(irc) Report errors, use WELCOME-given nick

This commit is contained in:
Jaidyn Ann 2021-08-11 20:47:40 -05:00
parent 409eaede86
commit 5fb7d5268c

View File

@ -270,6 +270,8 @@ IrcProtocol::_ProcessNumeric(int32 numeric, BString sender, BStringList params)
switch (numeric) {
case RPL_WELCOME:
{
if (params.CountStrings() == 2)
fNick = params.First();
BString cmd("WHO ");
cmd << fNick << "\n";
_SendIrc(cmd);
@ -350,6 +352,17 @@ IrcProtocol::_ProcessNumericError(int32 numeric, BString sender,
_SendIrc(cmd);
break;
}
default:
{
BString body = std::to_string(numeric).c_str();
body << params.Last();
BMessage err(IM_MESSAGE);
err.AddInt32("im_what", IM_MESSAGE_RECEIVED);
err.AddString("chat_id", "*server*");
err.AddString("body", body);
_SendMsg(&err);
}
}
}