예제 #1
0
파일: base_bot.py 프로젝트: CIRCL/rt_bot
    def connectionInitialized(self):
        """
    Once authorized, join the room.

    If the join action causes a new room to be created, the room will be
    locked until configured. Here we will just accept the default
    configuration by submitting an empty form using L{configure}, which
    usually results in a public non-persistent room.

    Alternatively, you would use L{getConfiguration} to retrieve the
    configuration form, and then submit the filled in form with the
    required settings using L{configure}, possibly after presenting it to
    an end-user.
    """
        self.join(self.roomJID, self.nick, password=self.roomPASSWORD)

        def joinedRoom(room):
            if room.locked:
                # Just accept the default configuration.
                return self.configure(room.roomJID, {})

        MUCClient.connectionInitialized(self)

        d = self.join(self.roomJID, self.nick, password="******")
        d.addCallback(joinedRoom)
        d.addCallback(lambda _: log.msg("Joined room"))
        d.addErrback(log.err, "Join failed")
예제 #2
0
	def __init__(self, muc, passedConfig):
		global config 
		config = passedConfig
		MUCClient.__init__(self)
		self.muc = muc
		self.nick = config.xmpp.nick
		self.po = None
		self.users = []
예제 #3
0
 def __init__(self, server, rooms, nick):
     MUCClient.__init__(self)
     self.server   = server
     self.jrooms     = rooms
     self.nick     = nick
     self.last     = {}
     self.activity = None
     self._roomOccupantMap = {}
예제 #4
0
	def connectionInitialized(self):
		global config 
		MUCClient.connectionInitialized(self)
		self.join(self.muc, self.nick)
		
		factory = Factory()
		factory.protocol = PO
		point = TCP4ClientEndpoint(reactor, config.po.server, config.po.port)
		d = point.connect(factory)
		d.addCallback(self.gotPO)
예제 #5
0
 def connectionInitialized(self):
     """
     Join to the room with given JID.
     """
     def joinedRoom(room):
         if room.locked:
             # Just accept the default configuration.
             return self.configure(room.roomJID, {})
     MUCClient.connectionInitialized(self)
     d = self.join(self.roomJID, self.nick)
     d.addCallback(joinedRoom)
     d.addCallback(lambda _: log.msg("Joined room:", self.roomJID.full()))
     d.addErrback(log.err, "Join room failed:", self.roomJID.full())
예제 #6
0
 def connectionInitialized(self):
     """
     Join to the chat with given JID.
     """
     def joinedChat(chat):
         if chat.locked:
             # Just accept the default configuration.
             return self.configure(chat.chatJID, {})
     MUCClient.connectionInitialized(self)
     d = self.join(self.chatJID, self.nick)
     d.addCallback(joinedChat)
     d.addCallback(lambda _: log.msg("Joined chat:", self.chatJID.full()))
     d.addErrback(log.err, "Join chat failed:", self.chatJID.full())
예제 #7
0
    def connectionInitialized(self):
        """
        Join to the room with given JID.
        """
        def joinedRoom(room):
            if room.locked:
                # Just accept the default configuration.
                return self.configure(room.roomJID, {})

        MUCClient.connectionInitialized(self)
        d = self.join(self.roomJID, self.nick)
        d.addCallback(joinedRoom)
        d.addCallback(lambda _: log.msg("Joined room:", self.roomJID.full()))
        d.addErrback(log.err, "Join room failed:", self.roomJID.full())
예제 #8
0
    def connectionInitialized(self):
        """
        Once authorized, join the room.
        """
        def joinedRoom(room):
            if room.locked:
                # Just accept the default configuration.
                return self.configure(room.roomJID, {})

        MUCClient.connectionInitialized(self)

        d = self.join(self.roomJID, self.nick)
        d.addCallback(joinedRoom)
        d.addCallback(lambda _: log.msg("Joined room"))
        d.addErrback(log.err, "Join failed")
예제 #9
0
파일: sovbot.py 프로젝트: smedstadc/sovbot
    def connectionInitialized(self):
        """Once authorized, join the room."""
        log.msg("Connected...")

        def joinedRoom(room):
            if room.locked:
                log.msg("Room was locked, using default configuration...")
                # The room will be locked if it didn't exist before we joined it.
                # Just accept the default configuration. The room will be public and temporary.
                return self.configure(room.roomJID, {})

        MUCClient.connectionInitialized(self)
        self.join(self.room_jid, self.nick)
        log.msg("Joining {}...".format(self.room_jid))
        log.msg("Start looping task with {} second interval...".format(TASK_INTERVAL))
        self.looping_task.start(TASK_INTERVAL)
예제 #10
0
 def __init__(self, chatJID, nick, appIdPatterns):
     MUCClient.__init__(self)
     self.chatJID = chatJID
     self.nick = nick
     self.appIdPatterns = appIdPatterns
예제 #11
0
파일: __init__.py 프로젝트: saml/letschat
 def __init__(self, roomJID, nick):
     MUCClient.__init__(self)
     self.roomJID = roomJID
     self.nick = nick
예제 #12
0
파일: base_bot.py 프로젝트: CIRCL/rt_bot
 def __init__(self, roomJID, nick, roomPASSWORD):
     MUCClient.__init__(self)
     self.roomJID = roomJID
     self.nick = nick
     self.roomPASSWORD = roomPASSWORD
예제 #13
0
 def __init__(self, roomJID, nick, repositoryMasks):
     MUCClient.__init__(self)
     self.roomJID = roomJID
     self.nick = nick
     self.repositoryMasks = repositoryMasks
예제 #14
0
 def __init__(self, roomJID, nick, dbpath):
     MUCClient.__init__(self)
     self.roomJID = roomJID
     self.nick = nick
     self.muc_log = MUCLogSqlite(dbpath)
예제 #15
0
 def __init__(self, roomJID, nick):
     MUCClient.__init__(self)
     self.roomJID = roomJID
     self.nick = nick
     self._bot = Bot(roomJID, nick, self.groupChat)
예제 #16
0
 def __init__(self, roomJID, nick, repositoryMasks):
     MUCClient.__init__(self)
     self.roomJID = roomJID
     self.nick = nick
     self.repositoryMasks = repositoryMasks
예제 #17
0
파일: sovbot.py 프로젝트: smedstadc/sovbot
 def __init__(self, room_jid, nick):
     MUCClient.__init__(self)
     self.room_jid = room_jid
     self.nick = nick
     self.looping_task = task.LoopingCall(self.notifications_task)