From 62b190d0ff61541d35f3b9f30c44a58ce20af014 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 16 Dec 2010 18:14:33 -0500 Subject: [PATCH] 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. --- sleekxmpp/plugins/xep_0045.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sleekxmpp/plugins/xep_0045.py b/sleekxmpp/plugins/xep_0045.py index d5fbf00..feec70d 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):