all repos — honk @ 35c4c78c754770bacd5d0a1b06fe2749b1e5d63d

my fork of honk

handle reject follow
Ted Unangst tedu@tedunangst.com
Tue, 13 Oct 2020 15:12:56 -0400
commit

35c4c78c754770bacd5d0a1b06fe2749b1e5d63d

parent

6415fc53473647713c17bac11239ea1a199232c7

2 files changed, 23 insertions(+), 0 deletions(-)

jump to
M activity.goactivity.go

@@ -1820,3 +1820,24 @@ log.Printf("error updating honker: %s", err)

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 + } +}
M web.goweb.go

@@ -380,6 +380,8 @@ }

followme(user, who, who, j) case "Accept": followyou2(user, j) + case "Reject": + nofollowyou2(user, j) case "Update": obj, ok := j.GetMap("object") if ok {