XEP-0004: Remove deprecated getXML() and fromXML() methods.

This commit is contained in:
Emmanuel Gil Peyrot 2016-09-20 16:34:48 +09:00
parent 0edeefd977
commit b8e091233e
3 changed files with 5 additions and 17 deletions

View file

@ -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)

View file

@ -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

View file

@ -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):