optimize the code
This commit is contained in:
parent
2493be0698
commit
df88db7209
1 changed files with 11 additions and 7 deletions
14
src/gajim.py
14
src/gajim.py
|
@ -772,13 +772,19 @@ class Interface:
|
||||||
# ('BOOKMARKS', account, [{name,jid,autojoin,password,nick}, {}])
|
# ('BOOKMARKS', account, [{name,jid,autojoin,password,nick}, {}])
|
||||||
# We received a bookmark item from the server (JEP48)
|
# We received a bookmark item from the server (JEP48)
|
||||||
# Auto join GC windows if neccessary
|
# Auto join GC windows if neccessary
|
||||||
for bm in bms:
|
|
||||||
if bm['autojoin'] in ('1', 'true'):
|
self.roster.make_menu() # update the menu to show our bookmarks
|
||||||
invisible_show = gajim.SHOW_LIST.index('invisible')
|
invisible_show = gajim.SHOW_LIST.index('invisible')
|
||||||
# do not autojoin if we are invisible
|
# do not autojoin if we are invisible
|
||||||
if gajim.connections[account].connected != invisible_show:
|
if gajim.connections[account].connected == invisible_show:
|
||||||
|
return
|
||||||
|
|
||||||
|
# check for autojoins
|
||||||
|
for bm in bms:
|
||||||
|
if bm['autojoin'] in ('1', 'true'):
|
||||||
self.roster.join_gc_room(account, bm['jid'], bm['nick'],
|
self.roster.join_gc_room(account, bm['jid'], bm['nick'],
|
||||||
bm['password'])
|
bm['password'])
|
||||||
|
# join already open groupchats # FIXME: why this happens here? nothing to do with BMs
|
||||||
for account in gajim.connections:
|
for account in gajim.connections:
|
||||||
for room_jid in self.instances[account]['gc']:
|
for room_jid in self.instances[account]['gc']:
|
||||||
if room_jid == 'tabbed':
|
if room_jid == 'tabbed':
|
||||||
|
@ -792,8 +798,6 @@ class Interface:
|
||||||
password = gajim.gc_passwords[room_jid]
|
password = gajim.gc_passwords[room_jid]
|
||||||
gajim.connections[account].join_gc(nick, room, server, password)
|
gajim.connections[account].join_gc(nick, room, server, password)
|
||||||
|
|
||||||
self.roster.make_menu()
|
|
||||||
|
|
||||||
def handle_event_file_send_error(self, account, array):
|
def handle_event_file_send_error(self, account, array):
|
||||||
jid = array[0]
|
jid = array[0]
|
||||||
file_props = array[1]
|
file_props = array[1]
|
||||||
|
|
Loading…
Add table
Reference in a new issue