Merge branch 'master' of ssh://github.com/osmandapp/Osmand into ShareLocationImprovements

This commit is contained in:
Chumva 2018-08-14 13:26:09 +03:00
commit d8bdd0ddfe

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)
}
}
}