mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-24 16:31:28 +00:00
Change TS Media message timestamp from received time to sent time
Fix #3525 Closes #3535 //FREEBIE
This commit is contained in:
parent
038f24f394
commit
fe5e101463
@ -311,13 +311,7 @@ public class ConversationItem extends LinearLayout
|
|||||||
|
|
||||||
secureImage.setVisibility(messageRecord.isSecure() ? View.VISIBLE : View.GONE);
|
secureImage.setVisibility(messageRecord.isSecure() ? View.VISIBLE : View.GONE);
|
||||||
bodyText.setCompoundDrawablesWithIntrinsicBounds(0, 0, messageRecord.isKeyExchange() ? R.drawable.ic_menu_login : 0, 0);
|
bodyText.setCompoundDrawablesWithIntrinsicBounds(0, 0, messageRecord.isKeyExchange() ? R.drawable.ic_menu_login : 0, 0);
|
||||||
|
dateText.setText(DateUtils.getExtendedRelativeTimeSpanString(getContext(), locale, messageRecord.getTimestamp()));
|
||||||
final long timestamp;
|
|
||||||
|
|
||||||
if (messageRecord.isPush()) timestamp = messageRecord.getDateSent();
|
|
||||||
else timestamp = messageRecord.getDateReceived();
|
|
||||||
|
|
||||||
dateText.setText(DateUtils.getExtendedRelativeTimeSpanString(getContext(), locale, timestamp));
|
|
||||||
|
|
||||||
if (messageRecord.isFailed()) {
|
if (messageRecord.isFailed()) {
|
||||||
setFailedStatusIcons();
|
setFailedStatusIcons();
|
||||||
@ -471,7 +465,7 @@ public class ConversationItem extends LinearLayout
|
|||||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
intent.setDataAndType(slide.getUri(), slide.getContentType());
|
intent.setDataAndType(slide.getUri(), slide.getContentType());
|
||||||
if (!messageRecord.isOutgoing()) intent.putExtra(MediaPreviewActivity.RECIPIENT_EXTRA, recipient.getRecipientId());
|
if (!messageRecord.isOutgoing()) intent.putExtra(MediaPreviewActivity.RECIPIENT_EXTRA, recipient.getRecipientId());
|
||||||
intent.putExtra(MediaPreviewActivity.DATE_EXTRA, messageRecord.getDateReceived());
|
intent.putExtra(MediaPreviewActivity.DATE_EXTRA, messageRecord.getTimestamp());
|
||||||
|
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
|
@ -482,13 +482,8 @@ public class ThreadDatabase extends Database {
|
|||||||
MessageRecord record;
|
MessageRecord record;
|
||||||
|
|
||||||
if (reader != null && (record = reader.getNext()) != null) {
|
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),
|
updateThread(threadId, count, record.getBody().getBody(), getAttachmentUriFor(record),
|
||||||
timestamp, record.getDeliveryStatus(), record.getReceiptCount(),
|
record.getTimestamp(), record.getDeliveryStatus(), record.getReceiptCount(),
|
||||||
record.getType(), unarchive);
|
record.getType(), unarchive);
|
||||||
notifyConversationListListeners();
|
notifyConversationListListeners();
|
||||||
return false;
|
return false;
|
||||||
|
@ -115,6 +115,11 @@ public abstract class MessageRecord extends DisplayRecord {
|
|||||||
return SmsDatabase.Types.isPushType(type) && !SmsDatabase.Types.isForcedSms(type);
|
return SmsDatabase.Types.isPushType(type) && !SmsDatabase.Types.isForcedSms(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getTimestamp() {
|
||||||
|
if (isPush()) return getDateSent();
|
||||||
|
else return getDateReceived();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isForcedSms() {
|
public boolean isForcedSms() {
|
||||||
return SmsDatabase.Types.isForcedSms(type);
|
return SmsDatabase.Types.isForcedSms(type);
|
||||||
}
|
}
|
||||||
|
@ -349,10 +349,8 @@ public class MessageNotifier {
|
|||||||
CharSequence body = record.getDisplayBody();
|
CharSequence body = record.getDisplayBody();
|
||||||
Recipients threadRecipients = null;
|
Recipients threadRecipients = null;
|
||||||
SlideDeck slideDeck = null;
|
SlideDeck slideDeck = null;
|
||||||
long timestamp;
|
long timestamp = record.getTimestamp();
|
||||||
|
|
||||||
if (record.isPush()) timestamp = record.getDateSent();
|
|
||||||
else timestamp = record.getDateReceived();
|
|
||||||
|
|
||||||
if (threadId != -1) {
|
if (threadId != -1) {
|
||||||
threadRecipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);
|
threadRecipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user