From 6b2bc7d84ba4530145b65db2d8f18b789e5434ab Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 12 Aug 2017 13:40:28 +0200 Subject: [PATCH] Fix From text in Mail Missing lines in Change RetroShareLink creation methodes as static --- retroshare-gui/src/gui/RetroShareLink.cpp | 5 ++-- retroshare-gui/src/gui/msgs/MessageWidget.cpp | 28 +++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index e0559d272..21e253fc1 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -316,16 +316,15 @@ void RetroShareLink::fromUrl(const QUrl& url) RsGxsId id(gxsid.toStdString()) ; if(!id.isNull()) - createIdentity(id,name,radix) ; + *this = createIdentity(id,name,radix) ; else std::cerr << "(EE) identity link is not valid." << std::endl; return ; } if (url.host() == HOST_MESSAGE) { - _type = TYPE_MESSAGE; std::string id = urlQuery.queryItemValue(MESSAGE_ID).toStdString(); - createMessage(RsPeerId(id), urlQuery.queryItemValue(MESSAGE_SUBJECT)); + *this = createMessage(RsPeerId(id), urlQuery.queryItemValue(MESSAGE_SUBJECT)); return; } diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index b0f78a923..fa3ecf5c0 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -579,7 +579,7 @@ void MessageWidget::fill(const std::string &msgId) ui.dateText->setText(DateTime::formatDateTime(msgInfo.ts)); RsPeerId ownId = rsPeers->getOwnId(); - QString tooltip_string ; + QString tooltip_string ; // if ((msgInfo.msgflags & RS_MSG_BOXMASK) == RS_MSG_OUTBOX) // outgoing message are from me // { @@ -587,27 +587,27 @@ void MessageWidget::fill(const std::string &msgId) // link.createMessage(ownId, ""); // } - if(msgInfo.msgflags & RS_MSG_DISTANT) // distant message - { - tooltip_string = PeerDefs::rsidFromId(msgInfo.rsgxsid_srcId) ; - link.createMessage(msgInfo.rsgxsid_srcId, ""); - } - else - { - tooltip_string = PeerDefs::rsidFromId(msgInfo.rspeerid_srcId) ; - link.createMessage(msgInfo.rspeerid_srcId, ""); - } + if(msgInfo.msgflags & RS_MSG_DISTANT) // distant message + { + tooltip_string = PeerDefs::rsidFromId(msgInfo.rsgxsid_srcId) ; + link = RetroShareLink::createMessage(msgInfo.rsgxsid_srcId, ""); + } + else + { + tooltip_string = PeerDefs::rsidFromId(msgInfo.rspeerid_srcId) ; + link = RetroShareLink::createMessage(msgInfo.rspeerid_srcId, ""); + } - if ((msgInfo.msgflags & RS_MSG_SYSTEM) && msgInfo.rspeerid_srcId == ownId) { + if ((msgInfo.msgflags & RS_MSG_SYSTEM) && msgInfo.rspeerid_srcId == ownId) { ui.fromText->setText("RetroShare"); } else { ui.fromText->setText(link.toHtml()); ui.fromText->setToolTip(tooltip_string) ; } - ui.subjectText->setText(QString::fromUtf8(msgInfo.title.c_str())); + ui.subjectText->setText(QString::fromUtf8(msgInfo.title.c_str())); - // emoticons disabled because of crazy cost. + // emoticons disabled because of crazy cost. //text = RsHtmlMsg(msgInfo.msgflags).formatText(ui.msgText->document(), QString::fromUtf8(msgInfo.msg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS); text = RsHtmlMsg(msgInfo.msgflags).formatText(ui.msgText->document(), QString::fromUtf8(msgInfo.msg.c_str()), RSHTML_FORMATTEXT_EMBED_LINKS); ui.msgText->resetImagesStatus(Settings->getMsgLoadEmbeddedImages() || (msgInfo.msgflags & RS_MSG_LOAD_EMBEDDED_IMAGES));