commit 46f2e32
default
·
2024-04-11 17:29:30 +0000 UTC
parent 1a9bb5f
Undo for Likes and Announces are no longer dropped.
2 files changed,
+15,
-0
M
data.c
+14,
-0
1@@ -1941,6 +1941,8 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
2 }
3 else
4 if (strcmp(type, "Undo") == 0) { /** **/
5+ char *id = xs_dict_get(object, "object");
6+
7 if (xs_type(object) != XSTYPE_DICT)
8 utype = "Follow";
9
10@@ -1952,6 +1954,18 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
11 else
12 snac_log(snac, xs_fmt("error deleting follower %s", actor));
13 }
14+ else
15+ if (strcmp(utype, "Like") == 0) { /** **/
16+ int status = object_unadmire(id, actor, 1);
17+
18+ snac_log(snac, xs_fmt("Unlike for %s %d", id, status));
19+ }
20+ else
21+ if (strcmp(utype, "Announce") == 0) { /** **/
22+ int status = object_unadmire(id, actor, 0);
23+
24+ snac_log(snac, xs_fmt("Unboost for %s %d", id, status));
25+ }
26 else
27 snac_debug(snac, 1, xs_fmt("ignored 'Undo' for object type '%s'", utype));
28 }
M
data.c
+1,
-0
1@@ -916,6 +916,7 @@ int object_unadmire(const char *id, const char *actor, int like)
2 fn = xs_replace_i(fn, ".json", like ? "_l.idx" : "_a.idx");
3
4 status = index_del(fn, actor);
5+ index_gc(fn);
6
7 srv_debug(0,
8 xs_fmt("object_unadmire (%s) %s %s %d", like ? "Like" : "Announce", actor, fn, status));