update deps; experiment: log security
This commit is contained in:
23
vendor/maunium.net/go/mautrix/appservice/eventprocessor.go
generated
vendored
23
vendor/maunium.net/go/mautrix/appservice/eventprocessor.go
generated
vendored
@@ -137,12 +137,22 @@ func (ep *EventProcessor) Dispatch(evt *event.Event) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (ep *EventProcessor) Start() {
|
||||
func (ep *EventProcessor) startEvents() {
|
||||
for {
|
||||
select {
|
||||
case evt := <-ep.as.Events:
|
||||
ep.Dispatch(evt)
|
||||
case <-ep.stop:
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (ep *EventProcessor) startEncryption() {
|
||||
for {
|
||||
select {
|
||||
case evt := <-ep.as.ToDeviceEvents:
|
||||
ep.Dispatch(evt)
|
||||
case otk := <-ep.as.OTKCounts:
|
||||
ep.DispatchOTK(otk)
|
||||
case dl := <-ep.as.DeviceLists:
|
||||
@@ -153,6 +163,11 @@ func (ep *EventProcessor) Start() {
|
||||
}
|
||||
}
|
||||
|
||||
func (ep *EventProcessor) Stop() {
|
||||
ep.stop <- struct{}{}
|
||||
func (ep *EventProcessor) Start() {
|
||||
go ep.startEvents()
|
||||
go ep.startEncryption()
|
||||
}
|
||||
|
||||
func (ep *EventProcessor) Stop() {
|
||||
close(ep.stop)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user