diff src/server/server.py @ 909:e8b133b77aa4

browser, server: update to get compatibility with 0.7-dev (not finished): Q&D update to restore compatibility - version changed to 0.7D - contact list has been modified to be compatible with changes, but it doesn't take profit of improvment yet - messageSend partially work, there is a disconnection and an error in console logs when sending a message - message are not received yet
author Goffi <goffi@goffi.org>
date Tue, 09 Aug 2016 01:07:15 +0200
parents 763da94ba28b
children 58f611481e6d
line wrap: on
line diff
--- a/src/server/server.py	Wed Jul 13 22:45:54 2016 +0200
+++ b/src/server/server.py	Tue Aug 09 01:07:15 2016 +0200
@@ -463,10 +463,10 @@
         profile = ISATSession(self.session).profile
         self.sat_host.bridge.setPresence('', presence, {'': status}, profile)
 
-    def jsonrpc_sendMessage(self, to_jid, msg, subject, type_, options={}):
+    def jsonrpc_messageSend(self, to_jid, msg, subject, type_, extra={}):
         """send message"""
         profile = ISATSession(self.session).profile
-        return self.asyncBridgeCall("sendMessage", to_jid, msg, subject, type_, options, profile)
+        return self.asyncBridgeCall("messageSend", to_jid, msg, subject, type_, extra, profile)
 
     ## PubSub ##
 
@@ -713,7 +713,7 @@
         d.addCallback(show)
         return d
 
-    def jsonrpc_joinMUC(self, room_jid, nick):
+    def jsonrpc_mucJoin(self, room_jid, nick):
         """Join a Multi-User Chat room
 
         @param room_jid (unicode): room JID or empty string to generate a unique name
@@ -744,19 +744,14 @@
             return
         self.sat_host.bridge.mucLeave(room_jid.userhost(), profile)
 
-    def jsonrpc_getRoomsJoined(self):
+    def jsonrpc_mucGetRoomsJoined(self):
         """Return list of room already joined by user"""
         profile = ISATSession(self.session).profile
-        return self.sat_host.bridge.getRoomsJoined(profile)
+        return self.sat_host.bridge.mucGetRoomsJoined(profile)
 
-    def jsonrpc_getRoomsSubjects(self):
-        """Return list of room subjects"""
-        profile = ISATSession(self.session).profile
-        return self.sat_host.bridge.getRoomsSubjects(profile)
-
-    def jsonrpc_getDefaultMUC(self):
+    def jsonrpc_mucGetDefaultService(self):
         """@return: the default MUC"""
-        d = self.asyncBridgeCall("getDefaultMUC")
+        d = self.asyncBridgeCall("mucGetDefaultService")
         return d
 
     def jsonrpc_launchTarotGame(self, other_players, room_jid=""):
@@ -1509,16 +1504,16 @@
             self.bridge.register("disconnected", self.signal_handler.disconnected)
             self.bridge.register("actionResult", self.action_handler.actionResultCb)
             #core
-            for signal_name in ['presenceUpdate', 'newMessage', 'subscribe', 'contactDeleted',
+            for signal_name in ['presenceUpdate', 'messageNew', 'subscribe', 'contactDeleted',
                                 'newContact', 'entityDataUpdated', 'askConfirmation', 'newAlert', 'paramUpdate']:
                 self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name))
             # XXX: actionNew is handled separately because the handler must manage security_limit
             self.bridge.register('actionNew', self.signal_handler.actionNewHandler)
             #plugins
-            for signal_name in ['psEvent', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted', 'tarotGameNew', 'tarotGameChooseContrat',
+            for signal_name in ['psEvent', 'mucRoomJoined', 'tarotGameStarted', 'tarotGameNew', 'tarotGameChooseContrat',
                                 'tarotGameShowCards', 'tarotGameInvalidCards', 'tarotGameCardsPlayed', 'tarotGameYourTurn', 'tarotGameScore', 'tarotGamePlayers',
                                 'radiocolStarted', 'radiocolPreload', 'radiocolPlay', 'radiocolNoUpload', 'radiocolUploadOk', 'radiocolSongRejected', 'radiocolPlayers',
-                                'roomLeft', 'roomUserChangedNick', 'chatStateReceived']:
+                                'mucRoomLeft', 'mucRoomUserChangedNick', 'chatStateReceived']:
                 self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name), "plugin")
             self.media_dir = self.bridge.getConfig('', 'media_dir')
             self.local_dir = self.bridge.getConfig('', 'local_dir')