mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
add native function for getting chat-ids from chatlist
This commit is contained in:
+7
-1
@@ -727,12 +727,18 @@ JNIEXPORT void Java_com_b44t_messenger_DcChatlist_DcChatlistUnref(JNIEnv *env, j
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcChatlist_getCnt(JNIEnv *env, jobject obj, jlong hChatlist)
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcChatlist_getCnt(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return dc_chatlist_get_cnt(get_dc_chatlist(env, obj));
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcChatlist_getChatId(JNIEnv *env, jobject obj, jint index)
|
||||
{
|
||||
return dc_chatlist_get_chat_id(get_dc_chatlist(env, obj), index);
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jlong Java_com_b44t_messenger_DcChatlist_DcChatlistGetChatByIndex(JNIEnv *env, jclass c, jlong hChatlist, jint index)
|
||||
{
|
||||
dc_chatlist_t* chatlist = (dc_chatlist_t*)hChatlist;
|
||||
|
||||
@@ -36,9 +36,10 @@ public class DcChatlist {
|
||||
}
|
||||
|
||||
public native int getCnt();
|
||||
public DcChat getChatByIndex(int index) { return new DcChat(DcChatlistGetChatByIndex(m_hChatlist, index)); }
|
||||
public DcMsg getMsgByIndex(int index) { return new DcMsg(DcChatlistGetMsgByIndex(m_hChatlist, index)); }
|
||||
public DcLot getSummaryByIndex(int index, DcChat chat) { return new DcLot(DcChatlistGetSummaryByIndex(m_hChatlist, index, chat==null? null : chat.getCPtr())); }
|
||||
public native int getChatId(int index);
|
||||
public DcChat getChat(int index) { return new DcChat(DcChatlistGetChatByIndex(m_hChatlist, index)); }
|
||||
public DcMsg getMsg(int index) { return new DcMsg(DcChatlistGetMsgByIndex(m_hChatlist, index)); }
|
||||
public DcLot getSummary(int index, DcChat chat) { return new DcLot(DcChatlistGetSummaryByIndex(m_hChatlist, index, chat==null? null : chat.getCPtr())); }
|
||||
|
||||
// working with raw c-data
|
||||
private long m_hChatlist; // must not be renamed as referenced by JNI
|
||||
|
||||
Reference in New Issue
Block a user