Merge pull request 'hotfix' (#26) from hotfix into main
All checks were successful
BuildImage / build-image (push) Successful in 1m15s
All checks were successful
BuildImage / build-image (push) Successful in 1m15s
Reviewed-on: #26
This commit is contained in:
commit
d3f8a59390
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user