mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 05:02:11 +08:00
chore: msg
This commit is contained in:
parent
542dfd6759
commit
3257e38649
@ -197,6 +197,10 @@ func (m *msgServer) sendMsgSingleChat(ctx context.Context, req *pbmsg.SendMsgReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgServer) SendSimpleMsg(ctx context.Context, req *pbmsg.SendSimpleMsgReq) (*pbmsg.SendSimpleMsgResp, error) {
|
func (m *msgServer) SendSimpleMsg(ctx context.Context, req *pbmsg.SendSimpleMsgReq) (*pbmsg.SendSimpleMsgResp, error) {
|
||||||
|
user, err := m.UserLocalCache.GetUserInfo(ctx, req.SendID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
msgData := &sdkws.MsgData{
|
msgData := &sdkws.MsgData{
|
||||||
SendID: req.SendID,
|
SendID: req.SendID,
|
||||||
RecvID: req.RecvID,
|
RecvID: req.RecvID,
|
||||||
@ -204,11 +208,11 @@ func (m *msgServer) SendSimpleMsg(ctx context.Context, req *pbmsg.SendSimpleMsgR
|
|||||||
ClientMsgID: GetMsgID(req.SendID),
|
ClientMsgID: GetMsgID(req.SendID),
|
||||||
ServerMsgID: GetMsgID(req.SendID),
|
ServerMsgID: GetMsgID(req.SendID),
|
||||||
SenderPlatformID: constant.AdminPlatformID,
|
SenderPlatformID: constant.AdminPlatformID,
|
||||||
SenderNickname: "",
|
SenderNickname: user.Nickname,
|
||||||
SenderFaceURL: "",
|
SenderFaceURL: user.FaceURL,
|
||||||
SessionType: 0,
|
SessionType: datautil.If[int32](req.RecvID == "", constant.ReadGroupChatType, constant.SingleChatType),
|
||||||
MsgFrom: 0,
|
MsgFrom: constant.UserMsgType,
|
||||||
ContentType: 0,
|
ContentType: constant.Text,
|
||||||
Content: req.Content,
|
Content: req.Content,
|
||||||
Seq: 0,
|
Seq: 0,
|
||||||
SendTime: 0,
|
SendTime: 0,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user