Merge pull request #30 from shocknet/release

Release
This commit is contained in:
Daniel Lugo 2020-02-18 09:40:07 -04:00 committed by GitHub
commit 04f2fcd10e
2 changed files with 9 additions and 8 deletions

View file

@ -2,6 +2,7 @@
* @format * @format
*/ */
const Gun = require('gun') const Gun = require('gun')
Gun.log = () => {}
// @ts-ignore // @ts-ignore
require('gun/lib/open') require('gun/lib/open')
const debounce = require('lodash/debounce') const debounce = require('lodash/debounce')
@ -792,7 +793,7 @@ class Mediator {
try { try {
const { token } = body const { token } = body
console.log('ON_CHATS', body) // console.log('ON_CHATS', body)
await throwOnInvalidToken(token) await throwOnInvalidToken(token)
@ -894,9 +895,9 @@ class Mediator {
API.Events.onSimplerReceivedRequests(receivedRequests => { API.Events.onSimplerReceivedRequests(receivedRequests => {
if (Config.SHOW_LOG) { if (Config.SHOW_LOG) {
console.log('---receivedRequests---') // console.log('---receivedRequests---')
console.log(receivedRequests) // console.log(receivedRequests)
console.log('-----------------------') // console.log('-----------------------')
} }
this.socket.emit(Event.ON_RECEIVED_REQUESTS, { this.socket.emit(Event.ON_RECEIVED_REQUESTS, {
@ -931,9 +932,9 @@ class Mediator {
API.Events.onSimplerSentRequests( API.Events.onSimplerSentRequests(
debounce(sentRequests => { debounce(sentRequests => {
console.log( // console.log(
`new Reqss in mediator: ${JSON.stringify(sentRequests)}` // `new Reqss in mediator: ${JSON.stringify(sentRequests)}`
) // )
this.socket.emit(Event.ON_SENT_REQUESTS, { this.socket.emit(Event.ON_SENT_REQUESTS, {
msg: sentRequests, msg: sentRequests,
ok: true, ok: true,

View file

@ -6,7 +6,7 @@ const { Buffer } = require('buffer')
const APIKeyPair = new Map() const APIKeyPair = new Map()
const authorizedDevices = new Map() const authorizedDevices = new Map()
const nonEncryptedEvents = ['ping', 'disconnect'] const nonEncryptedEvents = ['ping', 'disconnect', 'IS_GUN_AUTH']
const Encryption = { const Encryption = {
isNonEncrypted: event => nonEncryptedEvents.includes(event), isNonEncrypted: event => nonEncryptedEvents.includes(event),