Fix sharing to unknown chats

This commit is contained in:
Chumva 2019-04-10 18:31:15 +03:00
parent 4edc375c7d
commit a379fb900c

View file

@ -274,12 +274,18 @@ class SetTimeDialogFragment : BaseDialogFragment(), TelegramLocationListener, Te
private fun updateList() {
val items: MutableList<TdApi.Object> = mutableListOf()
telegramHelper.getChatList().filter { chatLivePeriods.keys.contains(it.chatId) }
.forEach { orderedChat ->
telegramHelper.getChat(orderedChat.chatId)?.also { items.add(it) }
chatLivePeriods.keys.forEach {
val chat = telegramHelper.getChat(it)
if (chat != null) {
items.add(chat)
}
}
userLivePeriods.keys.forEach {
val user = telegramHelper.getUser(it.toInt())
if (user != null) {
items.add(user)
}
}
telegramHelper.getContacts().values.filter { userLivePeriods.keys.contains(it.id.toLong()) }
.forEach { user -> items.add(user) }
adapter.items = items
}