Comparing version 0.1.8 to 0.1.9
{ | ||
"name": "corsica", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Ephemeral screens for the masses.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -49,4 +49,2 @@ /* Description: | ||
console.log('command sending', msgType, msg); | ||
corsica.sendMessage(msgType, msg); | ||
@@ -53,0 +51,0 @@ return msg; |
@@ -21,3 +21,3 @@ /* Description: | ||
// Otherwise, pass it on unmodified. | ||
if ((message.screen || '').match(/[\*\?\+\|]/)) { | ||
if (message && (message.screen || '').match(/[\*\?\+\|]/)) { | ||
var pattern = Minimatch(message.screen); | ||
@@ -24,0 +24,0 @@ |
@@ -28,4 +28,3 @@ /* Description: | ||
corsica.on('reset', function(content) { | ||
return settings.get() | ||
.then(function (settings) { | ||
settings.get().then(function (settings) { | ||
var nextLine = settings.defaultUrl[urlIndex]; | ||
@@ -44,5 +43,6 @@ urlIndex = (urlIndex + 1) % settings.defaultUrl.length; | ||
} | ||
return content; | ||
}); | ||
return content; | ||
}); | ||
}; |
@@ -80,2 +80,23 @@ /* Description: | ||
corsica.on('timer.stop', function(content) { | ||
console.log('stopping timer for', content.screen); | ||
var screens = content.screen; | ||
if (!(screens instanceof Array)) { | ||
screens = [screens]; | ||
} | ||
screens.forEach(function(screen) { | ||
if (clientCounters[screen]) { | ||
clientCounters[screen]++; | ||
} | ||
}); | ||
return content; | ||
}); | ||
corsica.on('timer.start', function(content) { | ||
console.log('restarting timer for', content.screen); | ||
corsica.sendMessage('reset', {screen: content.screen}); | ||
return content; | ||
}); | ||
}; |
116328
46
1611