Exemplo n.º 1
0
def handle_user(data, match, client, channels):
    """
    This is a handshake. We'll blatantly disregard the whole pinging thing,
    because I don't really care. Clients still ping the server as it is.
    We'll see how it works out.

    '^USER (?P<user>[^\s]+) (?P<mode>[^\s]+) (?P<junk>[^\s]+) :(?P<name>.*)'

    :type data: str
    :type match: dict
    :type client: Client
    :type channels: list
    """
    client.name = match['name']
    client.host = match['host']
    logger.info("Set new user's name to '{name}'", name=client.name)
    logger.info("Set new user's host to '{host}'", host=client.host)

    response = Protocol.handshake(client)

    return [line.format(nick=client.nick) for line in response]
Exemplo n.º 2
0
def handle_user(data, match, client, channels):
    """
    This is a handshake. We'll blatantly disregard the whole pinging thing,
    because I don't really care. Clients still ping the server as it is.
    We'll see how it works out.

    '^USER (?P<user>[^\s]+) (?P<mode>[^\s]+) (?P<junk>[^\s]+) :(?P<name>.*)'

    :type data: str
    :type match: dict
    :type client: Client
    :type channels: list
    """
    client.name = match['name']
    client.host = match['host']
    logger.info("Set new user's name to '{name}'", name=client.name)
    logger.info("Set new user's host to '{host}'", host=client.host)

    response = Protocol.handshake(client)

    return [line.format(nick=client.nick) for line in response]