Fix compilation after tdlib api updated

This commit is contained in:
Chumva 2019-06-11 12:25:24 +03:00
parent 05425ccab6
commit ccbd86d4e0
3 changed files with 15 additions and 5 deletions

View file

@ -88,6 +88,10 @@ android {
disable 'InvalidPackage'
disable 'MissingTranslation'
}
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
task downloadTdLibzip {
@ -149,4 +153,5 @@ dependencies {
exclude group: 'com.android.support'
}
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'androidx.annotation:annotation:1.1.0'
}

View file

@ -413,7 +413,7 @@ class TelegramHelper private constructor() {
}
TdApi.File.CONSTRUCTOR -> {
val file = obj as TdApi.File
client!!.send(TdApi.DownloadFile(file.id, 10), defaultHandler)
client!!.send(TdApi.DownloadFile(file.id, 10, 0, 0, true), defaultHandler)
}
else -> listener?.onTelegramError(-1, "Receive wrong response from TDLib: $obj")
}
@ -524,7 +524,7 @@ class TelegramHelper private constructor() {
}
resultArticles.forEach {
client?.send(TdApi.SendInlineQueryResultMessage(shareInfo.chatId, 0, true,
true, inlineQueryResults.inlineQueryId, it.id)) { obj ->
true, inlineQueryResults.inlineQueryId, it.id, false)) { obj ->
handleTextLocationMessageUpdate(obj, shareInfo)
}
}
@ -1342,7 +1342,7 @@ class TelegramHelper private constructor() {
}
TdApi.File.CONSTRUCTOR -> {
val file = obj as TdApi.File
client!!.send(TdApi.DownloadFile(file.id, 10), defaultHandler)
client!!.send(TdApi.DownloadFile(file.id, 10, 0, 0, true), defaultHandler)
}
else -> listener?.onTelegramError(-1, "Receive wrong response from TDLib: $obj")
}

View file

@ -94,8 +94,13 @@ object OsmandLocationUtils {
fun getSenderMessageId(message: TdApi.Message): Int {
val forwardInfo = message.forwardInfo
return if (forwardInfo != null && forwardInfo is TdApi.MessageForwardedFromUser) {
forwardInfo.senderUserId
return if (forwardInfo != null) {
val origin: TdApi.MessageForwardOrigin? = forwardInfo.origin
if (origin != null && origin is TdApi.MessageForwardOriginUser) {
origin.senderUserId
} else {
message.senderUserId
}
} else {
message.senderUserId
}