File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ pub enum Param {
8787 /// `Secure-Join-Fingerprint` header for `{vc,vg}-request-with-auth` messages.
8888 Arg3 = b'G' ,
8989
90- /// For Messages
90+ /// Deprecated `Secure-Join-Group` header for messages.
9191 Arg4 = b'H' ,
9292
9393 /// For Messages
Original file line number Diff line number Diff line change @@ -1125,6 +1125,14 @@ mod tests {
11251125 assert_eq ! ( msg. get_header( HeaderDef :: SecureJoin ) . unwrap( ) , "vg-request" ) ;
11261126 assert ! ( msg. get_header( HeaderDef :: SecureJoinInvitenumber ) . is_some( ) ) ;
11271127
1128+ // Old Delta Chat core sent `Secure-Join-Group` header in `vg-request`,
1129+ // but it was only used by Alice in `vg-request-with-auth`.
1130+ // New Delta Chat versions do not use `Secure-Join-Group` header at all
1131+ // and it is deprecated.
1132+ // Now `Secure-Join-Group` header
1133+ // is only sent in `vg-request-with-auth` for compatibility.
1134+ assert ! ( msg. get_header( HeaderDef :: SecureJoinGroup ) . is_none( ) ) ;
1135+
11281136 // Step 3: Alice receives vg-request, sends vg-auth-required
11291137 alice. recv_msg ( & sent) . await ;
11301138
Original file line number Diff line number Diff line change @@ -378,14 +378,21 @@ async fn send_handshake_message(
378378 // Sends our own fingerprint in the Secure-Join-Fingerprint header.
379379 let bob_fp = load_self_public_key ( context) . await ?. fingerprint ( ) ;
380380 msg. param . set ( Param :: Arg3 , bob_fp. hex ( ) ) ;
381+
382+ // Sends the grpid in the Secure-Join-Group header.
383+ //
384+ // `Secure-Join-Group` header is deprecated,
385+ // but old Delta Chat core requires that Alice receives it.
386+ //
387+ // Previous Delta Chat core also sent `Secure-Join-Group` header
388+ // in `vg-request` messages,
389+ // but it was not used on the receiver.
390+ if let QrInvite :: Group { ref grpid, .. } = invite {
391+ msg. param . set ( Param :: Arg4 , grpid) ;
392+ }
381393 }
382394 } ;
383395
384- // Sends the grpid in the Secure-Join-Group header.
385- if let QrInvite :: Group { ref grpid, .. } = invite {
386- msg. param . set ( Param :: Arg4 , grpid) ;
387- }
388-
389396 chat:: send_msg ( context, chat_id, & mut msg) . await ?;
390397 Ok ( ( ) )
391398}
You can’t perform that action at this time.
0 commit comments