mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-20 06:28:09 -07:00
Get it working, using not-great and very initial splitting code
This commit is contained in:
+15
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user