Browse Source

Send RPL_MYINFO on connect

master
Forest Belton 2 years ago
parent
commit
987a70a457
2 changed files with 7 additions and 3 deletions
  1. +6
    -3
      paircd/client.py
  2. +1
    -0
      paircd/reply.py

+ 6
- 3
paircd/client.py View File

@ -2,7 +2,7 @@ from asyncio import StreamReader, StreamWriter, Queue
from dataclasses import dataclass, field from dataclasses import dataclass, field
from datetime import datetime from datetime import datetime
from logging import log, INFO 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 paircd.message import Message
from typing import Set from typing import Set
@ -50,6 +50,9 @@ class Client:
self.write_message(RPL_WELCOME(self.nickname, self.id())) self.write_message(RPL_WELCOME(self.nickname, self.id()))
self.write_message(RPL_YOURHOST(self.nickname, "localhost", "paircd-0.0.1")) 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())) 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", "", "")
)

+ 1
- 0
paircd/reply.py View File

@ -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_WELCOME = reply_fn("001", "Welcome to the Internet Relay Network {0}")
RPL_YOURHOST = reply_fn("002", "Your host is {0}, running version {1}") RPL_YOURHOST = reply_fn("002", "Your host is {0}, running version {1}")
RPL_CREATED = reply_fn("003", "This server was created {0}") 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_WHOISUSER = reply_fn(311, "{0} {1} {2} * :{3}")
RPL_ENDOFWHO = reply_fn(315, "{0} :End of /WHO list") RPL_ENDOFWHO = reply_fn(315, "{0} :End of /WHO list")
RPL_ENDOFWHOIS = reply_fn(318, "{0} :End of /WHOIS list") RPL_ENDOFWHOIS = reply_fn(318, "{0} :End of /WHOIS list")

Loading…
Cancel
Save