113113
114114 ui . createUsers ( QBUsers , ui . $usersList ) ;
115115 ui . $usersTitle . text ( MESSAGES . title_login ) ;
116-
116+
117117 if ( ! params . withoutUpdMsg || params . msg ) {
118118 qbApp . MsgBoard . update ( params . msg ) ;
119119 }
365365 if ( app . currentSession . peerConnections [ userID ] . stream && ! _ . isEmpty ( $that . attr ( 'src' ) ) ) {
366366 if ( $that . hasClass ( 'active' ) ) {
367367 $that . removeClass ( 'active' ) ;
368-
368+
369369 app . currentSession . detachMediaStream ( 'main_video' ) ;
370370 ui . changeFilter ( '#main_video' , 'no' ) ;
371371 app . mainVideo = 0 ;
479479 console . log ( 'Session: ' + session ) ;
480480 console . groupEnd ( ) ;
481481
482- var userInfo = _ . findWhere ( QBUsers , { id : + userId } ) ;
482+ var userInfo = _ . findWhere ( QBUsers , { id : + userId } ) ,
483+ currentUserInfo = _ . findWhere ( QBUsers , { id : app . currentSession . currentUserID } ) ;
483484
484485 /** It's for p2p call */
485486 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+ ) ;
487495 }
488496
489497 /** It's for groups call */
540548
541549 /** update list of callee who take call */
542550 takedCallCallee . push ( userInfo ) ;
543-
551+
544552 if ( app . currentSession . currentUserID === app . currentSession . initiatorID ) {
545553 qbApp . MsgBoard . update ( 'accept_call' , { users : takedCallCallee } ) ;
546554 }
553561 console . log ( 'Extension: ' + JSON . stringify ( extension ) ) ;
554562 console . groupEnd ( ) ;
555563
556- var userInfo = _ . findWhere ( QBUsers , { id : userId } ) ;
564+ var userInfo = _ . findWhere ( QBUsers , { id : userId } ) ,
565+ currentUserInfo = _ . findWhere ( QBUsers , { id : app . currentSession . currentUserID } ) ;
557566
558567 /** It's for p2p call */
559568 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+ ) ;
561577 }
562578
563579 /** It's for groups call */
571587 console . log ( 'Extension: ' + JSON . stringify ( extension ) ) ;
572588 console . groupEnd ( ) ;
573589
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 } ) ;
575593
576594 /** It's for p2p call */
577595 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+ ) ;
579604 }
580605
581606 /** It's for groups call */
590615 app . currentSession . peerConnections [ userID ] . stream = stream ;
591616
592617 app . currentSession . attachMediaStream ( 'remote_video_' + userID , stream ) ;
593-
618+
594619 if ( remoteStreamCounter === 0 ) {
595620 $ ( '#remote_video_' + userID ) . click ( ) ;
596-
621+
597622 app . mainVideo = userID ;
598623 ++ remoteStreamCounter ;
599624 }
636661 if ( connectionState === QB . webrtc . SessionConnectionState . CLOSED ) {
637662 ui . toggleRemoteVideoView ( userID , 'clear' ) ;
638663 document . getElementById ( ui . sounds . rington ) . pause ( ) ;
639-
664+
640665 if ( app . mainVideo === userID ) {
641666 $ ( '#remote_video_' + userID ) . removeClass ( 'active' ) ;
642667
673698 if ( _ . isEmpty ( app . currentSession ) || isCallEnded ) {
674699 if ( callTimer ) {
675700 $ ( '#timer' ) . addClass ( 'hidden' ) ;
676-
701+
677702 clearInterval ( callTimer ) ;
678703 callTimer = null ;
679704 ui . callTime = 0 ;
683708 } ;
684709 }
685710 } ) ;
686- } ( window , jQuery ) ) ;
711+ } ( window , jQuery ) ) ;
0 commit comments