Added bool to hide sip addresses (in history)

This commit is contained in:
Sylvain Berfini 2013-06-11 15:33:00 +02:00
parent 131395bf7a
commit 4c7bcfc84d
2 changed files with 11 additions and 2 deletions

View file

@ -40,6 +40,7 @@
<bool name="lock_statusbar">false</bool>
<bool name="emoticons_in_messages">true</bool>
<bool name="only_display_username_if_unknown">true</bool> <!-- Display username for all sip addresses (if not in contact and display name empty) -->
<bool name="never_display_sip_addresses">false</bool> <!-- To use only with the above setting set to true -->
<bool name="display_messages_time_and_status">true</bool> <!-- Used to show the time of each message arrival -->
<bool name="display_time_aside">false</bool> <!-- if display_messages_time = true, display time on the side of the message instead of below -->

View file

@ -85,7 +85,11 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
private void displayHistory(String status, String callTime, String callDate) {
contactName.setText(displayName == null ? sipUri : displayName);
if (getResources().getBoolean(R.bool.never_display_sip_addresses)) {
contactAddress.setText(LinphoneUtils.getUsernameFromAddress(sipUri));
} else {
contactAddress.setText(sipUri);
}
if (status.equals("Missed")) {
callDirection.setText(getString(R.string.call_state_missed));
@ -136,7 +140,11 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
} else if (id == R.id.chat) {
LinphoneActivity.instance().displayChat(sipUri);
} else if (id == R.id.addToContacts) {
LinphoneActivity.instance().displayContactsForEdition(sipUri);
String uriToAdd = sipUri;
if (getResources().getBoolean(R.bool.never_display_sip_addresses)) {
uriToAdd = LinphoneUtils.getUsernameFromAddress(sipUri);
}
LinphoneActivity.instance().displayContactsForEdition(uriToAdd);
}
}