@@ -1790,7 +1790,7 @@ TransferredFile.prototype.receive = async function() {
1790
1790
throw new Error ( 'Receiving in wrong direction' ) ;
1791
1791
if ( f . pc )
1792
1792
throw new Error ( 'Download already in progress' ) ;
1793
- let pc = new RTCPeerConnection ( serverConnection . getRTCConfiguration ( ) ) ;
1793
+ let pc = new RTCPeerConnection ( f . sc . getRTCConfiguration ( ) ) ;
1794
1794
if ( ! pc ) {
1795
1795
let err = new Error ( "Couldn't create peer connection" ) ;
1796
1796
f . fail ( err ) ;
@@ -1807,7 +1807,7 @@ TransferredFile.prototype.receive = async function() {
1807
1807
}
1808
1808
} ;
1809
1809
pc . onicecandidate = function ( e ) {
1810
- serverConnection . userMessage ( 'filetransfer' , f . userid , {
1810
+ f . sc . userMessage ( 'filetransfer' , f . userid , {
1811
1811
type : 'downice' ,
1812
1812
id : f . id ,
1813
1813
candidate : e . candidate ,
@@ -1851,7 +1851,7 @@ TransferredFile.prototype.answer = async function(sdp) {
1851
1851
throw new Error ( 'Sending file in wrong direction' ) ;
1852
1852
if ( f . pc )
1853
1853
throw new Error ( 'Transfer already in progress' ) ;
1854
- let pc = new RTCPeerConnection ( serverConnection . getRTCConfiguration ( ) ) ;
1854
+ let pc = new RTCPeerConnection ( f . sc . getRTCConfiguration ( ) ) ;
1855
1855
if ( ! pc ) {
1856
1856
let err = new Error ( "Couldn't create peer connection" ) ;
1857
1857
f . fail ( err ) ;
@@ -1862,7 +1862,7 @@ TransferredFile.prototype.answer = async function(sdp) {
1862
1862
1863
1863
f . candidates = [ ] ;
1864
1864
pc . onicecandidate = function ( e ) {
1865
- serverConnection . userMessage ( 'filetransfer' , f . userid , {
1865
+ f . sc . userMessage ( 'filetransfer' , f . userid , {
1866
1866
type : 'upice' ,
1867
1867
id : f . id ,
1868
1868
candidate : e . candidate ,
@@ -1910,7 +1910,7 @@ TransferredFile.prototype.answer = async function(sdp) {
1910
1910
if ( ! answer )
1911
1911
throw new Error ( "Couldn't create answer" ) ;
1912
1912
await pc . setLocalDescription ( answer ) ;
1913
- serverConnection . userMessage ( 'filetransfer' , f . userid , {
1913
+ f . sc . userMessage ( 'filetransfer' , f . userid , {
1914
1914
type : 'answer' ,
1915
1915
id : f . id ,
1916
1916
sdp : pc . localDescription . sdp ,
0 commit comments