1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

IRCClient: Add channel member context menus for common CTCP requests

Add menu items for CTCP: USERINFO, FINGER, TIME, VERSION, CLIENTINFO
This commit is contained in:
Brendan Coles 2020-04-11 08:23:03 +00:00 committed by Andreas Kling
parent 3b21c4aa56
commit 502299919a
3 changed files with 54 additions and 0 deletions

View file

@ -1006,6 +1006,11 @@ void IRCClient::handle_whois_action(const String& nick)
send_whois(nick);
}
void IRCClient::handle_ctcp_user_action(const String& nick, const String& message)
{
send_ctcp_request(nick, message);
}
void IRCClient::handle_open_query_action(const String& nick)
{
ensure_query(nick);
@ -1104,6 +1109,16 @@ void IRCClient::send_ctcp_response(const StringView& peer, const StringView& pay
send_notice(peer, message);
}
void IRCClient::send_ctcp_request(const StringView& peer, const StringView& payload)
{
StringBuilder builder;
builder.append(0x01);
builder.append(payload);
builder.append(0x01);
auto message = builder.to_string();
send_privmsg(peer, message);
}
void IRCClient::handle_ctcp_request(const StringView& peer, const StringView& payload)
{
dbg() << "handle_ctcp_request: " << payload;