Merge branch 'master' into master-ghc8107
This commit is contained in:
commit
81bd7d97c5
@ -117,9 +117,7 @@ fun groupChatAction(groupInfo: GroupInfo, chatModel: ChatModel) {
|
|||||||
suspend fun openDirectChat(contactId: Long, chatModel: ChatModel) {
|
suspend fun openDirectChat(contactId: Long, chatModel: ChatModel) {
|
||||||
val chat = chatModel.controller.apiGetChat(ChatType.Direct, contactId)
|
val chat = chatModel.controller.apiGetChat(ChatType.Direct, contactId)
|
||||||
if (chat != null) {
|
if (chat != null) {
|
||||||
chatModel.chatItems.clear()
|
openChat(chat, chatModel)
|
||||||
chatModel.chatItems.addAll(chat.chatItems)
|
|
||||||
chatModel.chatId.value = "@$contactId"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,11 +137,13 @@ suspend fun openChat(chat: Chat, chatModel: ChatModel) {
|
|||||||
suspend fun apiLoadPrevMessages(chatInfo: ChatInfo, chatModel: ChatModel, beforeChatItemId: Long, search: String) {
|
suspend fun apiLoadPrevMessages(chatInfo: ChatInfo, chatModel: ChatModel, beforeChatItemId: Long, search: String) {
|
||||||
val pagination = ChatPagination.Before(beforeChatItemId, ChatPagination.PRELOAD_COUNT)
|
val pagination = ChatPagination.Before(beforeChatItemId, ChatPagination.PRELOAD_COUNT)
|
||||||
val chat = chatModel.controller.apiGetChat(chatInfo.chatType, chatInfo.apiId, pagination, search) ?: return
|
val chat = chatModel.controller.apiGetChat(chatInfo.chatType, chatInfo.apiId, pagination, search) ?: return
|
||||||
|
if (chatModel.chatId.value != chat.id) return
|
||||||
chatModel.chatItems.addAll(0, chat.chatItems)
|
chatModel.chatItems.addAll(0, chat.chatItems)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun apiFindMessages(chatInfo: ChatInfo, chatModel: ChatModel, search: String) {
|
suspend fun apiFindMessages(chatInfo: ChatInfo, chatModel: ChatModel, search: String) {
|
||||||
val chat = chatModel.controller.apiGetChat(chatInfo.chatType, chatInfo.apiId, search = search) ?: return
|
val chat = chatModel.controller.apiGetChat(chatInfo.chatType, chatInfo.apiId, search = search) ?: return
|
||||||
|
if (chatModel.chatId.value != chat.id) return
|
||||||
chatModel.chatItems.clear()
|
chatModel.chatItems.clear()
|
||||||
chatModel.chatItems.addAll(0, chat.chatItems)
|
chatModel.chatItems.addAll(0, chat.chatItems)
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: simplex-chat
|
name: simplex-chat
|
||||||
version: 5.3.0.9
|
version: 5.3.0.10
|
||||||
#synopsis:
|
#synopsis:
|
||||||
#description:
|
#description:
|
||||||
homepage: https://github.com/simplex-chat/simplex-chat#readme
|
homepage: https://github.com/simplex-chat/simplex-chat#readme
|
||||||
|
@ -5,7 +5,7 @@ cabal-version: 1.12
|
|||||||
-- see: https://github.com/sol/hpack
|
-- see: https://github.com/sol/hpack
|
||||||
|
|
||||||
name: simplex-chat
|
name: simplex-chat
|
||||||
version: 5.3.0.9
|
version: 5.3.0.10
|
||||||
category: Web, System, Services, Cryptography
|
category: Web, System, Services, Cryptography
|
||||||
homepage: https://github.com/simplex-chat/simplex-chat#readme
|
homepage: https://github.com/simplex-chat/simplex-chat#readme
|
||||||
author: simplex.chat
|
author: simplex.chat
|
||||||
|
Loading…
Reference in New Issue
Block a user