@@ 114,10 114,10 @@ func (elections *ElectionsMap) SetupEventHooks(client *mautrix.Client, syncer ma
}
wrapper := func(f func(*event.Event) bool) func(*event.Event) bool {
- return func(evt *event.Event) (success bool) {
+ return func(evt *event.Event) bool {
if evt.Unsigned.RedactedBecause != nil {
log.Debugf("event %s was redacted", evt.ID)
- return
+ return false
}
eventStore.Lock()
_, evtIsProcessing := eventStore.Processing[evt.ID]
@@ 140,7 140,7 @@ func (elections *ElectionsMap) SetupEventHooks(client *mautrix.Client, syncer ma
eventStore.Processing[evt.ID] = struct{}{}
eventStore.Unlock()
}
- success = f(evt)
+ success := f(evt)
eventStore.Lock()
// see EventStore doc for success explanation
if success {
@@ 150,7 150,7 @@ func (elections *ElectionsMap) SetupEventHooks(client *mautrix.Client, syncer ma
}
delete(eventStore.Processing, evt.ID)
eventStore.Unlock()
- return
+ return success
}
}