ssbc / ssb-server

The gossip and replication server for Secure Scuttlebutt - a distributed social network
1.69k stars 164 forks source link

`sbot invite.addMe` does not work #312

Closed myf closed 8 years ago

myf commented 8 years ago

according to the docs sbot invite.addMe is an alias to sbot invite.accept. when i execute this command with a valid invitation code I got the following error:

node sbot.js invite.addMe [omitting actual invite code]

{ message: 'this.accept is not a function',
  name: 'TypeError',
  stack: 'TypeError: this.accept is not a function
    at EventEmitter.<anonymous> (/home/myf/modules/scuttlebot/plugins/invite.js:120:21)
    at apply (/home/myf/modules/scuttlebot/node_modules/muxrpc-validation/index.js:173:15)
    at EventEmitter.<anonymous> (/home/myf/modules/scuttlebot/node_modules/muxrpc-validation/index.js:82:14)
    at EventEmitter.hooked (/home/myf/modules/scuttlebot/node_modules/hoox/index.js:10:15)
    at Object.PacketStream.request (/home/myf/modules/scuttlebot/node_modules/secret-stack/node_modules/muxrpc/index.js:102:27)
    at PacketStream._onrequest (/home/myf/modules/scuttlebot/node_modules/packet-stream/index.js:149:17)
    at PacketStream.write (/home/myf/modules/scuttlebot/node_modules/packet-stream/index.js:122:41)
    at /home/myf/modules/scuttlebot/node_modules/secret-stack/node_modules/muxrpc/pull-weird.js:55:15
    at /home/myf/modules/scuttlebot/node_modules/secret-stack/node_modules/pull-stream/sinks.js:15:33
    at /home/myf/modules/scuttlebot/node_modules/pull-stream/throughs.js:73:11' }
Alias for accept.
dominictarr commented 8 years ago

does it work if you use accept?

myf commented 8 years ago

@dominictarr yes

dominictarr commented 8 years ago

okay lets just remove addMe then, @pfraze what do yo think?

myf commented 8 years ago

ah i think the problem is the scope, one sec

myf commented 8 years ago

it's this line here https://github.com/ssbc/scuttlebot/blob/master/plugins/invite.js#L120 where this has a different scope? this.invite.accept might make sense but i don't quite understand what's going on here

..but it doesn't really matter that much if it's just an alias

pfrazee commented 8 years ago

@myf's PR fixes it, but it might be a good idea to cut the function.

dominictarr commented 8 years ago

obviously no one else was using it because otherwise we would have heard about this issue already. lets just remove it.

myf commented 8 years ago

I am cool with that too, a bit redundant. This is to show this was not used properly. On Mar 4, 2016 10:11 PM, "Dominic Tarr" notifications@github.com wrote:

obviously no one else was using it because otherwise we would have heard about this issue already. lets just remove it.

— Reply to this email directly or view it on GitHub https://github.com/ssbc/scuttlebot/issues/312#issuecomment-192557119.

dominictarr commented 8 years ago

cool, will remove then.

dominictarr commented 8 years ago

fixed in 7.6.2