Merge pull request 'hotfix' (#26) from hotfix into main
BuildImage / build-image (push) Successful in 1m15s Details

Reviewed-on: #26
This commit is contained in:
李寻欢 2024-03-07 10:04:47 +08:00
commit d3f8a59390
3 changed files with 18 additions and 2 deletions

View File

@ -88,7 +88,13 @@ func (m Message) IsRevokeMsg() bool {
// @receiver m
// @return bool
func (m Message) IsNewUserJoin() bool {
sysFlag := m.Type == types.MsgTypeSys && strings.Contains(m.Content, "\"邀请\"") && strings.Contains(m.Content, "\"加入了群聊")
if m.Type != types.MsgTypeSys {
return false
}
isInvitation := strings.Contains(m.Content, "\"邀请\"") && strings.Contains(m.Content, "\"加入了群聊")
isScanQrCode := strings.Contains(m.Content, "通过扫描") && strings.Contains(m.Content, "加入群聊")
sysFlag := isInvitation || isScanQrCode
if sysFlag {
return true
}
@ -97,7 +103,7 @@ func (m Message) IsNewUserJoin() bool {
if err := xml.Unmarshal([]byte(m.Content), &d); err != nil {
return false
}
return m.Type == types.MsgTypeSys && d.Type == "delchatroommember"
return d.Type == "delchatroommember"
}
// IsAt

View File

@ -22,6 +22,11 @@ func parse(msg []byte) {
// 记录原始数据
m.Raw = string(msg)
// 如果不是自己的消息,直接返回
if m.ToUser == current.GetRobotInfo().WxId {
return
}
// 提取出群成员信息
// Sys类型的消息正文不包含微信 Id所以不需要处理
if m.IsGroup() && m.Type != types.MsgTypeSys {

View File

@ -23,6 +23,11 @@ func parse(remoteAddr net.Addr, msg []byte) {
// 记录原始数据
m.Raw = string(msg)
// 如果不是自己的消息,直接返回
if m.ToUser == current.GetRobotInfo().WxId {
return
}
// 提取出群成员信息
// Sys类型的消息正文不包含微信 Id所以不需要处理
if m.IsGroup() && m.Type != types.MsgTypeSys {