mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-18 11:58:09 +00:00
Improved contacts numbers handling
This commit is contained in:
parent
5ba538646c
commit
2b84cf2f5c
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 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);
|
||||
}
|
||||
|
||||
v.findViewById(R.id.chat).setOnClickListener(chatListener);
|
||||
if (LinphoneUtils.isSipAddress(numberOrAddress)) {
|
||||
v.findViewById(R.id.chat).setOnClickListener(chatListener);
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue