comparison src/core/sat_main.py @ 1355:33a21f06551d frontends_multi_profiles

core: fixes bug introduced by 1262 (f8a8434dbac7) in SAT.delContact
author souliane <souliane@mailoo.org>
date Fri, 06 Mar 2015 16:06:38 +0100
parents 49f967fc87aa
children ba87b940f07a
comparison
equal deleted inserted replaced
1354:14fc88275e65 1355:33a21f06551d
636 636
637 def delContact(self, to_jid, profile_key): 637 def delContact(self, to_jid, profile_key):
638 """Remove contact from roster list""" 638 """Remove contact from roster list"""
639 profile = self.memory.getProfileName(profile_key) 639 profile = self.memory.getProfileName(profile_key)
640 assert profile 640 assert profile
641 d1 = self.profiles[profile].roster.removeItem(to_jid) 641 self.profiles[profile].presence.unsubscribe(to_jid) # is not asynchronous
642 d2 = self.profiles[profile].presence.unsubscribe(to_jid) 642 return self.profiles[profile].roster.removeItem(to_jid)
643 d_list = defer.DeferredList([d1, d2])
644 def check_result(list_result):
645 for success, value in list_result:
646 if not success:
647 raise value
648 d_list.addCallback(check_result)
649 return d_list
650 643
651 ## Discovery ## 644 ## Discovery ##
652 # discovery methods are shortcuts to self.memory.disco 645 # discovery methods are shortcuts to self.memory.disco
653 # the main difference with client.disco is that self.memory.disco manage cache 646 # the main difference with client.disco is that self.memory.disco manage cache
654 647