mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Support IDLE and POLL.
This commit is contained in:
@@ -1643,7 +1643,6 @@ LOCAL_SRC_FILES += \
|
||||
../../../messenger-backend/src/mrcontact.c \
|
||||
../../../messenger-backend/src/mrcontactlist.c \
|
||||
../../../messenger-backend/src/mrimap.c \
|
||||
../../../messenger-backend/src/mrimfparser.c \
|
||||
../../../messenger-backend/src/mrjob.c \
|
||||
../../../messenger-backend/src/mrlog.c \
|
||||
../../../messenger-backend/src/mrloginparam.c \
|
||||
|
||||
@@ -189,6 +189,12 @@ JNIEXPORT jlong Java_org_telegram_messenger_MrMailbox_MrMailboxGetChatById(JNIEn
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrMailboxMarkseenChatById(JNIEnv *env, jclass c, jlong hMailbox, jint chat_id)
|
||||
{
|
||||
return (jlong)mrmailbox_markseen_chat_by_id((mrmailbox_t*)hMailbox, chat_id);
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrMailboxCreateChatByContactId(JNIEnv *env, jclass c, jlong hMailbox, jint contact_id)
|
||||
{
|
||||
return (jint)mrmailbox_create_chat_by_contact_id((mrmailbox_t*)hMailbox, contact_id);
|
||||
@@ -356,13 +362,13 @@ JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrChatGetDraftReplyToMsgId(
|
||||
|
||||
JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrChatGetTotalMsgCount(JNIEnv *env, jclass c, jlong hChat)
|
||||
{
|
||||
return mrchat_get_total_msg_count((mrchat_t*)hChat); /* mrchat_get_unread_count() checks for nullpointers */
|
||||
return mrchat_get_total_msg_count((mrchat_t*)hChat);
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrChatGetUnreadCount(JNIEnv *env, jclass c, jlong hChat)
|
||||
JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrChatGetUnseenCount(JNIEnv *env, jclass c, jlong hChat)
|
||||
{
|
||||
return mrchat_get_unread_count((mrchat_t*)hChat); /* mrchat_get_unread_count() checks for nullpointers */
|
||||
return mrchat_get_unseen_count((mrchat_t*)hChat); /* mrchat_get_unseen_count() checks for nullpointers */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -289,6 +289,7 @@ public class ApplicationLoader extends Application {
|
||||
// EDIT BY MR - open my sqlite file (you can inspect the file eg. with "Tools / Android Device Monitor / File Explorer")
|
||||
File dbfile = new File(getFilesDirFixed(), "messenger.db");
|
||||
MrMailbox.MrMailboxOpen(MrMailbox.hMailbox, dbfile.getAbsolutePath(), "");
|
||||
MrMailbox.MrMailboxConnect(MrMailbox.hMailbox);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -216,6 +216,7 @@ public class MrMailbox {
|
||||
|
||||
public native static long MrMailboxGetChatlist (long hMailbox); // returns hChatlist which must be unref'd after usage
|
||||
public native static long MrMailboxGetChatById (long hMailbox, int id); // return hChat which must be unref'd after usage
|
||||
public native static int MrMailboxMarkseenChatById (long hMailbox, int id);
|
||||
public native static int MrMailboxCreateChatByContactId(long hMailbox, int contact_id); // returns chat_id
|
||||
public native static int[] MrMailboxGetChatMedia (long hMailbox, int chat_id, int msg_type, int or_msg_type);
|
||||
public native static long MrMailboxGetMsgById (long hMailbox, int id); // return hMsg which must be unref'd after usage
|
||||
@@ -243,7 +244,7 @@ public class MrMailbox {
|
||||
public native static long MrChatGetDraftTimestamp (long hChat); // returns 0 for "no draft"
|
||||
public native static int MrChatGetDraftReplyToMsgId (long hChat); // returns 0 for "no draft"
|
||||
public native static int MrChatSetDraft (long hChat, String draft/*NULL=delete*/, long replyToMsgId);
|
||||
public native static int MrChatGetUnreadCount (long hChat);
|
||||
public native static int MrChatGetUnseenCount (long hChat);
|
||||
public native static int MrChatGetTotalMsgCount (long hChat);
|
||||
public native static long MrChatGetSummary (long hChat); // returns hPoortext
|
||||
public native static long MrChatGetMsglist (long hChat, int offset, int amount); // returns hMsglist
|
||||
|
||||
@@ -841,7 +841,7 @@ public class DialogCell extends BaseCell {
|
||||
}
|
||||
*/
|
||||
|
||||
unreadCount = MrMailbox.MrChatGetUnreadCount(m_hChat);
|
||||
unreadCount = MrMailbox.MrChatGetUnseenCount(m_hChat);
|
||||
}
|
||||
|
||||
if (mask != 0) {
|
||||
|
||||
@@ -377,6 +377,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
// EDIT BY MR -- set up the values so that the activity gets usable
|
||||
dialog_id = arguments.getInt("chat_id", 0);
|
||||
MrMailbox.MrMailboxMarkseenChatById(MrMailbox.hMailbox, (int)dialog_id);
|
||||
m_hChat = MrMailbox.MrMailboxGetChatById(MrMailbox.hMailbox, (int)dialog_id);
|
||||
currentChat = new TLRPC.Chat();
|
||||
currentChat.id = (int)dialog_id;
|
||||
|
||||
@@ -243,20 +243,17 @@ public class MrAccountSettingsActivity extends BaseFragment {
|
||||
MrMailbox.MrMailboxSetConfig(MrMailbox.hMailbox, "send_pw", v.isEmpty() ? null : v);
|
||||
}
|
||||
|
||||
MrMailbox.MrMailboxDisconnect(MrMailbox.hMailbox);
|
||||
MrMailbox.MrMailboxConfigure(MrMailbox.hMailbox);
|
||||
if( MrMailbox.MrMailboxConnect(MrMailbox.hMailbox)!=0 ) {
|
||||
|
||||
}
|
||||
MrMailbox.MrMailboxConnect(MrMailbox.hMailbox);
|
||||
|
||||
// show dialog
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
||||
builder.setMessage("Testing the server connection, this may take a moment.");
|
||||
builder.setNeutralButton(LocaleController.getString("Cancel", R.string.Cancel), new DialogInterface.OnClickListener() {
|
||||
builder.setNeutralButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
MrMailbox.MrMailboxFetch(MrMailbox.hMailbox);
|
||||
finishFragment();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user