diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 2f43120ac..331aed893 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -403,7 +403,7 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title) continue; QString name; - if (chatId.isLobbyId() || chatId.isDistantChatId()) + if (chatId.isLobbyId() || chatId.isDistantChatId() || chatId.isPeerId()) { RsIdentityDetails details; diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp index 19ffdac90..9f5f88e74 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp @@ -44,12 +44,8 @@ #define ROLE_PLAINTEXT Qt::UserRole + 1 ImHistoryBrowserCreateItemsThread::ImHistoryBrowserCreateItemsThread(ImHistoryBrowser *parent, const ChatId& peerId) - : QThread(parent) -{ - m_chatId = peerId; - m_historyBrowser = parent; - stopped = false; -} + : QThread(parent), m_historyBrowser(parent), m_chatId(peerId), stopped(false) +{} ImHistoryBrowserCreateItemsThread::~ImHistoryBrowserCreateItemsThread() { @@ -285,10 +281,12 @@ void ImHistoryBrowser::fillItem(QListWidgetItem *itemWidget, HistoryMsg& msg) QString name; if (m_chatId.isLobbyId() || m_chatId.isDistantChatId()) { RsIdentityDetails details; - if (rsIdentity->getIdDetails(RsGxsId(msg.peerName), details)) + if (rsIdentity->getIdDetails(RsGxsId(msg.peerId), details)) name = QString::fromUtf8(details.mNickname.c_str()); - else + else if(!msg.peerName.empty()) name = QString::fromUtf8(msg.peerName.c_str()); + else + name = QString::fromUtf8(msg.peerId.toStdString().c_str()); } else { name = QString::fromUtf8(msg.peerName.c_str()); } diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index b635703d7..dd33495b9 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -618,13 +618,13 @@ QString RsHtml::formatText(QTextDocument *textDocument, const QString &text, ulo QString errorMsg; int errorLine; int errorColumn; - QDomDocument doc; + QDomDocument doc; if (doc.setContent(formattedText, &errorMsg, &errorLine, &errorColumn) == false) { - // convert text with QTextBrowser - QTextBrowser textBrowser; - textBrowser.setText(text); - formattedText=textBrowser.toHtml(); + // convert text with QTextDocument + QTextDocument textDoc; + textDoc.setPlainText(text); + formattedText=textDoc.toHtml(); formattedText.remove(0,formattedText.indexOf("<")); formattedText=saveSpace(formattedText); doc.setContent(formattedText, &errorMsg, &errorLine, &errorColumn);