Improved contacts numbers handling

This commit is contained in:
Sylvain Berfini 2012-09-27 12:05:45 +02:00
parent b259902326
commit 63c5cf01f5

View file

@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import java.io.InputStream;
import org.linphone.compatibility.Compatibility;
import org.linphone.core.LinphoneProxyConfig;
import org.linphone.ui.AvatarWithShadow;
import android.content.Intent;
@ -112,13 +113,16 @@ public class ContactFragment extends Fragment implements OnClickListener {
v.findViewById(R.id.dial).setVisibility(View.GONE);
}
if (LinphoneUtils.isSipAddress(numberOrAddress)) {
v.findViewById(R.id.chat).setOnClickListener(chatListener);
if (LinphoneUtils.isSipAddress(numberOrAddress)) {
v.findViewById(R.id.chat).setTag(numberOrAddress);
} else {
v.findViewById(R.id.chat).setVisibility(View.INVISIBLE);
if (displayChatAddressOnly) {
v.setVisibility(View.GONE);
LinphoneProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig();
if (lpc != null) {
if (!numberOrAddress.startsWith("sip:")) {
numberOrAddress = "sip:" + numberOrAddress;
}
v.findViewById(R.id.chat).setTag(numberOrAddress + "@" + lpc.getDomain());
}
}