summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar default2024-08-07 11:01:10 +0200
committerGravatar default2024-08-07 11:01:10 +0200
commitd9994c9a35154cad00061eccb5a4a0ddf672a0bb (patch)
tree17083aa39a441fea956799616dbdb7c04f3f8fa1 /activitypub.c
parentmastoapi: show EmojiReact notifications as 'favourites'. (diff)
downloadsnac2-d9994c9a35154cad00061eccb5a4a0ddf672a0bb.tar.gz
snac2-d9994c9a35154cad00061eccb5a4a0ddf672a0bb.tar.xz
snac2-d9994c9a35154cad00061eccb5a4a0ddf672a0bb.zip
Fixed leaked EmojiReact notifications.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/activitypub.c b/activitypub.c
index 1cfd75b..65e555d 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -574,7 +574,7 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
574 return 0; 574 return 0;
575 } 575 }
576 576
577 if (xs_match(type, "Like|Announce")) { 577 if (xs_match(type, "Like|Announce|EmojiReact")) {
578 const char *object = xs_dict_get(c_msg, "object"); 578 const char *object = xs_dict_get(c_msg, "object");
579 579
580 if (xs_type(object) == XSTYPE_DICT) 580 if (xs_type(object) == XSTYPE_DICT)
@@ -834,7 +834,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
834 if (xs_type(objid) == XSTYPE_DICT) 834 if (xs_type(objid) == XSTYPE_DICT)
835 objid = xs_dict_get(objid, "id"); 835 objid = xs_dict_get(objid, "id");
836 836
837 if (strcmp(type, "Like") == 0 || strcmp(type, "Announce") == 0) { 837 if (xs_match(type, "Like|Announce|EmojiReact")) {
838 /* if it's not an admiration about something by us, done */ 838 /* if it's not an admiration about something by us, done */
839 if (xs_is_null(objid) || !xs_startswith(objid, snac->actor)) 839 if (xs_is_null(objid) || !xs_startswith(objid, snac->actor))
840 return; 840 return;
@@ -1901,10 +1901,10 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
1901 } 1901 }
1902 } 1902 }
1903 else 1903 else
1904 if (strcmp(utype, "Like") == 0) { /** **/ 1904 if (strcmp(utype, "Like") == 0 || strcmp(utype, "EmojiReact") == 0) { /** **/
1905 int status = object_unadmire(id, actor, 1); 1905 int status = object_unadmire(id, actor, 1);
1906 1906
1907 snac_log(snac, xs_fmt("Unlike for %s %d", id, status)); 1907 snac_log(snac, xs_fmt("Undo '%s' for %s %d", utype, id, status));
1908 } 1908 }
1909 else 1909 else
1910 if (strcmp(utype, "Announce") == 0) { /** **/ 1910 if (strcmp(utype, "Announce") == 0) { /** **/