From c86137449e733fc643337f33eaa33daf9e16d73c Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 27 May 2021 21:45:23 +0200 Subject: Add a MessageClipped option to set your own clipped message. Closes #1359 (#1487) --- bridge/irc/irc.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'bridge/irc/irc.go') 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) -- cgit v1.2.3