plugin email invitation: guests are now automatically added to host roster in guests group

This commit is contained in:
Goffi 2020-08-13 23:46:18 +02:00
commit f6a33c170b

View file

@ -325,6 +325,17 @@ class InvitationsPlugin(object):
(kwargs.pop('message_body', None) or DEFAULT_BODY).format(**format_args),
)
## roster
# we automatically add guest to host roster (if host is specified)
# FIXME: a parameter to disable auto roster adding would be nice
if profile is not None:
try:
client = self.host.getClient(profile)
except Exception as e:
log.error(f"Can't get host profile: {profile}: {e}")
else:
await self.host.updateContact(client, jid_, name, ['guests'])
if kwargs:
log.warning(_("Not all arguments have been consumed: {}").format(kwargs))