Fix panic bug in TwtFromNote() where parent note was shadowing note
continuous-integration/drone/push Build is passing Details

main
James Mills 2 months ago
parent 288341f719
commit 6f8340f379
Signed by: prologic
GPG Key ID: AC4C014F1440EBD6

@ -0,0 +1,9 @@
{
"attachment": {
"blurhash": "LRBM_Pof00RjM{t7t7M{IUWBxuj[",
"mediaType": "image/png",
"name": "",
"type": "Document",
"url": "https://gts.mills.io/fileserver/01DBA70S0E6CEZ78EJJKCQF69H/attachment/original/01JJCPPGF6BGT81HNKVNQHSH1T.png"
}
}

@ -56,11 +56,11 @@ func TwtFromNoteFactory(conf *Config, cache *Cache, archive Archiver) TwtFromNot
}
if note.InReplyTo != "" {
note, err := ap.GetNote(note.InReplyTo)
parent, err := ap.GetNote(note.InReplyTo)
if err != nil {
log.WithError(err).Warnf("error looking up note for inReplyTo=%s", note.InReplyTo)
} else {
if twt, err := TwtFromNoteFactory(conf, cache, archive)(note); err == nil {
if twt, err := TwtFromNoteFactory(conf, cache, archive)(parent); err == nil {
hash := twt.Hash()
if _, ok := cache.Lookup(hash); ok || archive.Has(hash) {
content = fmt.Sprintf("(#%s) %s", hash, content)

Loading…
Cancel
Save