comparison libervia.py @ 122:397a88b340f3

browser: fixed call to getRoomsJoined
author Goffi <goffi@goffi.org>
date Sat, 10 Dec 2011 11:32:14 +0100
parents a8d11fdea090
children f9d63624699f
comparison
equal deleted inserted replaced
121:2d40b0f5fb37 122:397a88b340f3
75 75
76 class BridgeCall(LiberviaJsonProxy): 76 class BridgeCall(LiberviaJsonProxy):
77 def __init__(self): 77 def __init__(self):
78 LiberviaJsonProxy.__init__(self, "/json_api", 78 LiberviaJsonProxy.__init__(self, "/json_api",
79 ["getContacts", "addContact", "sendMessage", "sendMblog", "getMblogNodes", "getProfileJid", "getHistory", "getPresenceStatus", 79 ["getContacts", "addContact", "sendMessage", "sendMblog", "getMblogNodes", "getProfileJid", "getHistory", "getPresenceStatus",
80 "joinMUC", "getRoomJoined", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady", "tarotGameContratChoosed", 80 "joinMUC", "getRoomsJoined", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady", "tarotGameContratChoosed",
81 "tarotGamePlayCards", "getWaitingSub", "subscription", "delContact", "updateContact", "getCardCache"]) 81 "tarotGamePlayCards", "getWaitingSub", "subscription", "delContact", "updateContact", "getCardCache"])
82 82
83 class BridgeSignals(LiberviaJsonProxy): 83 class BridgeSignals(LiberviaJsonProxy):
84 def __init__(self, host): 84 def __init__(self, host):
85 self.host = host 85 self.host = host
253 def _getProfileJidCB(self, jid): 253 def _getProfileJidCB(self, jid):
254 self.whoami = JID(jid) 254 self.whoami = JID(jid)
255 #we can now ask our status 255 #we can now ask our status
256 self.bridge.call('getPresenceStatus', self._getPresenceStatusCb) 256 self.bridge.call('getPresenceStatus', self._getPresenceStatusCb)
257 #the rooms where we are 257 #the rooms where we are
258 self.bridge.call('getRoomJoined', self._getRoomJoinedCb) 258 self.bridge.call('getRoomsJoined', self._getRoomsJoinedCb)
259 #and if there is any subscription request waiting for us 259 #and if there is any subscription request waiting for us
260 self.bridge.call('getWaitingSub', self._getWaitingSubCb) 260 self.bridge.call('getWaitingSub', self._getWaitingSubCb)
261 261
262 ## Signals callbacks ## 262 ## Signals callbacks ##
263 263
357 for entity in presence_data: 357 for entity in presence_data:
358 for resource in presence_data[entity]: 358 for resource in presence_data[entity]:
359 args = presence_data[entity][resource] 359 args = presence_data[entity][resource]
360 self._presenceUpdateCb("%s/%s" % (entity, resource), *args) 360 self._presenceUpdateCb("%s/%s" % (entity, resource), *args)
361 361
362 def _getRoomJoinedCb(self, room_data): 362 def _getRoomsJoinedCb(self, room_data):
363 for room in room_data: 363 for room in room_data:
364 self._roomJoinedCb(*room) 364 self._roomJoinedCb(*room)
365 365
366 def _getWaitingSubCb(self, waiting_sub): 366 def _getWaitingSubCb(self, waiting_sub):
367 for sub in waiting_sub: 367 for sub in waiting_sub: