Commit 609951c8 by 杨铁龙

Merge commit 'd7ef878e' into ytl003

parents 723eb400 d7ef878e
Showing with 18 additions and 6 deletions
......@@ -90,7 +90,12 @@ function buildChatItem(chat: RawChatItem) {
const filterActiveChats = (items: RawChatItem[]) => {
return items.filter(
(i) => !i.is_finish && !i.is_exited && !i.is_remove && !i.is_deleted
(i) =>
!i.is_finish &&
!i.is_exited &&
!i.is_remove &&
!i.is_deleted &&
i.type === "group"
);
};
......@@ -378,10 +383,10 @@ export default {
list: cache,
total: 9999,
});
const ts = cache.map((i) => i.last_msg_ts).sort();
const ts = cache
.map((i) => Math.max(i.last_msg_ts, i.update_time))
.sort();
const last = ts[ts.length - 1];
await xim.fetchChatListAfter(last)!.then((r) => {
const list = filterActiveChats(r.args[0] as RawChatItem[]);
const items = list.map((i) => buildChatItem(i));
......@@ -389,7 +394,6 @@ export default {
cache = dbController.mergeChatList(cache, items);
}
});
return buildUnreadMessage(cache);
}
......@@ -617,7 +621,15 @@ export default {
if (!data) {
return;
}
const chat = data.args[0];
const chat = data.args[0] as RawChatItem;
if (!chat.model_name && chat.business_data) {
const b = JSON.parse(chat.business_data) as {
model_name: string;
obj_id: string;
};
chat.model_name = b.model_name;
chat.obj_id = b.obj_id;
}
wantedChatRoom = {
...chat,
chat_id: chat.id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment