kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix crash when showing a message with a button without media.
rodzic
b2f3867b0b
commit
52a5fb8ea2
|
@ -178,9 +178,9 @@ public class ConversationAdapter
|
||||||
} else if (messageRecord.isUpdate()) {
|
} else if (messageRecord.isUpdate()) {
|
||||||
return MESSAGE_TYPE_UPDATE;
|
return MESSAGE_TYPE_UPDATE;
|
||||||
} else if (messageRecord.isOutgoing()) {
|
} else if (messageRecord.isOutgoing()) {
|
||||||
return MessageRecordUtil.isTextOnly(messageRecord, context) && !conversationMessage.hasBeenQuoted() ? MESSAGE_TYPE_OUTGOING_TEXT : MESSAGE_TYPE_OUTGOING_MULTIMEDIA;
|
return conversationMessage.isTextOnly(context) ? MESSAGE_TYPE_OUTGOING_TEXT : MESSAGE_TYPE_OUTGOING_MULTIMEDIA;
|
||||||
} else {
|
} else {
|
||||||
return MessageRecordUtil.isTextOnly(messageRecord, context) && !conversationMessage.hasBeenQuoted() ? MESSAGE_TYPE_INCOMING_TEXT : MESSAGE_TYPE_INCOMING_MULTIMEDIA;
|
return conversationMessage.isTextOnly(context) ? MESSAGE_TYPE_INCOMING_TEXT : MESSAGE_TYPE_INCOMING_MULTIMEDIA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||||
import org.thoughtcrime.securesms.database.model.Mention;
|
import org.thoughtcrime.securesms.database.model.Mention;
|
||||||
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
||||||
import org.thoughtcrime.securesms.database.model.databaseprotos.BodyRangeList;
|
import org.thoughtcrime.securesms.database.model.databaseprotos.BodyRangeList;
|
||||||
|
import org.thoughtcrime.securesms.util.MessageRecordUtil;
|
||||||
|
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -120,6 +121,12 @@ public class ConversationMessage {
|
||||||
return styleResult.getBottomButton();
|
return styleResult.getBottomButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isTextOnly(@NonNull Context context) {
|
||||||
|
return MessageRecordUtil.isTextOnly(messageRecord, context) &&
|
||||||
|
!hasBeenQuoted() &&
|
||||||
|
getBottomButton() == null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory providing multiple ways of creating {@link ConversationMessage}s.
|
* Factory providing multiple ways of creating {@link ConversationMessage}s.
|
||||||
*/
|
*/
|
||||||
|
|
Ładowanie…
Reference in New Issue