mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
adapt to location-rendering-api
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.b44t.messenger;
|
||||
|
||||
public class DcArray {
|
||||
|
||||
public DcArray(long arrayCPtr) {
|
||||
this.arrayCPtr = arrayCPtr;
|
||||
}
|
||||
|
||||
@Override protected void finalize() throws Throwable {
|
||||
super.finalize();
|
||||
unrefArrayCPtr();
|
||||
arrayCPtr = 0;
|
||||
}
|
||||
|
||||
public native int getCnt ();
|
||||
public native float getLatitude (int index);
|
||||
public native float getLongitude(int index);
|
||||
public native float getAccuracy (int index);
|
||||
public native long getTimestamp(int index);
|
||||
public native int getMsgId (int index);
|
||||
|
||||
// working with raw c-data
|
||||
private long arrayCPtr; // CAVE: the name is referenced in the JNI
|
||||
private native void unrefArrayCPtr();
|
||||
}
|
||||
@@ -21,6 +21,7 @@ public class DcContext {
|
||||
public final static int DC_EVENT_MSG_READ = 2015;
|
||||
public final static int DC_EVENT_CHAT_MODIFIED = 2020;
|
||||
public final static int DC_EVENT_CONTACTS_CHANGED = 2030;
|
||||
public final static int DC_EVENT_LOCATION_CHANGED = 2035;
|
||||
public final static int DC_EVENT_CONFIGURE_PROGRESS = 2041;
|
||||
public final static int DC_EVENT_IMEX_PROGRESS = 2051;
|
||||
public final static int DC_EVENT_IMEX_FILE_WRITTEN = 2052;
|
||||
@@ -154,6 +155,7 @@ public class DcContext {
|
||||
public native int joinSecurejoin (String qr);
|
||||
public native void sendLocationsToChat (int chat_id, int seconds);
|
||||
public native boolean isSendingLocationsToChat(int chat_id);
|
||||
public @NonNull DcArray getLocations (int chat_id, int contact_id) { return new DcArray(getLocationsCPtr(chat_id, contact_id)); }
|
||||
|
||||
/**
|
||||
* @return true if at least one chat has location streaming enabled
|
||||
@@ -180,4 +182,5 @@ public class DcContext {
|
||||
private native long getMsgCPtr (int id);
|
||||
private native long getDraftCPtr (int id);
|
||||
private native long getContactCPtr (int id);
|
||||
private native long getLocationsCPtr (int chat_id, int contact_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user