diff options
| author | 2023-05-17 11:24:47 +0200 | |
|---|---|---|
| committer | 2023-05-17 11:24:47 +0200 | |
| commit | 93d1649ba6f2c9acf9efb854208d7ea117af6026 (patch) | |
| tree | 35af5f7f3fcc825fb95e19277359e401a455f5c0 /activitypub.c | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-93d1649ba6f2c9acf9efb854208d7ea117af6026.tar.gz snac2-93d1649ba6f2c9acf9efb854208d7ea117af6026.tar.xz snac2-93d1649ba6f2c9acf9efb854208d7ea117af6026.zip | |
New config option 'drop_dm_from_unknown'.
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c index 39d1605..57c3259 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -1045,6 +1045,16 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req) | |||
| 1045 | return 1; | 1045 | return 1; |
| 1046 | } | 1046 | } |
| 1047 | 1047 | ||
| 1048 | /* if it's a DM from someone we don't follow, reject the message */ | ||
| 1049 | if (xs_type(xs_dict_get(snac->config, "drop_dm_from_unknown")) == XSTYPE_TRUE) { | ||
| 1050 | if (strcmp(utype, "Note") == 0 && !is_msg_public(snac, msg) && | ||
| 1051 | !following_check(snac, actor)) { | ||
| 1052 | snac_log(snac, xs_fmt("DM rejected from unknown actor %s", actor)); | ||
| 1053 | |||
| 1054 | return 1; | ||
| 1055 | } | ||
| 1056 | } | ||
| 1057 | |||
| 1048 | /* bring the actor */ | 1058 | /* bring the actor */ |
| 1049 | a_status = actor_request(snac, actor, &actor_o); | 1059 | a_status = actor_request(snac, actor, &actor_o); |
| 1050 | 1060 | ||