Merge branch 'develop' of git://github.com/fritzy/SleekXMPP into develop

This commit is contained in:
Lance Stout 2010-07-19 04:02:28 -04:00
commit 1ef112966b
2 changed files with 18 additions and 1 deletions

View file

@ -146,11 +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']}))
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."""
iq = self.Iq().setValues({'type': 'get'}).enable('roster').send()

11
sleekxmpp/stanza/atom.py Normal file
View file

@ -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 = {}