Support selecting a thread and showing related messages (by a rather brute force search). Sort child messages in the reverse order of top level messages, because that's how we roll.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3754 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-01-12 02:55:29 +00:00
parent d51eb64c8e
commit 35b7eb511a
4 changed files with 58 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ function processMessages() {
for (let message of g_data.messages) {
if (root == message.id) {
message.children.push(new_message);
message.children.sort((x, y) => y.timestamp - x.timestamp);
message.children.sort((x, y) => x.timestamp - y.timestamp);
found = true;
}
}
@@ -53,7 +53,7 @@ function processMessages() {
for (let message of g_data.messages) {
if (JSON.parse(message.content).root == new_message.id) {
new_message.children.push(message);
new_message.children.sort((x, y) => y.timestamp - x.timestamp);
new_message.children.sort((x, y) => x.timestamp - y.timestamp);
removed[message.id] = true;
}
}