summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-12-16 18:14:33 -0500
committerLance Stout <lancestout@gmail.com>2010-12-16 18:14:33 -0500
commit62b190d0ff61541d35f3b9f30c44a58ce20af014 (patch)
tree730437ed52b306c1c49bd78464c64585a75958e7
parent4b57b8131f424c0b3fc0ad616e3c48322e3f7e6e (diff)
downloadslixmpp-62b190d0ff61541d35f3b9f30c44a58ce20af014.tar.gz
slixmpp-62b190d0ff61541d35f3b9f30c44a58ce20af014.tar.bz2
slixmpp-62b190d0ff61541d35f3b9f30c44a58ce20af014.tar.xz
slixmpp-62b190d0ff61541d35f3b9f30c44a58ce20af014.zip
Fixed specifying 'from' values in XEP-0045 plugin.
Methods now accept either an ifrom or mfrom parameter to specify a 'from' value. Client connections should not need to use these, but component connections must use them.
-rw-r--r--sleekxmpp/plugins/xep_0045.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/sleekxmpp/plugins/xep_0045.py b/sleekxmpp/plugins/xep_0045.py
index d5fbf003..feec70db 100644
--- a/sleekxmpp/plugins/xep_0045.py
+++ b/sleekxmpp/plugins/xep_0045.py
@@ -276,10 +276,10 @@ class xep_0045(base.base_plugin):
raise ValueError
return True
- def invite(self, room, jid, reason=''):
+ def invite(self, room, jid, reason='', mfrom=''):
""" Invite a jid to a room."""
msg = self.xmpp.makeMessage(room)
- msg['from'] = self.xmpp.boundjid.bare
+ msg['from'] = mfrom
x = ET.Element('{http://jabber.org/protocol/muc#user}x')
invite = ET.Element('{http://jabber.org/protocol/muc#user}invite', {'to': jid})
if reason:
@@ -299,10 +299,10 @@ class xep_0045(base.base_plugin):
self.xmpp.sendPresence(pshow='unavailable', pto="%s/%s" % (room, nick))
del self.rooms[room]
- def getRoomConfig(self, room):
+ def getRoomConfig(self, room, ifrom=''):
iq = self.xmpp.makeIqGet('http://jabber.org/protocol/muc#owner')
iq['to'] = room
- iq['from'] = self.xmpp.boundjid.bare
+ iq['from'] = ifrom
result = iq.send()
if result is None or result['type'] != 'result':
raise ValueError
@@ -318,13 +318,13 @@ class xep_0045(base.base_plugin):
iq = self.xmpp.makeIqSet(query)
iq.send()
- def setRoomConfig(self, room, config):
+ def setRoomConfig(self, room, config, ifrom=''):
query = ET.Element('{http://jabber.org/protocol/muc#owner}query')
x = config.getXML('submit')
query.append(x)
iq = self.xmpp.makeIqSet(query)
iq['to'] = room
- iq['from'] = self.xmpp.boundjid.bare
+ iq['from'] = ifrom
iq.send()
def getJoinedRooms(self):