mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 22:35:52 +01:00
bridgev2/portal: run post handle even if chat resync is short-circuited
This commit is contained in:
parent
5967fe7b0f
commit
449de115ff
2 changed files with 10 additions and 2 deletions
|
|
@ -1628,6 +1628,10 @@ func (portal *Portal) handleRemoteEvent(ctx context.Context, source *UserLogin,
|
|||
}
|
||||
if evtType == RemoteEventChatResync {
|
||||
log.Debug().Msg("Not handling chat resync event further as portal was created by it")
|
||||
postHandler, ok := evt.(RemotePostHandler)
|
||||
if ok {
|
||||
postHandler.PostHandle(ctx, portal)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,11 +80,15 @@ func (evt *EventMeta) ShouldCreatePortal() bool {
|
|||
}
|
||||
|
||||
func (evt *EventMeta) PreHandle(ctx context.Context, portal *bridgev2.Portal) {
|
||||
evt.PreHandleFunc(ctx, portal)
|
||||
if evt.PreHandleFunc != nil {
|
||||
evt.PreHandleFunc(ctx, portal)
|
||||
}
|
||||
}
|
||||
|
||||
func (evt *EventMeta) PostHandle(ctx context.Context, portal *bridgev2.Portal) {
|
||||
evt.PostHandleFunc(ctx, portal)
|
||||
if evt.PostHandleFunc != nil {
|
||||
evt.PostHandleFunc(ctx, portal)
|
||||
}
|
||||
}
|
||||
|
||||
func (evt EventMeta) WithType(t bridgev2.RemoteEventType) EventMeta {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue