From 987a70a45779807a01977f7284982ceaf79c6550 Mon Sep 17 00:00:00 2001 From: Forest Belton Date: Tue, 22 Jun 2021 03:46:14 -0400 Subject: [PATCH] Send RPL_MYINFO on connect --- paircd/client.py | 9 ++++++--- paircd/reply.py | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/paircd/client.py b/paircd/client.py index 8190f93..b0777a1 100644 --- a/paircd/client.py +++ b/paircd/client.py @@ -2,7 +2,7 @@ from asyncio import StreamReader, StreamWriter, Queue from dataclasses import dataclass, field from datetime import datetime from logging import log, INFO -from paircd.reply import RPL_CREATED, RPL_WELCOME, RPL_YOURHOST +from paircd.reply import RPL_CREATED, RPL_MYINFO, RPL_WELCOME, RPL_YOURHOST from paircd.message import Message from typing import Set @@ -50,6 +50,9 @@ class Client: self.write_message(RPL_WELCOME(self.nickname, self.id())) self.write_message(RPL_YOURHOST(self.nickname, "localhost", "paircd-0.0.1")) - - # TODO: Pull timestamp from Server instance + # TODO: Pull timestamp from server instance self.write_message(RPL_CREATED(self.nickname, datetime.utcnow())) + # TODO: Display list of supported user & channel modes + self.write_message( + RPL_MYINFO(self.nickname, "localhost", "paircd-0.0.1", "", "") + ) diff --git a/paircd/reply.py b/paircd/reply.py index 8868a66..8b52cc8 100644 --- a/paircd/reply.py +++ b/paircd/reply.py @@ -37,6 +37,7 @@ ERR_NOSUCHSERVER = reply_fn(402, "{0}: No such server") RPL_WELCOME = reply_fn("001", "Welcome to the Internet Relay Network {0}") RPL_YOURHOST = reply_fn("002", "Your host is {0}, running version {1}") RPL_CREATED = reply_fn("003", "This server was created {0}") +RPL_MYINFO = reply_fn("004", "{0} {1} {2} {3}") RPL_WHOISUSER = reply_fn(311, "{0} {1} {2} * :{3}") RPL_ENDOFWHO = reply_fn(315, "{0} :End of /WHO list") RPL_ENDOFWHOIS = reply_fn(318, "{0} :End of /WHOIS list")