Skip to content

Commit

Permalink
Replying to group chat now updates the notification
Browse files Browse the repository at this point in the history
  • Loading branch information
anze3db committed Sep 27, 2011
1 parent ed3fa93 commit f09e1a0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function wrappedText(text, sender, timestamp, direction, chat) {
}

text = _fixText(text);
if (chat){
if (chat && direction != TelepathyClient.NotificationDirection.SENT){
text = sender + ": " + text;
}
if (text.substr(0, 3) == '/me' && direction != TelepathyClient.NotificationDirection.SENT) {
Expand Down Expand Up @@ -156,7 +156,7 @@ Source.prototype = {
} else if (this._initialFlag == 2) {
direction = TelepathyClient.NotificationDirection.RECEIVED;
}

let message = wrappedText(this._initialMessage, this._author, null, direction, this._chat);
this._notification.appendMessage(message, false);

Expand Down Expand Up @@ -308,18 +308,23 @@ Source.prototype = {
},

_onDisplayedChatMessage: function(emitter, account, author, text, conversation, flag) {

global.log(flag);
if (text && (this._conversation == conversation) && (flag & 3) == 2) {
// accept messages from people who sent us something with our nick in it
if ((flag & 32) == 32) {
this._authors[author] = true;
}
if (author in this._authors) {
let message = wrappedText(author + ": " + text, author, null, TelepathyClient.NotificationDirection.RECEIVED);
let message = wrappedText(text, author, null, TelepathyClient.NotificationDirection.RECEIVED, this._chat);
this._notification.appendMessage(message, false);
this.notify();
}
}
else if(flag == 1){
let message = wrappedText(text, author, null, TelepathyClient.NotificationDirection.SENT, this._chat);
this._notification.appendMessage(message, false);
this.notify();
}

},

Expand Down

0 comments on commit f09e1a0

Please sign in to comment.