mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 11:06:43 +08:00
notification
This commit is contained in:
parent
b84dbbc3b8
commit
264451d923
@ -160,17 +160,35 @@ messagecallback:
|
|||||||
stateChange:
|
stateChange:
|
||||||
switch: false
|
switch: false
|
||||||
|
|
||||||
|
iOSPush:
|
||||||
|
pushSound: "xxx"
|
||||||
|
badgeCount: 1
|
||||||
|
|
||||||
notification:
|
notification:
|
||||||
offlinePush:
|
groupCreated:
|
||||||
switch: true
|
conversation:
|
||||||
createGroup:
|
conversationChanged: 1
|
||||||
title: "create group title"
|
unreadCount: 1
|
||||||
desc: "create group desc"
|
offlinePush:
|
||||||
ext: "create group ext"
|
switch: true
|
||||||
quitGroup:
|
title: "create group title"
|
||||||
title: "quit group title"
|
desc: "create group desc"
|
||||||
desc: "quit group desc"
|
ext: "create group ext"
|
||||||
ext: "quit 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---------------------#
|
||||||
|
@ -213,26 +213,24 @@ func CreateGroupNotification(sendID string, creator im_mysql_model.User, group i
|
|||||||
msg.SessionType = constant.GroupChatType
|
msg.SessionType = constant.GroupChatType
|
||||||
msg.MsgFrom = constant.SysMsgType
|
msg.MsgFrom = constant.SysMsgType
|
||||||
|
|
||||||
var tip open_im_sdk.CreateGroupTip
|
var groupCreated open_im_sdk.GroupCreatedTips
|
||||||
tip.Group = &open_im_sdk.GroupInfoTip{}
|
groupCreated.Group = &open_im_sdk.GroupInfo{}
|
||||||
utils.CopyStructFields(tip.Group, group)
|
utils.CopyStructFields(groupCreated.Group, group)
|
||||||
tip.Creator = &open_im_sdk.UserInfoTip{}
|
groupCreated.Creator = &open_im_sdk.GroupMemberFullInfo{}
|
||||||
utils.CopyStructFields(tip.Creator, creator)
|
utils.CopyStructFields(groupCreated.Creator, creator)
|
||||||
for _, v := range memberList {
|
for _, v := range memberList {
|
||||||
var groupMemberInfo open_im_sdk.GroupMemberFullInfoTip
|
var groupMemberInfo open_im_sdk.GroupMemberFullInfo
|
||||||
utils.CopyStructFields(&groupMemberInfo, v)
|
utils.CopyStructFields(&groupMemberInfo, v)
|
||||||
tip.MemberList = append(tip.MemberList, &groupMemberInfo)
|
groupCreated.MemberList = append(groupCreated.MemberList, &groupMemberInfo)
|
||||||
}
|
}
|
||||||
|
var tips open_im_sdk.TipsComm
|
||||||
msg.Content = utils.StructToJsonString(tip)
|
tips.Detail = utils.StructToJsonString(groupCreated)
|
||||||
var offlinePushInfo open_im_sdk.OfflinePushInfo
|
tips.DefaultTips = creator.Name + " " + config.Config.DefaultTips.GroupCreatedTips
|
||||||
offlinePushInfo.Title = config.Config.Notification.CreateGroup.Title
|
msg.Content = utils.StructToJsonString(tips)
|
||||||
offlinePushInfo.Desc = config.Config.Notification.CreateGroup.Desc
|
Notification(&msg, false)
|
||||||
offlinePushInfo.Ext = config.Config.Notification.CreateGroup.Ext
|
|
||||||
Notification(&msg, false, offlinePushInfo)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Notification(m *WSToMsgSvrChatMsg, onlineUserOnly bool, offlinePushInfo open_im_sdk.OfflinePushInfo) {
|
func Notification(m *WSToMsgSvrChatMsg, onlineUserOnly bool) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,19 +172,30 @@ type config struct {
|
|||||||
SmtpPort int `yaml:"smtpPort"`
|
SmtpPort int `yaml:"smtpPort"`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//notification:
|
||||||
|
// groupCreated:
|
||||||
|
// offlinePush:
|
||||||
|
// switch: true
|
||||||
|
// title: "create group title"
|
||||||
|
// desc: "create group desc"
|
||||||
|
// ext: "create group ext"
|
||||||
|
// defaultTips:
|
||||||
|
// tips: "create the group" # xx create the group
|
||||||
|
// conversationChanged: 1
|
||||||
|
//
|
||||||
|
|
||||||
Notification struct {
|
Notification struct {
|
||||||
OfflinePush struct {
|
GroupCreated struct {
|
||||||
Switch bool `yaml:"switch"`
|
OfflinePush struct {
|
||||||
}
|
Switch bool `yaml:"switch"`
|
||||||
CreateGroup struct {
|
Title string `yaml:"title"`
|
||||||
Title string `yaml:"title"`
|
Desc string `yaml:"desc"`
|
||||||
Desc string `yaml:"desc"`
|
Ext string `yaml:"ext"`
|
||||||
Ext string `yaml:"ext"`
|
}
|
||||||
}
|
DefaultTips struct {
|
||||||
QuiteGroup struct {
|
GroupCreatedTips string `yaml:"croupCreatedTips"`
|
||||||
Title string `yaml:"title"`
|
GroupInfoChangedTips string `yaml:"groupInfoChangedTips"`
|
||||||
Desc string `yaml:"desc"`
|
}
|
||||||
Ext string `yaml:"ext"`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -93,38 +93,33 @@ message OfflinePushInfo{
|
|||||||
string Ext = 3;
|
string Ext = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GroupInfoTip{
|
//public
|
||||||
string GroupID = 1;
|
message GroupInfo{
|
||||||
string GroupName = 2;
|
string GroupID = 1;
|
||||||
string Notification = 3;
|
string GroupName = 2;
|
||||||
string Introduction = 4;
|
string Notification = 3;
|
||||||
string FaceUrl = 5;
|
string Introduction = 4;
|
||||||
string Ex = 6;
|
string FaceUrl = 5;
|
||||||
string OwnerID = 7;
|
string Ex = 6;
|
||||||
uint64 CreateTime = 8;
|
PublicUserInfo Owner = 7;
|
||||||
uint32 MemberCount = 9;
|
uint64 CreateTime = 8;
|
||||||
|
uint32 MemberCount = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//private, Group members have permission to view
|
||||||
message GroupMemberFullInfoTip {
|
message GroupMemberFullInfo {
|
||||||
string GroupId = 1 ;
|
string GroupID = 1 ;
|
||||||
string UserId = 2 ;
|
string UserID = 2 ;
|
||||||
int32 Role = 3;
|
int32 Role = 3;
|
||||||
uint64 JoinTime = 4;
|
uint64 JoinTime = 4;
|
||||||
string NickName = 5;
|
string NickName = 5;
|
||||||
string FaceUrl =6;
|
string FaceUrl = 6;
|
||||||
|
string FriendRemark = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//private, Friends have permission to view
|
||||||
|
message UserInfo{
|
||||||
message CreateGroupTip{
|
|
||||||
GroupInfoTip Group = 1;
|
|
||||||
UserInfoTip Creator = 2;
|
|
||||||
repeated GroupMemberFullInfoTip MemberList = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message UserInfoTip {
|
|
||||||
string UserID = 1;
|
string UserID = 1;
|
||||||
string Name = 2;
|
string Name = 2;
|
||||||
string Icon = 3;
|
string Icon = 3;
|
||||||
@ -135,4 +130,140 @@ message UserInfoTip {
|
|||||||
string Ex = 8;
|
string Ex = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//No permissions required
|
||||||
|
message PublicUserInfo{
|
||||||
|
string UserID = 1;
|
||||||
|
string Name = 2;
|
||||||
|
string Icon = 3;
|
||||||
|
int32 Gender = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message TipsComm{
|
||||||
|
string Detail = 1;
|
||||||
|
string DefaultTips = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////group/////////////////////
|
||||||
|
//Actively join the group
|
||||||
|
message MemberEnterTips{
|
||||||
|
GroupInfo Group = 1;
|
||||||
|
GroupMemberFullInfo Member = 2;
|
||||||
|
uint64 OperationTime = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Actively leave the group
|
||||||
|
message MemberLeaveTips{
|
||||||
|
GroupInfo Group = 1;
|
||||||
|
GroupMemberFullInfo Member = 2;
|
||||||
|
uint64 OperationTime = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MemberInvitedTips{
|
||||||
|
GroupInfo Group = 1;
|
||||||
|
GroupMemberFullInfo OpUser = 2;
|
||||||
|
GroupMemberFullInfo Member = 3;
|
||||||
|
uint64 OperationTime = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MemberKickedTips{
|
||||||
|
GroupInfo Group = 1;
|
||||||
|
GroupMemberFullInfo OpUser = 2;
|
||||||
|
GroupMemberFullInfo Member = 3;
|
||||||
|
uint64 OperationTime = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GroupMemberChangeInfo{
|
||||||
|
int32 ChangeType = 1; //1:info changed; 2:mute
|
||||||
|
GroupMemberFullInfo OpUser = 2; //who do this
|
||||||
|
GroupMemberFullInfo Member = 3;
|
||||||
|
uint64 MuteTime = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MemberInfoChangedTips{
|
||||||
|
GroupInfo Group = 1;
|
||||||
|
GroupMemberChangeInfo MemberChanged = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GroupCreatedTips{
|
||||||
|
GroupInfo Group = 1;
|
||||||
|
GroupMemberFullInfo Creator = 2;
|
||||||
|
repeated GroupMemberFullInfo MemberList = 3;
|
||||||
|
uint64 OperationTime = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GroupInfoChangedTips{
|
||||||
|
int32 ChangedType = 1; //1:name;2:Notification ...
|
||||||
|
GroupInfo Group = 2;
|
||||||
|
GroupMemberFullInfo OpUser = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ReceiveJoinApplicationTips{
|
||||||
|
GroupInfo Group = 1;
|
||||||
|
GroupMemberFullInfo Member = 2;
|
||||||
|
string Reason = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ApplicationProcessedTips{
|
||||||
|
GroupInfo Group = 1;
|
||||||
|
GroupMemberFullInfo OpUser = 2;
|
||||||
|
int32 Result = 3;
|
||||||
|
string Reason = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////friend/////////////////////
|
||||||
|
message FriendInfo{
|
||||||
|
string OwnerUserID = 1;
|
||||||
|
string Remark = 2;
|
||||||
|
uint64 CreateTime = 3;
|
||||||
|
UserInfo FriendUserInfo = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FriendApplication{
|
||||||
|
uint64 AddTime = 4;
|
||||||
|
string AddSource = 5;
|
||||||
|
string AddWording = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
//user1 add user2
|
||||||
|
message FriendApplicationListAddedTips{
|
||||||
|
PublicUserInfo OpUser = 1; //user1
|
||||||
|
FriendApplication Application = 2;
|
||||||
|
PublicUserInfo OpedUser = 3; //user2
|
||||||
|
}
|
||||||
|
|
||||||
|
// user2 accept
|
||||||
|
message FriendApplicationListAcceptTips{
|
||||||
|
PublicUserInfo OpUser = 1; //user2
|
||||||
|
PublicUserInfo OpedUser = 2; //user1
|
||||||
|
}
|
||||||
|
|
||||||
|
// user2 reject
|
||||||
|
message FriendApplicationListRejectTips{
|
||||||
|
PublicUserInfo OpUser = 1; //user2
|
||||||
|
PublicUserInfo OpedUser = 2; //user1
|
||||||
|
}
|
||||||
|
|
||||||
|
message FriendListAddedTips{
|
||||||
|
FriendInfo Friend = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FriendListDeletedTips{
|
||||||
|
FriendInfo Friend = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BlackListAddTips{
|
||||||
|
FriendInfo Friend = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BlackListDeletedTips{
|
||||||
|
FriendInfo Friend = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FriendInfoChangedTips{
|
||||||
|
FriendInfo Friend = 1;
|
||||||
|
}
|
||||||
|
//////////////////////user/////////////////////
|
||||||
|
message SelfInfoUpdatedTips{
|
||||||
|
UserInfo SelfUserInfo = 1;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user