@@ -326,6 +326,14 @@ pub(crate) async fn handle_securejoin_handshake(
326
326
ChatId :: create_for_contact ( context, contact_id) . await ?;
327
327
}
328
328
329
+ // TODO Here we need to check that the token isn't too old (no more than 2 days)
330
+ // and if it is too old, then we need to put the chat into "Request" state.
331
+ // Except if `get_config(Config::IsBot)` is true, in this case we just continue normally.
332
+
333
+ // When the "Request" state is accepted (`ChatId::accept()`), we need to continue here. Also, we need to
334
+ // remember in the database that the user accepted a securejoin and the current timestamp.
335
+ // This probably needs to go into a new table `alicestate` or similar
336
+
329
337
// Alice -> Bob
330
338
send_alice_handshake_msg (
331
339
context,
@@ -432,6 +440,17 @@ pub(crate) async fn handle_securejoin_handshake(
432
440
info ! ( context, "Auth verified." , ) ;
433
441
context. emit_event ( EventType :: ContactsChanged ( Some ( contact_id) ) ) ;
434
442
inviter_progress ! ( context, contact_id, 600 ) ;
443
+
444
+ // TODO Here we need to check that the token isn't too old
445
+ // and if it is too old, then we need to put the chat into "Request" state.
446
+
447
+ // Except if `get_config(Config::IsBot)` is true, in this case we just continue normally.
448
+
449
+ // Except if the user already accepted the securejoin above in the last 2 days,
450
+ // in this case we just continue normally.
451
+
452
+ // When the "Request" state is accepted (in `ChatId::accept()`), we need to continue here.
453
+
435
454
if join_vg {
436
455
// the vg-member-added message is special:
437
456
// this is a normal Chat-Group-Member-Added message
0 commit comments