@@ -860,7 +860,7 @@ async fn main() {
860860 print ! ( ">> " ) ;
861861 std:: io:: stdout ( ) . flush ( ) . unwrap ( ) ;
862862
863- // let mut received_msgs = vec![];
863+ let mut received_msgs = vec ! [ ] ;
864864 let mut last_ft_guid = "AE271F00-2F67-42C4-8EF2-74600055A2B7" . to_string ( ) ;
865865
866866 let mut circle_session: Option < CircleServerSession < DefaultAnisetteProvider > > = None ;
@@ -932,46 +932,46 @@ async fn main() {
932932 // }
933933 // }
934934 // }
935- // let msg = client.handle(msg).await;
936- // if msg.is_err() {
937- // error!("Failed to receive {}", msg.err().unwrap());
938- // continue;
939- // }
940- // if let Ok(Some(msg)) = msg {
941- // if msg.has_payload() && !received_msgs.contains(&msg.id) {
942- // received_msgs.push(msg.id.clone());
943- // if let Message::ShareProfile(message) = &msg.message {
944- // if let Err(e) = name_photo_client.get_record(&message).await {
945- // error!("{e}");
946- // }
947- // }
948- // if let Message::UpdateProfile(UpdateProfileMessage { profile: Some(profile), .. }) = &msg.message {
949- // if let Ok(record) = name_photo_client.get_record(&profile).await {
950- // // handle_record(record, &client, &name_photo_client, &profile).await;
951- // }
952- // }
953- // if let Message::UpdateProfile(UpdateProfileMessage { profile: Some(profile), .. }) = &msg.message {
954- // if let Ok(record) = name_photo_client.get_record(&profile).await {
955- // // handle_record(record, &client, &name_photo_client, &profile).await;
956- // }
957- // }
958- // if let Message::SetTranscriptBackground(msg) = &msg.message {
959- // if let Some(mmcs) = msg.to_mmcs() {
960- // let mut output = vec![];
961- // let file = Cursor::new(&mut output);
962- // mmcs.get_attachment(&*connection, file, |a, b| { }).await.unwrap();
963- // SimplifiedTranscriptPoster::parse_payload(&output).unwrap();
964- // }
965- // }
966- // println!("{}", msg);
967- // print!(">> ");
968- // std::io::stdout().flush().unwrap();
969- // if let Some(context) = msg.certified_context {
970- // println!("sending delivered {}", msg.send_delivered);
971- // client.identity.certify_delivery("com.apple.madrid", &context, false).await.unwrap();
972- // }
973- // }
974- // }
935+ let msg = client. handle( msg) . await ;
936+ if msg. is_err( ) {
937+ error!( "Failed to receive {}" , msg. err( ) . unwrap( ) ) ;
938+ continue ;
939+ }
940+ if let Ok ( Some ( msg) ) = msg {
941+ if msg. has_payload( ) && !received_msgs. contains( & msg. id) {
942+ received_msgs. push( msg. id. clone( ) ) ;
943+ // if let Message::ShareProfile(message) = &msg.message {
944+ // if let Err(e) = name_photo_client.get_record(&message).await {
945+ // error!("{e}");
946+ // }
947+ // }
948+ // if let Message::UpdateProfile(UpdateProfileMessage { profile: Some(profile), .. }) = &msg.message {
949+ // if let Ok(record) = name_photo_client.get_record(&profile).await {
950+ // // handle_record(record, &client, &name_photo_client, &profile).await;
951+ // }
952+ // }
953+ // if let Message::UpdateProfile(UpdateProfileMessage { profile: Some(profile), .. }) = &msg.message {
954+ // if let Ok(record) = name_photo_client.get_record(&profile).await {
955+ // // handle_record(record, &client, &name_photo_client, &profile).await;
956+ // }
957+ // }
958+ // if let Message::SetTranscriptBackground(msg) = &msg.message {
959+ // if let Some(mmcs) = msg.to_mmcs() {
960+ // let mut output = vec![];
961+ // let file = Cursor::new(&mut output);
962+ // mmcs.get_attachment(&*connection, file, |a, b| { }).await.unwrap();
963+ // SimplifiedTranscriptPoster::parse_payload(&output).unwrap();
964+ // }
965+ // }
966+ println!( "{}" , msg) ;
967+ print!( ">> " ) ;
968+ std:: io:: stdout( ) . flush( ) . unwrap( ) ;
969+ if let Some ( context) = msg. certified_context {
970+ println!( "sending delivered {}" , msg. send_delivered) ;
971+ client. identity. certify_delivery( "com.apple.madrid" , & context, false ) . await . unwrap( ) ;
972+ }
973+ }
974+ }
975975 // },
976976 // input = &mut read_task => {
977977 // let Ok(input) = input else {
0 commit comments