1
0
Fork 0
forked from External/ergo

import changes

This commit is contained in:
Failure 2024-07-24 17:10:22 -07:00
parent 30f47a9b22
commit ca62b268b0
16 changed files with 272 additions and 34 deletions

View file

@ -16,6 +16,7 @@ func IsRestrictedCTCPMessage(message string) bool {
type MessagePair struct {
Message string
Tags map[string]string
Concat bool // should be relayed with the multiline-concat tag
}
@ -37,19 +38,20 @@ type SplitMessage struct {
func MakeMessage(original string) (result SplitMessage) {
result.Message = original
result.Msgid = GenerateSecretToken()
result.Msgid = GenerateMessageIdStr()
result.SetTime()
return
}
func (sm *SplitMessage) Append(message string, concat bool) {
func (sm *SplitMessage) Append(message string, concat bool, tags map[string]string) {
if sm.Msgid == "" {
sm.Msgid = GenerateSecretToken()
sm.Msgid = GenerateMessageIdStr()
}
sm.Split = append(sm.Split, MessagePair{
Message: message,
Concat: concat,
Tags: tags,
})
}