mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
group add verify
This commit is contained in:
parent
8849cd46c9
commit
1650165f4b
@ -5,6 +5,7 @@ import (
|
|||||||
"Open_IM/pkg/common/constant"
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/db"
|
"Open_IM/pkg/common/db"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
|
"Open_IM/pkg/common/token_verify"
|
||||||
"Open_IM/pkg/grpc-etcdv3/getcdv3"
|
"Open_IM/pkg/grpc-etcdv3/getcdv3"
|
||||||
cacheRpc "Open_IM/pkg/proto/cache"
|
cacheRpc "Open_IM/pkg/proto/cache"
|
||||||
pbCache "Open_IM/pkg/proto/cache"
|
pbCache "Open_IM/pkg/proto/cache"
|
||||||
@ -297,14 +298,16 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
if len(addUidList) > 0 {
|
||||||
|
memberUserIDList = append(memberUserIDList, addUidList...)
|
||||||
|
}
|
||||||
|
if !token_verify.IsManagerUserID(pb.MsgData.SendID) {
|
||||||
|
if !utils.IsContain(pb.MsgData.SendID, memberUserIDList) {
|
||||||
|
return returnMsg(&replay, pb, 202, "you are not in group", "", 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
m := make(map[string][]string, 2)
|
m := make(map[string][]string, 2)
|
||||||
//if len(memberUserIDList) > GroupMemberNum {
|
|
||||||
// getOnlineAndOfflineUserIDList(memberUserIDList, m, pb.OperationID)
|
|
||||||
// log.Debug(pb.OperationID, m[constant.OnlineStatus], m[constant.OfflineStatus])
|
|
||||||
//} else {
|
|
||||||
m[constant.OnlineStatus] = memberUserIDList
|
m[constant.OnlineStatus] = memberUserIDList
|
||||||
//}
|
|
||||||
|
|
||||||
log.Debug(pb.OperationID, "send msg cost time1 ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID)
|
log.Debug(pb.OperationID, "send msg cost time1 ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID)
|
||||||
newTime = db.GetCurrentTimestampByMill()
|
newTime = db.GetCurrentTimestampByMill()
|
||||||
|
|
||||||
@ -329,9 +332,6 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S
|
|||||||
}
|
}
|
||||||
log.Debug(pb.OperationID, "send msg cost time22 ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID, "uidList : ", len(addUidList))
|
log.Debug(pb.OperationID, "send msg cost time22 ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID, "uidList : ", len(addUidList))
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go rpc.sendMsgToGroup(addUidList, *pb, constant.OnlineStatus, &sendTag, &wg)
|
|
||||||
wg.Wait()
|
|
||||||
log.Debug(pb.OperationID, "send msg cost time2 ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID)
|
|
||||||
newTime = db.GetCurrentTimestampByMill()
|
newTime = db.GetCurrentTimestampByMill()
|
||||||
// callback
|
// callback
|
||||||
callbackResp = callbackAfterSendGroupMsg(pb)
|
callbackResp = callbackAfterSendGroupMsg(pb)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user