Changeset 9839 for trunk/src/common/connection.py
- Timestamp:
- 06/25/08 11:25:43 (5 months ago)
- Files:
-
- 1 modified
-
trunk/src/common/connection.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/connection.py
r9836 r9839 812 812 if not self.connection: 813 813 return 814 if not self.privacy_rules_supported: 815 self.dispatch('STATUS', gajim.SHOW_LIST[self.connected]) 816 self.dispatch('ERROR', (_('Invisibility not supported'), 817 _('Account %s doesn\'t support invisibility.') % self.name)) 818 return 814 819 # If we are already connected, and privacy rules are supported, send 815 820 # offline presence first as it's required by XEP-0126 … … 829 834 830 835 def _continue_invisible(self, con, iq_obj, msg, signed, initial): 831 ptype = ''832 show = ''833 836 if iq_obj.getType() == 'error': # server doesn't support privacy lists 834 # We use the old way which is not xmpp complient 835 ptype = 'invisible' 836 show = 'invisible' 837 else: 838 # active the privacy rule 839 self.privacy_rules_supported = True 840 self.activate_privacy_rule('invisible') 841 priority = unicode(gajim.get_priority(self.name, show)) 842 p = common.xmpp.Presence(typ = ptype, priority = priority, show = show) 843 p = self.add_sha(p, ptype != 'unavailable') 837 return 838 # active the privacy rule 839 self.privacy_rules_supported = True 840 self.activate_privacy_rule('invisible') 841 self.connected = STATUS_LIST.index('invisible') 842 self.status = msg 843 priority = unicode(gajim.get_priority(self.name, 'invisible')) 844 p = common.xmpp.Presence(priority = priority) 845 p = self.add_sha(p, True) 844 846 if msg: 845 847 p.setStatus(msg) … … 954 956 if not auto and not show == 'offline': 955 957 sign_msg = True 956 self.status = msg 958 if show != 'invisible': 959 # We save it only when privacy list is accepted 960 self.status = msg 957 961 if show != 'offline' and self.connected < 1: 958 962 # set old_show to requested 'show' in case we need to … … 994 998 if self.connected == 1: 995 999 return 996 was_invisible = self.connected == STATUS_LIST.index('invisible')997 self.connected = STATUS_LIST.index(show)998 1000 if show == 'invisible': 999 1001 signed = self.get_signed_presence(msg) 1000 1002 self.send_invisible_presence(msg, signed) 1001 1003 return 1004 was_invisible = self.connected == STATUS_LIST.index('invisible') 1005 self.connected = STATUS_LIST.index(show) 1002 1006 if was_invisible and self.privacy_rules_supported: 1003 1007 iq = self.build_privacy_rule('visible', 'allow')
