hubot-salesforce-slack
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "hubot-salesforce-slack", | ||
"description": "A slack module for hubot to display Salesforce related data", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"author": "Patrick Connelly <patrick@deadlypenguin.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -137,3 +137,3 @@ // Description: | ||
robot.respond(/status ([A-Za-z0-9]+)$/i, function (msg) { | ||
var attachment, msg_data, stat, incident, impact, maint, m_start, m_end, | ||
var attachment, msg_data, stat, incident, impact, maint, m_start, m_end, m_now, | ||
match = msg.match[1]; | ||
@@ -150,9 +150,10 @@ | ||
if (!lo.isEmpty(data.Incidents)) { | ||
if (data.status !== 'OK' || !lo.isEmpty(data.Incidents)) { | ||
incident = lo.last(data.Incidents); | ||
impact = lo.first(incident.IncidentImpacts); | ||
m_now = moment(); | ||
m_start = moment(impact.startTime); | ||
m_end = (impact.endTime === null) ? moment() : moment(impact.endTime); | ||
m_end = (impact.endTime === null) ? m_now : moment(impact.endTime); | ||
if (m_end.isSameOrAfter(moment())) { | ||
if (m_end.isSameOrAfter(m_now)) { | ||
if (incident.IncidentImpacts[0].type === 'performanceDegradation') { | ||
@@ -159,0 +160,0 @@ stat = 'Degradation'; |
211599
283