Mark incoming messages as read when seen.

This commit is contained in:
B. Petersen
2016-12-05 22:56:02 +01:00
parent 1036139cb7
commit a59be9d2af
3 changed files with 12 additions and 9 deletions
@@ -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);
}
}
}