back interdiff of round #2 and #1

feat: add study session comments #1

merged
opened by brookjeynes.dev targeting master from bj/2025-09-05/feat/study-session-comments
ERROR
internal/server/views/views.go

Failed to calculate interdiff for this file.

REVERTED
internal/db/follow.go
···
package db
import (
-
"database/sql"
"fmt"
-
"log"
"strings"
"time"
)
···
return IsSelf
}
+
var follows, isFollowed bool
query := `
+
select
+
exists(select 1 from follows where user_did = ? and subject_did = ?),
+
exists(select 1 from follows where user_did = ? and subject_did = ?)
+
`
+
err := e.QueryRow(query, userDid, subjectDid, subjectDid, userDid).Scan(&follows, &isFollowed)
-
SELECT
-
-- Count of rows where the user follows the subject
-
COUNT(CASE WHEN user_did = ? AND subject_did = ? THEN 1 END),
-
-- Count of rows where the subject follows the user
-
COUNT(CASE WHEN user_did = ? AND subject_did = ? THEN 1 END)
-
FROM
-
follows
-
WHERE
-
(user_did = ? AND subject_did = ?) OR (user_did = ? AND subject_did = ?);
-
`
-
-
var userFollowsSubject, subjectFollowsUser int
-
err := e.QueryRow(
-
query,
-
userDid, subjectDid,
-
subjectDid, userDid,
-
userDid, subjectDid,
-
subjectDid, userDid,
-
).Scan(&userFollowsSubject, &subjectFollowsUser)
-
if err != nil {
-
if err == sql.ErrNoRows {
-
return IsNotFollowing
-
}
-
log.Printf("failed to query follow status: %v", err)
return IsNotFollowing
}
+
if follows && isFollowed {
-
if userFollowsSubject > 0 && subjectFollowsUser > 0 {
return IsMutual
+
} else if follows {
-
} else if userFollowsSubject > 0 {
return IsFollowing
} else {
return IsNotFollowing
ERROR
api/yoten/cbor_gen.go

Failed to calculate interdiff for this file.

ERROR
api/yoten/feedcomment.go

Failed to calculate interdiff for this file.

ERROR
cmd/gen.go

Failed to calculate interdiff for this file.

ERROR
internal/server/views/new-study-session.templ

Failed to calculate interdiff for this file.

ERROR
lexicons/feed/comment.json

Failed to calculate interdiff for this file.

ERROR
internal/clients/posthog/posthog.go

Failed to calculate interdiff for this file.

ERROR
internal/server/app.go

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/activity.templ

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/resource.templ

Failed to calculate interdiff for this file.

ERROR
internal/server/oauth/handler/handler.go

Failed to calculate interdiff for this file.

ERROR
internal/server/handlers/router.go

Failed to calculate interdiff for this file.

ERROR
internal/db/comment.go

Failed to calculate interdiff for this file.

ERROR
internal/db/utils.go

Failed to calculate interdiff for this file.

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

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/comment.templ

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/reactions.templ

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/study-session.templ

Failed to calculate interdiff for this file.

ERROR
internal/server/views/study-session.templ

Failed to calculate interdiff for this file.

ERROR
internal/consumer/ingester.go

Failed to calculate interdiff for this file.

ERROR
internal/db/notification.go

Failed to calculate interdiff for this file.

ERROR
internal/server/handlers/comment.go

Failed to calculate interdiff for this file.

ERROR
internal/server/views/friends.templ

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/notification.templ

Failed to calculate interdiff for this file.