Changeset 9839
- Timestamp:
- 06/25/08 11:25:43 (2 months ago)
- Location:
- trunk/src
- Files:
-
- 3 modified
-
common/connection_handlers.py (modified) (1 diff)
-
common/connection.py (modified) (4 diffs)
-
roster_window.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/connection_handlers.py
r9838 r9839 1102 1102 self.privacy_rules_supported = True 1103 1103 self.get_privacy_list('block') 1104 elif self.continue_connect_info: 1105 if self.continue_connect_info[0] == 'invisible': 1106 # Trying to login as invisible but privacy list not supported 1107 self.disconnect(on_purpose=True) 1108 self.dispatch('STATUS', 'offline') 1109 self.dispatch('ERROR', (_('Invisibility not supported'), 1110 _('Account %s doesn\'t support invisibility.') % self.name)) 1111 return 1104 1112 # Ask metacontacts before roster 1105 1113 self.get_metacontacts() -
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') -
trunk/src/roster_window.py
r9835 r9839 4451 4451 item.set_image(icon) 4452 4452 sub_menu.append(item) 4453 item.connect('activate', self.change_status, account, show) 4453 con = gajim.connections[account] 4454 if show == 'invisible' and con.connected > 1 and \ 4455 not con.privacy_rules_supported: 4456 item.set_sensitive(False) 4457 else: 4458 item.connect('activate', self.change_status, account, show) 4454 4459 4455 4460 item = gtk.SeparatorMenuItem()
