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