1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

fix long msg error.

This commit is contained in:
Mrs4s 2020-09-09 17:50:06 +08:00
parent 23750bb591
commit dde8bded28
3 changed files with 14 additions and 8 deletions

View File

@ -13,10 +13,10 @@ import (
"math/rand" "math/rand"
"net" "net"
"strconv" "strconv"
"strings"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
"strings"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
@ -184,7 +184,7 @@ func (c *QQClient) GetVipInfo(target int64) (*VipInfo, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
ret := VipInfo{Uin: target}; ret := VipInfo{Uin: target}
b = b[bytes.Index(b, []byte(`<span class="ui-nowrap">`))+24:] b = b[bytes.Index(b, []byte(`<span class="ui-nowrap">`))+24:]
t := b[:bytes.Index(b, []byte(`</span>`))] t := b[:bytes.Index(b, []byte(`</span>`))]
ret.Name = string(t) ret.Name = string(t)
@ -445,7 +445,7 @@ func (c *QQClient) GetForwardMessage(resId string) *message.ForwardMessage {
ret.Nodes = append(ret.Nodes, &message.ForwardNode{ ret.Nodes = append(ret.Nodes, &message.ForwardNode{
SenderId: m.Head.FromUin, SenderId: m.Head.FromUin,
SenderName: func() string { SenderName: func() string {
if m.Head.MsgType == 82 { if m.Head.MsgType == 82 && m.Head.GroupInfo != nil {
return m.Head.GroupInfo.GroupCard return m.Head.GroupInfo.GroupCard
} }
return m.Head.FromNick return m.Head.FromNick

2
go.mod
View File

@ -4,6 +4,6 @@ go 1.14
require ( require (
github.com/golang/protobuf v1.4.2 github.com/golang/protobuf v1.4.2
github.com/tidwall/gjson v1.6.1 // indirect github.com/tidwall/gjson v1.6.1
google.golang.org/protobuf v1.25.0 google.golang.org/protobuf v1.25.0
) )

6
go.sum
View File

@ -24,6 +24,12 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/tidwall/gjson v1.6.1 h1:LRbvNuNuvAiISWg6gxLEFuCe72UKy5hDqhxW/8183ws=
github.com/tidwall/gjson v1.6.1/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0=
github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=