1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-07-09 07:18:31 +00:00

fix(cqcode): split url does not work

(cherry picked from commit 8db68f9427)
This commit is contained in:
wdvxdr
2021-03-28 00:11:13 +08:00
parent 5049a8f697
commit 84fef8f0c0

View File

@ -442,7 +442,13 @@ S1: // Plain Text
if *(*byte)(add(ptr, uintptr(i))) == '[' && i+4 < l &&
*(*uint32)(add(ptr, uintptr(i))) == magicCQ { // Magic :uint32([]byte("[CQ:"))
if i > j {
r = append(r, message.NewText(CQCodeUnescapeText(s[j:i])))
if SplitURL {
for _, str := range global.SplitURL(CQCodeUnescapeText(s[j:i])) {
r = append(r, message.NewText(str))
}
} else {
r = append(r, message.NewText(CQCodeUnescapeText(s[j:i])))
}
}
CQBegin = i
i += 4
@ -500,7 +506,13 @@ S4: // CQCode param value
goto End
End:
if i > j {
r = append(r, message.NewText(CQCodeUnescapeText(s[j:i])))
if SplitURL {
for _, str := range global.SplitURL(CQCodeUnescapeText(s[j:i])) {
r = append(r, message.NewText(str))
}
} else {
r = append(r, message.NewText(CQCodeUnescapeText(s[j:i])))
}
}
return
}