diff --git a/src/net/java/sip/communicator/impl/callhistory/CallHistorySourceContact.java b/src/net/java/sip/communicator/impl/callhistory/CallHistorySourceContact.java index 72a62af64..b0607437e 100644 --- a/src/net/java/sip/communicator/impl/callhistory/CallHistorySourceContact.java +++ b/src/net/java/sip/communicator/impl/callhistory/CallHistorySourceContact.java @@ -111,7 +111,14 @@ private void initPeerDetails() if (peerAddress != null) { - ContactDetail contactDetail = new ContactDetail(peerAddress); + String peerRecordDisplayName = peerRecord.getDisplayName(); + + if(peerRecordDisplayName == null + || peerRecordDisplayName.length() == 0) + peerRecordDisplayName = peerAddress; + + ContactDetail contactDetail = + new ContactDetail(peerAddress, peerRecordDisplayName); Map, ProtocolProviderService> preferredProviders = null; diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/SourceUIContact.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/SourceUIContact.java index c54179ecb..79721ccec 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/SourceUIContact.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/SourceUIContact.java @@ -13,6 +13,7 @@ import javax.swing.*; import org.jitsi.service.resources.*; +import org.jitsi.util.*; import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.main.contactlist.*; @@ -22,6 +23,7 @@ import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.globalstatus.*; +import net.java.sip.communicator.util.*; /** * The SourceUIContact is the implementation of the UIContact for the @@ -517,7 +519,20 @@ private void addDetailsToToolTip( List details, } } - jLabels[i] = new JLabel(contactDetail.getDetail()); + String labelText; + + if(ConfigurationUtils.isHideAddressInCallHistoryTooltipEnabled()) + { + labelText = contactDetail.getDisplayName(); + if(StringUtils.isNullOrEmpty(labelText)) + labelText = contactDetail.getDetail(); + } + else + { + labelText = contactDetail.getDetail(); + } + + jLabels[i] = new JLabel(labelText); toolTip.addLine(jLabels); } diff --git a/src/net/java/sip/communicator/util/ConfigurationUtils.java b/src/net/java/sip/communicator/util/ConfigurationUtils.java index d6d735a5e..f80c4f8f5 100644 --- a/src/net/java/sip/communicator/util/ConfigurationUtils.java +++ b/src/net/java/sip/communicator/util/ConfigurationUtils.java @@ -307,6 +307,19 @@ public class ConfigurationUtils */ private static boolean isSingleWindowInterfaceEnabled = false; + /** + * Whether addresses will be shown in call history tooltips. + */ + private static boolean isHideAddressInCallHistoryTooltipEnabled = false; + + /** + * The name of the property, whether to show addresses in call history + * tooltip. + */ + private static final String HIDE_ADDR_IN_CALL_HISTORY_TOOLTIP_PROPERTY + = "net.java.sip.communicator.impl.gui.contactlist" + + ".HIDE_ADDRESS_IN_CALL_HISTORY_TOOLTIP_ENABLED"; + /** * The name of the show smileys property. */ @@ -874,6 +887,10 @@ public static void loadGuiConfigurations() = configService.getBoolean( "impl.gui.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS", true); + + isHideAddressInCallHistoryTooltipEnabled = configService.getBoolean( + HIDE_ADDR_IN_CALL_HISTORY_TOOLTIP_PROPERTY, + isHideAddressInCallHistoryTooltipEnabled); } /** @@ -1743,6 +1760,15 @@ public static boolean isSingleWindowInterfaceEnabled() return isSingleWindowInterfaceEnabled; } + /** + * Whether addresses will be shown in call history tooltips. + * @return whether addresses will be shown in call history tooltips. + */ + public static boolean isHideAddressInCallHistoryTooltipEnabled() + { + return isHideAddressInCallHistoryTooltipEnabled; + } + /** * Updates the "singleWindowInterface" property through the * ConfigurationService.