plugin email invitation: guests are now automatically added to host roster in guests group
This commit is contained in:
parent
a8cb6e5a70
commit
f6a33c170b
1 changed files with 11 additions and 0 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue