fix tabs->spaces

This commit is contained in:
Dan Winship 2009-11-03 12:13:08 -05:00
parent 64373fe77e
commit 242c2bce04

View File

@ -174,13 +174,13 @@ Source.prototype = {
log('channel for ' + this._targetId); log('channel for ' + this._targetId);
this._pendingMessages = null; this._pendingMessages = null;
// FIXME: RequestAvatar is deprecated in favor of // FIXME: RequestAvatar is deprecated in favor of
// RequestAvatars; but RequestAvatars provides no explicit // RequestAvatars; but RequestAvatars provides no explicit
// indication of "no avatar available", so there's no way we // indication of "no avatar available", so there's no way we
// can reliably wait for it to finish before displaying a // can reliably wait for it to finish before displaying a
// message. So we use RequestAvatar() instead. // message. So we use RequestAvatar() instead.
let targethandle = channel_props[CHANNEL + '.TargetHandle']; let targethandle = channel_props[CHANNEL + '.TargetHandle'];
conn.RequestAvatarRemote(targethandle, Lang.bind(this, this._gotAvatar)); conn.RequestAvatarRemote(targethandle, Lang.bind(this, this._gotAvatar));
@ -193,34 +193,34 @@ Source.prototype = {
this._channelText.ListPendingMessagesRemote(false, this._channelText.ListPendingMessagesRemote(false,
Lang.bind(this, function(msgs, excp) { Lang.bind(this, function(msgs, excp) {
if (msgs) { if (msgs) {
log('got pending messages for ' + this._targetId); log('got pending messages for ' + this._targetId);
this._pendingMessages = msgs; this._pendingMessages = msgs;
this._processPendingMessages(); this._processPendingMessages();
} }
})); }));
}, },
_gotAvatar: function(result, excp) { _gotAvatar: function(result, excp) {
if (result) { if (result) {
let bytes = result[0]; let bytes = result[0];
this._avatar = Shell.TextureCache.get_default().load_from_data(bytes, bytes.length, AVATAR_SIZE, AVATAR_SIZE); this._avatar = Shell.TextureCache.get_default().load_from_data(bytes, bytes.length, AVATAR_SIZE, AVATAR_SIZE);
log('got avatar for ' + this._targetId); log('got avatar for ' + this._targetId);
} else { } else {
// fallback avatar (FIXME) // fallback avatar (FIXME)
this._avatar = Shell.TextureCache.get_default().load_icon_name("stock_person", AVATAR_SIZE); this._avatar = Shell.TextureCache.get_default().load_icon_name("stock_person", AVATAR_SIZE);
log('using default avatar for ' + this._targetId); log('using default avatar for ' + this._targetId);
} }
this._processPendingMessages(); this._processPendingMessages();
}, },
_processPendingMessages: function() { _processPendingMessages: function() {
if (!this._avatar || !this._pendingMessages) if (!this._avatar || !this._pendingMessages)
return; return;
for (let i = 0; i < this._pendingMessages.length; i++) for (let i = 0; i < this._pendingMessages.length; i++)
this._receivedMessage.apply(this, [this._channel].concat(this._pendingMessages[i])); this._receivedMessage.apply(this, [this._channel].concat(this._pendingMessages[i]));
this._pendingMessages = null; this._pendingMessages = null;
}, },
_channelClosed: function() { _channelClosed: function() {