mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-07 18:45:58 +08:00
check.go
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package msg
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/check"
|
||||
"Open_IM/internal/common/notification"
|
||||
"Open_IM/internal/common/rpcserver"
|
||||
"Open_IM/pkg/common/config"
|
||||
@@ -25,6 +26,7 @@ import (
|
||||
type msgServer struct {
|
||||
*rpcserver.RpcServer
|
||||
MsgInterface controller.MsgInterface
|
||||
Group *check.GroupChecker
|
||||
}
|
||||
|
||||
type deleteMsg struct {
|
||||
|
||||
@@ -4,6 +4,9 @@ import (
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/proto/sdkws"
|
||||
"Open_IM/pkg/utils"
|
||||
"github.com/go-redis/redis/v8"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func isMessageHasReadEnabled(msgData *sdkws.MsgData) bool {
|
||||
@@ -23,3 +26,12 @@ func isMessageHasReadEnabled(msgData *sdkws.MsgData) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func IsNotFound(err error) bool {
|
||||
switch utils.Unwrap(err) {
|
||||
case redis.Nil, gorm.ErrRecordNotFound:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user