diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java index 786ed93c6..328731382 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java @@ -966,7 +966,6 @@ private void call(TreeNode treeNode) // Adds additional phone numbers found in contact information ContactNode n = (ContactNode)treeNode; MetaContact metaContact = null; - boolean hasPhone = false; if(n.getContactDescriptor().getDescriptor() instanceof MetaContact) { @@ -1012,7 +1011,6 @@ public PresenceStatus getPresenceStatus() } }; telephonyContacts.add(cd); - hasPhone = true; } } } @@ -1022,7 +1020,7 @@ public PresenceStatus getPresenceStatus() ChooseCallAccountPopupMenu chooseAccountDialog = null; - if (telephonyContacts.size() == 1 && !hasPhone) + if (telephonyContacts.size() == 1) { UIContactDetail detail = telephonyContacts.get(0); @@ -1060,7 +1058,7 @@ else if (providersCount > 1) tree, detail.getAddress(), providers); } } - else if (telephonyContacts.size() > 1 || hasPhone) + else if (telephonyContacts.size() > 1) { chooseAccountDialog = new ChooseCallAccountPopupMenu(tree, telephonyContacts); diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java index 379c6c1dd..9641b63a7 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java @@ -532,16 +532,24 @@ private void init() sendSmsItem.setName("sendSms"); } - if (callContactMenu.getItemCount() > 1 || - (hasPhones && callContactMenu.getItemCount() > 0)) + if (callContactMenu.getItemCount() > 1) { this.add(callContactMenu); } else { - this.add(callItem); - this.callItem.setName("call"); + if((hasPhones && callContactMenu.getItemCount() > 0)) + { + JMenuItem item = callContactMenu.getItem(0); + this.callItem.setName(item.getName()); + } + else + { + this.callItem.setName("call"); + } + this.callItem.addActionListener(this); + this.add(callItem); } if (videoCallMenu.getItemCount() > 1) @@ -641,7 +649,7 @@ else if (authRequestItemCount == 1 this.sendFileItem.setEnabled(false); if (metaContact.getDefaultContact( - OperationSetBasicTelephony.class) == null) + OperationSetBasicTelephony.class) == null && !hasPhones) this.callItem.setEnabled(false); if (metaContact.getDefaultContact( diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIContact.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIContact.java index 4dd200c24..f1ca6802a 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIContact.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIContact.java @@ -16,6 +16,7 @@ import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.OperationSetExtendedAuthorizations.SubscriptionStatus; +import net.java.sip.communicator.service.protocol.ServerStoredDetails.*; import net.java.sip.communicator.util.*; /** @@ -253,7 +254,7 @@ public List getContactDetailsForOperationSet( /** * Gets the avatar of a specific MetaContact in the form of an * ImageIcon value. - * + * * @param isSelected indicates if the contact is selected * @param width the desired icon width * @param height the desired icon height @@ -288,7 +289,7 @@ public ImageIcon getAvatar( = (Object[]) metaContact.getData(AVATAR_DATA_KEY); ImageIcon avatar = null; - if ((avatarCache != null) && (avatarCache[0] == avatarBytes)) + if ((avatarCache != null) && (avatarCache[0] == avatarBytes)) avatar = (ImageIcon) avatarCache[1]; // If the avatar isn't available or it's not up-to-date, create it. @@ -406,6 +407,29 @@ public ExtendedTooltip getToolTip() //String statusMessage = protocolContact.getStatusMessage(); tip.addLine(protocolStatusIcon, contactAddress); + OperationSetServerStoredContactInfo infoOpSet = + protocolContact.getProtocolProvider().getOperationSet( + OperationSetServerStoredContactInfo.class); + + if(infoOpSet != null) + { + Iterator details = + infoOpSet.getAllDetailsForContact(protocolContact); + + while(details.hasNext()) + { + GenericDetail d = details.next(); + if(d instanceof PhoneNumberDetail) + { + PhoneNumberDetail pnd = (PhoneNumberDetail)d; + if(pnd.getNumber() != null && + pnd.getNumber().length() > 0) + { + tip.addLine(null, pnd.getNumber()); + } + } + } + } // Set the first found status message. if (statusMessage == null