# HG changeset patch # User Goffi # Date 1309907359 -7200 # Node ID 2e2e10785c332fe65d3ae2ef31b80e535ceb8162 # Parent aff34642616bc169b162f98b13ea5023bdb58e1b server side: refactored signal according to SàT's bridge changes + getCardCache handling + updatedValue handling diff -r aff34642616b -r 2e2e10785c33 libervia.tac --- a/libervia.tac Tue Jul 05 14:06:03 2011 +0200 +++ b/libervia.tac Wed Jul 06 01:09:19 2011 +0200 @@ -263,13 +263,11 @@ profile = ISATSession(self.session).profile self.sat_host.bridge.tarotGamePlayCards(player_nick, referee, cards, profile) - def jsonrpc_getAvatar(self, jid): + def jsonrpc_getCardCache(self, jid): """Get the avatar of a contact @param jid: jid of contact from who we want the avatar @return: path to the avatar image""" - cache = self.bridge.getCardCache(jid) - if cache.has_key('avatar'): - return self.bridge.getAvatarFile(cache['avatar']) + return self.sat_host.bridge.getCardCache(jid) class Register(jsonrpc.JSONRPC): """This class manage the registration procedure with SàT @@ -609,11 +607,14 @@ sys.exit(1) self.bridge.register("connected", self.signal_handler.connected) self.bridge.register("connectionError", self.signal_handler.connectionError) - self.bridge.register("actionResult", self.action_handler.actionResultCb, "request") - for signal_name in ['presenceUpdate', 'personalEvent', 'newMessage', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted', 'tarotGameNew', - 'tarotGameChooseContrat', 'tarotGameShowCards', 'tarotGameInvalidCards', 'tarotGameCardsPlayed', 'tarotGameYourTurn', 'tarotGameScore', - 'subscribe', 'contactDeleted', 'newContact']: + self.bridge.register("actionResult", self.action_handler.actionResultCb) + #core + for signal_name in ['presenceUpdate', 'newMessage', 'subscribe', 'contactDeleted', 'newContact', 'updatedValue']: self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name)) + #plugins + for signal_name in ['personalEvent', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted', 'tarotGameNew', 'tarotGameChooseContrat', + 'tarotGameShowCards', 'tarotGameInvalidCards', 'tarotGameCardsPlayed', 'tarotGameYourTurn', 'tarotGameScore']: + self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name), "plugin") self.media_dir = self.bridge.getConfig('','media_dir') self.local_dir = self.bridge.getConfig('','local_dir') root.putChild('json_signal_api', self.signal_handler)