diff --git a/bridgev2/portal.go b/bridgev2/portal.go index 6ada8918..f3adddd9 100644 --- a/bridgev2/portal.go +++ b/bridgev2/portal.go @@ -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 } } diff --git a/bridgev2/simplevent/meta.go b/bridgev2/simplevent/meta.go index f9a1ea6a..8aa91866 100644 --- a/bridgev2/simplevent/meta.go +++ b/bridgev2/simplevent/meta.go @@ -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 {