From c1caef56794b79b990c8772ae9fc6e648bbc1c49 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 5 Aug 2020 15:49:26 -0400 Subject: [PATCH] only fill in reply handles if logged in user --- fun.go | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/fun.go b/fun.go index 670ff63..d5d08bc 100644 --- a/fun.go +++ b/fun.go @@ -83,21 +83,23 @@ func reverbolate(userid int64, honks []*Honk) { } } } - if user.Options.MentionAll { - hset := []string{"@" + h.Handle} - for _, a := range h.Audience { - if a == h.Honker || a == user.URL { - continue - } - _, hand := handles(a) - if hand != "" { - hand = "@" + hand - hset = append(hset, hand) + if user != nil { + if user.Options.MentionAll { + hset := []string{"@" + h.Handle} + for _, a := range h.Audience { + if a == h.Honker || a == user.URL { + continue + } + _, hand := handles(a) + if hand != "" { + hand = "@" + hand + hset = append(hset, hand) + } } + h.Handles = strings.Join(hset, " ") + } else if h.Honker != user.URL { + h.Handles = "@" + h.Handle } - h.Handles = strings.Join(hset, " ") - } else if h.Honker != user.URL { - h.Handles = "@" + h.Handle } if h.URL == "" { h.URL = h.XID