Example #1
0
 def connectionInitialized(self):
     MessageProtocol.connectionInitialized(self)
     RosterClientProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
     
     #Call to handler
     self._xmpphandler.onAuthenticated()
Example #2
0
class AdminClient(XMPPClient, PubSubClientMixIn):

    implements(IAdminClient)

    def __init__(self, jid, jdomain, password, pubsub_jid):

        jid = JID(jid)
        self.pubsub_jid = JID(pubsub_jid)
        self.admin = AdminHandler()
        self.pubsub = PubSubHandler()
        self.chat = ChatHandler()
        self.presence = PresenceClientProtocol()

        super(AdminClient, self).__init__(
            jid, password,
            extra_handlers=[self.admin,
                            self.pubsub,
                            self.chat,
                            self.presence],
            host=jdomain)

    def _authd(self, xs):
        super(AdminClient, self)._authd(xs)
        self.presence.available()
        ev = AdminClientConnected(self)
        notify(ev)

    def _disconnected(self, reason):
        super(AdminClient, self)._disconnected(reason)
        ev = AdminClientDisconnected(self)
        notify(ev)
Example #3
0
class AdminClient(XMPPClient, PubSubClientMixIn):

    implements(IAdminClient)

    def __init__(self, jid, jdomain, password, pubsub_jid):

        jid = JID(jid)
        self.pubsub_jid = JID(pubsub_jid)
        self.admin = AdminHandler()
        self.pubsub = PubSubHandler()
        self.chat = ChatHandler()
        self.presence = PresenceClientProtocol()

        super(AdminClient, self).__init__(
            jid,
            password,
            extra_handlers=[self.admin, self.pubsub, self.chat, self.presence],
            host=jdomain)

    def _authd(self, xs):
        super(AdminClient, self)._authd(xs)
        self.presence.available()
        ev = AdminClientConnected(self)
        notify(ev)

    def _disconnected(self, reason):
        super(AdminClient, self)._disconnected(reason)
        ev = AdminClientDisconnected(self)
        notify(ev)
Example #4
0
    def __init__(self, jid, jdomain, password, pubsub_jid):

        jid = JID(jid)
        self.pubsub_jid = JID(pubsub_jid)
        self.admin = AdminHandler()
        self.pubsub = PubSubHandler()
        self.chat = ChatHandler()
        self.presence = PresenceClientProtocol()

        super(AdminClient, self).__init__(
            jid,
            password,
            extra_handlers=[self.admin, self.pubsub, self.chat, self.presence],
            host=jdomain)
 def __init__(self, jid, host, password, port, authcallback):
     self.authcallback = authcallback
     self.vcard = VCardHandler()
     self.presence = PresenceClientProtocol()
     # XXX: This is a hack. See https://github.com/ralphm/wokkel/issues/5
     # Not yet sure what the best way of dealing with this is.
     jid = JID(u'@'.join(
         (doubleEscapeNode(unescapeNode(jid.user)), jid.host)))
     super(UserClient, self).__init__(
         jid, password,
         extra_handlers=[self.vcard, self.presence],
         host=host,
         port=port)
 def __init__(self, backend_interaction, component=False):
     '''
     @param backend_interaction: The handler for cumminicating with the logic of the backend.
     @type backend_interaction: ServerInteraction 
     '''
     #init XEPs
     MessageProtocol.__init__(self)
     LocationQuery.__init__(self)
     JabberRPC.__init__(self)
     IQBasedAvatar.__init__(self)
     PresenceClientProtocol.__init__(self)
     self.component = component
     
     #register rpc functions
     self.registerMethodCall('getSettings', self.onGetSettings)
     self.registerMethodCall('setSettings', self.onSetSettings)
     self.registerMethodCall('getUserInfo', self.onGetUserInfo)
     self.registerMethodCall('createFriendship', self.onCreateFriendship)
     self.registerMethodCall('destroyFriendship', self.onDestroyFriendship)
     
     #give the backend (ServerInteraction) a reference to this protocol handler
     self.backend = backend_interaction
     self.backend.set_server_component(self)
Example #7
0
    def __init__(self, jid, jdomain, password, pubsub_jid):

        jid = JID(jid)
        self.pubsub_jid = JID(pubsub_jid)
        self.admin = AdminHandler()
        self.pubsub = PubSubHandler()
        self.chat = ChatHandler()
        self.presence = PresenceClientProtocol()

        super(AdminClient, self).__init__(
            jid, password,
            extra_handlers=[self.admin,
                            self.pubsub,
                            self.chat,
                            self.presence],
            host=jdomain)
class AdminClient(XMPPClient):
    implements(IAdminClient)

    def __init__(self, jid, host, password, port):
        try:
            jid = JID(jid)
        except RuntimeError, e:
            log.warn(e)
            return

        self.admin = AdminHandler()
        self.chat = ChatHandler()
        self.presence = PresenceClientProtocol()
        super(AdminClient, self).__init__(
            jid, password,
            extra_handlers=[self.admin, self.chat, self.presence],
            host=host,
            port=port)
Example #9
0
    def createXMPPClients(self, jid, password):
        """
        Create XMPP clients.

        @return: C{(xmppClient, pubsubClient)}
        """
        xmppClient = XMPPClient(jid, password)
        xmppClient.startService()

        presence = PresenceClientProtocol()
        presence.setHandlerParent(xmppClient)
        presence.available(priority=127)

        pubsubClient = SuperfeedrClient(self)
        pubsubClient.setHandlerParent(xmppClient)

        return xmppClient, pubsubClient
Example #10
0
 def connectionInitialized(self):
     print 'Initializing connection'
     MessageProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
     RosterClientProtocol.connectionInitialized(self)
     self.getRoster().addCallback(self.processRoster)
Example #11
0
 def connectionInitialized(self):
     MessageProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
Example #12
0
 def __init__(self, availableSubscribers):
     PresenceClientProtocol.__init__(self)
     self.availableSubscribers = availableSubscribers
Example #13
0
 def unsubscribedReceived(self, user, entity):
     PresenceClientProtocol.unsubscribedReceived(self, entity)
Example #14
0
 def unsubscribedReceived(self, user, entity):
     PresenceClientProtocol.unsubscribedReceived(self, entity)
Example #15
0
 def __init__(self, bot):
     self.bot = bot
     PresenceClientProtocol.__init__(self)
Example #16
0
 def connectionInitialized(self):
     MessageProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
     self.statii = {}
     self.ignoring = defaultdict(set)
Example #17
0
 def connectionInitialized(self):
     RosterClientProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
     self.attemptGetRoster()
Example #18
0
 def __init__(self, component, jid_act_as, jid_proxy_to):
     PresenceClientProtocol.__init__(self)
     XmppProxyHandler.__init__(self, component, jid_act_as, jid_proxy_to)
Example #19
0
 def connectionInitialized(self):
     PresenceClientProtocol.connectionInitialized(self)
     self.available()
Example #20
0
 def connectionInitialized(self):
     MessageProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
 def connectionInitialized(self):
     LocationQuery.connectionInitialized(self)
     JabberRPC.connectionInitialized(self)
     MessageProtocol.connectionInitialized(self)
     IQBasedAvatar.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
Example #22
0
 def __init__(self, bot):
     self.bot=bot
     PresenceClientProtocol.__init__(self)
Example #23
0
 def connectionInitialized(self):
     PresenceClientProtocol.connectionInitialized(self)
     self.available()
Example #24
0
 def connectionInitialized(self):
     MessageProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
     self.statii = {}
     self.ignoring = DefaultDict()
     self.ignoring.f = lambda x: sets.Set()