hotfix #26

Merged
李寻欢 merged 3 commits from hotfix into main 2024-03-07 10:04:47 +08:00
Showing only changes of commit 165fefdb48 - Show all commits

View File

@ -88,7 +88,13 @@ func (m Message) IsRevokeMsg() bool {
// @receiver m // @receiver m
// @return bool // @return bool
func (m Message) IsNewUserJoin() 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 { if sysFlag {
return true return true
} }
@ -97,7 +103,7 @@ func (m Message) IsNewUserJoin() bool {
if err := xml.Unmarshal([]byte(m.Content), &d); err != nil { if err := xml.Unmarshal([]byte(m.Content), &d); err != nil {
return false return false
} }
return m.Type == types.MsgTypeSys && d.Type == "delchatroommember" return d.Type == "delchatroommember"
} }
// IsAt // IsAt