Example #1
0
 def sendLine(self, line):
     """send line to server, and add outbound requests to lists."""
     if line.cmd == 'PING':
         self.pingreq[line.args[0]] = True
     if line.cmd == 'WHO':
         self.addRequest(self.whoreq, line)
     if line.cmd == 'TOPIC' and len(line.args) == 1:
         self.addRequest(self.topicreq, line)
     if line.cmd == 'MODE' and len(line.args) == 1:
         self.addRequest(self.modereq, line)
     if line.cmd == 'NAMES':
         self.addRequest(self.namesreq, line)
     if line.cmd == 'AWAY':
         if len(line.args) > 0 and line.args[0] != '': # if setting away:
             self.awaymsg = line.args[0]
     if line.cmd in ["PRIVMSG", "NOTICE"]:
         # need to log self. simulate server info:
         fakeargs = line.args
         fakeargs[1] = "+" + fakeargs[1] # we are "identified"
         fakeline = Line(cmd=line.cmd, args=fakeargs,
                           prefix=self.clientprefix, time=w3c_timestamp())
         # log the line *after* the line currently being processed
         reactor.callLater(0, self.logLine, fakeline)
     if dbg: info("Sent to server: %s" % line)
     Irc.sendLine(self, line)
Example #2
0
    def sendLine(self, line):
        """send line to server, and add outbound requests to lists."""
        if line.cmd == 'PING':
            self.pingreq[line.args[0]] = True
        if line.cmd == 'WHO':
            self.addRequest(self.whoreq, line)
        if line.cmd == 'TOPIC' and len(line.args) == 1:
            self.addRequest(self.topicreq, line)
        if line.cmd == 'MODE' and len(line.args) == 1:
            self.addRequest(self.modereq, line)
        if line.cmd == 'NAMES':
            self.addRequest(self.namesreq, line)
        if line.cmd == 'AWAY':
            if len(line.args) > 0 and line.args[0] != '': # if setting away:
                self.awaymsg = line.args[0]

        if dbg: info("Sent to server: %s" % line)
        Irc.sendLine(self, line)