mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-19 04:28:08 +00:00
Fix displayname for chat alert
This commit is contained in:
parent
3e2c1febfa
commit
01214fba33
1 changed files with 10 additions and 2 deletions
|
|
@ -445,6 +445,14 @@ public class ChatEventsAdapter extends ListSelectionAdapter {
|
|||
case ConferenceSecurityEvent:
|
||||
String message;
|
||||
holder.eventLayout.setVisibility(View.VISIBLE);
|
||||
if (event.getSecurityEventFaultyDevice() != null) {
|
||||
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(event.getSecurityEventFaultyDevice());
|
||||
if (contact != null) {
|
||||
displayName = contact.getFullName();
|
||||
} else {
|
||||
displayName = LinphoneUtils.getAddressDisplayName(event.getSecurityEventFaultyDevice());
|
||||
}
|
||||
}
|
||||
switch (event.getSecurityEventType()) {
|
||||
case SecurityLevelDowngraded:
|
||||
message = mContext.getString(R.string.security_level_degraded);
|
||||
|
|
@ -452,7 +460,7 @@ public class ChatEventsAdapter extends ListSelectionAdapter {
|
|||
case MultideviceParticipantDetected:
|
||||
holder.eventMessage.setTextColor(Color.RED);
|
||||
if (event.getSecurityEventFaultyDevice() != null) {
|
||||
message = mContext.getString(R.string.security_alert_multidevice_from).replace("%s", event.getSecurityEventFaultyDevice().getUsername());
|
||||
message = mContext.getString(R.string.security_alert_multidevice_from).replace("%s", displayName);
|
||||
} else {
|
||||
message = mContext.getString(R.string.security_alert_multidevice);
|
||||
}
|
||||
|
|
@ -461,7 +469,7 @@ public class ChatEventsAdapter extends ListSelectionAdapter {
|
|||
case LimeIdentityKeyChanged:
|
||||
holder.eventMessage.setTextColor(Color.RED);
|
||||
if (event.getSecurityEventFaultyDevice() != null) {
|
||||
message = mContext.getString(R.string.security_alert_from).replace("%s", event.getSecurityEventFaultyDevice().getUsername());
|
||||
message = mContext.getString(R.string.security_alert_from).replace("%s", displayName);
|
||||
} else {
|
||||
message = mContext.getString(R.string.security_alert);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue