wiki cruft.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4649 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-11-27 17:23:48 +00:00
parent 625504b8eb
commit d96e0a7497
2 changed files with 1 additions and 10 deletions

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "📝",
"previous": "&LCMT+xWf3xEYwQ7HLx9AUHuj0wTHOn2Ux0uUz8Anlu4=.sha256"
"previous": "&2HYCsRnzXWQTE/oFrSARWDr/Uv7teWHqQASdSG68gfw=.sha256"
}

View File

@ -40,17 +40,13 @@ async function process_message(whoami, collection, message, kind, parent) {
}
export async function collection(ids, kind, parent, max_rowid, data, include_private) {
print('COLLECTION?');
let whoami = await ssb.getIdentities();
print('WHOAMI', whoami);
data = data ?? {};
let rowid = 0;
let first = true;
print('CHECKING', kind, ids);
await ssb.sqlAsync('SELECT MAX(rowid) AS rowid FROM messages', [], function(row) {
rowid = row.rowid;
});
print('one');
while (true) {
if (rowid == max_rowid) {
await new_message();
@ -59,12 +55,9 @@ export async function collection(ids, kind, parent, max_rowid, data, include_pri
});
first = false;
}
print('two');
let modified = false;
let rows = [];
print(include_private ? true: false, ids);
print(JSON.stringify([JSON.stringify(ids), max_rowid ?? -1, rowid, kind, parent, include_private ? true : false]));
await ssb.sqlAsync(`
SELECT messages.id, author, content, timestamp
FROM messages
@ -77,10 +70,8 @@ export async function collection(ids, kind, parent, max_rowid, data, include_pri
(?6 AND content LIKE '"%'))
ORDER BY timestamp
`, [JSON.stringify(ids), max_rowid ?? -1, rowid, kind, parent, include_private ? true : false], function(row) {
print('three');
rows.push(row);
});
print('done');
max_rowid = rowid;
for (let row of rows) {
if (await process_message(whoami, data, row, kind, parent)) {