A personal app view to see Bsky posts of your followers (for when their app view goes down)
17
fork

Configure Feed

Select the types of activity you want to include in your feed.

combine post and repost to same model to make easier

Signed-off-by: Will Andrews <did:plc:dadhhalkfcq3gucaq25hjqon>

+9 -9
+9 -9
src/tap.rs
··· 154 154 async fn handle_repost_event(record: &RecordEvent, pool: &sqlx::SqlitePool) { 155 155 match record.action { 156 156 RecordAction::Create => { 157 - let tap_post: TapRepost = record.parse_record().unwrap(); // TODO: better error handling here 157 + let tap_post: TapPost = record.parse_record().unwrap(); // TODO: better error handling here 158 158 let cid: String = match record.cid.clone() { 159 159 Some(x) => x.to_string(), 160 160 None => "".to_string(), 161 161 }; 162 + 163 + let subject: String = match tap_post.subject { 164 + Some(x) => x.uri.clone().to_string(), 165 + None => "".to_string(), 166 + }; 167 + 162 168 let mut repost = RepostRecord { 163 169 created: Utc::now(), 164 170 indexed: Utc::now(), 165 171 author: record.did.clone().to_string(), 166 172 rkey: record.rkey.to_string(), 167 - subject: tap_post.subject.uri, 173 + subject: subject, 168 174 cid: cid, 169 175 }; 170 176 ··· 213 219 struct TapPost { 214 220 #[serde(rename = "createdAt")] 215 221 created_at: String, 216 - } 217 - 218 - #[derive(Debug, Deserialize)] 219 - struct TapRepost { 220 - #[serde(rename = "createdAt")] 221 - created_at: String, 222 - subject: Subject, 222 + subject: Option<Subject>, 223 223 } 224 224 225 225 #[derive(Debug, Deserialize)]