Error code standardization
This commit is contained in:
+5
-4
@@ -1,6 +1,7 @@
|
||||
package msg
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
@@ -25,7 +26,7 @@ func SetConversationNotification(operationID, sendID, recvID string, contentType
|
||||
EmitDefaults: false,
|
||||
}
|
||||
tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
||||
var n NotificationMsg
|
||||
var n msg.NotificationMsg
|
||||
n.SendID = sendID
|
||||
n.RecvID = recvID
|
||||
n.ContentType = int32(contentType)
|
||||
@@ -37,7 +38,7 @@ func SetConversationNotification(operationID, sendID, recvID string, contentType
|
||||
log.Error(operationID, utils.GetSelfFuncName(), "Marshal failed ", err.Error(), tips.String())
|
||||
return
|
||||
}
|
||||
Notification(&n)
|
||||
msg.Notification(&n)
|
||||
}
|
||||
|
||||
// SetPrivate调用
|
||||
@@ -70,7 +71,7 @@ func ConversationChangeNotification(ctx context.Context, userID string) {
|
||||
SetConversationNotification(operationID, userID, userID, constant.ConversationOptChangeNotification, ConversationChangedTips, tips)
|
||||
}
|
||||
|
||||
//会话未读数同步
|
||||
// 会话未读数同步
|
||||
func ConversationUnreadChangeNotification(operationID, userID, conversationID string, updateUnreadCountTime int64) {
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName())
|
||||
ConversationChangedTips := &open_im_sdk.ConversationUpdateTips{
|
||||
+1
-3
@@ -1,11 +1,9 @@
|
||||
package msg
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/api_struct"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/getcdv3"
|
||||
"Open_IM/pkg/proto/msg"
|
||||
open_im_sdk "Open_IM/pkg/proto/sdkws"
|
||||
"Open_IM/pkg/utils"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package msg
|
||||
package notification
|
||||
|
||||
import (
|
||||
cbApi "Open_IM/pkg/callback_struct"
|
||||
+4
-3
@@ -1,7 +1,8 @@
|
||||
package msg
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/check"
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
@@ -76,7 +77,7 @@ func friendNotification(operationID, fromUserID, toUserID string, contentType in
|
||||
return
|
||||
}
|
||||
|
||||
var n NotificationMsg
|
||||
var n msg.NotificationMsg
|
||||
n.SendID = fromUserID
|
||||
n.RecvID = toUserID
|
||||
n.ContentType = contentType
|
||||
@@ -88,7 +89,7 @@ func friendNotification(operationID, fromUserID, toUserID string, contentType in
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), tips.String())
|
||||
return
|
||||
}
|
||||
Notification(&n)
|
||||
msg.Notification(&n)
|
||||
}
|
||||
|
||||
func FriendApplicationAddNotification(ctx context.Context, req *pbFriend.AddFriendReq) {
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
package msg
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
@@ -181,7 +182,7 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv
|
||||
return
|
||||
}
|
||||
|
||||
var n NotificationMsg
|
||||
var n msg.NotificationMsg
|
||||
n.SendID = sendID
|
||||
if groupID != "" {
|
||||
n.RecvID = groupID
|
||||
@@ -206,7 +207,7 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), tips.String())
|
||||
return
|
||||
}
|
||||
Notification(&n)
|
||||
msg.Notification(&n)
|
||||
}
|
||||
|
||||
// 创建群后调用
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
package msg
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
open_im_sdk "Open_IM/pkg/proto/sdkws"
|
||||
@@ -31,7 +32,7 @@ func MessageNotification(operationID, sendID, recvID string, contentType int32,
|
||||
}
|
||||
|
||||
tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
||||
var n NotificationMsg
|
||||
var n msg.NotificationMsg
|
||||
n.SendID = sendID
|
||||
n.RecvID = recvID
|
||||
n.ContentType = contentType
|
||||
@@ -43,5 +44,5 @@ func MessageNotification(operationID, sendID, recvID string, contentType int32,
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), tips.String())
|
||||
return
|
||||
}
|
||||
Notification(&n)
|
||||
msg.Notification(&n)
|
||||
}
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
package msg
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
//sdk "Open_IM/pkg/proto/sdkws"
|
||||
@@ -10,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
func SuperGroupNotification(operationID, sendID, recvID string) {
|
||||
n := &NotificationMsg{
|
||||
n := &msg.NotificationMsg{
|
||||
SendID: sendID,
|
||||
RecvID: recvID,
|
||||
MsgFrom: constant.SysMsgType,
|
||||
@@ -19,5 +20,5 @@ func SuperGroupNotification(operationID, sendID, recvID string) {
|
||||
OperationID: operationID,
|
||||
}
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName(), string(n.Content))
|
||||
Notification(n)
|
||||
msg.Notification(n)
|
||||
}
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
package msg
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
pbOffice "Open_IM/pkg/proto/office"
|
||||
@@ -24,7 +25,7 @@ func WorkMomentNotification(operationID, sendID, recvID string, m proto.Message)
|
||||
EmitDefaults: false,
|
||||
}
|
||||
tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
||||
n := &NotificationMsg{
|
||||
n := &msg.NotificationMsg{
|
||||
SendID: sendID,
|
||||
RecvID: recvID,
|
||||
MsgFrom: constant.UserMsgType,
|
||||
@@ -38,5 +39,5 @@ func WorkMomentNotification(operationID, sendID, recvID string, m proto.Message)
|
||||
return
|
||||
}
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName(), string(n.Content))
|
||||
Notification(n)
|
||||
msg.Notification(n)
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package auth
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/check"
|
||||
"Open_IM/internal/common/rpc_server"
|
||||
"Open_IM/internal/common/rpcserver"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db/cache"
|
||||
|
||||
@@ -2,18 +2,15 @@ package conversation
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/check"
|
||||
chat "Open_IM/internal/rpc/msg"
|
||||
chat "Open_IM/internal/common/notification"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db/cache"
|
||||
"Open_IM/pkg/common/db/controller"
|
||||
"Open_IM/pkg/common/db/relation"
|
||||
"Open_IM/pkg/common/db/table"
|
||||
"Open_IM/pkg/common/db/unrelation"
|
||||
"Open_IM/pkg/common/log"
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
"Open_IM/pkg/getcdv3"
|
||||
pbConversation "Open_IM/pkg/proto/conversation"
|
||||
pbUser "Open_IM/pkg/proto/user"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"github.com/dtm-labs/rockscache"
|
||||
|
||||
@@ -3,7 +3,7 @@ package friend
|
||||
import (
|
||||
"Open_IM/internal/common/check"
|
||||
"Open_IM/internal/common/convert"
|
||||
chat "Open_IM/internal/rpc/msg"
|
||||
chat "Open_IM/internal/common/notification"
|
||||
"Open_IM/pkg/common/db/table/relation"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package friend
|
||||
|
||||
import (
|
||||
cbApi "Open_IM/pkg/callback_struct"
|
||||
cbapi "Open_IM/pkg/callbackstruct"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/http"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
pbFriend "Open_IM/pkg/proto/friend"
|
||||
pbfriend "Open_IM/pkg/proto/friend"
|
||||
"context"
|
||||
|
||||
//"Open_IM/pkg/proto/msg"
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
http2 "net/http"
|
||||
)
|
||||
|
||||
func callbackBeforeAddFriendV1(ctx context.Context, req *pbFriend.AddFriendReq) error {
|
||||
func callbackBeforeAddFriendV1(ctx context.Context, req *pbfriend.ApplyToAddFriendReq) error {
|
||||
resp := callbackBeforeAddFriend(ctx, req)
|
||||
if resp.ErrCode != 0 {
|
||||
return (&constant.ErrInfo{
|
||||
@@ -26,20 +26,20 @@ func callbackBeforeAddFriendV1(ctx context.Context, req *pbFriend.AddFriendReq)
|
||||
return nil
|
||||
}
|
||||
|
||||
func callbackBeforeAddFriend(ctx context.Context, req *pbFriend.AddFriendReq) cbApi.CommonCallbackResp {
|
||||
callbackResp := cbApi.CommonCallbackResp{OperationID: tracelog.GetOperationID(ctx)}
|
||||
func callbackBeforeAddFriend(ctx context.Context, req *pbfriend.ApplyToAddFriendReq) cbapi.CommonCallbackResp {
|
||||
callbackResp := cbapi.CommonCallbackResp{OperationID: tracelog.GetOperationID(ctx)}
|
||||
if !config.Config.Callback.CallbackBeforeAddFriend.Enable {
|
||||
return callbackResp
|
||||
}
|
||||
|
||||
commonCallbackReq := &cbApi.CallbackBeforeAddFriendReq{
|
||||
commonCallbackReq := &cbapi.CallbackBeforeAddFriendReq{
|
||||
CallbackCommand: constant.CallbackBeforeAddFriendCommand,
|
||||
FromUserID: req.FromUserID,
|
||||
ToUserID: req.ToUserID,
|
||||
ReqMsg: req.ReqMsg,
|
||||
OperationID: tracelog.GetOperationID(ctx),
|
||||
}
|
||||
resp := &cbApi.CallbackBeforeAddFriendResp{
|
||||
resp := &cbapi.CallbackBeforeAddFriendResp{
|
||||
CommonCallbackResp: &callbackResp,
|
||||
}
|
||||
//utils.CopyStructFields(req, msg.MsgData)
|
||||
|
||||
@@ -3,8 +3,8 @@ package friend
|
||||
import (
|
||||
"Open_IM/internal/common/check"
|
||||
"Open_IM/internal/common/convert"
|
||||
"Open_IM/internal/common/rpc_server"
|
||||
chat "Open_IM/internal/rpc/msg"
|
||||
chat "Open_IM/internal/common/notification"
|
||||
"Open_IM/internal/common/rpcserver"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db/controller"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package group
|
||||
|
||||
import (
|
||||
cbApi "Open_IM/pkg/callback_struct"
|
||||
cbApi "Open_IM/pkg/callbackstruct"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db/table/relation"
|
||||
|
||||
+23
-23
@@ -2,7 +2,7 @@ package group
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/network"
|
||||
chat "Open_IM/internal/rpc/msg"
|
||||
"Open_IM/internal/common/notification"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db/cache"
|
||||
@@ -198,11 +198,11 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
|
||||
if req.GroupInfo.GroupType == constant.SuperGroup {
|
||||
go func() {
|
||||
for _, userID := range userIDs {
|
||||
chat.SuperGroupNotification(tracelog.GetOperationID(ctx), userID, userID)
|
||||
notification.SuperGroupNotification(tracelog.GetOperationID(ctx), userID, userID)
|
||||
}
|
||||
}()
|
||||
} else {
|
||||
chat.GroupCreatedNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), group.GroupID, userIDs)
|
||||
notification.GroupCreatedNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), group.GroupID, userIDs)
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
@@ -299,7 +299,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
return nil, err
|
||||
}
|
||||
for _, request := range requests {
|
||||
chat.JoinGroupApplicationNotification(ctx, &pbGroup.JoinGroupReq{
|
||||
notification.JoinGroupApplicationNotification(ctx, &pbGroup.JoinGroupReq{
|
||||
GroupID: request.GroupID,
|
||||
ReqMessage: request.ReqMsg,
|
||||
JoinSource: request.JoinSource,
|
||||
@@ -315,7 +315,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
return nil, err
|
||||
}
|
||||
for _, userID := range req.InvitedUserIDs {
|
||||
chat.SuperGroupNotification(tracelog.GetOperationID(ctx), userID, userID)
|
||||
notification.SuperGroupNotification(tracelog.GetOperationID(ctx), userID, userID)
|
||||
}
|
||||
} else {
|
||||
opUserID := tracelog.GetOpUserID(ctx)
|
||||
@@ -336,7 +336,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
if err := s.GroupInterface.CreateGroup(ctx, nil, groupMembers); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.MemberInvitedNotification(tracelog.GetOperationID(ctx), req.GroupID, tracelog.GetOpUserID(ctx), req.Reason, req.InvitedUserIDs)
|
||||
notification.MemberInvitedNotification(tracelog.GetOperationID(ctx), req.GroupID, tracelog.GetOpUserID(ctx), req.Reason, req.InvitedUserIDs)
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
@@ -413,7 +413,7 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
|
||||
}
|
||||
go func() {
|
||||
for _, userID := range req.KickedUserIDs {
|
||||
chat.SuperGroupNotification(tracelog.GetOperationID(ctx), userID, userID)
|
||||
notification.SuperGroupNotification(tracelog.GetOperationID(ctx), userID, userID)
|
||||
}
|
||||
}()
|
||||
} else {
|
||||
@@ -453,7 +453,7 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
|
||||
if err := s.GroupInterface.DeleteGroupMember(ctx, group.GroupID, req.KickedUserIDs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.MemberKickedNotification(req, req.KickedUserIDs)
|
||||
notification.MemberKickedNotification(req, req.KickedUserIDs)
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
@@ -623,10 +623,10 @@ func (s *groupServer) GroupApplicationResponse(ctx context.Context, req *pbGroup
|
||||
return nil, err
|
||||
}
|
||||
if req.HandleResult == constant.GroupResponseAgree {
|
||||
chat.GroupApplicationAcceptedNotification(req)
|
||||
chat.MemberEnterNotification(req)
|
||||
notification.GroupApplicationAcceptedNotification(req)
|
||||
notification.MemberEnterNotification(req)
|
||||
} else if req.HandleResult == constant.GroupResponseRefuse {
|
||||
chat.GroupApplicationRejectedNotification(req)
|
||||
notification.GroupApplicationRejectedNotification(req)
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
@@ -663,7 +663,7 @@ func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq)
|
||||
if err := s.GroupInterface.CreateGroup(ctx, nil, []*relationTb.GroupMemberModel{groupMember}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.MemberEnterDirectlyNotification(req.GroupID, tracelog.GetOpUserID(ctx), tracelog.GetOperationID(ctx))
|
||||
notification.MemberEnterDirectlyNotification(req.GroupID, tracelog.GetOpUserID(ctx), tracelog.GetOperationID(ctx))
|
||||
return resp, nil
|
||||
}
|
||||
groupRequest := relationTb.GroupRequestModel{
|
||||
@@ -676,7 +676,7 @@ func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq)
|
||||
if err := s.GroupInterface.CreateGroupRequest(ctx, []*relationTb.GroupRequestModel{&groupRequest}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.JoinGroupApplicationNotification(ctx, req)
|
||||
notification.JoinGroupApplicationNotification(ctx, req)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -690,13 +690,13 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq)
|
||||
if err := s.GroupInterface.DeleteSuperGroupMember(ctx, req.GroupID, []string{tracelog.GetOpUserID(ctx)}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.SuperGroupNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), tracelog.GetOpUserID(ctx))
|
||||
notification.SuperGroupNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), tracelog.GetOpUserID(ctx))
|
||||
} else {
|
||||
_, err := s.GroupInterface.TakeGroupMember(ctx, req.GroupID, tracelog.GetOpUserID(ctx))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.MemberQuitNotification(req)
|
||||
notification.MemberQuitNotification(req)
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
@@ -730,7 +730,7 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.GroupInfoSetNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), req.GroupInfoForSet.GroupID, group.GroupName, group.Notification, group.Introduction, group.FaceURL, req.GroupInfoForSet.NeedVerification)
|
||||
notification.GroupInfoSetNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), req.GroupInfoForSet.GroupID, group.GroupName, group.Notification, group.Introduction, group.FaceURL, req.GroupInfoForSet.NeedVerification)
|
||||
if req.GroupInfoForSet.Notification != "" {
|
||||
GroupNotification(ctx, group.GroupID)
|
||||
}
|
||||
@@ -780,7 +780,7 @@ func (s *groupServer) TransferGroupOwner(ctx context.Context, req *pbGroup.Trans
|
||||
if err := s.GroupInterface.TransferGroupOwner(ctx, req.GroupID, req.OldOwnerUserID, req.NewOwnerUserID, newOwner.RoleLevel); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.GroupOwnerTransferredNotification(req)
|
||||
notification.GroupOwnerTransferredNotification(req)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -912,7 +912,7 @@ func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGrou
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
chat.GroupDismissedNotification(req)
|
||||
notification.GroupDismissedNotification(req)
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
@@ -936,7 +936,7 @@ func (s *groupServer) MuteGroupMember(ctx context.Context, req *pbGroup.MuteGrou
|
||||
if err := s.GroupInterface.UpdateGroupMember(ctx, member.GroupID, member.UserID, data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.GroupMemberMutedNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), req.GroupID, req.UserID, req.MutedSeconds)
|
||||
notification.GroupMemberMutedNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), req.GroupID, req.UserID, req.MutedSeconds)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -959,7 +959,7 @@ func (s *groupServer) CancelMuteGroupMember(ctx context.Context, req *pbGroup.Ca
|
||||
if err := s.GroupInterface.UpdateGroupMember(ctx, member.GroupID, member.UserID, data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.GroupMemberCancelMutedNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), req.GroupID, req.UserID)
|
||||
notification.GroupMemberCancelMutedNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), req.GroupID, req.UserID)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -971,7 +971,7 @@ func (s *groupServer) MuteGroup(ctx context.Context, req *pbGroup.MuteGroupReq)
|
||||
if err := s.GroupInterface.UpdateGroup(ctx, req.GroupID, UpdateGroupStatusMap(constant.GroupStatusMuted)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.GroupMutedNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), req.GroupID)
|
||||
notification.GroupMutedNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), req.GroupID)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -983,7 +983,7 @@ func (s *groupServer) CancelMuteGroup(ctx context.Context, req *pbGroup.CancelMu
|
||||
if err := s.GroupInterface.UpdateGroup(ctx, req.GroupID, UpdateGroupStatusMap(constant.GroupOk)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.GroupCancelMutedNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), req.GroupID)
|
||||
notification.GroupCancelMutedNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), req.GroupID)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -1060,7 +1060,7 @@ func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbGroup.SetGr
|
||||
return nil, err
|
||||
}
|
||||
for _, member := range req.Members {
|
||||
chat.GroupMemberInfoSetNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), member.GroupID, member.UserID)
|
||||
notification.GroupMemberInfoSetNotification(tracelog.GetOperationID(ctx), tracelog.GetOpUserID(ctx), member.GroupID, member.UserID)
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package msg
|
||||
|
||||
import (
|
||||
cbApi "Open_IM/pkg/callback_struct"
|
||||
"Open_IM/pkg/common/callback"
|
||||
cbapi "Open_IM/pkg/callbackstruct"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/http"
|
||||
@@ -12,8 +11,8 @@ import (
|
||||
http2 "net/http"
|
||||
)
|
||||
|
||||
func copyCallbackCommonReqStruct(msg *pbChat.SendMsgReq) cbApi.CommonCallbackReq {
|
||||
req := cbApi.CommonCallbackReq{
|
||||
func copyCallbackCommonReqStruct(msg *pbChat.SendMsgReq) cbapi.CommonCallbackReq {
|
||||
req := cbapi.CommonCallbackReq{
|
||||
SendID: msg.MsgData.SendID,
|
||||
ServerMsgID: msg.MsgData.ServerMsgID,
|
||||
ClientMsgID: msg.MsgData.ClientMsgID,
|
||||
@@ -27,35 +26,35 @@ func copyCallbackCommonReqStruct(msg *pbChat.SendMsgReq) cbApi.CommonCallbackReq
|
||||
CreateTime: msg.MsgData.CreateTime,
|
||||
AtUserIDList: msg.MsgData.AtUserIDList,
|
||||
SenderFaceURL: msg.MsgData.SenderFaceURL,
|
||||
Content: callback.GetContent(msg.MsgData),
|
||||
Content: utils.GetContent(msg.MsgData),
|
||||
Seq: msg.MsgData.Seq,
|
||||
Ex: msg.MsgData.Ex,
|
||||
}
|
||||
return req
|
||||
}
|
||||
|
||||
func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp {
|
||||
callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID}
|
||||
func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) cbapi.CommonCallbackResp {
|
||||
callbackResp := cbapi.CommonCallbackResp{OperationID: msg.OperationID}
|
||||
if !config.Config.Callback.CallbackBeforeSendSingleMsg.Enable {
|
||||
return callbackResp
|
||||
}
|
||||
log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg)
|
||||
commonCallbackReq := copyCallbackCommonReqStruct(msg)
|
||||
commonCallbackReq.CallbackCommand = constant.CallbackBeforeSendSingleMsgCommand
|
||||
req := cbApi.CallbackBeforeSendSingleMsgReq{
|
||||
req := cbapi.CallbackBeforeSendSingleMsgReq{
|
||||
CommonCallbackReq: commonCallbackReq,
|
||||
RecvID: msg.MsgData.RecvID,
|
||||
}
|
||||
resp := &cbApi.CallbackBeforeSendSingleMsgResp{
|
||||
resp := &cbapi.CallbackBeforeSendSingleMsgResp{
|
||||
CommonCallbackResp: &callbackResp,
|
||||
}
|
||||
//utils.CopyStructFields(req, msg.MsgData)
|
||||
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackBeforeSendSingleMsgCommand,
|
||||
req, resp, config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackTimeOut, &config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackFailedContinue); err != nil {
|
||||
req, resp, config.Config.Callback.CallbackBeforeSendSingleMsg); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
if !config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackFailedContinue {
|
||||
if !*config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackFailedContinue {
|
||||
callbackResp.ActionCode = constant.ActionForbidden
|
||||
return callbackResp
|
||||
} else {
|
||||
@@ -66,22 +65,22 @@ func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackRes
|
||||
return callbackResp
|
||||
}
|
||||
|
||||
func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp {
|
||||
callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID}
|
||||
func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) cbapi.CommonCallbackResp {
|
||||
callbackResp := cbapi.CommonCallbackResp{OperationID: msg.OperationID}
|
||||
if !config.Config.Callback.CallbackAfterSendSingleMsg.Enable {
|
||||
return callbackResp
|
||||
}
|
||||
log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg)
|
||||
commonCallbackReq := copyCallbackCommonReqStruct(msg)
|
||||
commonCallbackReq.CallbackCommand = constant.CallbackAfterSendSingleMsgCommand
|
||||
req := cbApi.CallbackAfterSendSingleMsgReq{
|
||||
req := cbapi.CallbackAfterSendSingleMsgReq{
|
||||
CommonCallbackReq: commonCallbackReq,
|
||||
RecvID: msg.MsgData.RecvID,
|
||||
}
|
||||
resp := &cbApi.CallbackAfterSendSingleMsgResp{CommonCallbackResp: &callbackResp}
|
||||
resp := &cbapi.CallbackAfterSendSingleMsgResp{CommonCallbackResp: &callbackResp}
|
||||
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackAfterSendSingleMsgCommand,
|
||||
req, resp, config.Config.Callback.CallbackAfterSendSingleMsg.CallbackTimeOut, &config.Config.Callback.CallbackAfterSendSingleMsg.CallbackFailedContinue); err != nil {
|
||||
req, resp, config.Config.Callback.CallbackAfterSendSingleMsg); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
return callbackResp
|
||||
@@ -89,25 +88,25 @@ func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp
|
||||
return callbackResp
|
||||
}
|
||||
|
||||
func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp {
|
||||
callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID}
|
||||
func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) cbapi.CommonCallbackResp {
|
||||
callbackResp := cbapi.CommonCallbackResp{OperationID: msg.OperationID}
|
||||
if !config.Config.Callback.CallbackBeforeSendGroupMsg.Enable {
|
||||
return callbackResp
|
||||
}
|
||||
log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg)
|
||||
commonCallbackReq := copyCallbackCommonReqStruct(msg)
|
||||
commonCallbackReq.CallbackCommand = constant.CallbackBeforeSendGroupMsgCommand
|
||||
req := cbApi.CallbackAfterSendGroupMsgReq{
|
||||
req := cbapi.CallbackAfterSendGroupMsgReq{
|
||||
CommonCallbackReq: commonCallbackReq,
|
||||
GroupID: msg.MsgData.GroupID,
|
||||
}
|
||||
resp := &cbApi.CallbackBeforeSendGroupMsgResp{CommonCallbackResp: &callbackResp}
|
||||
resp := &cbapi.CallbackBeforeSendGroupMsgResp{CommonCallbackResp: &callbackResp}
|
||||
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackBeforeSendGroupMsgCommand,
|
||||
req, resp, config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackTimeOut, &config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackFailedContinue); err != nil {
|
||||
req, resp, config.Config.Callback.CallbackBeforeSendGroupMsg); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
if !config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackFailedContinue {
|
||||
if !*config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackFailedContinue {
|
||||
callbackResp.ActionCode = constant.ActionForbidden
|
||||
return callbackResp
|
||||
} else {
|
||||
@@ -118,22 +117,22 @@ func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp
|
||||
return callbackResp
|
||||
}
|
||||
|
||||
func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp {
|
||||
callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID}
|
||||
func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) cbapi.CommonCallbackResp {
|
||||
callbackResp := cbapi.CommonCallbackResp{OperationID: msg.OperationID}
|
||||
if !config.Config.Callback.CallbackAfterSendGroupMsg.Enable {
|
||||
return callbackResp
|
||||
}
|
||||
log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg)
|
||||
commonCallbackReq := copyCallbackCommonReqStruct(msg)
|
||||
commonCallbackReq.CallbackCommand = constant.CallbackAfterSendGroupMsgCommand
|
||||
req := cbApi.CallbackAfterSendGroupMsgReq{
|
||||
req := cbapi.CallbackAfterSendGroupMsgReq{
|
||||
CommonCallbackReq: commonCallbackReq,
|
||||
GroupID: msg.MsgData.GroupID,
|
||||
}
|
||||
resp := &cbApi.CallbackAfterSendGroupMsgResp{CommonCallbackResp: &callbackResp}
|
||||
resp := &cbapi.CallbackAfterSendGroupMsgResp{CommonCallbackResp: &callbackResp}
|
||||
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackAfterSendGroupMsgCommand, req, resp,
|
||||
config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut, nil); err != nil {
|
||||
config.Config.Callback.CallbackAfterSendGroupMsg); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
return callbackResp
|
||||
@@ -141,24 +140,24 @@ func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp
|
||||
return callbackResp
|
||||
}
|
||||
|
||||
func callbackMsgModify(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp {
|
||||
func callbackMsgModify(msg *pbChat.SendMsgReq) cbapi.CommonCallbackResp {
|
||||
log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg)
|
||||
callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID}
|
||||
callbackResp := cbapi.CommonCallbackResp{OperationID: msg.OperationID}
|
||||
if !config.Config.Callback.CallbackMsgModify.Enable || msg.MsgData.ContentType != constant.Text {
|
||||
return callbackResp
|
||||
}
|
||||
commonCallbackReq := copyCallbackCommonReqStruct(msg)
|
||||
commonCallbackReq.CallbackCommand = constant.CallbackMsgModifyCommand
|
||||
req := cbApi.CallbackMsgModifyCommandReq{
|
||||
req := cbapi.CallbackMsgModifyCommandReq{
|
||||
CommonCallbackReq: commonCallbackReq,
|
||||
}
|
||||
resp := &cbApi.CallbackMsgModifyCommandResp{CommonCallbackResp: &callbackResp}
|
||||
resp := &cbapi.CallbackMsgModifyCommandResp{CommonCallbackResp: &callbackResp}
|
||||
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackMsgModifyCommand, req, resp,
|
||||
config.Config.Callback.CallbackMsgModify.CallbackTimeOut, &config.Config.Callback.CallbackMsgModify.CallbackFailedContinue); err != nil {
|
||||
config.Config.Callback.CallbackMsgModify); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
if !config.Config.Callback.CallbackMsgModify.CallbackFailedContinue {
|
||||
if !*config.Config.Callback.CallbackMsgModify.CallbackFailedContinue {
|
||||
callbackResp.ActionCode = constant.ActionForbidden
|
||||
return callbackResp
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package msg
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/notification"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/log"
|
||||
@@ -18,7 +19,7 @@ func (rpc *rpcChat) SetMessageReactionExtensions(ctx context.Context, req *msg.S
|
||||
var rResp msg.SetMessageReactionExtensionsResp
|
||||
rResp.ClientMsgID = req.ClientMsgID
|
||||
rResp.MsgFirstModifyTime = req.MsgFirstModifyTime
|
||||
callbackResp := callbackSetMessageReactionExtensions(req)
|
||||
callbackResp := notification.callbackSetMessageReactionExtensions(req)
|
||||
if callbackResp.ActionCode != constant.ActionAllow || callbackResp.ErrCode != 0 {
|
||||
rResp.ErrCode = int32(callbackResp.ErrCode)
|
||||
rResp.ErrMsg = callbackResp.ErrMsg
|
||||
@@ -41,7 +42,7 @@ func (rpc *rpcChat) SetMessageReactionExtensions(ctx context.Context, req *msg.S
|
||||
}
|
||||
rResp.MsgFirstModifyTime = callbackResp.MsgFirstModifyTime
|
||||
rResp.Result = callbackResp.ResultReactionExtensionList
|
||||
ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, isHistory, false)
|
||||
notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, isHistory, false)
|
||||
return &rResp, nil
|
||||
}
|
||||
for _, v := range callbackResp.ResultReactionExtensionList {
|
||||
@@ -187,12 +188,12 @@ func (rpc *rpcChat) SetMessageReactionExtensions(ctx context.Context, req *msg.S
|
||||
}
|
||||
if !isExists {
|
||||
if !req.IsReact {
|
||||
ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, true, true)
|
||||
notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, true, true)
|
||||
} else {
|
||||
ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, false)
|
||||
notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, false)
|
||||
}
|
||||
} else {
|
||||
ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, true)
|
||||
notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, true)
|
||||
}
|
||||
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc return is:", rResp.String())
|
||||
return &rResp, nil
|
||||
@@ -278,7 +279,7 @@ func (rpc *rpcChat) AddMessageReactionExtensions(ctx context.Context, req *msg.M
|
||||
func (rpc *rpcChat) DeleteMessageReactionExtensions(ctx context.Context, req *msg.DeleteMessageListReactionExtensionsReq) (resp *msg.DeleteMessageListReactionExtensionsResp, err error) {
|
||||
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc args is:", req.String())
|
||||
var rResp msg.DeleteMessageListReactionExtensionsResp
|
||||
callbackResp := callbackDeleteMessageReactionExtensions(req)
|
||||
callbackResp := notification.callbackDeleteMessageReactionExtensions(req)
|
||||
if callbackResp.ActionCode != constant.ActionAllow || callbackResp.ErrCode != 0 {
|
||||
rResp.ErrCode = int32(callbackResp.ErrCode)
|
||||
rResp.ErrMsg = callbackResp.ErrMsg
|
||||
@@ -294,7 +295,7 @@ func (rpc *rpcChat) DeleteMessageReactionExtensions(ctx context.Context, req *ms
|
||||
//if ExternalExtension
|
||||
if req.IsExternalExtensions {
|
||||
rResp.Result = callbackResp.ResultReactionExtensionList
|
||||
ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, false)
|
||||
notification.ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, false)
|
||||
return &rResp, nil
|
||||
|
||||
}
|
||||
@@ -418,7 +419,7 @@ func (rpc *rpcChat) DeleteMessageReactionExtensions(ctx context.Context, req *ms
|
||||
}
|
||||
|
||||
}
|
||||
ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, isExists)
|
||||
notification.ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, isExists)
|
||||
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc return is:", rResp.String())
|
||||
return &rResp, nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package msg
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/notification"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
@@ -152,7 +153,7 @@ func (rpc *rpcChat) runCh() {
|
||||
continue
|
||||
}
|
||||
if len(unexistSeqList) > 0 {
|
||||
DeleteMessageNotification(msg.OpUserID, msg.UserID, unexistSeqList, msg.OperationID)
|
||||
notification.DeleteMessageNotification(msg.OpUserID, msg.UserID, unexistSeqList, msg.OperationID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package office
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/notification"
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/db/mongo"
|
||||
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
rocksCache "Open_IM/pkg/common/db/rocks_cache"
|
||||
@@ -437,7 +437,7 @@ func (s *officeServer) CreateOneWorkMoment(_ context.Context, req *pbOffice.Crea
|
||||
UserName: createUser.Nickname,
|
||||
CreateTime: workMoment.CreateTime,
|
||||
}
|
||||
msg.WorkMomentSendNotification(req.OperationID, atUser.UserID, workMomentNotificationMsg)
|
||||
notification.WorkMomentSendNotification(req.OperationID, atUser.UserID, workMomentNotificationMsg)
|
||||
}
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||
return resp, nil
|
||||
@@ -546,7 +546,7 @@ func (s *officeServer) LikeOneWorkMoment(_ context.Context, req *pbOffice.LikeOn
|
||||
}
|
||||
// send notification
|
||||
if like && workMoment.UserID != req.UserID {
|
||||
msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg)
|
||||
notification.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg)
|
||||
}
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||
return resp, nil
|
||||
@@ -599,10 +599,10 @@ func (s *officeServer) CommentOneWorkMoment(_ context.Context, req *pbOffice.Com
|
||||
}
|
||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "msg: ", *workMomentNotificationMsg)
|
||||
if req.UserID != workMoment.UserID {
|
||||
msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg)
|
||||
notification.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg)
|
||||
}
|
||||
if req.ReplyUserID != "" && req.ReplyUserID != workMoment.UserID && req.ReplyUserID != req.UserID {
|
||||
msg.WorkMomentSendNotification(req.OperationID, req.ReplyUserID, workMomentNotificationMsg)
|
||||
notification.WorkMomentSendNotification(req.OperationID, req.ReplyUserID, workMomentNotificationMsg)
|
||||
}
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||
return resp, nil
|
||||
|
||||
@@ -2,8 +2,8 @@ package user
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/convert"
|
||||
"Open_IM/internal/common/rpc_server"
|
||||
chat "Open_IM/internal/rpc/msg"
|
||||
chat "Open_IM/internal/common/notification"
|
||||
"Open_IM/internal/common/rpcserver"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db/controller"
|
||||
|
||||
Reference in New Issue
Block a user