try harder to not deliver to self.

This commit is contained in:
Ted Unangst 2019-09-28 17:13:57 -04:00
parent 91afec7070
commit 1b0dc71a71
1 changed files with 11 additions and 7 deletions

View File

@ -994,7 +994,9 @@ func honkworldwide(user *WhatAbout, honk *Honk) {
rcpts := make(map[string]bool) rcpts := make(map[string]bool)
for _, a := range honk.Audience { for _, a := range honk.Audience {
if a != thewholeworld && a != user.URL && !strings.HasSuffix(a, "/followers") { if a == thewholeworld || a == user.URL || strings.HasSuffix(a, "/followers") {
continue
}
box, _ := getboxes(a) box, _ := getboxes(a)
if box != nil && honk.Public && box.Shared != "" { if box != nil && honk.Public && box.Shared != "" {
rcpts["%"+box.Shared] = true rcpts["%"+box.Shared] = true
@ -1002,9 +1004,11 @@ func honkworldwide(user *WhatAbout, honk *Honk) {
rcpts[a] = true rcpts[a] = true
} }
} }
}
if honk.Public { if honk.Public {
for _, f := range getdubs(user.ID) { for _, f := range getdubs(user.ID) {
if f.XID == user.URL {
continue
}
box, _ := getboxes(f.XID) box, _ := getboxes(f.XID)
if box != nil && box.Shared != "" { if box != nil && box.Shared != "" {
rcpts["%"+box.Shared] = true rcpts["%"+box.Shared] = true