Fixed display issue for security events

This commit is contained in:
Sylvain Berfini 2018-11-26 15:55:38 +01:00
parent 75a4e113d1
commit d29c6e9740
3 changed files with 12 additions and 5 deletions

View file

@ -364,7 +364,10 @@ public class ChatMessagesAdapter extends SelectableAdapter<ChatMessageViewHolder
holder.eventLayout.setBackgroundResource(R.drawable.event_decoration_gray); holder.eventLayout.setBackgroundResource(R.drawable.event_decoration_gray);
Address address = event.getParticipantAddress(); Address address = event.getParticipantAddress();
String displayName = null; if (address == null && event.getType() == EventLog.Type.ConferenceSecurityEvent) {
address = event.getSecurityEventFaultyDeviceAddress();
}
String displayName = "";
if (address != null) { if (address != null) {
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address); LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
if (contact != null) { if (contact != null) {

View file

@ -162,10 +162,14 @@ public class ChatRoomViewHolder extends RecyclerView.ViewHolder implements View.
ContactAvatar.displayAvatar(contact, avatarLayout); ContactAvatar.displayAvatar(contact, avatarLayout);
} }
} else { } else {
Address remoteAddr; Address remoteAddr = null;
if (mRoom.hasCapability(ChatRoomCapabilities.Encrypted.toInt())) { if (mRoom.hasCapability(ChatRoomCapabilities.Encrypted.toInt())) {
Participant[] participants = mRoom.getParticipants(); Participant[] participants = mRoom.getParticipants();
remoteAddr = participants[0].getAddress(); if (participants.length > 0) {
remoteAddr = participants[0].getAddress();
} else {
//TODO: error
}
} else { } else {
remoteAddr = mRoom.getPeerAddress(); remoteAddr = mRoom.getPeerAddress();
} }

View file

@ -2,6 +2,6 @@
<shape <shape
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line"> android:shape="line">
<stroke android:width="50dp" android:color="@color/colorI"/> <stroke android:width="1dp" android:color="@color/colorI"/>
<size android:height="1dp" /> <size android:height="1dp" android:width="50dp" />
</shape> </shape>