# HG changeset patch # User Goffi # Date 1597355178 -7200 # Node ID e38ddaf477bdc0231852ce622feedd1f1f87c21c # Parent 83bc9d46a417d966eaef60a1eb538079a2f177a8 plugin email invitation: guests are now automatically added to host roster in `guests` group diff -r 83bc9d46a417 -r e38ddaf477bd sat/plugins/plugin_misc_email_invitation.py --- a/sat/plugins/plugin_misc_email_invitation.py Thu Aug 13 23:46:18 2020 +0200 +++ b/sat/plugins/plugin_misc_email_invitation.py Thu Aug 13 23:46:18 2020 +0200 @@ -325,6 +325,17 @@ (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))