diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index daa7f77c4..115bac905 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -1097,13 +1097,15 @@ void MessagesDialog::insertMessages() // From .... { + bool setText = true; if (msgbox == RS_MSG_INBOX || msgbox == RS_MSG_OUTBOX) { if ((it->msgflags & RS_MSG_SYSTEM) && it->srcId == ownId) { text = "RetroShare"; } else { if (it->msgflags & RS_MSG_DISTANT) - { + { // distant message + setText = false; if (gotInfo || rsMsgs->getMessage(it->msgId, msgInfo)) { gotInfo = true; item->setId(RsGxsId(msgInfo.rsgxsid_srcId), COLUMN_FROM); @@ -1146,15 +1148,17 @@ void MessagesDialog::insertMessages() std::cerr << "MessagesDialog::insertMsgTxtAndFiles() Couldn't find Msg" << std::endl; } } - if(it->msgflags & RS_MSG_DISTANT) - { + if (setText) + { item->setText(COLUMN_FROM, text); item->setData(COLUMN_FROM, ROLE_SORT, text + dateString); + } else { + item->setData(COLUMN_FROM, ROLE_SORT, item->text(COLUMN_FROM) + dateString); } } // Subject - text = QString::fromUtf8(it->title.c_str()); + text = QString::fromUtf8(it->title.c_str()); item->setText(COLUMN_SUBJECT, text); item->setData(COLUMN_SUBJECT, ROLE_SORT, text + dateString); diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp index 6cceecb11..14748d5a8 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp @@ -203,10 +203,11 @@ bool GxsIdDetails::process(const RsGxsId &id, GxsIdDetailsCallbackFunction callb // without one timer tick, but it causes the use of Pixmap in avatars within a threat that is different than // the GUI thread, which is not allowed by Qt => some avatars fail to load. - // if (rsIdentity && rsIdentity->getIdDetails(id, details)) { - // callback(GXS_ID_DETAILS_TYPE_DONE, details, object, data); - // return true; - // } + bool isGuiThread = (QThread::currentThread() == qApp->thread()); + if (isGuiThread && rsIdentity && rsIdentity->getIdDetails(id, details)) { + callback(GXS_ID_DETAILS_TYPE_DONE, details, object, data); + return true; + } details.mId = id; @@ -233,7 +234,7 @@ bool GxsIdDetails::process(const RsGxsId &id, GxsIdDetailsCallbackFunction callb } /* Start timer */ - if (QThread::currentThread() == qApp->thread()) { + if (isGuiThread) { /* Start timer directly */ mInstance->doStartTimer(); } else {