Change TS Media message timestamp from received time to sent time

Fix #3525
Closes #3535
//FREEBIE
This commit is contained in:
PurplePlatypus
2015-07-06 17:14:57 -05:00
committed by Moxie Marlinspike
parent 038f24f394
commit fe5e101463
4 changed files with 10 additions and 18 deletions

View File

@@ -482,13 +482,8 @@ public class ThreadDatabase extends Database {
MessageRecord record;
if (reader != null && (record = reader.getNext()) != null) {
final long timestamp;
if (record.isPush()) timestamp = record.getDateSent();
else timestamp = record.getDateReceived();
updateThread(threadId, count, record.getBody().getBody(), getAttachmentUriFor(record),
timestamp, record.getDeliveryStatus(), record.getReceiptCount(),
record.getTimestamp(), record.getDeliveryStatus(), record.getReceiptCount(),
record.getType(), unarchive);
notifyConversationListListeners();
return false;

View File

@@ -115,6 +115,11 @@ public abstract class MessageRecord extends DisplayRecord {
return SmsDatabase.Types.isPushType(type) && !SmsDatabase.Types.isForcedSms(type);
}
public long getTimestamp() {
if (isPush()) return getDateSent();
else return getDateReceived();
}
public boolean isForcedSms() {
return SmsDatabase.Types.isForcedSms(type);
}