Use custom type for EventHandler output

This commit is contained in:
Tulir Asokan 2018-06-14 20:21:44 +03:00
parent feaf75b327
commit 944b384633
3 changed files with 15 additions and 12 deletions

View file

@ -53,7 +53,13 @@ const (
const FormatHTML = "org.matrix.custom.html"
type EventHandler func(*Event) bool
type EventHandler func(*Event) EventHandlerResult
type EventHandlerResult bool
const (
Continue EventHandlerResult = false
StopPropagation EventHandlerResult = true
)
type MatrixClient interface {
AddEventHandler(EventType, EventHandler)