{"id":372224,"date":"2024-05-21T05:07:13","date_gmt":"2024-05-21T05:07:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=372224"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T05:07:13","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=372224","title":{"rendered":"<span>Telegram Desktop \u0438 Compose Multiplatform<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/334\/6cc\/1a5\/3346cc1a529358ae66dd2f635343c3e8.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0447\u0430\u0442 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438.\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0447\u0430\u0442 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438.\" width=\"2586\" height=\"2088\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/334\/6cc\/1a5\/3346cc1a529358ae66dd2f635343c3e8.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0447\u0430\u0442 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438.<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412\u00a0\u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/738022\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Telegram \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 backend\u2011\u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0412\u00a0\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0442\u0430\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0441\u00a0\u0442\u0435\u0445 \u043f\u043e\u0440\u00a0\u0431\u044b\u043b\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 \u0432\u00a0\u0446\u0435\u043b\u043e\u043c, \u044f \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e\u00a0\u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043a\u00a0\u0438\u043c\u0435\u044e\u0449\u0435\u043c\u0443\u0441\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u0443 \u0438 \u0437\u0430\u043e\u0434\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0447\u0442\u043e\u2011\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u0434\u043b\u044f\u00a0\u0441\u0435\u0431\u044f. \u0412\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430\u00a0\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Compose Multiplatform. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Telegram!<\/p>\n<h2>\u0421 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c?<\/h2>\n<p>Compose Multiplatform\u00a0\u2014 \u044d\u0442\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f\u00a0\u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043f\u043e\u0434\u00a0\u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0441\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Kotlin \u0438 Jetpack Compose. \u0418 \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u044d\u0442\u043e\u00a0\u0431\u044b\u043b \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u00a0Jetpack Compose, \u0442\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u00a0\u043d\u0430\u0447\u0430\u043b\u0435 \u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u043f\u0440\u043e\u0448\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u043e\u043a \u043d\u0430 <a href=\"https:\/\/developer.android.com\/develop\/ui\/compose\/mental-model\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0440\u0442\u0430\u043b\u0435<\/a> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0434\u043b\u044f\u00a0android. \u041f\u043e\u0441\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/JetBrains\/compose-multiplatform\/tree\/master\/tutorials\" rel=\"noopener noreferrer nofollow\">tutorials<\/a> \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u00a0\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Compose Multiplatform \u043e\u0442\u00a0JetBrains.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u00a0IntelliJ IDEA(\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0435\u0440\u0441\u0438\u0438 community) \u0432\u044b\u0431\u0440\u0430\u0432 \u0448\u0430\u0431\u043b\u043e\u043d <code>Compose for Desktop<\/code> \u0438\u043b\u0438\u00a0\u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/kmp.jetbrains.com\" rel=\"noopener noreferrer nofollow\">wizard<\/a>. \u0412\u00a0\u0438\u0442\u043e\u0433\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f Gradle \u043f\u0440\u043e\u0435\u043a\u0442, \u0433\u0434\u0435 \u0443\u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f\u00a0\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0430\u00a0\u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u2011\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u00a0\u0432\u0438\u0434\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u0412\u00a0\u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043c\u0438\u043c\u043e UI\u2011\u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0435 \u0438 \u0431\u044d\u043a\u0435\u043d\u0434, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0435\u0449\u0435 java\u2011\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u00a0\u043f\u0440\u0438\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Compose\u2011\u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438 \u0443\u0447\u0435\u0441\u0442\u044c \u044d\u0442\u043e, \u0430\u00a0\u0443\u00a0\u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430\u00a0\u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a\u00a0\u043d\u0438\u043c \u0438\u0437\u00a0\u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430. \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u00a0\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 <code>appResourcesRootDir<\/code>, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e <code>resources<\/code> \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432\u00a0\u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"kotlin\">compose.desktop {     application {         mainClass = \"TelegramComposeMultiplatformKt\"          jvmArgs += listOf(\"-Xmx256m\")          nativeDistributions {             targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)             packageName = \"TelegramComposeMultiplatform\"             packageVersion = \"1.0.0\"             appResourcesRootDir.set(project.layout.projectDirectory.dir(\"resources\"))         }     } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>compose.application.resources.dir<\/code> \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441:<\/p>\n<pre><code class=\"kotlin\">class Resources {      companion object {          private val resourcesDirectory: File = File(System.getProperty(\"compose.application.resources.dir\"))          fun resourcesDirectory(): File = resourcesDirectory          fun resolve(relative: String) : File = resourcesDirectory.resolve(relative)      }  }<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0432\u0430\u0436\u043d\u0443\u044e \u0432\u0435\u0449\u044c:<\/p>\n<pre><code class=\"bash\">resources \u251c\u2500\u2500 common \u2502\u00a0\u00a0 \u251c\u2500\u2500 backend-0.0.1.jar \u2502\u00a0\u00a0 \u2514\u2500\u2500 content_loader.gif \u251c\u2500\u2500 linux-arm64 \u2502\u00a0\u00a0 \u2514\u2500\u2500 libtdjni.so \u251c\u2500\u2500 linux-x64 \u2502\u00a0\u00a0 \u2514\u2500\u2500 libtdjni.so \u251c\u2500\u2500 macos-arm64 \u2502\u00a0\u00a0 \u2514\u2500\u2500 libtdjni.dylib \u251c\u2500\u2500 macos-x64 \u2502\u00a0\u00a0 \u2514\u2500\u2500 libtdjni.dylib \u2514\u2500\u2500 windows-x64     \u251c\u2500\u2500 libcrypto-1_1-x64.dll     \u251c\u2500\u2500 libssl-1_1-x64.dll     \u251c\u2500\u2500 tdjni.dll     \u2514\u2500\u2500 zlib1.dll src \u251c\u2500\u2500 main \u2502\u00a0\u00a0 \u251c\u2500\u2500 kotlin<\/code><\/pre>\n<p>\u0423 Compose-\u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041a\u0430\u0442\u0430\u043b\u043e\u0433 <code>common<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u0441\u0431\u043e\u0440\u043a\u0443 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0414\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u041e\u0421 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f &#8212; <code>&lt;resource_dir>\/&lt;os_name><\/code> \u0438\u043b\u0438 <code>&lt;resource_dir>\/&lt;os_name>-&lt;arch_name><\/code>(\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u041e\u0421 &#8212; <code>windows<\/code>, <code>macos<\/code>, <code>linux<\/code>; \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b &#8212; <code>x64<\/code>, <code>arm64<\/code>). \u041f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u0437\u044f\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0434 \u043d\u0443\u0436\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <code>common<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f jar \u0431\u044d\u043a\u0435\u043d\u0434\u0430, \u0430 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 TDLib \u0434\u043b\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u0430(\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043c\u043e\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/738022\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>).<\/p>\n<h2>\u041d\u0430\u0447\u043d\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0435 \u043e\u043a\u043d\u043e \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0431\u044d\u043a\u0435\u043d\u0434 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e.<\/p>\n<pre><code class=\"kotlin\">fun main() = application {      val backendStarted = remember { mutableStateOf(false) }      val appScope = rememberCoroutineScope()      appScope.launch {         startBackend()         awaitReadiness(backendStarted)     }      Window(         title = \"Telegram Compose Multiplatform\",         state = WindowState(width = 1200.dp, height = 800.dp),         onCloseRequest = {             terminatingApp.set(true)             appScope.launch {                 delay(300)                 httpClient.post(\"${baseUrl}\/${clientUri}\/shutdown\")             }.invokeOnCompletion {                 exitApplication()                 httpClient.close()             }         }     ) {         if (backendStarted.value) {             App()         } else {             LoadingDisclaimer(\"Starting...\")         }     }  }<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<pre><code class=\"kotlin\">@Composable fun App() {     Row {         var waitCode by remember { mutableStateOf(false) }         var waitPass by remember { mutableStateOf(false) }         var status by remember { mutableStateOf(Status.NOT_AUTHORIZED) }          LaunchedEffect(Unit) {             status = authorizationStatus()         }          val mainScope = rememberCoroutineScope()          mainScope.launch {             while (!terminatingApp.get()) {                 status = authorizationStatus()                 if (status == Status.AUTHORIZED) break                 waitCode = waitCode()                 delay(300)                 waitPass = waitPass()                 delay(300)             }         }          if (status == Status.AUTHORIZED) {             InitialLoad()         } else if (waitCode) {             AuthForm(AuthType.CODE, mainScope)         } else if (waitPass) {             AuthForm(AuthType.PASSWORD, mainScope)         }     } }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f, \u0442\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u0432\u0432\u043e\u0434\u0430 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0434\u0435\u0442 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/808\/28c\/165\/80828c165bf3d4d1671267c09d318abc.png\" width=\"2194\" height=\"1690\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/808\/28c\/165\/80828c165bf3d4d1671267c09d318abc.png\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d \u0432\u0442\u043e\u0440\u043e\u0439 \u0444\u0430\u043a\u0442\u043e\u0440 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0442\u043e \u0435\u0433\u043e \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/332\/033\/0b7\/3320330b7849013e0835686875b00488.png\" width=\"2194\" height=\"1690\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/332\/033\/0b7\/3320330b7849013e0835686875b00488.png\"\/><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u0447\u0430\u0442\u043e\u0432(\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043a\u043e\u043d\u043e\u043a \u0438 \u043f\u0440\u043e\u0447\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438) \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0441\u0446\u0435\u043d\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u042f \u0441\u0434\u0435\u043b\u0430\u043b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u00a0\u2014 \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0447\u0430\u0442\u043e\u0432 \u0441\u00a0\u0438\u0445 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u0441\u043b\u0435\u0432\u0430, \u0430\u00a0\u0442\u0430\u043a\u0436\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434\u00a0\u043e\u043a\u043d\u043e \u0447\u0430\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438. \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0447\u0430\u0442\u043e\u0432 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u00a0\u2014 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443 \u043d\u0430\u00a0\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u00a0\u044d\u0442\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c, \u0430\u00a0\u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<ol>\n<li>\n<p>\u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0447\u0430\u0442<\/p>\n<\/li>\n<li>\n<p>\u0427\u0430\u0442 \u0432\u00a0\u0441\u043f\u0438\u0441\u043a\u0435 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d<\/p>\n<\/li>\n<li>\n<p>\u0412\u00a0\u0447\u0430\u0442\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f \u0438\u043a\u043e\u043d\u043a\u0430, \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0442\u043e\u0436\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043d\u0435\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0447\u0430\u0442\u0430 \u0432\u00a0\u0441\u043f\u0438\u0441\u043a\u0435, \u0447\u0430\u0442\u044b \u0441\u00a0\u043d\u043e\u0432\u044b\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0432\u00a0\u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u044b\u0448\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e\u00a0\u044d\u0442\u043e \u0437\u0430\u00a0\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043a\u0430\u043a\u00a0\u0438\u0445 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u00a0\u0431\u044d\u043a\u0435\u043d\u0434. \u0412\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 Spring Boot \u043f\u0440\u043e\u0435\u043a\u0442. \u0412\u00a0\u043d\u0435\u043c \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043f\u0430\u043a\u0435\u0442 <code>tdlib<\/code>, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0430\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0439 \u043e\u0442\u00a0TDLib, \u0432\u043e\u0442 \u0435\u0433\u043e \u0441\u043e\u0441\u0442\u0430\u0432:<\/p>\n<pre><code class=\"bash\">tdlib \u251c\u2500\u2500 UpdateBasicGroup.java \u251c\u2500\u2500 UpdateBasicGroupFullInfo.java \u251c\u2500\u2500 UpdateChatLastMessageHandler.java \u251c\u2500\u2500 UpdateChatNewOrder.java \u251c\u2500\u2500 UpdateChatPhoto.java \u251c\u2500\u2500 UpdateChatReadInbox.java \u251c\u2500\u2500 UpdateChatTitleHandler.java \u251c\u2500\u2500 UpdateDeleteMessages.java \u251c\u2500\u2500 UpdateFile.java \u251c\u2500\u2500 UpdateMessageContent.java \u251c\u2500\u2500 UpdateNewChat.java \u251c\u2500\u2500 UpdateNewMessage.java \u251c\u2500\u2500 UpdateSupergroup.java \u251c\u2500\u2500 UpdateSupergroupFullInfo.java \u251c\u2500\u2500 UpdateUser.java<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043a\u043e\u043d\u043a\u0438 \u0447\u0430\u0442\u0430: <\/p>\n<pre><code class=\"java\">@Service public class UpdateChatPhoto implements UpdateNotificationListener&lt;TdApi.UpdateChatPhoto> {      private final UpdatesQueues updatesQueues;      public UpdateChatPhoto(UpdatesQueues updatesQueues) {         this.updatesQueues = updatesQueues;     }      @Override     public void handleNotification(TdApi.UpdateChatPhoto updateChatPhoto) {         TdApi.Chat chat = Caches.initialChatCache.get(updateChatPhoto.chatId);         if (chat != null) {             synchronized (chat) {                 chat.photo = updateChatPhoto.photo;             }             updatesQueues.addIncomingSidebarUpdate(updateChatPhoto);         }     }          @Override     public Class&lt;TdApi.UpdateChatPhoto> notificationType() {         return TdApi.UpdateChatPhoto.class;     } }<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 Spring \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u0447\u0442\u043e \u0438\u043a\u043e\u043d\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c. \u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0432\u043e\u043b\u044c\u043d\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u044d\u0448\u0438\u0440\u0443\u044e \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0435. \u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0447\u0430\u0442\u043e\u0432.<\/p>\n<pre><code class=\"java\">@Component public class GetSidebarUpdates implements Supplier&lt;List&lt;ChatPreview>> {      @Autowired     private GetChatLastMessage getChatLastMessage;      @Autowired     private GetChatNewTitle getChatNewTitle;      @Autowired     private GetChatNewOrder getChatNewOrder;      @Autowired     private GetChatReadInbox getChatReadInbox;      @Autowired     private GetNewChat getNewChat;      @Autowired     private GetNewChatPhoto getNewChatPhoto;      @Autowired     private UpdatesQueues updatesQueues;      @Override     public List&lt;ChatPreview> get() {         List&lt;ChatPreview> previews = new ArrayList&lt;>();         for (int i = 0; i &lt; 100; i++) {             TdApi.Update update = updatesQueues.pollIncomingSidebarUpdate();             if (update == null) break;              if (update instanceof TdApi.UpdateChatLastMessage upd) {                 addPreviewFromUpdate(getChatLastMessage, upd, previews);             } else if (update instanceof TdApi.UpdateChatTitle upd) {                 addPreviewFromUpdate(getChatNewTitle, upd, previews);             } else if (update instanceof TdApi.UpdateChatPosition upd) {                 addPreviewFromUpdate(getChatNewOrder, upd, previews);             } else if (update instanceof TdApi.UpdateChatReadInbox upd) {                 addPreviewFromUpdate(getChatReadInbox, upd, previews);             } else if (update instanceof TdApi.UpdateNewChat upd) {                 addPreviewFromUpdate(getNewChat, upd, previews);             } else if (update instanceof TdApi.UpdateChatPhoto upd) {                 addPreviewFromUpdate(getNewChatPhoto, upd, previews);             }          }          return previews;     }      private &lt;T extends TdApi.Update> void addPreviewFromUpdate(Function&lt;T, ChatPreview> func,                                                                T update,                                                                List&lt;ChatPreview> previews) {         ChatPreview preview = func.apply(update);         if (preview != null) previews.add(preview);     }  }<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a UI. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u0440\u0442\u043e\u0447\u0435\u043a \u0447\u0430\u0442\u043e\u0432:<\/p>\n<pre><code class=\"kotlin\">LazyColumn(state = lazyListState, modifier = sidebarWidthModifier.background(MaterialTheme.colors.surface).fillMaxHeight()) {      itemsIndexed(clientStates.chatPreviews, { _, v -> v}) { _, chatPreview ->          if (chatSearchInput.value.isBlank() || chatPreview.title.contains(chatSearchInput.value, ignoreCase = true)) {             var hasUnread = false             chatPreview.unreadCount?.let {                 if (it != 0) {                     hasUnread = true                 }             }             val onChatClick = {                 selectedChatId.value = chatPreview.id                 clientStates.selectedChatPreview.value = chatPreview             }             if (filterUnreadChats.value &amp;&amp; hasUnread) {                 ChatCard(chatListUpdateScope = chatListUpdateScope, chatPreview = chatPreview, selectedChatId = selectedChatId, onClick = onChatClick)                 Divider(modifier = sidebarWidthModifier.height(2.dp), color = greyColor)             } else if (!filterUnreadChats.value) {                 ChatCard(chatListUpdateScope = chatListUpdateScope, chatPreview = chatPreview, selectedChatId = selectedChatId, onClick = onChatClick)                 Divider(modifier = sidebarWidthModifier.height(2.dp), color = greyColor)             }          }      }  }<\/code><\/pre>\n<p>\u041f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u043f\u0438\u0441\u043a\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0441\u043a\u0440\u043e\u043b\u043b, \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0447\u0430\u0442\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0447\u0430\u0442 \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u043c.<\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u043a\u043d\u043e \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0447\u0430\u0442\u043e\u0432 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"kotlin\">@Composable fun MainScene(clientStates: ClientStates) {      val selectedChatId: MutableState&lt;Long> = remember { mutableStateOf(-1) }      var needToScrollUpSidebar by remember { mutableStateOf(false) }      val chatSearchInput: MutableState&lt;String> = remember { mutableStateOf(\"\") }      val chatListUpdateScope = rememberCoroutineScope()      val lazyListState = rememberLazyListState()      val filterUnreadChats: MutableState&lt;Boolean> = remember { mutableStateOf(false) }      chatListUpdateScope.launch {         while (!terminatingApp.get()) {             val chatsSizeBeforeUpdates = clientStates.chatPreviews.size             var firstChatPreviewBeforeUpdates: ChatPreview? = null             if (clientStates.chatPreviews.isNotEmpty()) {                 firstChatPreviewBeforeUpdates = clientStates.chatPreviews[0]             }              handleSidebarUpdates(clientStates.chatPreviews)              needToScrollUpSidebar = (clientStates.chatPreviews.size > chatsSizeBeforeUpdates) ||                     (clientStates.chatPreviews.isNotEmpty() &amp;&amp; lazyListState.firstVisibleItemIndex &lt; 3 &amp;&amp; firstChatPreviewBeforeUpdates != clientStates.chatPreviews[0])             if (needToScrollUpSidebar) {                 lazyListState.scrollToItem(0)             }              delay(1000)         }     }      Scaffold(         topBar = { ScaffoldTopBar(clientStates, chatSearchInput, filterUnreadChats) },         backgroundColor = greyColor     ) {          Row {              Box {                 LazyColumn(state = lazyListState, modifier = sidebarWidthModifier.background(MaterialTheme.colors.surface).fillMaxHeight()) {                      itemsIndexed(clientStates.chatPreviews, { _, v -> v}) { _, chatPreview ->                          if (chatSearchInput.value.isBlank() || chatPreview.title.contains(chatSearchInput.value, ignoreCase = true)) {                             var hasUnread = false                             chatPreview.unreadCount?.let {                                 if (it != 0) {                                     hasUnread = true                                 }                             }                             val onChatClick = {                                 selectedChatId.value = chatPreview.id                                 clientStates.selectedChatPreview.value = chatPreview                             }                             if (filterUnreadChats.value &amp;&amp; hasUnread) {                                 ChatCard(chatListUpdateScope = chatListUpdateScope, chatPreview = chatPreview, selectedChatId = selectedChatId, onClick = onChatClick)                                 Divider(modifier = sidebarWidthModifier.height(2.dp), color = greyColor)                             } else if (!filterUnreadChats.value) {                                 ChatCard(chatListUpdateScope = chatListUpdateScope, chatPreview = chatPreview, selectedChatId = selectedChatId, onClick = onChatClick)                                 Divider(modifier = sidebarWidthModifier.height(2.dp), color = greyColor)                             }                          }                      }                  }                  if (lazyListState.firstVisibleItemIndex > 3) {                     Row(modifier = sidebarWidthModifier) {                         Row(modifier = Modifier.fillMaxSize().padding(top = 12.dp, end = 12.dp), horizontalArrangement = Arrangement.End) {                             ScrollButton(                                 direction = ScrollDirection.UP,                                 onClick = {                                     chatListUpdateScope.launch {                                         lazyListState.animateScrollToItem(0)                                     }                                 }                             )                         }                     }                 }             }              Column {                 if (selectedChatId.value == -1L &amp;&amp; clientStates.chatPreviews.isNotEmpty()) {                     SelectChatOffer()                 } else if (selectedChatId.value != -1L) {                      var readChat by remember { mutableStateOf(-1L) }                      Row {                         Divider(modifier = Modifier.fillMaxHeight().width(2.dp), color = greyColor)                         ChatWindow(chatId = selectedChatId.value, chatListUpdateScope = chatListUpdateScope, clientStates = clientStates)                     }                      chatListUpdateScope.launch {                         clientStates.selectedChatPreview.let {                             it.value?.let { currentChat ->                                 currentChat.unreadCount?.let {                                     if (it > 0 &amp;&amp; readChat != currentChat.id) {                                         readChat = currentChat.id                                         markAsRead(readChat)                                     }                                 }                             }                         }                     }                  }             }          }      }  }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u00a0\u0442\u0430\u043a\u043e\u0439\u00a0\u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0441\u00a0\u043e\u043a\u043d\u043e\u043c \u0447\u0430\u0442\u0430. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0435\u0433\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c, \u0442\u043e \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438\u0437\u00a0\u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043a\u0430\u043a\u043e\u0439\u2011\u0442\u043e \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0430\u00a0\u043f\u0440\u0438\u00a0\u0441\u043a\u0440\u043e\u043b\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0443\u0436\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438. \u041f\u043b\u044e\u0441 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430\u00a0\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u00a0\u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0447\u0430\u0442\u0435:<\/p>\n<ol>\n<li>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0447\u0430\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0433\u0440\u0443\u043f\u043f\u0430 \u0438\u043b\u0438\u00a0\u043a\u0430\u043d\u0430\u043b, \u0442\u043e \u0441\u043b\u0435\u0434\u0438\u043c \u0437\u0430\u00a0\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0442\u043e \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u00a0\u0441\u043f\u0438\u0441\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p>\u0412\u00a0\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u0445 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d \u043a\u043e\u043d\u0442\u0435\u043d\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u043e\u0436\u0435 \u0441\u043b\u0435\u0434\u0438\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f, \u0442\u043e \u043d\u0430\u043c \u0435\u0433\u043e \u0442\u043e\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f3f\/2f6\/75a\/f3f2f675a14baaa818c472c5cc7083bc.png\" width=\"2440\" height=\"1648\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f3f\/2f6\/75a\/f3f2f675a14baaa818c472c5cc7083bc.png\"\/><\/figure>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u043e\u043a\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0444\u043e\u0442\u043e, \u0430\u00a0\u0432\u00a0Telegram \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439(\u0432\u0438\u0434\u0435\u043e, \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u043e\u043f\u0440\u043e\u0441\u044b, \u0441\u0442\u0438\u043a\u0435\u0440\u044b, \u044d\u043c\u043e\u0434\u0437\u0438 \u0438\u00a0\u0442.\u00a0\u0434.). \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435\u00a0\u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0438 \u0441\u0441\u044b\u043b\u043a\u0438, \u043d\u043e\u00a0\u044f \u0445\u043e\u0447\u0443 \u0441\u043a\u043e\u0440\u043e \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u00a0\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0427\u0430\u0442\u044b\u2011\u0444\u043e\u0440\u0443\u043c\u044b \u043f\u043e\u043a\u0430 \u0442\u043e\u0436\u0435 \u043d\u0435\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f, \u0442\u0430\u043c \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0432\u00a0\u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u0447\u0430\u0442\u0435(\u0432 TDLib \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0435\u00a0\u0434\u043e\u00a0\u043a\u043e\u043d\u0446\u0430 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u0430 \u0435\u0449\u0435, \u0434\u0443\u043c\u0430\u044e \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c).<\/p>\n<h2>\u0421\u043e\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442<\/h2>\n<p>Compose-\u043f\u043b\u0430\u0433\u0438\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f jvm-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0432 \u0432\u0438\u0434\u0435 java-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430(<code>run<\/code>), \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 jar \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b(<code>packageUberJarForCurrentOS<\/code>), \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435(<code>createDistributable<\/code>, <code>packageDistributionForCurrentOS<\/code>), \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u043f\u043b\u0430\u0433\u0438\u043d\u0430(<code>runDistributable<\/code>). \u0412\u043e\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447 \u043f\u043b\u0430\u0433\u0438\u043d\u0430:<\/p>\n<details class=\"spoiler\">\n<summary>Compose desktop tasks<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"bash\">Compose desktop tasks --------------------- checkRuntime createDistributable createReleaseDistributable createRuntimeImage notarizeDmg notarizeReleaseDmg package packageDeb packageDistributionForCurrentOS packageDmg packageMsi packageReleaseDeb packageReleaseDistributionForCurrentOS packageReleaseDmg packageReleaseMsi packageReleaseUberJarForCurrentOS packageUberJarForCurrentOS prepareAppResources proguardReleaseJars run runDistributable runRelease runReleaseDistributable suggestRuntimeModules unpackDefaultComposeDesktopJvmApplicationResources<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0443\u0434\u0430 \u0436\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 MacOS. \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <code>.app<\/code> \u043f\u0430\u043a\u0435\u0442\u0430, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c(\u0432\u044b\u0432\u043e\u0434 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e):<\/p>\n<pre><code class=\"bash\">TelegramComposeMultiplatform.app \u2514\u2500\u2500 Contents     \u251c\u2500\u2500 Info.plist     \u251c\u2500\u2500 MacOS     \u2502\u00a0\u00a0 \u2514\u2500\u2500 TelegramComposeMultiplatform     \u251c\u2500\u2500 PkgInfo     \u251c\u2500\u2500 Resources     \u2502\u00a0\u00a0 \u2514\u2500\u2500 TelegramComposeMultiplatform.icns     \u251c\u2500\u2500 _CodeSignature     \u2502\u00a0\u00a0 \u2514\u2500\u2500 CodeResources     \u251c\u2500\u2500 app     \u2502\u00a0\u00a0 \u251c\u2500\u2500 TelegramComposeMultiplatform.cfg     \u2502\u00a0\u00a0 \u251c\u2500\u2500 animation-core-desktop-1.5.12-c65799cdb55518dd8ec9156ecfe547d.jar     \u2502\u00a0\u00a0 \u251c\u2500\u2500 animation-desktop-1.5.12-dc4e76c5a73ca9b53362d097ff8157.jar     \u2502\u00a0\u00a0 \u251c\u2500\u2500 annotations-23.0.0-8484cd17d040d837983323f760b2c660.jar     \u2502\u00a0\u00a0 \u251c\u2500\u2500 resources     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 backend-0.0.1.jar     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 content_loader.gif     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 libtdjni.dylib     \u2502\u00a0\u00a0 \u251c\u2500\u2500 runtime-desktop-1.5.12-1698bf91f4fdffbbb15d2b84e7e0f69e.jar<\/code><\/pre>\n<p>\u0410\u00a0\u0432\u043e\u0442 \u0438 \u043e\u043d\u0438\u00a0\u2014 \u043d\u0430\u0448 \u0431\u044d\u043a\u0435\u043d\u0434, \u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 TDLib \u0434\u043b\u044f\u00a0\u043d\u0435\u0433\u043e \u0438 gif c loader&#8217;\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u041f\u0440\u0438\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u043d\u043e \u043a\u00a0\u043d\u0438\u043c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0438 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a\u00a0\u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c.<\/p>\n<p>\u0412 <a href=\"https:\/\/github.com\/p-vorobyev\/telegram-desktop-compose-multiplatform\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a> \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u0447\u0442\u043e\u00a0\u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u043b\u044f\u00a0\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0431\u043e\u0440\u043a\u0438. \u041d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u00a0MacOS(x64\u00a0+ M) \u0438 Windows(x64). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u0443\u2011\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0442\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435:)<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c desktop \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Compose Multiplatform. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f Telegram \u043a\u043b\u0438\u0435\u043d\u0442 \u0441\u00a0\u043e\u0447\u0435\u043d\u044c \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u043e\u00a0\u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0441\u043a\u0435\u043b\u0435\u0442\u043e\u043c \u0434\u043b\u044f\u00a0\u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043e\u043a, \u0430\u00a0\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432\u00a0\u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 Telegram API \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e. \u041e\u0442\u00a0Compose Multiplatform \u0443\u00a0\u043c\u0435\u043d\u044f \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e\u00a0\u0432\u0430\u043c\u00a0\u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e!<\/p>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/p-vorobyev\/telegram-desktop-compose-multiplatform\" rel=\"noopener noreferrer nofollow\">telegram\u2011desktop\u2011compose\u2011multiplatform<\/a>\u00a0\u2014 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/p-vorobyev\/spring-boot-starter-telegram\" rel=\"noopener noreferrer nofollow\">spring\u2011boot\u2011starter\u2011telegram<\/a>\u00a0\u2014 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u00a0\u0431\u044d\u043a\u0435\u043d\u0434\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.jetbrains.com\/lp\/compose-multiplatform\/\" rel=\"noopener noreferrer nofollow\">compose\u2011multiplatform<\/a>\u00a0\u2014 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 Compose Multiplatform<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.android.com\/develop\/ui\/compose\/mental-model\" rel=\"noopener noreferrer nofollow\">Jetpack Compose<\/a>\u00a0\u2014 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0434\u043b\u044f\u00a0\u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f Jetpack Compose<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/JetBrains\/compose-multiplatform\/tree\/master\/tutorials\" rel=\"noopener noreferrer nofollow\">Tutorials<\/a>\u00a0\u2014 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b \u043f\u043e\u00a0Compose Multiplatform \u043e\u0442\u00a0JetBrains<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/803987\/\"> https:\/\/habr.com\/ru\/articles\/803987\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0447\u0430\u0442 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438.<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412\u00a0\u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/738022\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Telegram \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 backend\u2011\u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0412\u00a0\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0442\u0430\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0441\u00a0\u0442\u0435\u0445 \u043f\u043e\u0440\u00a0\u0431\u044b\u043b\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 \u0432\u00a0\u0446\u0435\u043b\u043e\u043c, \u044f \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e\u00a0\u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043a\u00a0\u0438\u043c\u0435\u044e\u0449\u0435\u043c\u0443\u0441\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u0443 \u0438 \u0437\u0430\u043e\u0434\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0447\u0442\u043e\u2011\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u0434\u043b\u044f\u00a0\u0441\u0435\u0431\u044f. \u0412\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430\u00a0\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Compose Multiplatform. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Telegram!<\/p>\n<h2>\u0421 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c?<\/h2>\n<p>Compose Multiplatform\u00a0\u2014 \u044d\u0442\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f\u00a0\u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043f\u043e\u0434\u00a0\u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0441\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Kotlin \u0438 Jetpack Compose. \u0418 \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u044d\u0442\u043e\u00a0\u0431\u044b\u043b \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u00a0Jetpack Compose, \u0442\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u00a0\u043d\u0430\u0447\u0430\u043b\u0435 \u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u043f\u0440\u043e\u0448\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u043e\u043a \u043d\u0430 <a href=\"https:\/\/developer.android.com\/develop\/ui\/compose\/mental-model\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0440\u0442\u0430\u043b\u0435<\/a> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0434\u043b\u044f\u00a0android. \u041f\u043e\u0441\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/JetBrains\/compose-multiplatform\/tree\/master\/tutorials\" rel=\"noopener noreferrer nofollow\">tutorials<\/a> \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u00a0\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Compose Multiplatform \u043e\u0442\u00a0JetBrains.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u00a0IntelliJ IDEA(\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0435\u0440\u0441\u0438\u0438 community) \u0432\u044b\u0431\u0440\u0430\u0432 \u0448\u0430\u0431\u043b\u043e\u043d <code>Compose for Desktop<\/code> \u0438\u043b\u0438\u00a0\u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/kmp.jetbrains.com\" rel=\"noopener noreferrer nofollow\">wizard<\/a>. \u0412\u00a0\u0438\u0442\u043e\u0433\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f Gradle \u043f\u0440\u043e\u0435\u043a\u0442, \u0433\u0434\u0435 \u0443\u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f\u00a0\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0430\u00a0\u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u2011\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u00a0\u0432\u0438\u0434\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u0412\u00a0\u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043c\u0438\u043c\u043e UI\u2011\u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0435 \u0438 \u0431\u044d\u043a\u0435\u043d\u0434, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0435\u0449\u0435 java\u2011\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u00a0\u043f\u0440\u0438\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Compose\u2011\u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438 \u0443\u0447\u0435\u0441\u0442\u044c \u044d\u0442\u043e, \u0430\u00a0\u0443\u00a0\u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430\u00a0\u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a\u00a0\u043d\u0438\u043c \u0438\u0437\u00a0\u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430. \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u00a0\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 <code>appResourcesRootDir<\/code>, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e <code>resources<\/code> \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432\u00a0\u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"kotlin\">compose.desktop {     application {         mainClass = \"TelegramComposeMultiplatformKt\"          jvmArgs += listOf(\"-Xmx256m\")          nativeDistributions {             targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)             packageName = \"TelegramComposeMultiplatform\"             packageVersion = \"1.0.0\"             appResourcesRootDir.set(project.layout.projectDirectory.dir(\"resources\"))         }     } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>compose.application.resources.dir<\/code> \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441:<\/p>\n<pre><code class=\"kotlin\">class Resources {      companion object {          private val resourcesDirectory: File = File(System.getProperty(\"compose.application.resources.dir\"))          fun resourcesDirectory(): File = resourcesDirectory          fun resolve(relative: String) : File = resourcesDirectory.resolve(relative)      }  }<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0432\u0430\u0436\u043d\u0443\u044e \u0432\u0435\u0449\u044c:<\/p>\n<pre><code class=\"bash\">resources \u251c\u2500\u2500 common \u2502\u00a0\u00a0 \u251c\u2500\u2500 backend-0.0.1.jar \u2502\u00a0\u00a0 \u2514\u2500\u2500 content_loader.gif \u251c\u2500\u2500 linux-arm64 \u2502\u00a0\u00a0 \u2514\u2500\u2500 libtdjni.so \u251c\u2500\u2500 linux-x64 \u2502\u00a0\u00a0 \u2514\u2500\u2500 libtdjni.so \u251c\u2500\u2500 macos-arm64 \u2502\u00a0\u00a0 \u2514\u2500\u2500 libtdjni.dylib \u251c\u2500\u2500 macos-x64 \u2502\u00a0\u00a0 \u2514\u2500\u2500 libtdjni.dylib \u2514\u2500\u2500 windows-x64     \u251c\u2500\u2500 libcrypto-1_1-x64.dll     \u251c\u2500\u2500 libssl-1_1-x64.dll     \u251c\u2500\u2500 tdjni.dll     \u2514\u2500\u2500 zlib1.dll src \u251c\u2500\u2500 main \u2502\u00a0\u00a0 \u251c\u2500\u2500 kotlin<\/code><\/pre>\n<p>\u0423 Compose-\u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041a\u0430\u0442\u0430\u043b\u043e\u0433 <code>common<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u0441\u0431\u043e\u0440\u043a\u0443 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0414\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u041e\u0421 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f &#8212; <code>&lt;resource_dir>\/&lt;os_name><\/code> \u0438\u043b\u0438 <code>&lt;resource_dir>\/&lt;os_name>-&lt;arch_name><\/code>(\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u041e\u0421 &#8212; <code>windows<\/code>, <code>macos<\/code>, <code>linux<\/code>; \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b &#8212; <code>x64<\/code>, <code>arm64<\/code>). \u041f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u0437\u044f\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0434 \u043d\u0443\u0436\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <code>common<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f jar \u0431\u044d\u043a\u0435\u043d\u0434\u0430, \u0430 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 TDLib \u0434\u043b\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u0430(\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043c\u043e\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/738022\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>).<\/p>\n<h2>\u041d\u0430\u0447\u043d\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0435 \u043e\u043a\u043d\u043e \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0431\u044d\u043a\u0435\u043d\u0434 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e.<\/p>\n<pre><code class=\"kotlin\">fun main() = application {      val backendStarted = remember { mutableStateOf(false) }      val appScope = rememberCoroutineScope()      appScope.launch {         startBackend()         awaitReadiness(backendStarted)     }      Window(         title = \"Telegram Compose Multiplatform\",         state = WindowState(width = 1200.dp, height = 800.dp),         onCloseRequest = {             terminatingApp.set(true)             appScope.launch {                 delay(300)                 httpClient.post(\"${baseUrl}\/${clientUri}\/shutdown\")             }.invokeOnCompletion {                 exitApplication()                 httpClient.close()             }         }     ) {         if (backendStarted.value) {             App()         } else {             LoadingDisclaimer(\"Starting...\")         }     }  }<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<pre><code class=\"kotlin\">@Composable fun App() {     Row {         var waitCode by remember { mutableStateOf(false) }         var waitPass by remember { mutableStateOf(false) }         var status by remember { mutableStateOf(Status.NOT_AUTHORIZED) }          LaunchedEffect(Unit) {             status = authorizationStatus()         }          val mainScope = rememberCoroutineScope()          mainScope.launch {             while (!terminatingApp.get()) {                 status = authorizationStatus()                 if (status == Status.AUTHORIZED) break                 waitCode = waitCode()                 delay(300)                 waitPass = waitPass()                 delay(300)             }         }          if (status == Status.AUTHORIZED) {             InitialLoad()         } else if (waitCode) {             AuthForm(AuthType.CODE, mainScope)         } else if (waitPass) {             AuthForm(AuthType.PASSWORD, mainScope)         }     } }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f, \u0442\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u0432\u0432\u043e\u0434\u0430 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0434\u0435\u0442 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d \u0432\u0442\u043e\u0440\u043e\u0439 \u0444\u0430\u043a\u0442\u043e\u0440 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0442\u043e \u0435\u0433\u043e \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u0447\u0430\u0442\u043e\u0432(\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043a\u043e\u043d\u043e\u043a \u0438 \u043f\u0440\u043e\u0447\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438) \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0441\u0446\u0435\u043d\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u042f \u0441\u0434\u0435\u043b\u0430\u043b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u00a0\u2014 \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0447\u0430\u0442\u043e\u0432 \u0441\u00a0\u0438\u0445 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u0441\u043b\u0435\u0432\u0430, \u0430\u00a0\u0442\u0430\u043a\u0436\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434\u00a0\u043e\u043a\u043d\u043e \u0447\u0430\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438. \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0447\u0430\u0442\u043e\u0432 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u00a0\u2014 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443 \u043d\u0430\u00a0\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u00a0\u044d\u0442\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c, \u0430\u00a0\u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<ol>\n<li>\n<p>\u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0447\u0430\u0442<\/p>\n<\/li>\n<li>\n<p>\u0427\u0430\u0442 \u0432\u00a0\u0441\u043f\u0438\u0441\u043a\u0435 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d<\/p>\n<\/li>\n<li>\n<p>\u0412\u00a0\u0447\u0430\u0442\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f \u0438\u043a\u043e\u043d\u043a\u0430, \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0442\u043e\u0436\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043d\u0435\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0447\u0430\u0442\u0430 \u0432\u00a0\u0441\u043f\u0438\u0441\u043a\u0435, \u0447\u0430\u0442\u044b \u0441\u00a0\u043d\u043e\u0432\u044b\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0432\u00a0\u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u044b\u0448\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e\u00a0\u044d\u0442\u043e \u0437\u0430\u00a0\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043a\u0430\u043a\u00a0\u0438\u0445 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u00a0\u0431\u044d\u043a\u0435\u043d\u0434. \u0412\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 Spring Boot \u043f\u0440\u043e\u0435\u043a\u0442. \u0412\u00a0\u043d\u0435\u043c \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043f\u0430\u043a\u0435\u0442 <code>tdlib<\/code>, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0430\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0439 \u043e\u0442\u00a0TDLib, \u0432\u043e\u0442 \u0435\u0433\u043e \u0441\u043e\u0441\u0442\u0430\u0432:<\/p>\n<pre><code class=\"bash\">tdlib \u251c\u2500\u2500 UpdateBasicGroup.java \u251c\u2500\u2500 UpdateBasicGroupFullInfo.java \u251c\u2500\u2500 UpdateChatLastMessageHandler.java \u251c\u2500\u2500 UpdateChatNewOrder.java \u251c\u2500\u2500 UpdateChatPhoto.java \u251c\u2500\u2500 UpdateChatReadInbox.java \u251c\u2500\u2500 UpdateChatTitleHandler.java \u251c\u2500\u2500 UpdateDeleteMessages.java \u251c\u2500\u2500 UpdateFile.java \u251c\u2500\u2500 UpdateMessageContent.java \u251c\u2500\u2500 UpdateNewChat.java \u251c\u2500\u2500 UpdateNewMessage.java \u251c\u2500\u2500 UpdateSupergroup.java \u251c\u2500\u2500 UpdateSupergroupFullInfo.java \u251c\u2500\u2500 UpdateUser.java<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043a\u043e\u043d\u043a\u0438 \u0447\u0430\u0442\u0430: <\/p>\n<pre><code class=\"java\">@Service public class UpdateChatPhoto implements UpdateNotificationListener&lt;TdApi.UpdateChatPhoto> {      private final UpdatesQueues updatesQueues;      public UpdateChatPhoto(UpdatesQueues updatesQueues) {         this.updatesQueues = updatesQueues;     }      @Override     public void handleNotification(TdApi.UpdateChatPhoto updateChatPhoto) {         TdApi.Chat chat = Caches.initialChatCache.get(updateChatPhoto.chatId);         if (chat != null) {             synchronized (chat) {                 chat.photo = updateChatPhoto.photo;             }             updatesQueues.addIncomingSidebarUpdate(updateChatPhoto);         }     }          @Override     public Class&lt;TdApi.UpdateChatPhoto> notificationType() {         return TdApi.UpdateChatPhoto.class;     } }<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 Spring \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u0447\u0442\u043e \u0438\u043a\u043e\u043d\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c. \u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0432\u043e\u043b\u044c\u043d\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u044d\u0448\u0438\u0440\u0443\u044e \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0435. \u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0447\u0430\u0442\u043e\u0432.<\/p>\n<pre><code class=\"java\">@Component public class GetSidebarUpdates implements Supplier&lt;List&lt;ChatPreview>> {      @Autowired     private GetChatLastMessage getChatLastMessage;      @Autowired     private GetChatNewTitle getChatNewTitle;      @Autowired     private GetChatNewOrder getChatNewOrder;      @Autowired     private GetChatReadInbox getChatReadInbox;      @Autowired     private GetNewChat getNewChat;      @Autowired     private GetNewChatPhoto getNewChatPhoto;      @Autowired     private UpdatesQueues updatesQueues;      @Override     public List&lt;ChatPreview> get() {         List&lt;ChatPreview> previews = new ArrayList&lt;>();         for (int i = 0; i &lt; 100; i++) {             TdApi.Update update = updatesQueues.pollIncomingSidebarUpdate();             if (update == null) break;              if (update instanceof TdApi.UpdateChatLastMessage upd) {                 addPreviewFromUpdate(getChatLastMessage, upd, previews);             } else if (update instanceof TdApi.UpdateChatTitle upd) {                 addPreviewFromUpdate(getChatNewTitle, upd, previews);             } else if (update instanceof TdApi.UpdateChatPosition upd) {                 addPreviewFromUpdate(getChatNewOrder, upd, previews);             } else if (update instanceof TdApi.UpdateChatReadInbox upd) {                 addPreviewFromUpdate(getChatReadInbox, upd, previews);             } else if (update instanceof<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-372224","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/372224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=372224"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/372224\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=372224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=372224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=372224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}