Permalink
Browse files

Merge pull request #75 from michaelvillar/master

Fixed error in trim() of notification
  • Loading branch information...
2 parents ff57e7b + 1ea3db1 commit c0d67189325ce6cfce82364978858847376ec380 @argon argon committed Jan 11, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/notification.js
View
@@ -148,15 +148,15 @@ Notification.prototype.trim = function() {
return 0;
}
if(typeof this.alert == "string") {
- var length = Buffer.byteLength(this.alert.length, this.encoding || 'utf8');
+ var length = Buffer.byteLength(this.alert, this.encoding || 'utf8');
if (length < tooLong) {
return length - tooLong;
}
this.alert = this.alert.substring(0, length - tooLong);
return tooLong;
}
else if(typeof this.alert == "object" && typeof this.alert.body == "string") {
- var length = Buffer.byteLength(this.alert.body.length, this.encoding || 'utf8');
+ var length = Buffer.byteLength(this.alert.body, this.encoding || 'utf8');
if (length < tooLong) {
return length - tooLong;
}

0 comments on commit c0d6718

Please sign in to comment.