only count mentions that are tagged as such

This commit is contained in:
Ted Unangst 2019-10-16 18:23:25 -04:00
parent a5f2dd74c2
commit 4a9851c09c
1 changed files with 10 additions and 5 deletions

View File

@ -634,12 +634,8 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
}
xonk.Audience = append(xonk.Audience, xonk.Honker)
xonk.Audience = oneofakind(xonk.Audience)
for _, a := range xonk.Audience {
if a == user.URL {
xonk.Whofore = 1
}
}
var mentions []string
if obj != nil {
ot, _ := obj.GetString("type")
url, _ = obj.GetString("url")
@ -780,6 +776,10 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
p.Url, _ = tag.GetString("url")
xonk.Place = p
}
if tt == "Mention" {
m, _ := tag.GetString("href")
mentions = append(mentions, m)
}
}
starttime, ok := obj.GetString("startTime")
if ok {
@ -861,6 +861,11 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
xonk.Precis = precis
xonk.Format = "html"
xonk.Convoy = convoy
for _, m := range mentions {
if m == user.URL {
xonk.Whofore = 1
}
}
if isUpdate {
log.Printf("something has changed! %s", xonk.XID)