|
|
|
@ -34,6 +34,12 @@ import (
|
|
|
|
|
"github.com/openimsdk/tools/utils/stringutil"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// GroupApplicationReceiver
|
|
|
|
|
const (
|
|
|
|
|
applicantReceiver = iota
|
|
|
|
|
adminReceiver
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func NewGroupNotificationSender(db controller.GroupDatabase, msgRpcClient *rpcclient.MessageRpcClient, userRpcClient *rpcclient.UserRpcClient, config *Config, fn func(ctx context.Context, userIDs []string) ([]notification.CommonUser, error)) *GroupNotificationSender {
|
|
|
|
|
return &GroupNotificationSender{
|
|
|
|
|
NotificationSender: rpcclient.NewNotificationSender(&config.NotificationConfig, rpcclient.WithRpcClient(msgRpcClient), rpcclient.WithUserRpcClient(userRpcClient)),
|
|
|
|
@ -408,9 +414,9 @@ func (g *GroupNotificationSender) GroupApplicationAcceptedNotification(ctx conte
|
|
|
|
|
for _, userID := range append(userIDs, req.FromUserID) {
|
|
|
|
|
tips := &sdkws.GroupApplicationAcceptedTips{Group: group, OpUser: opUser, HandleMsg: req.HandledMsg}
|
|
|
|
|
if userID == req.FromUserID {
|
|
|
|
|
tips.ReceiverAs = 0
|
|
|
|
|
tips.ReceiverAs = applicantReceiver
|
|
|
|
|
} else {
|
|
|
|
|
tips.ReceiverAs = 1
|
|
|
|
|
tips.ReceiverAs = adminReceiver
|
|
|
|
|
}
|
|
|
|
|
g.Notification(ctx, mcontext.GetOpUserID(ctx), userID, constant.GroupApplicationAcceptedNotification, tips)
|
|
|
|
|
}
|
|
|
|
@ -441,9 +447,9 @@ func (g *GroupNotificationSender) GroupApplicationRejectedNotification(ctx conte
|
|
|
|
|
for _, userID := range append(userIDs, req.FromUserID) {
|
|
|
|
|
tips := &sdkws.GroupApplicationAcceptedTips{Group: group, OpUser: opUser, HandleMsg: req.HandledMsg}
|
|
|
|
|
if userID == req.FromUserID {
|
|
|
|
|
tips.ReceiverAs = 0
|
|
|
|
|
tips.ReceiverAs = applicantReceiver
|
|
|
|
|
} else {
|
|
|
|
|
tips.ReceiverAs = 1
|
|
|
|
|
tips.ReceiverAs = adminReceiver
|
|
|
|
|
}
|
|
|
|
|
g.Notification(ctx, mcontext.GetOpUserID(ctx), userID, constant.GroupApplicationRejectedNotification, tips)
|
|
|
|
|
}
|
|
|
|
|