Handle SETHOST response to update the vhost of the user

This commit is contained in:
adator
2025-11-16 13:20:11 +01:00
parent 7ffc58d4ff
commit a3dcc20a06
3 changed files with 49 additions and 23 deletions

View File

@@ -335,7 +335,7 @@ class IProtocol(ABC):
"""
@abstractmethod
def parse_nick(self, server_msg: list[str]) -> dict[str, str]:
def parse_nick(self, server_msg: list[str]) -> tuple[Optional['MUser'], str, str]:
"""Parse nick changes and return dictionary.
>>> [':97KAAAAAC', 'NICK', 'testinspir', '1757360740']
@@ -343,7 +343,9 @@ class IProtocol(ABC):
server_msg (list[str]): The server message to parse
Returns:
dict[str, str]: The response as dictionary.
tuple(MUser, newnickname(str), timestamp(str)): Tuple of the response.
>>> MUser, newnickname, timestamp
"""
@abstractmethod
@@ -563,3 +565,12 @@ class IProtocol(ABC):
Args:
server_msg (list[str]): The server message
"""
@abstractmethod
def on_sethost(self, server_msg: list[str]) -> None:
"""On SETHOST command
>>> [':001DN7305', 'SETHOST', ':netadmin.example.org']
Args:
server_msg (list[str]): _description_
"""