Changeset 9884
- Timestamp:
- 07/05/08 08:33:49 (5 months ago)
- Location:
- trunk/src
- Files:
-
- 2 modified
-
common/contacts.py (modified) (2 diffs)
-
roster_window.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/contacts.py
r9883 r9884 327 327 # do not count transports 328 328 continue 329 if self.has_brother(account, jid ) and not \330 self.is_big_brother(account, jid ):329 if self.has_brother(account, jid, accounts) and not \ 330 self.is_big_brother(account, jid, accounts): 331 331 # count metacontacts only once 332 332 continue … … 403 403 break 404 404 405 def has_brother(self, account, jid ):405 def has_brother(self, account, jid, accounts): 406 406 tag = self.get_metacontacts_tag(account, jid) 407 407 if not tag: 408 408 return False 409 meta_jids = self.get_metacontacts_jids(tag )409 meta_jids = self.get_metacontacts_jids(tag, accounts) 410 410 return len(meta_jids) > 1 or len(meta_jids[account]) > 1 411 411 412 def is_big_brother(self, account, jid ):412 def is_big_brother(self, account, jid, accounts): 413 413 family = self.get_metacontacts_family(account, jid) 414 414 if family: 415 bb_data = self.get_metacontacts_big_brother(family) 415 nearby_family = [data for data in family 416 if account in accounts] 417 bb_data = self.get_metacontacts_big_brother(nearby_family) 416 418 if bb_data['jid'] == jid and bb_data['account'] == account: 417 419 return True 418 420 return False 419 421 420 def get_metacontacts_jids(self, tag ):422 def get_metacontacts_jids(self, tag, accounts): 421 423 '''Returns all jid for the given tag in the form {acct: [jid1, jid2],.}''' 422 424 answers = {} 423 425 for account in self._metacontacts_tags: 424 426 if tag in self._metacontacts_tags[account]: 427 if account not in accounts: 428 continue 425 429 answers[account] = [] 426 430 for data in self._metacontacts_tags[account][tag]: -
trunk/src/roster_window.py
r9883 r9884 3786 3786 3787 3787 # Is the contact we drag a meta contact? 3788 is_big_brother = gajim.contacts.is_big_brother(account_source, jid_source) 3788 accounts = (self.regroup and gajim.contacts.get_accounts()) or account_source 3789 is_big_brother = gajim.contacts.is_big_brother(account_source, jid_source, accounts) 3789 3790 3790 3791 # Contact drop on group row or between two contacts
