pb: open_im_sdk.OfflinePushInfo

pull/131/head
wenxu12345 3 years ago
parent e63b3ab0e3
commit 3ba881f641

@ -171,6 +171,37 @@ messagecallback:
stateChange: stateChange:
switch: false switch: false
iOSPush:
pushSound: "xxx"
badgeCount: 1
notification:
groupCreated:
conversation:
conversationChanged: 1
unreadCount: 1
offlinePush:
switch: true
title: "create group title"
desc: "create group desc"
ext: "create group ext"
defaultTips:
tips: "create the group" # xx create the group
groupInfoChanged:
conversation:
conversationChanged: 1
unreadCount: 1
offlinePush:
switch: true
title: "group info changed title"
desc: "group info changed desc"
ext: "group info changed ext"
defaultTips:
tips: "group info changed by" # group info changed by xx
conversationChanged: 0
#---------------demo configuration---------------------# #---------------demo configuration---------------------#
#The following configuration items are applied to openIM Demo configuration #The following configuration items are applied to openIM Demo configuration
demoswitch: true demoswitch: true

@ -6,6 +6,7 @@ import (
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant" "Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db" "Open_IM/pkg/common/db"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
http2 "Open_IM/pkg/common/http" http2 "Open_IM/pkg/common/http"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/grpc-etcdv3/getcdv3"
@ -203,17 +204,33 @@ type WSToMsgSvrChatMsg struct {
OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"` OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"`
} }
func CreateGroupNotification(SendID, RecvID string, tip open_im_sdk.CreateGroupTip) { func CreateGroupNotification(sendID string, creator im_mysql_model.User, group im_mysql_model.Group, memberList []im_mysql_model.GroupMember) {
var msg WSToMsgSvrChatMsg var msg WSToMsgSvrChatMsg
msg.OperationID = utils.OperationIDGenerator() msg.OperationID = utils.OperationIDGenerator()
msg.SendID = SendID msg.SendID = sendID
msg.RecvID = RecvID msg.RecvID = group.GroupId
msg.ContentType = constant.CreateGroupTip msg.ContentType = constant.CreateGroupTip
msg.SessionType = constant.SysMsgType msg.SessionType = constant.GroupChatType
msg.MsgFrom = constant.SysMsgType
var groupCreated open_im_sdk.GroupCreatedTips
groupCreated.Group = &open_im_sdk.GroupInfo{}
utils.CopyStructFields(groupCreated.Group, group)
groupCreated.Creator = &open_im_sdk.GroupMemberFullInfo{}
utils.CopyStructFields(groupCreated.Creator, creator)
for _, v := range memberList {
var groupMemberInfo open_im_sdk.GroupMemberFullInfo
utils.CopyStructFields(&groupMemberInfo, v)
groupCreated.MemberList = append(groupCreated.MemberList, &groupMemberInfo)
}
var tips open_im_sdk.TipsComm
tips.Detail = utils.StructToJsonString(groupCreated)
tips.DefaultTips = creator.Name + " " + config.Config.DefaultTips.GroupCreatedTips
msg.Content = utils.StructToJsonString(tips)
Notification(&msg, false)
} }
func Notification(m *WSToMsgSvrChatMsg, onlineUserOnly bool, offlineInfo open_im_sdk.OfflinePushInfo) { func Notification(m *WSToMsgSvrChatMsg, onlineUserOnly bool) {
} }

@ -91,6 +91,8 @@ message OfflinePushInfo{
string Title = 1; string Title = 1;
string Desc = 2; string Desc = 2;
string Ext = 3; string Ext = 3;
string PushSound = 4;
bool ISBadgeCount = 5;
} }
message GroupInfoTip{ message GroupInfoTip{

Loading…
Cancel
Save