mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 15:06:15 -04:00
rename function and add event to achieve compatibility with snapdrop-android app
This commit is contained in:
parent
4a0cd1f49a
commit
17abc91c86
2 changed files with 10 additions and 4 deletions
|
@ -329,7 +329,7 @@ class Peer {
|
||||||
this._onFilesTransferRequest(messageJSON);
|
this._onFilesTransferRequest(messageJSON);
|
||||||
break;
|
break;
|
||||||
case 'header':
|
case 'header':
|
||||||
this._onFilesHeader(messageJSON);
|
this._onFileHeader(messageJSON);
|
||||||
break;
|
break;
|
||||||
case 'partition':
|
case 'partition':
|
||||||
this._onReceivedPartitionEnd(messageJSON);
|
this._onReceivedPartitionEnd(messageJSON);
|
||||||
|
@ -389,7 +389,7 @@ class Peer {
|
||||||
this._requestPending = null;
|
this._requestPending = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onFilesHeader(header) {
|
_onFileHeader(header) {
|
||||||
if (this._requestAccepted && this._requestAccepted.header.length) {
|
if (this._requestAccepted && this._requestAccepted.header.length) {
|
||||||
this._lastProgress = 0;
|
this._lastProgress = 0;
|
||||||
this._digester = new FileDigester({size: header.size, name: header.name, mime: header.mime},
|
this._digester = new FileDigester({size: header.size, name: header.name, mime: header.mime},
|
||||||
|
@ -443,6 +443,9 @@ class Peer {
|
||||||
this._abortTransfer();
|
this._abortTransfer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// include for compatibility with Snapdrop for Android app
|
||||||
|
Events.fire('file-received', fileBlob);
|
||||||
|
|
||||||
this._filesReceived.push(fileBlob);
|
this._filesReceived.push(fileBlob);
|
||||||
if (!this._requestAccepted.header.length) {
|
if (!this._requestAccepted.header.length) {
|
||||||
this._busy = false;
|
this._busy = false;
|
||||||
|
|
|
@ -340,7 +340,7 @@ class Peer {
|
||||||
this._onFilesTransferRequest(messageJSON);
|
this._onFilesTransferRequest(messageJSON);
|
||||||
break;
|
break;
|
||||||
case 'header':
|
case 'header':
|
||||||
this._onFilesHeader(messageJSON);
|
this._onFileHeader(messageJSON);
|
||||||
break;
|
break;
|
||||||
case 'partition':
|
case 'partition':
|
||||||
this._onReceivedPartitionEnd(messageJSON);
|
this._onReceivedPartitionEnd(messageJSON);
|
||||||
|
@ -400,7 +400,7 @@ class Peer {
|
||||||
this._requestPending = null;
|
this._requestPending = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onFilesHeader(header) {
|
_onFileHeader(header) {
|
||||||
if (this._requestAccepted && this._requestAccepted.header.length) {
|
if (this._requestAccepted && this._requestAccepted.header.length) {
|
||||||
this._lastProgress = 0;
|
this._lastProgress = 0;
|
||||||
this._digester = new FileDigester({size: header.size, name: header.name, mime: header.mime},
|
this._digester = new FileDigester({size: header.size, name: header.name, mime: header.mime},
|
||||||
|
@ -454,6 +454,9 @@ class Peer {
|
||||||
this._abortTransfer();
|
this._abortTransfer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// include for compatibility with Snapdrop for Android app
|
||||||
|
Events.fire('file-received', fileBlob);
|
||||||
|
|
||||||
this._filesReceived.push(fileBlob);
|
this._filesReceived.push(fileBlob);
|
||||||
if (!this._requestAccepted.header.length) {
|
if (!this._requestAccepted.header.length) {
|
||||||
this._busy = false;
|
this._busy = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue