From e6fc25aa524b8547a0d34043ce4baa0d14cabb29 Mon Sep 17 00:00:00 2001 From: Flynn Date: Sat, 28 Jun 2014 14:56:51 -0700 Subject: [PATCH] Temp commit for debugging audio notifications --- widget/widget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/widget/widget.cpp b/widget/widget.cpp index bce8becd3..008ce0120 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -347,7 +347,7 @@ void Widget::onFriendMessageReceived(int friendId, const QString& message) if (activeFriendWidget != nullptr) { 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; newMessageAlert(); @@ -384,6 +384,7 @@ void Widget::newMessageAlert() { QApplication::alert(this, 1000); QSound::play("audio/notification.wav"); + qWarning() << "ping"; } 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); - 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)) {