comparison libervia.tac @ 251:24335e82fef0

plugin XEP-249: added parameter Misc / Auto-join MUC on invitation: - also cleaned getOrCreateLiberviaWidget and _chatStateReceivedCb from unused arguments
author souliane <souliane@mailoo.org>
date Tue, 05 Nov 2013 21:12:14 +0100
parents a25aa882e09a
children 53c7f0237f1e
comparison
equal deleted inserted replaced
250:38e6211d36ca 251:24335e82fef0
437 437
438 def jsonrpc_getNewAccountDomain(self): 438 def jsonrpc_getNewAccountDomain(self):
439 """@return: the domain for new account creation""" 439 """@return: the domain for new account creation"""
440 d = self.asyncBridgeCall("getNewAccountDomain") 440 d = self.asyncBridgeCall("getNewAccountDomain")
441 return d 441 return d
442
443 def jsonrpc_confirmationAnswer(self, confirmation_id, result, answer_data):
444 """Send the user's answer to any previous 'askConfirmation' signal"""
445 profile = ISATSession(self.session).profile
446 self.sat_host.bridge.confirmationAnswer(confirmation_id, result, answer_data, profile)
447
442 448
443 class Register(JSONRPCMethodManager): 449 class Register(JSONRPCMethodManager):
444 """This class manage the registration procedure with SàT 450 """This class manage the registration procedure with SàT
445 It provide an api for the browser, check password and setup the web server""" 451 It provide an api for the browser, check password and setup the web server"""
446 452
651 def jsonrpc_isRegistered(self): 657 def jsonrpc_isRegistered(self):
652 """Tell if the user is already registered""" 658 """Tell if the user is already registered"""
653 _session = self.request.getSession() 659 _session = self.request.getSession()
654 profile = ISATSession(_session).profile 660 profile = ISATSession(_session).profile
655 return bool(profile) 661 return bool(profile)
656 662
663
657 class SignalHandler(jsonrpc.JSONRPC): 664 class SignalHandler(jsonrpc.JSONRPC):
658 665
659 def __init__(self, sat_host): 666 def __init__(self, sat_host):
660 Resource.__init__(self) 667 Resource.__init__(self)
661 self.register=None 668 self.register=None
841 self.bridge.register("connected", self.signal_handler.connected) 848 self.bridge.register("connected", self.signal_handler.connected)
842 self.bridge.register("disconnected", self.signal_handler.disconnected) 849 self.bridge.register("disconnected", self.signal_handler.disconnected)
843 self.bridge.register("connectionError", self.signal_handler.connectionError) 850 self.bridge.register("connectionError", self.signal_handler.connectionError)
844 self.bridge.register("actionResult", self.action_handler.actionResultCb) 851 self.bridge.register("actionResult", self.action_handler.actionResultCb)
845 #core 852 #core
846 for signal_name in ['presenceUpdate', 'newMessage', 'subscribe', 'contactDeleted', 'newContact', 'entityDataUpdated']: 853 for signal_name in ['presenceUpdate', 'newMessage', 'subscribe', 'contactDeleted', 'newContact', 'entityDataUpdated', 'askConfirmation', 'newAlert']:
847 self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name)) 854 self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name))
848 #plugins 855 #plugins
849 for signal_name in ['personalEvent', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted', 'tarotGameNew', 'tarotGameChooseContrat', 856 for signal_name in ['personalEvent', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted', 'tarotGameNew', 'tarotGameChooseContrat',
850 'tarotGameShowCards', 'tarotGameInvalidCards', 'tarotGameCardsPlayed', 'tarotGameYourTurn', 'tarotGameScore', 857 'tarotGameShowCards', 'tarotGameInvalidCards', 'tarotGameCardsPlayed', 'tarotGameYourTurn', 'tarotGameScore',
851 'radiocolStarted', 'radiocolPreload', 'radiocolPlay', 'radiocolNoUpload', 'radiocolUploadOk', 'radiocolSongRejected', 858 'radiocolStarted', 'radiocolPreload', 'radiocolPlay', 'radiocolNoUpload', 'radiocolUploadOk', 'radiocolSongRejected',