From 1b0dc71a7185954cb8466e6ec014b775ee7d5400 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sat, 28 Sep 2019 17:13:57 -0400 Subject: [PATCH] try harder to not deliver to self. --- activity.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/activity.go b/activity.go index aaba2b0..69e1396 100644 --- a/activity.go +++ b/activity.go @@ -994,17 +994,21 @@ func honkworldwide(user *WhatAbout, honk *Honk) { rcpts := make(map[string]bool) for _, a := range honk.Audience { - if a != thewholeworld && a != user.URL && !strings.HasSuffix(a, "/followers") { - box, _ := getboxes(a) - if box != nil && honk.Public && box.Shared != "" { - rcpts["%"+box.Shared] = true - } else { - rcpts[a] = true - } + if a == thewholeworld || a == user.URL || strings.HasSuffix(a, "/followers") { + continue + } + box, _ := getboxes(a) + if box != nil && honk.Public && box.Shared != "" { + rcpts["%"+box.Shared] = true + } else { + rcpts[a] = true } } if honk.Public { for _, f := range getdubs(user.ID) { + if f.XID == user.URL { + continue + } box, _ := getboxes(f.XID) if box != nil && box.Shared != "" { rcpts["%"+box.Shared] = true