diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2012-10-01 06:10:21 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2012-10-01 06:10:21 +0000 |
commit | 1ee98bdf07c702123efd5ded704bc32ac71a0859 (patch) | |
tree | 7289c9f8f571702a588a824d69f272af03b450c3 /src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java | |
parent | b75a83f406c9eafec0f81a43cb5bda6a87bb9d58 (diff) | |
download | jitsi-1ee98bdf07c702123efd5ded704bc32ac71a0859.zip jitsi-1ee98bdf07c702123efd5ded704bc32ac71a0859.tar.gz jitsi-1ee98bdf07c702123efd5ded704bc32ac71a0859.tar.bz2 |
Commits work in progress on improving, stabalising audio and video telephony conferencing.
Diffstat (limited to 'src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java index 071acd9..06f329d 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java @@ -29,9 +29,9 @@ import org.jitsi.util.*; */ public class ReceivedCallDialog extends PreCallDialog - implements ActionListener, - CallListener, - Skinnable + implements ActionListener, + CallListener, + Skinnable { /** * The incoming call to render. @@ -57,11 +57,11 @@ public class ReceivedCallDialog this.incomingCall = call; - OperationSetBasicTelephony<?> telephonyOpSet - = call.getProtocolProvider() - .getOperationSet(OperationSetBasicTelephony.class); + OperationSetBasicTelephony<?> basicTelephony + = call.getProtocolProvider().getOperationSet( + OperationSetBasicTelephony.class); - telephonyOpSet.addCallListener(this); + basicTelephony.addCallListener(this); initCallLabel(getCallLabels()); } @@ -150,16 +150,34 @@ public class ReceivedCallDialog } /** - * When call is remotely ended we close this dialog. - * @param event the <tt>CallEvent</tt> that has been triggered + * {@inheritDoc} + * + * When the <tt>Call</tt> depicted by this dialog is (remotely) ended, + * close/dispose of this dialog. + * + * @param event a <tt>CallEvent</tt> which specifies the <tt>Call</tt> that + * has ended */ public void callEnded(CallEvent event) { - Call sourceCall = event.getSourceCall(); + if (event.getSourceCall().equals(incomingCall)) + dispose(); + } - if (sourceCall.equals(incomingCall)) + @Override + public void dispose() + { + try { - dispose(); + OperationSetBasicTelephony<?> basicTelephony + = incomingCall.getProtocolProvider().getOperationSet( + OperationSetBasicTelephony.class); + + basicTelephony.removeCallListener(this); + } + finally + { + super.dispose(); } } @@ -227,12 +245,11 @@ public class ReceivedCallDialog private String getPeerDisplayName(CallPeer peer) { String displayName = peer.getDisplayName(); - String peerAddress = peer.getAddress(); - - if(StringUtils.isNullOrEmpty(displayName, true)) - return peerAddress; - return displayName; + return + StringUtils.isNullOrEmpty(displayName, true) + ? peer.getAddress() + : displayName; } /** @@ -243,15 +260,16 @@ public class ReceivedCallDialog */ private String getPeerDisplayAddress(CallPeer peer) { - String displayName = peer.getDisplayName(); String peerAddress = peer.getAddress(); if(StringUtils.isNullOrEmpty(peerAddress, true)) return null; - - if(peerAddress.equalsIgnoreCase(displayName)) - return null; - - return peerAddress; + else + { + return + peerAddress.equalsIgnoreCase(peer.getDisplayName()) + ? null + : peerAddress; + } } } |