forked from cory/tildefriends
		
	wiki cruft.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4649 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		| @@ -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)) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user