summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/activitypub.c b/activitypub.c
index c9f700f..c00c371 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -2180,25 +2180,32 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
2180 if (strcmp(type, "Undo") == 0) { /** **/ 2180 if (strcmp(type, "Undo") == 0) { /** **/
2181 const char *id = xs_dict_get(object, "object"); 2181 const char *id = xs_dict_get(object, "object");
2182 2182
2183 if (xs_type(object) != XSTYPE_DICT) 2183 if (xs_type(object) != XSTYPE_DICT) {
2184 snac_debug(snac, 1, xs_fmt("undo: overriding utype %s | %s | %s",
2185 utype, id, actor));
2184 utype = "Follow"; 2186 utype = "Follow";
2187 }
2185 2188
2186 if (strcmp(utype, "Follow") == 0) { /** **/ 2189 if (strcmp(utype, "Follow") == 0) { /** **/
2187 if (id && strcmp(id, snac->actor) != 0) 2190 if (!id) {
2191 snac_log(snac, xs_fmt("no id (msg.object.object) when "
2192 "handling follow: %s", actor));
2193 return 1;
2194 }
2195 if (strcmp(id, snac->actor) != 0)
2188 snac_debug(snac, 1, xs_fmt("Undo + Follow from %s not for us (%s)", actor, id)); 2196 snac_debug(snac, 1, xs_fmt("Undo + Follow from %s not for us (%s)", actor, id));
2189 else { 2197 else
2190 if (valid_status(follower_del(snac, actor))) { 2198 if (valid_status(follower_del(snac, actor))) {
2191 snac_log(snac, xs_fmt("no longer following us %s", actor)); 2199 snac_log(snac, xs_fmt("no longer following us %s", actor));
2192 do_notify = 1; 2200 do_notify = 1;
2193 }
2194 else
2195 if (pending_check(snac, actor)) {
2196 pending_del(snac, actor);
2197 snac_log(snac, xs_fmt("cancelled pending follow from %s", actor));
2198 }
2199 else
2200 snac_log(snac, xs_fmt("error deleting follower %s", actor));
2201 } 2201 }
2202 else
2203 if (pending_check(snac, actor)) {
2204 pending_del(snac, actor);
2205 snac_log(snac, xs_fmt("cancelled pending follow from %s", actor));
2206 }
2207 else
2208 snac_log(snac, xs_fmt("error deleting follower %s", actor));
2202 } 2209 }
2203 else 2210 else
2204 if (strcmp(utype, "Like") == 0 || strcmp(utype, "EmojiReact") == 0) { /** **/ 2211 if (strcmp(utype, "Like") == 0 || strcmp(utype, "EmojiReact") == 0) { /** **/