Pin the chat channels
This commit is contained in:
parent
c096872467
commit
1c531ccd47
@ -50,6 +50,15 @@ define([
|
|||||||
return proxy.friends || {};
|
return proxy.friends || {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Msg.getFriendChannelsList = function (common) {
|
||||||
|
var friends = getFriendList(common);
|
||||||
|
var list = [];
|
||||||
|
Object.keys(friends).forEach(function (key) {
|
||||||
|
list.push(friends[key].channel);
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
};
|
||||||
|
|
||||||
// Messaging tools
|
// Messaging tools
|
||||||
|
|
||||||
var avatars = {};
|
var avatars = {};
|
||||||
@ -332,7 +341,9 @@ define([
|
|||||||
if (friends[pubKey]) { return void cb("E_EXISTS"); }
|
if (friends[pubKey]) { return void cb("E_EXISTS"); }
|
||||||
|
|
||||||
friends[pubKey] = data;
|
friends[pubKey] = data;
|
||||||
common.whenRealtimeSyncs(common.getRealtime(), cb);
|
common.whenRealtimeSyncs(common.getRealtime(), function () {
|
||||||
|
common.pinPads([data.channel], cb);
|
||||||
|
});
|
||||||
common.changeDisplayName(proxy[common.displayNameKey]);
|
common.changeDisplayName(proxy[common.displayNameKey]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -116,6 +116,7 @@ define([
|
|||||||
common.inviteFromUserlist = Messaging.inviteFromUserlist;
|
common.inviteFromUserlist = Messaging.inviteFromUserlist;
|
||||||
common.createOwnedChannel = Messaging.createOwnedChannel;
|
common.createOwnedChannel = Messaging.createOwnedChannel;
|
||||||
common.getFriendList = Messaging.getFriendList;
|
common.getFriendList = Messaging.getFriendList;
|
||||||
|
common.getFriendChannelsList = Messaging.getFriendChannelsList;
|
||||||
common.getFriendListUI = Messaging.getFriendListUI;
|
common.getFriendListUI = Messaging.getFriendListUI;
|
||||||
common.createData = Messaging.createData;
|
common.createData = Messaging.createData;
|
||||||
|
|
||||||
@ -751,6 +752,11 @@ define([
|
|||||||
if (avatarChan) { list.push(avatarChan); }
|
if (avatarChan) { list.push(avatarChan); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getProxy().friends) {
|
||||||
|
var fList = common.getFriendChannelsList(common);
|
||||||
|
list = list.concat(fList);
|
||||||
|
}
|
||||||
|
|
||||||
list.push(common.base64ToHex(userChannel));
|
list.push(common.base64ToHex(userChannel));
|
||||||
list.sort();
|
list.sort();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user