[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
1
fork

Configure Feed

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

revert "feat: reply notification root uris"

+3 -29
-4
data-plane/indexing/plugins/reply.ts
··· 167 167 recordCid: string; 168 168 sortAt: string; 169 169 reasonSubject?: string; 170 - threadRootUri?: string; 171 170 }> = []; 172 171 const notified = new Set([obj.reply.authorDid]); 173 172 const maybeNotify = (notif: { ··· 178 177 recordCid: string; 179 178 sortAt: string; 180 179 reasonSubject?: string; 181 - threadRootUri?: string; 182 180 }) => { 183 181 if (!notified.has(notif.did)) { 184 182 notified.add(notif.did); ··· 213 211 recordUri: obj.reply.uri, 214 212 recordCid: obj.reply.cid, 215 213 sortAt: obj.reply.createdAt, 216 - threadRootUri: obj.reply.reply?.root.uri, 217 214 }); 218 215 // found hidden reply, don't notify any higher ancestors 219 216 if (threadgateHiddenReplies.includes(ancestorUri.toString())) break; ··· 235 232 recordUri: descendent.uri, 236 233 recordCid: descendent.cid, 237 234 sortAt: descendent.sortAt, 238 - threadRootUri: obj.reply.reply?.root.uri, 239 235 }); 240 236 } 241 237 }
-2
data-plane/indexing/processor.ts
··· 41 41 recordCid: string; 42 42 sortAt: string; 43 43 reasonSubject?: string; 44 - threadRootUri?: string; 45 44 }; 46 45 47 46 export class RecordProcessor<T, S> { ··· 375 374 author: notif.author, 376 375 recordUri: notif.recordUri, 377 376 reasonSubject: notif.reasonSubject, 378 - threadRootUri: notif.threadRootUri, 379 377 }); 380 378 }); 381 379 }
+3 -23
utils/push.ts
··· 8 8 author: string; 9 9 recordUri: string; 10 10 reasonSubject?: string; 11 - threadRootUri?: string; 12 11 } 13 12 14 13 export interface PushConfig { ··· 255 254 recordUri: payload.recordUri, 256 255 ...(payload.reasonSubject && 257 256 { reasonSubject: payload.reasonSubject }), 258 - ...(payload.threadRootUri && 259 - { threadRootUri: payload.threadRootUri }), 260 257 }, 261 258 }, 262 259 }; 263 260 264 261 // Add platform-specific options 265 262 if (token.platform === "ios") { 266 - const threadId = this.getIosThreadId(payload); 263 + const threadId = this.getThreadId(payload); 267 264 message.message.apns = { 268 265 headers: { 269 266 "apns-priority": "10", ··· 277 274 }, 278 275 }; 279 276 } else if (token.platform === "android") { 280 - const threadId = this.getAndroidTag(payload); 277 + const threadId = this.getThreadId(payload); 281 278 message.message.android = { 282 279 priority: "high", 283 280 notification: { ··· 513 510 return base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); 514 511 } 515 512 516 - private getIosThreadId(payload: PushPayload): string { 517 - if (payload.reason === "follow") { 518 - return "follows"; 519 - } 520 - if (payload.reason === "reply") { 521 - return payload.threadRootUri ?? payload.reasonSubject ?? 522 - payload.recordUri; 523 - } 524 - if (payload.reasonSubject) { 525 - return payload.reasonSubject; 526 - } 527 - return payload.recordUri; 528 - } 529 - 530 - private getAndroidTag(payload: PushPayload): string { 513 + private getThreadId(payload: PushPayload): string { 531 514 if (payload.reason === "follow") { 532 515 return "follows"; 533 - } 534 - if (payload.reason === "reply") { 535 - return payload.reasonSubject ?? payload.recordUri; 536 516 } 537 517 if (payload.reasonSubject) { 538 518 return payload.reasonSubject;