aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java
diff options
context:
space:
mode:
authorEmil Ivov <emcho@jitsi.org>2009-03-24 17:49:00 +0000
committerEmil Ivov <emcho@jitsi.org>2009-03-24 17:49:00 +0000
commit7a331c69a138235acdac302e1b79a7a20fe3a3a6 (patch)
tree48a4a887c0535f3f00cc407f74bf16998cf51fc3 /src/net/java
parentd2c58e4146c439140e4ced8ba1165dd8d371e9af (diff)
downloadjitsi-7a331c69a138235acdac302e1b79a7a20fe3a3a6.zip
jitsi-7a331c69a138235acdac302e1b79a7a20fe3a3a6.tar.gz
jitsi-7a331c69a138235acdac302e1b79a7a20fe3a3a6.tar.bz2
Fixes issue #582 : SIP account name displayed in the GUI should be the AOR
Diffstat (limited to 'src/net/java')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java11
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/SipAccountID.java20
2 files changed, 19 insertions, 12 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
index bddee2e..91f6e7e 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
@@ -401,7 +401,8 @@ public class ProtocolProviderServiceSipImpl
if (preferredSipPort > NetworkUtils.MAX_PORT_NUMBER)
{
logger.error(preferredSipPort + " is larger than "
- + NetworkUtils.MAX_PORT_NUMBER + " and does not "
+ + NetworkUtils.MAX_PORT_NUMBER
+ + " and does not "
+ "therefore represent a valid port nubmer.");
}
}
@@ -414,7 +415,8 @@ public class ProtocolProviderServiceSipImpl
accountID.getAccountPropertyBoolean(
ProtocolProviderFactory.IS_PRESENCE_ENABLED, true);
- boolean forceP2P = accountID.getAccountPropertyBoolean(ProtocolProviderFactory.FORCE_P2P_MODE, true);
+ boolean forceP2P = accountID.getAccountPropertyBoolean(
+ ProtocolProviderFactory.FORCE_P2P_MODE, true);
int pollingValue =
accountID.getAccountPropertyInt(
@@ -490,9 +492,8 @@ public class ProtocolProviderServiceSipImpl
new ClientCapabilities(this);
//initialize our display name
- ourDisplayName =
- accountID
- .getAccountPropertyString(ProtocolProviderFactory.DISPLAY_NAME);
+ ourDisplayName = accountID.getAccountPropertyString(
+ ProtocolProviderFactory.DISPLAY_NAME);
if(ourDisplayName == null
|| ourDisplayName.trim().length() == 0)
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/SipAccountID.java b/src/net/java/sip/communicator/impl/protocol/sip/SipAccountID.java
index 4202d48..c17953b 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/SipAccountID.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/SipAccountID.java
@@ -17,7 +17,16 @@ import net.java.sip.communicator.service.protocol.*;
public class SipAccountID
extends AccountID
{
- private static String getUserIDWithoutServerName(String userID)
+ /**
+ * Removes the server part from a sip user id if there is one. Used when
+ * calling the super constructor to ensure that we will be consistent about
+ * the value of the user id.
+ *
+ * @param userID the sip user id that we'd like to remove a server from.
+ *
+ * @return the user part of the <tt>userID</tt>
+ */
+ private static String stripServerNameFromUserID(String userID)
{
int index = userID.indexOf("@");
return (index > -1) ? userID.substring(0, index) : userID;
@@ -33,7 +42,7 @@ public class SipAccountID
protected SipAccountID(String userID, Map accountProperties,
String serverName)
{
- super(getUserIDWithoutServerName(userID), accountProperties,
+ super(stripServerNameFromUserID(userID), accountProperties,
(String) accountProperties.get(ProtocolProviderFactory.PROTOCOL),
serverName);
}
@@ -77,7 +86,8 @@ public class SipAccountID
*/
public String getDisplayName()
{
- String returnValue = getUserID();
+ String returnValue = super.getAccountPropertyString(
+ ProtocolProviderFactory.USER_ID);
String protocolName =
getAccountPropertyString(ProtocolProviderFactory.PROTOCOL);
@@ -88,10 +98,6 @@ public class SipAccountID
// this is apparently a no registrar account
protocolName = "RegistrarLess " + protocolName;
}
- else
- {
- returnValue += "@" + service;
- }
if (protocolName != null && protocolName.trim().length() > 0)
returnValue += " (" + protocolName + ")";