From d6512a695c867e6dc7735713feb0b91bd93a068b Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Fri, 23 Aug 2024 20:25:36 +0300 Subject: [PATCH] fix format notify PipelineNotify --- .../telegram/service/notify/PipelineNotifyGenerator.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java index 87b2871..044df42 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java @@ -28,19 +28,21 @@ public class PipelineNotifyGenerator implements NotifyBoxAnswerGenerator optProjectName = projectService.getProjectNameById(notify.getProjectId()) .map(Strings::escapeMarkdown); + if (optProjectName.isPresent()) { final String projectName = optProjectName.get(); builder.append(Icons.PROJECT).append(": ").append(projectName).append("\n"); } builder - .append(Icons.TREE).append(": ").append(notify.getRefName()); + .append(Icons.TREE).append(": ").append(notify.getRefName()) + .append(Icons.HR) + .append(notify.getOldStatus().getIcon()).append(" ").append(notify.getOldStatus()).append(Icons.ARROW).append(notify.getNewStatus().getIcon()).append(" ").append(notify.getNewStatus()); + return BoxAnswer.builder() .message(builder.toString())