Skip to content

Commit e78b028

Browse files
committed
chat/v2: don't send push to sender
1 parent 91956a6 commit e78b028

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/code/server/grpc/chat/v2/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ func (s *Server) SendMessage(ctx context.Context, req *chatpb.SendMessageRequest
791791
}
792792

793793
s.onPersistChatMessage(log, chatId, chatMessage)
794-
s.sendPushNotifications(chatId, chatTitle, chatMessage)
794+
s.sendPushNotifications(chatId, chatTitle, memberId, chatMessage)
795795

796796
return &chatpb.SendMessageResponse{
797797
Result: chatpb.SendMessageResponse_OK,
@@ -1409,7 +1409,7 @@ func (s *Server) onPersistChatMessage(log *logrus.Entry, chatId chat.ChatId, cha
14091409
}
14101410
}
14111411

1412-
func (s *Server) sendPushNotifications(chatId chat.ChatId, chatTitle string, message *chatpb.ChatMessage) {
1412+
func (s *Server) sendPushNotifications(chatId chat.ChatId, chatTitle string, sender chat.MemberId, message *chatpb.ChatMessage) {
14131413
log := s.log.WithFields(logrus.Fields{
14141414
"method": "sendPushNotifications",
14151415
"chat_id": chatId.String(),
@@ -1426,7 +1426,7 @@ func (s *Server) sendPushNotifications(chatId chat.ChatId, chatTitle string, mes
14261426
eg.SetLimit(min(32, len(members)))
14271427

14281428
for _, m := range members {
1429-
if m.IsMuted || m.IsUnsubscribed {
1429+
if m.MemberId == sender || m.IsMuted || m.IsUnsubscribed {
14301430
continue
14311431
}
14321432

0 commit comments

Comments
 (0)