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 {
87
87
/// `Secure-Join-Fingerprint` header for `{vc,vg}-request-with-auth` messages.
88
88
Arg3 = b'G' ,
89
89
90
- /// For Messages
90
+ /// Deprecated `Secure-Join-Group` header for messages.
91
91
Arg4 = b'H' ,
92
92
93
93
/// For Messages
Original file line number Diff line number Diff line change @@ -1125,6 +1125,14 @@ mod tests {
1125
1125
assert_eq ! ( msg. get_header( HeaderDef :: SecureJoin ) . unwrap( ) , "vg-request" ) ;
1126
1126
assert ! ( msg. get_header( HeaderDef :: SecureJoinInvitenumber ) . is_some( ) ) ;
1127
1127
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
+
1128
1136
// Step 3: Alice receives vg-request, sends vg-auth-required
1129
1137
alice. recv_msg ( & sent) . await ;
1130
1138
Original file line number Diff line number Diff line change @@ -378,14 +378,21 @@ async fn send_handshake_message(
378
378
// Sends our own fingerprint in the Secure-Join-Fingerprint header.
379
379
let bob_fp = load_self_public_key ( context) . await ?. fingerprint ( ) ;
380
380
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
+ }
381
393
}
382
394
} ;
383
395
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
-
389
396
chat:: send_msg ( context, chat_id, & mut msg) . await ?;
390
397
Ok ( ( ) )
391
398
}
You can’t perform that action at this time.
0 commit comments