example-bot: Add note about encrypting for MUCs

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-02-27 11:45:21 +00:00
parent c753a672f4
commit 1496becac7
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -156,6 +156,12 @@ class EchoBot(ClientXMPP):
# `encrypt_message` excepts the plaintext to be sent, a list of # `encrypt_message` excepts the plaintext to be sent, a list of
# bare JIDs to encrypt to, and optionally a dict of problems to # bare JIDs to encrypt to, and optionally a dict of problems to
# expect per bare JID. # expect per bare JID.
#
# Note that this function returns an `<encrypted/>` object,
# and not a full Message stanza. This combined with the
# `recipients` parameter that requires for a list of JIDs,
# allows you to encrypt for 1:1 as well as groupchats (MUC).
#
# TODO: Document expect_problems # TODO: Document expect_problems
recipients = [mto] recipients = [mto]
encrypt = await self['xep_0384'].encrypt_message(body, recipients) encrypt = await self['xep_0384'].encrypt_message(body, recipients)