From a38735cb2adabb75f110669d5425bf389cfc7ab7 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 2 Jun 2010 15:54:44 -0700 Subject: [PATCH 1/3] added very, very, very basic atom stanza --- sleekxmpp/stanza/atom.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sleekxmpp/stanza/atom.py diff --git a/sleekxmpp/stanza/atom.py b/sleekxmpp/stanza/atom.py new file mode 100644 index 0000000..5e82cb9 --- /dev/null +++ b/sleekxmpp/stanza/atom.py @@ -0,0 +1,11 @@ +from .. xmlstream.stanzabase import ElementBase, ET, JID +from xml.etree import cElementTree as ET + +class AtomEntry(ElementBase): + namespace = 'http://www.w3.org/2005/Atom' + name = 'entry' + plugin_attrib = 'entry' + interfaces = set(('title', 'summary')) + sub_interfaces = set(('title', 'summary')) + plugin_attrib_map = {} + plugin_tag_map = {} From bae082f4370c37c4aca0afc303b2d98b22582a34 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Thu, 15 Jul 2010 11:53:35 -0700 Subject: [PATCH 2/3] fixed updateRoster and delRosterItem --- sleekxmpp/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py index ccb4352..35df620 100644 --- a/sleekxmpp/__init__.py +++ b/sleekxmpp/__init__.py @@ -146,10 +146,17 @@ class ClientXMPP(basexmpp, XMLStream): def updateRoster(self, jid, name=None, subscription=None, groups=[]): """Add or change a roster item.""" iq = self.Iq().setValues({'type': 'set'}) - iq['roster'] = {jid: {'name': name, 'subscription': subscription, 'groups': groups}} + iq['roster']['items'] = {jid: {'name': name, 'subscription': subscription, 'groups': groups}} #self.send(iq, self.Iq().setValues({'id': iq['id']})) + return r = iq.send() return r['type'] == 'result' + + def delRosterItem(self, jid): + iq = self.Iq() + iq['type'] = 'set' + iq['roster']['items'] = {jid: {'subscription': 'remove'}} + return iq.send()['type'] == 'result' def getRoster(self): """Request the roster be sent.""" From 078c71ed3fd550812461795149f6ffca35397871 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Thu, 15 Jul 2010 14:25:10 -0700 Subject: [PATCH 3/3] accidental debugging return left in the code from last commit --- sleekxmpp/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py index 35df620..df0af09 100644 --- a/sleekxmpp/__init__.py +++ b/sleekxmpp/__init__.py @@ -148,7 +148,6 @@ class ClientXMPP(basexmpp, XMLStream): iq = self.Iq().setValues({'type': 'set'}) iq['roster']['items'] = {jid: {'name': name, 'subscription': subscription, 'groups': groups}} #self.send(iq, self.Iq().setValues({'id': iq['id']})) - return r = iq.send() return r['type'] == 'result'