don't use jabber last seen in status calculations
This commit is contained in:
parent
021552b1d4
commit
95ee8459b8
|
@ -775,10 +775,10 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
|
|||
handler.postDelayed(refreshTitleRunnable, 5000L);
|
||||
} else if (conversation.getMode() == Conversation.MODE_SINGLE) {
|
||||
Contact contact = conversation.getContact();
|
||||
if (showLastSeen
|
||||
&& contact.getLastseen() > 0
|
||||
&& contact.getPresences().allOrNonSupport(Namespace.IDLE)) {
|
||||
actionBar.setSubtitle(UIHelper.lastseen(getApplicationContext(), contact.isActive(), contact.getLastseen(), true));
|
||||
List<String> statuses = contact.getPresences().getStatusMessages();
|
||||
if (!statuses.isEmpty() && !statuses.get(0).isBlank()) {
|
||||
actionBar.setSubtitle(statuses.get(0));
|
||||
handler.postDelayed(refreshTitleRunnable, 5000L);
|
||||
} else {
|
||||
actionBar.setSubtitle("");
|
||||
handler.removeCallbacks(refreshTitleRunnable);
|
||||
|
|
|
@ -49,15 +49,11 @@ class PresenceIndicator : View {
|
|||
|
||||
fun setStatus(contact: Contact?) {
|
||||
val status = contact?.shownStatus
|
||||
if ((status == Presence.Status.ONLINE || status == Presence.Status.CHAT) &&
|
||||
(contact.lastseen <= 0 || !contact.presences.allOrNonSupport(Namespace.IDLE) || ((System.currentTimeMillis() - contact.lastseen) / 1000) > 60)) {
|
||||
this.status = null
|
||||
} else {
|
||||
if (status != this.status) {
|
||||
this.status = status
|
||||
}
|
||||
|
||||
invalidate()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
|
|
Loading…
Reference in a new issue