Make method "requestMessage" silent

This commit is contained in:
Alex Sytnyk 2018-08-14 12:39:24 +03:00
parent 52badedcae
commit cbe7051247

View file

@ -486,14 +486,8 @@ class TelegramHelper private constructor() {
private fun requestMessage(chatId: Long, messageId: Long, onComplete: (TdApi.Message) -> Unit) {
client?.send(TdApi.GetMessage(chatId, messageId)) { obj ->
when (obj.constructor) {
TdApi.Error.CONSTRUCTOR -> {
val error = obj as TdApi.Error
if (error.code != IGNORED_ERROR_CODE) {
listener?.onTelegramError(error.code, error.message)
}
}
TdApi.Message.CONSTRUCTOR -> onComplete(obj as TdApi.Message)
if (obj is TdApi.Message) {
onComplete(obj)
}
}
}