mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/portal: allow remote events to have post handlers
This commit is contained in:
parent
1b7a78b811
commit
37af19a01a
2 changed files with 9 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue