예제 #1
0
def _redispatch_kick(message):
    kicker = get_user(message.source)
    channel, kickee, reason = get_channel(message.params[0]), get_user(
        message.params[1]), message.params[2]
    signal("kick").send(message,
                        kicker=kicker,
                        kickee=kickee,
                        channel=channel,
                        reason=reason)
예제 #2
0
def _parse_mode(message):
    # :ChanServ!ChanServ@services. MODE ##fwilson +o fwilson
    argument_modes = "".join(
        message.client.server_supports["CHANMODES"].split(",")[:-1])
    argument_modes += message.client.server_supports["PREFIX"].split(
        ")")[0][1:]
    user = get_user(message.source)
    channel = message.params[0]
    modes = message.params[1]
    args = message.params[2:]
    flag = "+"
    for mode in modes:
        if mode in "+-":
            flag = mode
            continue
        if mode in argument_modes:
            arg = args.pop(0)
        else:
            arg = None
        signal("{}mode".format(flag)).send(message,
                                           mode=mode,
                                           arg=arg,
                                           user=user,
                                           channel=channel)
        signal("mode {}{}".format(flag, mode)).send(message,
                                                    arg=arg,
                                                    user=user,
                                                    channel=channel)
예제 #3
0
파일: core.py 프로젝트: rixx/asyncirc
def _redispatch_message_common(message, mtype):
    target, text = message.params[0], message.params[1]
    user = get_user(message.source)
    signal(mtype).send(message, user=user, target=target, text=text)
    if target == message.client.nickname:
        signal("private-{}".format(mtype)).send(message, user=user, target=target, text=text)
    else:
        signal("public-{}".format(mtype)).send(message, user=user, target=target, text=text)
예제 #4
0
파일: core.py 프로젝트: Cadair/asyncirc
def _redispatch_message_common(message, type):
    target, text = get_target(message.params[0]), message.params[1]
    user = get_user(message.source)
    signal(type).send(message, user=user, target=target, text=text)
    if target == message.client.nickname:
        signal("private-{}".format(type)).send(message, user=user, target=target, text=text)
    else:
        signal("public-{}".format(type)).send(message, user=user, target=target, text=text)
예제 #5
0
파일: core.py 프로젝트: Cadair/asyncirc
def _parse_mode(message):
    # :ChanServ!ChanServ@services. MODE ##fwilson +o fwilson
    argument_modes = "".join(message.client.server_supports["CHANMODES"].split(",")[:-1])
    argument_modes += message.client.server_supports["PREFIX"].split(")")[0][1:]
    user = get_user(message.source)
    channel = message.params[0]
    modes = message.params[1]
    args = message.params[2:]
    flag = "+"
    for mode in modes:
        if mode in "+-":
            flag = mode
            continue
        if mode in argument_modes:
            arg = args.pop(0)
        else:
            arg = None
        signal("{}mode".format(flag)).send(message, mode=mode, arg=arg, user=user, channel=channel)
        signal("mode {}{}".format(flag, mode)).send(message, arg=arg, user=user, channel=channel)
예제 #6
0
def _redispatch_nick(message):
    old_user = get_user(message.source)
    new_nick = message.params[0]
    if old_user.nick == message.client.nickname:
        message.client.nickname = new_nick
    signal("nick").send(message, user=old_user, new_nick=new_nick)
예제 #7
0
def _redispatch_quit(message):
    user = get_user(message.source)
    reason = message.params[0]
    signal("quit").send(message, user=user, reason=reason)
예제 #8
0
def _redispatch_part(message):
    user = get_user(message.source)
    channel, reason = get_channel(message.params[0]), None
    if len(message.params) > 1:
        reason = message.params[1]
    signal("part").send(message, user=user, channel=channel, reason=reason)
예제 #9
0
def _redispatch_join(message):
    user = get_user(message.source)
    channel = get_channel(message.params[0])
    signal("join").send(message, user=user, channel=channel)
예제 #10
0
파일: core.py 프로젝트: rixx/asyncirc
def _redispatch_join(message):
    signal("join").send(message, user=get_user(message.source), channel=message.params[0])
예제 #11
0
파일: core.py 프로젝트: Cadair/asyncirc
def _redispatch_nick(message):
    old_user = get_user(message.source)
    new_nick = message.params[0]
    if old_user.nick == message.client.nickname:
        message.client.nickname = new_nick
    signal("nick").send(message, user=old_user, new_nick=new_nick)
예제 #12
0
파일: core.py 프로젝트: Cadair/asyncirc
def _redispatch_kick(message):
    kicker = get_user(message.source)
    channel, kickee, reason = get_channel(message.params[0]), get_user(message.params[1]), message.params[2]
    signal("kick").send(message, kicker=kicker, kickee=kickee, channel=channel, reason=reason)
예제 #13
0
파일: core.py 프로젝트: Cadair/asyncirc
def _redispatch_quit(message):
    user = get_user(message.source)
    reason = message.params[0]
    signal("quit").send(message, user=user, reason=reason)
예제 #14
0
파일: core.py 프로젝트: Cadair/asyncirc
def _redispatch_part(message):
    user = get_user(message.source)
    channel, reason = get_channel(message.params[0]), None
    if len(message.params) > 1:
        reason = message.params[1]
    signal("part").send(message, user=user, channel=channel, reason=reason)
예제 #15
0
파일: core.py 프로젝트: Cadair/asyncirc
def _redispatch_join(message):
    user = get_user(message.source)
    channel = get_channel(message.params[0])
    signal("join").send(message, user=user, channel=channel)