Make the friends list from the share modal reusable

This commit is contained in:
yflory
2019-08-28 15:29:38 +02:00
parent 28b2341f2c
commit f6762f7c01
8 changed files with 256 additions and 126 deletions

View File

@@ -422,12 +422,12 @@ define([
return JSON.parse(JSON.stringify(friendRequests));
};
funcs.getFriends = function () {
funcs.getFriends = function (meIncluded) {
var priv = ctx.metadataMgr.getPrivateData();
var friends = priv.friends;
var goodFriends = {};
Object.keys(friends).forEach(function (curve) {
if (curve.length !== 44) { return; }
if (curve.length !== 44 && !meIncluded) { return; }
var data = friends[curve];
if (!data.notifications) { return; }
goodFriends[curve] = friends[curve];