we can ignore incoming xonks that originated as self

This commit is contained in:
Ted Unangst 2019-04-14 10:15:47 -04:00
parent 68c465c4ad
commit 1acb85d047
2 changed files with 7 additions and 4 deletions

View File

@ -217,8 +217,11 @@ func savedonk(url string, name, media string) *Donk {
return &donk return &donk
} }
func needxonk(userid int64, x *Honk) bool { func needxonk(user *WhatAbout, x *Honk) bool {
row := stmtFindXonk.QueryRow(userid, x.XID) if strings.HasPrefix(x.XID, user.URL + "/h/") {
return false
}
row := stmtFindXonk.QueryRow(user.ID, x.XID)
err := row.Scan(&x.ID) err := row.Scan(&x.ID)
if err == nil { if err == nil {
return false return false
@ -314,7 +317,7 @@ func peeppeep() {
for _, item := range items { for _, item := range items {
xonk := xonkxonk(item) xonk := xonkxonk(item)
if xonk != nil && needxonk(user.ID, xonk) { if xonk != nil && needxonk(user, xonk) {
xonk.UserID = user.ID xonk.UserID = user.ID
savexonk(xonk) savexonk(xonk)
} }

View File

@ -335,7 +335,7 @@ func inbox(w http.ResponseWriter, r *http.Request) {
} }
default: default:
xonk := xonkxonk(j) xonk := xonkxonk(j)
if xonk != nil && needxonk(user.ID, xonk) { if xonk != nil && needxonk(user, xonk) {
xonk.UserID = user.ID xonk.UserID = user.ID
savexonk(xonk) savexonk(xonk)
} }