Fix Lobby's sound notification.

Lobby "message arrived" sound play depends of notify ChatRooms settings.
This commit is contained in:
Phenom 2017-05-08 15:29:11 +02:00
parent add529ffd3
commit a869a37802
2 changed files with 23 additions and 23 deletions

View File

@ -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 <unistd.h>
#include <QMessageBox>
#include <QInputDialog>
#include <QMenu>
#include <QMessageBox>
#include <QWidgetAction>
#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 <gui/common/html.h>
#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 <retroshare/rsnotify.h>
#include <time.h>
#include <unistd.h>
#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;

View File

@ -21,15 +21,19 @@
#include <QTime>
#include <QMenu>
#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 <retroshare/rsidentity.h>
#include <util/HandleRichText.h>
#include <retroshare/rsidentity.h>
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)