forked from cory/tildefriends
Create a util.js.{h,c} from some common things.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3681 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
12
core/ssb.js
12
core/ssb.js
@ -52,11 +52,11 @@ var g_database = new Database('core');
|
||||
|
||||
async function test_following() {
|
||||
try {
|
||||
debug_print("I AM", await ssb.whoami());
|
||||
print("I AM", await ssb.whoami());
|
||||
var result = await followingDeep(g_database, [await ssb.whoami()], 1);
|
||||
debug_print("following ", JSON.stringify(result));
|
||||
print("following ", JSON.stringify(result));
|
||||
} catch (e) {
|
||||
debug_print("DOH", e, e.stack);
|
||||
print("DOH", e, e.stack);
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ ssb.registerConnectionsChanged(function(change, connection) {
|
||||
g_wants_requests[connection.id].send_json(out_message);
|
||||
}
|
||||
} else {
|
||||
debug_print("blobs.get", id);
|
||||
print("blobs.get", id);
|
||||
var received_bytes = 0;
|
||||
var expected_bytes = message.message[id];
|
||||
var buffer = new Uint8Array(expected_bytes);
|
||||
@ -114,10 +114,10 @@ ssb.registerConnectionsChanged(function(change, connection) {
|
||||
}
|
||||
});
|
||||
} else if (change == 'remove') {
|
||||
debug_print('REMOVE', connection.id);
|
||||
print('REMOVE', connection.id);
|
||||
delete g_wants_requests[connection.id];
|
||||
} else {
|
||||
debug_print('CHANGE', change);
|
||||
print('CHANGE', change);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user