commit b5524d7

grunfink  ·  2026-03-22 07:49:24 +0000 UTC
parent 210bb07
Also check for actor_alt in is_msg_for_me().
1 files changed,  +3, -3
+3, -3
 1@@ -813,13 +813,13 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
 2     /* if it's a Follow, it must be explicitly for us */
 3     if (xs_match(type, "Follow")) {
 4         const char *object = xs_dict_get(c_msg, "object");
 5-        return !xs_is_null(object) && strcmp(snac->actor, object) == 0;
 6+        return !xs_is_null(object) && (strcmp(snac->actor, object) == 0 || strcmp(snac->actor_alt, object) == 0);
 7     }
 8 
 9     /* only accept Ping directed to us */
10     if (xs_match(type, "Ping")) {
11         const char *dest = xs_dict_get(c_msg, "to");
12-        return !xs_is_null(dest) && strcmp(snac->actor, dest) == 0;
13+        return !xs_is_null(dest) && (strcmp(snac->actor, dest) == 0 || strcmp(snac->actor_alt, dest) == 0);
14     }
15 
16     /* if it's not a Create or Update, allow as is */
17@@ -860,7 +860,7 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
18 
19     while(xs_list_iter(&p, &v)) {
20         /* explicitly for me? accept */
21-        if (strcmp(v, snac->actor) == 0)
22+        if (strcmp(v, snac->actor) == 0 || strcmp(v, snac->actor_alt) == 0)
23             return 2;
24 
25         if (pub_msg) {