enable music track listener only after we signed it. Fixes #5351

This commit is contained in:
Yann Leboulanger 2009-10-21 19:39:43 +02:00
parent 0aa8856b6c
commit 3330f7bfa5
2 changed files with 4 additions and 13 deletions

View File

@ -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

View File

@ -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