1
0
Fork 0

🐛 修复扫码加入群聊的成员无法识别的BUG

This commit is contained in:
李寻欢 2024-03-07 10:04:03 +08:00
parent 22474efc57
commit 165fefdb48
1 changed files with 8 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