diff libervia.tac @ 55:d5266c41ca24

Roster list update, contact deletion + some refactoring
author Goffi <goffi@goffi.org>
date Sun, 29 May 2011 02:13:53 +0200
parents f25c4077f6b9
children e552a67b933d
line wrap: on
line diff
--- a/libervia.tac	Sat May 28 20:18:14 2011 +0200
+++ b/libervia.tac	Sun May 29 02:13:53 2011 +0200
@@ -148,6 +148,11 @@
         self.sat_host.bridge.addContact(entity, profile)
         self.sat_host.bridge.updateContact(entity, name, groups, profile)
 
+    def jsonrpc_delContact(self, entity):
+        """Remove contact from contacts list"""
+        profile = ISATSession(self.session).profile
+        self.sat_host.bridge.delContact(entity, profile)
+
     def jsonrpc_subscription(self, sub_type, entity, name, groups):
         """Confirm (or infirm) subscription,
         and setup user roster in case of subscription"""
@@ -579,7 +584,7 @@
         self.bridge.register("actionResult", self.action_handler.actionResultCb, "request") 
         for signal_name in ['presenceUpdate', 'personalEvent', 'newMessage', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted', 'tarotGameNew',
                             'tarotGameChooseContrat', 'tarotGameShowCards', 'tarotGameInvalidCards', 'tarotGameCardsPlayed', 'tarotGameYourTurn', 'tarotGameScore',
-                            'subscribe']:
+                            'subscribe', 'contactDeleted', 'newContact']:
             self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name))
         root.putChild('json_signal_api', self.signal_handler)
         root.putChild('json_api', MethodHandler(self))