diff src/server/server.py @ 689:a6adefddcb0a

browser and server side: complete changeset 669 (a8fddccf5b84) about joining MUC: - TODO: some issues remain when a MUC is already joined and you enter a "short" name (JID node) in the dialog
author souliane <souliane@mailoo.org>
date Thu, 02 Apr 2015 00:36:08 +0200
parents 9877607c719a
children 7a9c7b9f6a28
line wrap: on
line diff
--- a/src/server/server.py	Wed Apr 01 22:04:17 2015 +0200
+++ b/src/server/server.py	Thu Apr 02 00:36:08 2015 +0200
@@ -392,20 +392,21 @@
 
     def jsonrpc_joinMUC(self, room_jid, nick):
         """Join a Multi-User Chat room
-        @room_jid: leave empty string to generate a unique name
+
+        @param room_jid (unicode): room JID or empty string to generate a unique name
+        @param nick (unicode): user nick
         """
         profile = ISATSession(self.session).profile
         d = self.asyncBridgeCall("joinMUC", room_jid, nick, {}, profile)
         return d
 
     def jsonrpc_inviteMUC(self, contact_jid, room_jid):
-        """Invite a user to a Multi-User Chat room"""
+        """Invite a user to a Multi-User Chat room
+
+        @param contact_jid (unicode): contact to invite
+        @param room_jid (unicode): room JID or empty string to generate a unique name
+        """
         profile = ISATSession(self.session).profile
-        try:
-            room_jid = JID(room_jid).userhost()
-        except:
-            log.warning('Invalid room jid')
-            return
         room_id = room_jid.split("@")[0]
         service = room_jid.split("@")[1]
         self.sat_host.bridge.inviteMUC(contact_jid, service, room_id, {}, profile)
@@ -431,16 +432,12 @@
         return self.sat_host.bridge.getRoomsSubjects(profile)
 
     def jsonrpc_launchTarotGame(self, other_players, room_jid=""):
-        """Create a room, invite the other players and start a Tarot game
-        @param room_jid: leave empty string to generate a unique room name
+        """Create a room, invite the other players and start a Tarot game.
+
+        @param other_players (list[unicode]): JIDs of the players to play with
+        @param room_jid (unicode): room JID or empty string to generate a unique name
         """
         profile = ISATSession(self.session).profile
-        try:
-            if room_jid != "":
-                room_jid = JID(room_jid).userhost()
-        except:
-            log.warning('Invalid room jid')
-            return
         self.sat_host.bridge.tarotGameLaunch(other_players, room_jid, profile)
 
     def jsonrpc_getTarotCardsPaths(self):
@@ -460,16 +457,12 @@
         self.sat_host.bridge.tarotGamePlayCards(player_nick, referee, cards, profile)
 
     def jsonrpc_launchRadioCollective(self, invited, room_jid=""):
-        """Create a room, invite people, and start a radio collective
-        @param room_jid: leave empty string to generate a unique room name
+        """Create a room, invite people, and start a radio collective.
+
+        @param invited (list[unicode]): JIDs of the contacts to play with
+        @param room_jid (unicode): room JID or empty string to generate a unique name
         """
         profile = ISATSession(self.session).profile
-        try:
-            if room_jid != "":
-                room_jid = JID(room_jid).userhost()
-        except:
-            log.warning('Invalid room jid')
-            return
         self.sat_host.bridge.radiocolLaunch(invited, room_jid, profile)
 
     def jsonrpc_getEntitiesData(self, jids, keys):