File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
crates/rustyclaw-core/src/gateway Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -269,27 +269,27 @@ fn generic_messenger_config(
269269 } ,
270270 ) ) ,
271271 #[ cfg( feature = "whatsapp" ) ]
272- "whatsapp" => Some ( chat_system_config :: MessengerConfig :: WhatsApp (
273- chat_system_config :: WhatsAppConfig {
274- name : name . clone ( ) ,
275- db_path : messenger_state_dir ( "whatsapp" , & name ) ?
276- . join ( format ! ( "{name}.db" ) )
277- . to_string_lossy ( )
278- . into_owned ( ) ,
279- } ,
280- ) ) ,
272+ "whatsapp" => {
273+ let db_path = whatsapp_state_dir ( & name ) ?
274+ . join ( format ! ( "{name}.db" ) )
275+ . to_string_lossy ( )
276+ . into_owned ( ) ;
277+ Some ( chat_system_config :: MessengerConfig :: WhatsApp (
278+ chat_system_config :: WhatsAppConfig { name , db_path } ,
279+ ) )
280+ }
281281 _ => None ,
282282 } ;
283283
284284 Ok ( messenger)
285285}
286286
287287#[ cfg( feature = "whatsapp" ) ]
288- fn messenger_state_dir ( kind : & str , name : & str ) -> Result < std:: path:: PathBuf > {
288+ fn whatsapp_state_dir ( name : & str ) -> Result < std:: path:: PathBuf > {
289289 Ok ( dirs:: data_dir ( )
290290 . context ( "Failed to get data directory" ) ?
291291 . join ( "rustyclaw" )
292- . join ( kind )
292+ . join ( "whatsapp" )
293293 . join ( name) )
294294}
295295
You can’t perform that action at this time.
0 commit comments