1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

fix: cqcode fix url

之前写的时候憨批了
This commit is contained in:
wdvxdr 2021-03-28 00:11:13 +08:00
parent 001d9aa0d6
commit 8db68f9427
No known key found for this signature in database
GPG Key ID: 55FF1414A69CEBA6

View File

@ -443,8 +443,14 @@ 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 {
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
j = i
@ -501,8 +507,14 @@ S4: // CQCode param value
goto End
End:
if i > j {
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
}