Skip to content

Commit

Permalink
Callback, security
Browse files Browse the repository at this point in the history
  • Loading branch information
Didrik Nordström committed Nov 24, 2011
1 parent 385aaee commit 8e4ad9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/growler.js
Expand Up @@ -64,6 +64,7 @@ var nl = '\r\n', nl2 = nl+nl;
var GrowlApplication = function(name, options, security) {
this.name = name;
this.options = {};
security = security || {};

_.defaults(this.options, options, {
hostname: 'localhost',
Expand Down Expand Up @@ -164,7 +165,7 @@ GrowlApplication.prototype.register = function(callback) {
*
* @return {string} The randomized notification ID
*/
GrowlApplication.prototype.sendNotification = function (name, options) {
GrowlApplication.prototype.sendNotification = function (name, options, callback) {

var notification = this.notifications[name];
if (!notification)
Expand All @@ -177,7 +178,6 @@ GrowlApplication.prototype.sendNotification = function (name, options) {
_.defaults(options, {
title: notification.displayName,
text: null,
callback: function() {}, // Called when a response is received
sticky: null, // Stay on screen until clicked
priority: null, // In range [-2, 2], 2 meaning emergency
icon: notification.icon
Expand All @@ -194,7 +194,7 @@ GrowlApplication.prototype.sendNotification = function (name, options) {
'Notification-Icon': options.icon // @see GrowlApplication.prototype.register
}];

this.sendQuery('NOTIFY', headerBlocks, options.callback);
this.sendQuery('NOTIFY', headerBlocks, callback);

return id;
};
Expand Down

0 comments on commit 8e4ad9a

Please sign in to comment.