assure that getAccountAddress doesn't append the server name twice.

cusax-fix
Symphorien Wanko 18 years ago
parent ecb532f08a
commit 4356706655

@ -47,18 +47,4 @@ private static String getServiceName(Map accountProperties)
else
return "jabber.org";
}
/**
* The super method is overridden here because jabber user id
* is already the user address and it is therefore pointless to add the
* service name.
*
* @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 getUserID();
}
}

@ -220,10 +220,18 @@ private CallJabberImpl createOutgoingCall(String calleeAddress)
, OperationFailedException.INTERNAL_ERROR);
}
// we determine on wich resource the remote user is connected
String fullCalleeURI = protocolProvider.getConnection().
getRoster().getPresence(calleeAddress).getFrom();
// we determine on which resource the remote user is connected if the
// resource isn't already provided
String fullCalleeURI = null;
if (calleeAddress.indexOf('/') > 0)
{
fullCalleeURI = calleeAddress;
}
else
{
fullCalleeURI = protocolProvider.getConnection().
getRoster().getPresence(calleeAddress).getFrom();
}
if (fullCalleeURI.indexOf('/') < 0)
{
throw new OperationFailedException(
@ -243,15 +251,15 @@ private CallJabberImpl createOutgoingCall(String calleeAddress)
.discoverInfo(fullCalleeURI);
if (di.containsFeature("http://www.xmpp.org/extensions/xep-0166.html#ns"))
{
logger.info(fullCalleeURI + ": telephony supported ");
logger.info(fullCalleeURI + ": jingle supported ");
}
else
{
logger.info(calleeAddress + ": telephony not supported ??? ");
logger.info(calleeAddress + ": jingle not supported ??? ");
//
// throw new OperationFailedException(
// "Failed to create OutgoingJingleSession.\n"
// + fullCalleeURI + " do not supports telephony"
// + fullCalleeURI + " do not supports jingle"
// , OperationFailedException.INTERNAL_ERROR);
}
}

@ -189,6 +189,9 @@ public String getService()
*/
public String getAccountAddress()
{
return getUserID() + "@" + getService();
if (getUserID().indexOf('@') > 0)
return getUserID();
else
return getUserID() + "@" + getService();
}
}

Loading…
Cancel
Save