From 3330f7bfa50a46dfda4d14bece36b14f81164832 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 21 Oct 2009 19:39:43 +0200 Subject: [PATCH] enable music track listener only after we signed it. Fixes #5351 --- src/common/connection_handlers.py | 7 ------- src/gajim.py | 10 ++++------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index f522ab6fc..c9d02b194 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -897,13 +897,6 @@ class ConnectionDisco: if identity['category'] == 'pubsub' and identity.get('type') == \ 'pep': self.pep_supported = True - if dbus_support.supported: - listener = MusicTrackListener.get() - track = listener.get_playing_track() - if gajim.config.get_per('accounts', self.name, - 'publish_tune'): - gajim.interface.music_track_changed(listener, track, - self.name) break if features.__contains__(common.xmpp.NS_VCARD): self.vcard_supported = True diff --git a/src/gajim.py b/src/gajim.py index 32f07389e..b488bf68c 100644 --- a/src/gajim.py +++ b/src/gajim.py @@ -1942,6 +1942,10 @@ class Interface: nick = gc_control.nick password = gajim.gc_passwords.get(room_jid, '') gajim.connections[account].join_gc(nick, room_jid, password) + # send currently played music + if gajim.connections[account].pep_supported and dbus_support.supported \ + and gajim.config.get_per('accounts', account, 'publish_tune'): + self.enable_music_listener() def handle_event_metacontacts(self, account, tags_list): gajim.contacts.define_metacontacts(account, tags_list) @@ -3402,12 +3406,6 @@ class Interface: pass gobject.timeout_add_seconds(5, remote_init) - for account in gajim.connections: - if gajim.config.get_per('accounts', account, 'publish_tune') and \ - dbus_support.supported: - self.enable_music_listener() - break - def __init__(self): gajim.interface = self gajim.thread_interface = ThreadInterface