mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 17:45:59 +08:00
errcode
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
pbChat "Open_IM/pkg/proto/msg"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
func (rpc *rpcChat) ClearMsg(_ context.Context, req *pbChat.ClearMsgReq) (*pbChat.ClearMsgResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc req: ", req.String())
|
||||
if req.OpUserID != req.UserID && !token_verify.IsManagerUserID(req.UserID) {
|
||||
if req.OpUserID != req.UserID && !tokenverify.IsManagerUserID(req.UserID) {
|
||||
errMsg := "No permission" + req.OpUserID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.ClearMsgResp{ErrCode: constant.ErrNoPermission.ErrCode, ErrMsg: errMsg}, nil
|
||||
@@ -39,7 +39,7 @@ func (rpc *rpcChat) ClearMsg(_ context.Context, req *pbChat.ClearMsgReq) (*pbCha
|
||||
|
||||
func (rpc *rpcChat) SetMsgMinSeq(_ context.Context, req *pbChat.SetMsgMinSeqReq) (*pbChat.SetMsgMinSeqResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc req: ", req.String())
|
||||
if req.OpUserID != req.UserID && !token_verify.IsManagerUserID(req.UserID) {
|
||||
if req.OpUserID != req.UserID && !tokenverify.IsManagerUserID(req.UserID) {
|
||||
errMsg := "No permission" + req.OpUserID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.SetMsgMinSeqResp{ErrCode: constant.ErrNoPermission.ErrCode, ErrMsg: errMsg}, nil
|
||||
|
||||
@@ -4,17 +4,17 @@ import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/proto/msg"
|
||||
commonPb "Open_IM/pkg/proto/sdk_ws"
|
||||
common "Open_IM/pkg/proto/sdk_ws"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (rpc *rpcChat) DelMsgList(_ context.Context, req *commonPb.DelMsgListReq) (*commonPb.DelMsgListResp, error) {
|
||||
func (rpc *rpcChat) DelMsgList(_ context.Context, req *common.DelMsgListReq) (*common.DelMsgListResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||
resp := &commonPb.DelMsgListResp{}
|
||||
resp := &common.DelMsgListResp{}
|
||||
select {
|
||||
case rpc.delMsgCh <- deleteMsg{
|
||||
UserID: req.UserID,
|
||||
@@ -32,7 +32,7 @@ func (rpc *rpcChat) DelMsgList(_ context.Context, req *commonPb.DelMsgListReq) (
|
||||
}
|
||||
func (rpc *rpcChat) DelSuperGroupMsg(ctx context.Context, req *msg.DelSuperGroupMsgReq) (*msg.DelSuperGroupMsgResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||
if !token_verify.CheckAccess(ctx, req.OpUserID, req.UserID) {
|
||||
if !tokenverify.CheckAccess(ctx, req.OpUserID, req.UserID) {
|
||||
log.NewError(req.OperationID, "CheckAccess false ", req.OpUserID, req.UserID)
|
||||
return &msg.DelSuperGroupMsgResp{ErrCode: constant.ErrNoPermission.ErrCode, ErrMsg: constant.ErrNoPermission.ErrMsg}, nil
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
utils2 "Open_IM/pkg/common/utils"
|
||||
pbGroup "Open_IM/pkg/proto/group"
|
||||
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
//} creator->group
|
||||
|
||||
func setOpUserInfo(opUserID, groupID string, groupMemberInfo *open_im_sdk.GroupMemberFullInfo) error {
|
||||
if token_verify.IsManagerUserID(opUserID) {
|
||||
if tokenverify.IsManagerUserID(opUserID) {
|
||||
u, err := imdb.GetUserByUserID(opUserID)
|
||||
if err != nil {
|
||||
return utils.Wrap(err, "GetUserByUserID failed")
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"Open_IM/pkg/common/db"
|
||||
rocksCache "Open_IM/pkg/common/db/rocks_cache"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/getcdv3"
|
||||
cacheRpc "Open_IM/pkg/proto/cache"
|
||||
pbConversation "Open_IM/pkg/proto/conversation"
|
||||
@@ -182,7 +182,7 @@ func (rpc *rpcChat) messageVerification(ctx context.Context, data *pbChat.SendMs
|
||||
log.NewError(data.OperationID, errMsg)
|
||||
return false, 201, errMsg, nil
|
||||
}
|
||||
if token_verify.IsManagerUserID(data.MsgData.SendID) {
|
||||
if tokenverify.IsManagerUserID(data.MsgData.SendID) {
|
||||
return true, 0, "", userIDList
|
||||
}
|
||||
if data.MsgData.ContentType <= constant.NotificationEnd && data.MsgData.ContentType >= constant.NotificationBegin {
|
||||
@@ -256,7 +256,7 @@ func (rpc *rpcChat) messageVerification(ctx context.Context, data *pbChat.SendMs
|
||||
log.NewError(data.OperationID, errMsg)
|
||||
return false, 201, errMsg, nil
|
||||
}
|
||||
if token_verify.IsManagerUserID(data.MsgData.SendID) {
|
||||
if tokenverify.IsManagerUserID(data.MsgData.SendID) {
|
||||
return true, 0, "", userIDList
|
||||
}
|
||||
if data.MsgData.ContentType <= constant.NotificationEnd && data.MsgData.ContentType >= constant.NotificationBegin {
|
||||
|
||||
Reference in New Issue
Block a user