summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar default2024-04-11 19:29:30 +0200
committerGravatar default2024-04-11 19:29:30 +0200
commit46f2e324d8df49af914ba5781f13337dea7dd6aa (patch)
treedb7abedc0387c039fd5b5bd315aef5b7a887309c /activitypub.c
parentFixed bug in form processing. (diff)
downloadsnac2-46f2e324d8df49af914ba5781f13337dea7dd6aa.tar.gz
snac2-46f2e324d8df49af914ba5781f13337dea7dd6aa.tar.xz
snac2-46f2e324d8df49af914ba5781f13337dea7dd6aa.zip
Undo for Likes and Announces are no longer dropped.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index 9a23e14..d75bbdd 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1941,6 +1941,8 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1941 } 1941 }
1942 else 1942 else
1943 if (strcmp(type, "Undo") == 0) { /** **/ 1943 if (strcmp(type, "Undo") == 0) { /** **/
1944 char *id = xs_dict_get(object, "object");
1945
1944 if (xs_type(object) != XSTYPE_DICT) 1946 if (xs_type(object) != XSTYPE_DICT)
1945 utype = "Follow"; 1947 utype = "Follow";
1946 1948
@@ -1953,6 +1955,18 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1953 snac_log(snac, xs_fmt("error deleting follower %s", actor)); 1955 snac_log(snac, xs_fmt("error deleting follower %s", actor));
1954 } 1956 }
1955 else 1957 else
1958 if (strcmp(utype, "Like") == 0) { /** **/
1959 int status = object_unadmire(id, actor, 1);
1960
1961 snac_log(snac, xs_fmt("Unlike for %s %d", id, status));
1962 }
1963 else
1964 if (strcmp(utype, "Announce") == 0) { /** **/
1965 int status = object_unadmire(id, actor, 0);
1966
1967 snac_log(snac, xs_fmt("Unboost for %s %d", id, status));
1968 }
1969 else
1956 snac_debug(snac, 1, xs_fmt("ignored 'Undo' for object type '%s'", utype)); 1970 snac_debug(snac, 1, xs_fmt("ignored 'Undo' for object type '%s'", utype));
1957 } 1971 }
1958 else 1972 else