Revert prettyJsonOrRaw update and use go-nostr v1.8.4 for all user's metadata

This commit is contained in:
Daniele Tonon
2023-05-25 13:58:30 +02:00
parent 3a7e3d02ad
commit 0c90ec92ea
5 changed files with 31 additions and 20 deletions

View File

@@ -143,17 +143,16 @@ func render(w http.ResponseWriter, r *http.Request) {
// : ''
textImageURL := ""
content := ""
content_json := make(map[string]interface{})
description := ""
if useTextImage {
textImageURL = fmt.Sprintf("https://%s/image/%s", hostname, code)
if subject != "" {
content = fmt.Sprintf("%s -- %s", subject, seenOnRelays)
description = fmt.Sprintf("%s -- %s", subject, seenOnRelays)
} else {
content = seenOnRelays
description = seenOnRelays
}
} else {
content_json, content = prettyJsonOrRaw(event.Content)
description = prettyJsonOrRaw(event.Content)
}
eventJSON, _ := json.MarshalIndent(event, "", " ")
@@ -169,8 +168,7 @@ func render(w http.ResponseWriter, r *http.Request) {
"naddr": naddr,
"metadata": metadata,
"authorLong": authorLong,
"content": content,
"content_json": content_json,
"description": description,
"textImageURL": textImageURL,
"videoType": videoType,
"image": image,