Parse usernames out of /mods and /vips messages (#3187)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -834,6 +834,31 @@ void IrcMessageHandler::handleNoticeMessage(Communi::IrcNoticeMessage *message)
|
||||
hostOn);
|
||||
channel->addMessage(builder.release());
|
||||
}
|
||||
else if (tags == "room_mods" || tags == "vips_success")
|
||||
{
|
||||
// /mods and /vips
|
||||
// room_mods: The moderators of this channel are: ampzyh, antichriststollen, apa420, ...
|
||||
// vips_success: The VIPs of this channel are: 8008, aiden, botfactory, ...
|
||||
|
||||
QString noticeText = msg->messageText;
|
||||
if (tags == "vips_success")
|
||||
{
|
||||
// this one has a trailing period, need to get rid of it.
|
||||
noticeText.chop(1);
|
||||
}
|
||||
|
||||
QStringList msgParts = noticeText.split(':');
|
||||
MessageBuilder builder;
|
||||
|
||||
auto tc = dynamic_cast<TwitchChannel *>(channel.get());
|
||||
assert(tc != nullptr &&
|
||||
"IrcMessageHandler::handleNoticeMessage. Twitch specific "
|
||||
"functionality called in non twitch channel");
|
||||
|
||||
TwitchMessageBuilder::modsOrVipsSystemMessage(
|
||||
msgParts.at(0), msgParts.at(1).split(", "), tc, &builder);
|
||||
channel->addMessage(builder.release());
|
||||
}
|
||||
else
|
||||
{
|
||||
channel->addMessage(msg);
|
||||
|
||||
Reference in New Issue
Block a user