Ejemplo n.º 1
0
 def handle_ievent(self, ievent):
     """ check for callbacks, call Irc method. """
     try:
         Irc.handle_ievent(self, ievent)
         if ievent.cmnd == 'JOIN' or ievent.msg:
             if ievent.nick in self.nicks401: self.nicks401.remove(ievent.nick)
         if ievent.cmnd != "PRIVMSG":
             i = IrcEvent()
             i.copyin(ievent)
             i.bot = self
             i.sock = self.sock
             ievent.nocb = True
             self.doevent(i)
     except:
         handle_exception()
Ejemplo n.º 2
0
    partyline.del_party(nick)
    return
try:
    res = self.normalize(res)
    ievent = IrcEvent()
    ievent.printto = sock
    ievent.bottype = "irc"
    ievent.nick = nick
    ievent.userhost = userhost
    ievent.auth = userhost
    ievent.channel = channel or ievent.userhost
    ievent.origtxt = res
    ievent.txt = res
    ievent.cmnd = 'DCC'
    ievent.cbtype = 'DCC'
    ievent.bot = self
    ievent.sock = sock
    ievent.speed = 1
    ievent.isdcc = True
    ievent.msg = True
    ievent.bind(self)
    logging.debug("%s - dcc - constructed event" % self.name)
    if ievent.txt[0] == "!":
        self.doevent(ievent)
        continue
    elif ievent.txt[0] == "@":
        partyline.say_broadcast_notself(ievent.nick, "[%s] %s" % (ievent.nick, ievent.txt))
        q = Queue.Queue()
        ievent.queues = [q]
        ievent.txt = ievent.txt[1:]
        self.doevent(ievent)