Merge pull request #2177 from defnax/fix-invite-message

Fix to hide the Invite Button when its a Friend Request Message
This commit is contained in:
defnax 2020-12-21 13:48:49 +01:00 committed by GitHub
commit e367a1f698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 22 deletions

View File

@ -117,19 +117,28 @@ void MsgItem::updateItemStatic()
if (!mIsHome)
{
if (mi.msgflags & RS_MSG_USER_REQUEST)
{
title = QString::fromUtf8(mi.title.c_str()) + " " + tr("from") + " " + srcName;
replyButton->setText(tr("Reply to invite"));
subjectLabel->hide();
inviteFrame->show();
}
else
{
title = tr("Message From") + ": " + srcName;
sendinviteButton->hide();
inviteFrame->hide();
}
if ((mi.msgflags & RS_MSG_USER_REQUEST) && (!mi.rsgxsid_srcId.isNull()))
{
title = QString::fromUtf8(mi.title.c_str()) + " " + tr("from") + " " + srcName;
replyButton->setText(tr("Reply to invite"));
subjectLabel->hide();
inviteFrame->show();
}
else if ((mi.msgflags & RS_MSG_USER_REQUEST) && mi.rsgxsid_srcId.isNull())
{
title = QString::fromUtf8(mi.title.c_str()) + " " + " " + srcName;
subjectLabel->hide();
inviteFrame->show();
infoLabel->setText(tr("This message invites you to make friend! You may accept this request."));
sendinviteButton->hide();
replyButton->hide();
}
else
{
title = tr("Message From") + ": " + srcName;
sendinviteButton->hide();
inviteFrame->hide();
}
}
else
{

View File

@ -161,10 +161,6 @@
<property name="text">
<string>Reply Message</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/mail_reply.png</normaloff>:/images/mail_reply.png</iconset>
</property>
</widget>
</item>
<item>

View File

@ -541,11 +541,17 @@ void MessageWidget::fill(const std::string &msgId)
return;
}
if (msgInfo.msgflags & RS_MSG_USER_REQUEST){
ui.inviteFrame->show();
} else {
ui.inviteFrame->hide();
}
if ((msgInfo.msgflags & RS_MSG_USER_REQUEST) && msgInfo.rsgxsid_srcId.isNull()){
ui.inviteFrame->show();
ui.sendInviteButton->hide();
ui.infoLabel->setText(tr("You got an invite to make friend! You may accept this request."));
} else if ((msgInfo.msgflags & RS_MSG_USER_REQUEST) && (!msgInfo.rsgxsid_srcId.isNull())){
ui.inviteFrame->show();
ui.sendInviteButton->show();
ui.infoLabel->setText(tr("You got an invite to make friend! You may accept this request and send your own Certificate back"));
} else {
ui.inviteFrame->hide();
}
const std::list<FileInfo> &recList = msgInfo.files;
std::list<FileInfo>::const_iterator it;