mirror of
https://github.com/amark/gun.git
synced 2025-06-07 06:36:46 +00:00
patch + update .mesh
to _
This commit is contained in:
parent
80153d9d9b
commit
111953a1bf
21
gun.js
21
gun.js
@ -959,7 +959,6 @@
|
|||||||
|
|
||||||
function output(msg){
|
function output(msg){
|
||||||
var put, get, at = this.as, back = at.back, root = at.root, tmp;
|
var put, get, at = this.as, back = at.back, root = at.root, tmp;
|
||||||
if(!msg.I){ msg.I = at.$ }
|
|
||||||
if(!msg.$){ msg.$ = at.$ }
|
if(!msg.$){ msg.$ = at.$ }
|
||||||
this.to.next(msg);
|
this.to.next(msg);
|
||||||
if(get = msg.get){
|
if(get = msg.get){
|
||||||
@ -1215,7 +1214,6 @@
|
|||||||
at.on('in', {get: at.get, put: Gun.val.link.ify(get['#']), $: at.$, '@': msg['@']});
|
at.on('in', {get: at.get, put: Gun.val.link.ify(get['#']), $: at.$, '@': msg['@']});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
msg.$ = at.root.$;
|
|
||||||
Gun.on.put(msg, at.root.$);
|
Gun.on.put(msg, at.root.$);
|
||||||
}
|
}
|
||||||
var empty = {}, u;
|
var empty = {}, u;
|
||||||
@ -1312,7 +1310,7 @@
|
|||||||
//else if(!cat.async && msg.put !== at.put && root.stop && root.stop[at.id]){ return } root.stop && (root.stop[at.id] = true);
|
//else if(!cat.async && msg.put !== at.put && root.stop && root.stop[at.id]){ return } root.stop && (root.stop[at.id] = true);
|
||||||
|
|
||||||
|
|
||||||
//root.stop && (root.stop.ID = root.stop.ID || Gun.text.random(2));
|
//root.stop && (root.stop.id = root.stop.id || Gun.text.random(2));
|
||||||
//if((tmp = root.stop) && (tmp = tmp[at.id] || (tmp[at.id] = {})) && tmp[cat.id]){ return } tmp && (tmp[cat.id] = true);
|
//if((tmp = root.stop) && (tmp = tmp[at.id] || (tmp[at.id] = {})) && tmp[cat.id]){ return } tmp && (tmp[cat.id] = true);
|
||||||
if(eve.seen && at.id && eve.seen[at.id]){ return eve.to.next(msg) }
|
if(eve.seen && at.id && eve.seen[at.id]){ return eve.to.next(msg) }
|
||||||
//if((tmp = root.stop)){ if(tmp[at.id]){ return } tmp[at.id] = msg.root; } // temporary fix till a better solution?
|
//if((tmp = root.stop)){ if(tmp[at.id]){ return } tmp[at.id] = msg.root; } // temporary fix till a better solution?
|
||||||
@ -1812,7 +1810,7 @@
|
|||||||
|
|
||||||
root.on('out', function(msg){
|
root.on('out', function(msg){
|
||||||
if(msg.lS){ return }
|
if(msg.lS){ return }
|
||||||
if(msg.I && msg.put && !msg['@'] && !empty(opt.peers)){
|
if(Gun.is(msg.$) && msg.put && !msg['@'] && !empty(opt.peers)){
|
||||||
id = msg['#'];
|
id = msg['#'];
|
||||||
Gun.graph.is(msg.put, null, map);
|
Gun.graph.is(msg.put, null, map);
|
||||||
if(!to){ to = setTimeout(flush, opt.wait || 1) }
|
if(!to){ to = setTimeout(flush, opt.wait || 1) }
|
||||||
@ -1888,7 +1886,7 @@
|
|||||||
return; // Hmm, what if we have peers but we are disconnected?
|
return; // Hmm, what if we have peers but we are disconnected?
|
||||||
}
|
}
|
||||||
//console.log("lS get", lex, data);
|
//console.log("lS get", lex, data);
|
||||||
root.on('in', {'@': msg['#'], put: Gun.graph.node(data), how: 'lS', lS: msg.I});
|
root.on('in', {'@': msg['#'], put: Gun.graph.node(data), how: 'lS', lS: msg.$ || root.$});
|
||||||
};
|
};
|
||||||
Gun.debug? setTimeout(to,1) : to();
|
Gun.debug? setTimeout(to,1) : to();
|
||||||
});
|
});
|
||||||
@ -1938,8 +1936,8 @@
|
|||||||
if((tmp = msg['@'])
|
if((tmp = msg['@'])
|
||||||
&& (tmp = ctx.dup.s[tmp])
|
&& (tmp = ctx.dup.s[tmp])
|
||||||
&& (tmp = tmp.it)
|
&& (tmp = tmp.it)
|
||||||
&& tmp.mesh){
|
&& tmp._){
|
||||||
mesh.say(msg, tmp.mesh.via, 1);
|
mesh.say(msg, (tmp._).via, 1);
|
||||||
tmp['##'] = msg['##'];
|
tmp['##'] = msg['##'];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1971,9 +1969,9 @@
|
|||||||
(tmp = dup.s)[hash] = tmp[id];
|
(tmp = dup.s)[hash] = tmp[id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(msg.mesh = function(){}).via = peer;
|
(msg._ = function(){}).via = peer;
|
||||||
if((tmp = msg['><'])){
|
if((tmp = msg['><'])){
|
||||||
msg.mesh.to = Type.obj.map(tmp.split(','), function(k,i,m){m(k,true)});
|
(msg._).to = Type.obj.map(tmp.split(','), function(k,i,m){m(k,true)});
|
||||||
}
|
}
|
||||||
if(msg.dam){
|
if(msg.dam){
|
||||||
if(tmp = mesh.hear[msg.dam]){
|
if(tmp = mesh.hear[msg.dam]){
|
||||||
@ -1981,7 +1979,6 @@
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.on('in', msg);
|
ctx.on('in', msg);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -2012,7 +2009,7 @@
|
|||||||
}
|
}
|
||||||
var tmp, wire = peer.wire || ((opt.wire) && opt.wire(peer)), msh, raw;// || open(peer, ctx); // TODO: Reopen!
|
var tmp, wire = peer.wire || ((opt.wire) && opt.wire(peer)), msh, raw;// || open(peer, ctx); // TODO: Reopen!
|
||||||
if(!wire){ return }
|
if(!wire){ return }
|
||||||
msh = msg.mesh || empty;
|
msh = (msg._) || empty;
|
||||||
if(peer === msh.via){ return }
|
if(peer === msh.via){ return }
|
||||||
if(!(raw = msh.raw)){ raw = mesh.raw(msg) }
|
if(!(raw = msh.raw)){ raw = mesh.raw(msg) }
|
||||||
if((tmp = msg['@'])
|
if((tmp = msg['@'])
|
||||||
@ -2063,7 +2060,7 @@
|
|||||||
|
|
||||||
mesh.raw = function(msg){
|
mesh.raw = function(msg){
|
||||||
if(!msg){ return '' }
|
if(!msg){ return '' }
|
||||||
var dup = ctx.dup, msh = msg.mesh || {}, put, hash, tmp;
|
var dup = ctx.dup, msh = (msg._) || {}, put, hash, tmp;
|
||||||
if(tmp = msh.raw){ return tmp }
|
if(tmp = msh.raw){ return tmp }
|
||||||
if(typeof msg === 'string'){ return msg }
|
if(typeof msg === 'string'){ return msg }
|
||||||
if(msg['@'] && (tmp = msg.put)){
|
if(msg['@'] && (tmp = msg.put)){
|
||||||
|
@ -3,16 +3,11 @@ var Gun = (typeof window !== "undefined")? window.Gun : require('../gun');
|
|||||||
Gun.on('create', function(root){
|
Gun.on('create', function(root){
|
||||||
this.to.next(root);
|
this.to.next(root);
|
||||||
var opt = root.opt, u;
|
var opt = root.opt, u;
|
||||||
if(typeof window !== "undefined"){
|
|
||||||
opt.window = window;
|
|
||||||
}
|
|
||||||
//if(true !== opt.radisk && (!opt.window && !process.env.RAD_ENV && !process.env.AWS_S3_BUCKET) && false !== opt.localStorage){ return }
|
|
||||||
//if(true !== opt.radisk){ return }
|
|
||||||
if(false === opt.radisk){ return }
|
if(false === opt.radisk){ return }
|
||||||
var Radisk = (opt.window && opt.window.Radisk) || require('./radisk');
|
var Radisk = (Gun.window && Gun.window.Radisk) || require('./radisk');
|
||||||
var Radix = Radisk.Radix;
|
var Radix = Radisk.Radix;
|
||||||
|
|
||||||
opt.store = opt.store || (!opt.window && require('./rfs')(opt));
|
opt.store = opt.store || (!Gun.window && require('./rfs')(opt));
|
||||||
var rad = Radisk(opt), esc = String.fromCharCode(27);
|
var rad = Radisk(opt), esc = String.fromCharCode(27);
|
||||||
|
|
||||||
root.on('put', function(msg){
|
root.on('put', function(msg){
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
opt.RTCPeerConnection = rtcpc;
|
opt.RTCPeerConnection = rtcpc;
|
||||||
opt.RTCSessionDescription = rtcsd;
|
opt.RTCSessionDescription = rtcsd;
|
||||||
opt.RTCIceCandidate = rtcic;
|
opt.RTCIceCandidate = rtcic;
|
||||||
opt.webrtc = opt.webrtc || {'iceServers': [
|
opt.rtc = opt.rtc || {'iceServers': [
|
||||||
{url: 'stun:stun.l.google.com:19302'},
|
{url: 'stun:stun.l.google.com:19302'},
|
||||||
{url: "stun:stun.sipgate.net:3478"},
|
{url: "stun:stun.sipgate.net:3478"},
|
||||||
{url: "stun:stun.stunprotocol.org"},
|
{url: "stun:stun.stunprotocol.org"},
|
||||||
@ -28,33 +28,33 @@
|
|||||||
{url: "stun:217.10.68.152:10000"},
|
{url: "stun:217.10.68.152:10000"},
|
||||||
{url: 'stun:stun.services.mozilla.com'}
|
{url: 'stun:stun.services.mozilla.com'}
|
||||||
]};
|
]};
|
||||||
opt.webrtc.dataChannel = opt.webrtc.dataChannel || {ordered: false, maxRetransmits: 2};
|
opt.rtc.dataChannel = opt.rtc.dataChannel || {ordered: false, maxRetransmits: 2};
|
||||||
opt.webrtc.sdp = opt.webrtc.sdp || {mandatory: {OfferToReceiveAudio: false, OfferToReceiveVideo: false}};
|
opt.rtc.sdp = opt.rtc.sdp || {mandatory: {OfferToReceiveAudio: false, OfferToReceiveVideo: false}};
|
||||||
|
|
||||||
var mesh = opt.mesh = opt.mesh || Gun.Mesh(root);
|
var mesh = opt.mesh = opt.mesh || Gun.Mesh(root);
|
||||||
root.on('create', function(at){
|
root.on('create', function(at){
|
||||||
this.to.next(at);
|
this.to.next(at);
|
||||||
setTimeout(function(){ root.on('out', {webrtc: {id: opt.pid}}) },1); // announce ourself
|
setTimeout(function(){ root.on('out', {rtc: {id: opt.pid}}) },1); // announce ourself
|
||||||
});
|
});
|
||||||
root.on('in', function(msg){
|
root.on('in', function(msg){
|
||||||
if(msg.webrtc){ open(msg) }
|
if(msg.rtc){ open(msg) }
|
||||||
this.to.next(msg);
|
this.to.next(msg);
|
||||||
});
|
});
|
||||||
|
|
||||||
function open(msg){
|
function open(msg){
|
||||||
var rtc = msg.webrtc, peer, tmp;
|
var rtc = msg.rtc, peer, tmp;
|
||||||
if(!rtc || !rtc.id){ return }
|
if(!rtc || !rtc.id){ return }
|
||||||
if(tmp = rtc.answer){
|
if(tmp = rtc.answer){
|
||||||
if(!(peer = opt.peers[rtc.id]) || peer.remoteSet){ return }
|
if(!(peer = opt.peers[rtc.id]) || peer.remoteSet){ return }
|
||||||
return peer.setRemoteDescription(peer.remoteSet = new opt.RTCSessionDescription(tmp));
|
return peer.setRemoteDescription(peer.remoteSet = new opt.RTCSessionDescription(tmp));
|
||||||
}
|
}
|
||||||
if(tmp = rtc.candidate){
|
if(tmp = rtc.candidate){
|
||||||
peer = opt.peers[rtc.id] || open({webrtc: {id: rtc.id}});
|
peer = opt.peers[rtc.id] || open({rtc: {id: rtc.id}});
|
||||||
return peer.addIceCandidate(new opt.RTCIceCandidate(tmp));
|
return peer.addIceCandidate(new opt.RTCIceCandidate(tmp));
|
||||||
}
|
}
|
||||||
if(opt.peers[rtc.id]){ return }
|
if(opt.peers[rtc.id]){ return }
|
||||||
(peer = new opt.RTCPeerConnection(opt.webrtc)).id = rtc.id;
|
(peer = new opt.RTCPeerConnection(opt.rtc)).id = rtc.id;
|
||||||
var wire = peer.wire = peer.createDataChannel('dc', opt.webrtc.dataChannel);
|
var wire = peer.wire = peer.createDataChannel('dc', opt.rtc.dataChannel);
|
||||||
mesh.hi(peer);
|
mesh.hi(peer);
|
||||||
wire.onclose = function(){
|
wire.onclose = function(){
|
||||||
mesh.bye(peer);
|
mesh.bye(peer);
|
||||||
@ -77,7 +77,7 @@
|
|||||||
};
|
};
|
||||||
peer.onicecandidate = function(e){ // source: EasyRTC!
|
peer.onicecandidate = function(e){ // source: EasyRTC!
|
||||||
if(!e.candidate){ return }
|
if(!e.candidate){ return }
|
||||||
root.on('out', {'@': msg['#'], webrtc: {candidate: e.candidate, id: opt.pid}});
|
root.on('out', {'@': msg['#'], rtc: {candidate: e.candidate, id: opt.pid}});
|
||||||
}
|
}
|
||||||
peer.ondatachannel = function(e){
|
peer.ondatachannel = function(e){
|
||||||
var rc = e.channel;
|
var rc = e.channel;
|
||||||
@ -89,14 +89,14 @@
|
|||||||
peer.setRemoteDescription(new opt.RTCSessionDescription(tmp));
|
peer.setRemoteDescription(new opt.RTCSessionDescription(tmp));
|
||||||
peer.createAnswer(function(answer){
|
peer.createAnswer(function(answer){
|
||||||
peer.setLocalDescription(answer);
|
peer.setLocalDescription(answer);
|
||||||
root.on('out', {'@': msg['#'], webrtc: {answer: answer, id: opt.pid}});
|
root.on('out', {'@': msg['#'], rtc: {answer: answer, id: opt.pid}});
|
||||||
}, function(){}, opt.webrtc.sdp);
|
}, function(){}, opt.rtc.sdp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
peer.createOffer(function(offer){
|
peer.createOffer(function(offer){
|
||||||
peer.setLocalDescription(offer);
|
peer.setLocalDescription(offer);
|
||||||
root.on('out', {'@': msg['#'], webrtc: {offer: offer, id: opt.pid}});
|
root.on('out', {'@': msg['#'], rtc: {offer: offer, id: opt.pid}});
|
||||||
}, function(){}, opt.webrtc.sdp);
|
}, function(){}, opt.rtc.sdp);
|
||||||
return peer;
|
return peer;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
2
nts.js
2
nts.js
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
Gun.state.drift = Gun.state.drift || 0;
|
Gun.state.drift = Gun.state.drift || 0;
|
||||||
setTimeout(function ping(){
|
setTimeout(function ping(){
|
||||||
var NTS = {}, ack = Gun.text.random(), msg = {'#': ack, nts: true, gun: ctx.gun};
|
var NTS = {}, ack = Gun.text.random(), msg = {'#': ack, nts: true};
|
||||||
NTS.start = Gun.state();
|
NTS.start = Gun.state();
|
||||||
ask[ack] = function(at){
|
ask[ack] = function(at){
|
||||||
NTS.end = Gun.state();
|
NTS.end = Gun.state();
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gun",
|
"name": "gun",
|
||||||
"version": "0.9.999997",
|
"version": "0.9.999998",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gun",
|
"name": "gun",
|
||||||
"version": "0.9.999997",
|
"version": "0.9.999998",
|
||||||
"description": "A realtime, decentralized, offline-first, graph data synchronization engine.",
|
"description": "A realtime, decentralized, offline-first, graph data synchronization engine.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"browser": "gun.min.js",
|
"browser": "gun.min.js",
|
||||||
|
61
sea.js
61
sea.js
@ -1108,11 +1108,11 @@
|
|||||||
|
|
||||||
// signature handles data output, it is a proxy to the security function.
|
// signature handles data output, it is a proxy to the security function.
|
||||||
function signature(msg){
|
function signature(msg){
|
||||||
if(msg.user){
|
if((msg._||noop).user){
|
||||||
return this.to.next(msg);
|
return this.to.next(msg);
|
||||||
}
|
}
|
||||||
var ctx = this.as;
|
var ctx = this.as;
|
||||||
msg.user = ctx.user;
|
(msg._||(msg._=function(){})).user = ctx.user;
|
||||||
security.call(this, msg);
|
security.call(this, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1153,9 +1153,9 @@
|
|||||||
each.pubs(val, key, node, soul); return;
|
each.pubs(val, key, node, soul); return;
|
||||||
}
|
}
|
||||||
if('~' === soul.slice(0,1) && 2 === (tmp = soul.slice(1)).split('.').length){ // special case, account data for a public key.
|
if('~' === soul.slice(0,1) && 2 === (tmp = soul.slice(1)).split('.').length){ // special case, account data for a public key.
|
||||||
each.pub(val, key, node, soul, tmp, msg.user); return;
|
each.pub(val, key, node, soul, tmp, (msg._||noop).user); return;
|
||||||
}
|
}
|
||||||
each.any(val, key, node, soul, msg.user); return;
|
each.any(val, key, node, soul, (msg._||noop).user); return;
|
||||||
return each.end({err: "No other data allowed!"});
|
return each.end({err: "No other data allowed!"});
|
||||||
};
|
};
|
||||||
each.alias = function(val, key, node, soul){ // Example: {_:#~@, ~@alice: {#~@alice}}
|
each.alias = function(val, key, node, soul){ // Example: {_:#~@, ~@alice: {#~@alice}}
|
||||||
@ -1174,7 +1174,7 @@
|
|||||||
return each.end({err: "Account must match!"});
|
return each.end({err: "Account must match!"});
|
||||||
}
|
}
|
||||||
check['user'+soul+key] = 1;
|
check['user'+soul+key] = 1;
|
||||||
if(msg.I && user && user.is && pub === user.is.pub){
|
if(Gun.is(msg.$) && user && user.is && pub === user.is.pub){
|
||||||
SEA.sign(SEA.opt.prep(tmp = SEA.opt.parse(val), key, node, soul), (user._).sea, function(data){ var rel;
|
SEA.sign(SEA.opt.prep(tmp = SEA.opt.parse(val), key, node, soul), (user._).sea, function(data){ var rel;
|
||||||
if(u === data){ return each.end({err: SEA.err || 'Pub signature fail.'}) }
|
if(u === data){ return each.end({err: SEA.err || 'Pub signature fail.'}) }
|
||||||
if(rel = Gun.val.link.is(val)){
|
if(rel = Gun.val.link.is(val)){
|
||||||
@ -1199,20 +1199,12 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
each.any = function(val, key, node, soul, user){ var tmp, pub;
|
each.any = function(val, key, node, soul, user){ var tmp, pub;
|
||||||
if(!user || !user.is){
|
if(!(pub = SEA.opt.pub(soul))){
|
||||||
if(tmp = SEA.opt.pub(soul)){
|
if(at.opt.secure){
|
||||||
check['any'+soul+key] = 1;
|
each.end({err: "Soul is missing public key at '" + key + "'."});
|
||||||
SEA.verify(SEA.opt.pack(val,key,node,soul), pub = tmp, function(data){ var rel;
|
|
||||||
data = SEA.opt.unpack(data, key, node);
|
|
||||||
if(u === data){ return each.end({err: "Mismatched owner on '" + key + "'."}) } // thanks @rogowski !
|
|
||||||
if((rel = Gun.val.link.is(data)) && pub === SEA.opt.pub(rel)){
|
|
||||||
(at.sea.own[rel] = at.sea.own[rel] || {})[pub] = true;
|
|
||||||
}
|
|
||||||
check['any'+soul+key] = 0;
|
|
||||||
each.end({ok: 1});
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// TODO: Ask community if should auto-sign non user-graph data.
|
||||||
check['any'+soul+key] = 1;
|
check['any'+soul+key] = 1;
|
||||||
at.on('secure', function(msg){ this.off();
|
at.on('secure', function(msg){ this.off();
|
||||||
check['any'+soul+key] = 0;
|
check['any'+soul+key] = 0;
|
||||||
@ -1222,24 +1214,7 @@
|
|||||||
//each.end({err: "Data cannot be modified."});
|
//each.end({err: "Data cannot be modified."});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!(tmp = SEA.opt.pub(soul))){
|
if(Gun.is(msg.$) && user && user.is && pub === user.is.pub){
|
||||||
if(at.opt.secure){
|
|
||||||
each.end({err: "Soul is missing public key at '" + key + "'."});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// TODO: Ask community if should auto-sign non user-graph data.
|
|
||||||
check['any'+soul+key] = 0;
|
|
||||||
each.end({ok: 1});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(!msg.I){ // only sign data put out from this instance.
|
|
||||||
each.any(val, key, node, soul);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if((pub = tmp) !== (user.is||noop).pub){
|
|
||||||
each.any(val, key, node, soul);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/*var other = Gun.obj.map(at.sea.own[soul], function(v, p){
|
/*var other = Gun.obj.map(at.sea.own[soul], function(v, p){
|
||||||
if((user.is||{}).pub !== p){ return p }
|
if((user.is||{}).pub !== p){ return p }
|
||||||
});
|
});
|
||||||
@ -1254,6 +1229,18 @@
|
|||||||
check['any'+soul+key] = 0;
|
check['any'+soul+key] = 0;
|
||||||
each.end({ok: 1});
|
each.end({ok: 1});
|
||||||
}, {check: SEA.opt.pack(tmp, key, node, soul), raw: 1});
|
}, {check: SEA.opt.pack(tmp, key, node, soul), raw: 1});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
check['any'+soul+key] = 1;
|
||||||
|
SEA.verify(SEA.opt.pack(val,key,node,soul), pub, function(data){ var rel;
|
||||||
|
data = SEA.opt.unpack(data, key, node);
|
||||||
|
if(u === data){ return each.end({err: "Mismatched owner on '" + key + "'."}) } // thanks @rogowski !
|
||||||
|
if((rel = Gun.val.link.is(data)) && pub === SEA.opt.pub(rel)){
|
||||||
|
(at.sea.own[rel] = at.sea.own[rel] || {})[pub] = true;
|
||||||
|
}
|
||||||
|
check['any'+soul+key] = 0;
|
||||||
|
each.end({ok: 1});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
each.end = function(ctx){ // TODO: Can't you just switch this to each.end = cb?
|
each.end = function(ctx){ // TODO: Can't you just switch this to each.end = cb?
|
||||||
if(each.err){ return }
|
if(each.err){ return }
|
||||||
@ -1265,7 +1252,7 @@
|
|||||||
if(Gun.obj.map(check, function(no){
|
if(Gun.obj.map(check, function(no){
|
||||||
if(no){ return true }
|
if(no){ return true }
|
||||||
})){ return }
|
})){ return }
|
||||||
msg.user = at.user; // already been through firewall, does not need to again on out.
|
(msg._||{}).user = at.user || security; // already been through firewall, does not need to again on out.
|
||||||
to.next(msg);
|
to.next(msg);
|
||||||
};
|
};
|
||||||
Gun.obj.map(msg.put, each.node);
|
Gun.obj.map(msg.put, each.node);
|
||||||
@ -1306,7 +1293,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEA.opt.shuffle_attack = 1546329600000; // Jan 1, 2019
|
SEA.opt.shuffle_attack = 1546329600000; // Jan 1, 2019
|
||||||
var noop = {}, u;
|
var noop = function(){}, u;
|
||||||
var fl = Math.floor; // TODO: Still need to fix inconsistent state issue.
|
var fl = Math.floor; // TODO: Still need to fix inconsistent state issue.
|
||||||
var rel_is = Gun.val.rel.is;
|
var rel_is = Gun.val.rel.is;
|
||||||
// TODO: Potential bug? If pub/priv key starts with `-`? IDK how possible.
|
// TODO: Potential bug? If pub/priv key starts with `-`? IDK how possible.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user