comparison libervia.py @ 427:b5b440e6ea16

server + browser side, getPresenceStatuses has been renamed
author Goffi <goffi@goffi.org>
date Mon, 31 Mar 2014 12:26:20 +0200
parents 77d8f55fc5f0
children bbdbee25123a
comparison
equal deleted inserted replaced
426:77d8f55fc5f0 427:b5b440e6ea16
117 class BridgeCall(LiberviaJsonProxy): 117 class BridgeCall(LiberviaJsonProxy):
118 def __init__(self): 118 def __init__(self):
119 LiberviaJsonProxy.__init__(self, "/json_api", 119 LiberviaJsonProxy.__init__(self, "/json_api",
120 ["getContacts", "addContact", "sendMessage", "sendMblog", "sendMblogComment", 120 ["getContacts", "addContact", "sendMessage", "sendMblog", "sendMblogComment",
121 "getLastMblogs", "getMassiveLastMblogs", "getMblogComments", "getProfileJid", 121 "getLastMblogs", "getMassiveLastMblogs", "getMblogComments", "getProfileJid",
122 "getHistory", "getPresenceStatus", "joinMUC", "mucLeave", "getRoomsJoined", 122 "getHistory", "getPresenceStatuses", "joinMUC", "mucLeave", "getRoomsJoined",
123 "inviteMUC", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady", 123 "inviteMUC", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady",
124 "tarotGamePlayCards", "launchRadioCollective", "getMblogs", "getMblogsWithComments", 124 "tarotGamePlayCards", "launchRadioCollective", "getMblogs", "getMblogsWithComments",
125 "getWaitingSub", "subscription", "delContact", "updateContact", "getCard", 125 "getWaitingSub", "subscription", "delContact", "updateContact", "getCard",
126 "getEntityData", "getParamsUI", "asyncGetParamA", "setParam", "launchAction", 126 "getEntityData", "getParamsUI", "asyncGetParamA", "setParam", "launchAction",
127 "disconnect", "chatStateComposing", "getNewAccountDomain", "confirmationAnswer", 127 "disconnect", "chatStateComposing", "getNewAccountDomain", "confirmationAnswer",
510 del self.init_cache 510 del self.init_cache
511 511
512 def _getProfileJidCB(self, jid): 512 def _getProfileJidCB(self, jid):
513 self.whoami = JID(jid) 513 self.whoami = JID(jid)
514 #we can now ask our status 514 #we can now ask our status
515 self.bridge.call('getPresenceStatus', self._getPresenceStatusCb) 515 self.bridge.call('getPresenceStatuses', self._getPresenceStatusesCb)
516 #the rooms where we are 516 #the rooms where we are
517 self.bridge.call('getRoomsJoined', self._getRoomsJoinedCb) 517 self.bridge.call('getRoomsJoined', self._getRoomsJoinedCb)
518 #and if there is any subscription request waiting for us 518 #and if there is any subscription request waiting for us
519 self.bridge.call('getWaitingSub', self._getWaitingSubCb) 519 self.bridge.call('getWaitingSub', self._getWaitingSubCb)
520 #we fill the panels already here 520 #we fill the panels already here
740 def _radioColGenericCb(self, event_name, room_jid_s, args): 740 def _radioColGenericCb(self, event_name, room_jid_s, args):
741 for lib_wid in self.libervia_widgets: 741 for lib_wid in self.libervia_widgets:
742 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s: 742 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s:
743 getattr(lib_wid.getGame("RadioCol"), event_name)(*args) 743 getattr(lib_wid.getGame("RadioCol"), event_name)(*args)
744 744
745 def _getPresenceStatusCb(self, presence_data): 745 def _getPresenceStatusesCb(self, presence_data):
746 for entity in presence_data: 746 for entity in presence_data:
747 for resource in presence_data[entity]: 747 for resource in presence_data[entity]:
748 args = presence_data[entity][resource] 748 args = presence_data[entity][resource]
749 self._presenceUpdateCb("%s/%s" % (entity, resource), *args) 749 self._presenceUpdateCb("%s/%s" % (entity, resource), *args)
750 750