Skip to content

Commit 99d93f1

Browse files
committed
tests work only node 16. starting thread stuff
1 parent f57eb86 commit 99d93f1

3 files changed

Lines changed: 45 additions & 3 deletions

File tree

package-lock.json

Lines changed: 27 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
},
5555
"homepage": "https://github.com/solidos/solid-ui",
5656
"dependencies": {
57+
"16": "^0.0.2",
5758
"escape-html": "^1.0.3",
5859
"eslint-plugin-n": "^15.5.1",
5960
"i": "^0.3.7",

src/chat/infinite.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export function insertMessageIntoTable (channelObject, messageTable, message, fr
105105
export async function infiniteMessageArea (dom, wasStore, chatChannel, options) {
106106
// ///////////////////////////////////////////////////////////////////////
107107

108-
function syncMessages (about, messageTable) {
108+
function syncMessages (chatChannel, messageTable) {
109109
const displayed = {}
110110
let ele, ele2
111111
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
@@ -116,7 +116,7 @@ export async function infiniteMessageArea (dom, wasStore, chatChannel, options)
116116

117117
const messages = store
118118
.statementsMatching(
119-
about,
119+
chatChannel,
120120
ns.wf('message'),
121121
null,
122122
messageTable.chatDocument
@@ -155,6 +155,21 @@ export async function infiniteMessageArea (dom, wasStore, chatChannel, options)
155155
if (isDeleted(latest) && !options.showDeletedMessages) {
156156
return // ignore deleted messaged -- @@ could also leave a placeholder
157157
}
158+
if (options.thread) { // only show things in thread
159+
const thread = store.any(message, ns.sioc('has_container'), null, message.doc())
160+
if (message.sameTerm(options.thread)) {
161+
// console.log(' displaying root of thread ' + thread)
162+
} else if (thread.sameTerm(options.thread)) {
163+
// console.log(' displaying body of thread ' + thread)
164+
} else {
165+
return // suppress message not in thread
166+
}
167+
}
168+
169+
// const replyTo = store.any(message, ns.sioc('reply_of'), null, message.doc())
170+
// @@ best thing to do with a reply? Move to after the thing replied to and shift right?
171+
// Sort by originalMessageDate, reply number?
172+
158173
insertMessageIntoTable(channelObject,
159174
messageTable,
160175
message,

0 commit comments

Comments
 (0)