TelepathyClient: rename AvatarManager to ContactManager
and belated rename info.token to info.tokens https://bugzilla.gnome.org/show_bug.cgi?id=611613
This commit is contained in:
parent
7160e8a137
commit
a3a09e6b2e
@ -11,7 +11,7 @@ const Main = imports.ui.main;
|
|||||||
const MessageTray = imports.ui.messageTray;
|
const MessageTray = imports.ui.messageTray;
|
||||||
const Telepathy = imports.misc.telepathy;
|
const Telepathy = imports.misc.telepathy;
|
||||||
|
|
||||||
let avatarManager;
|
let contactManager;
|
||||||
let channelDispatcher;
|
let channelDispatcher;
|
||||||
|
|
||||||
// See Notification.appendMessage
|
// See Notification.appendMessage
|
||||||
@ -54,7 +54,7 @@ Client.prototype = {
|
|||||||
|
|
||||||
this._channels = {};
|
this._channels = {};
|
||||||
|
|
||||||
avatarManager = new AvatarManager();
|
contactManager = new ContactManager();
|
||||||
|
|
||||||
channelDispatcher = new Telepathy.ChannelDispatcher(DBus.session,
|
channelDispatcher = new Telepathy.ChannelDispatcher(DBus.session,
|
||||||
Telepathy.CHANNEL_DISPATCHER_NAME,
|
Telepathy.CHANNEL_DISPATCHER_NAME,
|
||||||
@ -144,11 +144,11 @@ DBus.conformExport(Client.prototype, Telepathy.ClientIface);
|
|||||||
DBus.conformExport(Client.prototype, Telepathy.ClientObserverIface);
|
DBus.conformExport(Client.prototype, Telepathy.ClientObserverIface);
|
||||||
|
|
||||||
|
|
||||||
function AvatarManager() {
|
function ContactManager() {
|
||||||
this._init();
|
this._init();
|
||||||
};
|
};
|
||||||
|
|
||||||
AvatarManager.prototype = {
|
ContactManager.prototype = {
|
||||||
_init: function() {
|
_init: function() {
|
||||||
this._connections = {};
|
this._connections = {};
|
||||||
// Note that if we changed this to '/telepathy/avatars' then
|
// Note that if we changed this to '/telepathy/avatars' then
|
||||||
@ -173,8 +173,8 @@ AvatarManager.prototype = {
|
|||||||
info.cacheDir = this._cacheDir + '/' + match[1];
|
info.cacheDir = this._cacheDir + '/' + match[1];
|
||||||
GLib.mkdir_with_parents(info.cacheDir, 0700);
|
GLib.mkdir_with_parents(info.cacheDir, 0700);
|
||||||
|
|
||||||
// info.token[handle] is the token for @handle's avatar
|
// info.tokens[handle] is the token for @handle's avatar
|
||||||
info.token = {};
|
info.tokens = {};
|
||||||
|
|
||||||
// info.icons[handle] is an array of the icon actors currently
|
// info.icons[handle] is an array of the icon actors currently
|
||||||
// being displayed for @handle. These will be updated
|
// being displayed for @handle. These will be updated
|
||||||
@ -217,7 +217,7 @@ AvatarManager.prototype = {
|
|||||||
|
|
||||||
_setIcon: function(iconBox, info, handle) {
|
_setIcon: function(iconBox, info, handle) {
|
||||||
let textureCache = St.TextureCache.get_default();
|
let textureCache = St.TextureCache.get_default();
|
||||||
let token = info.token[handle];
|
let token = info.tokens[handle];
|
||||||
let file;
|
let file;
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
@ -249,10 +249,10 @@ AvatarManager.prototype = {
|
|||||||
if (!info)
|
if (!info)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (info.token[handle] == token)
|
if (info.tokens[handle] == token)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
info.token[handle] = token;
|
info.tokens[handle] = token;
|
||||||
if (token != '') {
|
if (token != '') {
|
||||||
let file = this._getFileForToken(info, token);
|
let file = this._getFileForToken(info, token);
|
||||||
if (!GLib.file_test(file, GLib.FileTest.EXISTS)) {
|
if (!GLib.file_test(file, GLib.FileTest.EXISTS)) {
|
||||||
@ -306,7 +306,7 @@ AvatarManager.prototype = {
|
|||||||
this._setIcon(iconBox, info, handle);
|
this._setIcon(iconBox, info, handle);
|
||||||
|
|
||||||
// Asynchronously load the real avatar if we don't have it yet.
|
// Asynchronously load the real avatar if we don't have it yet.
|
||||||
if (info.token[handle] == null) {
|
if (info.tokens[handle] == null) {
|
||||||
info.connectionAvatars.GetKnownAvatarTokensRemote([handle], Lang.bind(this,
|
info.connectionAvatars.GetKnownAvatarTokensRemote([handle], Lang.bind(this,
|
||||||
function (tokens, err) {
|
function (tokens, err) {
|
||||||
let token = tokens && tokens[handle] ? tokens[handle] : '';
|
let token = tokens && tokens[handle] ? tokens[handle] : '';
|
||||||
@ -357,7 +357,7 @@ Source.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
createIcon: function(size) {
|
createIcon: function(size) {
|
||||||
return avatarManager.createAvatar(this._conn, this._targetHandle, size);
|
return contactManager.createAvatar(this._conn, this._targetHandle, size);
|
||||||
},
|
},
|
||||||
|
|
||||||
clicked: function() {
|
clicked: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user