fork to do stuff

cleanup

+13 -25
+11 -23
src/jetstream.rs
··· 191 191 let event: JetstreamEvent = serde_json::from_str(message)?; 192 192 let commit = event.commit.as_ref().unwrap(); // Safe because we checked above 193 193 194 - // Skip messages from our own DID 195 - // if let Some(ref own_did) = self.own_did { 196 - // if &event.did == own_did { 197 - // return Ok(()); 198 - // } 199 - // } 200 - 201 194 // Parse the blip record 202 195 let record_data = commit.record.as_ref(); 203 196 if record_data.is_none() { ··· 209 202 Err(_) => return Ok(()), // Silently skip unparseable records 210 203 }; 211 204 212 - // Get or resolve the handle 213 - let mut handle = self.resolve_did(&event.did).await; 214 - let mut is_own = false; 215 - 216 - if let Some(ref own_did) = self.own_did { 217 - if &event.did == own_did { 218 - is_own = true; 219 - handle = String::from("you"); 220 - } 221 - } 205 + let is_own = self.own_did.as_ref().is_some_and(|own| own == &event.did); 206 + let handle = if is_own { 207 + "you".into() 208 + } else { 209 + // Get or resolve the handle 210 + self.resolve_did(&event.did).await 211 + }; 222 212 223 213 // Create TUI message 224 214 let tui_message = TuiMessage::new( 225 215 handle, 226 216 blip_record.content, 227 - is_own, // Not our own message 228 - Some( 229 - DateTime::parse_from_rfc3339(&blip_record.created_at) 230 - .unwrap() 231 - .with_timezone(&Utc), 232 - ), 217 + is_own, 218 + DateTime::parse_from_rfc3339(&blip_record.created_at) 219 + .map(|dt| dt.with_timezone(&Utc)) 220 + .ok(), // Parse RFC3339 → UTC, None if invalid (so current timestamp instead) 233 221 ); 234 222 235 223 // Send to TUI
+2 -2
src/tui.rs
··· 294 294 .rev() 295 295 .find(|m| m.is_own) 296 296 .is_some_and(|m| m.timestamp == message.timestamp); 297 - // TODO: some messages getting flagged as duplicates if it's the same content as previous separate message from you 298 297 299 298 if duplicate { 300 - continue; // skip this while iteration 299 + continue; 301 300 } 301 + 302 302 app.add_message(message); 303 303 app.set_connection_status(true); 304 304 }