commit 23177e9

default  ·  2023-03-07 08:40:55 +0000 UTC
parent 946c297
is_msg_for_me() also accepts msgs where a followed is cc'ed.
1 files changed,  +7, -3
+7, -3
 1@@ -304,12 +304,16 @@ int is_msg_for_me(snac *snac, xs_dict *c_msg)
 2     xs_str *v;
 3 
 4     while(xs_list_iter(&p, &v)) {
 5-        /* explicitly for me? we're done */
 6+        /* explicitly for me? accept */
 7         if (strcmp(v, snac->actor) == 0)
 8             return 2;
 9+
10+        /* for someone we follow? (probably cc'ed) accept */
11+        if (following_check(snac, v))
12+            return 5;
13     }
14 
15-    /* accept if it's from someone we follow */
16+    /* accept if it's by someone we follow */
17     char *atto = xs_dict_get(msg, "attributedTo");
18 
19     if (!xs_is_null(atto) && following_check(snac, atto))
20@@ -320,7 +324,7 @@ int is_msg_for_me(snac *snac, xs_dict *c_msg)
21     if (!xs_is_null(irt)) {
22         xs *r_msg = NULL;
23 
24-        /* try to get it */
25+        /* try to get the replied message */
26         if (valid_status(object_get(irt, &r_msg))) {
27             atto = xs_dict_get(r_msg, "attributedTo");
28