mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
load contact from database before calling wasSeenRecently() (#2382)
* load contact from database before calling wasSeenRecently() in ConversationActivity.handleEvent() * add a comment about why handling DC_EVENT_MSG_DELIVERED is needed
This commit is contained in:
committed by
GitHub
parent
5261d53412
commit
1252b862d8
@@ -270,8 +270,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
if (!isMultiUser()) {
|
||||
eventCenter.addObserver(DcContext.DC_EVENT_INCOMING_MSG, this);
|
||||
eventCenter.addObserver(DcContext.DC_EVENT_MSG_DELIVERED, this);
|
||||
eventCenter.addObserver(DcContext.DC_EVENT_MSG_READ, this);
|
||||
// handle DC_EVENT_MSG_DELIVERED to hide the seen-recently indicator if needed:
|
||||
eventCenter.addObserver(DcContext.DC_EVENT_MSG_DELIVERED, this);
|
||||
}
|
||||
|
||||
if (isForwarding(this)) {
|
||||
@@ -1580,7 +1581,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
|| eventId == DcContext.DC_EVENT_MSG_DELIVERED)
|
||||
&& event.getData1Int() == chatId) {
|
||||
DcContact contact = recipient.getDcContact();
|
||||
titleView.setSeenRecently(contact!=null? contact.wasSeenRecently() : false);
|
||||
titleView.setSeenRecently(contact!=null? dcContext.getContact(contact.getId()).wasSeenRecently() : false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user