def connectionInitialized(self): MessageProtocol.connectionInitialized(self) RosterClientProtocol.connectionInitialized(self) PresenceClientProtocol.connectionInitialized(self) #Call to handler self._xmpphandler.onAuthenticated()
def createClient(bosh, domain, debug): if bosh: factory = BOSHClientFactory(jid.internJID(domain), None) else: factory = ClientFactory(jid.internJID(domain), None) factory.streamManager.logTraffic = debug protocol = MessageProtocol() protocol.setHandlerParent(factory.streamManager) if bosh: yield boshClientCreator(bosh, factory) else: yield client.clientCreator(factory)
def connectionInitialized(self): MessageProtocol.connectionInitialized(self) if self.presenceHandler is None: # Look for a presence handler for handler in self.parent: if isinstance(handler, PresenceProtocol): self.presenceHandler = handler break # Send presence to the room to join if self.presenceHandler is not None: self.presenceHandler.available(recipient=self.occupantJID) else: log.msg("No presence handler available for this connection!")
def __init__(self, jid): MessageProtocol.__init__(self) self.jid = jid self.help = [] self.commands = {} for (name, klass) in inspect.getmembers(commands, inspect.isclass): if not name in ('Command', 'User'): self.commands[name] = klass if hasattr(klass, 'aliases'): for alias in klass.aliases: self.commands[alias] = klass if name in HELP_COMMANDS: if hasattr(klass, 'usage'): self.help.append("%s %s" % (name, klass.usage)) self.help = "\n".join(self.help) self.session = accounts.Datastore().get_session()
def __init__(self, jid): MessageProtocol.__init__(self) self.jid = jid self.help = [] self.commands = {} for (name, klass) in inspect.getmembers(commands, inspect.isclass): if not name in ("Command", "User"): self.commands[name] = klass if hasattr(klass, "aliases"): for alias in klass.aliases: self.commands[alias] = klass if name in HELP_COMMANDS: if hasattr(klass, "usage"): self.help.append("%s %s" % (name, klass.usage)) self.help = "\n".join(self.help) self.session = accounts.Datastore().get_session()
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)
def connectionInitialized(self): LocationQuery.connectionInitialized(self) JabberRPC.connectionInitialized(self) MessageProtocol.connectionInitialized(self) IQBasedAvatar.connectionInitialized(self) PresenceClientProtocol.connectionInitialized(self)
def __init__(self, component=False, socket=None): MessageProtocol.__init__(self) self.component = component self._socket = socket self._message_count = 0 self._begin_time = None
def connectionInitialized(self): MessageProtocol.connectionInitialized(self) PresenceClientProtocol.connectionInitialized(self) self.statii = {} self.ignoring = DefaultDict() self.ignoring.f = lambda x: sets.Set()
def __init__(self, output, hostname, targetjid, *args, **kwargs): self.output = output self.hostname = hostname self.targetjid = targetjid MessageProtocol.__init__(self, *args, **kwargs)
def __init__(self): MessageProtocol.__init__(self)
def connectionInitialized(self): MessageProtocol.connectionInitialized(self) PresenceClientProtocol.connectionInitialized(self) self.statii = {} self.ignoring = defaultdict(set)
def __init__(self, bot): self.bot=bot MessageProtocol.__init__(self)
def connectionInitialized(self): MessageProtocol.connectionInitialized(self) PresenceClientProtocol.connectionInitialized(self)
def connectionInitialized(self): print 'Initializing connection' MessageProtocol.connectionInitialized(self) PresenceClientProtocol.connectionInitialized(self) RosterClientProtocol.connectionInitialized(self) self.getRoster().addCallback(self.processRoster)
def __init__(self): MessageProtocol.__init__(self) self.mpdclient = mpdclient.MpdClient() self.mpdclient.connect()
def __init__(self, xmpphandler): MessageProtocol.__init__(self) self._xmpphandler = xmpphandler self._xmpphandler.setProtocol(self)
def __init__(self, bot): self.bot = bot MessageProtocol.__init__(self)
def __init__(self, *args, **kwargs): MessageProtocol.__init__(self, *args, **kwargs) self.running = True self.emails = []
def __init__(self, component=False): MessageProtocol.__init__(self) self.component = component
def __init__(self, component, jid_act_as, jid_proxy_to): MessageProtocol.__init__(self) XmppProxyHandler.__init__(self, component, jid_act_as, jid_proxy_to)
def __init__(self, endpoint): MessageProtocol.__init__(self) self.endpoint = endpoint