fix: improve task event filtering in activities feed
Filter by both event-type:task tag and presence of status tag (NIP-52 calendar events don't have status on kind 31922, only on RSVP kind 31925). This catches manually-created task events that may not have the event-type tag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
680b1a97e6
commit
cf08b76515
1 changed files with 6 additions and 3 deletions
|
|
@ -135,9 +135,12 @@ export class ActivitiesNostrService extends BaseService {
|
|||
* Parse a raw Nostr event into an Activity view model.
|
||||
*/
|
||||
private parseNostrEventToActivity(event: NostrEvent): Activity | null {
|
||||
// Skip task events (they reuse kind 31922 but tag with event-type:task)
|
||||
const eventType = event.tags?.find(tag => tag[0] === 'event-type')?.[1]
|
||||
if (eventType === 'task') return null
|
||||
// Skip task events — they reuse NIP-52 kinds but can be identified by
|
||||
// task-specific tags (event-type:task, status, recurrence)
|
||||
const tags = event.tags ?? []
|
||||
const eventType = tags.find(tag => tag[0] === 'event-type')?.[1]
|
||||
const hasStatus = tags.some(tag => tag[0] === 'status')
|
||||
if (eventType === 'task' || hasStatus) return null
|
||||
|
||||
if (event.kind === NIP52_KINDS.CALENDAR_TIME_EVENT) {
|
||||
const parsed = parseCalendarTimeEvent(event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue