mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-09 19:45:58 +08:00
Merge remote-tracking branch 'origin/errcode' into errcode
This commit is contained in:
@@ -36,7 +36,7 @@ func Start(server *grpc.Server) {
|
||||
pbGroup.RegisterGroupServer(server, &groupServer{
|
||||
GroupInterface: controller.NewGroupInterface(nil, cache.NewRedis().GetClient(), unrelation.NewMongo().GetClient()),
|
||||
registerCenter: nil,
|
||||
user: check.NewUserCheck(),
|
||||
user: check.NewUserCheck(nil),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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