diff --git a/src/gajim.py b/src/gajim.py index 9b8ecb4b2..fea128474 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -230,16 +230,20 @@ class Interface: def allow_notif(self, account): gajim.allow_notifications[account] = True + def handle_event_status(self, account, status): # OUR status #('STATUS', account, status) - if status != 'offline': - gobject.timeout_add(30000, self.allow_notif, account) - else: + model = self.roster.status_combobox.get_model() + if status == 'offline': + model[self.roster.status_message_menuitem_iter][3] = False # sensitivity for this menuitem gajim.allow_notifications[account] = False # we are disconnected from all gc for room_jid in gajim.gc_connected[account]: if self.windows[account]['gc'].has_key(room_jid): self.windows[account]['gc'][room_jid].got_disconnected(room_jid) + else: + gobject.timeout_add(30000, self.allow_notif, account) + model[self.roster.status_message_menuitem_iter][3] = True # sensitivity for this menuitem self.roster.on_status_changed(account, status) if self.remote and self.remote.is_enabled(): self.remote.raise_signal('AccountPresence', (status, account)) @@ -262,11 +266,11 @@ class Interface: resource = '' priority = array[4] if jid.find('@') <= 0: - #It must be an agent + # It must be an agent ji = jid.replace('@', '') else: ji = jid - #Update user + # Update contact if gajim.contacts[account].has_key(ji): luser = gajim.contacts[account][ji] user1 = None @@ -318,17 +322,17 @@ class Interface: user1.priority = priority user1.keyID = keyID if jid.find('@') <= 0: - #It must be an agent + # It must be an agent if gajim.contacts[account].has_key(ji): - #Update existing iter + # Update existing iter self.roster.draw_contact(ji, account) elif jid == gajim.get_jid_from_account(account): - #It's another of our resources. We don't need to see that! + # It's another of our resources. We don't need to see that! return elif gajim.contacts[account].has_key(ji): - #It isn't an agent + # It isn't an agent self.roster.chg_contact_status(user1, array[1], array[2], account) - #play sound + # play sound if old_show < 2 and new_show > 1: if gajim.config.get_per('soundevents', 'contact_connected', 'enabled'): diff --git a/src/roster_window.py b/src/roster_window.py index 721f50c61..213cff1a7 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1437,7 +1437,7 @@ _('If "%s" accepts this request you will know his status.') %jid) if not gajim.config.get_per('accounts', acct, 'sync_with_global_status'): continue - # We're going ti change our status to invisible + # We're going to change our status to invisible if self.connected_rooms(acct): bug_user = True break @@ -1454,22 +1454,19 @@ _('If "%s" accepts this request you will know his status.') %jid) for acct in accounts: if not gajim.config.get_per('accounts', acct, 'sync_with_global_status'): continue - # FIXME: not here why? + # we are connected or we want to connect if not one_connected or gajim.connections[acct].connected > 1: self.send_status(acct, status, message) - - model = self.status_combobox.get_model() - model[self.status_message_menuitem_iter][3] = True # sensitivity for this menuitem def update_status_comboxbox(self): - #table to change index in plugin.connected to index in combobox + # table to change index in plugin.connected to index in combobox table = {0:9, 1:9, 2:0, 3:1, 4:2, 5:3, 6:4, 7:5} maxi = 0 for account in gajim.connections: if gajim.connections[account].connected > maxi: maxi = gajim.connections[account].connected - #temporarily block signal in order not to send status that we show - #in the combobox + # temporarily block signal in order not to send status that we show + # in the combobox self.status_combobox.handler_block(self.id_signal_cb) self.status_combobox.set_active(table[maxi]) self.status_combobox.handler_unblock(self.id_signal_cb) @@ -1645,7 +1642,7 @@ _('If "%s" accepts this request you will know his status.') %jid) if self.plugin.windows[account].has_key('join_gc'): self.plugin.windows[account]['join_gc'].window.present() else: - #FIXME: Why this try/except? + # c http://nkour.blogspot.com/2005/05/pythons-init-return-none-doesnt-return.html try: self.plugin.windows[account]['join_gc'] = dialogs.JoinGroupchatWindow(self.plugin, account) except RuntimeError: @@ -1938,6 +1935,7 @@ _('If "%s" accepts this request you will know his status.') %jid) if self.plugin.windows[account].has_key('disco'): self.plugin.windows[account]['disco'].window.present() else: + # c http://nkour.blogspot.com/2005/05/pythons-init-return-none-doesnt-return.html try: self.plugin.windows[account]['disco'] = \ config.ServiceDiscoveryWindow(self.plugin, account)