forked from upstream-mirrors/quik
Ignore textonly field in mms
This commit is contained in:
@@ -682,8 +682,7 @@ public class PduPersister {
|
||||
return pdu;
|
||||
}
|
||||
|
||||
private void persistAddress(
|
||||
long msgId, int type, EncodedStringValue[] array) {
|
||||
private void persistAddress(long msgId, int type, EncodedStringValue[] array) {
|
||||
ContentValues values = new ContentValues(3);
|
||||
|
||||
for (EncodedStringValue addr : array) {
|
||||
@@ -1416,9 +1415,6 @@ public class PduPersister {
|
||||
// while saving the parts.
|
||||
long dummyId = System.currentTimeMillis(); // Dummy ID of the msg.
|
||||
|
||||
// Figure out if this PDU is a text-only message
|
||||
boolean textOnly = true;
|
||||
|
||||
// Sum up the total message size
|
||||
int messageSize = 0;
|
||||
|
||||
@@ -1427,32 +1423,14 @@ public class PduPersister {
|
||||
body = ((MultimediaMessagePdu) pdu).getBody();
|
||||
// Start saving parts if necessary.
|
||||
if (body != null) {
|
||||
int partsNum = body.getPartsNum();
|
||||
if (partsNum > 2) {
|
||||
// For a text-only message there will be two parts: 1-the SMIL, 2-the text.
|
||||
// Down a few lines below we're checking to make sure we've only got SMIL or
|
||||
// text. We also have to check then we don't have more than two parts.
|
||||
// Otherwise, a slideshow with two text slides would be marked as textOnly.
|
||||
textOnly = false;
|
||||
}
|
||||
for (int i = 0; i < partsNum; i++) {
|
||||
for (int i = 0; i < body.getPartsNum(); i++) {
|
||||
PduPart part = body.getPart(i);
|
||||
messageSize += part.getDataLength();
|
||||
persistPart(part, dummyId, preOpenedFiles);
|
||||
|
||||
// If we've got anything besides text/plain or SMIL part, then we've got
|
||||
// an mms message with some other type of attachment.
|
||||
String contentType = getPartContentType(part);
|
||||
if (contentType != null && !ContentType.APP_SMIL.equals(contentType)
|
||||
&& !ContentType.TEXT_PLAIN.equals(contentType)) {
|
||||
textOnly = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Record whether this mms message is a simple plain text or not. This is a hint for the
|
||||
// UI.
|
||||
// values.put(Mms.TEXT_ONLY, textOnly ? 1 : 0);
|
||||
|
||||
// The message-size might already have been inserted when parsing the
|
||||
// PDU header. If not, then we insert the message size as well.
|
||||
if (values.getAsInteger(Mms.MESSAGE_SIZE) == null) {
|
||||
|
||||
@@ -78,11 +78,7 @@ class CursorToMessage @Inject constructor(
|
||||
mmsStatus = cursor.getInt(columnsMap.mmsStatus)
|
||||
subject = cursor.getString(columnsMap.mmsSubject) ?: ""
|
||||
textContentType = ""
|
||||
|
||||
attachmentType = when (cursor.getInt(columnsMap.mmsTextOnly)) {
|
||||
0 -> Message.AttachmentType.NOT_LOADED
|
||||
else -> Message.AttachmentType.TEXT
|
||||
}
|
||||
attachmentType = Message.AttachmentType.NOT_LOADED
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,8 +131,7 @@ class CursorToMessage @Inject constructor(
|
||||
Mms.DELIVERY_REPORT,
|
||||
Mms.READ_REPORT,
|
||||
MmsSms.PendingMessages.ERROR_TYPE,
|
||||
Mms.STATUS,
|
||||
Mms.TEXT_ONLY)
|
||||
Mms.STATUS)
|
||||
}
|
||||
|
||||
class MessageColumns(private val cursor: Cursor) {
|
||||
@@ -166,7 +161,6 @@ class CursorToMessage @Inject constructor(
|
||||
val mmsReadReport by lazy { getColumnIndex(Mms.READ_REPORT) }
|
||||
val mmsErrorType by lazy { getColumnIndex(MmsSms.PendingMessages.ERROR_TYPE) }
|
||||
val mmsStatus by lazy { getColumnIndex(Mms.STATUS) }
|
||||
val mmsTextOnly by lazy { getColumnIndex(Mms.TEXT_ONLY) }
|
||||
|
||||
private fun getColumnIndex(columnsName: String) = try {
|
||||
cursor.getColumnIndexOrThrow(columnsName)
|
||||
|
||||
Reference in New Issue
Block a user