mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
include GIF to gallery, adapt to new API, fixes #197
This commit is contained in:
+4
-4
@@ -880,16 +880,16 @@ JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isVerified(JNIEnv *env, jobjec
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jintArray Java_com_b44t_messenger_DcContext_getChatMedia(JNIEnv *env, jobject obj, jint chat_id, jint msg_type, jint or_msg_type)
|
||||
JNIEXPORT jintArray Java_com_b44t_messenger_DcContext_getChatMedia(JNIEnv *env, jobject obj, jint chat_id, jint type1, jint type2, jint type3)
|
||||
{
|
||||
dc_array_t* ca = dc_get_chat_media(get_dc_context(env, obj), chat_id, msg_type, or_msg_type);
|
||||
dc_array_t* ca = dc_get_chat_media(get_dc_context(env, obj), chat_id, type1, type2, type3);
|
||||
return dc_array2jintArray_n_unref(env, ca);
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcContext_getNextMedia(JNIEnv *env, jobject obj, jint msg_id, jint dir)
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcContext_getNextMedia(JNIEnv *env, jobject obj, jint msg_id, jint dir, jint type1, jint type2, jint type3)
|
||||
{
|
||||
return dc_get_next_media(get_dc_context(env, obj), msg_id, dir);
|
||||
return dc_get_next_media(get_dc_context(env, obj), msg_id, dir, type1, type2, type3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -120,8 +120,8 @@ public class DcContext {
|
||||
public native int[] getChatMsgs (int chat_id, int flags, int marker1before);
|
||||
public native int[] searchMsgs (int chat_id, String query);
|
||||
public native int[] getFreshMsgs ();
|
||||
public native int[] getChatMedia (int chat_id, int msg_type, int or_msg_type);
|
||||
public native int getNextMedia (int msg_id, int dir);
|
||||
public native int[] getChatMedia (int chat_id, int type1, int type2, int type3);
|
||||
public native int getNextMedia (int msg_id, int dir, int type1, int type2, int type3);
|
||||
public native int[] getChatContacts (int chat_id);
|
||||
public native void deleteChat (int chat_id);
|
||||
public @NonNull DcMsg getMsg (int msg_id) { return new DcMsg(getMsgCPtr(msg_id)); }
|
||||
|
||||
@@ -58,7 +58,7 @@ public class BucketedThreadMediaLoader extends AsyncTaskLoader<BucketedThreadMed
|
||||
public BucketedThreadMedia loadInBackground() {
|
||||
BucketedThreadMedia result = new BucketedThreadMedia(getContext());
|
||||
DcContext context = DcHelper.getContext(getContext());
|
||||
int[] messages = context.getChatMedia(address.getDcChatId(), DcMsg.DC_MSG_IMAGE, DcMsg.DC_MSG_VIDEO);
|
||||
int[] messages = context.getChatMedia(address.getDcChatId(), DcMsg.DC_MSG_IMAGE, DcMsg.DC_MSG_GIF, DcMsg.DC_MSG_VIDEO);
|
||||
for(int nextId : messages) {
|
||||
result.add(context.getMsg(nextId));
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class PagingMediaLoader extends AsyncLoader<DcMediaGalleryElement> {
|
||||
@Override
|
||||
public DcMediaGalleryElement loadInBackground() {
|
||||
DcContext context = DcHelper.getContext(getContext());
|
||||
int[] mediaMessages = context.getChatMedia(msg.getChatId(), DcMsg.DC_MSG_IMAGE, DcMsg.DC_MSG_VIDEO);
|
||||
int[] mediaMessages = context.getChatMedia(msg.getChatId(), DcMsg.DC_MSG_IMAGE, DcMsg.DC_MSG_GIF, DcMsg.DC_MSG_VIDEO);
|
||||
// first id is the oldest message.
|
||||
int currentIndex = -1;
|
||||
for(int ii = 0; ii < mediaMessages.length; ii++) {
|
||||
|
||||
Reference in New Issue
Block a user