From df037e489c38ddc3c61642f968d0125979011677 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Fri, 8 Oct 2021 09:11:05 -0400 Subject: [PATCH] fix: filter chats --- status/statusgo_backend/chat.nim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/status/statusgo_backend/chat.nim b/status/statusgo_backend/chat.nim index 7f0cd34..b97542e 100644 --- a/status/statusgo_backend/chat.nim +++ b/status/statusgo_backend/chat.nim @@ -62,17 +62,17 @@ proc loadChats*(): seq[Chat] = echo "ACCESSING CHATS DIRECTLY ===============" let time = cpuTime() - let chats = status_go_chat.chats() + let chats = status_go_chat.chats().filterIt(it.active and it.chatType != status_go_chat.ChatType.Unknown) let resTime1 = cpuTime() - time echo "Time taken: ", resTime1 - # for c in chats: - # echo "Chat: ......" - # echo "- id: ", c.id - # echo "- timestamp: ", c.timestamp - # echo "- active: ", c.active - # echo "- name: ", c.name - # echo "- type: ", c.chatType + for c in chats: + echo "Chat: ......" + echo "- id: ", c.id + echo "- timestamp: ", c.timestamp + echo "- active: ", c.active + echo "- name: ", c.name + echo "- type: ", c.chatType echo "Speedup improvement: ", resTime2 / resTime1 * 100, "%"