@@ -155,6 +155,11 @@ fn do_initiate_key_transfer(context: &Context) -> Result<String> {
155
155
}
156
156
}
157
157
}
158
+ // no maybe_add_bcc_self_device_msg() here.
159
+ // the ui shows the dialog with the setup code on this device,
160
+ // it would be too much noise to have two things popping up at the same time.
161
+ // maybe_add_bcc_self_device_msg() is called on the other device
162
+ // once the transfer is completed.
158
163
Ok ( setup_code)
159
164
}
160
165
@@ -230,6 +235,21 @@ pub fn create_setup_code(_context: &Context) -> String {
230
235
ret
231
236
}
232
237
238
+ fn maybe_add_bcc_self_device_msg ( context : & Context ) -> Result < ( ) > {
239
+ if !context. sql . get_raw_config_bool ( context, "bcc_self" ) {
240
+ let mut msg = Message :: new ( Viewtype :: Text ) ;
241
+ // TODO: define this as a stockstring once the wording is settled.
242
+ msg. text = Some (
243
+ "It seems you are using multiple devices with Delta Chat. Great!\n \n \
244
+ If you also want to synchronize outgoing messages accross all devices, \
245
+ go to the settings and enable \" Send copy to self\" ."
246
+ . to_string ( ) ,
247
+ ) ;
248
+ chat:: add_device_msg ( context, & mut msg) ?;
249
+ }
250
+ Ok ( ( ) )
251
+ }
252
+
233
253
pub fn continue_key_transfer ( context : & Context , msg_id : MsgId , setup_code : & str ) -> Result < ( ) > {
234
254
ensure ! ( !msg_id. is_special( ) , "wrong id" ) ;
235
255
@@ -244,6 +264,7 @@ pub fn continue_key_transfer(context: &Context, msg_id: MsgId, setup_code: &str)
244
264
let sc = normalize_setup_code ( setup_code) ;
245
265
let armored_key = decrypt_setup_file ( context, & sc, file) ?;
246
266
set_self_key ( context, & armored_key, true , true ) ?;
267
+ maybe_add_bcc_self_device_msg ( context) ?;
247
268
248
269
Ok ( ( ) )
249
270
} else {
0 commit comments