diff --git a/activity.go b/activity.go index 3b153c3..81af4d2 100644 --- a/activity.go +++ b/activity.go @@ -1820,3 +1820,24 @@ func followyou2(user *WhatAbout, j junk.Junk) { return } } + +func nofollowyou2(user *WhatAbout, j junk.Junk) { + who, _ := j.GetString("actor") + + log.Printf("updating honker reject: %s", who) + db := opendatabase() + row := db.QueryRow("select name, folxid from honkers where userid = ? and xid = ? and flavor in ('presub', 'sub')", + user.ID, who) + var name, folxid string + err := row.Scan(&name, &folxid) + if err != nil { + log.Printf("can't get honker name: %s", err) + return + } + _, err = stmtUpdateFlavor.Exec("unsub", folxid, user.ID, name, who, "presub") + _, err = stmtUpdateFlavor.Exec("unsub", folxid, user.ID, name, who, "sub") + if err != nil { + log.Printf("error updating honker: %s", err) + return + } +} diff --git a/web.go b/web.go index cd335bf..ec14167 100644 --- a/web.go +++ b/web.go @@ -380,6 +380,8 @@ func inbox(w http.ResponseWriter, r *http.Request) { followme(user, who, who, j) case "Accept": followyou2(user, j) + case "Reject": + nofollowyou2(user, j) case "Update": obj, ok := j.GetMap("object") if ok {