mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-09-27 03:41:07 -04:00
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
This commit is contained in:
parent
4017a91932
commit
8d494ecaf8
1 changed files with 16 additions and 13 deletions
|
@ -322,7 +322,10 @@ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg)
|
||||||
QString message = QString::fromUtf8(msg.msg.c_str());
|
QString message = QString::fromUtf8(msg.msg.c_str());
|
||||||
RsGxsId gxs_id = msg.lobby_peer_gxs_id ;
|
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 ;
|
RsIdentityDetails details ;
|
||||||
|
|
||||||
QString name ;
|
QString name ;
|
||||||
|
@ -331,19 +334,19 @@ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg)
|
||||||
else
|
else
|
||||||
name = QString::fromUtf8(msg.peer_alternate_nickname.c_str()) + " (" + QString::fromStdString(gxs_id.toStdString()) + ")" ;
|
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);
|
ui.chatWidget->addChatMsg(msg.incoming, name, sendTime, recvTime, message, ChatWidget::MSGTYPE_NORMAL);
|
||||||
emit messageReceived(id()) ;
|
emit messageReceived(id()) ;
|
||||||
}
|
|
||||||
|
|
||||||
// This is a trick to translate HTML into text.
|
// This is a trick to translate HTML into text.
|
||||||
QTextEdit editor;
|
QTextEdit editor;
|
||||||
editor.setHtml(message);
|
editor.setHtml(message);
|
||||||
QString notifyMsg = QString::fromStdString(gxs_id.toStdString()) + ": " + editor.toPlainText();
|
QString notifyMsg = name + ": " + editor.toPlainText();
|
||||||
|
|
||||||
if(notifyMsg.length() > 30)
|
if(notifyMsg.length() > 30)
|
||||||
MainWindow::displayLobbySystrayMsg(tr("Lobby chat") + ": " + _lobby_name, notifyMsg.left(30) + QString("..."));
|
MainWindow::displayLobbySystrayMsg(tr("Lobby chat") + ": " + _lobby_name, notifyMsg.left(30) + QString("..."));
|
||||||
else
|
else
|
||||||
MainWindow::displayLobbySystrayMsg(tr("Lobby chat") + ": " + _lobby_name, notifyMsg);
|
MainWindow::displayLobbySystrayMsg(tr("Lobby chat") + ": " + _lobby_name, notifyMsg);
|
||||||
|
}
|
||||||
|
|
||||||
// also update peer list.
|
// also update peer list.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue