Improved contacts numbers handling
This commit is contained in:
parent
b259902326
commit
63c5cf01f5
1 changed files with 8 additions and 4 deletions
|
@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
import org.linphone.compatibility.Compatibility;
|
import org.linphone.compatibility.Compatibility;
|
||||||
|
import org.linphone.core.LinphoneProxyConfig;
|
||||||
import org.linphone.ui.AvatarWithShadow;
|
import org.linphone.ui.AvatarWithShadow;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -112,13 +113,16 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
||||||
v.findViewById(R.id.dial).setVisibility(View.GONE);
|
v.findViewById(R.id.dial).setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v.findViewById(R.id.chat).setOnClickListener(chatListener);
|
||||||
if (LinphoneUtils.isSipAddress(numberOrAddress)) {
|
if (LinphoneUtils.isSipAddress(numberOrAddress)) {
|
||||||
v.findViewById(R.id.chat).setOnClickListener(chatListener);
|
|
||||||
v.findViewById(R.id.chat).setTag(numberOrAddress);
|
v.findViewById(R.id.chat).setTag(numberOrAddress);
|
||||||
} else {
|
} else {
|
||||||
v.findViewById(R.id.chat).setVisibility(View.INVISIBLE);
|
LinphoneProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig();
|
||||||
if (displayChatAddressOnly) {
|
if (lpc != null) {
|
||||||
v.setVisibility(View.GONE);
|
if (!numberOrAddress.startsWith("sip:")) {
|
||||||
|
numberOrAddress = "sip:" + numberOrAddress;
|
||||||
|
}
|
||||||
|
v.findViewById(R.id.chat).setTag(numberOrAddress + "@" + lpc.getDomain());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue