diff options
author | Nathan Fritz <fritzy@netflint.net> | 2010-01-25 10:40:50 -0800 |
---|---|---|
committer | Nathan Fritz <fritzy@netflint.net> | 2010-01-25 10:40:50 -0800 |
commit | 65dd83d4e174fc5f88ea90b32dd9e3ebf1787294 (patch) | |
tree | 9710ceeebb74d49c6ae1926bae7be5188c4a9066 /sleekxmpp/plugins | |
parent | 6e4c1128ec8f01d31c7714c13db02ff20c7a0a40 (diff) | |
parent | 6b130eb94775da8675750a0a9aed75fa6f328137 (diff) | |
download | slixmpp-65dd83d4e174fc5f88ea90b32dd9e3ebf1787294.tar.gz slixmpp-65dd83d4e174fc5f88ea90b32dd9e3ebf1787294.tar.bz2 slixmpp-65dd83d4e174fc5f88ea90b32dd9e3ebf1787294.tar.xz slixmpp-65dd83d4e174fc5f88ea90b32dd9e3ebf1787294.zip |
Merge branch 'master' of github.com:fritzy/SleekXMPP
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r-- | sleekxmpp/plugins/stanza_pubsub.py | 5 | ||||
-rw-r--r-- | sleekxmpp/plugins/xep_0030.py | 6 | ||||
-rw-r--r-- | sleekxmpp/plugins/xep_0045.py | 7 | ||||
-rw-r--r-- | sleekxmpp/plugins/xep_0050.py | 3 |
4 files changed, 14 insertions, 7 deletions
diff --git a/sleekxmpp/plugins/stanza_pubsub.py b/sleekxmpp/plugins/stanza_pubsub.py index 900f3c82..58f9c896 100644 --- a/sleekxmpp/plugins/stanza_pubsub.py +++ b/sleekxmpp/plugins/stanza_pubsub.py @@ -58,7 +58,7 @@ class Subscription(ElementBase): namespace = 'http://jabber.org/protocol/pubsub' name = 'subscription' plugin_attrib = name - interfaces = set(('jid', 'node', 'subscription')) + interfaces = set(('jid', 'node', 'subscription', 'subid')) plugin_attrib_map = {} plugin_tag_map = {} @@ -207,9 +207,10 @@ class Publish(Items): namespace = 'http://jabber.org/protocol/pubsub' name = 'publish' plugin_attrib = name - interfaces = set(('node')) + interfaces = set(('node',)) plugin_attrib_map = {} plugin_tag_map = {} + subitem = Item stanzaPlugin(Pubsub, Publish) diff --git a/sleekxmpp/plugins/xep_0030.py b/sleekxmpp/plugins/xep_0030.py index 791038cd..bff0dc17 100644 --- a/sleekxmpp/plugins/xep_0030.py +++ b/sleekxmpp/plugins/xep_0030.py @@ -53,7 +53,7 @@ class xep_0030(base.base_plugin): def info_handler(self, xml): logging.debug("Info request from %s" % xml.get('from', '')) iq = self.xmpp.makeIqResult(xml.get('id', self.xmpp.getNewId())) - iq.attrib['from'] = self.xmpp.fulljid + iq.attrib['from'] = xml.get('to') iq.attrib['to'] = xml.get('from', self.xmpp.server) query = xml.find('{http://jabber.org/protocol/disco#info}query') node = query.get('node', 'main') @@ -74,7 +74,7 @@ class xep_0030(base.base_plugin): def item_handler(self, xml): logging.debug("Item request from %s" % xml.get('from', '')) iq = self.xmpp.makeIqResult(xml.get('id', self.xmpp.getNewId())) - iq.attrib['from'] = self.xmpp.fulljid + iq.attrib['from'] = xml.get('to') iq.attrib['to'] = xml.get('from', self.xmpp.server) query = self.xmpp.makeIqQuery(iq, 'http://jabber.org/protocol/disco#items').find('{http://jabber.org/protocol/disco#items}query') node = xml.find('{http://jabber.org/protocol/disco#items}query').get('node', 'main') @@ -82,7 +82,7 @@ class xep_0030(base.base_plugin): itemxml = ET.Element('item') itemxml.attrib = item if itemxml.attrib['jid'] is None: - itemxml.attrib['jid'] = self.xmpp.fulljid + itemxml.attrib['jid'] = xml.get('to') query.append(itemxml) self.xmpp.send(iq) diff --git a/sleekxmpp/plugins/xep_0045.py b/sleekxmpp/plugins/xep_0045.py index 4b181f99..82737421 100644 --- a/sleekxmpp/plugins/xep_0045.py +++ b/sleekxmpp/plugins/xep_0045.py @@ -223,12 +223,15 @@ class xep_0045(base.base_plugin): return False return True - def setAffiliation(self, room, jid, affiliation='member'): + def setAffiliation(self, room, jid=None, nick=None, affiliation='member'): """ Change room affiliation.""" if affiliation not in ('outcast', 'member', 'admin', 'owner', 'none'): raise TypeError query = ET.Element('{http://jabber.org/protocol/muc#admin}query') - item = ET.Element('item', {'affiliation':affiliation, 'jid':jid}) + if nick is not None: + item = ET.Element('item', {'affiliation':affiliation, 'nick':nick}) + else: + item = ET.Element('item', {'affiliation':affiliation, 'jid':jid}) query.append(item) iq = self.xmpp.makeIqSet(query) iq['to'] = room diff --git a/sleekxmpp/plugins/xep_0050.py b/sleekxmpp/plugins/xep_0050.py index b75a675c..0ca66ddb 100644 --- a/sleekxmpp/plugins/xep_0050.py +++ b/sleekxmpp/plugins/xep_0050.py @@ -62,6 +62,7 @@ class xep_0050(base.base_plugin): name, form, pointer, multi = self.commands[node] self.sessions[sessionid] = {} self.sessions[sessionid]['jid'] = xml.get('from') + self.sessions[sessionid]['to'] = xml.get('to') self.sessions[sessionid]['past'] = [(form, None)] self.sessions[sessionid]['next'] = pointer npointer = pointer @@ -133,6 +134,8 @@ class xep_0050(base.base_plugin): command.append(xmlactions) if not sessionid: sessionid = self.getNewSession() + else: + iq.attrib['from'] = self.sessions[sessionid]['to'] command.attrib['sessionid'] = sessionid if form is not None: if hasattr(form,'getXML'): |