Skip to content

Commit

Permalink
fix: #1557
Browse files Browse the repository at this point in the history
  • Loading branch information
Akegarasu committed Jun 25, 2022
1 parent 7e75035 commit a0fba6a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions coolq/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,12 @@ func (bot *CQBot) uploadForwardElement(m gjson.Result, target int64, sourceType
groupID := target
source := message.Source{SourceType: sourceType, PrimaryID: target}
if sourceType == message.SourcePrivate {
groupID = 0
// ios 设备的合并转发来源群号不能为 0
if len(bot.Client.GroupList) == 0 {
groupID = 1
} else {
groupID = bot.Client.GroupList[1].Uin
}
}
builder := bot.Client.NewForwardMessageBuilder(groupID)

Expand Down Expand Up @@ -875,12 +880,10 @@ func (bot *CQBot) uploadForwardElement(m gjson.Result, target int64, sourceType
i := e.Get("data.id").Int()
m, _ := db.GetMessageByGlobalID(int32(i))
if m != nil {
mSource := func() message.SourceType {
if m.GetType() == "group" {
return message.SourceGroup
}
return message.SourcePrivate
}()
mSource := message.SourcePrivate
if m.GetType() == "group" {
mSource = message.SourceGroup
}
msgTime := m.GetAttribute().Timestamp
if msgTime == 0 {
msgTime = ts.Unix()
Expand Down

0 comments on commit a0fba6a

Please sign in to comment.