XEP-0004: Remove deprecated getXML() and fromXML() methods.
This commit is contained in:
parent
0edeefd977
commit
b8e091233e
3 changed files with 5 additions and 17 deletions
|
@ -81,18 +81,6 @@ class Form(ElementBase):
|
|||
self.append(field)
|
||||
return field
|
||||
|
||||
def getXML(self, type='submit'):
|
||||
self['type'] = type
|
||||
log.warning("Form.getXML() is deprecated API compatibility " + \
|
||||
"with plugins/old_0004.py")
|
||||
return self.xml
|
||||
|
||||
def fromXML(self, xml):
|
||||
log.warning("Form.fromXML() is deprecated API compatibility " + \
|
||||
"with plugins/old_0004.py")
|
||||
n = Form(xml=xml)
|
||||
return n
|
||||
|
||||
def add_item(self, values):
|
||||
itemXML = ET.Element('{%s}item' % self.namespace)
|
||||
self.xml.append(itemXML)
|
||||
|
|
|
@ -222,7 +222,7 @@ class XEP_0045(BasePlugin):
|
|||
if ifrom is not None:
|
||||
iq['from'] = ifrom
|
||||
query = ET.Element('{http://jabber.org/protocol/muc#owner}query')
|
||||
form = form.getXML('submit')
|
||||
form['type'] = 'submit'
|
||||
query.append(form)
|
||||
iq.append(query)
|
||||
# For now, swallow errors to preserve existing API
|
||||
|
@ -373,8 +373,8 @@ class XEP_0045(BasePlugin):
|
|||
|
||||
def setRoomConfig(self, room, config, ifrom=''):
|
||||
query = ET.Element('{http://jabber.org/protocol/muc#owner}query')
|
||||
x = config.getXML('submit')
|
||||
query.append(x)
|
||||
config['type'] = 'submit'
|
||||
query.append(config)
|
||||
iq = self.xmpp.make_iq_set(query)
|
||||
iq['to'] = room
|
||||
iq['from'] = ifrom
|
||||
|
|
|
@ -206,7 +206,7 @@ class Options(ElementBase):
|
|||
return form
|
||||
|
||||
def set_options(self, value):
|
||||
self.xml.append(value.getXML())
|
||||
self.xml.append(value)
|
||||
return self
|
||||
|
||||
def del_options(self):
|
||||
|
@ -238,7 +238,7 @@ class PublishOptions(ElementBase):
|
|||
if value is None:
|
||||
self.del_publish_options()
|
||||
else:
|
||||
self.xml.append(value.getXML())
|
||||
self.xml.append(value)
|
||||
return self
|
||||
|
||||
def del_publish_options(self):
|
||||
|
|
Loading…
Reference in a new issue