annotate doc/libervia-cli/message.rst @ 4326:5fd6a4dc2122

cli (output/std): use `rich` to output JSON.
author Goffi <goffi@goffi.org>
date Wed, 20 Nov 2024 11:38:44 +0100
parents 073bb1d1a7f8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
1 .. highlight:: sh
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
2
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
3 ================================
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 message: chat message management
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 ================================
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 Message commands let you send chat messages or manage your server message archives.
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
8
3488
c80a0f864b5d doc: updated doc following global renaming
Goffi <goffi@goffi.org>
parents: 3454
diff changeset
9 .. _libervia-cli_message_send:
3041
72583524cfd3 doc (jp): jp commands are now fully documented:
Goffi <goffi@goffi.org>
parents: 2946
diff changeset
10
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 send
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 ====
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
13
3041
72583524cfd3 doc (jp): jp commands are now fully documented:
Goffi <goffi@goffi.org>
parents: 2946
diff changeset
14 Send a message to a contact or a chat room.
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 ``stdin`` is used as message source.
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
16 You can encrypt your message using ``--encrypt [ALGORITHM]`` argument, this will create an encrypted session and replace existing one if needed.
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
17 You can manage your encrypted session using ``encryption`` command.
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
18
4311
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
19 It's possible to send a message to several participants at once (besides group chat),
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
20 using addressing commands like ``--to``, ``--cc``, or ``--bcc``. This works in a similar
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
21 way as for emails. If your server supports it (i.e., if it supports `XEP-0033`_), only
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
22 one message will be sent from Libervia, and the server will handle the rest. If it doesn't
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
23 support multicasting, Libervia will handle it itself and send as many messages as
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
24 necessary.
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
25
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
26 You can also add metadata to the message to indicate who must get the reply (with
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
27 ``--reply-to`` and ``reply-room``) or if the message doesn't expect any reply (with
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
28 ``--no-reply``).
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
29
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
30 examples
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
31 --------
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
32
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
33 Send a message to a contact::
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
34
3488
c80a0f864b5d doc: updated doc following global renaming
Goffi <goffi@goffi.org>
parents: 3454
diff changeset
35 $ echo 'Salut à Toi!' | li message send louise@example.net
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
36
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
37 Send a message encrypted with OMEMO::
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
38
3488
c80a0f864b5d doc: updated doc following global renaming
Goffi <goffi@goffi.org>
parents: 3454
diff changeset
39 $ echo 'pssst, this message is encrypted' | li message send -e omemo louise@example.net
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
40
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
41 Send a ``normal`` message marked as French with a subject::
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
42
3505
4705f80b6e23 doc: more renaming
Goffi <goffi@goffi.org>
parents: 3488
diff changeset
43 $ echo 'Bonjour, je vous écris avec « Libervia »' | li message send -l fr -t normal -S 'Ceci est un message de test'
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
44
3806
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
45 retract
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
46 =======
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
47
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
48 Retract a message, i.e. mark it as retracted in database, and send a retraction request to
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
49 original recipient.
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
50
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
51 When a message is marked as retracted in database, it won't appear anymore or a hint
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
52 (commonly called *tombstone*) will be displayed instead (the behaviour depend of the
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
53 frontend that you're using). However, there is an option to archive retracted messages:
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
54 ``Privacy``/``retract_history``. This option is disabled by default, but if you set it
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
55 (e.g. with ``li param set``), the original message will be kept in metadata and may be
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
56 displayed if the frontend that you're using allows it.
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
57
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
58 The ``message_id`` positional argument is the internal ID of the message (not an XMPP ID).
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
59 It may be displayed by some frontends.
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
60
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
61 .. note::
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
62
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
63 It is not possible to be sure that a message will be retracted: once something is sent
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
64 through the network, any recipient can keep it, copy it, share it, etc. This is true for
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
65 Libervia/XMPP as for any software, decentralized or not.
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
66
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
67 Retract send a retractation **request**, i.e. it asks to the recipient(s) client(s) to
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
68 hide or delete the message, but it's not possible to have a guarantee that nobody kept
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
69 a request.
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
70
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
71 The message is also removed from database, except if the option
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
72 ``Privacy``/``retract_history`` is set (see above).
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
73
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
74 example
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
75 -------
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
76
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
77 Retract message with ID ``1234-5678-9abc-def0``::
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
78
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
79 $ li message retract 1234-5678-9abc-def0
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
80
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
81 mam
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
82 ===
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
83
3041
72583524cfd3 doc (jp): jp commands are now fully documented:
Goffi <goffi@goffi.org>
parents: 2946
diff changeset
84 Query archives using MAM.
3806
adebd8036b68 doc (cli/message): `retract` command
Goffi <goffi@goffi.org>
parents: 3563
diff changeset
85
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
86 This command allows you to check message archive kept on the server (i.e. not the local copy).
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
87 You usually want to specify a starting point, and a number of message to retrieve. If too many messages
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
88 are available, you'll have to use RSM commands to navigate through the results.
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
89
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
90 examples
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
91 --------
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
92
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
93 Retrieve messages from last 2 days::
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
94
3488
c80a0f864b5d doc: updated doc following global renaming
Goffi <goffi@goffi.org>
parents: 3454
diff changeset
95 $ li message mam -S "2 days ago"
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
96
3563
267e4987b58b doc: fix remaining SàT references/typos + add `libervia-cli` missing commands
Goffi <goffi@goffi.org>
parents: 3505
diff changeset
97 Retrieve messages from last 5 hours on Libervia official chat room::
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
98
4077
d6837db456fd refactoring: fix names in doc following modules hierarchy refactoring
Goffi <goffi@goffi.org>
parents: 3806
diff changeset
99 $ li message mam -S "5 hours ago" -s libervia@chat.jabberfr.org
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
100
3563
267e4987b58b doc: fix remaining SàT references/typos + add `libervia-cli` missing commands
Goffi <goffi@goffi.org>
parents: 3505
diff changeset
101 Retrieve 2 first messages of 2019 on Libervia official chat room::
2946
ce16847a7b6d doc: documentation first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
102
4077
d6837db456fd refactoring: fix names in doc following modules hierarchy refactoring
Goffi <goffi@goffi.org>
parents: 3806
diff changeset
103 $ li message mam -S 2019-01-01 -s libervia@chat.jabberfr.org -m 2
4311
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
104
073bb1d1a7f8 doc (cli/message): add documentation for new addressing commands:
Goffi <goffi@goffi.org>
parents: 4077
diff changeset
105 .. _XEP-0033: https://xmpp.org/extensions/xep-0033.html