Get it working, using not-great and very initial splitting code

This commit is contained in:
Daniel Oaks
2017-01-14 15:28:50 +10:00
parent 92626a178d
commit f6185fa336
4 changed files with 127 additions and 11 deletions
+15 -3
View File
@@ -142,10 +142,10 @@ func (client *Client) maxlens() (int, int) {
maxlenTags = 4096
}
if client.capabilities[MaxLine] {
if maxLineTagsLength > maxlenTags {
maxlenTags = maxLineTagsLength
if client.server.limits.LineLen.Tags > maxlenTags {
maxlenTags = client.server.limits.LineLen.Tags
}
maxlenRest = maxLineRestLength
maxlenRest = client.server.limits.LineLen.Rest
}
return maxlenTags, maxlenRest
}
@@ -496,6 +496,18 @@ func (client *Client) destroy() {
}
}
// SendSplitMsgFromClient sends an IRC PRIVMSG/NOTICE coming from a specific client.
// Adds account-tag to the line as well.
func (client *Client) SendSplitMsgFromClient(from *Client, tags *map[string]ircmsg.TagValue, command, target string, message SplitMessage) {
if client.capabilities[MaxLine] {
client.SendFromClient(from, tags, from.nickMaskString, command, target, message.ForMaxLine)
} else {
for _, str := range message.For512 {
client.SendFromClient(from, tags, from.nickMaskString, command, target, str)
}
}
}
// SendFromClient sends an IRC line coming from a specific client.
// Adds account-tag to the line as well.
func (client *Client) SendFromClient(from *Client, tags *map[string]ircmsg.TagValue, prefix string, command string, params ...string) error {