diff options
author | Wim <wim@42.be> | 2021-05-27 21:45:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 21:45:23 +0200 |
commit | c86137449e733fc643337f33eaa33daf9e16d73c (patch) | |
tree | 711cbfd7f64edfbf1780285b0f177afc2b3c472b /bridge/irc | |
parent | efec01a92f3d7c3aec3ada8bf873d728e349eee6 (diff) | |
download | matterbridge-msglm-c86137449e733fc643337f33eaa33daf9e16d73c.tar.gz matterbridge-msglm-c86137449e733fc643337f33eaa33daf9e16d73c.tar.bz2 matterbridge-msglm-c86137449e733fc643337f33eaa33daf9e16d73c.zip |
Add a MessageClipped option to set your own clipped message. Closes #1359 (#1487)
Diffstat (limited to 'bridge/irc')
-rw-r--r-- | bridge/irc/irc.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index 4ccdee95..e54f8030 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -167,9 +167,9 @@ func (b *Birc) Send(msg config.Message) (string, error) { } if b.GetBool("MessageSplit") { - msgLines = helper.GetSubLines(msg.Text, b.MessageLength) + msgLines = helper.GetSubLines(msg.Text, b.MessageLength, b.GetString("MessageClipped")) } else { - msgLines = helper.GetSubLines(msg.Text, 0) + msgLines = helper.GetSubLines(msg.Text, 0, b.GetString("MessageClipped")) } for i := range msgLines { if len(b.Local) >= b.MessageQueue { @@ -316,12 +316,16 @@ func (b *Birc) endNames(client *girc.Client, event girc.Event) { sort.Strings(b.names[channel]) maxNamesPerPost := (300 / b.nicksPerRow()) * b.nicksPerRow() for len(b.names[channel]) > maxNamesPerPost { - b.Remote <- config.Message{Username: b.Nick, Text: b.formatnicks(b.names[channel][0:maxNamesPerPost]), - Channel: channel, Account: b.Account} + b.Remote <- config.Message{ + Username: b.Nick, Text: b.formatnicks(b.names[channel][0:maxNamesPerPost]), + Channel: channel, Account: b.Account, + } b.names[channel] = b.names[channel][maxNamesPerPost:] } - b.Remote <- config.Message{Username: b.Nick, Text: b.formatnicks(b.names[channel]), - Channel: channel, Account: b.Account} + b.Remote <- config.Message{ + Username: b.Nick, Text: b.formatnicks(b.names[channel]), + Channel: channel, Account: b.Account, + } b.names[channel] = nil b.i.Handlers.Clear(girc.RPL_NAMREPLY) b.i.Handlers.Clear(girc.RPL_ENDOFNAMES) |