From 8c40b6f9a772c3c6ad9d0ff09945b9c9a0b7a532 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 30 Jun 2011 11:53:44 +0200 Subject: [PATCH] rename Source and Notification to make clear they are about chats We are going to support more Telepathy events hence more Source and Notification types. https://bugzilla.gnome.org/show_bug.cgi?id=653740 --- js/ui/telepathyClient.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js index be31a9b2e..d81b40a76 100644 --- a/js/ui/telepathyClient.js +++ b/js/ui/telepathyClient.js @@ -69,8 +69,8 @@ function Client() { Client.prototype = { _init : function() { - // channel path -> Source - this._sources = {}; + // channel path -> ChatSource + this._chatSources = {}; // Set up a SimpleObserver, which will call _observeChannels whenever a // channel matching its filters is detected. @@ -138,12 +138,12 @@ Client.prototype = { }, _createSource: function(account, conn, channel, contact) { - if (this._sources[channel.get_object_path()]) + if (this._chatSources[channel.get_object_path()]) return; - let source = new Source(account, conn, channel, contact, this._tpClient); + let source = new ChatSource(account, conn, channel, contact, this._tpClient); - this._sources[channel.get_object_path()] = source; + this._chatSources[channel.get_object_path()] = source; source.connect('destroy', Lang.bind(this, function() { if (this._tpClient.is_handling_channel(channel)) { @@ -154,7 +154,7 @@ Client.prototype = { }); } - delete this._sources[channel.get_object_path()]; + delete this._chatSources[channel.get_object_path()]; })); }, @@ -171,7 +171,7 @@ Client.prototype = { if (this._tpClient.is_handling_channel(channel)) { // We are already handling the channel, display the source - let source = this._sources[channel.get_object_path()]; + let source = this._chatSources[channel.get_object_path()]; if (source) source.notify(); } @@ -200,11 +200,11 @@ Client.prototype = { } }; -function Source(account, conn, channel, contact, client) { +function ChatSource(account, conn, channel, contact, client) { this._init(account, conn, channel, contact, client); } -Source.prototype = { +ChatSource.prototype = { __proto__: MessageTray.Source.prototype, _init: function(account, conn, channel, contact, client) { @@ -222,7 +222,7 @@ Source.prototype = { this._channel = channel; this._closedId = this._channel.connect('invalidated', Lang.bind(this, this._channelClosed)); - this._notification = new Notification(this); + this._notification = new ChatNotification(this); this._notification.setUrgency(MessageTray.Urgency.HIGH); // We ack messages when the message box is collapsed if user has @@ -480,11 +480,11 @@ Source.prototype = { } }; -function Notification(source) { +function ChatNotification(source) { this._init(source); } -Notification.prototype = { +ChatNotification.prototype = { __proto__: MessageTray.Notification.prototype, _init: function(source) {