diff --git a/src/connection/connection.js b/src/connection/connection.js index ae459b5..5dae842 100644 --- a/src/connection/connection.js +++ b/src/connection/connection.js @@ -155,7 +155,11 @@ class Connection extends EventEmitter { const bufferReader = new BufferReader(frame); const responseCode = bufferReader.readByte(); - if(responseCode === Constants.ResponseCodes.SelfInfo){ + if(responseCode === Constants.ResponseCodes.Ok){ + this.onOkResponse(bufferReader); + } else if(responseCode === Constants.ResponseCodes.Err){ + this.onErrResponse(bufferReader); + } else if(responseCode === Constants.ResponseCodes.SelfInfo){ this.onSelfInfoResponse(bufferReader); } else if(responseCode === Constants.ResponseCodes.CurrTime){ this.onCurrTimeResponse(bufferReader); @@ -212,6 +216,18 @@ class Connection extends EventEmitter { }); } + onOkResponse(bufferReader) { + this.emit(Constants.ResponseCodes.Ok, { + + }); + } + + onErrResponse(bufferReader) { + this.emit(Constants.ResponseCodes.Err, { + + }); + } + onContactsStartResponse(bufferReader) { this.emit(Constants.ResponseCodes.ContactsStart, { count: bufferReader.readUInt32LE(),