Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 97434f27c6c4e51fe71b7978f8c3ed69feee8690 Author: chotaire <chotaire@chotaire.net> Date: Thu Apr 18 23:56:05 2019 +0000 Add verbose IRC joins/parts (ident@host) (#805) New configuration setting: VerboseJoinPart (default is false) diff --git a/bridge/config/config.go b/bridge/config/config.go index 29261d5..1af6f40 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -1207 +1207 @@ 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 @@ -1416 +1417 @@ 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 1d26007..f0e5492 100644 --- a/bridge/irc/handlers.go +++ b/bridge/irc/handlers.go @@ -918 +9113 @@ 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 diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index 6531ace..51cf3e0 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -1576 +15711 @@ RemoteNickFormat="[{PROTOCOL}] <{NICK}> "  #OPTIONAL (default false)  ShowJoinPart=false   +#Enable to show verbose users joins/parts (ident@host) from other bridges +#Currently works for messages from the following bridges: irc +#OPTIONAL (default false) +VerboseJoinPart=false +  #Do not send joins/parts to other bridges  #Currently works for messages from the following bridges: irc, mattermost, slack  #OPTIONAL (default false)