Added invite info frame for Friend Request Messages.

This commit is contained in:
defnax 2017-02-07 17:01:36 +01:00
parent 90594bc9a6
commit 9226ccc5ca
6 changed files with 320 additions and 10 deletions

View file

@ -135,6 +135,7 @@ MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WindowFlags f
connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended()));
connect(ui.msgText, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl)));
connect(ui.sendinviteButton, SIGNAL(clicked()), this, SLOT(sendInvite()));
connect(NotifyQt::getInstance(), SIGNAL(messagesTagsChanged()), this, SLOT(messagesTagsChanged()));
connect(NotifyQt::getInstance(), SIGNAL(messagesChanged()), this, SLOT(messagesChanged()));
@ -173,6 +174,8 @@ MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WindowFlags f
}
ui.dateText-> setText("");
ui.inviteFrame->hide();
}
MessageWidget::~MessageWidget()
@ -478,6 +481,12 @@ void MessageWidget::fill(const std::string &msgId)
std::cerr << "MessageWidget::fill() Couldn't find Msg" << std::endl;
return;
}
if (msgInfo.msgflags & RS_MSG_USER_REQUEST){
ui.inviteFrame->show();
} else {
ui.inviteFrame->hide();
}
const std::list<FileInfo> &recList = msgInfo.files;
std::list<FileInfo>::const_iterator it;
@ -738,3 +747,20 @@ void MessageWidget::loadImagesAlways()
rsMail->MessageLoadEmbeddedImages(currMsgId, true);
}
void MessageWidget::sendInvite()
{
MessageInfo mi;
if (!rsMail)
return;
if (!rsMail->getMessage(currMsgId, mi))
return;
if ((QMessageBox::question(this, tr("Send invite?"),tr("Do you really want send a invite with your Certificate?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes)
{
MessageComposer::sendInvite(mi.rsgxsid_srcId);
}
}