diff --git a/customize.dist/src/less2/include/messenger.less b/customize.dist/src/less2/include/messenger.less index 64b820336..dfcafb4f8 100644 --- a/customize.dist/src/less2/include/messenger.less +++ b/customize.dist/src/less2/include/messenger.less @@ -125,6 +125,8 @@ } #cp-app-contacts-container.cp-app-contacts-inapp { #cp-app-contacts-friendlist { + display: none; +/* transition: width 0.2s ease-in-out 0.2s; width: 68px; .cp-app-contacts-friend { @@ -145,6 +147,7 @@ font-size: 18px; } } +*/ } } diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index 4d4106c40..559addc42 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -262,6 +262,14 @@ display: flex; justify-content: space-between; align-items: center; + button { + width: 20px; + font-size: 16px; + padding: 0; + border: none; + height: 20px; + cursor: pointer; + } } .cp-toolbar-userlist-name-input { flex: 1; @@ -278,14 +286,6 @@ min-height: 0; text-overflow: ellipsis; } - .cp-toolbar-userlist-name-edit { - width: 20px; - font-size: 16px; - padding: 0; - border: none; - height: 20px; - cursor: pointer; - } .cp-toolbar-userlist-friend { padding: 0; } @@ -387,7 +387,7 @@ color: @toolbar-color; color: var(--toolbar-color); } - .cp-toolbar-userlist-name-edit { + .cp-toolbar-userlist-button { color: @toolbar-userlist-name-edit; color: var(--toolbar-userlist-name-edit); background: transparent; diff --git a/www/common/common-messenger.js b/www/common/common-messenger.js index f7a54b6cf..9b2b339c0 100644 --- a/www/common/common-messenger.js +++ b/www/common/common-messenger.js @@ -204,7 +204,7 @@ define([ }; // Make sure the data we have about our friends are up-to-date when we see them online - var checkFriendData = function (curve, data) { + var checkFriendData = function (curve, data, channel) { if (curve === proxy.curvePublic) { return; } var friend = getFriend(proxy, curve); if (!friend) { return; } @@ -217,7 +217,7 @@ define([ }); eachHandler('update', function (f) { - f(clone(data), types); + f(clone(data), types, channel); }); }; @@ -261,7 +261,7 @@ define([ // the sender field. This is to prevent replay attacks. if (parsed[2] !== sender || !parsed[1]) { return; } channel.mapId[sender] = parsed[1]; - checkFriendData(parsed[1].curvePublic, parsed[1]); + checkFriendData(parsed[1].curvePublic, parsed[1], channel.id); eachHandler('join', function (f) { f(parsed[1], channel.id); }); @@ -328,7 +328,7 @@ define([ return true; } if (parsedMsg[0] === Types.update) { - checkFriendData(parsedMsg[1], parsedMsg[3]); + checkFriendData(parsedMsg[1], parsedMsg[3], channel.id); return; } if (parsedMsg[0] === Types.unfriend) { @@ -809,7 +809,10 @@ define([ }; var ready = false; + var initialized = false; var init = function () { + if (initialized) { return; } + initialized = true; var friends = getFriendList(proxy); nThen(function (waitFor) { @@ -827,7 +830,7 @@ define([ emit('READY'); }); }; - init(); + //init(); var getRooms = function (data, cb) { if (data && data.curvePublic) { @@ -931,6 +934,10 @@ define([ messenger.execCommand = function (obj, cb) { var cmd = obj.cmd; var data = obj.data; + if (cmd === 'INIT_FRIENDS') { + init(); + return void cb(); + } if (cmd === 'IS_READY') { return void cb(ready); } diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 561a36c95..c9d52d126 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1366,10 +1366,11 @@ define([ channel: channel, }); }); - messenger.on('update', function (info, types) { + messenger.on('update', function (info, types, channel) { sendMessengerEvent('CONTACTS_UPDATE', { types: types, info: info, + channel: channel }); }); messenger.on('friend', function (curvePublic) { diff --git a/www/common/sframe-messenger-inner.js b/www/common/sframe-messenger-inner.js index b277a1e58..31359fd3f 100644 --- a/www/common/sframe-messenger-inner.js +++ b/www/common/sframe-messenger-inner.js @@ -35,7 +35,7 @@ define([], function () { }); sFrameChan.on('EV_CONTACTS_UPDATE', function (data) { _handlers.update.forEach(function (f) { - f(data.info, data.types); + f(data.info, data.types, data.channel); }); }); sFrameChan.on('EV_CONTACTS_FRIEND', function (data) { diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index ffb35d54d..ac390400b 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -234,16 +234,15 @@ Messenger, MessengerUI, Messages) { var name = data.name || Messages.anonymous; var $span = $('', {'class': 'cp-avatar'}); var $rightCol = $('', {'class': 'cp-toolbar-userlist-rightcol'}); - var $nameSpan = $('', {'class': 'cp-toolbar-userlist-name'}).text(name).appendTo($rightCol); + var $nameSpan = $('', {'class': 'cp-toolbar-userlist-name'}).appendTo($rightCol); + var $nameValue = $('', { + 'class': 'cp-toolbar-userlist-name-value' + }).text(name).appendTo($nameSpan); var isMe = data.uid === user.uid; if (isMe && !priv.readOnly) { - $nameSpan.html(''); - var $nameValue = $('', { - 'class': 'cp-toolbar-userlist-name-value' - }).text(name).appendTo($nameSpan); if (!Config.disableProfile) { var $button = $('