mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 02:16:16 +08:00
Merge remote-tracking branch 'origin/errcode' into errcode
This commit is contained in:
commit
8b76ecd84e
@ -7,7 +7,7 @@ groupCreated:
|
|||||||
title: "create group title" # xx create the group
|
title: "create group title" # xx create the group
|
||||||
desc: "create group desc"
|
desc: "create group desc"
|
||||||
ext: "create group ext"
|
ext: "create group ext"
|
||||||
|
|
||||||
# 不加消息contentType,content统一json 结构体使用pb的
|
# 不加消息contentType,content统一json 结构体使用pb的
|
||||||
|
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ memberQuit:
|
|||||||
title: "memberQuit title"
|
title: "memberQuit title"
|
||||||
desc: "memberQuit desc"
|
desc: "memberQuit desc"
|
||||||
ext: "memberQuit ext"
|
ext: "memberQuit ext"
|
||||||
|
|
||||||
groupApplicationAccepted:
|
groupApplicationAccepted:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
@ -51,7 +51,7 @@ groupApplicationAccepted:
|
|||||||
title: "groupApplicationAccepted title"
|
title: "groupApplicationAccepted title"
|
||||||
desc: "groupApplicationAccepted desc"
|
desc: "groupApplicationAccepted desc"
|
||||||
ext: "groupApplicationAccepted ext"
|
ext: "groupApplicationAccepted ext"
|
||||||
|
|
||||||
groupApplicationRejected:
|
groupApplicationRejected:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
@ -166,11 +166,33 @@ groupMemberInfoSet:
|
|||||||
desc: "groupMemberInfoSet desc"
|
desc: "groupMemberInfoSet desc"
|
||||||
ext: "groupMemberInfoSet ext"
|
ext: "groupMemberInfoSet ext"
|
||||||
|
|
||||||
|
groupInfoSetAnnouncement:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupInfoSetAnnouncement title"
|
||||||
|
desc: "groupInfoSetAnnouncement desc"
|
||||||
|
ext: "groupInfoSetAnnouncement ext"
|
||||||
|
|
||||||
|
|
||||||
|
groupInfoSetName:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupInfoSetName title"
|
||||||
|
desc: "groupInfoSetName desc"
|
||||||
|
ext: "groupInfoSetName ext"
|
||||||
|
|
||||||
|
|
||||||
#############################friend#################################
|
#############################friend#################################
|
||||||
friendApplicationAdded:
|
friendApplicationAdded:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: false
|
enable: false
|
||||||
title: "Somebody applies to add you as a friend"
|
title: "Somebody applies to add you as a friend"
|
||||||
@ -180,7 +202,7 @@ friendApplicationAdded:
|
|||||||
friendApplicationApproved:
|
friendApplicationApproved:
|
||||||
isSendMsg: true
|
isSendMsg: true
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "Someone applies to add your friend application"
|
title: "Someone applies to add your friend application"
|
||||||
@ -190,7 +212,7 @@ friendApplicationApproved:
|
|||||||
friendApplicationRejected:
|
friendApplicationRejected:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "Someone rejected your friend application"
|
title: "Someone rejected your friend application"
|
||||||
@ -200,7 +222,7 @@ friendApplicationRejected:
|
|||||||
friendAdded:
|
friendAdded:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "We have become friends"
|
title: "We have become friends"
|
||||||
@ -210,7 +232,7 @@ friendAdded:
|
|||||||
friendDeleted:
|
friendDeleted:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "deleted a friend"
|
title: "deleted a friend"
|
||||||
@ -220,7 +242,7 @@ friendDeleted:
|
|||||||
friendRemarkSet:
|
friendRemarkSet:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "Your friend's profile has been changed"
|
title: "Your friend's profile has been changed"
|
||||||
@ -230,7 +252,7 @@ friendRemarkSet:
|
|||||||
blackAdded:
|
blackAdded:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "blocked a user"
|
title: "blocked a user"
|
||||||
@ -240,7 +262,7 @@ blackAdded:
|
|||||||
blackDeleted:
|
blackDeleted:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "Remove a blocked user"
|
title: "Remove a blocked user"
|
||||||
@ -250,7 +272,7 @@ blackDeleted:
|
|||||||
friendInfoUpdated:
|
friendInfoUpdated:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "friend info updated"
|
title: "friend info updated"
|
||||||
@ -261,7 +283,7 @@ friendInfoUpdated:
|
|||||||
userInfoUpdated:
|
userInfoUpdated:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "Remove a blocked user"
|
title: "Remove a blocked user"
|
||||||
@ -272,7 +294,7 @@ userInfoUpdated:
|
|||||||
conversationChanged:
|
conversationChanged:
|
||||||
isSendMsg: false
|
isSendMsg: false
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "conversation changed"
|
title: "conversation changed"
|
||||||
@ -282,7 +304,7 @@ conversationChanged:
|
|||||||
conversationSetPrivate:
|
conversationSetPrivate:
|
||||||
isSendMsg: true
|
isSendMsg: true
|
||||||
reliabilityLevel: 1
|
reliabilityLevel: 1
|
||||||
unreadCount: false
|
unreadCount: false
|
||||||
offlinePush:
|
offlinePush:
|
||||||
enable: true
|
enable: true
|
||||||
title: "burn after reading"
|
title: "burn after reading"
|
||||||
|
@ -12,11 +12,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewAuth(discov discoveryregistry.SvcDiscoveryRegistry) *Auth {
|
func NewAuth(discov discoveryregistry.SvcDiscoveryRegistry) *Auth {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAuthName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAuthName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Auth{conn: conn, discov: discov}
|
return &Auth{discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Auth struct {
|
type Auth struct {
|
||||||
|
@ -12,11 +12,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewConversation(discov discoveryregistry.SvcDiscoveryRegistry) *Conversation {
|
func NewConversation(discov discoveryregistry.SvcDiscoveryRegistry) *Conversation {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImConversationName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImConversationName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Conversation{conn: conn, discov: discov}
|
return &Conversation{discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Conversation struct {
|
type Conversation struct {
|
||||||
|
@ -13,11 +13,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewFriend(discov discoveryregistry.SvcDiscoveryRegistry) *Friend {
|
func NewFriend(discov discoveryregistry.SvcDiscoveryRegistry) *Friend {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImFriendName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImFriendName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Friend{conn: conn, discov: discov}
|
return &Friend{discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Friend struct {
|
type Friend struct {
|
||||||
|
@ -13,11 +13,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewGroup(discov discoveryregistry.SvcDiscoveryRegistry) *Group {
|
func NewGroup(discov discoveryregistry.SvcDiscoveryRegistry) *Group {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImGroupName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImGroupName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Group{conn: conn, discov: discov}
|
return &Group{discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Group struct {
|
type Group struct {
|
||||||
|
@ -22,11 +22,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewMsg(discov discoveryregistry.SvcDiscoveryRegistry) *Message {
|
func NewMsg(discov discoveryregistry.SvcDiscoveryRegistry) *Message {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImMsgName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImMsgName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Message{conn: conn, validate: validator.New(), discov: discov}
|
return &Message{validate: validator.New(), discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Message struct {
|
type Message struct {
|
||||||
|
@ -18,11 +18,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewThird(discov discoveryregistry.SvcDiscoveryRegistry) *Third {
|
func NewThird(discov discoveryregistry.SvcDiscoveryRegistry) *Third {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImThirdName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImThirdName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Third{conn: conn, discov: discov}
|
return &Third{discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Third struct {
|
type Third struct {
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apiresp"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/apiresp"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
@ -18,12 +17,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User {
|
func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImUserName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImUserName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
log.ZInfo(context.Background(), "user rpc conn", "conn", conn)
|
return &User{discov: discov}
|
||||||
return &User{conn: conn, discov: discov}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
|
@ -26,7 +26,6 @@ import (
|
|||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
||||||
pbConversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation"
|
|
||||||
pbGroup "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/group"
|
pbGroup "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/group"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
||||||
@ -926,21 +925,34 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf
|
|||||||
} else {
|
} else {
|
||||||
tips.OpUser = s.groupMemberDB2PB(opMember, 0)
|
tips.OpUser = s.groupMemberDB2PB(opMember, 0)
|
||||||
}
|
}
|
||||||
s.Notification.GroupInfoSetNotification(ctx, tips)
|
var num int
|
||||||
if req.GroupInfoForSet.Notification != "" {
|
if req.GroupInfoForSet.Notification != "" {
|
||||||
args := &pbConversation.ModifyConversationFieldReq{
|
num++
|
||||||
Conversation: &pbConversation.Conversation{
|
s.Notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{Group: tips.Group, OpUser: tips.OpUser})
|
||||||
OwnerUserID: mcontext.GetOpUserID(ctx),
|
//args := &pbConversation.ModifyConversationFieldReq{
|
||||||
ConversationID: utils.GetConversationIDBySessionType(constant.GroupChatType, group.GroupID),
|
// Conversation: &pbConversation.Conversation{
|
||||||
ConversationType: constant.SuperGroupChatType,
|
// OwnerUserID: mcontext.GetOpUserID(ctx),
|
||||||
GroupID: group.GroupID,
|
// ConversationID: utils.GetConversationIDBySessionType(constant.GroupChatType, group.GroupID),
|
||||||
},
|
// ConversationType: constant.SuperGroupChatType,
|
||||||
FieldType: constant.FieldGroupAtType,
|
// GroupID: group.GroupID,
|
||||||
UserIDList: userIDs,
|
// },
|
||||||
}
|
// FieldType: constant.FieldGroupAtType,
|
||||||
if err := s.conversationRpcClient.ModifyConversationField(ctx, args); err != nil {
|
// UserIDList: userIDs,
|
||||||
log.ZWarn(ctx, "modifyConversationField failed", err, "args", args)
|
//}
|
||||||
|
//if err := s.conversationRpcClient.ModifyConversationField(ctx, args); err != nil {
|
||||||
|
// log.ZWarn(ctx, "modifyConversationField failed", err, "args", args)
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
switch len(data) - num {
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
if req.GroupInfoForSet.GroupName == "" {
|
||||||
|
s.Notification.GroupInfoSetNotification(ctx, tips)
|
||||||
|
} else {
|
||||||
|
s.Notification.GroupInfoSetNameNotification(ctx, &sdkws.GroupInfoSetNameTips{Group: tips.Group, OpUser: tips.OpUser})
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
s.Notification.GroupInfoSetNotification(ctx, tips)
|
||||||
}
|
}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
@ -332,6 +332,8 @@ type Notification struct {
|
|||||||
GroupMemberInfoSet NotificationConf `yaml:"groupMemberInfoSet"`
|
GroupMemberInfoSet NotificationConf `yaml:"groupMemberInfoSet"`
|
||||||
GroupMemberSetToAdmin NotificationConf `yaml:"groupMemberSetToAdmin"`
|
GroupMemberSetToAdmin NotificationConf `yaml:"groupMemberSetToAdmin"`
|
||||||
GroupMemberSetToOrdinary NotificationConf `yaml:"groupMemberSetToOrdinaryUser"`
|
GroupMemberSetToOrdinary NotificationConf `yaml:"groupMemberSetToOrdinaryUser"`
|
||||||
|
GroupInfoSetAnnouncement NotificationConf `yaml:"groupInfoSetAnnouncement"`
|
||||||
|
GroupInfoSetName NotificationConf `yaml:"groupInfoSetName"`
|
||||||
////////////////////////user///////////////////////
|
////////////////////////user///////////////////////
|
||||||
UserInfoUpdated NotificationConf `yaml:"userInfoUpdated"`
|
UserInfoUpdated NotificationConf `yaml:"userInfoUpdated"`
|
||||||
//////////////////////friend///////////////////////
|
//////////////////////friend///////////////////////
|
||||||
|
@ -70,6 +70,8 @@ const (
|
|||||||
GroupMemberInfoSetNotification = 1516
|
GroupMemberInfoSetNotification = 1516
|
||||||
GroupMemberSetToAdminNotification = 1517
|
GroupMemberSetToAdminNotification = 1517
|
||||||
GroupMemberSetToOrdinaryUserNotification = 1518
|
GroupMemberSetToOrdinaryUserNotification = 1518
|
||||||
|
GroupInfoSetAnnouncementNotification = 1519
|
||||||
|
GroupInfoSetNameNotification = 1520
|
||||||
|
|
||||||
SignalingNotificationBegin = 1600
|
SignalingNotificationBegin = 1600
|
||||||
SignalingNotification = 1601
|
SignalingNotification = 1601
|
||||||
|
@ -10,5 +10,4 @@ protoc --go_out=plugins=grpc:./rtc --go_opt=module=github.com/OpenIMSDK/Open-IM-
|
|||||||
protoc --go_out=plugins=grpc:./sdkws --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws sdkws/sdkws.proto
|
protoc --go_out=plugins=grpc:./sdkws --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws sdkws/sdkws.proto
|
||||||
protoc --go_out=plugins=grpc:./third --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/third third/third.proto
|
protoc --go_out=plugins=grpc:./third --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/third third/third.proto
|
||||||
protoc --go_out=plugins=grpc:./user --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/user user/user.proto
|
protoc --go_out=plugins=grpc:./user --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/user user/user.proto
|
||||||
protoc --go_out=plugins=grpc:./wrapperspb --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb wrapperspb/wrapperspb.proto
|
protoc --go_out=plugins=grpc:./wrapperspb --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb wrapperspb/wrapperspb.proto
|
||||||
protoc --go_out=plugins=grpc:./office --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/office office/office.proto
|
|
File diff suppressed because it is too large
Load Diff
@ -233,6 +233,16 @@ message GroupInfoSetTips{
|
|||||||
GroupInfo group = 3;
|
GroupInfo group = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message GroupInfoSetNameTips{
|
||||||
|
GroupMemberFullInfo opUser = 1; //who do this
|
||||||
|
GroupInfo group = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GroupInfoSetAnnouncementTips{
|
||||||
|
GroupMemberFullInfo opUser = 1; //who do this
|
||||||
|
GroupInfo group = 2;
|
||||||
|
}
|
||||||
|
|
||||||
// OnJoinGroupApplication()
|
// OnJoinGroupApplication()
|
||||||
message JoinGroupApplicationTips{
|
message JoinGroupApplicationTips{
|
||||||
GroupInfo group = 1;
|
GroupInfo group = 1;
|
||||||
|
@ -37,6 +37,8 @@ func newContentTypeConf() map[int32]config.NotificationConf {
|
|||||||
constant.GroupMemberInfoSetNotification: config.Config.Notification.GroupMemberInfoSet,
|
constant.GroupMemberInfoSetNotification: config.Config.Notification.GroupMemberInfoSet,
|
||||||
constant.GroupMemberSetToAdminNotification: config.Config.Notification.GroupMemberSetToAdmin,
|
constant.GroupMemberSetToAdminNotification: config.Config.Notification.GroupMemberSetToAdmin,
|
||||||
constant.GroupMemberSetToOrdinaryUserNotification: config.Config.Notification.GroupMemberSetToOrdinary,
|
constant.GroupMemberSetToOrdinaryUserNotification: config.Config.Notification.GroupMemberSetToOrdinary,
|
||||||
|
constant.GroupInfoSetAnnouncementNotification: config.Config.Notification.GroupInfoSetAnnouncement,
|
||||||
|
constant.GroupInfoSetNameNotification: config.Config.Notification.GroupInfoSetName,
|
||||||
// user
|
// user
|
||||||
constant.UserInfoUpdatedNotification: config.Config.Notification.UserInfoUpdated,
|
constant.UserInfoUpdatedNotification: config.Config.Notification.UserInfoUpdated,
|
||||||
// friend
|
// friend
|
||||||
@ -79,6 +81,8 @@ func newSessionTypeConf() map[int32]int32 {
|
|||||||
constant.GroupMemberInfoSetNotification: constant.SuperGroupChatType,
|
constant.GroupMemberInfoSetNotification: constant.SuperGroupChatType,
|
||||||
constant.GroupMemberSetToAdminNotification: constant.SuperGroupChatType,
|
constant.GroupMemberSetToAdminNotification: constant.SuperGroupChatType,
|
||||||
constant.GroupMemberSetToOrdinaryUserNotification: constant.SuperGroupChatType,
|
constant.GroupMemberSetToOrdinaryUserNotification: constant.SuperGroupChatType,
|
||||||
|
constant.GroupInfoSetAnnouncementNotification: constant.SuperGroupChatType,
|
||||||
|
constant.GroupInfoSetNameNotification: constant.SuperGroupChatType,
|
||||||
// user
|
// user
|
||||||
constant.UserInfoUpdatedNotification: constant.SingleChatType,
|
constant.UserInfoUpdatedNotification: constant.SingleChatType,
|
||||||
// friend
|
// friend
|
||||||
|
@ -289,55 +289,23 @@ func (g *GroupNotificationSender) mergeGroupFull(ctx context.Context, groupID st
|
|||||||
return groupInfo, nil
|
return groupInfo, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//func (g *GroupNotificationSender) GroupCreatedNotification(ctx context.Context, group *relation.GroupModel, members []*relation.GroupMemberModel, userMap map[string]*sdkws.UserInfo) (err error) {
|
|
||||||
// defer log.ZDebug(ctx, "GroupCreatedNotification.return")
|
|
||||||
// defer func() {
|
|
||||||
// if err != nil {
|
|
||||||
// log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
||||||
// }
|
|
||||||
// }()
|
|
||||||
// groupInfo, err := g.mergeGroupFull(ctx, group.GroupID, group, &members, &userMap)
|
|
||||||
// if err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
// return g.msgClient.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupCreatedNotification, groupInfo)
|
|
||||||
//}
|
|
||||||
|
|
||||||
func (g *GroupNotificationSender) GroupCreatedNotification(ctx context.Context, tips *sdkws.GroupCreatedTips) (err error) {
|
func (g *GroupNotificationSender) GroupCreatedNotification(ctx context.Context, tips *sdkws.GroupCreatedTips) (err error) {
|
||||||
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupCreatedNotification, tips)
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupCreatedNotification, tips)
|
||||||
}
|
}
|
||||||
|
|
||||||
//func (g *GroupNotificationSender) GroupInfoSetNotification(ctx context.Context, group *relation.GroupModel, members []*relation.GroupMemberModel, needVerification *int32) (err error) {
|
|
||||||
// groupInfo, err := g.mergeGroupFull(ctx, group.GroupID, group, &members, nil)
|
|
||||||
// if err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
// tips := &sdkws.GroupInfoSetTips{Group: groupInfo.Group, OpUser: groupInfo.GroupOwnerUser}
|
|
||||||
// if needVerification != nil {
|
|
||||||
// tips.Group.NeedVerification = *needVerification
|
|
||||||
// }
|
|
||||||
// return g.msgClient.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupInfoSetNotification, tips)
|
|
||||||
//}
|
|
||||||
|
|
||||||
func (g *GroupNotificationSender) GroupInfoSetNotification(ctx context.Context, tips *sdkws.GroupInfoSetTips) (err error) {
|
func (g *GroupNotificationSender) GroupInfoSetNotification(ctx context.Context, tips *sdkws.GroupInfoSetTips) (err error) {
|
||||||
//groupInfo, err := g.mergeGroupFull(ctx, group.GroupID, group, &members, nil)
|
|
||||||
//if err != nil {
|
|
||||||
// return err
|
|
||||||
//}
|
|
||||||
//tips := &sdkws.GroupInfoSetTips{Group: groupInfo.Group, OpUser: groupInfo.GroupOwnerUser}
|
|
||||||
//if needVerification != nil {
|
|
||||||
// tips.Group.NeedVerification = *needVerification
|
|
||||||
//}
|
|
||||||
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNotification, tips)
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNotification, tips)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (g *GroupNotificationSender) GroupInfoSetNameNotification(ctx context.Context, tips *sdkws.GroupInfoSetNameTips) (err error) {
|
||||||
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNameNotification, tips)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g *GroupNotificationSender) GroupInfoSetAnnouncementNotification(ctx context.Context, tips *sdkws.GroupInfoSetAnnouncementTips) (err error) {
|
||||||
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetAnnouncementNotification, tips)
|
||||||
|
}
|
||||||
|
|
||||||
func (g *GroupNotificationSender) JoinGroupApplicationNotification(ctx context.Context, req *pbGroup.JoinGroupReq) (err error) {
|
func (g *GroupNotificationSender) JoinGroupApplicationNotification(ctx context.Context, req *pbGroup.JoinGroupReq) (err error) {
|
||||||
defer log.ZDebug(ctx, "return")
|
|
||||||
defer func() {
|
|
||||||
if err != nil {
|
|
||||||
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
group, err := g.getGroupInfo(ctx, req.GroupID)
|
group, err := g.getGroupInfo(ctx, req.GroupID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -377,22 +345,12 @@ func (g *GroupNotificationSender) MemberQuitNotification(ctx context.Context, re
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
//userIDs, err := g.getGroupOwnerAndAdminUserID(ctx, req.GroupID)
|
|
||||||
//if err != nil {
|
|
||||||
// return err
|
|
||||||
//}
|
|
||||||
tips := &sdkws.MemberQuitTips{Group: group, QuitUser: &sdkws.GroupMemberFullInfo{
|
tips := &sdkws.MemberQuitTips{Group: group, QuitUser: &sdkws.GroupMemberFullInfo{
|
||||||
GroupID: group.GroupID,
|
GroupID: group.GroupID,
|
||||||
UserID: user.UserID,
|
UserID: user.UserID,
|
||||||
Nickname: user.Nickname,
|
Nickname: user.Nickname,
|
||||||
FaceURL: user.FaceURL,
|
FaceURL: user.FaceURL,
|
||||||
}}
|
}}
|
||||||
//for _, userID := range append(userIDs, opUserID) {
|
|
||||||
// err = g.msgClient.Notification(ctx, mcontext.GetOpUserID(ctx), userID, constant.MemberQuitNotification, tips)
|
|
||||||
// if err != nil {
|
|
||||||
// log.ZError(ctx, "MemberQuitNotification failed", err, "group", req.GroupID, "userID", userID)
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
return g.Notification(ctx, mcontext.GetOpUserID(ctx), req.GroupID, constant.MemberQuitNotification, tips)
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), req.GroupID, constant.MemberQuitNotification, tips)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user