commit d9994c9
default
·
2024-08-07 09:01:10 +0000 UTC
parent d91a016
Fixed leaked EmojiReact notifications.
1 files changed,
+4,
-4
+4,
-4
1@@ -574,7 +574,7 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
2 return 0;
3 }
4
5- if (xs_match(type, "Like|Announce")) {
6+ if (xs_match(type, "Like|Announce|EmojiReact")) {
7 const char *object = xs_dict_get(c_msg, "object");
8
9 if (xs_type(object) == XSTYPE_DICT)
10@@ -834,7 +834,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
11 if (xs_type(objid) == XSTYPE_DICT)
12 objid = xs_dict_get(objid, "id");
13
14- if (strcmp(type, "Like") == 0 || strcmp(type, "Announce") == 0) {
15+ if (xs_match(type, "Like|Announce|EmojiReact")) {
16 /* if it's not an admiration about something by us, done */
17 if (xs_is_null(objid) || !xs_startswith(objid, snac->actor))
18 return;
19@@ -1901,10 +1901,10 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
20 }
21 }
22 else
23- if (strcmp(utype, "Like") == 0) { /** **/
24+ if (strcmp(utype, "Like") == 0 || strcmp(utype, "EmojiReact") == 0) { /** **/
25 int status = object_unadmire(id, actor, 1);
26
27- snac_log(snac, xs_fmt("Unlike for %s %d", id, status));
28+ snac_log(snac, xs_fmt("Undo '%s' for %s %d", utype, id, status));
29 }
30 else
31 if (strcmp(utype, "Announce") == 0) { /** **/