[sip-comm-dev] account address for jabber account id


#1

Hi,

I have made a smal modification on JabberAccountID.java, adding the method
    public String getAccountAddress()
to overrides the super one's which returns
    user@example.com@example.com
as the user address for a jabber account. A jabber acount already consist of the user address.
So, adding the server name at the end of the account id caused to have it twice in the resulting user address.

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Sympho a �crit :

Hi,

I have made a smal modification on JabberAccountID.java, adding the method
   public String getAccountAddress()
to overrides the super one's which returns
   user@example.com@example.com
as the user address for a jabber account. A jabber acount already consist of the user address.
So, adding the server name at the end of the account id caused to have it twice in the resulting user address.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

hem... well,

I haven't read anywhere that a jabber user id must always consist of an address so,
it is possible that the previous assertion isn't 100% accurate. To resolve the problem,
What do you think of replacing the actual AccountID#getAccountAddress

        public String getAccountAddress()
        {
            return getUserID() + "@" + getService();
        }

by

        public String getAccountAddress()
        {
            if (getUserID().indexOf('@') > 0)
                return getUserID();
           else
                return getUserID() + "@" + getService();
        }

or another option is to remove the service name at the end of a jabber user id
as it is done in the SipAccountID constructor.

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Sympho,

Sympho wrote:

Sympho a �crit :

Hi,

I have made a smal modification on JabberAccountID.java, adding the
method
   public String getAccountAddress()
to overrides the super one's which returns
   user@example.com@example.com
as the user address for a jabber account. A jabber acount already
consist of the user address.
So, adding the server name at the end of the account id caused to have
it twice in the resulting user address.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

hem... well,

I haven't read anywhere that a jabber user id must always consist of an
address so,
it is possible that the previous assertion isn't 100% accurate.

No indeed, it seems that it isn't. Here's what RFC 3920 says:

jid = [ node "@" ] domain [ "/" resource ]
domain = fqdn / address-literal
fqdn = (sub-domain 1*("." sub-domain))
sub-domain = (internationalized domain label)
address-literal = IPv4address / IPv6address

To resolve the problem,
What do you think of replacing the actual AccountID#getAccountAddress

        public String getAccountAddress()
        {
            return getUserID() + "@" + getService();
        }

by

        public String getAccountAddress()
        {
            if (getUserID().indexOf('@') > 0)
                return getUserID();
           else
                return getUserID() + "@" + getService();
        }

OK, you can give it a try. From a very perfunctory search it seems to me
that getAccountAddress() is mainly used for debug logging and user
messages but still make sure you run the tests before committing.

or another option is to remove the service name at the end of a jabber
user id
as it is done in the SipAccountID constructor.

You should definitely not do this! :slight_smile: This would scramble the account
UID which would be as good as deleting all jabber meta contact lists
that we store locally.

Cheers
Emil

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net