From 8d494ecaf8703ef958a4b7b1c78c2834454204cf Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 7 Mar 2015 14:06:10 +0000 Subject: [PATCH] fixed display of systray message for chat lobbies git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7991 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/chat/ChatLobbyDialog.cpp | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 5eb35b93f..81ad956f5 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -322,7 +322,10 @@ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg) QString message = QString::fromUtf8(msg.msg.c_str()); RsGxsId gxs_id = msg.lobby_peer_gxs_id ; - if(!isParticipantMuted(gxs_id)) { // We could change addChatMsg to display the peers icon, passing a ChatId + if(!isParticipantMuted(gxs_id)) + { + // We could change addChatMsg to display the peers icon, passing a ChatId + RsIdentityDetails details ; QString name ; @@ -331,19 +334,19 @@ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg) else name = QString::fromUtf8(msg.peer_alternate_nickname.c_str()) + " (" + QString::fromStdString(gxs_id.toStdString()) + ")" ; - ui.chatWidget->addChatMsg(msg.incoming, name, sendTime, recvTime, message, ChatWidget::MSGTYPE_NORMAL); - emit messageReceived(id()) ; - } - - // This is a trick to translate HTML into text. - QTextEdit editor; - editor.setHtml(message); - QString notifyMsg = QString::fromStdString(gxs_id.toStdString()) + ": " + editor.toPlainText(); + ui.chatWidget->addChatMsg(msg.incoming, name, sendTime, recvTime, message, ChatWidget::MSGTYPE_NORMAL); + emit messageReceived(id()) ; - if(notifyMsg.length() > 30) - MainWindow::displayLobbySystrayMsg(tr("Lobby chat") + ": " + _lobby_name, notifyMsg.left(30) + QString("...")); - else - MainWindow::displayLobbySystrayMsg(tr("Lobby chat") + ": " + _lobby_name, notifyMsg); + // This is a trick to translate HTML into text. + QTextEdit editor; + editor.setHtml(message); + QString notifyMsg = name + ": " + editor.toPlainText(); + + if(notifyMsg.length() > 30) + MainWindow::displayLobbySystrayMsg(tr("Lobby chat") + ": " + _lobby_name, notifyMsg.left(30) + QString("...")); + else + MainWindow::displayLobbySystrayMsg(tr("Lobby chat") + ": " + _lobby_name, notifyMsg); + } // also update peer list.