tangled
alpha
login
or
join now
diffdown.com
/
diffdown-app
0
fork
atom
Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol
diffdown.com
0
fork
atom
overview
issues
10
pulls
pipelines
fix: filter comments by document, fix JSON field names
John Luther
3 weeks ago
283b1f74
d222fc8b
+12
-9
3 changed files
expand all
collapse all
unified
split
internal
atproto
xrpc
client.go
handler
handler.go
model
models.go
+4
-1
internal/atproto/xrpc/client.go
reviewed
···
323
323
"documentURI": comment.DocumentURI,
324
324
"paragraphId": comment.ParagraphID,
325
325
"text": comment.Text,
326
326
-
"author": comment.AuthorDID,
326
326
+
"author": comment.Author,
327
327
}
328
328
uri, _, err := c.CreateRecord(collectionComment, record)
329
329
if err != nil {
···
343
343
for _, r := range records {
344
344
var comment model.Comment
345
345
if err := json.Unmarshal(r.Value, &comment); err != nil {
346
346
+
continue
347
347
+
}
348
348
+
if documentRKey != "" && comment.DocumentURI != "diffdown://document/"+documentRKey {
346
349
continue
347
350
}
348
351
comment.URI = r.URI
+1
-1
internal/handler/handler.go
reviewed
···
595
595
DocumentURI: fmt.Sprintf("at://%s/com.diffdown.document/%s", session.DID, rKey),
596
596
ParagraphID: req.ParagraphID,
597
597
Text: req.Text,
598
598
-
AuthorDID: session.DID,
598
598
+
Author: session.DID,
599
599
}
600
600
601
601
uri, err := client.CreateComment(comment)
+7
-7
internal/model/models.go
reviewed
···
67
67
}
68
68
69
69
type Comment struct {
70
70
-
URI string `json:"uri"`
71
71
-
DocumentURI string `json:"document_uri"`
72
72
-
ParagraphID string `json:"paragraph_id"`
73
73
-
Text string `json:"text"`
74
74
-
AuthorDID string `json:"author_did"`
75
75
-
AuthorName string `json:"author_name"`
76
76
-
CreatedAt string `json:"created_at"`
70
70
+
URI string `json:"uri"`
71
71
+
DocumentURI string `json:"documentURI"`
72
72
+
ParagraphID string `json:"paragraphId"`
73
73
+
Text string `json:"text"`
74
74
+
Author string `json:"author"`
75
75
+
AuthorName string `json:"authorName"`
76
76
+
CreatedAt time.Time `json:"createdAt"`
77
77
}
78
78
79
79
// RKeyFromURI extracts the rkey (last path segment) from an at:// URI.