mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -1860,6 +1860,11 @@ JNIEXPORT jlong Java_com_b44t_messenger_DcContact_getLastSeen(JNIEnv *env, jobje
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jboolean Java_com_b44t_messenger_DcContact_wasSeenRecently(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return (jboolean)(dc_contact_was_seen_recently(get_dc_contact(env, obj))!=0);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean Java_com_b44t_messenger_DcContact_isBlocked(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return (jboolean)(dc_contact_is_blocked(get_dc_contact(env, obj))!=0);
|
||||
|
||||
+1
-1
Submodule jni/deltachat-core-rust updated: a345d65c61...b77df71642
@@ -1,9 +1,5 @@
|
||||
package com.b44t.messenger;
|
||||
|
||||
import org.thoughtcrime.securesms.util.DateUtils;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class DcContact {
|
||||
|
||||
public final static int DC_CONTACT_ID_SELF = 1;
|
||||
@@ -50,10 +46,6 @@ public class DcContact {
|
||||
return getAddr();
|
||||
}
|
||||
|
||||
public boolean isSeenRecently() {
|
||||
return DateUtils.isWithin(getLastSeen(), 10, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
public native int getId ();
|
||||
public native String getName ();
|
||||
public native String getDisplayName ();
|
||||
@@ -63,6 +55,7 @@ public class DcContact {
|
||||
public native int getColor ();
|
||||
public native String getStatus ();
|
||||
public native long getLastSeen ();
|
||||
public native boolean wasSeenRecently();
|
||||
public native boolean isBlocked ();
|
||||
public native boolean isVerified ();
|
||||
|
||||
|
||||
@@ -1571,7 +1571,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
|| eventId == DcContext.DC_EVENT_MSG_DELIVERED)
|
||||
&& event.getData1Int() == chatId) {
|
||||
DcContact contact = recipient.getDcContact();
|
||||
titleView.setSeenRecently(contact!=null? contact.isSeenRecently() : false);
|
||||
titleView.setSeenRecently(contact!=null? contact.wasSeenRecently() : false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ public class ConversationListItem extends RelativeLayout
|
||||
if (contact == null) {
|
||||
avatar.setSeenRecently(false);
|
||||
} else {
|
||||
avatar.setSeenRecently(contact.isSeenRecently());
|
||||
avatar.setSeenRecently(contact.wasSeenRecently());
|
||||
if (contact.isVerified() || DcHelper.getContext(getContext()).getChat((int)chatId).isDeviceTalk()) {
|
||||
imgRight = R.drawable.ic_verified;
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public class ConversationListItem extends RelativeLayout
|
||||
|
||||
setBatchState(false);
|
||||
avatar.setAvatar(glideRequests, recipient, false);
|
||||
avatar.setSeenRecently(contact.isSeenRecently());
|
||||
avatar.setSeenRecently(contact.wasSeenRecently());
|
||||
}
|
||||
|
||||
public void bind(@NonNull DcMsg messageResult,
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ConversationTitleView extends RelativeLayout {
|
||||
if (dcContact.isVerified()) {
|
||||
imgRight = R.drawable.ic_verified;
|
||||
}
|
||||
isOnline = dcContact.isSeenRecently();
|
||||
isOnline = dcContact.wasSeenRecently();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class ConversationTitleView extends RelativeLayout {
|
||||
|
||||
public void setTitle(@NonNull GlideRequests glideRequests, @NonNull DcContact contact) {
|
||||
avatar.setAvatar(glideRequests, new Recipient(getContext(), contact), false);
|
||||
avatar.setSeenRecently(contact.isSeenRecently());
|
||||
avatar.setSeenRecently(contact.wasSeenRecently());
|
||||
title.setText(contact.getDisplayName());
|
||||
title.setCompoundDrawablesWithIntrinsicBounds(0, 0, contact.isVerified()? R.drawable.ic_verified : 0, 0);
|
||||
subtitle.setText(contact.getAddr());
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
|
||||
}
|
||||
}
|
||||
this.avatar.setAvatar(glideRequests, recipient, false);
|
||||
this.avatar.setSeenRecently(contact!=null? contact.isSeenRecently() : false);
|
||||
this.avatar.setSeenRecently(contact!=null? contact.wasSeenRecently() : false);
|
||||
|
||||
setText(name, number, label, contact);
|
||||
setEnabled(enabled);
|
||||
@@ -144,7 +144,7 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
|
||||
Util.runOnMain(() -> {
|
||||
avatar.setAvatar(glideRequests, recipient, false);
|
||||
DcContact contact = recipient.getDcContact();
|
||||
avatar.setSeenRecently(contact!=null? contact.isSeenRecently() : false);
|
||||
avatar.setSeenRecently(contact!=null? contact.wasSeenRecently() : false);
|
||||
nameView.setText(recipient.toShortString());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class DateUtils extends android.text.format.DateUtils {
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = DateUtils.class.getSimpleName();
|
||||
|
||||
public static boolean isWithin(final long millis, final long span, final TimeUnit unit) {
|
||||
private static boolean isWithin(final long millis, final long span, final TimeUnit unit) {
|
||||
return System.currentTimeMillis() - millis <= unit.toMillis(span);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user