mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05: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
@ -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()) ;
|
||||
}
|
||||
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();
|
||||
// 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);
|
||||
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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user