-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3616 from esl/inbox/async_removes
Inbox/async removes
- Loading branch information
Showing
30 changed files
with
752 additions
and
319 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## Configuration | ||
This module contains command definitions which are loaded when the module is activated. | ||
There are no options to be provided, therefore the following entry in the config file is sufficient: | ||
|
||
```toml | ||
[modules.mod_inbox_commands] | ||
``` | ||
|
||
## Admin endpoint | ||
|
||
### Bin flush for a user | ||
To clean the bin for a given user, the following admin API request can be triggered: | ||
|
||
```http | ||
DELETE /api/inbox/<domain>/<user>/<days>/bin, | ||
``` | ||
where `<domain>` and `<user>` are the domain and name parts of the user's jid, respectively, and `<days>` is the required number of days for an entry to be considered old enough to be removed, zero allowed (which clears all). | ||
|
||
The result would be a `200` with the number of rows that were removed as the body, or a corresponding error. For example, if only one entry was cleaned: | ||
```http | ||
HTTP/1.1 200 OK | ||
server: Cowboy, | ||
date: Wed, 30 Mar 2022 14:06:20 GMT, | ||
content-type: application/json, | ||
content-length: 1 | ||
1 | ||
``` | ||
|
||
### Global bin flush | ||
If all the bins were desired to be cleared, the following API can be used instead: | ||
|
||
```http | ||
DELETE /api/inbox/<host_type>/<days>/bin, | ||
``` | ||
where as before, `<days>` is the required number of days for an entry to be considered old enough to be removed, and `<host_type>` is the host type where inbox is configured. | ||
|
||
The result would look analogously: | ||
```http | ||
HTTP/1.1 200 OK | ||
server: Cowboy, | ||
date: Wed, 30 Mar 2022 14:06:20 GMT, | ||
content-type: application/json, | ||
content-length: 1 | ||
42 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
-type content() :: binary(). | ||
|
||
-type id() :: binary(). | ||
|
||
-type marker() :: binary(). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.