Improved code a bit

This commit is contained in:
Sylvain Berfini 2018-02-01 13:51:06 +01:00
parent e0a9be7fb9
commit f3e6c0c76f

View file

@ -622,20 +622,17 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
cr.markAsRead(); cr.markAsRead();
LinphoneActivity.instance().updateMissedChatCount(); LinphoneActivity.instance().updateMissedChatCount();
if (event.getType() == EventLog.Type.ConferenceChatMessage) { ChatMessage msg = event.getChatMessage();
ChatMessage message = event.getChatMessage(); if (msg.getErrorInfo() != null && msg.getErrorInfo().getReason() == Reason.UnsupportedContent) {
if (message.getErrorInfo() != null && message.getErrorInfo().getReason() == Reason.UnsupportedContent) { Log.w("Message received but content is unsupported, do not display it");
Log.w("Message received but content is unsupported, do not display it"); return;
return; }
}
if (!msg.hasTextContent() && msg.getFileTransferInformation() == null) {
if (!message.hasTextContent() && message.getFileTransferInformation() == null) { Log.w("Message has no text or file transfer information to display, ignoring it...");
Log.w("Message has no text or file transfer information to display, ignoring it..."); return;
return;
}
} }
ChatMessage msg = event.getChatMessage();
String externalBodyUrl = msg.getExternalBodyUrl(); String externalBodyUrl = msg.getExternalBodyUrl();
Content fileTransferContent = msg.getFileTransferInformation(); Content fileTransferContent = msg.getFileTransferInformation();
if (externalBodyUrl != null || fileTransferContent != null) { if (externalBodyUrl != null || fileTransferContent != null) {