summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/lrstanley/girc/handler.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-05-09 22:48:39 +0200
committerWim <wim@42.be>2018-05-09 22:48:39 +0200
commit521a7ed7b0b70d886f5863d453963dc35bc0c850 (patch)
tree3fbc5ebdff573fc4bfd8941895959672f8931b4b /vendor/github.com/lrstanley/girc/handler.go
parent529b188164b7b0f18ca31a43410898e73a22ed03 (diff)
downloadmatterbridge-msglm-521a7ed7b0b70d886f5863d453963dc35bc0c850.tar.gz
matterbridge-msglm-521a7ed7b0b70d886f5863d453963dc35bc0c850.tar.bz2
matterbridge-msglm-521a7ed7b0b70d886f5863d453963dc35bc0c850.zip
Update vendor lrstanley/girc
Diffstat (limited to 'vendor/github.com/lrstanley/girc/handler.go')
-rw-r--r--vendor/github.com/lrstanley/girc/handler.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/vendor/github.com/lrstanley/girc/handler.go b/vendor/github.com/lrstanley/girc/handler.go
index 6c082708..bde08976 100644
--- a/vendor/github.com/lrstanley/girc/handler.go
+++ b/vendor/github.com/lrstanley/girc/handler.go
@@ -22,19 +22,28 @@ func (c *Client) RunHandlers(event *Event) {
}
// Log the event.
- c.debug.Print("< " + StripRaw(event.String()))
+ prefix := "< "
+ if event.Echo {
+ prefix += "[echo-message] "
+ }
+ c.debug.Print(prefix + StripRaw(event.String()))
if c.Config.Out != nil {
if pretty, ok := event.Pretty(); ok {
fmt.Fprintln(c.Config.Out, StripRaw(pretty))
}
}
- // Background handlers first.
+ // Background handlers first. If the event is an echo-message, then only
+ // send the echo version to ALL_EVENTS.
c.Handlers.exec(ALL_EVENTS, true, c, event.Copy())
- c.Handlers.exec(event.Command, true, c, event.Copy())
+ if !event.Echo {
+ c.Handlers.exec(event.Command, true, c, event.Copy())
+ }
c.Handlers.exec(ALL_EVENTS, false, c, event.Copy())
- c.Handlers.exec(event.Command, false, c, event.Copy())
+ if !event.Echo {
+ c.Handlers.exec(event.Command, false, c, event.Copy())
+ }
// Check if it's a CTCP.
if ctcp := decodeCTCP(event.Copy()); ctcp != nil {