private void eachBuildStatus(BuildConnector build) { if (config.lastBuildNumber < build.getNumber()) { BuildStatusMonitor monitor = new BuildStatusMonitor(build); monitor.prepareData(config.eachBuildStatusConfigs); if (monitor.isValid()) { String messageText = monitor.getMessage(); if (!String.IsNullOrEmpty(messageText)) Messenger.Instance.sendMessage(config.messengerChatId, messageText); } } }
private void buildStatusCnahged(BuildConnector build) { if (!config.lastBuildStatus.Contains(build.getStatus()) && config.lastBuildNumber < build.getNumber()) { BuildStatusMonitor monitor = new BuildStatusMonitor(build); monitor.prepareData(config.bldStatusChangedConfigs); if (monitor.isValid()) { if (config.buildStatusTopicChange) { String newTopic = monitor.getTopic(); String actualTopic = Messenger.Instance.getTopicName(config.messengerChatId); if (!String.IsNullOrEmpty(newTopic) && newTopic != actualTopic) { newTopic = "/topic " + newTopic; Messenger.Instance.sendMessage(config.messengerChatId, newTopic); } } String messageText = monitor.getMessage(); if (!String.IsNullOrEmpty(messageText)) Messenger.Instance.sendMessage(config.messengerChatId, messageText); } } }