mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Mark incoming messages as read when seen.
This commit is contained in:
@@ -285,9 +285,15 @@ JNIEXPORT jint Java_com_b44t_messenger_MrMailbox_MrMailboxGetChatIdByContactId(J
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_MrMailbox_MrMailboxMarkseenChat(JNIEnv *env, jclass c, jlong hMailbox, jint chat_id)
|
||||
JNIEXPORT jint Java_com_b44t_messenger_MrMailbox_markseenMsg(JNIEnv *env, jclass cls, jint msg_id)
|
||||
{
|
||||
return (jlong)mrmailbox_markseen_chat((mrmailbox_t*)hMailbox, chat_id);
|
||||
return (jint)mrmailbox_markseen_msg(get_mrmailbox_t(env, cls), msg_id);
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_MrMailbox_markseenChat(JNIEnv *env, jclass cls, jint chat_id)
|
||||
{
|
||||
return (jlong)mrmailbox_markseen_chat(get_mrmailbox_t(env, cls), chat_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -148,11 +148,8 @@ public class MrMailbox {
|
||||
return new MrChat(MrMailboxGetChat(m_hMailbox, contact_id));
|
||||
}
|
||||
|
||||
public native static int markseenMsg(int id); // TODO: needs to be implemented
|
||||
|
||||
public static int markseenChat(int id) {
|
||||
return MrMailboxMarkseenChat(m_hMailbox, id);
|
||||
}
|
||||
public native static int markseenMsg (int msg_id);
|
||||
public native static int markseenChat (int chat_id);
|
||||
|
||||
public static int getChatIdByContactId (int contact_id) {
|
||||
return MrMailboxGetChatIdByContactId(m_hMailbox, contact_id);
|
||||
@@ -180,7 +177,6 @@ public class MrMailbox {
|
||||
|
||||
private native static long MrMailboxGetChatlist (long hMailbox); // returns hChatlist which must be unref'd after usage
|
||||
private native static long MrMailboxGetChat (long hMailbox, int chat_id); // return hChat which must be unref'd after usage
|
||||
private native static int MrMailboxMarkseenChat (long hMailbox, int id);
|
||||
private native static int MrMailboxGetChatIdByContactId (long hMailbox, int contact_id);
|
||||
private native static int MrMailboxCreateChatByContactId(long hMailbox, int contact_id); // returns chat_id
|
||||
private native static int[] MrMailboxGetChatMsgs (long hMailbox, int chat_id);
|
||||
|
||||
@@ -3351,7 +3351,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
messages.add(0, msgDrawObj);
|
||||
messagesDict.put(msg.id, msgDrawObj);
|
||||
chatAdapter.notifyDataSetChanged();
|
||||
scrollToLastMessage(false); // TODO: markseen
|
||||
scrollToLastMessage(false);
|
||||
MrMailbox.markseenMsg(evt_msg_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user