Yōten: A social tracker for your language learning journey built on the atproto.

feat: replies #2

merged opened by brookjeynes.dev targeting master from bj/2025-09-22/feat/replies

Adds replies to Yoten

Labels

None yet.

Participants 1
AT URI
at://did:plc:4mj54vc4ha3lh32ksxwunnbh/sh.tangled.repo.pull/3lzz3nxvzb622
+25 -1
Interdiff #0 β†’ #1
+23
internal/consumer/ingester.go
··· 627 } 628 629 log.Println("upserting comment from pds request")
··· 627 } 628 629 log.Println("upserting comment from pds request") 630 + 631 + 632 + 633 + return fmt.Errorf("failed to upsert comment record: %w", err) 634 + } 635 + 636 + // Create a comment if not commenting on self post. 637 + if subjectDid.String() != did { 638 + err = db.CreateNotification(tx, subjectDid.String(), did, subjectUri.String(), db.NotificationTypeComment) 639 + if err != nil { 640 + log.Println("failed to create notification record:", err) 641 + } 642 + } 643 + 644 + // Notify comment creator of reply if not replying to their own comment. 645 + if comment.ParentCommentUri != nil && comment.ParentCommentUri.Authority().String() != did { 646 + err = db.CreateNotification(tx, comment.ParentCommentUri.Authority().String(), did, parentCommentUri.String(), db.NotificationTypeReply) 647 + if err != nil { 648 + log.Println("failed to create notification record:", err) 649 + } 650 + } 651 + 652 + return tx.Commit()
internal/db/comment.go

This file has not been changed.

internal/server/handlers/comment.go

This file has not been changed.

internal/server/handlers/router.go

This file has not been changed.

internal/server/handlers/study-session.go

This file has not been changed.

internal/server/views/partials/comment-feed.templ

This file has not been changed.

internal/server/views/partials/comment.templ

This file has not been changed.

internal/server/views/partials/discussion.templ

This file has not been changed.

internal/server/views/partials/edit-comment.templ

This file has not been changed.

internal/server/views/partials/new-reply.templ

This file has not been changed.

internal/server/views/partials/partials.go

This file has not been changed.

internal/server/views/partials/reply.templ

This file has not been changed.

internal/server/views/study-session.templ

This file has not been changed.

+1 -1
migrations/update_notification_type.sql
··· 11 actor_did TEXT NOT NULL, 12 subject_uri TEXT NOT NULL, 13 state TEXT NOT NULL DEFAULT 'unread' CHECK(state IN ('unread', 'read')), 14 - type TEXT NOT NULL CHECK(type IN ('follow', 'reaction', 'comment')), 15 created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')), 16 FOREIGN KEY (recipient_did) REFERENCES profiles(did) ON DELETE CASCADE, 17 FOREIGN KEY (actor_did) REFERENCES profiles(did) ON DELETE CASCADE
··· 11 actor_did TEXT NOT NULL, 12 subject_uri TEXT NOT NULL, 13 state TEXT NOT NULL DEFAULT 'unread' CHECK(state IN ('unread', 'read')), 14 + type TEXT NOT NULL CHECK(type IN ('follow', 'reaction', 'comment', 'reply')), 15 created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')), 16 FOREIGN KEY (recipient_did) REFERENCES profiles(did) ON DELETE CASCADE, 17 FOREIGN KEY (actor_did) REFERENCES profiles(did) ON DELETE CASCADE
+1
internal/db/notification.go
··· 13 NotificationTypeFollow NotificationType = "follow" 14 NotificationTypeReaction NotificationType = "reaction" 15 NotificationTypeComment NotificationType = "comment" 16 ) 17 18 type NotificationState string
··· 13 NotificationTypeFollow NotificationType = "follow" 14 NotificationTypeReaction NotificationType = "reaction" 15 NotificationTypeComment NotificationType = "comment" 16 + NotificationTypeReply NotificationType = "reply" 17 ) 18 19 type NotificationState string

History

2 rounds 0 comments
sign up or login to add to the discussion
3 commits
expand
feat: handle replies
feat: fix cancel button from reply
feat: notify people on replies
expand 0 comments
pull request successfully merged
2 commits
expand
feat: handle replies
feat: fix cancel button from reply
expand 0 comments