avoid self mention

from zev
master
Ted Unangst 1 year ago
parent 565a286ff0
commit e149bceac9

@ -97,8 +97,11 @@ func reverbolate(userid int64, honks []*Honk) {
} }
} }
if user != nil { if user != nil {
hset := []string{}
if h.Honker != user.URL {
hset = append(hset, "@"+h.Handle)
}
if user.Options.MentionAll { if user.Options.MentionAll {
hset := []string{"@" + h.Handle}
for _, a := range h.Audience { for _, a := range h.Audience {
if a == h.Honker || a == user.URL { if a == h.Honker || a == user.URL {
continue continue
@ -109,10 +112,8 @@ func reverbolate(userid int64, honks []*Honk) {
hset = append(hset, 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, " ")
} }
if h.URL == "" { if h.URL == "" {
h.URL = h.XID h.URL = h.XID

Loading…
Cancel
Save