Adapt getFreshMsgCount() to new core.

This commit is contained in:
B. Petersen
2017-11-10 12:25:33 +01:00
parent 1c97c2e408
commit af471f4cf8
4 changed files with 10 additions and 8 deletions
+7 -6
View File
@@ -450,6 +450,13 @@ JNIEXPORT void Java_com_b44t_messenger_MrMailbox_deleteChat(JNIEnv *env, jclass
/* MrMailbox - handle messages */
JNIEXPORT jint Java_com_b44t_messenger_MrMailbox_getFreshMsgCount(JNIEnv *env, jclass cls, jint chat_id)
{
return mrmailbox_get_fresh_msg_count(get_mrmailbox_t(env, cls), chat_id);
}
JNIEXPORT jlong Java_com_b44t_messenger_MrMailbox_MrMailboxGetMsg(JNIEnv *env, jclass c, jlong hMailbox, jint id)
{
return (jlong)mrmailbox_get_msg((mrmailbox_t*)hMailbox, id);
@@ -789,12 +796,6 @@ JNIEXPORT jint Java_com_b44t_messenger_MrChat_MrChatGetDraftReplyToMsgId(JNIEnv
}
JNIEXPORT jint Java_com_b44t_messenger_MrChat_getFreshMsgCount(JNIEnv *env, jclass cls)
{
return mrchat_get_fresh_msg_count(get_mrchat_t(env, cls));
}
JNIEXPORT jint Java_com_b44t_messenger_MrChat_MrChatSetDraft(JNIEnv *env, jclass c, jlong hChat, jstring draft /* NULL=delete */, jint replyToMsgId)
{
CHAR_REF(draft);
@@ -493,7 +493,7 @@ public class ChatlistCell extends BaseCell {
public void update(int mask) {
if( m_showUnreadCount ) {
unreadCount = m_mrChat.getFreshMsgCount();
unreadCount = MrMailbox.getFreshMsgCount(m_mrChat.getId());
}
if (mask != 0) {
@@ -74,7 +74,6 @@ public class MrChat {
public int setDraft(String draft/*NULL=delete*/, long replyToMsgId) {
return MrChatSetDraft(m_hChat, draft, replyToMsgId);
}
public native int getFreshMsgCount();
private long m_hChat; // must not be renamed as referenced by JNI under the name "m_hChat"
private native static void MrChatUnref (long hChat);
@@ -165,6 +165,8 @@ public class MrMailbox {
return MrMailboxGetMsgInfo(m_hMailbox, id);
}
public static native int getFreshMsgCount(int chat_id);
public native static void deleteMsgs(int msg_ids[]);
public native static void forwardMsgs(int msg_ids[], int chat_ids);