|
|
|
@ -513,8 +513,9 @@ void Conversation::onFeedContext(const QPoint& pos)
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool hasAttach = item->getAttachPath() > 0 || item->getOutOfBandUrl() > 0; |
|
|
|
|
//the only mandatory condition - is for the message to be outgoing, the rest is just a good intention on the server
|
|
|
|
|
if (item->getOutgoing() && index.row() < 100 && item->getTime().daysTo(QDateTime::currentDateTimeUtc()) < 20) { |
|
|
|
|
if (item->getOutgoing() && !hasAttach && index.row() < 100 && item->getTime().daysTo(QDateTime::currentDateTimeUtc()) < 20) { |
|
|
|
|
showMenu = true; |
|
|
|
|
QAction* edit = contextMenu->addAction(Shared::icon("edit-rename"), tr("Edit")); |
|
|
|
|
connect(edit, &QAction::triggered, this, std::bind(&Conversation::onMessageEditRequested, this, id)); |
|
|
|
@ -549,6 +550,10 @@ void Conversation::onMessageEditRequested(const QString& id)
|
|
|
|
|
m_ui->currentActionBadge->setText(tr("Editing message...")); |
|
|
|
|
currentAction = CurrentAction::edit; |
|
|
|
|
m_ui->messageEditor->setText(msg.getBody()); |
|
|
|
|
QString path = msg.getAttachPath(); |
|
|
|
|
if (path.size() > 0) { |
|
|
|
|
addAttachedFile(path); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} catch (const Models::MessageFeed::NotFound& e) { |
|
|
|
|
qDebug() << "The message requested to be edited was not found" << e.getMessage().c_str(); |
|
|
|
|