OTR & another.im #23

Merged
Sergei Poljanski merged 65 commits from develop into master 2024-12-09 18:42:00 +00:00
2 changed files with 6 additions and 10 deletions
Showing only changes of commit 95ee8459b8 - Show all commits

View file

@ -775,10 +775,10 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
handler.postDelayed(refreshTitleRunnable, 5000L); handler.postDelayed(refreshTitleRunnable, 5000L);
} else if (conversation.getMode() == Conversation.MODE_SINGLE) { } else if (conversation.getMode() == Conversation.MODE_SINGLE) {
Contact contact = conversation.getContact(); Contact contact = conversation.getContact();
if (showLastSeen List<String> statuses = contact.getPresences().getStatusMessages();
&& contact.getLastseen() > 0 if (!statuses.isEmpty() && !statuses.get(0).isBlank()) {
&& contact.getPresences().allOrNonSupport(Namespace.IDLE)) { actionBar.setSubtitle(statuses.get(0));
actionBar.setSubtitle(UIHelper.lastseen(getApplicationContext(), contact.isActive(), contact.getLastseen(), true)); handler.postDelayed(refreshTitleRunnable, 5000L);
} else { } else {
actionBar.setSubtitle(""); actionBar.setSubtitle("");
handler.removeCallbacks(refreshTitleRunnable); handler.removeCallbacks(refreshTitleRunnable);

View file

@ -49,15 +49,11 @@ class PresenceIndicator : View {
fun setStatus(contact: Contact?) { fun setStatus(contact: Contact?) {
val status = contact?.shownStatus val status = contact?.shownStatus
if ((status == Presence.Status.ONLINE || status == Presence.Status.CHAT) && if (status != this.status) {
(contact.lastseen <= 0 || !contact.presences.allOrNonSupport(Namespace.IDLE) || ((System.currentTimeMillis() - contact.lastseen) / 1000) > 60)) {
this.status = null
} else {
this.status = status this.status = status
}
invalidate() invalidate()
} }
}
override fun onDraw(canvas: Canvas) { override fun onDraw(canvas: Canvas) {
super.onDraw(canvas) super.onDraw(canvas)