Add alias

This commit is contained in:
syuilo 2018-10-10 03:24:09 +09:00
parent db248a69c8
commit 9bebbf4e03
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 2 additions and 1 deletions

View file

@ -170,7 +170,7 @@ abstract class Connection extends EventEmitter {
const type = payload === undefined ? typeOrPayload.type : typeOrPayload; const type = payload === undefined ? typeOrPayload.type : typeOrPayload;
const body = payload === undefined ? typeOrPayload.body : payload; const body = payload === undefined ? typeOrPayload.body : payload;
this.stream.send('channel', { this.stream.send('ch', {
id: this.id, id: this.id,
type: type, type: type,
body: body body: body

View file

@ -58,6 +58,7 @@ export default class Connection {
case 'connect': this.onChannelConnectRequested(body); break; case 'connect': this.onChannelConnectRequested(body); break;
case 'disconnect': this.onChannelDisconnectRequested(body); break; case 'disconnect': this.onChannelDisconnectRequested(body); break;
case 'channel': this.onChannelMessageRequested(body); break; case 'channel': this.onChannelMessageRequested(body); break;
case 'ch': this.onChannelMessageRequested(body); break; // alias
} }
} }