Mercurial > libervia-backend
comparison sat.tac @ 187:12544ea2951f
Core: removed addItem for roster list, according to http://wokkel.ik.nu/ticket/56
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 18 Aug 2010 17:27:15 +0800 |
parents | 61f1e509e684 |
children | 92e4ddd580ae |
comparison
equal
deleted
inserted
replaced
186:33e618d385cf | 187:12544ea2951f |
---|---|
151 def removeItem(self, to): | 151 def removeItem(self, to): |
152 """Remove a contact from roster list""" | 152 """Remove a contact from roster list""" |
153 xmppim.RosterClientProtocol.removeItem(self, to) | 153 xmppim.RosterClientProtocol.removeItem(self, to) |
154 #TODO: check IQ result | 154 #TODO: check IQ result |
155 | 155 |
156 def addItem(self, to): | 156 #XXX: disabled (cf http://wokkel.ik.nu/ticket/56)) |
157 """Add a contact to roster list""" | 157 #def addItem(self, to): |
158 xmppim.RosterClientProtocol.addItem(self, to) | 158 #"""Add a contact to roster list""" |
159 #TODO: check IQ result | 159 #xmppim.RosterClientProtocol.addItem(self, to) |
160 #TODO: check IQ result""" | |
160 | 161 |
161 def onRosterSet(self, item): | 162 def onRosterSet(self, item): |
162 """Called when a new/update roster item is received""" | 163 """Called when a new/update roster item is received""" |
163 #TODO: send a signal to frontends | 164 #TODO: send a signal to frontends |
164 item_attr = {'to': str(item.subscriptionTo), | 165 item_attr = {'to': str(item.subscriptionTo), |
606 assert(profile) | 607 assert(profile) |
607 to_jid = jid.JID(to) if to else None | 608 to_jid = jid.JID(to) if to else None |
608 self.profiles[profile].presence.available(to_jid, show, statuses, priority) | 609 self.profiles[profile].presence.available(to_jid, show, statuses, priority) |
609 | 610 |
610 def subscription(self, subs_type, raw_jid, profile_key='@DEFAULT@'): | 611 def subscription(self, subs_type, raw_jid, profile_key='@DEFAULT@'): |
611 """Called to manage subscription""" | 612 """Called to manage subscription |
613 @param subs_type: subsciption type (cf RFC 3921) | |
614 @param raw_jid: unicode entity's jid | |
615 @param profile_key: profile""" | |
612 profile = self.memory.getProfileName(profile_key) | 616 profile = self.memory.getProfileName(profile_key) |
613 assert(profile) | 617 assert(profile) |
614 to_jid = jid.JID(raw_jid) | 618 to_jid = jid.JID(raw_jid) |
615 debug (_('subsciption request [%(subs_type)s] for %(jid)s') % {'subs_type':subs_type, 'jid':to_jid.full()}) | 619 debug (_('subsciption request [%(subs_type)s] for %(jid)s') % {'subs_type':subs_type, 'jid':to_jid.full()}) |
616 if subs_type=="subscribe": | 620 if subs_type=="subscribe": |
630 def addContact(self, to, profile_key='@DEFAULT@'): | 634 def addContact(self, to, profile_key='@DEFAULT@'): |
631 """Add a contact in roster list""" | 635 """Add a contact in roster list""" |
632 profile = self.memory.getProfileName(profile_key) | 636 profile = self.memory.getProfileName(profile_key) |
633 assert(profile) | 637 assert(profile) |
634 to_jid=jid.JID(to) | 638 to_jid=jid.JID(to) |
635 self.profiles[profile].roster.addItem(to_jid) | 639 #self.profiles[profile].roster.addItem(to_jid) XXX: disabled (cf http://wokkel.ik.nu/ticket/56)) |
636 self.profiles[profile].presence.subscribe(to_jid) | 640 self.profiles[profile].presence.subscribe(to_jid) |
637 | 641 |
638 def delContact(self, to, profile_key='@DEFAULT@'): | 642 def delContact(self, to, profile_key='@DEFAULT@'): |
639 """Remove contact from roster list""" | 643 """Remove contact from roster list""" |
640 profile = self.memory.getProfileName(profile_key) | 644 profile = self.memory.getProfileName(profile_key) |