server: emit full params object on server events

Fixes #81
This commit is contained in:
Feross Aboukhadijeh 2015-06-24 01:48:59 -07:00
parent ac17ed7d24
commit 67291edfb3

View File

@ -222,7 +222,7 @@ Server.prototype.onHttpRequest = function (req, res, opts) {
res.end(bencode.encode(response))
if (params.action === common.ACTIONS.ANNOUNCE) {
self.emit(common.EVENT_NAMES[params.event], params.addr)
self.emit(common.EVENT_NAMES[params.event], params.addr, params)
}
})
}
@ -262,7 +262,7 @@ Server.prototype.onUdpRequest = function (msg, rinfo) {
}
if (params.action === common.ACTIONS.ANNOUNCE) {
self.emit(common.EVENT_NAMES[params.event], params.addr)
self.emit(common.EVENT_NAMES[params.event], params.addr, params)
}
})
}
@ -350,7 +350,7 @@ Server.prototype._onWebSocketRequest = function (socket, params) {
}
if (params.action === common.ACTIONS.ANNOUNCE) {
self.emit(common.EVENT_NAMES[params.event], params.peer_id)
self.emit(common.EVENT_NAMES[params.event], params.peer_id, params)
}
})
}