113
113
114
114
ui . createUsers ( QBUsers , ui . $usersList ) ;
115
115
ui . $usersTitle . text ( MESSAGES . title_login ) ;
116
-
116
+
117
117
if ( ! params . withoutUpdMsg || params . msg ) {
118
118
qbApp . MsgBoard . update ( params . msg ) ;
119
119
}
365
365
if ( app . currentSession . peerConnections [ userID ] . stream && ! _ . isEmpty ( $that . attr ( 'src' ) ) ) {
366
366
if ( $that . hasClass ( 'active' ) ) {
367
367
$that . removeClass ( 'active' ) ;
368
-
368
+
369
369
app . currentSession . detachMediaStream ( 'main_video' ) ;
370
370
ui . changeFilter ( '#main_video' , 'no' ) ;
371
371
app . mainVideo = 0 ;
479
479
console . log ( 'Session: ' + session ) ;
480
480
console . groupEnd ( ) ;
481
481
482
- var userInfo = _ . findWhere ( QBUsers , { id : + userId } ) ;
482
+ var userInfo = _ . findWhere ( QBUsers , { id : + userId } ) ,
483
+ currentUserInfo = _ . findWhere ( QBUsers , { id : app . currentSession . currentUserID } ) ;
483
484
484
485
/** It's for p2p call */
485
486
if ( session . opponentsIDs . length === 1 ) {
486
- qbApp . MsgBoard . update ( 'p2p_call_stop' , { name : userInfo . full_name , reason : 'not answered' } ) ;
487
+ qbApp . MsgBoard . update (
488
+ 'p2p_call_stop' ,
489
+ {
490
+ name : userInfo . full_name ,
491
+ currentName : currentUserInfo . full_name ,
492
+ reason : 'not answered'
493
+ }
494
+ ) ;
487
495
}
488
496
489
497
/** It's for groups call */
540
548
541
549
/** update list of callee who take call */
542
550
takedCallCallee . push ( userInfo ) ;
543
-
551
+
544
552
if ( app . currentSession . currentUserID === app . currentSession . initiatorID ) {
545
553
qbApp . MsgBoard . update ( 'accept_call' , { users : takedCallCallee } ) ;
546
554
}
553
561
console . log ( 'Extension: ' + JSON . stringify ( extension ) ) ;
554
562
console . groupEnd ( ) ;
555
563
556
- var userInfo = _ . findWhere ( QBUsers , { id : userId } ) ;
564
+ var userInfo = _ . findWhere ( QBUsers , { id : userId } ) ,
565
+ currentUserInfo = _ . findWhere ( QBUsers , { id : app . currentSession . currentUserID } ) ;
557
566
558
567
/** It's for p2p call */
559
568
if ( session . opponentsIDs . length === 1 ) {
560
- qbApp . MsgBoard . update ( 'p2p_call_stop' , { name : userInfo . full_name , reason : 'rejected the call' } ) ;
569
+ qbApp . MsgBoard . update (
570
+ 'p2p_call_stop' ,
571
+ {
572
+ name : userInfo . full_name ,
573
+ currentName : currentUserInfo . full_name ,
574
+ reason : 'rejected the call'
575
+ }
576
+ ) ;
561
577
}
562
578
563
579
/** It's for groups call */
571
587
console . log ( 'Extension: ' + JSON . stringify ( extension ) ) ;
572
588
console . groupEnd ( ) ;
573
589
574
- var userInfo = _ . findWhere ( QBUsers , { id : userId } ) ;
590
+ /** It's for p2p call */
591
+ var userInfo = _ . findWhere ( QBUsers , { id : userId } ) ,
592
+ currentUserInfo = _ . findWhere ( QBUsers , { id : app . currentSession . currentUserID } ) ;
575
593
576
594
/** It's for p2p call */
577
595
if ( session . opponentsIDs . length === 1 ) {
578
- qbApp . MsgBoard . update ( 'p2p_call_stop' , { name : userInfo . full_name , reason : 'hung up the call' } ) ;
596
+ qbApp . MsgBoard . update (
597
+ 'p2p_call_stop' ,
598
+ {
599
+ name : userInfo . full_name ,
600
+ currentName : currentUserInfo . full_name ,
601
+ reason : 'hung up the call'
602
+ }
603
+ ) ;
579
604
}
580
605
581
606
/** It's for groups call */
590
615
app . currentSession . peerConnections [ userID ] . stream = stream ;
591
616
592
617
app . currentSession . attachMediaStream ( 'remote_video_' + userID , stream ) ;
593
-
618
+
594
619
if ( remoteStreamCounter === 0 ) {
595
620
$ ( '#remote_video_' + userID ) . click ( ) ;
596
-
621
+
597
622
app . mainVideo = userID ;
598
623
++ remoteStreamCounter ;
599
624
}
636
661
if ( connectionState === QB . webrtc . SessionConnectionState . CLOSED ) {
637
662
ui . toggleRemoteVideoView ( userID , 'clear' ) ;
638
663
document . getElementById ( ui . sounds . rington ) . pause ( ) ;
639
-
664
+
640
665
if ( app . mainVideo === userID ) {
641
666
$ ( '#remote_video_' + userID ) . removeClass ( 'active' ) ;
642
667
673
698
if ( _ . isEmpty ( app . currentSession ) || isCallEnded ) {
674
699
if ( callTimer ) {
675
700
$ ( '#timer' ) . addClass ( 'hidden' ) ;
676
-
701
+
677
702
clearInterval ( callTimer ) ;
678
703
callTimer = null ;
679
704
ui . callTime = 0 ;
683
708
} ;
684
709
}
685
710
} ) ;
686
- } ( window , jQuery ) ) ;
711
+ } ( window , jQuery ) ) ;
0 commit comments