This app provides no guarantees. Use at your own risk. Any data loss or leaks are not our responsibility even if it was due to using this app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mesh.hear = function(raw, peer){ | |
| if(!raw){ return } | |
| var msg, id, hash, tmp = raw[0]; | |
| if(opt.pack <= raw.length){ return mesh.say({dam: '!', err: "Message too big!"}, peer) } | |
| try{msg = msg || decode(raw); | |
| }catch(e){return opt.log('DAM JSON parse error', e)} | |
| if(msg && Array.isArray(msg)){ | |
| var i = 0, m; | |
| while(m = msg[i++]){ | |
| mesh.hear(m, peer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getList(idxSoul,cb){ | |
| let listOfSouls = {} | |
| let soulsToCheckAgainstUnique = [] | |
| gun.get(idxSoul).once(function(data){ | |
| if(data === undefined){cb.call(cb,listOfSouls); return}//for loop would error if not stopped | |
| for (const soul in data) { | |
| if(soul === '_')continue | |
| if(data[soul] !== null){//not Deleted | |
| //this means `false` will pass through, so archived items will still keep increment and unique values enforced | |
| soulsToCheckAgainstUnique.push(soul) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require('path'); | |
| const express = require('express'); | |
| const Gun = require('gun'); | |
| require('gun/nts') | |
| const port = (process.env.PORT || 8080); | |
| const app = express(); | |
| app.use(Gun.serve); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //CLIENT | |
| Gun.on('opt', function (ctx) { | |
| if (ctx.once) { | |
| return | |
| } | |
| this.to.next(ctx) | |
| ctx.on('auth', function(msg){ | |
| let to = this.to | |
| clientAuth(ctx) | |
| function clientAuth(ctx){ |