Skip to content

Commit

Permalink
* Add support for Server Boost messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
iProgramMC committed Jun 1, 2024
1 parent 981d0c9 commit 59b2459
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/windows/MessageList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,10 @@ bool MessageList::IsActionMessage(MessageType::eType msgType)
case MessageType::STAGE_END:
case MessageType::STAGE_SPEAKER:
case MessageType::STAGE_TOPIC:
case MessageType::GUILD_BOOST:
case MessageType::GUILD_BOOST_TIER_1:
case MessageType::GUILD_BOOST_TIER_2:
case MessageType::GUILD_BOOST_TIER_3:
return true;
}

Expand Down Expand Up @@ -1636,6 +1640,39 @@ void MessageList::DetermineMessageData(
break;
}

case MessageType::GUILD_BOOST:
{
messagePart1 = TEXT("");
messagePart2 = TEXT(" has boosted the server!");
break;
}

case MessageType::GUILD_BOOST_TIER_1:
case MessageType::GUILD_BOOST_TIER_2:
case MessageType::GUILD_BOOST_TIER_3:
{
std::string guildName = "[unknown guild]";
Guild* pGld = GetDiscordInstance()->GetGuild(guildID);
if (pGld)
guildName = pGld->m_name;

freedStringSpace = ConvertCppStringToTString(" has boosted the server! " + guildName + " has achieved ");

messagePart1 = TEXT("");
messagePart2 = freedStringSpace;
messagePart3 = TEXT("!");

int tier = int(msgType) - int(MessageType::GUILD_BOOST_TIER_1);
const LPCTSTR tiers[] = {
TEXT("Level 1"),
TEXT("Level 2"),
TEXT("Level 3"),
};

clickableString = tiers[tier];
break;
}

case MessageType::STAGE_START:
{
freedStringSpace = ConvertCppStringToTString(content);
Expand Down

0 comments on commit 59b2459

Please sign in to comment.