mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 09:05:59 +08:00
Merge remote-tracking branch 'origin/errcode' into errcode
This commit is contained in:
@@ -4,14 +4,14 @@ import (
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
open_im_sdk "Open_IM/pkg/proto/sdkws"
|
||||
sdkws "Open_IM/pkg/proto/sdkws"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
func SetConversationNotification(operationID, sendID, recvID string, contentType int, m proto.Message, tips open_im_sdk.TipsComm) {
|
||||
func SetConversationNotification(operationID, sendID, recvID string, contentType int, m proto.Message, tips sdkws.TipsComm) {
|
||||
log.NewInfo(operationID, "args: ", sendID, recvID, contentType, m.String(), tips.String())
|
||||
var err error
|
||||
tips.Detail, err = proto.Marshal(m)
|
||||
@@ -43,12 +43,12 @@ func SetConversationNotification(operationID, sendID, recvID string, contentType
|
||||
// SetPrivate调用
|
||||
func ConversationSetPrivateNotification(ctx context.Context, sendID, recvID string, isPrivateChat bool) {
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName())
|
||||
conversationSetPrivateTips := &open_im_sdk.ConversationSetPrivateTips{
|
||||
conversationSetPrivateTips := &sdkws.ConversationSetPrivateTips{
|
||||
RecvID: recvID,
|
||||
SendID: sendID,
|
||||
IsPrivate: isPrivateChat,
|
||||
}
|
||||
var tips open_im_sdk.TipsComm
|
||||
var tips sdkws.TipsComm
|
||||
var tipsMsg string
|
||||
if isPrivateChat == true {
|
||||
tipsMsg = config.Config.Notification.ConversationSetPrivate.DefaultTips.OpenTips
|
||||
@@ -62,10 +62,10 @@ func ConversationSetPrivateNotification(ctx context.Context, sendID, recvID stri
|
||||
// 会话改变
|
||||
func ConversationChangeNotification(ctx context.Context, userID string) {
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName())
|
||||
ConversationChangedTips := &open_im_sdk.ConversationUpdateTips{
|
||||
ConversationChangedTips := &sdkws.ConversationUpdateTips{
|
||||
UserID: userID,
|
||||
}
|
||||
var tips open_im_sdk.TipsComm
|
||||
var tips sdkws.TipsComm
|
||||
tips.DefaultTips = config.Config.Notification.ConversationOptUpdate.DefaultTips.Tips
|
||||
SetConversationNotification(operationID, userID, userID, constant.ConversationOptChangeNotification, ConversationChangedTips, tips)
|
||||
}
|
||||
@@ -73,12 +73,12 @@ func ConversationChangeNotification(ctx context.Context, userID string) {
|
||||
//会话未读数同步
|
||||
func ConversationUnreadChangeNotification(context context.Context, userID, conversationID string, updateUnreadCountTime int64) {
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName())
|
||||
ConversationChangedTips := &open_im_sdk.ConversationUpdateTips{
|
||||
ConversationChangedTips := &sdkws.ConversationUpdateTips{
|
||||
UserID: userID,
|
||||
ConversationIDList: []string{conversationID},
|
||||
UpdateUnreadCountTime: updateUnreadCountTime,
|
||||
}
|
||||
var tips open_im_sdk.TipsComm
|
||||
var tips sdkws.TipsComm
|
||||
tips.DefaultTips = config.Config.Notification.ConversationOptUpdate.DefaultTips.Tips
|
||||
SetConversationNotification(operationID, userID, userID, constant.ConversationUnreadNotification, ConversationChangedTips, tips)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user