Hide copy text context menu option if message has no text + hide sender in IMDN view for incoming messages

This commit is contained in:
Sylvain Berfini 2018-04-12 14:57:28 +02:00
parent ec1efbff81
commit c9b68fd05b
2 changed files with 10 additions and 0 deletions

View file

@ -351,6 +351,10 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
// Do not show incoming messages IDMN state in 1 to 1 chat room as we don't receive IMDN for them
menu.removeItem(R.id.imdn_infos);
}
if (!message.hasTextContent()) {
// Do not show copy text option if message doesn't have any text
menu.removeItem(R.id.copy_text);
}
}
@Override

View file

@ -198,6 +198,8 @@ public class ImdnFragment extends Fragment {
boolean first = true;
for (ParticipantImdnState participant : participants) {
Address address = participant.getParticipant().getAddress();
if (!mMessage.isOutgoing() && address.weakEqual(remoteSender)) continue;
LinphoneContact participantContact = ContactsManager.getInstance().findContactFromAddress(address);
String participantDisplayName = participantContact != null ? participantContact.getFullName() : LinphoneUtils.getAddressDisplayName(address);
@ -220,6 +222,8 @@ public class ImdnFragment extends Fragment {
first = true;
for (ParticipantImdnState participant : participants) {
Address address = participant.getParticipant().getAddress();
if (!mMessage.isOutgoing() && address.weakEqual(remoteSender)) continue;
LinphoneContact participantContact = ContactsManager.getInstance().findContactFromAddress(address);
String participantDisplayName = participantContact != null ? participantContact.getFullName() : LinphoneUtils.getAddressDisplayName(address);
@ -242,6 +246,8 @@ public class ImdnFragment extends Fragment {
first = true;
for (ParticipantImdnState participant : participants) {
Address address = participant.getParticipant().getAddress();
if (!mMessage.isOutgoing() && address.weakEqual(remoteSender)) continue;
LinphoneContact participantContact = ContactsManager.getInstance().findContactFromAddress(address);
String participantDisplayName = participantContact != null ? participantContact.getFullName() : LinphoneUtils.getAddressDisplayName(address);