Skip to content

Commit b6bde0f

Browse files
irc: Deprecate MessageSplit/MessageClipped to avoid double splitting
1 parent e89a4f6 commit b6bde0f

5 files changed

Lines changed: 2 additions & 37 deletions

File tree

bridge/config/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ type Protocol struct {
160160
MessageFormat string // telegram
161161
MessageLength int // IRC, max length of a message allowed
162162
MessageQueue int // IRC, size of message queue for flood control
163-
MessageSplit bool // IRC, split long messages with newlines on MessageLength instead of clipping
164163
MessageSplitMaxCount int // discord, split long messages into at most this many messages instead of clipping (MessageLength=1950 cannot be configured)
165164
Muc string // xmpp
166165
MxID string // matrix

bridge/irc/irc.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/lrstanley/girc"
1616
"github.com/matterbridge-org/matterbridge/bridge"
1717
"github.com/matterbridge-org/matterbridge/bridge/config"
18-
"github.com/matterbridge-org/matterbridge/bridge/helper"
1918
stripmd "github.com/writeas/go-strip-markdown"
2019

2120
// We need to import the 'data' package as an implicit dependency.
@@ -166,25 +165,11 @@ func (b *Birc) Send(msg config.Message) (string, error) {
166165
return "", nil
167166
}
168167

169-
var msgLines []string
170168
if b.GetBool("StripMarkdown") {
171169
msg.Text = stripmd.Strip(msg.Text)
172170
}
173171

174-
if b.GetBool("MessageSplit") {
175-
msgLines = helper.GetSubLines(msg.Text, b.MessageLength, b.GetString("MessageClipped"))
176-
} else {
177-
msgLines = helper.GetSubLines(msg.Text, 0, b.GetString("MessageClipped"))
178-
}
179-
for i := range msgLines {
180-
if len(b.Local) >= b.MessageQueue {
181-
b.Log.Debugf("flooding, dropping message (queue at %d)", len(b.Local))
182-
return "", nil
183-
}
184-
185-
msg.Text = msgLines[i]
186-
b.Local <- msg
187-
}
172+
b.Local <- msg
188173
return "", nil
189174
}
190175

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- steam protocol has changed profoundly
1212
- keybase has been removed because we don't have a maintainer for it. See
1313
[issue #9](https://github.com/matterbridge-org/matterbridge/issues/9)
14+
- irc: the `MessageSplit` and `MessageClipped` config options have been deprecated, because message splitting has been enabled by default upstream in girc; see [#190](https://github.com/matterbridge-org/matterbridge/issues/190#issuecomment-4230431653) for more information)
1415
- matrix: Change to mautrix.go for the matrix backend. See ([pr #79](https://github.com/matterbridge-org/matterbridge/pull/79)/[issue #60](https://github.com/matterbridge-org/matterbridge/issues/60)
1516
- xmpp: Initial replies/edits support has been removed, because it was incorrect ([#12](https://github.com/matterbridge-org/matterbridge/pull/12))
1617
- xmpp: `NoTls` setting has been deprecated; to disable `StartTls` and start a plaintext connection, use `NoStartTls`

docs/protocols/irc/settings.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,6 @@ messages will be dropped.
9393
MessageQueue=30
9494
```
9595

96-
## MessageSplit
97-
Split messages on `MessageLength` instead of showing the `<message clipped>`
98-
WARNING: this could lead to flooding
99-
100-
- Setting: **OPTIONAL**, **RELOADABLE**
101-
- Format: *boolean*
102-
- Example:
103-
```toml
104-
MessageSplit=true
105-
```
106-
10796
## Nick *
10897
Your nick on irc.
10998

matterbridge.toml.sample

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,6 @@ MessageQueue=30
105105
#OPTIONAL (default 400)
106106
MessageLength=400
107107

108-
#Split messages on MessageLength instead of showing the <clipped message>
109-
#WARNING: this could lead to flooding
110-
#OPTIONAL (default false)
111-
MessageSplit=false
112-
113-
#Message to show when a message is too big
114-
#Default "<clipped message>"
115-
MessageClipped="<clipped message>"
116-
117108
#Delay in seconds to rejoin a channel when kicked
118109
#OPTIONAL (default 0)
119110
RejoinDelay=0

0 commit comments

Comments
 (0)