comparison libervia.tac @ 268:79970bf6af93

browser_side: added class RoomAndContactsChooser: - unified UI for all the MUC menu items callbacks to join a room, invite people and start a game
author souliane <souliane@mailoo.org>
date Sun, 17 Nov 2013 17:57:14 +0100
parents cc778206b7ae
children a763b2ac5d41
comparison
equal deleted inserted replaced
267:a76243c02074 268:79970bf6af93
356 def jsonrpc_getRoomsJoined(self): 356 def jsonrpc_getRoomsJoined(self):
357 """Return list of room already joined by user""" 357 """Return list of room already joined by user"""
358 profile = ISATSession(self.session).profile 358 profile = ISATSession(self.session).profile
359 return self.sat_host.bridge.getRoomsJoined(profile) 359 return self.sat_host.bridge.getRoomsJoined(profile)
360 360
361 def jsonrpc_launchTarotGame(self, other_players): 361 def jsonrpc_launchTarotGame(self, other_players, room_jid=""):
362 """Create a room, invite the other players and start a Tarot game""" 362 """Create a room, invite the other players and start a Tarot game
363 profile = ISATSession(self.session).profile 363 @param room_jid: leave empty string to generate a unique room name
364 self.sat_host.bridge.tarotGameLaunch(other_players, profile) 364 """
365 profile = ISATSession(self.session).profile
366 try:
367 if room_jid != "":
368 room_jid = JID(room_jid).userhost()
369 except:
370 warning('Invalid room jid')
371 return
372 self.sat_host.bridge.tarotGameLaunch(other_players, room_jid, profile)
365 373
366 def jsonrpc_getTarotCardsPaths(self): 374 def jsonrpc_getTarotCardsPaths(self):
367 """Give the path of all the tarot cards""" 375 """Give the path of all the tarot cards"""
368 _join = os.path.join 376 _join = os.path.join
369 _media_dir = _join(self.sat_host.media_dir,'') 377 _media_dir = _join(self.sat_host.media_dir,'')
382 def jsonrpc_tarotGamePlayCards(self, player_nick, referee, cards): 390 def jsonrpc_tarotGamePlayCards(self, player_nick, referee, cards):
383 """Tell to the server the cards we want to put on the table""" 391 """Tell to the server the cards we want to put on the table"""
384 profile = ISATSession(self.session).profile 392 profile = ISATSession(self.session).profile
385 self.sat_host.bridge.tarotGamePlayCards(player_nick, referee, cards, profile) 393 self.sat_host.bridge.tarotGamePlayCards(player_nick, referee, cards, profile)
386 394
387 def jsonrpc_launchRadioCollective(self, invited): 395 def jsonrpc_launchRadioCollective(self, invited, room_jid=""):
388 """Create a room, invite people, and start a radio collective""" 396 """Create a room, invite people, and start a radio collective
389 profile = ISATSession(self.session).profile 397 @param room_jid: leave empty string to generate a unique room name
390 self.sat_host.bridge.radiocolLaunch(invited, profile) 398 """
399 profile = ISATSession(self.session).profile
400 try:
401 if room_jid != "":
402 room_jid = JID(room_jid).userhost()
403 except:
404 warning('Invalid room jid')
405 return
406 self.sat_host.bridge.radiocolLaunch(invited, room_jid, profile)
391 407
392 def jsonrpc_getEntityData(self, jid, keys): 408 def jsonrpc_getEntityData(self, jid, keys):
393 """Get cached data for an entit 409 """Get cached data for an entit
394 @param jid: jid of contact from who we want data 410 @param jid: jid of contact from who we want data
395 @param keys: name of data we want (list) 411 @param keys: name of data we want (list)