From a697afbbd8e5d63a7dbb8746ca1ba9e263d2ec2e Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Mon, 16 Aug 2021 18:18:22 -0500 Subject: [PATCH] (irc) Unban command --- protocols/irc/IrcProtocol.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/protocols/irc/IrcProtocol.cpp b/protocols/irc/IrcProtocol.cpp index 5a44eb5..f52088c 100644 --- a/protocols/irc/IrcProtocol.cpp +++ b/protocols/irc/IrcProtocol.cpp @@ -280,6 +280,18 @@ IrcProtocol::Process(BMessage* msg) _SendIrc(cmd); break; } + case IM_ROOM_UNBAN_PARTICIPANT: + { + BString chat_id = msg->FindString("chat_id"); + BString user_id = msg->FindString("user_id"); + + if (chat_id.IsEmpty() == false && user_id.IsEmpty() == false) { + BString cmd("MODE "); + cmd << chat_id << " -b " << _IdentNick(user_id) << "!*@*"; + _SendIrc(cmd); + } + break; + } case IM_ROOM_SEND_INVITE: { BString chat_id = msg->FindString("chat_id"); @@ -768,6 +780,7 @@ IrcProtocol::_ProcessCommand(BString command, BString sender, BMessage foot(IM_MESSAGE); foot.AddInt32("im_what", IM_ROOM_PARTICIPANT_KICKED); foot.AddString("chat_id", chat_id); + foot.AddString("user_name", _IdentNick(user_id)); foot.AddString("user_id", _NickIdent(user_id)); if (params.CountStrings() == 3) foot.AddString("body", params.StringAt(2));