diff options
author | chotaire <chotaire@chotaire.net> | 2019-04-18 23:56:05 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2019-04-18 23:56:05 +0200 |
commit | 6b47e295836254b8de8da384db5263fc3ef14362 (patch) | |
tree | 5ab4646f533411519bd66a795e2531ebd75549fd /bridge | |
parent | 380c38674c19d741b344c627a2db7f8f34d223d3 (diff) | |
download | matterbridge-msglm-6b47e295836254b8de8da384db5263fc3ef14362.tar.gz matterbridge-msglm-6b47e295836254b8de8da384db5263fc3ef14362.tar.bz2 matterbridge-msglm-6b47e295836254b8de8da384db5263fc3ef14362.zip |
Add verbose IRC joins/parts (ident@host) (#805)
New configuration setting: VerboseJoinPart (default is false)
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/config/config.go | 3 | ||||
-rw-r--r-- | bridge/irc/handlers.go | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/bridge/config/config.go b/bridge/config/config.go index 29261d58..1af6f407 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -120,7 +120,7 @@ type Protocol struct { ReplaceMessages [][]string // all protocols ReplaceNicks [][]string // all protocols RemoteNickFormat string // all protocols - RunCommands []string // irc + RunCommands []string // IRC Server string // IRC,mattermost,XMPP,discord ShowJoinPart bool // all protocols ShowTopicChange bool // slack @@ -141,6 +141,7 @@ type Protocol struct { UseFirstName bool // telegram UseUserName bool // discord UseInsecureURL bool // telegram + VerboseJoinPart bool // IRC WebhookBindAddress string // mattermost, slack WebhookURL string // mattermost, slack } diff --git a/bridge/irc/handlers.go b/bridge/irc/handlers.go index 1d260071..f0e54928 100644 --- a/bridge/irc/handlers.go +++ b/bridge/irc/handlers.go @@ -91,8 +91,13 @@ func (b *Birc) handleJoinPart(client *girc.Client, event girc.Event) { if b.GetBool("nosendjoinpart") { return } - b.Log.Debugf("<= Sending JOIN_LEAVE event from %s to gateway", b.Account) msg := config.Message{Username: "system", Text: event.Source.Name + " " + strings.ToLower(event.Command) + "s", Channel: channel, Account: b.Account, Event: config.EventJoinLeave} + if b.GetBool("verbosejoinpart") { + b.Log.Debugf("<= Sending verbose JOIN_LEAVE event from %s to gateway", b.Account) + msg = config.Message{Username: "system", Text: event.Source.Name + " (" + event.Source.Ident + "@" + event.Source.Host + ") " + strings.ToLower(event.Command) + "s", Channel: channel, Account: b.Account, Event: config.EventJoinLeave} + } else { + b.Log.Debugf("<= Sending JOIN_LEAVE event from %s to gateway", b.Account) + } b.Log.Debugf("<= Message is %#v", msg) b.Remote <- msg return |