From d8d5952469ecd3a0f80800856ceeed73dc7e677c Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Sun, 24 Sep 2006 21:11:47 +0000 Subject: [PATCH] Support for SIP (Work in Progress) Overrode the getAccountAddress() method so that we could add the sip: scheme in the beginning --- .../impl/protocol/sip/SipAccountID.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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 1ae52dce7..6382c0670 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/SipAccountID.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/SipAccountID.java @@ -23,11 +23,29 @@ public class SipAccountID * * @param userID the user id part of the SIP uri identifying this contact. * @param accountProperties any other properties necessary for the account. + * @param sererName the name of the server that the user belongs to. */ protected SipAccountID(String userID, Map accountProperties, - String serviceName) + String serverName) { - super(userID, accountProperties, ProtocolNames.SIP, serviceName); + super(userID, accountProperties, ProtocolNames.SIP, serverName); } + + /** + * Returns a string that could be directly used (or easily converted to) an + * address that other users of the procotol can use to communicate with us. + * By default this string is set to userid@servicename. Protocol + * implementors should override it if they'd need it to respect a different + * syntax. + * + * @return a String in the form of userid@service that other protocol users + * should be able to parse into a meaningful address and use it to + * communicate with us. + */ + public String getAccountAddress() + { + return "sip:" + getUserID() + "@" + getService(); + } + }