diff options
| author | 2025-12-02 09:53:58 +0100 | |
|---|---|---|
| committer | 2025-12-02 09:53:58 +0100 | |
| commit | 534ee6795aa4eb429846fab94a18036424485363 (patch) | |
| tree | 93c9f3f9dc187fe7aa38e882879f72353b273925 /data.c | |
| parent | Moved is_msg_mine() to data.c. (diff) | |
| parent | Fix user matching (diff) | |
| download | snac2-534ee6795aa4eb429846fab94a18036424485363.tar.gz snac2-534ee6795aa4eb429846fab94a18036424485363.tar.xz snac2-534ee6795aa4eb429846fab94a18036424485363.zip | |
Merge pull request 'fix user matching' (#502) from rakoo/snac2:master into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/502
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1467,7 +1467,7 @@ void timeline_update_indexes(snac *snac, const char *id) | |||
| 1467 | { | 1467 | { |
| 1468 | object_user_cache_add(snac, id, "private"); | 1468 | object_user_cache_add(snac, id, "private"); |
| 1469 | 1469 | ||
| 1470 | if (xs_startswith(id, snac->actor)) { | 1470 | if (is_msg_mine(snac, id)) { |
| 1471 | xs *msg = NULL; | 1471 | xs *msg = NULL; |
| 1472 | 1472 | ||
| 1473 | if (valid_status(object_get(id, &msg))) { | 1473 | if (valid_status(object_get(id, &msg))) { |
| @@ -1927,7 +1927,7 @@ int pin(snac *user, const char *id) | |||
| 1927 | { | 1927 | { |
| 1928 | int ret = -2; | 1928 | int ret = -2; |
| 1929 | 1929 | ||
| 1930 | if (xs_startswith(id, user->actor)) { | 1930 | if (is_msg_mine(user, id)) { |
| 1931 | if (is_pinned(user, id)) | 1931 | if (is_pinned(user, id)) |
| 1932 | ret = -3; | 1932 | ret = -3; |
| 1933 | else | 1933 | else |
| @@ -3527,7 +3527,7 @@ void enqueue_output(snac *snac, const xs_dict *msg, | |||
| 3527 | const xs_str *inbox, int retries, int p_status) | 3527 | const xs_str *inbox, int retries, int p_status) |
| 3528 | /* enqueues an output message to an inbox */ | 3528 | /* enqueues an output message to an inbox */ |
| 3529 | { | 3529 | { |
| 3530 | if (xs_startswith(inbox, snac->actor)) { | 3530 | if (is_msg_mine(snac, inbox)) { |
| 3531 | snac_debug(snac, 1, xs_str_new("refusing enqueue to myself")); | 3531 | snac_debug(snac, 1, xs_str_new("refusing enqueue to myself")); |
| 3532 | return; | 3532 | return; |
| 3533 | } | 3533 | } |
| @@ -4055,7 +4055,7 @@ void delete_purged_posts(snac *user, int days) | |||
| 4055 | if (xs_is_dict(msg)) { | 4055 | if (xs_is_dict(msg)) { |
| 4056 | const char *id = xs_dict_get(msg, "id"); | 4056 | const char *id = xs_dict_get(msg, "id"); |
| 4057 | 4057 | ||
| 4058 | if (xs_is_string(id) && xs_startswith(id, user->actor)) { | 4058 | if (xs_is_string(id) && is_msg_mine(user, id)) { |
| 4059 | xs *d_msg = msg_delete(user, id); | 4059 | xs *d_msg = msg_delete(user, id); |
| 4060 | 4060 | ||
| 4061 | enqueue_message(user, d_msg); | 4061 | enqueue_message(user, d_msg); |