diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 1e5361ead..dd1a52290 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -19,41 +19,37 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * - * ccr . 2016 Jan 26 - * - * Play sound on incoming messages. - * ****************************************************************/ -#include -#include #include #include +#include #include #include "ChatLobbyDialog.h" -#include "util/QtVersion.h" -#include "gui/ChatLobbyWidget.h" + #include "ChatTabWidget.h" -#include "gui/settings/rsharesettings.h" -#include "gui/settings/RsharePeerSettings.h" -#include "gui/MainWindow.h" +#include "gui/ChatLobbyWidget.h" #include "gui/FriendsDialog.h" -#include "gui/msgs/MessageComposer.h" -#include -#include "gui/common/RSTreeWidgetItem.h" +#include "gui/MainWindow.h" +#include "gui/common/html.h" #include "gui/common/FriendSelectionDialog.h" -#include "gui/gxs/GxsIdTreeWidgetItem.h" +#include "gui/common/RSTreeWidgetItem.h" #include "gui/gxs/GxsIdChooser.h" #include "gui/gxs/GxsIdDetails.h" -#include "util/HandleRichText.h" -#include "gui/SoundManager.h" +#include "gui/gxs/GxsIdTreeWidgetItem.h" #include "gui/Identity/IdDialog.h" +#include "gui/msgs/MessageComposer.h" +#include "gui/settings/RsharePeerSettings.h" +#include "gui/settings/rsharesettings.h" +#include "util/HandleRichText.h" +#include "util/QtVersion.h" #include #include +#include #define COLUMN_NAME 0 #define COLUMN_ACTIVITY 1 @@ -477,7 +473,6 @@ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg) ui.chatWidget->addChatMsg(msg.incoming, name, gxs_id, sendTime, recvTime, message, ChatWidget::MSGTYPE_NORMAL); emit messageReceived(msg.incoming, id(), sendTime, name, message) ; - SoundManager::play(SOUND_NEW_LOBBY_MESSAGE); // This is a trick to translate HTML into text. QTextEdit editor; diff --git a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp index 15cb3d942..ddfa24426 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp @@ -21,15 +21,19 @@ #include #include + #include "ChatLobbyUserNotify.h" -#include "gui/notifyqt.h" -#include "gui/MainWindow.h" + #include "gui/ChatLobbyWidget.h" +#include "gui/MainWindow.h" +#include "gui/notifyqt.h" +#include "gui/SoundManager.h" #include "gui/settings/rsharesettings.h" #include "util/DateTime.h" -#include #include +#include + ChatLobbyUserNotify::ChatLobbyUserNotify(QObject *parent) : UserNotify(parent) { @@ -273,8 +277,9 @@ void ChatLobbyUserNotify::chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime ti _listMsg[lobby_id][strAnchor]=msgData; emit countChanged(lobby_id, _listMsg[lobby_id].size()); - updateIcon(); -} + updateIcon(); + SoundManager::play(SOUND_NEW_LOBBY_MESSAGE); + } } bool ChatLobbyUserNotify::checkWord(QString message, QString word)