Changeset 36:f2953cadca90 in ralphm-patches for roster_server.patch
- Timestamp:
- Feb 12, 2010, 8:07:12 PM (11 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roster_server.patch
r34 r36 1 diff -r 09858bbc7f56wokkel/xmppim.py2 --- a/wokkel/xmppim.py Fri Feb 12 09:37:282010 +01003 +++ b/wokkel/xmppim.py Fri Feb 12 09:40:152010 +01001 diff -r 7b9f484b0b44 wokkel/xmppim.py 2 --- a/wokkel/xmppim.py Fri Feb 12 19:49:36 2010 +0100 3 +++ b/wokkel/xmppim.py Fri Feb 12 19:53:42 2010 +0100 4 4 @@ -12,6 +12,7 @@ 5 5 All of it should eventually move to Twisted. … … 20 20 def __init__(self, to=None, type=None): 21 21 domish.Element.__init__(self, (None, "presence")) 22 @@ -6 05,6 +609,7 @@23 self.groups = set()22 @@ -636,6 +640,7 @@ 23 24 24 25 25 … … 28 28 """ 29 29 Client side XMPP roster protocol. 30 @@ -6 14,6 +619,7 @@30 @@ -645,6 +650,7 @@ 31 31 ROSTER_SET = "/iq[@type='set']/query[@xmlns='%s']" % NS_ROSTER 32 32 self.xmlstream.addObserver(ROSTER_SET, self._onRosterSet) … … 36 36 jid = JID(element['jid']) 37 37 item = RosterItem(jid) 38 @@ -6 28,6 +634,7 @@38 @@ -659,6 +665,7 @@ 39 39 40 40 return item … … 44 44 """ 45 45 Retrieve contact list. 46 @@ - 683,6 +690,7 @@46 @@ -713,6 +720,7 @@ 47 47 item = self._parseRosterItem(iq.query.item) 48 48 self.onRosterSet(item) … … 52 52 """ 53 53 Called when a roster push for a new or update item was received. 54 @@ - 691,6 +699,7 @@54 @@ -721,6 +729,7 @@ 55 55 @type item: L{RosterItem} 56 56 """ … … 60 60 """ 61 61 Called when a roster push for the removal of an item was received. 62 @@ - 699,6 +708,57@@62 @@ -729,6 +738,48 @@ 63 63 @type entity: L{JID} 64 64 """ … … 76 76 + 77 77 + 78 + def _toRosterReply(self, items, iq):78 + def _toRosterReply(self, roster, iq): 79 79 + response = xmlstream.toResponse(iq, 'result') 80 80 + response.addElement((NS_ROSTER, 'query')) 81 81 + 82 + for item in items: 83 + element = response.query.addElement('item') 84 + element['jid'] = item['jid'] 85 + if item['name']: 86 + element['name'] = item['name'] 87 + element['subscription'] = item['subscription'] 88 + if item['ask']: 89 + element['ask'] = item['ask'] 90 + 91 + for group in item['groups']: 92 + element.addElement('group', content=group) 82 + for item in roster: 83 + response.query.addChild(item.toElement()) 93 84 + 94 85 + return response
Note: See TracChangeset
for help on using the changeset viewer.