提交 3ba881f6 编写于 作者: W wenxu12345

pb: open_im_sdk.OfflinePushInfo

上级 e63b3ab0
......@@ -171,6 +171,37 @@ messagecallback:
stateChange:
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---------------------#
#The following configuration items are applied to openIM Demo configuration
demoswitch: true
......
......@@ -6,6 +6,7 @@ import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
http2 "Open_IM/pkg/common/http"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
......@@ -203,17 +204,33 @@ type WSToMsgSvrChatMsg struct {
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
msg.OperationID = utils.OperationIDGenerator()
msg.SendID = SendID
msg.RecvID = RecvID
msg.SendID = sendID
msg.RecvID = group.GroupId
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 Desc = 2;
string Ext = 3;
string PushSound = 4;
bool ISBadgeCount = 5;
}
message GroupInfoTip{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册