From 2f72fe0ce0e647c20fa06e4041dee5d90e30df70 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 20 Jun 2019 23:47:05 -0400 Subject: [PATCH] fix unfollow. needs object field in follow object. --- activity.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/activity.go b/activity.go index fb61135..659d1d4 100644 --- a/activity.go +++ b/activity.go @@ -657,7 +657,7 @@ func rubadubdub(user *WhatAbout, req junk.Junk) { actor, _ := req.GetString("actor") j := junk.New() j["@context"] = itiswhatitis - j["id"] = user.URL + "/dub/" + xid + j["id"] = user.URL + "/dub/" + url.QueryEscape(xid) j["type"] = "Accept" j["actor"] = user.URL j["to"] = actor @@ -674,15 +674,16 @@ func rubadubdub(user *WhatAbout, req junk.Junk) { func itakeitallback(user *WhatAbout, xid string) { j := junk.New() j["@context"] = itiswhatitis - j["id"] = user.URL + "/unsub/" + xid + j["id"] = user.URL + "/unsub/" + url.QueryEscape(xid) j["type"] = "Undo" j["actor"] = user.URL j["to"] = xid f := junk.New() - f["id"] = user.URL + "/sub/" + xid + f["id"] = user.URL + "/sub/" + url.QueryEscape(xid) f["type"] = "Follow" f["actor"] = user.URL f["to"] = xid + f["object"] = xid j["object"] = f j["published"] = time.Now().UTC().Format(time.RFC3339) @@ -696,7 +697,7 @@ func itakeitallback(user *WhatAbout, xid string) { func subsub(user *WhatAbout, xid string) { j := junk.New() j["@context"] = itiswhatitis - j["id"] = user.URL + "/sub/" + xid + j["id"] = user.URL + "/sub/" + url.QueryEscape(xid) j["type"] = "Follow" j["actor"] = user.URL j["to"] = xid