From a2773922d2fe40e6d95d73f532640702709ab526 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Wed, 3 Mar 2021 16:27:44 +0000 Subject: Send events to appservice based on room membership (#1680) * Check membership of room * Use QueryStateAfterEventsResponse * Fix complexity * Changes that I made a long time ago * Rename to appserviceJoinedAtEvent * Check membership in GetMemberships * Update QueryMembershipsForRoom * Tweaks in client API * Update appserviceJoinedAtEvent * Comments * Try QueryMembershipForUser instead * Undo some changes to client API that shouldn't be needed * More /event tweaks * Refactor /event bit * Go back to QueryMembershipsForRoom because appservices are hard * Fix bugs in onMessage * Add comments Co-authored-by: Neil Alexander --- userapi/internal/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'userapi/internal/api.go') diff --git a/userapi/internal/api.go b/userapi/internal/api.go index e104714b..0d01afa1 100644 --- a/userapi/internal/api.go +++ b/userapi/internal/api.go @@ -381,7 +381,8 @@ func (a *UserInternalAPI) queryAppServiceToken(ctx context.Context, token, appSe // Use AS dummy device ID ID: types.AppServiceDeviceID, // AS dummy device has AS's token. - AccessToken: token, + AccessToken: token, + AppserviceID: appService.ID, } localpart, err := userutil.ParseUsernameParam(appServiceUserID, &a.ServerName) -- cgit v1.2.3