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