fix: Don't sort message creating a protected group over a protection message (#4963)

Otherwise it looks like the message creating a protected group is not verified. For this, use
`sent_timestamp` of the received message as an upper limit of the sort timestamp (`msgs.timestamp`)
of the protection message. As the protection message is added to the chat earlier, this way its
timestamp is always less or eq than the received message's timestamp.
This commit is contained in:
iequidoo
2023-11-27 03:39:55 -03:00
committed by iequidoo
parent 63b4339ca0
commit 8b37b8c1fd
3 changed files with 20 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ use crate::context::Context;
use crate::events::EventType;
use crate::mimeparser::MimeMessage;
use crate::sync::Sync::*;
use crate::tools::time;
use crate::tools::{create_smeared_timestamp, time};
use crate::{chat, stock_str};
/// Starts the securejoin protocol with the QR `invite`.
@@ -192,6 +192,7 @@ impl BobState {
Blocked::Not,
ProtectionStatus::Unprotected, // protection is added later as needed
None,
create_smeared_timestamp(context),
)
.await?
}