forked from cory/tildefriends
Fixing various badness as I still can't get rooms to work.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4038 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
10
core/ssb.js
10
core/ssb.js
@ -96,6 +96,9 @@ function tunnel_attendants(request) {
|
||||
|
||||
function send_blobs_create_wants(connection) {
|
||||
connection.send_json({'name': ['blobs', 'createWants'], 'type': 'source', 'args': []}, function on_blob_create_wants(message) {
|
||||
if (message.message?.name === 'Error') {
|
||||
return;
|
||||
}
|
||||
Object.keys(message.message).forEach(function(id) {
|
||||
if (message.message[id] < 0) {
|
||||
if (g_wants_requests[connection.id]) {
|
||||
@ -234,6 +237,9 @@ ssb.addRpc(['tunnel', 'isRoom'], function(request) {
|
||||
});
|
||||
|
||||
function notify_attendant_changed(id, type) {
|
||||
if (!id) {
|
||||
print(`notify_attendant_changed called with id=${id}`);
|
||||
}
|
||||
for (let r of Object.values(g_attendants)) {
|
||||
try {
|
||||
r.send_json({
|
||||
@ -241,8 +247,8 @@ function notify_attendant_changed(id, type) {
|
||||
id: id,
|
||||
});
|
||||
} catch (e) {
|
||||
print(`Removing ${r.connection.id} from g_attendants in ${type}.`, e);
|
||||
delete g_attendants[r.connection.id];
|
||||
print(`Removing ${id} from g_attendants in ${type}.`, e);
|
||||
delete g_attendants[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user