fixed notification display for msgs

This commit is contained in:
csoler 2019-03-26 11:47:11 +01:00
parent 1d4934b71e
commit f404962b51
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
3 changed files with 13 additions and 4 deletions

View File

@ -215,7 +215,7 @@ MessagesDialog::MessagesDialog(QWidget *parent)
ui.messageTreeWidget->setSortingEnabled(true);
/* Set header sizes for the fixed columns and resize modes, must be set after processSettings */
msgwheader->setStretchLastSection(false);
msgwheader->setStretchLastSection(true);
// fill folder list

View File

@ -144,7 +144,13 @@ public:
float f = fm.height();
QIcon icon ;
if(! computeNameIconAndComment(id,str,icon,comment))
if(id.isNull())
{
str = tr("[Notification]");
icon = QIcon(":/icons/logo_128.png");
}
else if(! computeNameIconAndComment(id,str,icon,comment))
if(mReloadPeriod > 3)
{
str = tr("[Unknown]");
@ -193,7 +199,10 @@ public:
QList<QIcon> icons;
if(rsPeers->isFriend(RsPeerId(id))) // horrible trick because some widgets still use locations as IDs (e.g. messages)
{
name = QString::fromUtf8(rsPeers->getPeerName(RsPeerId(id)).c_str()) ;
icon = QIcon(":/icons/avatar_128.png");
}
else if(!GxsIdDetails::MakeIdDesc(id, true, name, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR))
return false;
else

View File

@ -600,8 +600,8 @@ void MessageWidget::fill(const std::string &msgId)
link = RetroShareLink::createMessage(msgInfo.rspeerid_srcId, "");
}
if ((msgInfo.msgflags & RS_MSG_SYSTEM) && msgInfo.rspeerid_srcId == ownId) {
ui.fromText->setText("RetroShare");
if (((msgInfo.msgflags & RS_MSG_SYSTEM) && msgInfo.rspeerid_srcId == ownId) || msgInfo.rspeerid_srcId.isNull()) {
ui.fromText->setText("[Notification]");
if (toolButtonReply) toolButtonReply->setEnabled(false);
} else {
ui.fromText->setText(link.toHtml());