Mercurial > libervia-web
diff libervia.tac @ 137:b145da69a218
server + browser side: new api fix
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 22 Oct 2012 00:08:41 +0200 |
parents | ceef355156de |
children | 09a512d9a0c0 |
line wrap: on
line diff
--- a/libervia.tac Thu Aug 02 01:10:04 2012 +0200 +++ b/libervia.tac Mon Oct 22 00:08:41 2012 +0200 @@ -252,8 +252,8 @@ for line in result_dbus: #XXX: we have to do this stupid thing because Python D-Bus use its own types instead of standard types # and txJsonRPC doesn't accept D-Bus types, resulting in a empty query - timestamp, from_jid, to_jid, message = line - result.append((float(timestamp), unicode(from_jid), unicode(to_jid), unicode(message))) + timestamp, from_jid, to_jid, message, mess_type = line + result.append((float(timestamp), unicode(from_jid), unicode(to_jid), unicode(message), unicode(mess_type))) return result d.addCallback(show) return d @@ -304,12 +304,13 @@ profile = ISATSession(self.session).profile self.sat_host.bridge.radiocolLaunch(invited, profile) - 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""" + def jsonrpc_getEntityData(self, jid, keys): + """Get cached data for an entit + @param jid: jid of contact from who we want data + @param keys: name of data we want (list) + @return: requested data""" profile = ISATSession(self.session).profile - return self.sat_host.bridge.getCardCache(jid, profile) + return self.sat_host.bridge.getEntityData(jid, keys, profile) class Register(jsonrpc.JSONRPC): """This class manage the registration procedure with SàT @@ -691,7 +692,7 @@ self.bridge.register("connectionError", self.signal_handler.connectionError) self.bridge.register("actionResult", self.action_handler.actionResultCb) #core - for signal_name in ['presenceUpdate', 'newMessage', 'subscribe', 'contactDeleted', 'newContact', 'updatedValue']: + for signal_name in ['presenceUpdate', 'newMessage', 'subscribe', 'contactDeleted', 'newContact', 'entityDataUpdated']: self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name)) #plugins for signal_name in ['personalEvent', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted', 'tarotGameNew', 'tarotGameChooseContrat',