synapse/handlers/groups_local.py
def on_invite(self, group_id, user_id, content):
        """One of our users were invited to a group
        """
        # TODO: Support auto join and rejection

        if not self.is_mine_id(user_id):
            raise SynapseError(400, "User not on this server")

        local_profile = {}
        if "profile" in content:
            if "name" in content["profile"]:
                local_profile["name"] = content["profile"]["name"]
            if "avatar_url" in content["profile"]:
                local_profile["avatar_url"] = content["profile"]["avatar_url"]

        token = yield self.store.register_user_group_membership(
            group_id, user_id,
            membership="invite",
            content={"profile": local_profile, "inviter": content["inviter"]},
        )
        self.notifier.on_new_event(
            "groups_key", token, users=[user_id],
        )
        try:
            user_profile = yield self.profile_handler.get_profile(user_id)
        except Exception as e:
            logger.warn("No profile for user %s: %s", user_id, e)
            user_profile = {}

        defer.returnValue({"state": "invite", "user_profile": user_profile})
One of our users were invited to a group
        
One of our users were invited to a group
One of our users were invited to a group
def on_invite(self, group_id, user_id, content):
        if not self.is_mine_id(user_id):
            raise SynapseError(400, "User not on this server")
        local_profile = {}
        if "profile" in content:
            if "name" in content["profile"]:
                local_profile["name"] = content["profile"]["name"]
            if "avatar_url" in content["profile"]:
                local_profile["avatar_url"] = content["profile"]["avatar_url"]
        token = yield self.store.register_user_group_membership(
            group_id, user_id,
            membership="invite",
            content={"profile": local_profile, "inviter": content["inviter"]},
        )
        self.notifier.on_new_event(
            "groups_key", token, users=[user_id],
        )
        try:
            user_profile = yield self.profile_handler.get_profile(user_id)
        except Exception as e:
            logger.warn("No profile for user %s: %s", user_id, e)
            user_profile = {}
        defer.returnValue({"state": "invite", "user_profile": user_profile})
def on_invite ( self , group_id , user_id , content ) : if not self . is_mine_id ( user_id ) : raise SynapseError ( 400 , "User not on this server" ) local_profile = { } if "profile" in content : if "name" in content [ "profile" ] : local_profile [ "name" ] = content [ "profile" ] [ "name" ] if "avatar_url" in content [ "profile" ] : local_profile [ "avatar_url" ] = content [ "profile" ] [ "avatar_url" ] token = yield self . store . register_user_group_membership ( group_id , user_id , membership = "invite" , content = { "profile" : local_profile , "inviter" : content [ "inviter" ] } , ) self . notifier . on_new_event ( "groups_key" , token , users = [ user_id ] , ) try : user_profile = yield self . profile_handler . get_profile ( user_id ) except Exception as e : logger . warn ( "No profile for user %s: %s" , user_id , e ) user_profile = { } defer . returnValue ( { "state" : "invite" , "user_profile" : user_profile } )
One of our users were invited to a group
One of our users were invited to a group
"""One of our users were invited to a group
        """ # TODO: Support auto join and rejection
self
group_id
user_id
content