mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Prepare forwarding messages.
This commit is contained in:
@@ -137,6 +137,29 @@ static jintArray carray2jintArray_n_carray_free(JNIEnv *env, const carray* ca)
|
||||
}
|
||||
|
||||
|
||||
static int* jintArray2uint32Pointer(JNIEnv* env, jintArray ja, int* icnt)
|
||||
{
|
||||
uint32_t* ret = NULL;
|
||||
const jint* temp;
|
||||
int i;
|
||||
if( env && ja && icnt ) {
|
||||
temp = (*env)->GetIntArrayElements(env, ja, NULL);
|
||||
*icnt = (*env)->GetArrayLength(env, ja);
|
||||
if( temp && *icnt > 0 ) {
|
||||
ret = calloc(icnt, sizeof(uint32_t));
|
||||
if( ret ) {
|
||||
for( i = 0; i < icnt; i++ ) {
|
||||
ret[i] = (uint32_t)temp[i];
|
||||
}
|
||||
}
|
||||
(*env)->ReleaseIntArrayElements(env, ja, temp, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* MrMailbox
|
||||
******************************************************************************/
|
||||
@@ -401,9 +424,20 @@ JNIEXPORT jstring Java_com_b44t_messenger_MrMailbox_MrMailboxGetMsgInfo(JNIEnv *
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void Java_com_b44t_messenger_MrMailbox_MrMailboxDeleteMsg(JNIEnv *env, jclass c, jlong hMailbox, jint id)
|
||||
JNIEXPORT void Java_com_b44t_messenger_MrMailbox_deleteMsg(JNIEnv *env, jclass cls, jint id)
|
||||
{
|
||||
mrmailbox_delete_msg((mrmailbox_t*)hMailbox, id);
|
||||
mrmailbox_delete_msg(get_mrmailbox_t(env, cls), id);
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void Java_com_b44t_messenger_MrMailbox_forwardMsgs(JNIEnv *env, jclass cls, jintArray msg_ids, jintArray contact_ids)
|
||||
{
|
||||
int msg_ids_cnt, contact_ids_cnt;
|
||||
const int* msg_ids_ptr = jintArray2uint32Pointer(env, msg_ids, &msg_ids_cnt);
|
||||
const int* contact_ids_ptr = jintArray2uint32Pointer(env, contact_ids, &contact_ids_cnt);
|
||||
mrmailbox_forward_msgs(get_mrmailbox_t(env, cls), msg_ids_ptr, msg_ids_cnt, contact_ids_ptr, contact_ids_cnt);
|
||||
free(msg_ids_ptr);
|
||||
free(contact_ids_ptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -173,13 +173,11 @@ public class MrMailbox {
|
||||
return MrMailboxGetMsgInfo(m_hMailbox, id);
|
||||
}
|
||||
|
||||
public static void deleteMsg(int id) {
|
||||
MrMailboxDeleteMsg(m_hMailbox, id);
|
||||
}
|
||||
public native static void deleteMsg(int id);
|
||||
public native static void forwardMsg(int msg_ids[], int contact_ids[]);
|
||||
|
||||
private native static long MrMailboxGetMsg (long hMailbox, int id); // return hMsg which must be unref'd after usage
|
||||
private native static String MrMailboxGetMsgInfo (long hMailbox, int id);
|
||||
private native static void MrMailboxDeleteMsg (long hMailbox, int id);
|
||||
|
||||
// static
|
||||
private native static void MrStockAddStr (int id, String str);
|
||||
|
||||
@@ -447,19 +447,17 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
return;
|
||||
}
|
||||
createDeleteMessagesAlert();
|
||||
} else if (id == id_forward) {
|
||||
Toast.makeText(getParentActivity(), LocaleController.getString("NotYetImplemented", R.string.NotYetImplemented), Toast.LENGTH_SHORT).show();
|
||||
/*
|
||||
}
|
||||
else if (id == id_forward)
|
||||
{
|
||||
Bundle args = new Bundle();
|
||||
args.putBoolean("onlySelect", true);
|
||||
args.putInt("dialogsType", 1);
|
||||
DialogsActivity fragment = new DialogsActivity(args);
|
||||
fragment.setDelegate(ChatActivity.this);
|
||||
presentFragment(fragment);
|
||||
*/
|
||||
actionBar.hideActionMode();
|
||||
updateVisibleRows();
|
||||
} else if ( id == id_delete_chat) {
|
||||
presentFragment(fragment); // this results in a call to didSelectDialog()
|
||||
}
|
||||
else if ( id == id_delete_chat)
|
||||
{
|
||||
// as the history may be a mix of messenger-messages and e-mails, it is not safe to delete it.
|
||||
// the user can delete explicit messages or use his e-mail programm to delete masses.
|
||||
if (getParentActivity() == null) {
|
||||
@@ -2586,7 +2584,16 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
|
||||
@Override
|
||||
public void didSelectDialog(DialogsActivity activity, long did, boolean param) {
|
||||
public void didSelectDialog(DialogsActivity dialogsFragment, long did, boolean param) {
|
||||
|
||||
Toast.makeText(getParentActivity(), LocaleController.getString("NotYetImplemented", R.string.NotYetImplemented), Toast.LENGTH_SHORT).show();
|
||||
|
||||
actionBar.hideActionMode();
|
||||
updateVisibleRows();
|
||||
|
||||
dialogsFragment.finishFragment(true);
|
||||
|
||||
/*
|
||||
if (dialog_id != 0 && (forwaringMessage != null || !selectedMessagesIds.isEmpty() )) {
|
||||
if (forwaringMessage != null) {
|
||||
forwaringMessage = null;
|
||||
@@ -2626,6 +2633,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
updateVisibleRows();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user