annotate doc/libervia-cli/blocking.rst @ 3905:92482cc80d0b

tools (common/date_utils) handle timestamp and `in` + `delta2human`: regex used to parse datetimes has been improved to handle a unix time (which can be used with `+ <delta>` or `- <delta>`), and the `in <delta>` (e.g. `in 6 days`). `DEFAULT_DATETIME` has been removed as dateutil use current date by default, which is the expected behaviour. Add `delta2human` method which convert the difference of 2 unix times to a human friendly approximate text. rel 372
author Goffi <goffi@goffi.org>
date Thu, 22 Sep 2022 00:01:48 +0200
parents 29380ef68dbe
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3810
29380ef68dbe doc (components): AP item retraction + blocking:
Goffi <goffi@goffi.org>
parents: 3789
diff changeset
1 .. _libervia-cli_blocking:
29380ef68dbe doc (components): AP item retraction + blocking:
Goffi <goffi@goffi.org>
parents: 3789
diff changeset
2
3789
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
3 ===========================
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 blocking: entities blocking
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 ===========================
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
6
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 ``blocking`` are commands to block or unblock users by their JIDs (as specified by
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
8 `XEP-0191`_). You server must implement this XEP to use those commands.
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
9
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
10 A blocking is usually done using bare JID, however, you may specify a resource if you want
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 to block only this resource, or a domain if you want to block a whole domain. Please check
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 `XEP-0191 § JID Matching`_ for details.
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
13
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 list
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 ====
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
16
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
17 List already blocked users.
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
18
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
19 examples
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
20 --------
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
21
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
22 Check who has already been blocked::
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
23
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
24 $ li blocking list
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
25
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
26 block
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
27 =====
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
28
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
29 Block one or more entities by specifying their JIDs.
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
30
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
31 You just need to specify the bare JIDs of users that you want to block as positional
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
32 argument, specify only a domain if you want to block a whole domain.
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
33
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
34 examples
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
35 --------
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
36
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
37 Louise wants to block ``spammer@example.com`` and the whole domain ``spammers.example``::
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
38
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
39 $ li blocking block spammer@example.com spammers.example
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
40
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
41 unblock
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
42 =======
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
43
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
44 ``unblock`` works the same way as ``block``.
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
45
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
46 If you want to unblock all blocked users at once, you can use the ``all`` keyword. In this
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
47 case, you'll have to confirm the action. If you don't want to confirm manually, you can
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
48 use the ``-f, --force`` flag.
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
49
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
50 examples
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
51 --------
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
52
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
53 Pierre wants to unblock the domain ``example.com`` that he has blocked earlier::
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
54
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
55 $ li blocking unblock example.com
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
56
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
57 Élysée want to unblock all blocked users, without confirmation::
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
58
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
59 $ li blocking unblock -f all
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
60
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
61
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
62 .. _XEP-0191: https://xmpp.org/extensions/xep-0191.html
665f060fbecb doc (cli/blocking): `blocking` command documentation:
Goffi <goffi@goffi.org>
parents:
diff changeset
63 .. _XEP-0191 § JID Matching: https://xmpp.org/extensions/xep-0191.html#matching