Prepare for BLOB-handling.

This commit is contained in:
B. Petersen
2016-10-02 13:21:42 +02:00
parent 37b1f06f00
commit 5babc3d512
4 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -57,10 +57,12 @@ JNIEXPORT jlong Java_org_telegram_messenger_MrMailbox_MrMailboxNew(JNIEnv *env,
/* MrMailbox - open/close/connect/fetch */
JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrMailboxOpen(JNIEnv *env, jclass c, jlong hMailbox, jstring dbfile)
JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrMailboxOpen(JNIEnv *env, jclass c, jlong hMailbox, jstring dbfile, jstring blobdir)
{
CHAR_REF(dbfile);
jint ret = mrmailbox_open((mrmailbox_t*)hMailbox, dbfilePtr);
CHAR_REF(blobdir);
jint ret = mrmailbox_open((mrmailbox_t*)hMailbox, dbfilePtr, blobdirPtr);
CHAR_UNREF(blobdir);
CHAR_UNREF(dbfile)
return ret;
}
@@ -281,7 +281,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.MrMailboxOpen(MrMailbox.hMailbox, dbfile.getAbsolutePath(), "");
}
@Override
@@ -57,7 +57,7 @@ public class MrMailbox {
// MrMailbox objects
public native static long MrMailboxNew (); // returns hMailbox which must be unref'd after usage (Names as mrmailbox_new don't work due to the additional underscore)
public native static int MrMailboxOpen (long hMailbox, String dbfile);
public native static int MrMailboxOpen (long hMailbox, String dbfile, String blobdir);
public native static void MrMailboxClose (long hMailbox);
public native static int MrMailboxConnect (long hMailbox);
@@ -980,7 +980,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (currentEncryptedChat != null) {
timeItem2 = headerItem.addSubItem(chat_enc_timer, LocaleController.getString("SetTimer", R.string.SetTimer), 0);
}
/* EDIT BY MR -- it's not yet clear how messages should be deleted and/or chats can be leaved; disable this for the moment
/* EDIT BY MR -- it's not yet clear if and how messages can be deleted and/or chats can be leaved; disable this for the moment
if (!ChatObject.isChannel(currentChat)) {
headerItem.addSubItem(clear_history, LocaleController.getString("ClearHistory", R.string.ClearHistory), 0);
if (currentChat != null && !isBroadcast) {