summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/lrstanley/girc/state.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2023-08-05 20:43:19 +0200
committerGitHub <noreply@github.com>2023-08-05 20:43:19 +0200
commit56e7bd01ca09ad52b0c4f48f146a20a4f1b78696 (patch)
treeb1355645342667209263cbd355dc0b4254f1e8fe /vendor/github.com/lrstanley/girc/state.go
parent9459495484d6e06a3d46de64fccd8d06f7ccc72c (diff)
downloadmatterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.tar.gz
matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.tar.bz2
matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.zip
Update dependencies and remove old matterclient lib (#2067)HEADmaster
Diffstat (limited to 'vendor/github.com/lrstanley/girc/state.go')
-rw-r--r--vendor/github.com/lrstanley/girc/state.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/vendor/github.com/lrstanley/girc/state.go b/vendor/github.com/lrstanley/girc/state.go
index d9e72981..96d2ef88 100644
--- a/vendor/github.com/lrstanley/girc/state.go
+++ b/vendor/github.com/lrstanley/girc/state.go
@@ -28,10 +28,21 @@ type state struct {
// last capability check. These will get sent once we have received the
// last capability list command from the server.
tmpCap map[string]map[string]string
+
// serverOptions are the standard capabilities and configurations
// supported by the server at connection time. This also includes
// RPL_ISUPPORT entries.
serverOptions map[string]string
+
+ // maxLineLength defines how long before we truncate (or split) messages.
+ // DefaultMaxLineLength is what is used by default, as this is going to be a common
+ // standard. However, protocols like IRCv3, or ISUPPORT can override this.
+ maxLineLength int
+
+ // maxPrefixLength defines the estimated prefix length (":nick!user@host ") that
+ // we can use to calculate line splits.
+ maxPrefixLength int
+
// motd is the servers message of the day.
motd string
@@ -51,9 +62,11 @@ func (s *state) reset(initial bool) {
s.host = ""
s.channels = make(map[string]*Channel)
s.users = make(map[string]*User)
- s.serverOptions = make(map[string]string)
s.enabledCap = make(map[string]map[string]string)
s.tmpCap = make(map[string]map[string]string)
+ s.serverOptions = make(map[string]string)
+ s.maxLineLength = DefaultMaxLineLength
+ s.maxPrefixLength = DefaultMaxPrefixLength
s.motd = ""
if initial {