mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-21 00:53:40 -08:00
mod global msg overrides settings
This commit is contained in:
@@ -171,7 +171,7 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
|
||||
{
|
||||
// search for the first [ or @
|
||||
bracketFirstIndex = message.indexOf('[');
|
||||
mentionFirstIndex = mentionEnabled ? message.indexOf('@') : -1;
|
||||
mentionFirstIndex = message.indexOf('@');
|
||||
urlFirstIndex = message.indexOf(urlStarter);
|
||||
|
||||
bool startsWithBracket = (bracketFirstIndex != -1);
|
||||
@@ -298,20 +298,19 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
|
||||
}
|
||||
else if (index == mentionFirstIndex)
|
||||
{
|
||||
if (tabSupervisor->getIsLocalGame())
|
||||
int firstSpace = message.indexOf(" ");
|
||||
QString fullMentionUpToSpaceOrEnd = (firstSpace == -1) ? message.mid(1) : message.mid(1, firstSpace - 1);
|
||||
QString mentionIntact = fullMentionUpToSpaceOrEnd;
|
||||
|
||||
if ((!mentionEnabled && !isModeratorSendingGlobal(userLevel, fullMentionUpToSpaceOrEnd)) || tabSupervisor->getIsLocalGame())
|
||||
{
|
||||
cursor.insertText("@");
|
||||
message = message.mid(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
QMap<QString, UserListTWI *> userList = tabSupervisor->getUserListsTab()->getAllUsersList()->getUsers();
|
||||
|
||||
int firstSpace = message.indexOf(" ");
|
||||
QString fullMentionUpToSpaceOrEnd = (firstSpace == -1) ? message.mid(1) : message.mid(1, firstSpace - 1);
|
||||
QString mentionIntact = fullMentionUpToSpaceOrEnd;
|
||||
|
||||
do
|
||||
{
|
||||
if (isFullMentionAValidUser(userList, fullMentionUpToSpaceOrEnd)) // Is there a user online named this?
|
||||
|
||||
Reference in New Issue
Block a user