Add friend log to shared feed

This commit is contained in:
Natsumi
2021-01-02 03:37:48 +13:00
parent 8f97714a53
commit 3c451e4876
2 changed files with 53 additions and 0 deletions

View File

@@ -3494,6 +3494,19 @@ speechSynthesis.getVoices();
});
}
}
// TrustLevel, Friend, FriendRequest, Unfriend, DisplayName
var { data } = this.friendLogTable;
var j = this.friendLogTable.data.length;
for (i = j - 1; i >= j - 6; i--) {
var ctx = data[i];
if (ctx.type !== 'FriendRequest') {
arr.push({
...ctx,
isFriend: this.friends.has(ctx.userId),
isFavorite: API.cachedFavoritesByObjectId.has(ctx.userId)
});
}
}
arr.sort(function (a, b) {
if (a.created_at < b.created_at) {
return 1;