mod global msg overrides settings
This commit is contained in:
parent
1bda6e53b2
commit
ae4436ade7
1 changed files with 6 additions and 7 deletions
|
@ -171,7 +171,7 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
|
||||||
{
|
{
|
||||||
// search for the first [ or @
|
// search for the first [ or @
|
||||||
bracketFirstIndex = message.indexOf('[');
|
bracketFirstIndex = message.indexOf('[');
|
||||||
mentionFirstIndex = mentionEnabled ? message.indexOf('@') : -1;
|
mentionFirstIndex = message.indexOf('@');
|
||||||
urlFirstIndex = message.indexOf(urlStarter);
|
urlFirstIndex = message.indexOf(urlStarter);
|
||||||
|
|
||||||
bool startsWithBracket = (bracketFirstIndex != -1);
|
bool startsWithBracket = (bracketFirstIndex != -1);
|
||||||
|
@ -298,20 +298,19 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
|
||||||
}
|
}
|
||||||
else if (index == mentionFirstIndex)
|
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("@");
|
cursor.insertText("@");
|
||||||
message = message.mid(1);
|
message = message.mid(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
QMap<QString, UserListTWI *> userList = tabSupervisor->getUserListsTab()->getAllUsersList()->getUsers();
|
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
|
do
|
||||||
{
|
{
|
||||||
if (isFullMentionAValidUser(userList, fullMentionUpToSpaceOrEnd)) // Is there a user online named this?
|
if (isFullMentionAValidUser(userList, fullMentionUpToSpaceOrEnd)) // Is there a user online named this?
|
||||||
|
|
Loading…
Reference in a new issue