コード例 #1
0
 def connectionInitialized(self):
     MessageProtocol.connectionInitialized(self)
     RosterClientProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
     
     #Call to handler
     self._xmpphandler.onAuthenticated()
コード例 #2
0
ファイル: client.py プロジェクト: melta/jarn.xmpp.core
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)
コード例 #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)
コード例 #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)
コード例 #5
0
 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)
コード例 #6
0
 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)
コード例 #7
0
ファイル: client.py プロジェクト: melta/jarn.xmpp.core
    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)
コード例 #8
0
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)
コード例 #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
コード例 #10
0
ファイル: xmpp_transport.py プロジェクト: hogrewe/uniblab
 def connectionInitialized(self):
     print 'Initializing connection'
     MessageProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
     RosterClientProtocol.connectionInitialized(self)
     self.getRoster().addCallback(self.processRoster)
コード例 #11
0
ファイル: protocol.py プロジェクト: chanel5e/doubanbot
 def connectionInitialized(self):
     MessageProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
コード例 #12
0
ファイル: diarybot2.py プロジェクト: drewp/diarybot
 def __init__(self, availableSubscribers):
     PresenceClientProtocol.__init__(self)
     self.availableSubscribers = availableSubscribers
コード例 #13
0
ファイル: xmpp.py プロジェクト: morgenroth/pysms-t
 def unsubscribedReceived(self, user, entity):
     PresenceClientProtocol.unsubscribedReceived(self, entity)
コード例 #14
0
ファイル: xmpp.py プロジェクト: morgenroth/pysms-t
 def unsubscribedReceived(self, user, entity):
     PresenceClientProtocol.unsubscribedReceived(self, entity)
コード例 #15
0
ファイル: xmppClient.py プロジェクト: allo-/otfbot
 def __init__(self, bot):
     self.bot = bot
     PresenceClientProtocol.__init__(self)
コード例 #16
0
ファイル: protocol.py プロジェクト: pragnesh/beanstalk-xmpp
 def connectionInitialized(self):
     MessageProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
     self.statii = {}
     self.ignoring = defaultdict(set)
コード例 #17
0
ファイル: xmpp.py プロジェクト: iliescufm/pygame
 def connectionInitialized(self):
     RosterClientProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
     self.attemptGetRoster()
コード例 #18
0
ファイル: xmpp_protocol.py プロジェクト: tsing/XMPP-Proxy
 def __init__(self, component, jid_act_as, jid_proxy_to):
     PresenceClientProtocol.__init__(self)
     XmppProxyHandler.__init__(self, component, jid_act_as, jid_proxy_to)
コード例 #19
0
 def connectionInitialized(self):
     PresenceClientProtocol.connectionInitialized(self)
     self.available()
コード例 #20
0
 def connectionInitialized(self):
     MessageProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
コード例 #21
0
 def connectionInitialized(self):
     LocationQuery.connectionInitialized(self)
     JabberRPC.connectionInitialized(self)
     MessageProtocol.connectionInitialized(self)
     IQBasedAvatar.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
コード例 #22
0
ファイル: xmppClient.py プロジェクト: otfbot/otfbot
 def __init__(self, bot):
     self.bot=bot
     PresenceClientProtocol.__init__(self)
コード例 #23
0
ファイル: presence.py プロジェクト: carriercomm/mimir
 def connectionInitialized(self):
     PresenceClientProtocol.connectionInitialized(self)
     self.available()
コード例 #24
0
 def connectionInitialized(self):
     MessageProtocol.connectionInitialized(self)
     PresenceClientProtocol.connectionInitialized(self)
     self.statii = {}
     self.ignoring = DefaultDict()
     self.ignoring.f = lambda x: sets.Set()