implement path updated push event

This commit is contained in:
liamcottle 2025-02-12 00:48:02 +13:00
parent 845f9d6d19
commit 5735dc8b66
2 changed files with 15 additions and 0 deletions

View file

@ -163,6 +163,8 @@ class Connection extends EventEmitter {
this.onSentResponse(bufferReader);
} else if(responseCode === Constants.PushCodes.Advert){
this.onAdvertPush(bufferReader);
} else if(responseCode === Constants.PushCodes.PathUpdated){
this.onPathUpdatedPush(bufferReader);
} else if(responseCode === Constants.PushCodes.SendConfirmed){
this.onSendConfirmedPush(bufferReader);
} else if(responseCode === Constants.PushCodes.MsgWaiting){
@ -179,6 +181,12 @@ class Connection extends EventEmitter {
});
}
onPathUpdatedPush(bufferReader) {
this.emit(Constants.PushCodes.PathUpdated, {
publicKey: bufferReader.readBytes(32),
});
}
onSendConfirmedPush(bufferReader) {
this.emit(Constants.PushCodes.SendConfirmed, {
ackCode: bufferReader.readBytes(4),