now it's possible to fix your messages

This commit is contained in:
Blue 2022-03-28 23:25:33 +03:00
parent bf4a27f35d
commit 788c6ca556
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
13 changed files with 204 additions and 85 deletions

View file

@ -497,6 +497,17 @@ void Squawk::onConversationMessage(const Shared::Message& msg)
emit sendMessage(acc, msg);
}
void Squawk::onConversationReplaceMessage(const QString& originalId, const Shared::Message& msg)
{
Conversation* conv = static_cast<Conversation*>(sender());
QString acc = conv->getAccount();
rosterModel.changeMessage(acc, msg.getPenPalJid(), originalId, {
{"state", static_cast<uint>(Shared::Message::State::pending)}
});
emit replaceMessage(acc, originalId, msg);
}
void Squawk::onConversationResend(const QString& id)
{
Conversation* conv = static_cast<Conversation*>(sender());
@ -958,6 +969,7 @@ void Squawk::subscribeConversation(Conversation* conv)
{
connect(conv, &Conversation::destroyed, this, &Squawk::onConversationClosed);
connect(conv, &Conversation::sendMessage, this, &Squawk::onConversationMessage);
connect(conv, &Conversation::replaceMessage, this, &Squawk::onConversationReplaceMessage);
connect(conv, &Conversation::resendMessage, this, &Squawk::onConversationResend);
connect(conv, &Conversation::notifyableMessage, this, &Squawk::notify);
}