Esempio n. 1
0
def process_line(irc, type, obj):
    if type == "chanmsg":
        obj["message"] = util.decode_irc(obj["message"])
        events.fire("chanmsg", irc, obj)
    elif type == "privmsg":
        obj["message"] = util.decode_irc(obj["message"])
        events.fire("privmsg", irc, obj)
    elif type == "join":
        events.fire("join", irc, obj)
    elif type == "startup":
        irc.write("join", {"channel": "#twilightzone"})
    else:
        _log.warning("bad command type: %r: %r" % (type, obj))
Esempio n. 2
0
    def split_send(fn, data):
        split_data = []
        for x in [data] if isinstance(data, basestring) else data:
            split_data.extend(x.replace("\r", "").split("\n"))

        for x in util.split_lines(split_data):
            fn(util.decode_irc(x, redecode=False))
Esempio n. 3
0
    def split_send(cls, fn, data):
        split_data = []
        for x in [data] if isinstance(data, basestring) else data:
            split_data.extend(x.replace("\r", "").split("\n"))

        for x in util.split_lines(split_data):
            fn(util.decode_irc(x, redecode=False))
        return