comparison src/plugins/plugin_misc_room_game.py @ 941:c6d8fc63b1db

core, plugins: host.getClient now raise an exception instead of returning None when no profile is found, plugins have been adapted consequently and a bit cleaned
author Goffi <goffi@goffi.org>
date Fri, 28 Mar 2014 18:07:02 +0100
parents 1a759096ccbd
children e1842ebcb2f3
comparison
equal deleted inserted replaced
940:92e41e7c7e00 941:c6d8fc63b1db
425 user_jid = self.host.getJidNStream(profile)[0] 425 user_jid = self.host.getJidNStream(profile)[0]
426 d = self.host.plugins["XEP-0045"].join(JID(room_jid_s), user_jid.user, {}, profile) 426 d = self.host.plugins["XEP-0045"].join(JID(room_jid_s), user_jid.user, {}, profile)
427 d.addCallback(roomJoined) 427 d.addCallback(roomJoined)
428 428
429 client = self.host.getClient(profile) 429 client = self.host.getClient(profile)
430 if not client:
431 error(_('No client for this profile key: %s') % profile_key)
432 return
433 client.client_initialized.addCallback(lambda ignore: afterClientInit(room_jid_s)) 430 client.client_initialized.addCallback(lambda ignore: afterClientInit(room_jid_s))
434 431
435 def userJoinedTrigger(self, room, user, profile): 432 def userJoinedTrigger(self, room, user, profile):
436 """This trigger is used to check if the new user can take part of a game, 433 """This trigger is used to check if the new user can take part of a game,
437 create the game if we were waiting for him or just update the players list. 434 create the game if we were waiting for him or just update the players list.