bridgev2/portal: allow remote events to have post handlers
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run

This commit is contained in:
Tulir Asokan 2024-10-01 13:52:37 +03:00
commit 37af19a01a
2 changed files with 9 additions and 0 deletions

View file

@ -884,6 +884,11 @@ type RemotePreHandler interface {
PreHandle(ctx context.Context, portal *Portal)
}
type RemotePostHandler interface {
RemoteEvent
PostHandle(ctx context.Context, portal *Portal)
}
type RemoteChatInfoChange interface {
RemoteEvent
GetChatInfoChange(ctx context.Context) (*ChatInfoChange, error)

View file

@ -1594,6 +1594,10 @@ func (portal *Portal) handleRemoteEvent(ctx context.Context, source *UserLogin,
default:
log.Warn().Msg("Got remote event with unknown type")
}
postHandler, ok := evt.(RemotePostHandler)
if ok {
postHandler.PostHandle(ctx, portal)
}
}
func (portal *Portal) getIntentAndUserMXIDFor(ctx context.Context, sender EventSender, source *UserLogin, otherLogins []*UserLogin, evtType RemoteEventType) (intent MatrixAPI, extraUserID id.UserID) {