From 0901a6db5314a37f0be477db7d6d99d828482ec5 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Wed, 16 Nov 2005 10:21:43 +0000 Subject: [PATCH] do not autojoin bookmarks if you are invisible --- src/gajim.py | 7 +++++-- src/roster_window.py | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gajim.py b/src/gajim.py index 76f8837c4..939fbd6b0 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -774,8 +774,11 @@ class Interface: # Auto join GC windows if neccessary for bm in bms: if bm['autojoin'] in ('1', 'true'): - self.roster.join_gc_room(account, bm['jid'], bm['nick'], - bm['password']) + invisible_show = gajim.SHOW_LIST.index('invisible') + # do not autojoin if we are invisible + if gajim.connections[account].connected != invisible_show: + self.roster.join_gc_room(account, bm['jid'], bm['nick'], + bm['password']) for account in gajim.connections: for room_jid in self.instances[account]['gc']: if room_jid == 'tabbed': diff --git a/src/roster_window.py b/src/roster_window.py index 4805f5df2..4423e541e 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -278,6 +278,8 @@ class RosterWindow: model[iter][C_SECPIXBUF] = scaled_pixbuf def join_gc_room(self, account, room_jid, nick, password): + '''joins the room immediatelly''' + print 'JOIN_GC_ROOM' if room_jid in gajim.interface.instances[account]['gc'] and \ gajim.gc_connected[account][room_jid]: dialogs.ErrorDialog(_('You are already in room %s') % room_jid @@ -1738,6 +1740,7 @@ _('If "%s" accepts this request you will know his or her status.') %jid) dialogs.AddNewContactWindow(account) def on_join_gc_activate(self, widget, account): + '''when the join gc menuitem is clicked, show the join gc window''' invisible_show = gajim.SHOW_LIST.index('invisible') if gajim.connections[account].connected == invisible_show: dialogs.ErrorDialog(_('You cannot join a room while you are invisible') @@ -2598,7 +2601,6 @@ _('If "%s" accepts this request you will know his or her status.') %jid) col.add_attribute(render_text, 'markup', C_NAME) # where we hold the name col.add_attribute(render_text, 'editable', C_EDITABLE) # where we hold if the row is editable col.set_cell_data_func(render_text, self.nameCellDataFunc, None) - render_pixbuf = gtk.CellRendererPixbuf() # tls or avatar img col.pack_start(render_pixbuf, expand = False)