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

@@ -1219,7 +1219,7 @@ class Inspircd(IProtocol):
return user_obj, reason
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.
>>> [':97KAAAAAC', 'NICK', 'testinspir', '1757360740']
@@ -1233,12 +1233,10 @@ class Inspircd(IProtocol):
if scopy[0].startswith('@'):
scopy.pop(0)
response = {
"uid": scopy[0].replace(':', ''),
"newnickname": scopy[2],
"timestamp": scopy[3]
}
return response
user_obj = self._User.get_user(self._User.clean_uid(scopy[0]))
newnickname = scopy[2]
timestamp = scopy[3]
return user_obj, newnickname, timestamp
def parse_privmsg(self, server_msg: list[str]) -> tuple[Optional['MUser'], Optional['MUser'], Optional['MChannel'], str]:
"""Parse PRIVMSG message.
@@ -1412,3 +1410,11 @@ class Inspircd(IProtocol):
server_msg (list[str]): Original server message
"""
...
def on_sethost(self, server_msg: list[str]) -> None:
"""On SETHOST command
Args:
server_msg (list[str]): _description_
"""
...