1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Multi-window: Fix group chat event flag regression

This commit is contained in:
TheSpiritXIII 2015-07-30 09:37:52 -04:00 committed by tux3
parent 828dbf436f
commit 280737fda8
2 changed files with 26 additions and 24 deletions

View File

@ -1127,7 +1127,7 @@ bool Widget::newFriendMessageAlert(int friendId)
return false;
}
bool Widget::newGroupMessageAlert(int groupId)
bool Widget::newGroupMessageAlert(int groupId, bool notify)
{
bool hasActive;
QWidget* currentWindow;
@ -1145,7 +1145,7 @@ bool Widget::newGroupMessageAlert(int groupId)
hasActive = g->getGroupWidget() == activeChatroomWidget;
}
if (newMessageAlert(currentWindow, hasActive))
if (newMessageAlert(currentWindow, hasActive, notify))
{
g->setEventFlag(true);
g->getGroupWidget()->updateStatusLight();
@ -1183,7 +1183,7 @@ QString Widget::fromDialogType(DialogType type)
}
}
bool Widget::newMessageAlert(QWidget* currentWindow, bool isActive)
bool Widget::newMessageAlert(QWidget* currentWindow, bool isActive, bool notify)
{
bool inactiveWindow = isMinimized() || !currentWindow->isActiveWindow();
@ -1193,6 +1193,8 @@ bool Widget::newMessageAlert(QWidget* currentWindow, bool isActive)
if (ui->statusButton->property("status").toString() == "busy")
return false;
if (notify)
{
QApplication::alert(currentWindow);
if (Settings::getInstance().getShowWindow())
@ -1216,6 +1218,7 @@ bool Widget::newMessageAlert(QWidget* currentWindow, bool isActive)
Audio::playMono16Sound(sndData);
}
}
return true;
}
@ -1438,8 +1441,7 @@ void Widget::onGroupMessageReceived(int groupnumber, int peernumber, const QStri
else
g->getChatForm()->addMessage(author, message, isAction, QDateTime::currentDateTime(), true);
if (targeted || Settings::getInstance().getGroupAlwaysNotify())
newGroupMessageAlert(g->getGroupId());
newGroupMessageAlert(g->getGroupId(), targeted || Settings::getInstance().getGroupAlwaysNotify());
}
void Widget::onGroupNamelistChanged(int groupnumber, int peernumber, uint8_t Change)

View File

@ -68,7 +68,7 @@ public:
void addFriendDialog(Friend* frnd, ContentDialog* dialog);
void addGroupDialog(Group* group, ContentDialog* dialog);
bool newFriendMessageAlert(int friendId);
bool newGroupMessageAlert(int groupId);
bool newGroupMessageAlert(int groupId, bool notify);
bool getIsWindowMinimized();
void updateIcons();
void clearContactsList();
@ -200,7 +200,7 @@ private:
};
private:
bool newMessageAlert(QWidget* currentWindow, bool isActive);
bool newMessageAlert(QWidget* currentWindow, bool isActive, bool notify = true);
void setActiveToolMenuButton(ActiveToolMenuButton newActiveButton);
void hideMainForms(GenericChatroomWidget* chatroomWidget);
Group *createGroup(int groupId);