mirror of
https://github.com/WuKongIM/WuKongIMAndroidSDK
synced 2025-06-06 09:08:33 +00:00
修改查询未读消息错位问题
This commit is contained in:
parent
f25f6ce1a9
commit
38c916f1d2
Binary file not shown.
@ -1 +1 @@
|
||||
0f10025815cc3b3a056bbf80206e8eb0
|
||||
333292b76b1e8ad69a2818d5e07c54cf
|
@ -1 +1 @@
|
||||
e87d6e5bf997e0afc996543cd9f4b0c9eb807d71
|
||||
ff44e564273451158eb7b3a8a058c709003ca6bf
|
@ -1 +1 @@
|
||||
0d930b968b9478cbac3f4ad19a8ee6337f53c3d11cf508be5c3e34394c7100a1
|
||||
05a65aae19523c40972bc6b45297b151c0180b35f1a1814d45fa63bf9832f7c2
|
@ -1 +1 @@
|
||||
552b58a2c784495d09379f18a96d7852a7676162c88b981322be99d88305fad868f216817dcf90f5b58e71aaab9354d84743842c74197c8f9287e2e0198e16b9
|
||||
cafa49ce7676b24140f3f26abc1a477f1a346b70198834ae3f45c6f26d2b0fad89f8a1ee207cf9f058491b850bc41c4a8b7dc838fec819380f996804bcd81547
|
@ -8,6 +8,6 @@
|
||||
<versions>
|
||||
<version>1.0.1</version>
|
||||
</versions>
|
||||
<lastUpdated>20230620112658</lastUpdated>
|
||||
<lastUpdated>20230626111553</lastUpdated>
|
||||
</versioning>
|
||||
</metadata>
|
||||
|
@ -1 +1 @@
|
||||
68684efbe4367ca3e93e9e2de3b4bbe6
|
||||
f48c460f92fc1ee9b0bd8974a9553507
|
@ -1 +1 @@
|
||||
204705418f2c471bd0cc45d0c1ed7aac895e0473
|
||||
bd9945005606fc498af5030a1f96d8d58297dbca
|
@ -1 +1 @@
|
||||
423550f9f280d46f4dcfe91d2d1700d51221f95b141e3b0c24d5d6dc69242450
|
||||
b495b7552814cb94748400f19d8fc8e7ee3d69e6fcfce8371bc645fab48975fa
|
@ -1 +1 @@
|
||||
59c51a68cbd57fa15cad20c4443378061195145dfb48aa343450fa3c05239bfcd08d3f479b1000bef3aaa622ee53f9672a60462d569dfd824e42199d38cc07cf
|
||||
1629ee0f00564e9526d3143f71253963040d65a34d04b0af3635e2c957747f6b2f2e52cad0249d086c2795e7a0ba231f7ea48b5730f908e9c0d4246caebbc2aa
|
@ -8,6 +8,7 @@ import static com.xinbida.wukongim.db.WKDBColumns.TABLE.messageExtra;
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.xinbida.wukongim.WKIM;
|
||||
import com.xinbida.wukongim.WKIMApplication;
|
||||
@ -59,7 +60,6 @@ public class MsgDbManager {
|
||||
public void getOrSyncHistoryMessages(String channelId, byte channelType, long oldestOrderSeq, boolean contain, int pullMode, int limit, final IGetOrSyncHistoryMsgBack iGetOrSyncHistoryMsgBack) {
|
||||
//获取原始数据
|
||||
List<WKMsg> list = getMessages(channelId, channelType, oldestOrderSeq, contain, pullMode, limit);
|
||||
|
||||
//业务判断数据
|
||||
List<WKMsg> tempList = new ArrayList<>();
|
||||
for (int i = 0, size = list.size(); i < size; i++) {
|
||||
@ -80,18 +80,10 @@ public class MsgDbManager {
|
||||
minMessageSeq = tempList.get(i).messageSeq;
|
||||
}
|
||||
}
|
||||
|
||||
//是否同步消息
|
||||
boolean isSyncMsg = false;
|
||||
//reverse false:从区间大值开始拉取true:从区间小值开始拉取
|
||||
boolean reverse = false;
|
||||
long startMsgSeq = 0;
|
||||
long endMsgSeq = 0;
|
||||
//同步消息的最大messageSeq
|
||||
// long syncMaxMsgSeq = 0;
|
||||
//同步消息最小messageSeq,
|
||||
// long syncMinMsgSeq = 0;
|
||||
|
||||
//判断页与页之间是否连续
|
||||
long oldestMsgSeq;
|
||||
|
||||
@ -103,21 +95,15 @@ public class MsgDbManager {
|
||||
//下拉获取消息
|
||||
if (maxMessageSeq != 0 && oldestMsgSeq != 0 && oldestMsgSeq - maxMessageSeq > 1) {
|
||||
isSyncMsg = true;
|
||||
// syncMaxMsgSeq = oldestMsgSeq;
|
||||
// syncMinMsgSeq = maxMessageSeq;
|
||||
startMsgSeq = maxMessageSeq;
|
||||
endMsgSeq = oldestMsgSeq;
|
||||
reverse = false;//区间大值开始获取
|
||||
}
|
||||
} else {
|
||||
//上拉获取消息
|
||||
if (minMessageSeq != 0 && oldestMsgSeq != 0 && minMessageSeq - oldestMsgSeq > 1) {
|
||||
isSyncMsg = true;
|
||||
// syncMaxMsgSeq = minMessageSeq;
|
||||
// syncMinMsgSeq = oldestMsgSeq;
|
||||
startMsgSeq = minMessageSeq;
|
||||
endMsgSeq = oldestMsgSeq;
|
||||
reverse = true;//区间小值开始获取
|
||||
startMsgSeq = oldestMsgSeq;
|
||||
endMsgSeq = minMessageSeq;
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,48 +155,15 @@ public class MsgDbManager {
|
||||
if (pullMode == 0) {
|
||||
//如果下拉获取数据
|
||||
isSyncMsg = true;
|
||||
reverse = false;//从区间大值开始获取数据
|
||||
// syncMinMsgSeq = 0;
|
||||
// syncMaxMsgSeq = oldestMsgSeq;
|
||||
startMsgSeq = oldestMsgSeq;
|
||||
endMsgSeq = 0;
|
||||
} else {
|
||||
//如果上拉获取数据
|
||||
isSyncMsg = true;
|
||||
reverse = true;//从区间小值开始获取数据
|
||||
// syncMaxMsgSeq = 0;
|
||||
// syncMinMsgSeq = maxMessageSeq;
|
||||
startMsgSeq = oldestMsgSeq;
|
||||
endMsgSeq = 0;
|
||||
}
|
||||
}
|
||||
// if (!isContain) {
|
||||
// isSyncMsg = true;
|
||||
// if (dropDown) {
|
||||
// reverse = false;//从区间大值开始获取数据
|
||||
// syncMinMsgSeq = 0;
|
||||
// syncMaxMsgSeq = oldestMsgSeq;
|
||||
// }else {
|
||||
// reverse = true;//从区间小值开始获取数据
|
||||
// syncMaxMsgSeq = 0;
|
||||
// syncMinMsgSeq = oldestMsgSeq;
|
||||
// }
|
||||
// }
|
||||
// 如果提醒的某条消息未在本地同步消息范围内,则将该范围缩小到需要同步到消息序号上
|
||||
// if (oldestMsgSeq != 0) {
|
||||
// if (reverse) {
|
||||
// // 从大开始同步
|
||||
// if (oldestMsgSeq < syncMaxMsgSeq - limit) {
|
||||
// syncMaxMsgSeq = oldestMsgSeq + 3;
|
||||
// }
|
||||
// } else {
|
||||
// // 从小开始同步
|
||||
// if (oldestMsgSeq > syncMinMsgSeq + limit) {
|
||||
// syncMinMsgSeq = oldestMsgSeq - 3;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (isSyncMsg && startMsgSeq != endMsgSeq && requestCount < 5) {
|
||||
//同步消息
|
||||
requestCount++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user