mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 03:13:15 +08:00 
			
		
		
		
	feat: constant
This commit is contained in:
		
							parent
							
								
									14e923da66
								
							
						
					
					
						commit
						e8f107f250
					
				@ -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)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user