Fix muted avatars without lastname being able to send group invites

meow-7.2.2
Ansariel 2021-04-20 20:26:53 +02:00
parent 7442c3d685
commit 065bde8514
1 changed files with 13 additions and 1 deletions

View File

@ -1280,7 +1280,19 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
// group is not blocked, but we still need to check agent that sent the invitation
// and we have no agent's id
// Note: server sends username "first.last".
is_muted |= LLMuteList::getInstance()->isMuted(name);
// <FS:Ansariel> Fix broken mute check for avatars without last name:
// Names without last names are stored with capital first letter
// in the mute list, but they arrive here completely in lower case.
// So we need to change the first letter to upper case in order to
// make the mute check actually work.
//is_muted |= LLMuteList::getInstance()->isMuted(name);
std::string check_name(name);
if (!check_name.empty() && check_name.find('.') == std::string::npos)
{
check_name[0] = toupper(check_name[0]);
}
is_muted |= LLMuteList::getInstance()->isMuted(check_name);
// </FS:Ansariel>
}
if (is_do_not_disturb || is_muted)
{