edit icon next to the message showing if the message was edited and what was there a first

This commit is contained in:
Blue 2021-05-25 01:06:05 +03:00
parent 3f1fba4de2
commit 5f925217fc
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
4 changed files with 84 additions and 7 deletions

View file

@ -262,7 +262,7 @@ QVariant Models::MessageFeed::data(const QModelIndex& index, int role) const
answer = static_cast<unsigned int>(msg->getState());
break;
case Correction:
answer = msg->getEdited();
answer.setValue(fillCorrection(*msg));;
break;
case SentByMe:
answer = sentByMe(*msg);
@ -311,7 +311,7 @@ QVariant Models::MessageFeed::data(const QModelIndex& index, int role) const
item.date = msg->getTime();
item.state = msg->getState();
item.error = msg->getErrorText();
item.correction = msg->getEdited();
item.correction = fillCorrection(*msg);
QString body = msg->getBody();
if (body != msg->getOutOfBandUrl()) {
@ -480,6 +480,14 @@ Models::Attachment Models::MessageFeed::fillAttach(const Shared::Message& msg) c
return att;
}
Models::Edition Models::MessageFeed::fillCorrection(const Shared::Message& msg) const
{
::Models::Edition ed({msg.getEdited(), msg.getOriginalBody(), msg.getLastModified()});
return ed;
}
void Models::MessageFeed::downloadAttachment(const QString& messageId)
{
bool notify = false;