Skip to content

Commit 8f2c655

Browse files
committed
chat/v2: add handling for notifiaction chats
1 parent e7986e8 commit 8f2c655

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,15 @@ func (s *Server) toProtoChat(ctx context.Context, chatRecord *chat.ChatRecord, m
12911291

12921292
protoChat.CanMute = true
12931293
protoChat.CanUnsubscribe = true
1294+
case chat.ChatTypeNotification:
1295+
if chatRecord.ChatTitle == nil {
1296+
// TODO: we shouldn't fail the whole RPC
1297+
return nil, fmt.Errorf("invalid notification chat: missing title")
1298+
}
1299+
1300+
// TODO: Localization
1301+
protoChat.Title = *chatRecord.ChatTitle
1302+
12941303
default:
12951304
return nil, errors.Errorf("unsupported chat type: %s", chatRecord.ChatType.String())
12961305
}

0 commit comments

Comments
 (0)