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

Temp commit for debugging audio notifications

This commit is contained in:
Flynn 2014-06-28 14:56:51 -07:00
parent c43b612562
commit e6fc25aa52

View File

@ -347,7 +347,7 @@ void Widget::onFriendMessageReceived(int friendId, const QString& message)
if (activeFriendWidget != nullptr) if (activeFriendWidget != nullptr)
{ {
Friend* f2 = FriendList::findFriend(activeFriendWidget->friendId); Friend* f2 = FriendList::findFriend(activeFriendWidget->friendId);
if ((f->friendId != f2->friendId) || isFriendWidgetActive == 0) if (((f->friendId != f2->friendId) || isFriendWidgetActive == 0) || this->window()->isMinimized())
{ {
f->hasNewMessages = 1; f->hasNewMessages = 1;
newMessageAlert(); newMessageAlert();
@ -384,6 +384,7 @@ void Widget::newMessageAlert()
{ {
QApplication::alert(this, 1000); QApplication::alert(this, 1000);
QSound::play("audio/notification.wav"); QSound::play("audio/notification.wav");
qWarning() << "ping";
} }
void Widget::onFriendRequestReceived(const QString& userId, const QString& message) void Widget::onFriendRequestReceived(const QString& userId, const QString& message)
@ -424,7 +425,7 @@ void Widget::onGroupMessageReceived(int groupnumber, int friendgroupnumber, cons
g->chatForm->addGroupMessage(message, friendgroupnumber); g->chatForm->addGroupMessage(message, friendgroupnumber);
if (isGroupWidgetActive != 1 || (g->groupId != activeGroupWidget->groupId)) if ((isGroupWidgetActive != 1 || (g->groupId != activeGroupWidget->groupId)) || activeGroupWidget->windowState().testFlag(Qt::WindowMinimized))
{ {
if (message.contains(Settings::getInstance().getUsername(), Qt::CaseInsensitive)) if (message.contains(Settings::getInstance().getUsername(), Qt::CaseInsensitive))
{ {