mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
Fixed follow / unfollow mess for shared inboxes.
This commit is contained in:
parent
45c5c71f9e
commit
52f27123bb
1 changed files with 8 additions and 2 deletions
|
@ -468,9 +468,9 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
|
|||
return following_check(snac, actor);
|
||||
}
|
||||
|
||||
/* if it's an Undo + Follow, it must be from someone we follow */
|
||||
/* if it's an Undo + Follow, it must be from someone that follows us */
|
||||
if (xs_match(type, "Undo")) {
|
||||
return following_check(snac, actor);
|
||||
return follower_check(snac, actor);
|
||||
}
|
||||
|
||||
/* if it's an Accept + Follow, it must be for a Follow we created */
|
||||
|
@ -478,6 +478,12 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
|
|||
return following_check(snac, actor);
|
||||
}
|
||||
|
||||
/* if it's a Follow, it must be explicitly for us */
|
||||
if (xs_match(type, "Follow")) {
|
||||
char *object = xs_dict_get(c_msg, "object");
|
||||
return !xs_is_null(object) && strcmp(snac->actor, object) == 0;
|
||||
}
|
||||
|
||||
/* if it's not a Create or Update, allow as is */
|
||||
if (!xs_match(type, "Create|Update")) {
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue