From 3477d72367aae4b9b8bcaebe5f64db95be7166f8 Mon Sep 17 00:00:00 2001 From: xaxtix Date: Wed, 8 Dec 2021 15:02:09 +0300 Subject: [PATCH 1/4] Update to 8.3.0 --- TMessagesProj/jni/lottie.cpp | 25 +++++- TMessagesProj/jni/rlottie/inc/rlottie.h | 13 ++- .../rlottie/src/lottie/lottieanimation.cpp | 7 +- .../jni/rlottie/src/lottie/lottieloader.cpp | 8 +- .../jni/rlottie/src/lottie/lottieloader.h | 5 +- .../jni/rlottie/src/lottie/lottieparser.cpp | 87 ++++++++++++++++++- .../jni/rlottie/src/lottie/lottieparser.h | 3 +- TMessagesProj/jni/tgnet/ApiScheme.cpp | 2 +- TMessagesProj/jni/tgnet/ApiScheme.h | 2 +- 9 files changed, 131 insertions(+), 21 deletions(-) diff --git a/TMessagesProj/jni/lottie.cpp b/TMessagesProj/jni/lottie.cpp index 984c52847..1a6f45cc9 100644 --- a/TMessagesProj/jni/lottie.cpp +++ b/TMessagesProj/jni/lottie.cpp @@ -51,7 +51,7 @@ typedef struct LottieInfo { volatile uint32_t framesAvailableInCache = 0; }; -JNIEXPORT jlong Java_org_telegram_ui_Components_RLottieDrawable_create(JNIEnv *env, jclass clazz, jstring src, jstring json, jint w, jint h, jintArray data, jboolean precache, jintArray colorReplacement, jboolean limitFps) { +JNIEXPORT jlong Java_org_telegram_ui_Components_RLottieDrawable_create(JNIEnv *env, jclass clazz, jstring src, jstring json, jint w, jint h, jintArray data, jboolean precache, jintArray colorReplacement, jboolean limitFps, jint fitzModifier) { auto info = new LottieInfo(); std::map *colors = nullptr; @@ -71,16 +71,35 @@ JNIEXPORT jlong Java_org_telegram_ui_Components_RLottieDrawable_create(JNIEnv *e } } + + FitzModifier modifier = FitzModifier::None; + switch (fitzModifier) { + case 12: + modifier = FitzModifier::Type12; + break; + case 3: + modifier = FitzModifier::Type3; + break; + case 4: + modifier = FitzModifier::Type4; + break; + case 5: + modifier = FitzModifier::Type5; + break; + case 6: + modifier = FitzModifier::Type6; + break; + } char const *srcString = env->GetStringUTFChars(src, nullptr); info->path = srcString; if (json != nullptr) { char const *jsonString = env->GetStringUTFChars(json, nullptr); if (jsonString) { - info->animation = rlottie::Animation::loadFromData(jsonString, info->path, colors); + info->animation = rlottie::Animation::loadFromData(jsonString, info->path, colors, modifier); env->ReleaseStringUTFChars(json, jsonString); } } else { - info->animation = rlottie::Animation::loadFromFile(info->path, colors); + info->animation = rlottie::Animation::loadFromFile(info->path, colors, modifier); } if (srcString) { env->ReleaseStringUTFChars(src, srcString); diff --git a/TMessagesProj/jni/rlottie/inc/rlottie.h b/TMessagesProj/jni/rlottie/inc/rlottie.h index 296546a9c..ef8a07b81 100755 --- a/TMessagesProj/jni/rlottie/inc/rlottie.h +++ b/TMessagesProj/jni/rlottie/inc/rlottie.h @@ -52,6 +52,15 @@ struct LOTLayerNode; namespace rlottie { + enum class FitzModifier { + None, + Type12, + Type3, + Type4, + Type5, + Type6 + }; + struct Color { Color() = default; Color(float r, float g , float b):_r(r), _g(g), _b(b){} @@ -258,7 +267,7 @@ public: * @internal */ static std::unique_ptr - loadFromFile(const std::string &path, std::map *colorReplacement); + loadFromFile(const std::string &path, std::map *colorReplacement, FitzModifier fitzModifier); /** * @brief Constructs an animation object from JSON string data. @@ -273,7 +282,7 @@ public: * @internal */ static std::unique_ptr - loadFromData(std::string jsonData, const std::string &key, std::map *colorReplacement, const std::string &resourcePath=""); + loadFromData(std::string jsonData, const std::string &key, std::map *colorReplacement, FitzModifier fitzModifier = FitzModifier::None, const std::string &resourcePath=""); /** * @brief Returns default framerate of the Lottie resource. diff --git a/TMessagesProj/jni/rlottie/src/lottie/lottieanimation.cpp b/TMessagesProj/jni/rlottie/src/lottie/lottieanimation.cpp index bd2880883..1331fc686 100755 --- a/TMessagesProj/jni/rlottie/src/lottie/lottieanimation.cpp +++ b/TMessagesProj/jni/rlottie/src/lottie/lottieanimation.cpp @@ -125,6 +125,7 @@ void AnimationImpl::init(const std::shared_ptr &model) std::unique_ptr Animation::loadFromData( std::string jsonData, const std::string &key, std::map *colorReplacement, + FitzModifier fitzModifier, const std::string &resourcePath) { if (jsonData.empty()) { @@ -135,7 +136,7 @@ std::unique_ptr Animation::loadFromData( LottieLoader loader; if (loader.loadFromData(std::move(jsonData), key, colorReplacement, - (resourcePath.empty() ? " " : resourcePath))) { + (resourcePath.empty() ? " " : resourcePath), fitzModifier)) { auto animation = std::unique_ptr(new Animation); animation->colorMap = colorReplacement; animation->d->init(loader.model()); @@ -145,7 +146,7 @@ std::unique_ptr Animation::loadFromData( return nullptr; } -std::unique_ptr Animation::loadFromFile(const std::string &path, std::map *colorReplacement) +std::unique_ptr Animation::loadFromFile(const std::string &path, std::map *colorReplacement, FitzModifier fitzModifier) { if (path.empty()) { vWarning << "File path is empty"; @@ -153,7 +154,7 @@ std::unique_ptr Animation::loadFromFile(const std::string &path, std: } LottieLoader loader; - if (loader.load(path, colorReplacement)) { + if (loader.load(path, colorReplacement, fitzModifier)) { auto animation = std::unique_ptr(new Animation); animation->colorMap = colorReplacement; animation->d->init(loader.model()); diff --git a/TMessagesProj/jni/rlottie/src/lottie/lottieloader.cpp b/TMessagesProj/jni/rlottie/src/lottie/lottieloader.cpp index 2d6dd6d7e..b9f50f64d 100755 --- a/TMessagesProj/jni/rlottie/src/lottie/lottieloader.cpp +++ b/TMessagesProj/jni/rlottie/src/lottie/lottieloader.cpp @@ -75,7 +75,7 @@ static std::string dirname(const std::string &path) return std::string(path, 0, len); } -bool LottieLoader::load(const std::string &path, std::map *colorReplacement) +bool LottieLoader::load(const std::string &path, std::map *colorReplacement, rlottie::FitzModifier fitzModifier) { mModel = LottieFileCache::instance().find(path); if (mModel) return true; @@ -95,7 +95,7 @@ bool LottieLoader::load(const std::string &path, std::map *col if (content.empty()) return false; const char *str = content.c_str(); - LottieParser parser(const_cast(str), dirname(path).c_str(), colorReplacement); + LottieParser parser(const_cast(str), dirname(path).c_str(), colorReplacement, fitzModifier); if (parser.hasParsingError()) { return false; } @@ -111,12 +111,12 @@ bool LottieLoader::load(const std::string &path, std::map *col bool LottieLoader::loadFromData(std::string &&jsonData, const std::string &key, std::map *colorReplacement, - const std::string &resourcePath) + const std::string &resourcePath, rlottie::FitzModifier fitzModifier) { mModel = LottieFileCache::instance().find(key); if (mModel) return true; - LottieParser parser(const_cast(jsonData.c_str()), resourcePath.c_str(), colorReplacement); + LottieParser parser(const_cast(jsonData.c_str()), resourcePath.c_str(), colorReplacement, fitzModifier); mModel = parser.model(); if (!mModel) return false; diff --git a/TMessagesProj/jni/rlottie/src/lottie/lottieloader.h b/TMessagesProj/jni/rlottie/src/lottie/lottieloader.h index ffbbce3b4..11eae03d8 100755 --- a/TMessagesProj/jni/rlottie/src/lottie/lottieloader.h +++ b/TMessagesProj/jni/rlottie/src/lottie/lottieloader.h @@ -22,13 +22,14 @@ #include #include #include +#include class LOTModel; class LottieLoader { public: - bool load(const std::string &filePath, std::map *colorReplacement); - bool loadFromData(std::string &&jsonData, const std::string &key, std::map *colorReplacement, const std::string &resourcePath); + bool load(const std::string &filePath, std::map *colorReplacement, rlottie::FitzModifier fitzModifier); + bool loadFromData(std::string &&jsonData, const std::string &key, std::map *colorReplacement, const std::string &resourcePath, rlottie::FitzModifier fitzModifier); std::shared_ptr model(); private: std::shared_ptr mModel; diff --git a/TMessagesProj/jni/rlottie/src/lottie/lottieparser.cpp b/TMessagesProj/jni/rlottie/src/lottie/lottieparser.cpp index fb87072ae..5d17aa8cb 100755 --- a/TMessagesProj/jni/rlottie/src/lottie/lottieparser.cpp +++ b/TMessagesProj/jni/rlottie/src/lottie/lottieparser.cpp @@ -182,8 +182,8 @@ protected: class LottieParserImpl : protected LookaheadParserHandler { public: - LottieParserImpl(char *str, const char *dir_path, std::map *colorReplacement) - : LookaheadParserHandler(str), mDirPath(dir_path), colorMap(colorReplacement) + LottieParserImpl(char *str, const char *dir_path, std::map *colorReplacement, rlottie::FitzModifier fitzModifier) + : LookaheadParserHandler(str), mDirPath(dir_path), colorMap(colorReplacement), mFitzModifier(fitzModifier) { } @@ -270,6 +270,9 @@ public: void parseShapeProperty(LOTAnimatable &obj); void parseDashProperty(LOTDashProperty &dash); + void parseFitzColorReplacements(); + void parseFitzColorReplacement(); + std::shared_ptr interpolator(VPointF, VPointF, std::string); LottieColor toColor(const char *str); @@ -279,6 +282,7 @@ public: bool hasParsingError(); protected: + const rlottie::FitzModifier mFitzModifier; std::unordered_map> mInterpolatorCache; std::shared_ptr mComposition; @@ -611,6 +615,8 @@ void LottieParserImpl::parseComposition() { parseAssets(comp); } else if (0 == strcmp(key, "layers")) { parseLayers(comp); + } else if (0 == strcmp(key, "fitz")) { + parseFitzColorReplacements(); } else { #ifdef DEBUG_PARSER vWarning << "Composition Attribute Skipped : " << key; @@ -659,6 +665,79 @@ void LottieParserImpl::parseAssets(LOTCompositionData *composition) { // update the precomp layers with the actual layer object } +void LottieParserImpl::parseFitzColorReplacements() +{ + RAPIDJSON_ASSERT(PeekType() == kArrayType); + EnterArray(); + while (NextArrayValue()) { + parseFitzColorReplacement(); + } +} + +void LottieParserImpl::parseFitzColorReplacement() +{ + uint32_t original = 0; + uint32_t type12 = 0; + uint32_t type3 = 0; + uint32_t type4 = 0; + uint32_t type5 = 0; + uint32_t type6 = 0; + + EnterObject(); + while (const char *key = NextObjectKey()) { + if (0 == strcmp(key, "o")) { + RAPIDJSON_ASSERT(PeekType() == kNumberType); + original = GetInt(); + } else if (0 == strcmp(key, "f12")) { + RAPIDJSON_ASSERT(PeekType() == kNumberType); + type12 = GetInt(); + } else if (0 == strcmp(key, "f3")) { + RAPIDJSON_ASSERT(PeekType() == kNumberType); + type3 = GetInt(); + } else if (0 == strcmp(key, "f4")) { + RAPIDJSON_ASSERT(PeekType() == kNumberType); + type4 = GetInt(); + } else if (0 == strcmp(key, "f5")) { + RAPIDJSON_ASSERT(PeekType() == kNumberType); + type5 = GetInt(); + } else if (0 == strcmp(key, "f6")) { + RAPIDJSON_ASSERT(PeekType() == kNumberType); + type6 = GetInt(); + } else { + Skip(key); + } + } + + uint32_t replacedType = 0; + + switch (mFitzModifier) { + case rlottie::FitzModifier::None: + break; + case rlottie::FitzModifier::Type12: + replacedType = type12; + break; + case rlottie::FitzModifier::Type3: + replacedType = type3; + break; + case rlottie::FitzModifier::Type4: + replacedType = type4; + break; + case rlottie::FitzModifier::Type5: + replacedType = type5; + break; + case rlottie::FitzModifier::Type6: + replacedType = type6; + break; + } + + if (replacedType != 0) { + if (colorMap == NULL) { + colorMap = new std::map(); + } + colorMap->insert(std::pair(original, replacedType)); + } +} + static constexpr const unsigned char B64index[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2654,8 +2733,8 @@ LottieParser::~LottieParser() delete d; } -LottieParser::LottieParser(char *str, const char *dir_path, std::map *colorReplacement) - : d(new LottieParserImpl(str, dir_path, colorReplacement)) +LottieParser::LottieParser(char *str, const char *dir_path, std::map *colorReplacement, rlottie::FitzModifier fitzModifier) + : d(new LottieParserImpl(str, dir_path, colorReplacement, fitzModifier)) { d->parseComposition(); if (d->hasParsingError()) { diff --git a/TMessagesProj/jni/rlottie/src/lottie/lottieparser.h b/TMessagesProj/jni/rlottie/src/lottie/lottieparser.h index 3e2498105..aa466d587 100755 --- a/TMessagesProj/jni/rlottie/src/lottie/lottieparser.h +++ b/TMessagesProj/jni/rlottie/src/lottie/lottieparser.h @@ -21,12 +21,13 @@ #include "lottiemodel.h" #include +#include class LottieParserImpl; class LottieParser { public: ~LottieParser(); - LottieParser(char* str, const char *dir_path, std::map *colorReplacement); + LottieParser(char* str, const char *dir_path, std::map *colorReplacement, rlottie::FitzModifier fitzModifier = rlottie::FitzModifier::None); std::shared_ptr model(); bool hasParsingError(); private: diff --git a/TMessagesProj/jni/tgnet/ApiScheme.cpp b/TMessagesProj/jni/tgnet/ApiScheme.cpp index 76a33078e..337e6a7aa 100644 --- a/TMessagesProj/jni/tgnet/ApiScheme.cpp +++ b/TMessagesProj/jni/tgnet/ApiScheme.cpp @@ -989,7 +989,7 @@ auth_Authorization *auth_Authorization::TLdeserialize(NativeByteBuffer *stream, case 0x44747e9a: result = new TL_auth_authorizationSignUpRequired(); break; - case 0xcd050916: + case 0x33fb7bb8: result = new TL_auth_authorization(); break; default: diff --git a/TMessagesProj/jni/tgnet/ApiScheme.h b/TMessagesProj/jni/tgnet/ApiScheme.h index 3bc7c4e15..9ec65bb9e 100644 --- a/TMessagesProj/jni/tgnet/ApiScheme.h +++ b/TMessagesProj/jni/tgnet/ApiScheme.h @@ -680,7 +680,7 @@ public: class TL_auth_authorization : public auth_Authorization { public: - static const uint32_t constructor = 0xcd050916; + static const uint32_t constructor = 0x33fb7bb8; int32_t flags; int32_t tmp_sessions; From 4a43f809b3e201a5cece3c2e4b3df8d04bfefff3 Mon Sep 17 00:00:00 2001 From: xaxtix Date: Thu, 9 Dec 2021 19:28:33 +0300 Subject: [PATCH 2/4] Update to 8.3.1 --- TMessagesProj/build.gradle | 4 +- .../config/debug/AndroidManifest.xml | 4 +- .../config/debug/AndroidManifest_SDK23.xml | 2 +- .../config/release/AndroidManifest.xml | 4 +- .../config/release/AndroidManifest_SDK23.xml | 4 +- .../release/AndroidManifest_standalone.xml | 4 +- TMessagesProj/src/main/AndroidManifest.xml | 4 +- .../org/telegram/messenger/BuildVars.java | 12 +- .../java/org/telegram/messenger/FileLog.java | 2 +- .../messenger/FilesMigrationService.java | 315 +++++ .../messenger/MessagesController.java | 23 +- .../telegram/messenger/MessagesStorage.java | 10 +- .../messenger/NotificationCenter.java | 2 + .../telegram/tgnet/ConnectionsManager.java | 2 +- .../main/java/org/telegram/tgnet/TLRPC.java | 40 +- .../ui/ActionBar/ActionBarMenuItem.java | 3 + .../org/telegram/ui/CacheControlActivity.java | 164 +-- .../org/telegram/ui/Cells/ChatActionCell.java | 2 +- .../org/telegram/ui/Cells/SessionCell.java | 18 +- .../java/org/telegram/ui/ChatActivity.java | 1257 +++++++++-------- .../org/telegram/ui/ChatEditTypeActivity.java | 6 +- .../telegram/ui/Components/AlertsCreator.java | 29 +- .../ui/Components/ChatActivityEnterView.java | 6 +- .../ChatAttachAlertDocumentLayout.java | 14 +- .../telegram/ui/Components/MediaActivity.java | 2 +- .../Components/MotionBackgroundDrawable.java | 1 - .../ui/Components/RecyclerListView.java | 19 +- .../ui/Components/StickerImageView.java | 85 ++ .../telegram/ui/DefaultThemesPreviewCell.java | 2 +- .../java/org/telegram/ui/DialogsActivity.java | 16 + .../java/org/telegram/ui/LaunchActivity.java | 4 +- .../java/org/telegram/ui/PhotoViewer.java | 5 +- .../java/org/telegram/ui/ProfileActivity.java | 2 +- .../org/telegram/ui/SessionBottomSheet.java | 4 +- TMessagesProj/src/main/res/values/strings.xml | 5 + 35 files changed, 1206 insertions(+), 870 deletions(-) create mode 100644 TMessagesProj/src/main/java/org/telegram/messenger/FilesMigrationService.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/StickerImageView.java diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 9edd68934..05d2525a0 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -299,7 +299,7 @@ android { } } - defaultConfig.versionCode = 2493 + defaultConfig.versionCode = 2495 applicationVariants.all { variant -> variant.outputs.all { output -> @@ -318,7 +318,7 @@ android { defaultConfig { minSdkVersion 16 targetSdkVersion 30 - versionName "8.3.0" + versionName "8.3.1" vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] diff --git a/TMessagesProj/config/debug/AndroidManifest.xml b/TMessagesProj/config/debug/AndroidManifest.xml index c01d13c3b..3938549e9 100644 --- a/TMessagesProj/config/debug/AndroidManifest.xml +++ b/TMessagesProj/config/debug/AndroidManifest.xml @@ -10,12 +10,12 @@ - + - + - + diff --git a/TMessagesProj/config/release/AndroidManifest.xml b/TMessagesProj/config/release/AndroidManifest.xml index 7bb790100..4f2e1456e 100644 --- a/TMessagesProj/config/release/AndroidManifest.xml +++ b/TMessagesProj/config/release/AndroidManifest.xml @@ -10,12 +10,12 @@ - + - + - + @@ -18,7 +18,7 @@ - + - + @@ -18,7 +18,7 @@ - + - + @@ -80,6 +80,7 @@ android:manageSpaceActivity="org.telegram.ui.ExternalActionActivity" android:supportsRtl="false" android:requestLegacyExternalStorage="true" + android:preserveLegacyExternalStorage="true" android:allowAudioPlaybackCapture="true" tools:replace="android:supportsRtl"> @@ -448,6 +449,7 @@ + diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java index ae6a40c46..7910f61e9 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java @@ -19,18 +19,14 @@ public class BuildVars { public static boolean USE_CLOUD_STRINGS = true; public static boolean CHECK_UPDATES = true; public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29; - public static int BUILD_VERSION = 2493; - public static String BUILD_VERSION_STRING = "8.3.0"; + public static int BUILD_VERSION = 2495; + public static String BUILD_VERSION_STRING = "8.3.1"; public static int APP_ID = 4; public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103"; public static String APPCENTER_HASH = "a5b5c4f5-51da-dedc-9918-d9766a22ca7c"; - // PUBLIC + public static boolean DEBUG_PRIVATE_VERSION = false; - // public static String APPCENTER_HASH_DEBUG = "f9726602-67c9-48d2-b5d0-4761f1c1a8f3"; - // PRIVATE - //public static boolean DEBUG_PRIVATE_VERSION = true; - //public static String APPCENTER_HASH_DEBUG = DEBUG_PRIVATE_VERSION ? "29d0a6f1-b92f-493a-9fce-445681d767ec" : "f9726602-67c9-48d2-b5d0-4761f1c1a8f3"; - // + public static String SMS_HASH = isStandaloneApp() ? "w0lkcmTZkKh" : (DEBUG_VERSION ? "O2P2z+/jBpJ" : "oLeq9AcOZkT"); public static String PLAYSTORE_APP_URL = "https://play.google.com/store/apps/details?id=org.telegram.messenger"; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java b/TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java index 239cdd71f..4618a54e3 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java @@ -166,7 +166,7 @@ public class FileLog { if (!BuildVars.LOGS_ENABLED) { return; } - if (BuildVars.DEBUG_VERSION && needSent(e)) { + if (BuildVars.DEBUG_VERSION && needSent(e) && logToAppCenter) { AndroidUtilities.appCenterLog(e); } ensureInitied(); diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/FilesMigrationService.java b/TMessagesProj/src/main/java/org/telegram/messenger/FilesMigrationService.java new file mode 100644 index 000000000..9ffa04135 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/messenger/FilesMigrationService.java @@ -0,0 +1,315 @@ +package org.telegram.messenger; + +import android.Manifest; +import android.app.Activity; +import android.app.Notification; +import android.app.NotificationManager; +import android.app.Service; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Build; +import android.os.Environment; +import android.os.IBinder; +import android.text.TextUtils; +import android.util.TypedValue; +import android.view.Gravity; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.TextView; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.core.graphics.ColorUtils; + +import com.google.android.exoplayer2.util.Log; + +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BottomSheet; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.Components.LayoutHelper; +import org.telegram.ui.Components.StickerImageView; +import org.telegram.ui.DialogsActivity; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.stream.Stream; + +@RequiresApi(api = Build.VERSION_CODES.R) +public class FilesMigrationService extends Service { + + public static boolean hasOldFolder; + public static boolean isRunning; + public static FilesMigrationBottomSheet filesMigrationBottomSheet; + private int totalFilesCount; + private int movedFilesCount; + private static boolean wasShown = false; + + @Nullable + @Override + public IBinder onBind(Intent intent) { + return null; + } + + public static void start() { + Intent intent = new Intent(ApplicationLoader.applicationContext, FilesMigrationService.class); + ApplicationLoader.applicationContext.startService(intent); + } + + @Override + public int onStartCommand(Intent intent, int flags, int startId) { + NotificationsController.checkOtherNotificationsChannel(); + Notification notification = new Notification.Builder(this, NotificationsController.OTHER_NOTIFICATIONS_CHANNEL) + .setContentTitle(getText(R.string.MigratingFiles)) + .setAutoCancel(false) + .setSmallIcon(R.drawable.notification) + .build(); + + isRunning = true; + new Thread() { + @Override + public void run() { + migrateOldFolder(); + AndroidUtilities.runOnUIThread(() -> { + isRunning = false; + stopForeground(true); + stopSelf(); + }); + } + }.start(); + startForeground(301, notification); + + return super.onStartCommand(intent, flags, startId); + } + + public void migrateOldFolder() { + File path = Environment.getExternalStorageDirectory(); + if (Build.VERSION.SDK_INT >= 19 && !TextUtils.isEmpty(SharedConfig.storageCacheDir)) { + ArrayList dirs = AndroidUtilities.getRootDirs(); + if (dirs != null) { + for (int a = 0, N = dirs.size(); a < N; a++) { + File dir = dirs.get(a); + if (dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) { + path = dir; + break; + } + } + } + } + + File newPath = ApplicationLoader.applicationContext.getExternalFilesDir(null); + File telegramPath = new File(newPath, "Telegram"); + File oldPath = new File(path, "Telegram"); + + totalFilesCount = getFilesCount(oldPath); + + long moveStart = System.currentTimeMillis(); + if (oldPath.canRead() && oldPath.canWrite()) { + moveDirectory(oldPath, telegramPath); + } + long dt = System.currentTimeMillis() - moveStart; + + FileLog.d("move time = " + dt); + + SharedPreferences sharedPreferences = ApplicationLoader.applicationContext.getSharedPreferences("systemConfig", Context.MODE_PRIVATE); + sharedPreferences.edit().putBoolean("migration_to_scoped_storage_finished", true).apply(); + } + + private int getFilesCount(File source) { + if (!source.exists()) { + return 0; + } + int count = 0; + File[] fileList = source.listFiles(); + if (fileList != null) { + for (int i = 0; i < fileList.length; i++) { + if (fileList[i].isDirectory()) { + count += getFilesCount(fileList[i]); + } else { + count++; + } + } + } + return count; + } + + private void moveDirectory(File source, File target) { + if (!source.exists() || (!target.exists() && !target.mkdir())) { + return; + } + try (Stream files = Files.list(source.toPath())) { + files.forEach(path -> { + File dest = new File(target, path.getFileName().toString()); + if (Files.isDirectory(path)) { + moveDirectory(path.toFile(), dest); + } else { + try { + Files.move(path, dest.toPath()); + } catch (Exception e) { + FileLog.e(e, false); + try { + path.toFile().delete(); + } catch (Exception e1) { + FileLog.e(e1); + } + } + movedFilesCount++; + updateProgress(); + } + }); + } catch (Exception e) { + FileLog.e(e); + } + try { + source.delete(); + } catch (Exception e) { + FileLog.e(e); + } + } + + long lastUpdateTime; + private void updateProgress() { + long time = System.currentTimeMillis(); + if (time - lastUpdateTime > 20 || movedFilesCount >= totalFilesCount - 1) { + int currentCount = movedFilesCount; + AndroidUtilities.runOnUIThread(() -> { + Notification notification = new Notification.Builder(FilesMigrationService.this, NotificationsController.OTHER_NOTIFICATIONS_CHANNEL) + .setContentTitle(getText(R.string.MigratingFiles)) + .setContentText(String.format("%s/%s", currentCount, totalFilesCount)) + .setSmallIcon(R.drawable.notification) + .setAutoCancel(false) + .setProgress(totalFilesCount, currentCount, false) + .build(); + NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + mNotificationManager.notify(301, notification); + }); + } + } + + public static void checkBottomSheet(BaseFragment fragment) { + SharedPreferences sharedPreferences = ApplicationLoader.applicationContext.getSharedPreferences("systemConfig", Context.MODE_PRIVATE); + if (!Environment.isExternalStorageLegacy() || sharedPreferences.getBoolean("migration_to_scoped_storage_finished", false) || sharedPreferences.getInt("migration_to_scoped_storage_count", 0) >= 5 || wasShown || filesMigrationBottomSheet != null || isRunning) { + return; + } + if (Build.VERSION.SDK_INT >= 30) { + File path = Environment.getExternalStorageDirectory(); + if (!TextUtils.isEmpty(SharedConfig.storageCacheDir)) { + ArrayList dirs = AndroidUtilities.getRootDirs(); + if (dirs != null) { + for (int a = 0, N = dirs.size(); a < N; a++) { + File dir = dirs.get(a); + if (dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) { + path = dir; + break; + } + } + } + } + File oldDirectory = new File(path, "Telegram"); + hasOldFolder = oldDirectory.exists(); + } + if (hasOldFolder) { + filesMigrationBottomSheet = new FilesMigrationBottomSheet(fragment); + filesMigrationBottomSheet.show(); + wasShown = true; + sharedPreferences.edit().putInt("migration_to_scoped_storage_count", sharedPreferences.getInt("migration_to_scoped_storage_count", 0) + 1).apply(); + } else { + sharedPreferences.edit().putBoolean("migration_to_scoped_storage_finished", true).apply(); + } + } + + public static class FilesMigrationBottomSheet extends BottomSheet { + + BaseFragment fragment; + + @Override + protected boolean canDismissWithSwipe() { + return false; + } + + @Override + protected boolean canDismissWithTouchOutside() { + return false; + } + + public FilesMigrationBottomSheet(BaseFragment fragment) { + super(fragment.getParentActivity(), false); + this.fragment = fragment; + setCanceledOnTouchOutside(false); + Context context = fragment.getParentActivity(); + LinearLayout linearLayout = new LinearLayout(context); + linearLayout.setOrientation(LinearLayout.VERTICAL); + + StickerImageView imageView = new StickerImageView(context, currentAccount); + imageView.setStickerNum(7); + imageView.getImageReceiver().setAutoRepeat(1); + linearLayout.addView(imageView, LayoutHelper.createLinear(144, 144, Gravity.CENTER_HORIZONTAL, 0, 16, 0, 0)); + + TextView title = new TextView(context); + title.setGravity(Gravity.START); + title.setTextColor(Theme.getColor(Theme.key_dialogTextBlack)); + title.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20); + title.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + title.setText(LocaleController.getString("MigrateOldFolderTitle", R.string.MigrateOldFolderTitle)); + linearLayout.addView(title, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 21, 30, 21, 0)); + + TextView description = new TextView(context); + description.setGravity(Gravity.START); + description.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15); + description.setTextColor(Theme.getColor(Theme.key_dialogTextBlack)); + description.setText(AndroidUtilities.replaceTags(LocaleController.getString("MigrateOldFolderDescription", R.string.MigrateOldFolderDescription))); + linearLayout.addView(description, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 21, 15, 21, 16)); + + + TextView buttonTextView = new TextView(context); + buttonTextView.setPadding(AndroidUtilities.dp(34), 0, AndroidUtilities.dp(34), 0); + buttonTextView.setGravity(Gravity.CENTER); + buttonTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); + buttonTextView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + buttonTextView.setText(LocaleController.getString("MigrateOldFolderButton", R.string.MigrateOldFolderButton)); + + buttonTextView.setTextColor(Theme.getColor(Theme.key_featuredStickers_buttonText)); + buttonTextView.setBackgroundDrawable(Theme.createSimpleSelectorRoundRectDrawable(AndroidUtilities.dp(6), Theme.getColor(Theme.key_featuredStickers_addButton), ColorUtils.setAlphaComponent(Theme.getColor(Theme.key_windowBackgroundWhite), 120))); + + linearLayout.addView(buttonTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 48, 0, 16, 15, 16, 16)); + + buttonTextView.setOnClickListener(view -> { + migrateOldFolder(); + }); + + ScrollView scrollView = new ScrollView(context); + scrollView.addView(linearLayout); + setCustomView(scrollView); + } + + public void migrateOldFolder() { + Activity activity = fragment.getParentActivity(); + boolean canWrite = activity.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED; + boolean canRead = activity.checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED; + + if (!canRead || !canWrite) { + ArrayList permissions = new ArrayList<>(); + if (!canRead) { + permissions.add(Manifest.permission.READ_EXTERNAL_STORAGE); + } + if (!canWrite) { + permissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE); + } + String[] string = new String[permissions.size()]; + activity.requestPermissions(permissions.toArray(string), 4); + return; + } + start(); + dismiss(); + } + + @Override + public void dismiss() { + super.dismiss(); + filesMigrationBottomSheet = null; + } + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index 3572033d7..457b38b2d 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -4722,20 +4722,26 @@ public class MessagesController extends BaseController implements NotificationCe }); } - public void deleteUserChannelHistory(TLRPC.Chat chat, TLRPC.User user, int offset) { + public void deleteUserChannelHistory(TLRPC.Chat currentChat, TLRPC.User fromUser, TLRPC.Chat fromChat, int offset) { + long fromId = 0; + if (fromUser != null) { + fromId = fromUser.id; + } else if (fromChat != null){ + fromId = fromChat.id; + } if (offset == 0) { - getMessagesStorage().deleteUserChatHistory(-chat.id, user.id); + getMessagesStorage().deleteUserChatHistory(-currentChat.id, fromId); } TLRPC.TL_channels_deleteParticipantHistory req = new TLRPC.TL_channels_deleteParticipantHistory(); - req.channel = getInputChannel(chat); - req.participant = getInputPeer(user); + req.channel = getInputChannel(currentChat); + req.participant = fromUser != null ? getInputPeer(fromUser) : getInputPeer(fromChat); getConnectionsManager().sendRequest(req, (response, error) -> { if (error == null) { TLRPC.TL_messages_affectedHistory res = (TLRPC.TL_messages_affectedHistory) response; if (res.offset > 0) { - deleteUserChannelHistory(chat, user, res.offset); + deleteUserChannelHistory(currentChat, fromUser, fromChat, res.offset); } - processNewChannelDifferenceParams(res.pts, res.pts_count, chat.id); + processNewChannelDifferenceParams(res.pts, res.pts_count, currentChat.id); } }); } @@ -14810,10 +14816,7 @@ public class MessagesController extends BaseController implements NotificationCe } public void markSponsoredAsRead(long dialog_id, MessageObject object) { - ArrayList messages = getSponsoredMessages(dialog_id); - if (messages != null) { - messages.remove(object); - } + sponsoredMessages.remove(dialog_id); } public void deleteMessagesRange(long dialogId, long channelId, int minDate, int maxDate, boolean forAll, Runnable callback) { diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java index dc59684e8..80294eb4d 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java @@ -292,7 +292,7 @@ public class MessagesStorage extends BaseController { shmCacheFile = new File(filesDir, "cache4.db-shm"); boolean createTable = false; - //cacheFile.delete(); + if (!cacheFile.exists()) { createTable = true; } @@ -452,6 +452,9 @@ public class MessagesStorage extends BaseController { } cursor.dispose(); } catch (Exception e) { + if (e.getMessage() != null && e.getMessage().contains("malformed")) { + throw new RuntimeException("malformed"); + } FileLog.e(e); try { database.executeFast("CREATE TABLE IF NOT EXISTS params(id INTEGER PRIMARY KEY, seq INTEGER, pts INTEGER, date INTEGER, qts INTEGER, lsv INTEGER, sg INTEGER, pbytes BLOB)").stepThis().dispose(); @@ -6015,6 +6018,9 @@ public class MessagesStorage extends BaseController { participant = TLRPC.ChannelParticipant.TLdeserialize(data, data.readInt32(false), false); data.reuse(); } + if (participant != null && participant.user_id == getUserConfig().clientUserId) { + user = getUserConfig().getCurrentUser(); + } if (user != null && participant != null) { if (user.status != null) { user.status.expires = cursor.intValue(1); @@ -8748,7 +8754,7 @@ public class MessagesStorage extends BaseController { try { SQLitePreparedStatement state = database.executeFast("UPDATE messages_v2 SET replies_data = ? WHERE mid = ? AND uid = ?"); TLRPC.MessageReplies currentReplies = null; - SQLiteCursor cursor = database.queryFinalized(String.format("SELECT replies_data FROM messages_v2 WHERE mid = %d AND uid = %d", mid, -chatId)); + SQLiteCursor cursor = database.queryFinalized(String.format(Locale.ENGLISH, "SELECT replies_data FROM messages_v2 WHERE mid = %d AND uid = %d", mid, -chatId)); if (cursor.next()) { NativeByteBuffer data = cursor.byteBufferValue(0); if (data != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/NotificationCenter.java b/TMessagesProj/src/main/java/org/telegram/messenger/NotificationCenter.java index 54d978597..a9b64e0ea 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/NotificationCenter.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/NotificationCenter.java @@ -13,6 +13,8 @@ import androidx.annotation.UiThread; import android.os.SystemClock; import android.util.SparseArray; +import com.google.android.exoplayer2.util.Log; + import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; diff --git a/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java b/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java index 36d12943d..8a62a2595 100644 --- a/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java +++ b/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java @@ -1025,7 +1025,7 @@ public class ConnectionsManager extends BaseController { httpConnectionStream.close(); } } catch (Throwable e) { - FileLog.e(e); + FileLog.e(e, false); } try { if (outbuf != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java b/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java index 7e5e3de46..d2d206cc3 100644 --- a/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java +++ b/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java @@ -49905,29 +49905,29 @@ public class TLRPC { } } - public static class TL_channels_reportSpam extends TLObject { - public static int constructor = 0xfe087810; + public static class TL_channels_reportSpam extends TLObject { + public static int constructor = 0xf44a8315; - public InputChannel channel; - public InputUser user_id; - public ArrayList id = new ArrayList<>(); + public InputChannel channel; + public InputPeer participant; + public ArrayList id = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - channel.serializeToStream(stream); - user_id.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = id.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt32(id.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + channel.serializeToStream(stream); + participant.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = id.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt32(id.get(a)); + } + } + } public static class TL_channels_getMessages extends TLObject { public static int constructor = 0x93d7b347; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java index e3b25c574..f70624ac3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java @@ -1590,6 +1590,7 @@ public class ActionBarMenuItem extends FrameLayout { if (view != null && view.getVisibility() != GONE) { view.setVisibility(GONE); measurePopup = true; + checkHideMenuItem(); } } @@ -1618,6 +1619,7 @@ public class ActionBarMenuItem extends FrameLayout { popupLayout.getItemAt(a).setVisibility(GONE); } measurePopup = true; + checkHideMenuItem(); } public boolean isSubItemVisible(int id) { @@ -1636,6 +1638,7 @@ public class ActionBarMenuItem extends FrameLayout { if (view != null && view.getVisibility() != VISIBLE) { view.setVisibility(VISIBLE); measurePopup = true; + checkHideMenuItem(); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/CacheControlActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/CacheControlActivity.java index cca5ae1d6..fcb1a3b7e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/CacheControlActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/CacheControlActivity.java @@ -10,13 +10,11 @@ package org.telegram.ui; import android.content.Context; import android.content.DialogInterface; -import android.content.Intent; import android.content.SharedPreferences; -import android.net.Uri; +import android.content.pm.PackageManager; import android.os.Build; import android.os.Environment; import android.os.StatFs; -import android.provider.Settings; import android.text.TextUtils; import android.transition.ChangeBounds; import android.transition.Fade; @@ -25,7 +23,6 @@ import android.transition.TransitionSet; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; -import android.widget.CheckBox; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TextView; @@ -35,18 +32,14 @@ import androidx.core.widget.NestedScrollView; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.google.android.exoplayer2.util.Log; - import org.telegram.SQLite.SQLiteCursor; import org.telegram.SQLite.SQLiteDatabase; import org.telegram.SQLite.SQLitePreparedStatement; import org.telegram.messenger.AndroidUtilities; -import org.telegram.messenger.ApplicationLoader; -import org.telegram.messenger.BuildConfig; -import org.telegram.messenger.BuildVars; import org.telegram.messenger.DialogObject; import org.telegram.messenger.FileLoader; import org.telegram.messenger.FileLog; +import org.telegram.messenger.FilesMigrationService; import org.telegram.messenger.ImageLoader; import org.telegram.messenger.LocaleController; import org.telegram.messenger.MediaDataController; @@ -79,11 +72,7 @@ import org.telegram.ui.Components.StroageUsageView; import org.telegram.ui.Components.UndoView; import java.io.File; -import java.nio.file.CopyOption; -import java.nio.file.Files; -import java.nio.file.Path; import java.util.ArrayList; -import java.util.stream.Stream; public class CacheControlActivity extends BaseFragment { @@ -118,7 +107,6 @@ public class CacheControlActivity extends BaseFragment { private boolean calculating = true; private volatile boolean canceled = false; - private boolean hasOldFolder; private View bottomSheetView; private BottomSheet bottomSheet; @@ -213,24 +201,6 @@ public class CacheControlActivity extends BaseFragment { }); fragmentCreateTime = System.currentTimeMillis(); - - if (Build.VERSION.SDK_INT >= 30) { - File path = Environment.getExternalStorageDirectory(); - if (Build.VERSION.SDK_INT >= 19 && !TextUtils.isEmpty(SharedConfig.storageCacheDir)) { - ArrayList dirs = AndroidUtilities.getRootDirs(); - if (dirs != null) { - for (int a = 0, N = dirs.size(); a < N; a++) { - File dir = dirs.get(a); - if (dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) { - path = dir; - break; - } - } - } - } - File oldDirectory = new File(path, "Telegram"); - hasOldFolder = oldDirectory.exists(); - } updateRows(); return true; } @@ -247,21 +217,18 @@ public class CacheControlActivity extends BaseFragment { cacheInfoRow = rowCount++; databaseRow = rowCount++; databaseInfoRow = rowCount++; -// if (hasOldFolder) { -// migrateOldFolderRow = rowCount++; -// } } private void updateStorageUsageRow() { View view = layoutManager.findViewByPosition(storageUsageRow); if (view instanceof StroageUsageView) { StroageUsageView stroageUsageView = ((StroageUsageView) view); - long currentTime = System.currentTimeMillis(); + long currentTime = System.currentTimeMillis(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && currentTime - fragmentCreateTime > 250) { TransitionSet transition = new TransitionSet(); ChangeBounds changeBounds = new ChangeBounds(); changeBounds.setDuration(250); - changeBounds.excludeTarget(stroageUsageView.legendLayout,true); + changeBounds.excludeTarget(stroageUsageView.legendLayout, true); Fade in = new Fade(Fade.IN); in.setDuration(290); transition @@ -569,111 +536,7 @@ public class CacheControlActivity extends BaseFragment { @RequiresApi(api = Build.VERSION_CODES.R) private void migrateOldFolder() { - boolean isExternalStorageManager = Environment.isExternalStorageManager(); - - if (!BuildVars.NO_SCOPED_STORAGE && !isExternalStorageManager) { - AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); - builder.setTitle(LocaleController.getString("MigrateOldFolder", R.string.MigrateOldFolder)); - builder.setMessage(LocaleController.getString("ManageAllFilesRational2", R.string.ManageAllFilesRational2)); - builder.setPositiveButton(LocaleController.getString("Allow", R.string.Allow), (i1, i2) -> { - Uri uri = Uri.parse("package:" + BuildConfig.APPLICATION_ID); - getParentActivity().startActivity(new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, uri)); - }); - builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), (i1, i2) -> { - - }); - builder.show(); - return; - } - - Thread thread = new Thread() { - - int totalFilesCount; - int movedFilesCount; - @Override - public void run() { - super.run(); - File path = Environment.getExternalStorageDirectory(); - if (Build.VERSION.SDK_INT >= 19 && !TextUtils.isEmpty(SharedConfig.storageCacheDir)) { - ArrayList dirs = AndroidUtilities.getRootDirs(); - if (dirs != null) { - for (int a = 0, N = dirs.size(); a < N; a++) { - File dir = dirs.get(a); - if (dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) { - path = dir; - break; - } - } - } - } - - File newPath = ApplicationLoader.applicationContext.getExternalFilesDir(null); - File telegramPath = new File(newPath, "Telegram"); - File oldPath = new File(path, "Telegram"); - - totalFilesCount = getFilesCount(oldPath); - - long moveStart = System.currentTimeMillis(); - moveDirectory(oldPath, telegramPath); - long dt = System.currentTimeMillis() - moveStart; - FileLog.d("move time = " + dt); - } - - private int getFilesCount(File source) { - if (!source.exists()) { - return 0; - } - int count = 0; - File[] fileList = source.listFiles(); - for (int i = 0; i < fileList.length; i++) { - if (fileList[i].isDirectory()) { - count += getFilesCount(fileList[i]); - } else { - count++; - } - } - return count; - } - - private void moveDirectory(File source, File target) { - if (!source.exists() || (!target.exists() && !target.mkdir())) { - return; - } - try (Stream files = Files.list(source.toPath())) { - files.forEach(path -> { - File dest = new File(target, path.getFileName().toString()); - if (Files.isDirectory(path)) { - moveDirectory(path.toFile(), dest); - } else { - try { - Files.move(path, dest.toPath()); - } catch (Exception e) { - FileLog.e(e); - try { - path.toFile().delete(); - } catch (Exception e1) { - FileLog.e(e1); - } - } - movedFilesCount++; - updateProgress(); - } - }); - } catch (Exception e) { - FileLog.e(e); - } - try { - source.delete(); - } catch (Exception e) { - FileLog.e(e); - } - } - - private void updateProgress() { - float p = movedFilesCount / (float) totalFilesCount; - } - }; - thread.start(); + FilesMigrationService.checkBottomSheet(this); } private void clearDatabase() { @@ -982,4 +845,21 @@ public class CacheControlActivity extends BaseFragment { arrayList.add(new ThemeDescription(bottomSheetView, 0, null, null, null, null, Theme.key_statisticChartLine_indigo)); return arrayList; } + + @Override + public void onRequestPermissionsResultFragment(int requestCode, String[] permissions, int[] grantResults) { + if (requestCode == 4) { + boolean allGranted = true; + for (int a = 0; a < grantResults.length; a++) { + if (grantResults[a] != PackageManager.PERMISSION_GRANTED) { + allGranted = false; + break; + } + } + if (allGranted && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && FilesMigrationService.filesMigrationBottomSheet != null) { + FilesMigrationService.filesMigrationBottomSheet.migrateOldFolder(); + } + + } + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java index 51c7bdc67..78dd6fcaf 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java @@ -378,7 +378,7 @@ public class ChatActionCell extends BaseCell implements DownloadController.FileD } else if (url.startsWith("http")) { Browser.openUrl(getContext(), url); } else { - delegate.needOpenUserProfile(Integer.parseInt(url)); + delegate.needOpenUserProfile(Long.parseLong(url)); } } result = true; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SessionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SessionCell.java index 61a170e7d..55985d392 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SessionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SessionCell.java @@ -105,6 +105,16 @@ public class SessionCell extends FrameLayout { linearLayout.addView(onlineTextView, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, Gravity.RIGHT | Gravity.TOP, 0, 2, 0, 0)); } + int leftMargin; + int rightMargin; + if (LocaleController.isRTL) { + rightMargin = type == 0 ? 72 : 21; + leftMargin = 21; + } else { + leftMargin = type == 0 ? 72 : 21; + rightMargin = 21; + } + detailTextView = new TextView(context); detailTextView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); detailTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); @@ -113,7 +123,7 @@ public class SessionCell extends FrameLayout { detailTextView.setSingleLine(true); detailTextView.setEllipsize(TextUtils.TruncateAt.END); detailTextView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP); - addView(detailTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, type == 0 ? 72 : 21, 36, 21, 0)); + addView(detailTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, leftMargin, 36, rightMargin, 0)); detailExTextView = new TextView(context); detailExTextView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText3)); @@ -123,7 +133,7 @@ public class SessionCell extends FrameLayout { detailExTextView.setSingleLine(true); detailExTextView.setEllipsize(TextUtils.TruncateAt.END); detailExTextView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP); - addView(detailExTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, type == 0 ? 72 : 21, 59, 21, 0)); + addView(detailExTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, leftMargin, 59, rightMargin, 0)); } @Override @@ -136,11 +146,7 @@ public class SessionCell extends FrameLayout { if (object instanceof TLRPC.TL_authorization) { TLRPC.TL_authorization session = (TLRPC.TL_authorization) object; - - imageView.setImageDrawable(createDrawable(session)); - // nameTextView.setText(String.format(Locale.US, "%s %s", session.app_name, session.app_version)); - StringBuilder stringBuilder = new StringBuilder(); if (session.device_model.length() != 0) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 892bc3555..63cddae57 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -1794,9 +1794,13 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not * @return Other same chats index difference */ public int getOtherSameChatsDiff() { + if (parentLayout == null || parentLayout.fragmentsStack == null) { + return 0; + } int cur = parentLayout.fragmentsStack.indexOf(this); - if (cur == -1) + if (cur == -1) { cur = parentLayout.fragmentsStack.size(); + } int i = cur; for (int a = 0; a < parentLayout.fragmentsStack.size(); a++) { BaseFragment fragment = parentLayout.fragmentsStack.get(a); @@ -2344,6 +2348,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not }); } }); + } else { + actionBar.setSubtitle(LocaleController.getString("NoMessagesForThisDay", R.string.NoMessagesForThisDay)); } } }); @@ -2388,7 +2394,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not AndroidUtilities.updateViewVisibilityAnimated(avatarContainer, true, 0.95f, true); if (editTextItem != null && editTextItem.getTag() != null) { if (headerItem != null) { - Log.d("kek", "2"); headerItem.setVisibility(View.GONE); } if (editTextItem != null) { @@ -2405,7 +2410,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } else if (chatActivityEnterView.hasText() && TextUtils.isEmpty(chatActivityEnterView.getSlowModeTimer()) && (currentChat == null || ChatObject.canSendMessages(currentChat))) { if (headerItem != null) { - Log.d("kek", "3"); headerItem.setVisibility(View.GONE); } if (editTextItem != null) { @@ -2516,7 +2520,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not searchItemVisible = false; } - if (chatMode == 0 && threadMessageId == 0 && !UserObject.isReplyUser(currentUser) && reportType < 0) { + if (chatMode == 0 && threadMessageId == 0 && !UserObject.isReplyUser(currentUser) && reportType < 0 && !inMenuMode) { TLRPC.UserFull userFull = null; if (currentUser != null) { audioCallIconItem = menu.addItem(call, R.drawable.ic_call, themeDelegate); @@ -6972,7 +6976,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (editTextItem.getTag() == null) { editTextItem.setTag(1); editTextItem.setVisibility(View.VISIBLE); - Log.d("kek", "4"); headerItem.setVisibility(View.GONE); attachItem.setVisibility(View.GONE); } @@ -6983,7 +6986,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not editTextItem.setTag(null); editTextItem.setVisibility(View.GONE); if (chatActivityEnterView.hasText() && TextUtils.isEmpty(chatActivityEnterView.getSlowModeTimer())) { - Log.d("kek", "5"); headerItem.setVisibility(View.GONE); attachItem.setVisibility(View.VISIBLE); } else { @@ -7045,7 +7047,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } if (TextUtils.isEmpty(chatActivityEnterView.getSlowModeTimer())) { if (headerItem != null) { - Log.d("kek", "6"); headerItem.setVisibility(View.GONE); } if (attachItem != null) { @@ -14171,14 +14172,25 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } if (startLoadFromDate != 0) { int dateObjectIndex = -1; + int closeDateObjectIndex = -1; + int closeDateDiff = 0; for (int i = 0; i < messages.size(); i++) { if (messages.get(i).isDateObject && Math.abs(startLoadFromDate - messages.get(i).messageOwner.date) <= 100) { dateObjectIndex = i; break; } + if (messages.get(i).isDateObject) { + int timeDiff = Math.abs(startLoadFromDate - messages.get(i).messageOwner.date); + if (closeDateObjectIndex == -1 || timeDiff < closeDateDiff) { + closeDateDiff = timeDiff; + closeDateObjectIndex = i; + } + } } - if (dateObjectIndex > 0) { + if (dateObjectIndex >= 0) { chatLayoutManager.scrollToPositionWithOffset(chatAdapter.messagesStartRow + dateObjectIndex, (int) (AndroidUtilities.dp(4)), false); + } else if (closeDateObjectIndex >= 0) { + chatLayoutManager.scrollToPositionWithOffset(chatAdapter.messagesStartRow + closeDateObjectIndex, chatListView.getMeasuredHeight() / 2 - AndroidUtilities.dp(24), false); } } } @@ -21901,7 +21913,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (!actionBar.isSearchFieldVisible()) { AndroidUtilities.updateViewVisibilityAnimated(avatarContainer, false, 0.95f, true); if (headerItem != null) { - Log.d("kek", "1"); headerItem.setVisibility(View.GONE); } if (attachItem != null) { @@ -22964,681 +22975,675 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not view = new ChatMessageCell(mContext, true, themeDelegate); } ChatMessageCell chatMessageCell = (ChatMessageCell) view; - if (!inPreviewMode) { - chatMessageCell.setDelegate(new ChatMessageCell.ChatMessageCellDelegate() { + chatMessageCell.setDelegate(new ChatMessageCell.ChatMessageCellDelegate() { - @Override - public void didPressHint(ChatMessageCell cell, int type) { - if (type == 0) { - TLRPC.TL_messageMediaPoll media = (TLRPC.TL_messageMediaPoll) cell.getMessageObject().messageOwner.media; - showPollSolution(cell.getMessageObject(), media.results); - } else if (type == 1) { - MessageObject messageObject = cell.getMessageObject(); - if (messageObject.messageOwner.fwd_from == null || TextUtils.isEmpty(messageObject.messageOwner.fwd_from.psa_type)) { - return; - } - CharSequence text = LocaleController.getString("PsaMessageInfo_" + messageObject.messageOwner.fwd_from.psa_type); - if (TextUtils.isEmpty(text)) { - text = LocaleController.getString("PsaMessageInfoDefault", R.string.PsaMessageInfoDefault); - } - SpannableStringBuilder stringBuilder = new SpannableStringBuilder(text); - MessageObject.addLinks(false, stringBuilder); - MessageObject.GroupedMessages group = cell.getCurrentMessagesGroup(); - if (group != null) { - for (int a = 0, N = group.posArray.size(); a < N; a++) { - MessageObject.GroupedMessagePosition pos = group.posArray.get(a); - if ((pos.flags & MessageObject.POSITION_FLAG_LEFT) != 0) { - MessageObject m = group.messages.get(a); - if (m != messageObject) { - messageObject = m; - int count = chatListView.getChildCount(); - for (int b = 0; b < count; b++) { - View view = chatListView.getChildAt(b); - if (!(view instanceof ChatMessageCell)) { - continue; - } - ChatMessageCell c = (ChatMessageCell) view; - if (messageObject.equals(c.getMessageObject())) { - cell = c; - } + @Override + public void didPressHint(ChatMessageCell cell, int type) { + if (type == 0) { + TLRPC.TL_messageMediaPoll media = (TLRPC.TL_messageMediaPoll) cell.getMessageObject().messageOwner.media; + showPollSolution(cell.getMessageObject(), media.results); + } else if (type == 1) { + MessageObject messageObject = cell.getMessageObject(); + if (messageObject.messageOwner.fwd_from == null || TextUtils.isEmpty(messageObject.messageOwner.fwd_from.psa_type)) { + return; + } + CharSequence text = LocaleController.getString("PsaMessageInfo_" + messageObject.messageOwner.fwd_from.psa_type); + if (TextUtils.isEmpty(text)) { + text = LocaleController.getString("PsaMessageInfoDefault", R.string.PsaMessageInfoDefault); + } + SpannableStringBuilder stringBuilder = new SpannableStringBuilder(text); + MessageObject.addLinks(false, stringBuilder); + MessageObject.GroupedMessages group = cell.getCurrentMessagesGroup(); + if (group != null) { + for (int a = 0, N = group.posArray.size(); a < N; a++) { + MessageObject.GroupedMessagePosition pos = group.posArray.get(a); + if ((pos.flags & MessageObject.POSITION_FLAG_LEFT) != 0) { + MessageObject m = group.messages.get(a); + if (m != messageObject) { + messageObject = m; + int count = chatListView.getChildCount(); + for (int b = 0; b < count; b++) { + View view = chatListView.getChildAt(b); + if (!(view instanceof ChatMessageCell)) { + continue; + } + ChatMessageCell c = (ChatMessageCell) view; + if (messageObject.equals(c.getMessageObject())) { + cell = c; } } - break; } + break; } } - showInfoHint(messageObject, stringBuilder, 1); } - cell.showHintButton(false, true, type); + showInfoHint(messageObject, stringBuilder, 1); } + cell.showHintButton(false, true, type); + } - @Override - public boolean shouldDrawThreadProgress(ChatMessageCell cell) { - MessageObject.GroupedMessages group = cell.getCurrentMessagesGroup(); - MessageObject message; - if (group != null && !group.messages.isEmpty()) { - message = group.messages.get(0); + @Override + public boolean shouldDrawThreadProgress(ChatMessageCell cell) { + MessageObject.GroupedMessages group = cell.getCurrentMessagesGroup(); + MessageObject message; + if (group != null && !group.messages.isEmpty()) { + message = group.messages.get(0); + } else { + message = cell.getMessageObject(); + } + if (message == null) { + return false; + } + return message.getId() == commentLoadingMessageId; + } + + @Override + public void didPressSideButton(ChatMessageCell cell) { + if (getParentActivity() == null) { + return; + } + if (chatActivityEnterView != null) { + chatActivityEnterView.closeKeyboard(); + } + MessageObject messageObject = cell.getMessageObject(); + if (chatMode == MODE_PINNED) { + chatActivityDelegate.openReplyMessage(messageObject.getId()); + finishFragment(); + } else if ((UserObject.isReplyUser(currentUser) || UserObject.isUserSelf(currentUser)) && messageObject.messageOwner.fwd_from.saved_from_peer != null) { + if (UserObject.isReplyUser(currentUser) && messageObject.messageOwner.reply_to != null && messageObject.messageOwner.reply_to.reply_to_top_id != 0) { + openDiscussionMessageChat(messageObject.messageOwner.reply_to.reply_to_peer_id.channel_id, null, messageObject.messageOwner.reply_to.reply_to_top_id, 0, -1, messageObject.messageOwner.fwd_from.saved_from_msg_id, messageObject); } else { - message = cell.getMessageObject(); + openOriginalReplyChat(messageObject); } - if (message == null) { - return false; + } else { + ArrayList arrayList = null; + if (messageObject.getGroupId() != 0) { + MessageObject.GroupedMessages groupedMessages = groupedMessagesMap.get(messageObject.getGroupId()); + if (groupedMessages != null) { + arrayList = groupedMessages.messages; + } } - return message.getId() == commentLoadingMessageId; - } + if (arrayList == null) { + arrayList = new ArrayList<>(); + arrayList.add(messageObject); + } + showDialog(new ShareAlert(mContext, ChatActivity.this, arrayList, null, null, ChatObject.isChannel(currentChat), null, null, false, false, themeDelegate) { + @Override + public void dismissInternal() { + super.dismissInternal(); + AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid); + if (chatActivityEnterView.getVisibility() == View.VISIBLE) { + fragmentView.requestLayout(); + } + } - @Override - public void didPressSideButton(ChatMessageCell cell) { + @Override + protected void onSend(LongSparseArray dids, int count) { + if (dids.size() == 1) { + undoView.showWithAction(dids.valueAt(0).id, UndoView.ACTION_FWD_MESSAGES, count); + } else { + undoView.showWithAction(0, UndoView.ACTION_FWD_MESSAGES, count, dids.size(), null, null); + } + } + }); + AndroidUtilities.setAdjustResizeToNothing(getParentActivity(), classGuid); + fragmentView.requestLayout(); + } + } + + @Override + public boolean needPlayMessage(MessageObject messageObject) { + if (messageObject.isVoice() || messageObject.isRoundVideo()) { + boolean result = MediaController.getInstance().playMessage(messageObject); + MediaController.getInstance().setVoiceMessagesPlaylist(result ? createVoiceMessagesPlaylist(messageObject, false) : null, false); + return result; + } else if (messageObject.isMusic()) { + return MediaController.getInstance().setPlaylist(messages, messageObject, mergeDialogId); + } + return false; + } + + @Override + public void videoTimerReached() { + showNoSoundHint(); + } + + @Override + public void didPressTime(ChatMessageCell cell) { + undoView.showWithAction(dialog_id, UndoView.ACTION_IMPORT_INFO, null); + } + + @Override + public void didPressChannelAvatar(ChatMessageCell cell, TLRPC.Chat chat, int postId, float touchX, float touchY) { + if (chat == null) { + return; + } + if (actionBar.isActionModeShowed() || reportType >= 0) { + processRowSelect(cell, true, touchX, touchY); + return; + } + openChat(cell, chat, postId); + } + + @Override + public void didPressHiddenForward(ChatMessageCell cell) { + if (cell.getMessageObject().isImportedForward()) { + didPressTime(cell); + return; + } + showForwardHint(cell); + } + + @Override + public void didPressOther(ChatMessageCell cell, float otherX, float otherY) { + MessageObject messageObject = cell.getMessageObject(); + if (messageObject.type == 16) { + if (currentUser != null) { + VoIPHelper.startCall(currentUser, messageObject.isVideoCall(), userInfo != null && userInfo.video_calls_available, getParentActivity(), getMessagesController().getUserFull(currentUser.id), getAccountInstance()); + } + } else { + createMenu(cell, true, false, otherX, otherY, messageObject.isMusic()); + } + } + + @Override + public void didPressUserAvatar(ChatMessageCell cell, TLRPC.User user, float touchX, float touchY) { + if (actionBar.isActionModeShowed() || reportType >= 0) { + processRowSelect(cell, true, touchX, touchY); + return; + } + openProfile(user); + } + + @Override + public boolean didLongPressUserAvatar(ChatMessageCell cell, TLRPC.User user, float touchX, float touchY) { + if (isAvatarPreviewerEnabled()) { + final boolean enableMention = currentChat != null && (bottomOverlayChat == null || bottomOverlayChat.getVisibility() != View.VISIBLE) && (bottomOverlay == null || bottomOverlay.getVisibility() != View.VISIBLE); + final AvatarPreviewer.MenuItem[] menuItems = new AvatarPreviewer.MenuItem[2 + (enableMention ? 1 : 0)]; + menuItems[0] = AvatarPreviewer.MenuItem.OPEN_PROFILE; + menuItems[1] = AvatarPreviewer.MenuItem.SEND_MESSAGE; + if (enableMention) { + menuItems[2] = AvatarPreviewer.MenuItem.MENTION; + } + final TLRPC.UserFull userFull = getMessagesController().getUserFull(user.id); + final AvatarPreviewer.Data data; + if (userFull != null) { + data = AvatarPreviewer.Data.of(userFull, menuItems); + } else { + data = AvatarPreviewer.Data.of(user, classGuid, menuItems); + } + if (AvatarPreviewer.canPreview(data)) { + AvatarPreviewer.getInstance().show((ViewGroup) fragmentView, data, item -> { + switch (item) { + case SEND_MESSAGE: + openDialog(cell, user); + break; + case OPEN_PROFILE: + openProfile(user); + break; + case MENTION: + appendMention(user); + break; + } + }); + return true; + } + } + return false; + } + + private void appendMention(TLRPC.User user) { + if (chatActivityEnterView != null) { + final SpannableStringBuilder sb = new SpannableStringBuilder(); + final CharSequence text = chatActivityEnterView.getFieldText(); + if (text != null) { + sb.append(text); + } + if (sb.length() > 0 && sb.charAt(sb.length() - 1) != ' ') { + sb.append(' '); + } + if (user.username != null) { + sb.append("@").append(user.username).append(" "); + } else { + String name = UserObject.getFirstName(user, false); + Spannable spannable = new SpannableString(name + " "); + spannable.setSpan(new URLSpanUserMention("" + user.id, 3), 0, spannable.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + sb.append(spannable); + } + chatActivityEnterView.setFieldText(sb); + AndroidUtilities.runOnUIThread(() -> chatActivityEnterView.openKeyboard(), 200); + } + } + + @Override + public boolean didLongPressChannelAvatar(ChatMessageCell cell, TLRPC.Chat chat, int postId, float touchX, float touchY) { + if (isAvatarPreviewerEnabled()) { + AvatarPreviewer.MenuItem[] menuItems = {AvatarPreviewer.MenuItem.OPEN_PROFILE}; + if (currentChat == null || currentChat.id != chat.id || isThreadChat()) { + menuItems = Arrays.copyOf(menuItems, 2); + menuItems[1] = chat.broadcast ? AvatarPreviewer.MenuItem.OPEN_CHANNEL : AvatarPreviewer.MenuItem.OPEN_GROUP; + } + final TLRPC.ChatFull chatFull = getMessagesController().getChatFull(chat.id); + final AvatarPreviewer.Data data; + if (chatFull != null) { + data = AvatarPreviewer.Data.of(chat, chatFull, menuItems); + } else { + data = AvatarPreviewer.Data.of(chat, classGuid, menuItems); + } + if (AvatarPreviewer.canPreview(data)) { + AvatarPreviewer.getInstance().show((ViewGroup) fragmentView, data, item -> { + switch (item) { + case OPEN_PROFILE: + openProfile(chat); + break; + case OPEN_GROUP: + case OPEN_CHANNEL: + openChat(cell, chat, 0); + break; + } + }); + return true; + } + } + return false; + } + + private void openProfile(TLRPC.User user) { + if (user != null && user.id != getUserConfig().getClientUserId()) { + Bundle args = new Bundle(); + args.putLong("user_id", user.id); + ProfileActivity fragment = new ProfileActivity(args); + fragment.setPlayProfileAnimation(currentUser != null && currentUser.id == user.id ? 1 : 0); + AndroidUtilities.setAdjustResizeToNothing(getParentActivity(), classGuid); + presentFragment(fragment); + } + } + + private void openProfile(TLRPC.Chat chat) { + if (chat != null) { + Bundle args = new Bundle(); + args.putLong("chat_id", chat.id); + presentFragment(new ProfileActivity(args)); + } + } + + private void openDialog(ChatMessageCell cell, TLRPC.User user) { + if (user != null) { + Bundle args = new Bundle(); + args.putLong("user_id", user.id); + if (getMessagesController().checkCanOpenChat(args, ChatActivity.this, cell.getMessageObject())) { + presentFragment(new ChatActivity(args)); + } + } + } + + private void openChat(ChatMessageCell cell, TLRPC.Chat chat, int postId) { + if (currentChat != null && chat.id == currentChat.id) { + scrollToMessageId(postId, cell.getMessageObject().getId(), true, 0, true, 0); + } else if (currentChat == null || chat.id != currentChat.id || isThreadChat()) { + Bundle args = new Bundle(); + args.putLong("chat_id", chat.id); + if (postId != 0) { + args.putInt("message_id", postId); + } + if (getMessagesController().checkCanOpenChat(args, ChatActivity.this, cell.getMessageObject())) { + presentFragment(new ChatActivity(args)); + } + } + } + + private boolean isAvatarPreviewerEnabled() { + return UserObject.isUserSelf(currentUser) || (currentChat != null && (!ChatObject.isChannel(currentChat) || currentChat.megagroup)); + } + + @Override + public void didPressBotButton(ChatMessageCell cell, TLRPC.KeyboardButton button) { + if (getParentActivity() == null || bottomOverlayChat.getVisibility() == View.VISIBLE && + !(button instanceof TLRPC.TL_keyboardButtonSwitchInline) && !(button instanceof TLRPC.TL_keyboardButtonCallback) && + !(button instanceof TLRPC.TL_keyboardButtonGame) && !(button instanceof TLRPC.TL_keyboardButtonUrl) && + !(button instanceof TLRPC.TL_keyboardButtonBuy) && !(button instanceof TLRPC.TL_keyboardButtonUrlAuth)) { + return; + } + chatActivityEnterView.didPressedBotButton(button, cell.getMessageObject(), cell.getMessageObject()); + } + + @Override + public void didPressReaction(ChatMessageCell cell, TLRPC.TL_reactionCount reaction) { + getSendMessagesHelper().sendReaction(cell.getMessageObject(), reaction.reaction, ChatActivity.this); + } + + @Override + public void didPressVoteButtons(ChatMessageCell cell, ArrayList buttons, int showCount, int x, int y) { + if (showCount >= 0 || buttons.isEmpty()) { if (getParentActivity() == null) { return; } - if (chatActivityEnterView != null) { - chatActivityEnterView.closeKeyboard(); - } - MessageObject messageObject = cell.getMessageObject(); - if (chatMode == MODE_PINNED) { - chatActivityDelegate.openReplyMessage(messageObject.getId()); - finishFragment(); - } else if ((UserObject.isReplyUser(currentUser) || UserObject.isUserSelf(currentUser)) && messageObject.messageOwner.fwd_from.saved_from_peer != null) { - if (UserObject.isReplyUser(currentUser) && messageObject.messageOwner.reply_to != null && messageObject.messageOwner.reply_to.reply_to_top_id != 0) { - openDiscussionMessageChat(messageObject.messageOwner.reply_to.reply_to_peer_id.channel_id, null, messageObject.messageOwner.reply_to.reply_to_top_id, 0, -1, messageObject.messageOwner.fwd_from.saved_from_msg_id, messageObject); - } else { - openOriginalReplyChat(messageObject); - } - } else { - ArrayList arrayList = null; - if (messageObject.getGroupId() != 0) { - MessageObject.GroupedMessages groupedMessages = groupedMessagesMap.get(messageObject.getGroupId()); - if (groupedMessages != null) { - arrayList = groupedMessages.messages; - } - } - if (arrayList == null) { - arrayList = new ArrayList<>(); - arrayList.add(messageObject); - } - showDialog(new ShareAlert(mContext, ChatActivity.this, arrayList, null, null, ChatObject.isChannel(currentChat), null, null, false, false, themeDelegate) { - @Override - public void dismissInternal() { - super.dismissInternal(); - AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid); - if (chatActivityEnterView.getVisibility() == View.VISIBLE) { - fragmentView.requestLayout(); - } - } - - @Override - protected void onSend(LongSparseArray dids, int count) { - if (dids.size() == 1) { - undoView.showWithAction(dids.valueAt(0).id, UndoView.ACTION_FWD_MESSAGES, count); - } else { - undoView.showWithAction(0, UndoView.ACTION_FWD_MESSAGES, count, dids.size(), null, null); - } - } - }); - AndroidUtilities.setAdjustResizeToNothing(getParentActivity(), classGuid); - fragmentView.requestLayout(); - } - } - - @Override - public boolean needPlayMessage(MessageObject messageObject) { - if (messageObject.isVoice() || messageObject.isRoundVideo()) { - boolean result = MediaController.getInstance().playMessage(messageObject); - MediaController.getInstance().setVoiceMessagesPlaylist(result ? createVoiceMessagesPlaylist(messageObject, false) : null, false); - return result; - } else if (messageObject.isMusic()) { - return MediaController.getInstance().setPlaylist(messages, messageObject, mergeDialogId); - } - return false; - } - - @Override - public void videoTimerReached() { - showNoSoundHint(); - } - - @Override - public void didPressTime(ChatMessageCell cell) { - undoView.showWithAction(dialog_id, UndoView.ACTION_IMPORT_INFO, null); - } - - @Override - public void didPressChannelAvatar(ChatMessageCell cell, TLRPC.Chat chat, int postId, float touchX, float touchY) { - if (chat == null) { - return; - } - if (actionBar.isActionModeShowed() || reportType >= 0) { - processRowSelect(cell, true, touchX, touchY); - return; - } - openChat(cell, chat, postId); - } - - @Override - public void didPressHiddenForward(ChatMessageCell cell) { - if (cell.getMessageObject().isImportedForward()) { - didPressTime(cell); - return; - } - showForwardHint(cell); - } - - @Override - public void didPressOther(ChatMessageCell cell, float otherX, float otherY) { - MessageObject messageObject = cell.getMessageObject(); - if (messageObject.type == 16) { - if (currentUser != null) { - VoIPHelper.startCall(currentUser, messageObject.isVideoCall(), userInfo != null && userInfo.video_calls_available, getParentActivity(), getMessagesController().getUserFull(currentUser.id), getAccountInstance()); - } - } else { - createMenu(cell, true, false, otherX, otherY, messageObject.isMusic()); - } - } - - @Override - public void didPressUserAvatar(ChatMessageCell cell, TLRPC.User user, float touchX, float touchY) { - if (actionBar.isActionModeShowed() || reportType >= 0) { - processRowSelect(cell, true, touchX, touchY); - return; - } - openProfile(user); - } - - @Override - public boolean didLongPressUserAvatar(ChatMessageCell cell, TLRPC.User user, float touchX, float touchY) { - if (isAvatarPreviewerEnabled()) { - final boolean enableMention = currentChat != null && (bottomOverlayChat == null || bottomOverlayChat.getVisibility() != View.VISIBLE) && (bottomOverlay == null || bottomOverlay.getVisibility() != View.VISIBLE); - final AvatarPreviewer.MenuItem[] menuItems = new AvatarPreviewer.MenuItem[2 + (enableMention ? 1 : 0)]; - menuItems[0] = AvatarPreviewer.MenuItem.OPEN_PROFILE; - menuItems[1] = AvatarPreviewer.MenuItem.SEND_MESSAGE; - if (enableMention) { - menuItems[2] = AvatarPreviewer.MenuItem.MENTION; - } - final TLRPC.UserFull userFull = getMessagesController().getUserFull(user.id); - final AvatarPreviewer.Data data; - if (userFull != null) { - data = AvatarPreviewer.Data.of(userFull, menuItems); - } else { - data = AvatarPreviewer.Data.of(user, classGuid, menuItems); - } - if (AvatarPreviewer.canPreview(data)) { - AvatarPreviewer.getInstance().show((ViewGroup) fragmentView, data, item -> { - switch (item) { - case SEND_MESSAGE: - openDialog(cell, user); - break; - case OPEN_PROFILE: - openProfile(user); - break; - case MENTION: - appendMention(user); - break; - } - }); - return true; - } - } - return false; - } - - private void appendMention(TLRPC.User user) { - if (chatActivityEnterView != null) { - final SpannableStringBuilder sb = new SpannableStringBuilder(); - final CharSequence text = chatActivityEnterView.getFieldText(); - if (text != null) { - sb.append(text); - } - if (sb.length() > 0 && sb.charAt(sb.length() - 1) != ' ') { - sb.append(' '); - } - if (user.username != null) { - sb.append("@").append(user.username).append(" "); - } else { - String name = UserObject.getFirstName(user, false); - Spannable spannable = new SpannableString(name + " "); - spannable.setSpan(new URLSpanUserMention("" + user.id, 3), 0, spannable.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - sb.append(spannable); - } - chatActivityEnterView.setFieldText(sb); - AndroidUtilities.runOnUIThread(() -> chatActivityEnterView.openKeyboard(), 200); - } - } - - @Override - public boolean didLongPressChannelAvatar(ChatMessageCell cell, TLRPC.Chat chat, int postId, float touchX, float touchY) { - if (isAvatarPreviewerEnabled()) { - AvatarPreviewer.MenuItem[] menuItems = {AvatarPreviewer.MenuItem.OPEN_PROFILE}; - if (currentChat == null || currentChat.id != chat.id || isThreadChat()) { - menuItems = Arrays.copyOf(menuItems, 2); - menuItems[1] = chat.broadcast ? AvatarPreviewer.MenuItem.OPEN_CHANNEL : AvatarPreviewer.MenuItem.OPEN_GROUP; - } - final TLRPC.ChatFull chatFull = getMessagesController().getChatFull(chat.id); - final AvatarPreviewer.Data data; - if (chatFull != null) { - data = AvatarPreviewer.Data.of(chat, chatFull, menuItems); - } else { - data = AvatarPreviewer.Data.of(chat, classGuid, menuItems); - } - if (AvatarPreviewer.canPreview(data)) { - AvatarPreviewer.getInstance().show((ViewGroup) fragmentView, data, item -> { - switch (item) { - case OPEN_PROFILE: - openProfile(chat); - break; - case OPEN_GROUP: - case OPEN_CHANNEL: - openChat(cell, chat, 0); - break; - } - }); - return true; - } - } - return false; - } - - private void openProfile(TLRPC.User user) { - if (user != null && user.id != getUserConfig().getClientUserId()) { - Bundle args = new Bundle(); - args.putLong("user_id", user.id); - ProfileActivity fragment = new ProfileActivity(args); - fragment.setPlayProfileAnimation(currentUser != null && currentUser.id == user.id ? 1 : 0); - AndroidUtilities.setAdjustResizeToNothing(getParentActivity(), classGuid); - presentFragment(fragment); - } - } - - private void openProfile(TLRPC.Chat chat) { - if (chat != null) { - Bundle args = new Bundle(); - args.putLong("chat_id", chat.id); - presentFragment(new ProfileActivity(args)); - } - } - - private void openDialog(ChatMessageCell cell, TLRPC.User user) { - if (user != null) { - Bundle args = new Bundle(); - args.putLong("user_id", user.id); - if (getMessagesController().checkCanOpenChat(args, ChatActivity.this, cell.getMessageObject())) { - presentFragment(new ChatActivity(args)); - } - } - } - - private void openChat(ChatMessageCell cell, TLRPC.Chat chat, int postId) { - if (currentChat != null && chat.id == currentChat.id) { - scrollToMessageId(postId, cell.getMessageObject().getId(), true, 0, true, 0); - } else if (currentChat == null || chat.id != currentChat.id || isThreadChat()) { - Bundle args = new Bundle(); - args.putLong("chat_id", chat.id); - if (postId != 0) { - args.putInt("message_id", postId); - } - if (getMessagesController().checkCanOpenChat(args, ChatActivity.this, cell.getMessageObject())) { - presentFragment(new ChatActivity(args)); - } - } - } - - private boolean isAvatarPreviewerEnabled() { - return UserObject.isUserSelf(currentUser) || (currentChat != null && (!ChatObject.isChannel(currentChat) || currentChat.megagroup)); - } - - @Override - public void didPressBotButton(ChatMessageCell cell, TLRPC.KeyboardButton button) { - if (getParentActivity() == null || bottomOverlayChat.getVisibility() == View.VISIBLE && - !(button instanceof TLRPC.TL_keyboardButtonSwitchInline) && !(button instanceof TLRPC.TL_keyboardButtonCallback) && - !(button instanceof TLRPC.TL_keyboardButtonGame) && !(button instanceof TLRPC.TL_keyboardButtonUrl) && - !(button instanceof TLRPC.TL_keyboardButtonBuy) && !(button instanceof TLRPC.TL_keyboardButtonUrlAuth)) { - return; - } - chatActivityEnterView.didPressedBotButton(button, cell.getMessageObject(), cell.getMessageObject()); - } - - @Override - public void didPressReaction(ChatMessageCell cell, TLRPC.TL_reactionCount reaction) { - getSendMessagesHelper().sendReaction(cell.getMessageObject(), reaction.reaction, ChatActivity.this); - } - - @Override - public void didPressVoteButtons(ChatMessageCell cell, ArrayList buttons, int showCount, int x, int y) { - if (showCount >= 0 || buttons.isEmpty()) { - if (getParentActivity() == null) { + if (pollHintView == null) { + pollHintView = new HintView(getParentActivity(), HintView.TYPE_POLL_VOTE, themeDelegate); + pollHintView.setAlpha(0.0f); + pollHintView.setVisibility(View.INVISIBLE); + int index = contentView.indexOfChild(chatActivityEnterView); + if (index == -1) { return; } - if (pollHintView == null) { - pollHintView = new HintView(getParentActivity(), HintView.TYPE_POLL_VOTE, themeDelegate); - pollHintView.setAlpha(0.0f); - pollHintView.setVisibility(View.INVISIBLE); - int index = contentView.indexOfChild(chatActivityEnterView); - if (index == -1) { - return; - } - contentView.addView(pollHintView, index + 1, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 19, 0, 19, 0)); - } - if (buttons.isEmpty() && showCount < 0) { - ArrayList pollButtons = cell.getPollButtons(); - float lastDiff = 0; - for (int a = 0, N = pollButtons.size(); a < N; a++) { - ChatMessageCell.PollButton button = pollButtons.get(a); - lastDiff = cell.getY() + button.y - AndroidUtilities.dp(4) - chatListViewPaddingTop; - pollHintX = button.x + AndroidUtilities.dp(13.3f); - pollHintY = button.y - AndroidUtilities.dp(6) + y; - if (lastDiff > 0) { - lastDiff = 0; - x = pollHintX; - y = pollHintY; - break; - } - } - if (lastDiff != 0) { - chatListView.smoothScrollBy(0, (int) lastDiff); - pollHintCell = cell; - return; + contentView.addView(pollHintView, index + 1, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 19, 0, 19, 0)); + } + if (buttons.isEmpty() && showCount < 0) { + ArrayList pollButtons = cell.getPollButtons(); + float lastDiff = 0; + for (int a = 0, N = pollButtons.size(); a < N; a++) { + ChatMessageCell.PollButton button = pollButtons.get(a); + lastDiff = cell.getY() + button.y - AndroidUtilities.dp(4) - chatListViewPaddingTop; + pollHintX = button.x + AndroidUtilities.dp(13.3f); + pollHintY = button.y - AndroidUtilities.dp(6) + y; + if (lastDiff > 0) { + lastDiff = 0; + x = pollHintX; + y = pollHintY; + break; } } - pollHintView.showForMessageCell(cell, showCount, x, y, true); - } else { - getSendMessagesHelper().sendVote(cell.getMessageObject(), buttons, null); + if (lastDiff != 0) { + chatListView.smoothScrollBy(0, (int) lastDiff); + pollHintCell = cell; + return; + } } + pollHintView.showForMessageCell(cell, showCount, x, y, true); + } else { + getSendMessagesHelper().sendVote(cell.getMessageObject(), buttons, null); } + } - @Override - public void didPressCancelSendButton(ChatMessageCell cell) { - MessageObject message = cell.getMessageObject(); - if (message.messageOwner.send_state != 0) { - getSendMessagesHelper().cancelSendingMessage(message); - } + @Override + public void didPressCancelSendButton(ChatMessageCell cell) { + MessageObject message = cell.getMessageObject(); + if (message.messageOwner.send_state != 0) { + getSendMessagesHelper().cancelSendingMessage(message); } + } - @Override - public void didLongPress(ChatMessageCell cell, float x, float y) { + @Override + public void didLongPress(ChatMessageCell cell, float x, float y) { + createMenu(cell, false, false, x, y); + startMultiselect(chatListView.getChildAdapterPosition(cell)); + } + + @Override + public boolean canPerformActions() { + return actionBar != null && !actionBar.isActionModeShowed() && reportType < 0 || inPreviewMode; + } + + @Override + public void didPressUrl(ChatMessageCell cell, final CharacterStyle url, boolean longPress) { + didPressMessageUrl(url, longPress, cell.getMessageObject(), cell); + } + + @Override + public void needOpenWebView(MessageObject message, String url, String title, String description, String originalUrl, int w, int h) { + try { + EmbedBottomSheet.show(getParentActivity(), message, photoViewerProvider, title, description, originalUrl, url, w, h, isKeyboardVisible()); + } catch (Throwable e) { + FileLog.e(e); + } + } + + @Override + public void didPressReplyMessage(ChatMessageCell cell, int id) { + if (UserObject.isReplyUser(currentUser)) { + didPressSideButton(cell); + return; + } + MessageObject messageObject = cell.getMessageObject(); + if (chatMode == MODE_PINNED || chatMode == MODE_SCHEDULED) { + chatActivityDelegate.openReplyMessage(id); + finishFragment(); + } else { + scrollToMessageId(id, messageObject.getId(), true, messageObject.getDialogId() == mergeDialogId ? 1 : 0, true, 0); + } + } + + @Override + public void didPressViaBot(ChatMessageCell cell, String username) { + if (bottomOverlayChat != null && bottomOverlayChat.getVisibility() == View.VISIBLE || bottomOverlay != null && bottomOverlay.getVisibility() == View.VISIBLE) { + return; + } + if (chatActivityEnterView != null && username != null && username.length() > 0) { + chatActivityEnterView.setFieldText("@" + username + " "); + chatActivityEnterView.openKeyboard(); + } + } + + @Override + public void didStartVideoStream(MessageObject message) { + if (message.isVideo()) { + sendSecretMessageRead(message, true); + } + } + + @Override + public void needReloadPolls() { + invalidateMessagesVisiblePart(); + } + + @Override + public void didPressImage(ChatMessageCell cell, float x, float y) { + MessageObject message = cell.getMessageObject(); + if (message.isSendError()) { createMenu(cell, false, false, x, y); - startMultiselect(chatListView.getChildAdapterPosition(cell)); + return; + } else if (message.isSending()) { + return; } - - @Override - public boolean canPerformActions() { - return actionBar != null && !actionBar.isActionModeShowed() && reportType < 0; - } - - @Override - public void didPressUrl(ChatMessageCell cell, final CharacterStyle url, boolean longPress) { - didPressMessageUrl(url, longPress, cell.getMessageObject(), cell); - } - - @Override - public void needOpenWebView(MessageObject message, String url, String title, String description, String originalUrl, int w, int h) { + if (message.isDice()) { + undoView.showWithAction(0, chatActivityEnterView.getVisibility() == View.VISIBLE && bottomOverlay.getVisibility() != View.VISIBLE ? UndoView.ACTION_DICE_INFO : UndoView.ACTION_DICE_NO_SEND_INFO, message.getDiceEmoji(), null, () -> getSendMessagesHelper().sendMessage(message.getDiceEmoji(), dialog_id, replyingMessageObject, getThreadMessage(), null, false, null, null, null, true, 0, null)); + } else if (message.isAnimatedEmoji()) { + restartSticker(cell); + emojiAnimationsOverlay.onTapItem(cell, ChatActivity.this); + chatListView.cancelClickRunnables(false); + } else if (message.needDrawBluredPreview()) { + Runnable action = sendSecretMessageRead(message, false); + cell.invalidate(); + SecretMediaViewer.getInstance().setParentActivity(getParentActivity()); + SecretMediaViewer.getInstance().openMedia(message, photoViewerProvider, action); + } else if (message.getInputStickerSet() != null) { + StickersAlert alert = new StickersAlert(getParentActivity(), ChatActivity.this, message.getInputStickerSet(), null, bottomOverlayChat.getVisibility() != View.VISIBLE && (currentChat == null || ChatObject.canSendStickers(currentChat)) ? chatActivityEnterView : null, themeDelegate); + alert.setCalcMandatoryInsets(isKeyboardVisible()); + showDialog(alert); + } else if (message.isVideo() || message.type == 1 || message.type == 0 && !message.isWebpageDocument() || message.isGif()) { + openPhotoViewerForMessage(cell, message); + } else if (message.type == 3) { + sendSecretMessageRead(message, true); try { - EmbedBottomSheet.show(getParentActivity(), message, photoViewerProvider, title, description, originalUrl, url, w, h, isKeyboardVisible()); - } catch (Throwable e) { + File f = null; + if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) { + f = new File(message.messageOwner.attachPath); + } + if (f == null || !f.exists()) { + f = FileLoader.getPathToMessage(message.messageOwner); + } + Intent intent = new Intent(Intent.ACTION_VIEW); + if (Build.VERSION.SDK_INT >= 24) { + intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + intent.setDataAndType(FileProvider.getUriForFile(getParentActivity(), BuildConfig.APPLICATION_ID + ".provider", f), "video/mp4"); + } else { + intent.setDataAndType(Uri.fromFile(f), "video/mp4"); + } + getParentActivity().startActivityForResult(intent, 500); + } catch (Exception e) { FileLog.e(e); + alertUserOpenError(message); } - } - - @Override - public void didPressReplyMessage(ChatMessageCell cell, int id) { - if (UserObject.isReplyUser(currentUser)) { - didPressSideButton(cell); + } else if (message.type == 4) { + if (!AndroidUtilities.isGoogleMapsInstalled(ChatActivity.this)) { return; } - MessageObject messageObject = cell.getMessageObject(); - if (chatMode == MODE_PINNED || chatMode == MODE_SCHEDULED) { - chatActivityDelegate.openReplyMessage(id); - finishFragment(); + if (message.isLiveLocation()) { + LocationActivity fragment = new LocationActivity(currentChat == null || ChatObject.canSendMessages(currentChat) || currentChat.megagroup ? 2 : LocationActivity.LOCATION_TYPE_LIVE_VIEW); + fragment.setDelegate(ChatActivity.this); + fragment.setMessageObject(message); + presentFragment(fragment); } else { - scrollToMessageId(id, messageObject.getId(), true, messageObject.getDialogId() == mergeDialogId ? 1 : 0, true, 0); + LocationActivity fragment = new LocationActivity(currentEncryptedChat == null ? 3 : 0); + fragment.setDelegate(ChatActivity.this); + fragment.setMessageObject(message); + presentFragment(fragment); } - } - - @Override - public void didPressViaBot(ChatMessageCell cell, String username) { - if (bottomOverlayChat != null && bottomOverlayChat.getVisibility() == View.VISIBLE || bottomOverlay != null && bottomOverlay.getVisibility() == View.VISIBLE) { - return; + } else if (message.type == 9 || message.type == 0) { + if (message.getDocumentName().toLowerCase().endsWith("attheme")) { + File locFile = null; + if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) { + File f = new File(message.messageOwner.attachPath); + if (f.exists()) { + locFile = f; + } + } + if (locFile == null) { + File f = FileLoader.getPathToMessage(message.messageOwner); + if (f.exists()) { + locFile = f; + } + } + Theme.ThemeInfo themeInfo = Theme.applyThemeFile(locFile, message.getDocumentName(), null, true); + if (themeInfo != null) { + presentFragment(new ThemePreviewActivity(themeInfo)); + return; + } else { + scrollToPositionOnRecreate = -1; + } } - if (chatActivityEnterView != null && username != null && username.length() > 0) { - chatActivityEnterView.setFieldText("@" + username + " "); - chatActivityEnterView.openKeyboard(); + boolean handled = false; + if (message.canPreviewDocument()) { + PhotoViewer.getInstance().setParentActivity(getParentActivity(), themeDelegate); + PhotoViewer.getInstance().openPhoto(message, ChatActivity.this, message.type != 0 ? dialog_id : 0, message.type != 0 ? mergeDialogId : 0, photoViewerProvider); + handled = true; } - } - - @Override - public void didStartVideoStream(MessageObject message) { - if (message.isVideo()) { - sendSecretMessageRead(message, true); - } - } - - @Override - public void needReloadPolls() { - invalidateMessagesVisiblePart(); - } - - @Override - public void didPressImage(ChatMessageCell cell, float x, float y) { - MessageObject message = cell.getMessageObject(); - if (message.isSendError()) { - createMenu(cell, false, false, x, y); - return; - } else if (message.isSending()) { - return; - } - if (message.isDice()) { - undoView.showWithAction(0, chatActivityEnterView.getVisibility() == View.VISIBLE && bottomOverlay.getVisibility() != View.VISIBLE ? UndoView.ACTION_DICE_INFO : UndoView.ACTION_DICE_NO_SEND_INFO, message.getDiceEmoji(), null, () -> getSendMessagesHelper().sendMessage(message.getDiceEmoji(), dialog_id, replyingMessageObject, getThreadMessage(), null, false, null, null, null, true, 0, null)); - } else if (message.isAnimatedEmoji()) { - restartSticker(cell); - emojiAnimationsOverlay.onTapItem(cell, ChatActivity.this); - chatListView.cancelClickRunnables(false); - } else if (message.needDrawBluredPreview()) { - Runnable action = sendSecretMessageRead(message, false); - cell.invalidate(); - SecretMediaViewer.getInstance().setParentActivity(getParentActivity()); - SecretMediaViewer.getInstance().openMedia(message, photoViewerProvider, action); - } else if (message.getInputStickerSet() != null) { - StickersAlert alert = new StickersAlert(getParentActivity(), ChatActivity.this, message.getInputStickerSet(), null, bottomOverlayChat.getVisibility() != View.VISIBLE && (currentChat == null || ChatObject.canSendStickers(currentChat)) ? chatActivityEnterView : null, themeDelegate); - alert.setCalcMandatoryInsets(isKeyboardVisible()); - showDialog(alert); - } else if (message.isVideo() || message.type == 1 || message.type == 0 && !message.isWebpageDocument() || message.isGif()) { - openPhotoViewerForMessage(cell, message); - } else if (message.type == 3) { - sendSecretMessageRead(message, true); + if (!handled) { try { - File f = null; - if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) { - f = new File(message.messageOwner.attachPath); - } - if (f == null || !f.exists()) { - f = FileLoader.getPathToMessage(message.messageOwner); - } - Intent intent = new Intent(Intent.ACTION_VIEW); - if (Build.VERSION.SDK_INT >= 24) { - intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - intent.setDataAndType(FileProvider.getUriForFile(getParentActivity(), BuildConfig.APPLICATION_ID + ".provider", f), "video/mp4"); - } else { - intent.setDataAndType(Uri.fromFile(f), "video/mp4"); - } - getParentActivity().startActivityForResult(intent, 500); + AndroidUtilities.openForView(message, getParentActivity(), themeDelegate); } catch (Exception e) { FileLog.e(e); alertUserOpenError(message); } - } else if (message.type == 4) { - if (!AndroidUtilities.isGoogleMapsInstalled(ChatActivity.this)) { - return; - } - if (message.isLiveLocation()) { - LocationActivity fragment = new LocationActivity(currentChat == null || ChatObject.canSendMessages(currentChat) || currentChat.megagroup ? 2 : LocationActivity.LOCATION_TYPE_LIVE_VIEW); - fragment.setDelegate(ChatActivity.this); - fragment.setMessageObject(message); - presentFragment(fragment); + } + } + } + + @Override + public void didPressInstantButton(ChatMessageCell cell, int type) { + MessageObject messageObject = cell.getMessageObject(); + if (type == 8) { + PollVotesAlert.showForPoll(ChatActivity.this, messageObject); + } else if (type == 0) { + if (messageObject.messageOwner.media != null && messageObject.messageOwner.media.webpage != null && messageObject.messageOwner.media.webpage.cached_page != null) { + ArticleViewer.getInstance().setParentActivity(getParentActivity(), ChatActivity.this); + ArticleViewer.getInstance().open(messageObject); + } + } else if (type == 5) { + long uid = messageObject.messageOwner.media.user_id; + TLRPC.User user = null; + if (uid != 0) { + user = MessagesController.getInstance(currentAccount).getUser(uid); + } + openVCard(user, messageObject.messageOwner.media.vcard, messageObject.messageOwner.media.first_name, messageObject.messageOwner.media.last_name); + } else { + if (messageObject.isSponsored()) { + Bundle args = new Bundle(); + long peerId = MessageObject.getPeerId(messageObject.messageOwner.from_id); + if (peerId < 0) { + args.putLong("chat_id", -peerId); } else { - LocationActivity fragment = new LocationActivity(currentEncryptedChat == null ? 3 : 0); - fragment.setDelegate(ChatActivity.this); - fragment.setMessageObject(message); - presentFragment(fragment); + args.putLong("user_id", peerId); } - } else if (message.type == 9 || message.type == 0) { - if (message.getDocumentName().toLowerCase().endsWith("attheme")) { - File locFile = null; - if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) { - File f = new File(message.messageOwner.attachPath); - if (f.exists()) { - locFile = f; - } - } - if (locFile == null) { - File f = FileLoader.getPathToMessage(message.messageOwner); - if (f.exists()) { - locFile = f; - } - } - Theme.ThemeInfo themeInfo = Theme.applyThemeFile(locFile, message.getDocumentName(), null, true); - if (themeInfo != null) { - presentFragment(new ThemePreviewActivity(themeInfo)); - return; - } else { - scrollToPositionOnRecreate = -1; - } + if (messageObject.sponsoredChannelPost != 0) { + args.putInt("message_id", messageObject.sponsoredChannelPost); } - boolean handled = false; - if (message.canPreviewDocument()) { - PhotoViewer.getInstance().setParentActivity(getParentActivity(), themeDelegate); - PhotoViewer.getInstance().openPhoto(message, ChatActivity.this, message.type != 0 ? dialog_id : 0, message.type != 0 ? mergeDialogId : 0, photoViewerProvider); - handled = true; + if (messageObject.botStartParam != null) { + args.putString("inline_query", messageObject.botStartParam); } - if (!handled) { - try { - AndroidUtilities.openForView(message, getParentActivity(), themeDelegate); - } catch (Exception e) { - FileLog.e(e); - alertUserOpenError(message); - } + if (getMessagesController().checkCanOpenChat(args, ChatActivity.this)) { + presentFragment(new ChatActivity(args)); + } + } else if (messageObject.messageOwner.media != null && messageObject.messageOwner.media.webpage != null) { + if (!openLinkInternally(messageObject.messageOwner.media.webpage.url, messageObject.getId())) { + Browser.openUrl(getParentActivity(), messageObject.messageOwner.media.webpage.url); } } } + } - @Override - public void didPressInstantButton(ChatMessageCell cell, int type) { - MessageObject messageObject = cell.getMessageObject(); - if (type == 8) { - PollVotesAlert.showForPoll(ChatActivity.this, messageObject); - } else if (type == 0) { - if (messageObject.messageOwner.media != null && messageObject.messageOwner.media.webpage != null && messageObject.messageOwner.media.webpage.cached_page != null) { - ArticleViewer.getInstance().setParentActivity(getParentActivity(), ChatActivity.this); - ArticleViewer.getInstance().open(messageObject); - } - } else if (type == 5) { - long uid = messageObject.messageOwner.media.user_id; - TLRPC.User user = null; - if (uid != 0) { - user = MessagesController.getInstance(currentAccount).getUser(uid); - } - openVCard(user, messageObject.messageOwner.media.vcard, messageObject.messageOwner.media.first_name, messageObject.messageOwner.media.last_name); - } else { - if (messageObject.isSponsored()) { - Bundle args = new Bundle(); - long peerId = MessageObject.getPeerId(messageObject.messageOwner.from_id); - if (peerId < 0) { - args.putLong("chat_id", -peerId); - } else { - args.putLong("user_id", peerId); - } - if (messageObject.sponsoredChannelPost != 0) { - args.putInt("message_id", messageObject.sponsoredChannelPost); - } - if (messageObject.botStartParam != null) { - args.putString("inline_query", messageObject.botStartParam); - } - if (getMessagesController().checkCanOpenChat(args, ChatActivity.this)) { - presentFragment(new ChatActivity(args)); - } - } else if (messageObject.messageOwner.media != null && messageObject.messageOwner.media.webpage != null) { - if (!openLinkInternally(messageObject.messageOwner.media.webpage.url, messageObject.getId())) { - Browser.openUrl(getParentActivity(), messageObject.messageOwner.media.webpage.url); - } - } - } + @Override + public void didPressCommentButton(ChatMessageCell cell) { + MessageObject.GroupedMessages group = cell.getCurrentMessagesGroup(); + MessageObject message; + if (group != null && !group.messages.isEmpty()) { + message = group.messages.get(0); + } else { + message = cell.getMessageObject(); } - - @Override - public void didPressCommentButton(ChatMessageCell cell) { - MessageObject.GroupedMessages group = cell.getCurrentMessagesGroup(); - MessageObject message; - if (group != null && !group.messages.isEmpty()) { - message = group.messages.get(0); - } else { - message = cell.getMessageObject(); - } - int maxReadId; - long linkedChatId; - if (message.messageOwner.replies != null) { - maxReadId = message.messageOwner.replies.read_max_id; - linkedChatId = message.messageOwner.replies.channel_id; - } else { - maxReadId = -1; - linkedChatId = 0; - } - openDiscussionMessageChat(currentChat.id, message, message.getId(), linkedChatId, maxReadId, 0, null); + int maxReadId; + long linkedChatId; + if (message.messageOwner.replies != null) { + maxReadId = message.messageOwner.replies.read_max_id; + linkedChatId = message.messageOwner.replies.channel_id; + } else { + maxReadId = -1; + linkedChatId = 0; } + openDiscussionMessageChat(currentChat.id, message, message.getId(), linkedChatId, maxReadId, 0, null); + } - @Override - public String getAdminRank(long uid) { - if (ChatObject.isChannel(currentChat) && currentChat.megagroup) { - return getMessagesController().getAdminRank(currentChat.id, uid); - } - return null; + @Override + public String getAdminRank(long uid) { + if (ChatObject.isChannel(currentChat) && currentChat.megagroup) { + return getMessagesController().getAdminRank(currentChat.id, uid); } + return null; + } - @Override - public boolean shouldRepeatSticker(MessageObject message) { - return !alreadyPlayedStickers.containsKey(message); + @Override + public boolean shouldRepeatSticker(MessageObject message) { + return !alreadyPlayedStickers.containsKey(message); + } + + @Override + public void setShouldNotRepeatSticker(MessageObject message) { + alreadyPlayedStickers.put(message, true); + } + + @Override + public TextSelectionHelper.ChatListTextSelectionHelper getTextSelectionHelper() { + return textSelectionHelper; + } + + @Override + public boolean hasSelectedMessages() { + return selectedMessagesIds[0].size() + selectedMessagesIds[1].size() > 0; + } + + @Override + public void onDiceFinished() { + if (fireworksOverlay.isStarted()) { + return; } + fireworksOverlay.start(); + fireworksOverlay.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); + } - @Override - public void setShouldNotRepeatSticker(MessageObject message) { - alreadyPlayedStickers.put(message, true); - } + @Override + public PinchToZoomHelper getPinchToZoomHelper() { + return pinchToZoomHelper; + } - @Override - public TextSelectionHelper.ChatListTextSelectionHelper getTextSelectionHelper() { - return textSelectionHelper; - } + @Override + public boolean keyboardIsOpened() { + return contentView.getKeyboardHeight() + chatEmojiViewPadding >= AndroidUtilities.dp(20); + } - @Override - public boolean hasSelectedMessages() { - return selectedMessagesIds[0].size() + selectedMessagesIds[1].size() > 0; - } - - @Override - public void onDiceFinished() { - if (fireworksOverlay.isStarted()) { - return; - } - fireworksOverlay.start(); - fireworksOverlay.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); - } - - @Override - public PinchToZoomHelper getPinchToZoomHelper() { - return pinchToZoomHelper; - } - - @Override - public boolean keyboardIsOpened() { - return contentView.getKeyboardHeight() + chatEmojiViewPadding >= AndroidUtilities.dp(20); - } - - public boolean isLandscape() { - return contentView.getMeasuredWidth() > contentView.getMeasuredHeight(); - } - }); - } else { - chatMessageCell.setDelegate(new ChatMessageCell.ChatMessageCellDelegate() { - - }); - } + public boolean isLandscape() { + return contentView.getMeasuredWidth() > contentView.getMeasuredHeight(); + } + }); if (currentEncryptedChat == null) { chatMessageCell.setAllowAssistant(true); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatEditTypeActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatEditTypeActivity.java index bb5ae288c..91f3afe1d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatEditTypeActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatEditTypeActivity.java @@ -142,7 +142,7 @@ public class ChatEditTypeActivity extends BaseFragment implements NotificationCe } isPrivate = !isForcePublic && TextUtils.isEmpty(currentChat.username); isChannel = ChatObject.isChannel(currentChat) && !currentChat.megagroup; - isSaveRestricted = isPrivate && currentChat.noforwards; + isSaveRestricted = currentChat.noforwards; if (isForcePublic && TextUtils.isEmpty(currentChat.username) || isPrivate && currentChat.creator) { TLRPC.TL_channels_checkUsername req = new TLRPC.TL_channels_checkUsername(); req.username = "1"; @@ -470,7 +470,7 @@ public class ChatEditTypeActivity extends BaseFragment implements NotificationCe } private void processDone() { - if (isPrivate && currentChat.noforwards != isSaveRestricted) { + if (currentChat.noforwards != isSaveRestricted) { getMessagesController().toggleChatNoForwards(chatId, currentChat.noforwards = isSaveRestricted); } if (trySetUsername()) { @@ -616,7 +616,7 @@ public class ChatEditTypeActivity extends BaseFragment implements NotificationCe } publicContainer.setVisibility(isPrivate ? View.GONE : View.VISIBLE); privateContainer.setVisibility(isPrivate ? View.VISIBLE : View.GONE); - saveContainer.setVisibility(isPrivate ? View.VISIBLE : View.GONE); + saveContainer.setVisibility(View.VISIBLE); manageLinksTextView.setVisibility(View.VISIBLE); manageLinksInfoCell.setVisibility(View.VISIBLE); linkContainer.setPadding(0, 0, 0, isPrivate ? 0 : AndroidUtilities.dp(7)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/AlertsCreator.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/AlertsCreator.java index c1c4edc23..facb40b26 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/AlertsCreator.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/AlertsCreator.java @@ -4130,6 +4130,7 @@ public class AlertsCreator { final boolean[] checks = new boolean[3]; final boolean[] deleteForAll = new boolean[1]; TLRPC.User actionUser = null; + TLRPC.Chat actionChat = null; boolean canRevokeInbox = user != null && MessagesController.getInstance(currentAccount).canRevokePmInbox; int revokeTimeLimit; if (user != null) { @@ -4148,7 +4149,13 @@ public class AlertsCreator { selectedMessage.messageOwner.action instanceof TLRPC.TL_messageActionChatDeleteUser || selectedMessage.messageOwner.action instanceof TLRPC.TL_messageActionChatJoinedByLink || selectedMessage.messageOwner.action instanceof TLRPC.TL_messageActionChatAddUser) { - actionUser = MessagesController.getInstance(currentAccount).getUser(selectedMessage.messageOwner.from_id.user_id); + if (selectedMessage.messageOwner.from_id.user_id != 0) { + actionUser = MessagesController.getInstance(currentAccount).getUser(selectedMessage.messageOwner.from_id.user_id); + } else if (selectedMessage.messageOwner.from_id.channel_id != 0) { + actionChat = MessagesController.getInstance(currentAccount).getChat(selectedMessage.messageOwner.from_id.channel_id); + } else if (selectedMessage.messageOwner.from_id.chat_id != 0) { + actionChat = MessagesController.getInstance(currentAccount).getChat(selectedMessage.messageOwner.from_id.chat_id); + } } boolean hasOutgoing = !selectedMessage.isSendError() && selectedMessage.getDialogId() == mergeDialogId && (selectedMessage.messageOwner.action == null || selectedMessage.messageOwner.action instanceof TLRPC.TL_messageActionEmpty) && selectedMessage.isOut() && (currentDate - selectedMessage.messageOwner.date) <= revokeTimeLimit; if (hasOutgoing) { @@ -4188,8 +4195,8 @@ public class AlertsCreator { actionUser = MessagesController.getInstance(currentAccount).getUser(from_id); } } - if (actionUser != null && actionUser.id != UserConfig.getInstance(currentAccount).getClientUserId()) { - if (loadParticipant == 1 && !chat.creator) { + if ((actionUser != null && actionUser.id != UserConfig.getInstance(currentAccount).getClientUserId()) || (actionChat != null && !ChatObject.hasAdminRights(actionChat))) { + if (loadParticipant == 1 && !chat.creator && actionUser != null) { final AlertDialog[] progressDialog = new AlertDialog[]{new AlertDialog(activity, 3)}; TLRPC.TL_channels_getParticipant req = new TLRPC.TL_channels_getParticipant(); @@ -4224,6 +4231,7 @@ public class AlertsCreator { } FrameLayout frameLayout = new FrameLayout(activity); int num = 0; + String name = actionUser != null ? ContactsController.formatName(actionUser.first_name, actionUser.last_name) : actionChat.title; for (int a = 0; a < 3; a++) { if ((loadParticipant == 2 || !canBan) && a == 0) { continue; @@ -4236,7 +4244,7 @@ public class AlertsCreator { } else if (a == 1) { cell.setText(LocaleController.getString("DeleteReportSpam", R.string.DeleteReportSpam), "", false, false); } else { - cell.setText(LocaleController.formatString("DeleteAllFrom", R.string.DeleteAllFrom, ContactsController.formatName(actionUser.first_name, actionUser.last_name)), "", false, false); + cell.setText(LocaleController.formatString("DeleteAllFrom", R.string.DeleteAllFrom, name), "", false, false); } cell.setPadding(LocaleController.isRTL ? AndroidUtilities.dp(16) : AndroidUtilities.dp(8), 0, LocaleController.isRTL ? AndroidUtilities.dp(8) : AndroidUtilities.dp(16), 0); frameLayout.addView(cell, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 48, Gravity.TOP | Gravity.LEFT, 0, 48 * num, 0, 0)); @@ -4335,6 +4343,7 @@ public class AlertsCreator { } } final TLRPC.User userFinal = actionUser; + final TLRPC.Chat chatFinal = actionChat; builder.setPositiveButton(LocaleController.getString("Delete", R.string.Delete), (dialogInterface, i) -> { ArrayList ids = null; if (selectedMessage != null) { @@ -4386,21 +4395,25 @@ public class AlertsCreator { selectedMessages[a].clear(); } } - if (userFinal != null) { + if (userFinal != null || chatFinal != null) { if (checks[0]) { - MessagesController.getInstance(currentAccount).deleteParticipantFromChat(chat.id, userFinal, chatInfo); + MessagesController.getInstance(currentAccount).deleteParticipantFromChat(chat.id, userFinal, chatFinal, chatInfo, false, false); } if (checks[1]) { TLRPC.TL_channels_reportSpam req = new TLRPC.TL_channels_reportSpam(); req.channel = MessagesController.getInputChannel(chat); - req.user_id = MessagesController.getInstance(currentAccount).getInputUser(userFinal); + if (userFinal != null) { + req.participant = MessagesController.getInputPeer(userFinal); + } else { + req.participant = MessagesController.getInputPeer(chatFinal); + } req.id = ids; ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> { }); } if (checks[2]) { - MessagesController.getInstance(currentAccount).deleteUserChannelHistory(chat, userFinal, 0); + MessagesController.getInstance(currentAccount).deleteUserChannelHistory(chat, userFinal, chatFinal, 0); } } if (onDelete != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java index 82eccf8c0..b2d2b9c5d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java @@ -4659,7 +4659,6 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe messageEditText.setAlpha(1f); messageEditText.setTranslationX(0); messageEditText.requestFocus(); - updateSendAsButton(); } }); @@ -6816,7 +6815,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe } } boolean wasVisible = senderSelectView.getVisibility() == View.VISIBLE; - boolean isVisible = delegate.getSendAsPeers() != null && defPeer != null && delegate.getSendAsPeers().peers.size() > 1 && !isEditingMessage() && !isRecordingAudioVideo() && (recordedAudioPanel == null || recordedAudioPanel.getVisibility() == View.GONE); + boolean isVisible = delegate.getSendAsPeers() != null && defPeer != null && delegate.getSendAsPeers().peers.size() > 1 && !isEditingMessage() && !isRecordingAudioVideo(); int pad = AndroidUtilities.dp(2); MarginLayoutParams params = (MarginLayoutParams) senderSelectView.getLayoutParams(); float sA = isVisible ? 0 : 1; @@ -6832,8 +6831,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe } if (parentFragment.getOtherSameChatsDiff() == 0 && parentFragment.fragmentOpened) { - ValueAnimator anim = ValueAnimator.ofFloat(0, 1).setDuration(220); - anim.setInterpolator(CubicBezierInterpolator.DEFAULT); + ValueAnimator anim = ValueAnimator.ofFloat(0, 1).setDuration(150); anim.addUpdateListener(animation -> { float val = (float) animation.getAnimatedValue(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertDocumentLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertDocumentLayout.java index 6c6f4bdcf..2dcd18693 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertDocumentLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertDocumentLayout.java @@ -336,13 +336,13 @@ public class ChatAttachAlertDocumentLayout extends ChatAttachAlert.AttachAlertLa ListItem item = (ListItem) object; File file = item.file; boolean isExternalStorageManager = false; -// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { -// isExternalStorageManager = Environment.isExternalStorageManager(); -// } - if (!BuildVars.NO_SCOPED_STORAGE && (item.icon == R.drawable.files_storage || item.icon == R.drawable.files_internal)) { - //if (SharedConfig.dontAskManageStorage) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + isExternalStorageManager = Environment.isExternalStorageManager(); + } + if (!BuildVars.NO_SCOPED_STORAGE && (item.icon == R.drawable.files_storage || item.icon == R.drawable.files_internal) && !isExternalStorageManager) { + if (SharedConfig.dontAskManageStorage) { delegate.startDocumentSelectActivity(); - /*} else { + } else { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTopImage(R.drawable.doc_big, Theme.getColor(Theme.key_dialogTopBackground)); builder.setMessage(AndroidUtilities.replaceTags(LocaleController.getString("ManageAllFilesRational", R.string.ManageAllFilesRational))); @@ -368,7 +368,7 @@ public class ChatAttachAlertDocumentLayout extends ChatAttachAlert.AttachAlertLa delegate.startDocumentSelectActivity(); }); builder.show(); - }*/ + } } else if (file == null) { if (item.icon == R.drawable.files_gallery) { HashMap selectedPhotos = new HashMap<>(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/MediaActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/MediaActivity.java index 2968b7cf8..ad3a88d81 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/MediaActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/MediaActivity.java @@ -104,7 +104,7 @@ public class MediaActivity extends BaseFragment implements SharedMediaLayout.Sha @Override public boolean dispatchTouchEvent(MotionEvent ev) { - if (sharedMediaLayout != null && sharedMediaLayout.isInFastScroll() && sharedMediaLayout.getY() == 0) { + if (sharedMediaLayout != null && sharedMediaLayout.isInFastScroll()) { return sharedMediaLayout.dispatchFastScrollEvent(ev); } if (sharedMediaLayout != null && sharedMediaLayout.checkPinchToZoom(ev)) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/MotionBackgroundDrawable.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/MotionBackgroundDrawable.java index 03da6b631..ef3687770 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/MotionBackgroundDrawable.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/MotionBackgroundDrawable.java @@ -440,7 +440,6 @@ public class MotionBackgroundDrawable extends Drawable { legacyBitmap2 = null; } try { - legacyBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); legacyCanvas = new Canvas(legacyBitmap); invalidateLegacy = true; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/RecyclerListView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/RecyclerListView.java index 359095900..276a3ce14 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/RecyclerListView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/RecyclerListView.java @@ -385,6 +385,7 @@ public class RecyclerListView extends RecyclerView { float touchSlop; Drawable fastScrollShadowDrawable; Drawable fastScrollBackgroundDrawable; + boolean isRtl; Runnable hideFloatingDateRunnable = new Runnable() { @Override @@ -404,7 +405,9 @@ public class RecyclerListView extends RecyclerView { this.type = type; if (type == LETTER_TYPE) { letterPaint.setTextSize(AndroidUtilities.dp(45)); + isRtl = LocaleController.isRTL; } else { + isRtl = false; letterPaint.setTextSize(AndroidUtilities.dp(13)); letterPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); paint2.setColor(Theme.getColor(Theme.key_windowBackgroundWhite)); @@ -415,7 +418,7 @@ public class RecyclerListView extends RecyclerView { radii[a] = AndroidUtilities.dp(44); } - scrollX = LocaleController.isRTL ? AndroidUtilities.dp(10) : AndroidUtilities.dp((type == LETTER_TYPE ? 132 : 240) - 15); + scrollX = isRtl ? AndroidUtilities.dp(10) : AndroidUtilities.dp((type == LETTER_TYPE ? 132 : 240) - 15); updateColors(); setFocusableInTouchMode(true); ViewConfiguration vc = ViewConfiguration.get(context); @@ -453,11 +456,11 @@ public class RecyclerListView extends RecyclerView { float x = event.getX(); startY = lastY = event.getY(); float currentY = (float) Math.ceil((getMeasuredHeight() - AndroidUtilities.dp(24 + 30)) * progress) + AndroidUtilities.dp(12); - if (LocaleController.isRTL && x > AndroidUtilities.dp(25) || !LocaleController.isRTL && x < AndroidUtilities.dp(107) || lastY < currentY || lastY > currentY + AndroidUtilities.dp(30)) { + if (isRtl && x > AndroidUtilities.dp(25) || !isRtl && x < AndroidUtilities.dp(107) || lastY < currentY || lastY > currentY + AndroidUtilities.dp(30)) { return false; } if (type == DATE_TYPE && !floatingDateVisible) { - if (LocaleController.isRTL && x > AndroidUtilities.dp(25) || !LocaleController.isRTL && x < (getMeasuredWidth() - AndroidUtilities.dp(25)) || lastY < currentY || lastY > currentY + AndroidUtilities.dp(30)) { + if (isRtl && x > AndroidUtilities.dp(25) || !isRtl && x < (getMeasuredWidth() - AndroidUtilities.dp(25)) || lastY < currentY || lastY > currentY + AndroidUtilities.dp(30)) { return false; } } @@ -552,7 +555,7 @@ public class RecyclerListView extends RecyclerView { if (letterLayout.getLineCount() > 0) { float lWidth = letterLayout.getLineWidth(0); float lleft = letterLayout.getLineLeft(0); - if (LocaleController.isRTL) { + if (isRtl) { textX = AndroidUtilities.dp(10) + (AndroidUtilities.dp(88) - letterLayout.getLineWidth(0)) / 2 - letterLayout.getLineLeft(0); } else { textX = (AndroidUtilities.dp(88) - letterLayout.getLineWidth(0)) / 2 - letterLayout.getLineLeft(0); @@ -625,8 +628,8 @@ public class RecyclerListView extends RecyclerView { raduisBottom = AndroidUtilities.dp(44); raduisTop = AndroidUtilities.dp(4) + (1.0f - diff / AndroidUtilities.dp(29)) * AndroidUtilities.dp(40); } - if (LocaleController.isRTL && (radii[0] != raduisTop || radii[6] != raduisBottom) || !LocaleController.isRTL && (radii[2] != raduisTop || radii[4] != raduisBottom)) { - if (LocaleController.isRTL) { + if (isRtl && (radii[0] != raduisTop || radii[6] != raduisBottom) || !isRtl && (radii[2] != raduisTop || radii[4] != raduisBottom)) { + if (isRtl) { radii[0] = radii[1] = raduisTop; radii[6] = radii[7] = raduisBottom; } else { @@ -634,7 +637,7 @@ public class RecyclerListView extends RecyclerView { radii[4] = radii[5] = raduisBottom; } path.reset(); - rect.set(LocaleController.isRTL ? AndroidUtilities.dp(10) : 0, 0, AndroidUtilities.dp(LocaleController.isRTL ? 98 : 88), AndroidUtilities.dp(88)); + rect.set(isRtl ? AndroidUtilities.dp(10) : 0, 0, AndroidUtilities.dp(isRtl ? 98 : 88), AndroidUtilities.dp(88)); path.addRoundRect(rect, radii, Path.Direction.CW); path.close(); } @@ -1225,7 +1228,7 @@ public class RecyclerListView extends RecyclerView { if (fastScroll != null) { selfOnLayout = true; t += getPaddingTop(); - if (LocaleController.isRTL) { + if (fastScroll.isRtl) { fastScroll.layout(0, t, fastScroll.getMeasuredWidth(), t + fastScroll.getMeasuredHeight()); } else { int x = getMeasuredWidth() - fastScroll.getMeasuredWidth(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/StickerImageView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/StickerImageView.java new file mode 100644 index 000000000..557a0a283 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/StickerImageView.java @@ -0,0 +1,85 @@ +package org.telegram.ui.Components; + +import android.content.Context; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.DocumentObject; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.MediaDataController; +import org.telegram.messenger.NotificationCenter; +import org.telegram.messenger.SvgHelper; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.Theme; + +public class StickerImageView extends BackupImageView implements NotificationCenter.NotificationCenterDelegate { + + int currentAccount; + int stickerNum; + String stickerPackName = AndroidUtilities.STICKERS_PLACEHOLDER_PACK_NAME; + + public StickerImageView(Context context, int currentAccount) { + super(context); + this.currentAccount = currentAccount; + } + + public void setStickerNum(int stickerNum) { + this.stickerNum = stickerNum; + } + + public void setStickerPackName(String stickerPackName) { + this.stickerPackName = stickerPackName; + } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + setSticker(); + NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.diceStickersDidLoad); + } + + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.diceStickersDidLoad); + } + + @Override + public void didReceivedNotification(int id, int account, Object... args) { + if (id == NotificationCenter.diceStickersDidLoad) { + String name = (String) args[0]; + if (stickerPackName.equals(name)) { + setSticker(); + } + } + } + + private void setSticker() { + String imageFilter = null; + TLRPC.Document document = null; + TLRPC.TL_messages_stickerSet set = null; + + set = MediaDataController.getInstance(currentAccount).getStickerSetByName(stickerPackName); + if (set == null) { + set = MediaDataController.getInstance(currentAccount).getStickerSetByEmojiOrName(stickerPackName); + } + if (set != null && set.documents.size() > stickerNum) { + document = set.documents.get(stickerNum); + } + imageFilter = "130_130"; + + SvgHelper.SvgDrawable svgThumb = null; + if (document != null) { + svgThumb = DocumentObject.getSvgThumb(document.thumbs, Theme.key_emptyListPlaceholder, 0.2f); + } + if (svgThumb != null) { + svgThumb.overrideWidthAndHeight(512, 512); + } + + if (document != null) { + ImageLocation imageLocation = ImageLocation.getForDocument(document); + setImage(imageLocation, imageFilter, "tgs", svgThumb, set); + } else { + MediaDataController.getInstance(currentAccount).loadStickersByEmojiOrName(stickerPackName, false, set == null); + } + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DefaultThemesPreviewCell.java b/TMessagesProj/src/main/java/org/telegram/ui/DefaultThemesPreviewCell.java index bcd39b86c..aa21d8c18 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DefaultThemesPreviewCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DefaultThemesPreviewCell.java @@ -248,7 +248,7 @@ public class DefaultThemesPreviewCell extends LinearLayout { if (!Theme.isCurrentThemeDay()) { darkThemeDrawable.setCurrentFrame(darkThemeDrawable.getFramesCount() - 1); - dayNightCell.setTextAndIcon(LocaleController.getString("SettingsSwitchToDaytMode", R.string.SettingsSwitchToDayMode), darkThemeDrawable, true); + dayNightCell.setTextAndIcon(LocaleController.getString("SettingsSwitchToDayMode", R.string.SettingsSwitchToDayMode), darkThemeDrawable, true); } else { dayNightCell.setTextAndIcon(LocaleController.getString("SettingsSwitchToNightMode", R.string.SettingsSwitchToNightMode), darkThemeDrawable, true); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java index e6edaac55..46b75aef3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java @@ -88,6 +88,7 @@ import org.telegram.messenger.ContactsController; import org.telegram.messenger.DialogObject; import org.telegram.messenger.FileLoader; import org.telegram.messenger.FileLog; +import org.telegram.messenger.FilesMigrationService; import org.telegram.messenger.ImageLoader; import org.telegram.messenger.ImageLocation; import org.telegram.messenger.LocaleController; @@ -3534,6 +3535,9 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter. showSearch(false, false); } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + FilesMigrationService.checkBottomSheet(this); + } updateMenuButton(false); return fragmentView; } @@ -6347,6 +6351,18 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter. askingForPermissions = false; showFiltersHint(); } + } else if (requestCode == 4) { + boolean allGranted = true; + for (int a = 0; a < grantResults.length; a++) { + if (grantResults[a] != PackageManager.PERMISSION_GRANTED) { + allGranted = false; + break; + } + } + if (allGranted && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && FilesMigrationService.filesMigrationBottomSheet != null) { + FilesMigrationService.filesMigrationBottomSheet.migrateOldFolder(); + } + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index cdd061243..c16f0e178 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -1942,12 +1942,12 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa String msgID = data.getQueryParameter("message_id"); if (userID != null) { try { - push_user_id = Integer.parseInt(userID); + push_user_id = Long.parseLong(userID); } catch (NumberFormatException ignore) { } } else if (chatID != null) { try { - push_chat_id = Integer.parseInt(chatID); + push_chat_id = Long.parseLong(chatID); } catch (NumberFormatException ignore) { } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java index 12bf8a79a..dbe89a353 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java @@ -9648,7 +9648,6 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat isEvent = object != null && object.isEvent; sharedMediaType = MediaDataController.MEDIA_PHOTOVIDEO; allMediaItem.setText(LocaleController.getString("ShowAllMedia", R.string.ShowAllMedia)); - menuItem.setVisibility(View.VISIBLE); setItemVisible(sendItem, false, false); setItemVisible(pipItem, false, true); cameraItem.setVisibility(View.GONE); @@ -9894,7 +9893,6 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat cameraItem.setVisibility(View.VISIBLE); cameraItem.setTag(1); } - menuItem.setVisibility(View.GONE); imagesArrLocals.addAll(photos); Object obj = imagesArrLocals.get(index); boolean allowCaption; @@ -10553,7 +10551,6 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } actionBar.setTitle(LocaleController.getString("AttachGif", R.string.AttachGif)); } else { - menuItem.setVisibility(View.VISIBLE); if (size == 1) { if (isVideo) { actionBar.setTitle(LocaleController.getString("AttachVideo", R.string.AttachVideo)); @@ -12350,7 +12347,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat disableShowCheck = false; object.imageReceiver.setVisible(false, true); }; - if (parentChatActivity != null) { + if (parentChatActivity != null && parentChatActivity.getFragmentView() != null) { parentChatActivity.getUndoView().hide(false, 1); parentChatActivity.getFragmentView().invalidate(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index e90bfb4d7..ed8767e32 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -3886,7 +3886,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. participant.inviter_id = participant.channelParticipant.inviter_id; participant.user_id = MessageObject.getPeerId(participant.channelParticipant.peer); participant.date = participant.channelParticipant.date; - if (participant.user_id != 0 && participantsMap.indexOfKey(participant.user_id) < 0) { + if (participantsMap.indexOfKey(participant.user_id) < 0) { if (chatInfo.participants == null) { chatInfo.participants = new TLRPC.TL_chatParticipants(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SessionBottomSheet.java b/TMessagesProj/src/main/java/org/telegram/ui/SessionBottomSheet.java index 5b2f8352f..5b0a6936f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SessionBottomSheet.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SessionBottomSheet.java @@ -378,15 +378,17 @@ public class SessionBottomSheet extends BottomSheet { LinearLayout linearLayout = new LinearLayout(context); linearLayout.setOrientation(LinearLayout.VERTICAL); - addView(linearLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 64, 4, 0, 4)); + addView(linearLayout, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 64, 4, 0, 4)); valueText = new TextView(context); valueText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); + valueText.setGravity(Gravity.LEFT); valueText.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); linearLayout.addView(valueText, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 0, 0, 0, 0)); descriptionText = new TextView(context); descriptionText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13); + descriptionText.setGravity(Gravity.LEFT); descriptionText.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText)); linearLayout.addView(descriptionText, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 0, 4, 0, 0)); setPadding(0, AndroidUtilities.dp(4), 0, AndroidUtilities.dp(4)); diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml index 75d2058b4..6cdb64478 100644 --- a/TMessagesProj/src/main/res/values/strings.xml +++ b/TMessagesProj/src/main/res/values/strings.xml @@ -4889,4 +4889,9 @@ You received this message because you requested to join **%1$s** on %2$s un1 sent this message: Get code on this phone + Migration + Move Files Now + Migrate Files to Scoped Storage + Due to a change made by **Google**, we need to move the files you downloaded using **Telegram** to a new folder.\n\nThis may take a few moments. You can continue using the app while the files are moved. + Migrating files From 9e740dfd4d2b1ab6b8ed2b972e0f72fc9b8bd09d Mon Sep 17 00:00:00 2001 From: xaxtix Date: Thu, 30 Dec 2021 13:52:40 +0300 Subject: [PATCH 3/4] Update to 8.4.1 --- TMessagesProj/build.gradle | 5 +- TMessagesProj/proguard-rules.pro | 3 + .../src/main/assets/fonts/rcondensedbold.ttf | Bin 0 -> 169352 bytes .../widget/ChatListItemAnimator.java | 10 +- .../randomizedtesting/MurmurHash3.java | 42 + .../Xoroshiro128PlusRandom.java | 97 + .../com/google/zxing/qrcode/QRCodeWriter.java | 68 +- .../telegram/messenger/AndroidUtilities.java | 151 + .../org/telegram/messenger/BuildVars.java | 8 +- .../messenger/ForwardingMessagesParams.java | 13 + .../messenger/GcmPushListenerService.java | 1336 +- .../telegram/messenger/GenericProvider.java | 5 + .../org/telegram/messenger/ImageLoader.java | 8 +- .../telegram/messenger/LanguageDetector.java | 21 + .../telegram/messenger/LocaleController.java | 9 + .../telegram/messenger/MediaController.java | 236 +- .../messenger/MediaDataController.java | 379 +- .../org/telegram/messenger/MessageObject.java | 157 +- .../messenger/MessagesController.java | 135 +- .../telegram/messenger/MessagesStorage.java | 15 +- .../messenger/NotificationCenter.java | 8 +- .../messenger/NotificationsController.java | 23 +- .../messenger/SendMessagesHelper.java | 17 +- .../org/telegram/messenger/SharedConfig.java | 58 +- .../org/telegram/messenger/Utilities.java | 4 + .../video/MediaCodecVideoConvertor.java | 2 +- .../telegram/tgnet/ConnectionsManager.java | 6 +- .../main/java/org/telegram/tgnet/TLRPC.java | 33647 ++++++++-------- .../org/telegram/ui/ActionBar/ActionBar.java | 5 +- .../ui/ActionBar/ActionBarLayout.java | 30 +- .../telegram/ui/ActionBar/ActionBarMenu.java | 11 + .../ui/ActionBar/ActionBarMenuItem.java | 2 - .../ui/ActionBar/ActionBarPopupWindow.java | 35 +- .../telegram/ui/ActionBar/BaseFragment.java | 4 +- .../telegram/ui/ActionBar/BottomSheet.java | 31 +- .../telegram/ui/ActionBar/EmojiThemes.java | 28 +- .../telegram/ui/ActionBar/SimpleTextView.java | 45 + .../java/org/telegram/ui/ActionBar/Theme.java | 35 +- .../ui/Cells/AvailableReactionCell.java | 128 + .../org/telegram/ui/Cells/ChatActionCell.java | 38 +- .../telegram/ui/Cells/ChatMessageCell.java | 1007 +- .../org/telegram/ui/Cells/DialogCell.java | 114 +- .../telegram/ui/Cells/DrawerActionCell.java | 8 + .../telegram/ui/Cells/DrawerProfileCell.java | 3 +- .../org/telegram/ui/Cells/DrawerUserCell.java | 7 + .../telegram/ui/Cells/SettingsSearchCell.java | 2 +- .../org/telegram/ui/Cells/SharedLinkCell.java | 279 +- .../java/org/telegram/ui/Cells/TextCell.java | 1 + .../org/telegram/ui/Cells/TextCheckCell.java | 53 +- .../telegram/ui/Cells/TextCheckbox2Cell.java | 300 + .../org/telegram/ui/Cells/TextDetailCell.java | 26 +- .../org/telegram/ui/Cells/TextRadioCell.java | 272 + .../telegram/ui/Cells/TextSettingsCell.java | 15 +- .../ui/Cells/ThemePreviewMessagesCell.java | 267 +- .../ui/Cells/ThemesHorizontalListCell.java | 52 +- .../java/org/telegram/ui/ChatActivity.java | 1266 +- .../org/telegram/ui/ChatEditActivity.java | 57 +- .../telegram/ui/ChatPullingDownDrawable.java | 9 +- .../ui/ChatReactionsEditActivity.java | 267 + .../java/org/telegram/ui/CodeNumberField.java | 2 +- .../ui/Components/AudioPlayerAlert.java | 13 + .../ui/Components/AvatarsDarawable.java | 526 + .../ui/Components/AvatarsImageView.java | 507 +- .../ui/Components/ChatActivityEnterView.java | 120 +- .../ui/Components/ChatAttachAlert.java | 10 +- .../ChatAttachAlertDocumentLayout.java | 30 +- .../ChatAttachAlertPhotoLayout.java | 6 +- .../ChatScrimPopupContainerLayout.java | 30 + .../ui/Components/ChatThemeBottomSheet.java | 2 + .../org/telegram/ui/Components/CheckBox2.java | 4 + .../telegram/ui/Components/CheckBoxBase.java | 3 +- .../telegram/ui/Components/CounterView.java | 47 +- .../ui/Components/EditTextBoldCursor.java | 2 +- .../ui/Components/EditTextCaption.java | 10 + .../ui/Components/EditTextEffects.java | 273 + .../ui/Components/FlickerLoadingView.java | 57 +- .../ui/Components/ForwardingPreviewView.java | 1 + .../ui/Components/FragmentContextView.java | 10 +- .../GestureDetectorFixDoubleTap.java | 530 + .../telegram/ui/Components/GroupCallPip.java | 2 +- .../ui/Components/LerpedLayoutParams.java | 56 + .../Components/MotionBackgroundDrawable.java | 160 +- .../ui/Components/PhotoPaintView.java | 3 + .../PhotoViewerCaptionEnterView.java | 1 + .../ui/Components/PopupSwipeBackLayout.java | 440 + .../ui/Components/QRCodeBottomSheet.java | 30 +- .../ui/Components/ReactedHeaderView.java | 301 + .../ui/Components/ReactedUsersListView.java | 298 + .../ui/Components/ReactionTabHolderView.java | 115 + .../Reactions/ReactionsEffectOverlay.java | 376 + .../Reactions/ReactionsLayoutInBubble.java | 624 + .../Components/ReactionsContainerLayout.java | 431 + .../ui/Components/RecyclerListView.java | 225 +- .../ui/Components/SeekBarWaveform.java | 1 - .../ui/Components/SimpleThemeDescription.java | 17 + .../Components/SizeNotifierFrameLayout.java | 22 +- .../ui/Components/SnowflakesEffect.java | 135 +- .../ui/Components/StaticLayoutEx.java | 1 - .../telegram/ui/Components/TextStyleSpan.java | 17 + .../ui/Components/ThemeSmallPreviewView.java | 142 +- .../ui/Components/TranslateAlert.java | 1588 + .../ui/Components/UpdateAppAlertDialog.java | 4 +- .../ui/Components/spoilers/SpoilerEffect.java | 824 + .../spoilers/SpoilerEffectBitmapFactory.java | 120 + .../spoilers/SpoilersClickDetector.java | 70 + .../Components/spoilers/SpoilersTextView.java | 116 + .../voip/GroupCallRenderersContainer.java | 9 +- .../telegram/ui/DefaultThemesPreviewCell.java | 2 +- .../ChatActivityMemberRequestsDelegate.java | 2 +- .../java/org/telegram/ui/DialogsActivity.java | 6 +- .../telegram/ui/EmojiAnimationsOverlay.java | 3 - .../telegram/ui/LanguageSelectActivity.java | 436 +- .../org/telegram/ui/LocationActivity.java | 2 +- .../java/org/telegram/ui/LoginActivity.java | 8 +- .../telegram/ui/MediaCalendarActivity.java | 642 + .../java/org/telegram/ui/MessageSeenView.java | 18 +- .../java/org/telegram/ui/PhotoViewer.java | 23 +- .../java/org/telegram/ui/ProfileActivity.java | 124 +- .../main/java/org/telegram/ui/QrActivity.java | 1292 + .../ui/ReactionsDoubleTapManageActivity.java | 198 + .../ui/RestrictedLanguagesSelectActivity.java | 561 + .../org/telegram/ui/SessionBottomSheet.java | 4 +- .../ui/TextMessageEnterTransition.java | 12 +- .../java/org/telegram/ui/ThemeActivity.java | 47 +- .../res/drawable-hdpi/actions_reactions.png | Bin 0 -> 1442 bytes .../main/res/drawable-hdpi/msg_qr_mini.png | Bin 0 -> 799 bytes .../main/res/drawable-hdpi/msg_reactions.png | Bin 0 -> 1099 bytes .../drawable-hdpi/msg_reactions_filled.png | Bin 0 -> 905 bytes .../main/res/drawable-hdpi/msg_translate.png | Bin 0 -> 916 bytes .../main/res/drawable-hdpi/qr_at_large.png | Bin 0 -> 1340 bytes .../main/res/drawable-hdpi/qr_at_medium.png | Bin 0 -> 1088 bytes .../main/res/drawable-hdpi/qr_at_small.png | Bin 0 -> 931 bytes .../reactions_bubble_shadow.9.png | Bin 0 -> 3243 bytes .../res/drawable-mdpi/actions_reactions.png | Bin 0 -> 912 bytes .../main/res/drawable-mdpi/msg_qr_mini.png | Bin 0 -> 641 bytes .../main/res/drawable-mdpi/msg_reactions.png | Bin 0 -> 751 bytes .../drawable-mdpi/msg_reactions_filled.png | Bin 0 -> 613 bytes .../main/res/drawable-mdpi/msg_translate.png | Bin 0 -> 634 bytes .../main/res/drawable-mdpi/qr_at_large.png | Bin 0 -> 898 bytes .../main/res/drawable-mdpi/qr_at_medium.png | Bin 0 -> 786 bytes .../main/res/drawable-mdpi/qr_at_small.png | Bin 0 -> 638 bytes .../reactions_bubble_shadow.9.png | Bin 0 -> 1722 bytes .../src/main/res/drawable-nodpi/dino_pic.jpg | Bin 0 -> 4709 bytes .../res/drawable-xhdpi/actions_reactions.png | Bin 0 -> 1941 bytes .../main/res/drawable-xhdpi/msg_qr_mini.png | Bin 0 -> 1106 bytes .../main/res/drawable-xhdpi/msg_reactions.png | Bin 0 -> 1526 bytes .../drawable-xhdpi/msg_reactions_filled.png | Bin 0 -> 1195 bytes .../main/res/drawable-xhdpi/msg_translate.png | Bin 0 -> 1219 bytes .../main/res/drawable-xhdpi/qr_at_large.png | Bin 0 -> 1795 bytes .../main/res/drawable-xhdpi/qr_at_medium.png | Bin 0 -> 1595 bytes .../main/res/drawable-xhdpi/qr_at_small.png | Bin 0 -> 1543 bytes .../reactions_bubble_shadow.9.png | Bin 0 -> 4560 bytes .../res/drawable-xxhdpi/actions_reactions.png | Bin 0 -> 2999 bytes .../main/res/drawable-xxhdpi/msg_qr_mini.png | Bin 0 -> 1106 bytes .../res/drawable-xxhdpi/msg_reactions.png | Bin 0 -> 2361 bytes .../drawable-xxhdpi/msg_reactions_filled.png | Bin 0 -> 1800 bytes .../res/drawable-xxhdpi/msg_translate.png | Bin 0 -> 1817 bytes .../main/res/drawable-xxhdpi/qr_at_large.png | Bin 0 -> 2794 bytes .../main/res/drawable-xxhdpi/qr_at_medium.png | Bin 0 -> 2232 bytes .../main/res/drawable-xxhdpi/qr_at_small.png | Bin 0 -> 1865 bytes .../reactions_bubble_shadow.9.png | Bin 0 -> 8581 bytes .../src/main/res/raw/qr_code_logo_2.tgs | 1 + TMessagesProj/src/main/res/values/ids.xml | 1 + TMessagesProj/src/main/res/values/strings.xml | 81 + 164 files changed, 33576 insertions(+), 19058 deletions(-) create mode 100644 TMessagesProj/src/main/assets/fonts/rcondensedbold.ttf create mode 100644 TMessagesProj/src/main/java/com/carrotsearch/randomizedtesting/MurmurHash3.java create mode 100644 TMessagesProj/src/main/java/com/carrotsearch/randomizedtesting/Xoroshiro128PlusRandom.java create mode 100644 TMessagesProj/src/main/java/org/telegram/messenger/GenericProvider.java create mode 100644 TMessagesProj/src/main/java/org/telegram/messenger/LanguageDetector.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Cells/AvailableReactionCell.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckbox2Cell.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Cells/TextRadioCell.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/ChatReactionsEditActivity.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarsDarawable.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/ChatScrimPopupContainerLayout.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEffects.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/GestureDetectorFixDoubleTap.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/LerpedLayoutParams.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/PopupSwipeBackLayout.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedHeaderView.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedUsersListView.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionTabHolderView.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsEffectOverlay.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsLayoutInBubble.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionsContainerLayout.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/SimpleThemeDescription.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/TranslateAlert.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilerEffect.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilerEffectBitmapFactory.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersClickDetector.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersTextView.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/MediaCalendarActivity.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/QrActivity.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/ReactionsDoubleTapManageActivity.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/RestrictedLanguagesSelectActivity.java create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/actions_reactions.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/msg_qr_mini.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/msg_reactions.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/msg_reactions_filled.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/msg_translate.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/qr_at_large.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/qr_at_medium.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/qr_at_small.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/reactions_bubble_shadow.9.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/actions_reactions.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/msg_qr_mini.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/msg_reactions.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/msg_reactions_filled.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/msg_translate.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/qr_at_large.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/qr_at_medium.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/qr_at_small.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/reactions_bubble_shadow.9.png create mode 100644 TMessagesProj/src/main/res/drawable-nodpi/dino_pic.jpg create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/actions_reactions.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/msg_qr_mini.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/msg_reactions.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/msg_reactions_filled.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/msg_translate.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/qr_at_large.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/qr_at_medium.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/qr_at_small.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/reactions_bubble_shadow.9.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/actions_reactions.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/msg_qr_mini.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/msg_reactions.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/msg_reactions_filled.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/msg_translate.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/qr_at_large.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/qr_at_medium.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/qr_at_small.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/reactions_bubble_shadow.9.png create mode 100644 TMessagesProj/src/main/res/raw/qr_code_logo_2.tgs diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 05d2525a0..49664a98f 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -36,6 +36,7 @@ dependencies { implementation 'com.google.android.gms:play-services-wallet:18.1.3' implementation 'com.googlecode.mp4parser:isoparser:1.0.6' implementation 'com.stripe:stripe-android:2.0.2' + implementation 'com.google.mlkit:language-id:16.1.1' implementation files('libs/libgsaverification-client.aar') coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' @@ -299,7 +300,7 @@ android { } } - defaultConfig.versionCode = 2495 + defaultConfig.versionCode = 2522 applicationVariants.all { variant -> variant.outputs.all { output -> @@ -318,7 +319,7 @@ android { defaultConfig { minSdkVersion 16 targetSdkVersion 30 - versionName "8.3.1" + versionName "8.4.1" vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] diff --git a/TMessagesProj/proguard-rules.pro b/TMessagesProj/proguard-rules.pro index d8c91e408..ec3d0c01f 100644 --- a/TMessagesProj/proguard-rules.pro +++ b/TMessagesProj/proguard-rules.pro @@ -27,6 +27,9 @@ -keep class com.google.android.exoplayer2.metadata.flac.PictureFrame { *; } -keep class com.google.android.exoplayer2.decoder.SimpleOutputBuffer { *; } +# https://developers.google.com/ml-kit/known-issues#android_issues +-keep class com.google.mlkit.nl.languageid.internal.LanguageIdentificationJni { *; } + # Constant folding for resource integers may mean that a resource passed to this method appears to be unused. Keep the method to prevent this from happening. -keep class com.google.android.exoplayer2.upstream.RawResourceDataSource { public static android.net.Uri buildRawResourceUri(int); diff --git a/TMessagesProj/src/main/assets/fonts/rcondensedbold.ttf b/TMessagesProj/src/main/assets/fonts/rcondensedbold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..7fe31289ce91cbc8e94d23e5b01413dce22f682d GIT binary patch literal 169352 zcmbTf2YeJ&+Xp&lW_C9{yV-0u1=1TekV@|%ga8SU(0lK_zEr7Vp(_Yd6;Kh_42U2I zihzPG7LZ~=1w=qlX-cvu_kYgpWM_E!zWd$#gY52XnR(80p58_vf*^$8K^9{3+T^x9 z(8{$y5W|NEf;cFzsIcq5;|i7tV&o@+Ftl!7*OFGZ7F_Kqi1Ypt1jow4u4(D(_m;*A zYXiAlI#e5ZYkO_`w5r)~zvLAeRpbf?xF5 zfiospnu*`wcs;%!J8t0Ep)KAR^(Nr!fc4&-Fn;os%CW)_z|(+zK4H?(31{|fI4Ows z8-U3nn1m7d-Vu{akOZ^fD+CC^LXqGSa(lSMw5U?i*{ml&5O5&)H|wd$qF@VYsF>6z zi~8ilpIm<5D*@^of$AHg)fM!8z4~!+wm8Wq5u06#ld|k_;t}^Av1{FH^p9UYAg&7+ zXpzbFc&ABr&lP8u2a5l3_Y?ar6Z-)$VS44Cf*{?)dZL6FVY3nw8^=x(12lQo6M!WI zXh^r>z^Wba?ZD#rc0}TnNVXl-14Nu*wySztc&T9Vu39d0Rkym#{L#P6<)2pSqx;mK zUC@QckTRE#)fLLW76wFFUE%zlXttUJDZ!qQmBIfqqzpU$90~jnkM;yHYf0mMP2Mf5 zdF0!sdz&uB-~P{P9{jS&zWPgREFl}{FtT9}iP}rH(gEymFTJ*h4ioc86bMh~Q&~gW zYhEYR5hf{8-88I0-A}%S+LHaSN5gO)<7C{{rM?zL|a#mbuSVnrbxT;O3 zSJt#Uv~JzYyXdvtoUA6zx^I24&Hl|V?>S1MI&^57OXhbSP_xaPZR2-d3_X9T`os5U zOzYDnuU|%oIh)74`K{yQk0Ty@Hf>&Su)8p@^0s`!bP8M+DWnRSLIYu=A~$TrRshPv zX5cZ3Ki1%nIZvbVB&WVINMW?xvtfjSe??+op z)4hjERuUs4S5}&mBPOv|Iba!kW;VD*WtS``$3|9`iYgB$=|9WiA301Z#5r)y!@!InIB|CO5lN)rH-n()BE5CM-Cv|{?Y6twyGo2Kw2}weIVY*T? zJ%a&T)9MN?V~^1ueE9-Jz8c|ZyuumBiBFu2aIC(O_^A>e>C4U#X)Uepr4S`n{V

~I={b^x(UKJE%*oDH@zt*H{G1lYwyZe3 zrRYe)-El|h@$6^bJoF>kQP}pnIla)gO+W->Rveqxl9msj zPJi1?|Lri~7oSX$Yw9?pc)T<@Z+K#CZllb+Lhw;D={sWQQp%|ilNoDKrIX1cojgK` z*sC8pXBtCCi!~Vc&7cj%e&#~KCRi0qh@Jl`FwG_NO%DmlahgTRVGVIwl0`9P#>lUx zXH8rrEu5M)?aNW3SagNFN^+aMI*R7gD^2LPwBdve%}6uy^7lA%1Dv_G=gh&LGs|hN zKqi4hMbVOy9b(V2iYYl^VId)6?dji4%bc`GTsSqeNI6LF(^3X?l-NXi39>Uth*gD!jLnq!HkU;}$cKX+BES#fxK>h*Ny?CtoF=

DoM{$$EDjN`gAYOk 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. + * + * @see "http://sites.google.com/site/murmurhash/" + */ +final class MurmurHash3 +{ + private MurmurHash3() + { + // no instances. + } + + /** + * Hashes a 4-byte sequence (Java int). + */ + public static int hash(int k) + { + k ^= k >>> 16; + k *= 0x85ebca6b; + k ^= k >>> 13; + k *= 0xc2b2ae35; + k ^= k >>> 16; + return k; + } + + /** + * Hashes an 8-byte sequence (Java long). + */ + public static long hash(long k) + { + k ^= k >>> 33; + k *= 0xff51afd7ed558ccdL; + k ^= k >>> 33; + k *= 0xc4ceb9fe1a85ec53L; + k ^= k >>> 33; + + return k; + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/com/carrotsearch/randomizedtesting/Xoroshiro128PlusRandom.java b/TMessagesProj/src/main/java/com/carrotsearch/randomizedtesting/Xoroshiro128PlusRandom.java new file mode 100644 index 000000000..f4d6acaa4 --- /dev/null +++ b/TMessagesProj/src/main/java/com/carrotsearch/randomizedtesting/Xoroshiro128PlusRandom.java @@ -0,0 +1,97 @@ +package com.carrotsearch.randomizedtesting; + +import java.util.Random; + +/** + * Implements Xoroshiro128PlusRandom. Not synchronized (anywhere). + * + * @see "http://xoroshiro.di.unimi.it/" + */ +@SuppressWarnings("serial") +public class Xoroshiro128PlusRandom extends Random { + private static final double DOUBLE_UNIT = 0x1.0p-53; // 1.0 / (1L << 53); + private static final float FLOAT_UNIT = 0x1.0p-24f; // 1.0 / (1L << 24); + + private long s0, s1; + + public Xoroshiro128PlusRandom(long seed) { + // Must be here, the only Random constructor. Has side-effects on setSeed, see below. + super(0); + + s0 = MurmurHash3.hash(seed); + s1 = MurmurHash3.hash(s0); + + if (s0 == 0 && s1 == 0) { + s0 = MurmurHash3.hash(0xdeadbeefL); + s1 = MurmurHash3.hash(s0); + } + } + + @Override + public void setSeed(long seed) { + // Called from super constructor and observing uninitialized state? + if (s0 == 0 && s1 == 0) { + return; + } + + throw new RuntimeException("No seed set"); + } + + @Override + public boolean nextBoolean() { + return nextLong() >= 0; + } + + @Override + public void nextBytes(byte[] bytes) { + for (int i = 0, len = bytes.length; i < len; ) { + long rnd = nextInt(); + for (int n = Math.min(len - i, 8); n-- > 0; rnd >>>= 8) { + bytes[i++] = (byte) rnd; + } + } + } + + @Override + public double nextDouble() { + return (nextLong() >>> 11) * DOUBLE_UNIT; + } + + @Override + public float nextFloat() { + return (nextInt() >>> 8) * FLOAT_UNIT; + } + + @Override + public int nextInt() { + return (int) nextLong(); + } + + @Override + public int nextInt(int n) { + // Leave superclass's implementation. + return super.nextInt(n); + } + + @Override + public double nextGaussian() { + // Leave superclass's implementation. + return super.nextGaussian(); + } + + @Override + public long nextLong() { + final long s0 = this.s0; + long s1 = this.s1; + final long result = s0 + s1; + s1 ^= s0; + this.s0 = Long.rotateLeft(s0, 55) ^ s1 ^ s1 << 14; + this.s1 = Long.rotateLeft(s1, 36); + return result; + } + + @Override + protected int next(int bits) { + return ((int) nextLong()) >>> (32 - bits); + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/com/google/zxing/qrcode/QRCodeWriter.java b/TMessagesProj/src/main/java/com/google/zxing/qrcode/QRCodeWriter.java index 141a3c0d0..c88b9e5e3 100755 --- a/TMessagesProj/src/main/java/com/google/zxing/qrcode/QRCodeWriter.java +++ b/TMessagesProj/src/main/java/com/google/zxing/qrcode/QRCodeWriter.java @@ -16,14 +16,15 @@ package com.google.zxing.qrcode; -import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; +import android.graphics.Color; import android.graphics.Paint; -import android.graphics.drawable.Drawable; +import android.graphics.Path; +import android.graphics.RectF; +import android.graphics.Region; import android.graphics.drawable.GradientDrawable; -import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.WriterException; import com.google.zxing.qrcode.encoder.ByteMatrix; @@ -33,7 +34,6 @@ import com.google.zxing.qrcode.encoder.QRCode; import org.telegram.messenger.R; import org.telegram.messenger.SvgHelper; -import org.telegram.ui.ActionBar.Theme; import org.telegram.ui.Components.RLottieDrawable; import java.util.Arrays; @@ -55,7 +55,11 @@ public final class QRCodeWriter { private int imageSize; - public Bitmap encode(String contents, BarcodeFormat format, int width, int height, Map hints, Bitmap bitmap, Context context) throws WriterException { + public Bitmap encode(String contents, int width, int height, Map hints, Bitmap bitmap) throws WriterException { + return encode(contents, width, height, hints, bitmap, 1.0f, 0xffffffff, 0xff000000); + } + + public Bitmap encode(String contents, int width, int height, Map hints, Bitmap bitmap, float radiusFactor, int backgroundColor, int color) throws WriterException { if (contents.isEmpty()) { throw new IllegalArgumentException("Found empty contents"); @@ -107,9 +111,9 @@ public final class QRCodeWriter { bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); } Canvas canvas = new Canvas(bitmap); - canvas.drawColor(0xffffffff); + canvas.drawColor(backgroundColor); Paint blackPaint = new Paint(Paint.ANTI_ALIAS_FLAG); - blackPaint.setColor(0xff000000); + blackPaint.setColor(color); GradientDrawable rect = new GradientDrawable(); rect.setShape(GradientDrawable.RECTANGLE); @@ -123,6 +127,9 @@ public final class QRCodeWriter { imageSize = imageBloks * multiple - 24; int imageX = (size - imageSize) / 2; + boolean isTransparentBackground = Color.alpha(backgroundColor) == 0; + Path clipPath = new Path(); + RectF rectF = new RectF(); for (int a = 0; a < 3; a++) { int x, y; if (a == 0) { @@ -136,28 +143,41 @@ public final class QRCodeWriter { y = size - sideQuadSize * multiple - padding; } - float r = (sideQuadSize * multiple) / 3.0f; + float r; + if (isTransparentBackground) { + rectF.set(x + multiple, y + multiple, x + (sideQuadSize - 1) * multiple, y + (sideQuadSize - 1) * multiple); + r = (sideQuadSize * multiple) / 4.0f * radiusFactor; + clipPath.reset(); + clipPath.addRoundRect(rectF, r, r, Path.Direction.CW); + clipPath.close(); + canvas.save(); + canvas.clipPath(clipPath, Region.Op.DIFFERENCE); + } + r = (sideQuadSize * multiple) / 3.0f * radiusFactor; Arrays.fill(radii, r); - - rect.setColor(0xff000000); + rect.setColor(color); rect.setBounds(x, y, x + sideQuadSize * multiple, y + sideQuadSize * multiple); rect.draw(canvas); - canvas.drawRect(x + multiple, y + multiple, x + (sideQuadSize - 1) * multiple, y + (sideQuadSize - 1) * multiple, blackPaint); + if (isTransparentBackground) { + canvas.restore(); + } - r = (sideQuadSize * multiple) / 4.0f; - Arrays.fill(radii, r); - rect.setColor(0xffffffff); - rect.setBounds(x + multiple, y + multiple, x + (sideQuadSize - 1) * multiple, y + (sideQuadSize - 1) * multiple); - rect.draw(canvas); + if (!isTransparentBackground) { + r = (sideQuadSize * multiple) / 4.0f * radiusFactor; + Arrays.fill(radii, r); + rect.setColor(backgroundColor); + rect.setBounds(x + multiple, y + multiple, x + (sideQuadSize - 1) * multiple, y + (sideQuadSize - 1) * multiple); + rect.draw(canvas); + } - r = ((sideQuadSize - 2) * multiple) / 4.0f; + r = ((sideQuadSize - 2) * multiple) / 4.0f * radiusFactor; Arrays.fill(radii, r); - rect.setColor(0xff000000); + rect.setColor(color); rect.setBounds(x + multiple * 2, y + multiple * 2, x + (sideQuadSize - 2) * multiple, y + (sideQuadSize - 2) * multiple); rect.draw(canvas); } - float r = multiple / 2.0f; + float r = multiple / 2.0f * radiusFactor; for (int y = 0, outputY = padding; y < inputHeight; y++, outputY += multiple) { for (int x = 0, outputX = padding; x < inputWidth; x++, outputX += multiple) { @@ -179,7 +199,7 @@ public final class QRCodeWriter { radii[2] = radii[3] = 0; radii[4] = radii[5] = 0; } - rect.setColor(0xff000000); + rect.setColor(color); rect.setBounds(outputX, outputY, outputX + multiple, outputY + multiple); rect.draw(canvas); } else { @@ -201,9 +221,9 @@ public final class QRCodeWriter { radii[4] = radii[5] = r; has = true; } - if (has) { + if (has && !isTransparentBackground) { canvas.drawRect(outputX, outputY, outputX + multiple, outputY + multiple, blackPaint); - rect.setColor(0xffffffff); + rect.setColor(backgroundColor); rect.setBounds(outputX, outputY, outputX + multiple, outputY + multiple); rect.draw(canvas); } @@ -213,10 +233,6 @@ public final class QRCodeWriter { String svg = RLottieDrawable.readRes(null, R.raw.qr_logo); Bitmap icon = SvgHelper.getBitmap(svg, imageSize, imageSize, false); - -// Drawable drawable = context.getResources().getDrawable(R.drawable.ic_launcher_dr).mutate(); -// drawable.setBounds(imageX, imageX, imageX + imageSize, imageX + imageSize); -// drawable.draw(canvas); canvas.drawBitmap(icon, imageX, imageX, null); icon.recycle(); diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java b/TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java index fa1c171c6..b16846487 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java @@ -28,6 +28,7 @@ import android.content.res.AssetFileDescriptor; import android.content.res.Configuration; import android.database.Cursor; import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Paint; @@ -1967,6 +1968,29 @@ public class AndroidUtilities { } } + public static int charSequenceIndexOf(CharSequence cs, CharSequence needle, int fromIndex) { + for (int i = fromIndex; i < cs.length() - needle.length(); i++) { + boolean eq = true; + for (int j = 0; j < needle.length(); j++) { + if (needle.charAt(j) != cs.charAt(i + j)) { + eq = false; + break; + } + } + if (eq) + return i; + } + return -1; + } + + public static int charSequenceIndexOf(CharSequence cs, CharSequence needle) { + return charSequenceIndexOf(cs, needle, 0); + } + + public static boolean charSequenceContains(CharSequence cs, CharSequence needle) { + return charSequenceIndexOf(cs, needle) != -1; + } + public static CharSequence getTrimmedString(CharSequence src) { if (src == null || src.length() == 0) { return src; @@ -2905,6 +2929,57 @@ public class AndroidUtilities { return openForView(f, fileName, document.mime_type, activity, null); } + public static SpannableStringBuilder formatSpannableSimple(String format, CharSequence... cs) { + return formatSpannable(format, i -> "%s", cs); + } + + public static SpannableStringBuilder formatSpannable(String format, CharSequence... cs) { + if (format.contains("%s")) + return formatSpannableSimple(format, cs); + return formatSpannable(format, i -> "%" + (i + 1) + "$s", cs); + } + + public static SpannableStringBuilder formatSpannable(String format, GenericProvider keysProvider, CharSequence... cs) { + SpannableStringBuilder stringBuilder = new SpannableStringBuilder(format); + for (int i = 0; i < cs.length; i++) { + String key = keysProvider.provide(i); + int j = format.indexOf(key); + if (j != -1) { + stringBuilder.replace(j, j + key.length(), cs[i]); + format = format.substring(0, j) + cs[i].toString() + format.substring(j + key.length()); + } + } + return stringBuilder; + } + + public static CharSequence replaceTwoNewLinesToOne(CharSequence original) { + char[] buf = new char[2]; + if (original instanceof StringBuilder) { + StringBuilder stringBuilder = (StringBuilder) original; + for (int a = 0, N = original.length(); a < N - 2; a++) { + stringBuilder.getChars(a, a + 2, buf, 0); + if (buf[0] == '\n' && buf[1] == '\n') { + stringBuilder = stringBuilder.replace(a, a + 2, "\n"); + a--; + N--; + } + } + return original; + } else if (original instanceof SpannableStringBuilder) { + SpannableStringBuilder stringBuilder = (SpannableStringBuilder) original; + for (int a = 0, N = original.length(); a < N - 2; a++) { + stringBuilder.getChars(a, a + 2, buf, 0); + if (buf[0] == '\n' && buf[1] == '\n') { + stringBuilder = stringBuilder.replace(a, a + 2, "\n"); + a--; + N--; + } + } + return original; + } + return original.toString().replace("\n\n", "\n"); + } + public static CharSequence replaceNewLines(CharSequence original) { if (original instanceof StringBuilder) { StringBuilder stringBuilder = (StringBuilder) original; @@ -2913,6 +2988,7 @@ public class AndroidUtilities { stringBuilder.setCharAt(a, ' '); } } + return original; } else if (original instanceof SpannableStringBuilder) { SpannableStringBuilder stringBuilder = (SpannableStringBuilder) original; for (int a = 0, N = original.length(); a < N; a++) { @@ -2920,6 +2996,7 @@ public class AndroidUtilities { stringBuilder.replace(a, a + 1, " "); } } + return original; } return original.toString().replace('\n', ' '); } @@ -3642,6 +3719,9 @@ public class AndroidUtilities { } public static boolean checkHostForPunycode(String url) { + if (url == null) { + return false; + } boolean hasLatin = false; boolean hasNonLatin = false; try { @@ -3775,4 +3855,75 @@ public class AndroidUtilities { return preferences.getInt(key, (int) defaultValue); } } + + public static Bitmap getScaledBitmap(float w, float h, String path, String streamPath, int streamOffset) { + FileInputStream stream = null; + try { + BitmapFactory.Options options = new BitmapFactory.Options(); + options.inJustDecodeBounds = true; + + if (path != null) { + BitmapFactory.decodeFile(path, options); + } else { + stream = new FileInputStream(streamPath); + stream.getChannel().position(streamOffset); + BitmapFactory.decodeStream(stream, null, options); + } + if (options.outWidth > 0 && options.outHeight > 0) { + if (w > h && options.outWidth < options.outHeight) { + float temp = w; + w = h; + h = temp; + } + float scale = Math.min(options.outWidth / w, options.outHeight / h); + options.inSampleSize = 1; + if (scale > 1.0f) { + do { + options.inSampleSize *= 2; + } while (options.inSampleSize < scale); + } + options.inJustDecodeBounds = false; + Bitmap wallpaper; + if (path != null) { + wallpaper = BitmapFactory.decodeFile(path, options); + } else { + stream.getChannel().position(streamOffset); + wallpaper = BitmapFactory.decodeStream(stream, null, options); + } + return wallpaper; + } + } catch (Throwable e) { + FileLog.e(e); + } finally { + try { + if (stream != null) { + stream.close(); + } + } catch (Exception e2) { + FileLog.e(e2); + } + } + return null; + } + + public static Uri getBitmapShareUri(Bitmap bitmap, String fileName, Bitmap.CompressFormat format) { + File cachePath = AndroidUtilities.getCacheDir(); + if (!cachePath.isDirectory()) { + try { + cachePath.mkdirs(); + } catch (Exception e) { + FileLog.e(e); + return null; + } + } + File file = new File(cachePath, fileName); + try (FileOutputStream out = new FileOutputStream(file)) { + bitmap.compress(format, 100, out); + out.close(); + return FileProvider.getUriForFile(ApplicationLoader.applicationContext, BuildConfig.APPLICATION_ID + ".provider", file); + } catch (IOException e) { + FileLog.e(e); + } + return null; + } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java index 7910f61e9..a7a648a4f 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java @@ -16,16 +16,14 @@ public class BuildVars { public static boolean DEBUG_VERSION = false; public static boolean LOGS_ENABLED = false; + public static boolean DEBUG_PRIVATE_VERSION = false; public static boolean USE_CLOUD_STRINGS = true; public static boolean CHECK_UPDATES = true; public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29; - public static int BUILD_VERSION = 2495; - public static String BUILD_VERSION_STRING = "8.3.1"; + public static int BUILD_VERSION = 2522; + public static String BUILD_VERSION_STRING = "8.4.1"; public static int APP_ID = 4; public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103"; - public static String APPCENTER_HASH = "a5b5c4f5-51da-dedc-9918-d9766a22ca7c"; - - public static boolean DEBUG_PRIVATE_VERSION = false; public static String SMS_HASH = isStandaloneApp() ? "w0lkcmTZkKh" : (DEBUG_VERSION ? "O2P2z+/jBpJ" : "oLeq9AcOZkT"); public static String PLAYSTORE_APP_URL = "https://play.google.com/store/apps/details?id=org.telegram.messenger"; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/ForwardingMessagesParams.java b/TMessagesProj/src/main/java/org/telegram/messenger/ForwardingMessagesParams.java index 3bfb40ca8..3bfc46f5f 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/ForwardingMessagesParams.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/ForwardingMessagesParams.java @@ -21,6 +21,7 @@ public class ForwardingMessagesParams { public boolean isSecret; public boolean willSeeSenders; public boolean multiplyUsers; + public boolean hasSpoilers; public ArrayList pollChoosenAnswers = new ArrayList<>(); @@ -29,6 +30,7 @@ public class ForwardingMessagesParams { hasCaption = false; hasSenders = false; isSecret = DialogObject.isEncryptedDialog(newDialogId); + hasSpoilers = false; ArrayList hiddenSendersName = new ArrayList<>(); for (int i = 0; i < messages.size(); i++) { MessageObject messageObject = messages.get(i); @@ -46,6 +48,17 @@ public class ForwardingMessagesParams { message.media = messageObject.messageOwner.media; message.action = messageObject.messageOwner.action; message.edit_date = 0; + if (messageObject.messageOwner.entities != null) { + message.entities.addAll(messageObject.messageOwner.entities); + if (!hasSpoilers) { + for (TLRPC.MessageEntity e : message.entities) { + if (e instanceof TLRPC.TL_messageEntitySpoiler) { + hasSpoilers = true; + break; + } + } + } + } message.out = true; message.unread = false; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/GcmPushListenerService.java b/TMessagesProj/src/main/java/org/telegram/messenger/GcmPushListenerService.java index 73b55a1a5..8fd6623b2 100755 --- a/TMessagesProj/src/main/java/org/telegram/messenger/GcmPushListenerService.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/GcmPushListenerService.java @@ -12,6 +12,9 @@ import android.os.SystemClock; import android.text.TextUtils; import android.util.Base64; +import androidx.collection.LongSparseArray; + +import com.google.android.exoplayer2.util.Log; import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; @@ -27,8 +30,6 @@ import java.util.Locale; import java.util.Map; import java.util.concurrent.CountDownLatch; -import androidx.collection.LongSparseArray; - public class GcmPushListenerService extends FirebaseMessagingService { public static final int NOTIFICATION_ID = 1; @@ -108,6 +109,8 @@ public class GcmPushListenerService extends FirebaseMessagingService { loc_key = ""; } + + JSONObject custom; Object object = json.get("custom"); if (object instanceof JSONObject) { @@ -314,6 +317,11 @@ public class GcmPushListenerService extends FirebaseMessagingService { processNotification = true; } } + + if (loc_key.startsWith("REACT_") || loc_key.startsWith("CHAT_REACT_")) { + processNotification = true; + } + if (processNotification) { long chat_from_id = custom.optLong("chat_from_id", 0); long chat_from_broadcast_id = custom.optLong("chat_from_broadcast_id", 0); @@ -360,662 +368,670 @@ public class GcmPushListenerService extends FirebaseMessagingService { if (BuildVars.LOGS_ENABLED) { FileLog.d("GCM received message notification " + loc_key + " for dialogId = " + dialogId + " mid = " + msg_id); } - switch (loc_key) { - case "MESSAGE_TEXT": - case "CHANNEL_MESSAGE_TEXT": { - messageText = LocaleController.formatString("NotificationMessageText", R.string.NotificationMessageText, args[0], args[1]); - message1 = args[1]; - break; - } - case "MESSAGE_NOTEXT": { - messageText = LocaleController.formatString("NotificationMessageNoText", R.string.NotificationMessageNoText, args[0]); - message1 = LocaleController.getString("Message", R.string.Message); - break; - } - case "MESSAGE_PHOTO": { - messageText = LocaleController.formatString("NotificationMessagePhoto", R.string.NotificationMessagePhoto, args[0]); - message1 = LocaleController.getString("AttachPhoto", R.string.AttachPhoto); - break; - } - case "MESSAGE_PHOTO_SECRET": { - messageText = LocaleController.formatString("NotificationMessageSDPhoto", R.string.NotificationMessageSDPhoto, args[0]); - message1 = LocaleController.getString("AttachDestructingPhoto", R.string.AttachDestructingPhoto); - break; - } - case "MESSAGE_VIDEO": { - messageText = LocaleController.formatString("NotificationMessageVideo", R.string.NotificationMessageVideo, args[0]); - message1 = LocaleController.getString("AttachVideo", R.string.AttachVideo); - break; - } - case "MESSAGE_VIDEO_SECRET": { - messageText = LocaleController.formatString("NotificationMessageSDVideo", R.string.NotificationMessageSDVideo, args[0]); - message1 = LocaleController.getString("AttachDestructingVideo", R.string.AttachDestructingVideo); - break; - } - case "MESSAGE_SCREENSHOT": { - messageText = LocaleController.getString("ActionTakeScreenshoot", R.string.ActionTakeScreenshoot).replace("un1", args[0]); - break; - } - case "MESSAGE_ROUND": { - messageText = LocaleController.formatString("NotificationMessageRound", R.string.NotificationMessageRound, args[0]); - message1 = LocaleController.getString("AttachRound", R.string.AttachRound); - break; - } - case "MESSAGE_DOC": { - messageText = LocaleController.formatString("NotificationMessageDocument", R.string.NotificationMessageDocument, args[0]); - message1 = LocaleController.getString("AttachDocument", R.string.AttachDocument); - break; - } - case "MESSAGE_STICKER": { - if (args.length > 1 && !TextUtils.isEmpty(args[1])) { - messageText = LocaleController.formatString("NotificationMessageStickerEmoji", R.string.NotificationMessageStickerEmoji, args[0], args[1]); - message1 = args[1] + " " + LocaleController.getString("AttachSticker", R.string.AttachSticker); - } else { - messageText = LocaleController.formatString("NotificationMessageSticker", R.string.NotificationMessageSticker, args[0]); - message1 = LocaleController.getString("AttachSticker", R.string.AttachSticker); + if (loc_key.startsWith("REACT_") || loc_key.startsWith("CHAT_REACT_")) { + messageText = getReactedText(loc_key, args); + } else { + switch (loc_key) { + case "MESSAGE_TEXT": + case "CHANNEL_MESSAGE_TEXT": { + messageText = LocaleController.formatString("NotificationMessageText", R.string.NotificationMessageText, args[0], args[1]); + message1 = args[1]; + break; } - break; - } - case "MESSAGE_AUDIO": { - messageText = LocaleController.formatString("NotificationMessageAudio", R.string.NotificationMessageAudio, args[0]); - message1 = LocaleController.getString("AttachAudio", R.string.AttachAudio); - break; - } - case "MESSAGE_CONTACT": { - messageText = LocaleController.formatString("NotificationMessageContact2", R.string.NotificationMessageContact2, args[0], args[1]); - message1 = LocaleController.getString("AttachContact", R.string.AttachContact); - break; - } - case "MESSAGE_QUIZ": { - messageText = LocaleController.formatString("NotificationMessageQuiz2", R.string.NotificationMessageQuiz2, args[0], args[1]); - message1 = LocaleController.getString("QuizPoll", R.string.QuizPoll); - break; - } - case "MESSAGE_POLL": { - messageText = LocaleController.formatString("NotificationMessagePoll2", R.string.NotificationMessagePoll2, args[0], args[1]); - message1 = LocaleController.getString("Poll", R.string.Poll); - break; - } - case "MESSAGE_GEO": { - messageText = LocaleController.formatString("NotificationMessageMap", R.string.NotificationMessageMap, args[0]); - message1 = LocaleController.getString("AttachLocation", R.string.AttachLocation); - break; - } - case "MESSAGE_GEOLIVE": { - messageText = LocaleController.formatString("NotificationMessageLiveLocation", R.string.NotificationMessageLiveLocation, args[0]); - message1 = LocaleController.getString("AttachLiveLocation", R.string.AttachLiveLocation); - break; - } - case "MESSAGE_GIF": { - messageText = LocaleController.formatString("NotificationMessageGif", R.string.NotificationMessageGif, args[0]); - message1 = LocaleController.getString("AttachGif", R.string.AttachGif); - break; - } - case "MESSAGE_GAME": { - messageText = LocaleController.formatString("NotificationMessageGame", R.string.NotificationMessageGame, args[0], args[1]); - message1 = LocaleController.getString("AttachGame", R.string.AttachGame); - break; - } - case "MESSAGE_GAME_SCORE": - case "CHANNEL_MESSAGE_GAME_SCORE":{ - messageText = LocaleController.formatString("NotificationMessageGameScored", R.string.NotificationMessageGameScored, args[0], args[1], args[2]); - break; - } - case "MESSAGE_INVOICE": { - messageText = LocaleController.formatString("NotificationMessageInvoice", R.string.NotificationMessageInvoice, args[0], args[1]); - message1 = LocaleController.getString("PaymentInvoice", R.string.PaymentInvoice); - break; - } - case "MESSAGE_FWDS": { - messageText = LocaleController.formatString("NotificationMessageForwardFew", R.string.NotificationMessageForwardFew, args[0], LocaleController.formatPluralString("messages", Utilities.parseInt(args[1]))); - localMessage = true; - break; - } - case "MESSAGE_PHOTOS": { - messageText = LocaleController.formatString("NotificationMessageFew", R.string.NotificationMessageFew, args[0], LocaleController.formatPluralString("Photos", Utilities.parseInt(args[1]))); - localMessage = true; - break; - } - case "MESSAGE_VIDEOS": { - messageText = LocaleController.formatString("NotificationMessageFew", R.string.NotificationMessageFew, args[0], LocaleController.formatPluralString("Videos", Utilities.parseInt(args[1]))); - localMessage = true; - break; - } - case "MESSAGE_PLAYLIST": { - messageText = LocaleController.formatString("NotificationMessageFew", R.string.NotificationMessageFew, args[0], LocaleController.formatPluralString("MusicFiles", Utilities.parseInt(args[1]))); - localMessage = true; - break; - } - case "MESSAGE_DOCS": { - messageText = LocaleController.formatString("NotificationMessageFew", R.string.NotificationMessageFew, args[0], LocaleController.formatPluralString("Files", Utilities.parseInt(args[1]))); - localMessage = true; - break; - } - case "MESSAGES": { - messageText = LocaleController.formatString("NotificationMessageAlbum", R.string.NotificationMessageAlbum, args[0]); - localMessage = true; - break; - } - case "CHANNEL_MESSAGE_NOTEXT": { - messageText = LocaleController.formatString("ChannelMessageNoText", R.string.ChannelMessageNoText, args[0]); - message1 = LocaleController.getString("Message", R.string.Message); - break; - } - case "CHANNEL_MESSAGE_PHOTO": { - messageText = LocaleController.formatString("ChannelMessagePhoto", R.string.ChannelMessagePhoto, args[0]); - message1 = LocaleController.getString("AttachPhoto", R.string.AttachPhoto); - break; - } - case "CHANNEL_MESSAGE_VIDEO": { - messageText = LocaleController.formatString("ChannelMessageVideo", R.string.ChannelMessageVideo, args[0]); - message1 = LocaleController.getString("AttachVideo", R.string.AttachVideo); - break; - } - case "CHANNEL_MESSAGE_ROUND": { - messageText = LocaleController.formatString("ChannelMessageRound", R.string.ChannelMessageRound, args[0]); - message1 = LocaleController.getString("AttachRound", R.string.AttachRound); - break; - } - case "CHANNEL_MESSAGE_DOC": { - messageText = LocaleController.formatString("ChannelMessageDocument", R.string.ChannelMessageDocument, args[0]); - message1 = LocaleController.getString("AttachDocument", R.string.AttachDocument); - break; - } - case "CHANNEL_MESSAGE_STICKER": { - if (args.length > 1 && !TextUtils.isEmpty(args[1])) { - messageText = LocaleController.formatString("ChannelMessageStickerEmoji", R.string.ChannelMessageStickerEmoji, args[0], args[1]); - message1 = args[1] + " " + LocaleController.getString("AttachSticker", R.string.AttachSticker); - } else { - messageText = LocaleController.formatString("ChannelMessageSticker", R.string.ChannelMessageSticker, args[0]); - message1 = LocaleController.getString("AttachSticker", R.string.AttachSticker); + case "MESSAGE_NOTEXT": { + messageText = LocaleController.formatString("NotificationMessageNoText", R.string.NotificationMessageNoText, args[0]); + message1 = LocaleController.getString("Message", R.string.Message); + break; } - break; - } - case "CHANNEL_MESSAGE_AUDIO": { - messageText = LocaleController.formatString("ChannelMessageAudio", R.string.ChannelMessageAudio, args[0]); - message1 = LocaleController.getString("AttachAudio", R.string.AttachAudio); - break; - } - case "CHANNEL_MESSAGE_CONTACT": { - messageText = LocaleController.formatString("ChannelMessageContact2", R.string.ChannelMessageContact2, args[0], args[1]); - message1 = LocaleController.getString("AttachContact", R.string.AttachContact); - break; - } - case "CHANNEL_MESSAGE_QUIZ": { - messageText = LocaleController.formatString("ChannelMessageQuiz2", R.string.ChannelMessageQuiz2, args[0], args[1]); - message1 = LocaleController.getString("QuizPoll", R.string.QuizPoll); - break; - } - case "CHANNEL_MESSAGE_POLL": { - messageText = LocaleController.formatString("ChannelMessagePoll2", R.string.ChannelMessagePoll2, args[0], args[1]); - message1 = LocaleController.getString("Poll", R.string.Poll); - break; - } - case "CHANNEL_MESSAGE_GEO": { - messageText = LocaleController.formatString("ChannelMessageMap", R.string.ChannelMessageMap, args[0]); - message1 = LocaleController.getString("AttachLocation", R.string.AttachLocation); - break; - } - case "CHANNEL_MESSAGE_GEOLIVE": { - messageText = LocaleController.formatString("ChannelMessageLiveLocation", R.string.ChannelMessageLiveLocation, args[0]); - message1 = LocaleController.getString("AttachLiveLocation", R.string.AttachLiveLocation); - break; - } - case "CHANNEL_MESSAGE_GIF": { - messageText = LocaleController.formatString("ChannelMessageGIF", R.string.ChannelMessageGIF, args[0]); - message1 = LocaleController.getString("AttachGif", R.string.AttachGif); - break; - } - case "CHANNEL_MESSAGE_GAME": { - messageText = LocaleController.formatString("NotificationMessageGame", R.string.NotificationMessageGame, args[0]); - message1 = LocaleController.getString("AttachGame", R.string.AttachGame); - break; - } - case "CHANNEL_MESSAGE_FWDS": { - messageText = LocaleController.formatString("ChannelMessageFew", R.string.ChannelMessageFew, args[0], LocaleController.formatPluralString("ForwardedMessageCount", Utilities.parseInt(args[1])).toLowerCase()); - localMessage = true; - break; - } - case "CHANNEL_MESSAGE_PHOTOS": { - messageText = LocaleController.formatString("ChannelMessageFew", R.string.ChannelMessageFew, args[0], LocaleController.formatPluralString("Photos", Utilities.parseInt(args[1]))); - localMessage = true; - break; - } - case "CHANNEL_MESSAGE_VIDEOS": { - messageText = LocaleController.formatString("ChannelMessageFew", R.string.ChannelMessageFew, args[0], LocaleController.formatPluralString("Videos", Utilities.parseInt(args[1]))); - localMessage = true; - break; - } - case "CHANNEL_MESSAGE_PLAYLIST": { - messageText = LocaleController.formatString("ChannelMessageFew", R.string.ChannelMessageFew, args[0], LocaleController.formatPluralString("MusicFiles", Utilities.parseInt(args[1]))); - localMessage = true; - break; - } - case "CHANNEL_MESSAGE_DOCS": { - messageText = LocaleController.formatString("ChannelMessageFew", R.string.ChannelMessageFew, args[0], LocaleController.formatPluralString("Files", Utilities.parseInt(args[1]))); - localMessage = true; - break; - } - case "CHANNEL_MESSAGES": { - messageText = LocaleController.formatString("ChannelMessageAlbum", R.string.ChannelMessageAlbum, args[0]); - localMessage = true; - break; - } - case "CHAT_MESSAGE_TEXT": { - messageText = LocaleController.formatString("NotificationMessageGroupText", R.string.NotificationMessageGroupText, args[0], args[1], args[2]); - message1 = args[2]; - break; - } - case "CHAT_MESSAGE_NOTEXT": { - messageText = LocaleController.formatString("NotificationMessageGroupNoText", R.string.NotificationMessageGroupNoText, args[0], args[1]); - message1 = LocaleController.getString("Message", R.string.Message); - break; - } - case "CHAT_MESSAGE_PHOTO": { - messageText = LocaleController.formatString("NotificationMessageGroupPhoto", R.string.NotificationMessageGroupPhoto, args[0], args[1]); - message1 = LocaleController.getString("AttachPhoto", R.string.AttachPhoto); - break; - } - case "CHAT_MESSAGE_VIDEO": { - messageText = LocaleController.formatString("NotificationMessageGroupVideo", R.string.NotificationMessageGroupVideo, args[0], args[1]); - message1 = LocaleController.getString("AttachVideo", R.string.AttachVideo); - break; - } - case "CHAT_MESSAGE_ROUND": { - messageText = LocaleController.formatString("NotificationMessageGroupRound", R.string.NotificationMessageGroupRound, args[0], args[1]); - message1 = LocaleController.getString("AttachRound", R.string.AttachRound); - break; - } - case "CHAT_MESSAGE_DOC": { - messageText = LocaleController.formatString("NotificationMessageGroupDocument", R.string.NotificationMessageGroupDocument, args[0], args[1]); - message1 = LocaleController.getString("AttachDocument", R.string.AttachDocument); - break; - } - case "CHAT_MESSAGE_STICKER": { - if (args.length > 2 && !TextUtils.isEmpty(args[2])) { - messageText = LocaleController.formatString("NotificationMessageGroupStickerEmoji", R.string.NotificationMessageGroupStickerEmoji, args[0], args[1], args[2]); - message1 = args[2] + " " + LocaleController.getString("AttachSticker", R.string.AttachSticker); - } else { - messageText = LocaleController.formatString("NotificationMessageGroupSticker", R.string.NotificationMessageGroupSticker, args[0], args[1]); - message1 = args[1] + " " + LocaleController.getString("AttachSticker", R.string.AttachSticker); + case "MESSAGE_PHOTO": { + messageText = LocaleController.formatString("NotificationMessagePhoto", R.string.NotificationMessagePhoto, args[0]); + message1 = LocaleController.getString("AttachPhoto", R.string.AttachPhoto); + break; } - break; - } - case "CHAT_MESSAGE_AUDIO": { - messageText = LocaleController.formatString("NotificationMessageGroupAudio", R.string.NotificationMessageGroupAudio, args[0], args[1]); - message1 = LocaleController.getString("AttachAudio", R.string.AttachAudio); - break; - } - case "CHAT_MESSAGE_CONTACT": { - messageText = LocaleController.formatString("NotificationMessageGroupContact2", R.string.NotificationMessageGroupContact2, args[0], args[1], args[2]); - message1 = LocaleController.getString("AttachContact", R.string.AttachContact); - break; - } - case "CHAT_MESSAGE_QUIZ": { - messageText = LocaleController.formatString("NotificationMessageGroupQuiz2", R.string.NotificationMessageGroupQuiz2, args[0], args[1], args[2]); - message1 = LocaleController.getString("PollQuiz", R.string.PollQuiz); - break; - } - case "CHAT_MESSAGE_POLL": { - messageText = LocaleController.formatString("NotificationMessageGroupPoll2", R.string.NotificationMessageGroupPoll2, args[0], args[1], args[2]); - message1 = LocaleController.getString("Poll", R.string.Poll); - break; - } - case "CHAT_MESSAGE_GEO": { - messageText = LocaleController.formatString("NotificationMessageGroupMap", R.string.NotificationMessageGroupMap, args[0], args[1]); - message1 = LocaleController.getString("AttachLocation", R.string.AttachLocation); - break; - } - case "CHAT_MESSAGE_GEOLIVE": { - messageText = LocaleController.formatString("NotificationMessageGroupLiveLocation", R.string.NotificationMessageGroupLiveLocation, args[0], args[1]); - message1 = LocaleController.getString("AttachLiveLocation", R.string.AttachLiveLocation); - break; - } - case "CHAT_MESSAGE_GIF": { - messageText = LocaleController.formatString("NotificationMessageGroupGif", R.string.NotificationMessageGroupGif, args[0], args[1]); - message1 = LocaleController.getString("AttachGif", R.string.AttachGif); - break; - } - case "CHAT_MESSAGE_GAME": { - messageText = LocaleController.formatString("NotificationMessageGroupGame", R.string.NotificationMessageGroupGame, args[0], args[1], args[2]); - message1 = LocaleController.getString("AttachGame", R.string.AttachGame); - break; - } - case "CHAT_MESSAGE_GAME_SCORE": { - messageText = LocaleController.formatString("NotificationMessageGroupGameScored", R.string.NotificationMessageGroupGameScored, args[0], args[1], args[2], args[3]); - break; - } - case "CHAT_MESSAGE_INVOICE": { - messageText = LocaleController.formatString("NotificationMessageGroupInvoice", R.string.NotificationMessageGroupInvoice, args[0], args[1], args[2]); - message1 = LocaleController.getString("PaymentInvoice", R.string.PaymentInvoice); - break; - } - case "CHAT_CREATED": - case "CHAT_ADD_YOU": { - messageText = LocaleController.formatString("NotificationInvitedToGroup", R.string.NotificationInvitedToGroup, args[0], args[1]); - break; - } - case "CHAT_TITLE_EDITED": { - messageText = LocaleController.formatString("NotificationEditedGroupName", R.string.NotificationEditedGroupName, args[0], args[1]); - break; - } - case "CHAT_PHOTO_EDITED": { - messageText = LocaleController.formatString("NotificationEditedGroupPhoto", R.string.NotificationEditedGroupPhoto, args[0], args[1]); - break; - } - case "CHAT_ADD_MEMBER": { - messageText = LocaleController.formatString("NotificationGroupAddMember", R.string.NotificationGroupAddMember, args[0], args[1], args[2]); - break; - } - case "CHAT_VOICECHAT_START": { - messageText = LocaleController.formatString("NotificationGroupCreatedCall", R.string.NotificationGroupCreatedCall, args[0], args[1]); - break; - } - case "CHAT_VOICECHAT_INVITE": { - messageText = LocaleController.formatString("NotificationGroupInvitedToCall", R.string.NotificationGroupInvitedToCall, args[0], args[1], args[2]); - break; - } - case "CHAT_VOICECHAT_END": { - messageText = LocaleController.formatString("NotificationGroupEndedCall", R.string.NotificationGroupEndedCall, args[0], args[1]); - break; - } - case "CHAT_VOICECHAT_INVITE_YOU": { - messageText = LocaleController.formatString("NotificationGroupInvitedYouToCall", R.string.NotificationGroupInvitedYouToCall, args[0], args[1]); - break; - } - case "CHAT_DELETE_MEMBER": { - messageText = LocaleController.formatString("NotificationGroupKickMember", R.string.NotificationGroupKickMember, args[0], args[1]); - break; - } - case "CHAT_DELETE_YOU": { - messageText = LocaleController.formatString("NotificationGroupKickYou", R.string.NotificationGroupKickYou, args[0], args[1]); - break; - } - case "CHAT_LEFT": { - messageText = LocaleController.formatString("NotificationGroupLeftMember", R.string.NotificationGroupLeftMember, args[0], args[1]); - break; - } - case "CHAT_RETURNED": { - messageText = LocaleController.formatString("NotificationGroupAddSelf", R.string.NotificationGroupAddSelf, args[0], args[1]); - break; - } - case "CHAT_JOINED": { - messageText = LocaleController.formatString("NotificationGroupAddSelfMega", R.string.NotificationGroupAddSelfMega, args[0], args[1]); - break; - } - case "CHAT_REQ_JOINED": { - messageText = LocaleController.formatString("UserAcceptedToGroupPushWithGroup", R.string.UserAcceptedToGroupPushWithGroup, args[0], args[1]); - break; - } - case "CHAT_MESSAGE_FWDS": { - messageText = LocaleController.formatString("NotificationGroupForwardedFew", R.string.NotificationGroupForwardedFew, args[0], args[1], LocaleController.formatPluralString("messages", Utilities.parseInt(args[2]))); - localMessage = true; - break; - } - case "CHAT_MESSAGE_PHOTOS": { - messageText = LocaleController.formatString("NotificationGroupFew", R.string.NotificationGroupFew, args[0], args[1], LocaleController.formatPluralString("Photos", Utilities.parseInt(args[2]))); - localMessage = true; - break; - } - case "CHAT_MESSAGE_VIDEOS": { - messageText = LocaleController.formatString("NotificationGroupFew", R.string.NotificationGroupFew, args[0], args[1], LocaleController.formatPluralString("Videos", Utilities.parseInt(args[2]))); - localMessage = true; - break; - } - case "CHAT_MESSAGE_PLAYLIST": { - messageText = LocaleController.formatString("NotificationGroupFew", R.string.NotificationGroupFew, args[0], args[1], LocaleController.formatPluralString("MusicFiles", Utilities.parseInt(args[2]))); - localMessage = true; - break; - } - case "CHAT_MESSAGE_DOCS": { - messageText = LocaleController.formatString("NotificationGroupFew", R.string.NotificationGroupFew, args[0], args[1], LocaleController.formatPluralString("Files", Utilities.parseInt(args[2]))); - localMessage = true; - break; - } - case "CHAT_MESSAGES": { - messageText = LocaleController.formatString("NotificationGroupAlbum", R.string.NotificationGroupAlbum, args[0], args[1]); - localMessage = true; - break; - } - case "PINNED_TEXT": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedTextUser", R.string.NotificationActionPinnedTextUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedText", R.string.NotificationActionPinnedText, args[0], args[1], args[2]); - } else { - messageText = LocaleController.formatString("NotificationActionPinnedTextChannel", R.string.NotificationActionPinnedTextChannel, args[0], args[1]); - } + case "MESSAGE_PHOTO_SECRET": { + messageText = LocaleController.formatString("NotificationMessageSDPhoto", R.string.NotificationMessageSDPhoto, args[0]); + message1 = LocaleController.getString("AttachDestructingPhoto", R.string.AttachDestructingPhoto); + break; } - break; - } - case "PINNED_NOTEXT": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedNoTextUser", R.string.NotificationActionPinnedNoTextUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedNoText", R.string.NotificationActionPinnedNoText, args[0], args[1]); - } else { - messageText = LocaleController.formatString("NotificationActionPinnedNoTextChannel", R.string.NotificationActionPinnedNoTextChannel, args[0]); - } + case "MESSAGE_VIDEO": { + messageText = LocaleController.formatString("NotificationMessageVideo", R.string.NotificationMessageVideo, args[0]); + message1 = LocaleController.getString("AttachVideo", R.string.AttachVideo); + break; } - break; - } - case "PINNED_PHOTO": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedPhotoUser", R.string.NotificationActionPinnedPhotoUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedPhoto", R.string.NotificationActionPinnedPhoto, args[0], args[1]); - } else { - messageText = LocaleController.formatString("NotificationActionPinnedPhotoChannel", R.string.NotificationActionPinnedPhotoChannel, args[0]); - } + case "MESSAGE_VIDEO_SECRET": { + messageText = LocaleController.formatString("NotificationMessageSDVideo", R.string.NotificationMessageSDVideo, args[0]); + message1 = LocaleController.getString("AttachDestructingVideo", R.string.AttachDestructingVideo); + break; } - break; - } - case "PINNED_VIDEO": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedVideoUser", R.string.NotificationActionPinnedVideoUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedVideo", R.string.NotificationActionPinnedVideo, args[0], args[1]); - } else { - messageText = LocaleController.formatString("NotificationActionPinnedVideoChannel", R.string.NotificationActionPinnedVideoChannel, args[0]); - } + case "MESSAGE_SCREENSHOT": { + messageText = LocaleController.getString("ActionTakeScreenshoot", R.string.ActionTakeScreenshoot).replace("un1", args[0]); + break; } - break; - } - case "PINNED_ROUND": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedRoundUser", R.string.NotificationActionPinnedRoundUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedRound", R.string.NotificationActionPinnedRound, args[0], args[1]); - } else { - messageText = LocaleController.formatString("NotificationActionPinnedRoundChannel", R.string.NotificationActionPinnedRoundChannel, args[0]); - } + case "MESSAGE_ROUND": { + messageText = LocaleController.formatString("NotificationMessageRound", R.string.NotificationMessageRound, args[0]); + message1 = LocaleController.getString("AttachRound", R.string.AttachRound); + break; } - break; - } - case "PINNED_DOC": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedFileUser", R.string.NotificationActionPinnedFileUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedFile", R.string.NotificationActionPinnedFile, args[0], args[1]); - } else { - messageText = LocaleController.formatString("NotificationActionPinnedFileChannel", R.string.NotificationActionPinnedFileChannel, args[0]); - } + case "MESSAGE_DOC": { + messageText = LocaleController.formatString("NotificationMessageDocument", R.string.NotificationMessageDocument, args[0]); + message1 = LocaleController.getString("AttachDocument", R.string.AttachDocument); + break; } - break; - } - case "PINNED_STICKER": { - if (dialogId > 0) { + case "MESSAGE_STICKER": { if (args.length > 1 && !TextUtils.isEmpty(args[1])) { - messageText = LocaleController.formatString("NotificationActionPinnedStickerEmojiUser", R.string.NotificationActionPinnedStickerEmojiUser, args[0], args[1]); + messageText = LocaleController.formatString("NotificationMessageStickerEmoji", R.string.NotificationMessageStickerEmoji, args[0], args[1]); + message1 = args[1] + " " + LocaleController.getString("AttachSticker", R.string.AttachSticker); } else { - messageText = LocaleController.formatString("NotificationActionPinnedStickerUser", R.string.NotificationActionPinnedStickerUser, args[0]); + messageText = LocaleController.formatString("NotificationMessageSticker", R.string.NotificationMessageSticker, args[0]); + message1 = LocaleController.getString("AttachSticker", R.string.AttachSticker); } - } else { - if (isGroup) { - if (args.length > 2 && !TextUtils.isEmpty(args[2])) { - messageText = LocaleController.formatString("NotificationActionPinnedStickerEmoji", R.string.NotificationActionPinnedStickerEmoji, args[0], args[2], args[1]); - } else { - messageText = LocaleController.formatString("NotificationActionPinnedSticker", R.string.NotificationActionPinnedSticker, args[0], args[1]); - } + break; + } + case "MESSAGE_AUDIO": { + messageText = LocaleController.formatString("NotificationMessageAudio", R.string.NotificationMessageAudio, args[0]); + message1 = LocaleController.getString("AttachAudio", R.string.AttachAudio); + break; + } + case "MESSAGE_CONTACT": { + messageText = LocaleController.formatString("NotificationMessageContact2", R.string.NotificationMessageContact2, args[0], args[1]); + message1 = LocaleController.getString("AttachContact", R.string.AttachContact); + break; + } + case "MESSAGE_QUIZ": { + messageText = LocaleController.formatString("NotificationMessageQuiz2", R.string.NotificationMessageQuiz2, args[0], args[1]); + message1 = LocaleController.getString("QuizPoll", R.string.QuizPoll); + break; + } + case "MESSAGE_POLL": { + messageText = LocaleController.formatString("NotificationMessagePoll2", R.string.NotificationMessagePoll2, args[0], args[1]); + message1 = LocaleController.getString("Poll", R.string.Poll); + break; + } + case "MESSAGE_GEO": { + messageText = LocaleController.formatString("NotificationMessageMap", R.string.NotificationMessageMap, args[0]); + message1 = LocaleController.getString("AttachLocation", R.string.AttachLocation); + break; + } + case "MESSAGE_GEOLIVE": { + messageText = LocaleController.formatString("NotificationMessageLiveLocation", R.string.NotificationMessageLiveLocation, args[0]); + message1 = LocaleController.getString("AttachLiveLocation", R.string.AttachLiveLocation); + break; + } + case "MESSAGE_GIF": { + messageText = LocaleController.formatString("NotificationMessageGif", R.string.NotificationMessageGif, args[0]); + message1 = LocaleController.getString("AttachGif", R.string.AttachGif); + break; + } + case "MESSAGE_GAME": { + messageText = LocaleController.formatString("NotificationMessageGame", R.string.NotificationMessageGame, args[0], args[1]); + message1 = LocaleController.getString("AttachGame", R.string.AttachGame); + break; + } + case "MESSAGE_GAME_SCORE": + case "CHANNEL_MESSAGE_GAME_SCORE": { + messageText = LocaleController.formatString("NotificationMessageGameScored", R.string.NotificationMessageGameScored, args[0], args[1], args[2]); + break; + } + case "MESSAGE_INVOICE": { + messageText = LocaleController.formatString("NotificationMessageInvoice", R.string.NotificationMessageInvoice, args[0], args[1]); + message1 = LocaleController.getString("PaymentInvoice", R.string.PaymentInvoice); + break; + } + case "MESSAGE_FWDS": { + messageText = LocaleController.formatString("NotificationMessageForwardFew", R.string.NotificationMessageForwardFew, args[0], LocaleController.formatPluralString("messages", Utilities.parseInt(args[1]))); + localMessage = true; + break; + } + case "MESSAGE_PHOTOS": { + messageText = LocaleController.formatString("NotificationMessageFew", R.string.NotificationMessageFew, args[0], LocaleController.formatPluralString("Photos", Utilities.parseInt(args[1]))); + localMessage = true; + break; + } + case "MESSAGE_VIDEOS": { + messageText = LocaleController.formatString("NotificationMessageFew", R.string.NotificationMessageFew, args[0], LocaleController.formatPluralString("Videos", Utilities.parseInt(args[1]))); + localMessage = true; + break; + } + case "MESSAGE_PLAYLIST": { + messageText = LocaleController.formatString("NotificationMessageFew", R.string.NotificationMessageFew, args[0], LocaleController.formatPluralString("MusicFiles", Utilities.parseInt(args[1]))); + localMessage = true; + break; + } + case "MESSAGE_DOCS": { + messageText = LocaleController.formatString("NotificationMessageFew", R.string.NotificationMessageFew, args[0], LocaleController.formatPluralString("Files", Utilities.parseInt(args[1]))); + localMessage = true; + break; + } + case "MESSAGES": { + messageText = LocaleController.formatString("NotificationMessageAlbum", R.string.NotificationMessageAlbum, args[0]); + localMessage = true; + break; + } + case "CHANNEL_MESSAGE_NOTEXT": { + messageText = LocaleController.formatString("ChannelMessageNoText", R.string.ChannelMessageNoText, args[0]); + message1 = LocaleController.getString("Message", R.string.Message); + break; + } + case "CHANNEL_MESSAGE_PHOTO": { + messageText = LocaleController.formatString("ChannelMessagePhoto", R.string.ChannelMessagePhoto, args[0]); + message1 = LocaleController.getString("AttachPhoto", R.string.AttachPhoto); + break; + } + case "CHANNEL_MESSAGE_VIDEO": { + messageText = LocaleController.formatString("ChannelMessageVideo", R.string.ChannelMessageVideo, args[0]); + message1 = LocaleController.getString("AttachVideo", R.string.AttachVideo); + break; + } + case "CHANNEL_MESSAGE_ROUND": { + messageText = LocaleController.formatString("ChannelMessageRound", R.string.ChannelMessageRound, args[0]); + message1 = LocaleController.getString("AttachRound", R.string.AttachRound); + break; + } + case "CHANNEL_MESSAGE_DOC": { + messageText = LocaleController.formatString("ChannelMessageDocument", R.string.ChannelMessageDocument, args[0]); + message1 = LocaleController.getString("AttachDocument", R.string.AttachDocument); + break; + } + case "CHANNEL_MESSAGE_STICKER": { + if (args.length > 1 && !TextUtils.isEmpty(args[1])) { + messageText = LocaleController.formatString("ChannelMessageStickerEmoji", R.string.ChannelMessageStickerEmoji, args[0], args[1]); + message1 = args[1] + " " + LocaleController.getString("AttachSticker", R.string.AttachSticker); } else { + messageText = LocaleController.formatString("ChannelMessageSticker", R.string.ChannelMessageSticker, args[0]); + message1 = LocaleController.getString("AttachSticker", R.string.AttachSticker); + } + break; + } + case "CHANNEL_MESSAGE_AUDIO": { + messageText = LocaleController.formatString("ChannelMessageAudio", R.string.ChannelMessageAudio, args[0]); + message1 = LocaleController.getString("AttachAudio", R.string.AttachAudio); + break; + } + case "CHANNEL_MESSAGE_CONTACT": { + messageText = LocaleController.formatString("ChannelMessageContact2", R.string.ChannelMessageContact2, args[0], args[1]); + message1 = LocaleController.getString("AttachContact", R.string.AttachContact); + break; + } + case "CHANNEL_MESSAGE_QUIZ": { + messageText = LocaleController.formatString("ChannelMessageQuiz2", R.string.ChannelMessageQuiz2, args[0], args[1]); + message1 = LocaleController.getString("QuizPoll", R.string.QuizPoll); + break; + } + case "CHANNEL_MESSAGE_POLL": { + messageText = LocaleController.formatString("ChannelMessagePoll2", R.string.ChannelMessagePoll2, args[0], args[1]); + message1 = LocaleController.getString("Poll", R.string.Poll); + break; + } + case "CHANNEL_MESSAGE_GEO": { + messageText = LocaleController.formatString("ChannelMessageMap", R.string.ChannelMessageMap, args[0]); + message1 = LocaleController.getString("AttachLocation", R.string.AttachLocation); + break; + } + case "CHANNEL_MESSAGE_GEOLIVE": { + messageText = LocaleController.formatString("ChannelMessageLiveLocation", R.string.ChannelMessageLiveLocation, args[0]); + message1 = LocaleController.getString("AttachLiveLocation", R.string.AttachLiveLocation); + break; + } + case "CHANNEL_MESSAGE_GIF": { + messageText = LocaleController.formatString("ChannelMessageGIF", R.string.ChannelMessageGIF, args[0]); + message1 = LocaleController.getString("AttachGif", R.string.AttachGif); + break; + } + case "CHANNEL_MESSAGE_GAME": { + messageText = LocaleController.formatString("NotificationMessageGame", R.string.NotificationMessageGame, args[0]); + message1 = LocaleController.getString("AttachGame", R.string.AttachGame); + break; + } + case "CHANNEL_MESSAGE_FWDS": { + messageText = LocaleController.formatString("ChannelMessageFew", R.string.ChannelMessageFew, args[0], LocaleController.formatPluralString("ForwardedMessageCount", Utilities.parseInt(args[1])).toLowerCase()); + localMessage = true; + break; + } + case "CHANNEL_MESSAGE_PHOTOS": { + messageText = LocaleController.formatString("ChannelMessageFew", R.string.ChannelMessageFew, args[0], LocaleController.formatPluralString("Photos", Utilities.parseInt(args[1]))); + localMessage = true; + break; + } + case "CHANNEL_MESSAGE_VIDEOS": { + messageText = LocaleController.formatString("ChannelMessageFew", R.string.ChannelMessageFew, args[0], LocaleController.formatPluralString("Videos", Utilities.parseInt(args[1]))); + localMessage = true; + break; + } + case "CHANNEL_MESSAGE_PLAYLIST": { + messageText = LocaleController.formatString("ChannelMessageFew", R.string.ChannelMessageFew, args[0], LocaleController.formatPluralString("MusicFiles", Utilities.parseInt(args[1]))); + localMessage = true; + break; + } + case "CHANNEL_MESSAGE_DOCS": { + messageText = LocaleController.formatString("ChannelMessageFew", R.string.ChannelMessageFew, args[0], LocaleController.formatPluralString("Files", Utilities.parseInt(args[1]))); + localMessage = true; + break; + } + case "CHANNEL_MESSAGES": { + messageText = LocaleController.formatString("ChannelMessageAlbum", R.string.ChannelMessageAlbum, args[0]); + localMessage = true; + break; + } + case "CHAT_MESSAGE_TEXT": { + messageText = LocaleController.formatString("NotificationMessageGroupText", R.string.NotificationMessageGroupText, args[0], args[1], args[2]); + message1 = args[2]; + break; + } + case "CHAT_MESSAGE_NOTEXT": { + messageText = LocaleController.formatString("NotificationMessageGroupNoText", R.string.NotificationMessageGroupNoText, args[0], args[1]); + message1 = LocaleController.getString("Message", R.string.Message); + break; + } + case "CHAT_MESSAGE_PHOTO": { + messageText = LocaleController.formatString("NotificationMessageGroupPhoto", R.string.NotificationMessageGroupPhoto, args[0], args[1]); + message1 = LocaleController.getString("AttachPhoto", R.string.AttachPhoto); + break; + } + case "CHAT_MESSAGE_VIDEO": { + messageText = LocaleController.formatString("NotificationMessageGroupVideo", R.string.NotificationMessageGroupVideo, args[0], args[1]); + message1 = LocaleController.getString("AttachVideo", R.string.AttachVideo); + break; + } + case "CHAT_MESSAGE_ROUND": { + messageText = LocaleController.formatString("NotificationMessageGroupRound", R.string.NotificationMessageGroupRound, args[0], args[1]); + message1 = LocaleController.getString("AttachRound", R.string.AttachRound); + break; + } + case "CHAT_MESSAGE_DOC": { + messageText = LocaleController.formatString("NotificationMessageGroupDocument", R.string.NotificationMessageGroupDocument, args[0], args[1]); + message1 = LocaleController.getString("AttachDocument", R.string.AttachDocument); + break; + } + case "CHAT_MESSAGE_STICKER": { + if (args.length > 2 && !TextUtils.isEmpty(args[2])) { + messageText = LocaleController.formatString("NotificationMessageGroupStickerEmoji", R.string.NotificationMessageGroupStickerEmoji, args[0], args[1], args[2]); + message1 = args[2] + " " + LocaleController.getString("AttachSticker", R.string.AttachSticker); + } else { + messageText = LocaleController.formatString("NotificationMessageGroupSticker", R.string.NotificationMessageGroupSticker, args[0], args[1]); + message1 = args[1] + " " + LocaleController.getString("AttachSticker", R.string.AttachSticker); + } + break; + } + case "CHAT_MESSAGE_AUDIO": { + messageText = LocaleController.formatString("NotificationMessageGroupAudio", R.string.NotificationMessageGroupAudio, args[0], args[1]); + message1 = LocaleController.getString("AttachAudio", R.string.AttachAudio); + break; + } + case "CHAT_MESSAGE_CONTACT": { + messageText = LocaleController.formatString("NotificationMessageGroupContact2", R.string.NotificationMessageGroupContact2, args[0], args[1], args[2]); + message1 = LocaleController.getString("AttachContact", R.string.AttachContact); + break; + } + case "CHAT_MESSAGE_QUIZ": { + messageText = LocaleController.formatString("NotificationMessageGroupQuiz2", R.string.NotificationMessageGroupQuiz2, args[0], args[1], args[2]); + message1 = LocaleController.getString("PollQuiz", R.string.PollQuiz); + break; + } + case "CHAT_MESSAGE_POLL": { + messageText = LocaleController.formatString("NotificationMessageGroupPoll2", R.string.NotificationMessageGroupPoll2, args[0], args[1], args[2]); + message1 = LocaleController.getString("Poll", R.string.Poll); + break; + } + case "CHAT_MESSAGE_GEO": { + messageText = LocaleController.formatString("NotificationMessageGroupMap", R.string.NotificationMessageGroupMap, args[0], args[1]); + message1 = LocaleController.getString("AttachLocation", R.string.AttachLocation); + break; + } + case "CHAT_MESSAGE_GEOLIVE": { + messageText = LocaleController.formatString("NotificationMessageGroupLiveLocation", R.string.NotificationMessageGroupLiveLocation, args[0], args[1]); + message1 = LocaleController.getString("AttachLiveLocation", R.string.AttachLiveLocation); + break; + } + case "CHAT_MESSAGE_GIF": { + messageText = LocaleController.formatString("NotificationMessageGroupGif", R.string.NotificationMessageGroupGif, args[0], args[1]); + message1 = LocaleController.getString("AttachGif", R.string.AttachGif); + break; + } + case "CHAT_MESSAGE_GAME": { + messageText = LocaleController.formatString("NotificationMessageGroupGame", R.string.NotificationMessageGroupGame, args[0], args[1], args[2]); + message1 = LocaleController.getString("AttachGame", R.string.AttachGame); + break; + } + case "CHAT_MESSAGE_GAME_SCORE": { + messageText = LocaleController.formatString("NotificationMessageGroupGameScored", R.string.NotificationMessageGroupGameScored, args[0], args[1], args[2], args[3]); + break; + } + case "CHAT_MESSAGE_INVOICE": { + messageText = LocaleController.formatString("NotificationMessageGroupInvoice", R.string.NotificationMessageGroupInvoice, args[0], args[1], args[2]); + message1 = LocaleController.getString("PaymentInvoice", R.string.PaymentInvoice); + break; + } + case "CHAT_CREATED": + case "CHAT_ADD_YOU": { + messageText = LocaleController.formatString("NotificationInvitedToGroup", R.string.NotificationInvitedToGroup, args[0], args[1]); + break; + } + case "CHAT_TITLE_EDITED": { + messageText = LocaleController.formatString("NotificationEditedGroupName", R.string.NotificationEditedGroupName, args[0], args[1]); + break; + } + case "CHAT_PHOTO_EDITED": { + messageText = LocaleController.formatString("NotificationEditedGroupPhoto", R.string.NotificationEditedGroupPhoto, args[0], args[1]); + break; + } + case "CHAT_ADD_MEMBER": { + messageText = LocaleController.formatString("NotificationGroupAddMember", R.string.NotificationGroupAddMember, args[0], args[1], args[2]); + break; + } + case "CHAT_VOICECHAT_START": { + messageText = LocaleController.formatString("NotificationGroupCreatedCall", R.string.NotificationGroupCreatedCall, args[0], args[1]); + break; + } + case "CHAT_VOICECHAT_INVITE": { + messageText = LocaleController.formatString("NotificationGroupInvitedToCall", R.string.NotificationGroupInvitedToCall, args[0], args[1], args[2]); + break; + } + case "CHAT_VOICECHAT_END": { + messageText = LocaleController.formatString("NotificationGroupEndedCall", R.string.NotificationGroupEndedCall, args[0], args[1]); + break; + } + case "CHAT_VOICECHAT_INVITE_YOU": { + messageText = LocaleController.formatString("NotificationGroupInvitedYouToCall", R.string.NotificationGroupInvitedYouToCall, args[0], args[1]); + break; + } + case "CHAT_DELETE_MEMBER": { + messageText = LocaleController.formatString("NotificationGroupKickMember", R.string.NotificationGroupKickMember, args[0], args[1]); + break; + } + case "CHAT_DELETE_YOU": { + messageText = LocaleController.formatString("NotificationGroupKickYou", R.string.NotificationGroupKickYou, args[0], args[1]); + break; + } + case "CHAT_LEFT": { + messageText = LocaleController.formatString("NotificationGroupLeftMember", R.string.NotificationGroupLeftMember, args[0], args[1]); + break; + } + case "CHAT_RETURNED": { + messageText = LocaleController.formatString("NotificationGroupAddSelf", R.string.NotificationGroupAddSelf, args[0], args[1]); + break; + } + case "CHAT_JOINED": { + messageText = LocaleController.formatString("NotificationGroupAddSelfMega", R.string.NotificationGroupAddSelfMega, args[0], args[1]); + break; + } + case "CHAT_REQ_JOINED": { + messageText = LocaleController.formatString("UserAcceptedToGroupPushWithGroup", R.string.UserAcceptedToGroupPushWithGroup, args[0], args[1]); + break; + } + case "CHAT_MESSAGE_FWDS": { + messageText = LocaleController.formatString("NotificationGroupForwardedFew", R.string.NotificationGroupForwardedFew, args[0], args[1], LocaleController.formatPluralString("messages", Utilities.parseInt(args[2]))); + localMessage = true; + break; + } + case "CHAT_MESSAGE_PHOTOS": { + messageText = LocaleController.formatString("NotificationGroupFew", R.string.NotificationGroupFew, args[0], args[1], LocaleController.formatPluralString("Photos", Utilities.parseInt(args[2]))); + localMessage = true; + break; + } + case "CHAT_MESSAGE_VIDEOS": { + messageText = LocaleController.formatString("NotificationGroupFew", R.string.NotificationGroupFew, args[0], args[1], LocaleController.formatPluralString("Videos", Utilities.parseInt(args[2]))); + localMessage = true; + break; + } + case "CHAT_MESSAGE_PLAYLIST": { + messageText = LocaleController.formatString("NotificationGroupFew", R.string.NotificationGroupFew, args[0], args[1], LocaleController.formatPluralString("MusicFiles", Utilities.parseInt(args[2]))); + localMessage = true; + break; + } + case "CHAT_MESSAGE_DOCS": { + messageText = LocaleController.formatString("NotificationGroupFew", R.string.NotificationGroupFew, args[0], args[1], LocaleController.formatPluralString("Files", Utilities.parseInt(args[2]))); + localMessage = true; + break; + } + case "CHAT_MESSAGES": { + messageText = LocaleController.formatString("NotificationGroupAlbum", R.string.NotificationGroupAlbum, args[0], args[1]); + localMessage = true; + break; + } + case "PINNED_TEXT": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedTextUser", R.string.NotificationActionPinnedTextUser, args[0], args[1]); + } else { + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedText", R.string.NotificationActionPinnedText, args[0], args[1], args[2]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedTextChannel", R.string.NotificationActionPinnedTextChannel, args[0], args[1]); + } + } + break; + } + case "PINNED_NOTEXT": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedNoTextUser", R.string.NotificationActionPinnedNoTextUser, args[0], args[1]); + } else { + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedNoText", R.string.NotificationActionPinnedNoText, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedNoTextChannel", R.string.NotificationActionPinnedNoTextChannel, args[0]); + } + } + break; + } + case "PINNED_PHOTO": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedPhotoUser", R.string.NotificationActionPinnedPhotoUser, args[0], args[1]); + } else { + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedPhoto", R.string.NotificationActionPinnedPhoto, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedPhotoChannel", R.string.NotificationActionPinnedPhotoChannel, args[0]); + } + } + break; + } + case "PINNED_VIDEO": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedVideoUser", R.string.NotificationActionPinnedVideoUser, args[0], args[1]); + } else { + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedVideo", R.string.NotificationActionPinnedVideo, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedVideoChannel", R.string.NotificationActionPinnedVideoChannel, args[0]); + } + } + break; + } + case "PINNED_ROUND": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedRoundUser", R.string.NotificationActionPinnedRoundUser, args[0], args[1]); + } else { + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedRound", R.string.NotificationActionPinnedRound, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedRoundChannel", R.string.NotificationActionPinnedRoundChannel, args[0]); + } + } + break; + } + case "PINNED_DOC": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedFileUser", R.string.NotificationActionPinnedFileUser, args[0], args[1]); + } else { + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedFile", R.string.NotificationActionPinnedFile, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedFileChannel", R.string.NotificationActionPinnedFileChannel, args[0]); + } + } + break; + } + case "PINNED_STICKER": { + if (dialogId > 0) { if (args.length > 1 && !TextUtils.isEmpty(args[1])) { - messageText = LocaleController.formatString("NotificationActionPinnedStickerEmojiChannel", R.string.NotificationActionPinnedStickerEmojiChannel, args[0], args[1]); + messageText = LocaleController.formatString("NotificationActionPinnedStickerEmojiUser", R.string.NotificationActionPinnedStickerEmojiUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedStickerChannel", R.string.NotificationActionPinnedStickerChannel, args[0]); + messageText = LocaleController.formatString("NotificationActionPinnedStickerUser", R.string.NotificationActionPinnedStickerUser, args[0]); + } + } else { + if (isGroup) { + if (args.length > 2 && !TextUtils.isEmpty(args[2])) { + messageText = LocaleController.formatString("NotificationActionPinnedStickerEmoji", R.string.NotificationActionPinnedStickerEmoji, args[0], args[2], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedSticker", R.string.NotificationActionPinnedSticker, args[0], args[1]); + } + } else { + if (args.length > 1 && !TextUtils.isEmpty(args[1])) { + messageText = LocaleController.formatString("NotificationActionPinnedStickerEmojiChannel", R.string.NotificationActionPinnedStickerEmojiChannel, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedStickerChannel", R.string.NotificationActionPinnedStickerChannel, args[0]); + } } } + break; } - break; - } - case "PINNED_AUDIO": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedVoiceUser", R.string.NotificationActionPinnedVoiceUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedVoice", R.string.NotificationActionPinnedVoice, args[0], args[1]); + case "PINNED_AUDIO": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedVoiceUser", R.string.NotificationActionPinnedVoiceUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedVoiceChannel", R.string.NotificationActionPinnedVoiceChannel, args[0]); + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedVoice", R.string.NotificationActionPinnedVoice, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedVoiceChannel", R.string.NotificationActionPinnedVoiceChannel, args[0]); + } } + break; } - break; - } - case "PINNED_CONTACT": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedContactUser", R.string.NotificationActionPinnedContactUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedContact2", R.string.NotificationActionPinnedContact2, args[0], args[2], args[1]); + case "PINNED_CONTACT": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedContactUser", R.string.NotificationActionPinnedContactUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedContactChannel2", R.string.NotificationActionPinnedContactChannel2, args[0], args[1]); + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedContact2", R.string.NotificationActionPinnedContact2, args[0], args[2], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedContactChannel2", R.string.NotificationActionPinnedContactChannel2, args[0], args[1]); + } } + break; } - break; - } - case "PINNED_QUIZ": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedQuizUser", R.string.NotificationActionPinnedQuizUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedQuiz2", R.string.NotificationActionPinnedQuiz2, args[0], args[2], args[1]); + case "PINNED_QUIZ": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedQuizUser", R.string.NotificationActionPinnedQuizUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedQuizChannel2", R.string.NotificationActionPinnedQuizChannel2, args[0], args[1]); + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedQuiz2", R.string.NotificationActionPinnedQuiz2, args[0], args[2], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedQuizChannel2", R.string.NotificationActionPinnedQuizChannel2, args[0], args[1]); + } } + break; } - break; - } - case "PINNED_POLL": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedPollUser", R.string.NotificationActionPinnedPollUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedPoll2", R.string.NotificationActionPinnedPoll2, args[0], args[2], args[1]); + case "PINNED_POLL": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedPollUser", R.string.NotificationActionPinnedPollUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedPollChannel2", R.string.NotificationActionPinnedPollChannel2, args[0], args[1]); + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedPoll2", R.string.NotificationActionPinnedPoll2, args[0], args[2], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedPollChannel2", R.string.NotificationActionPinnedPollChannel2, args[0], args[1]); + } } + break; } - break; - } - case "PINNED_GEO": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedGeoUser", R.string.NotificationActionPinnedGeoUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedGeo", R.string.NotificationActionPinnedGeo, args[0], args[1]); + case "PINNED_GEO": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedGeoUser", R.string.NotificationActionPinnedGeoUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedGeoChannel", R.string.NotificationActionPinnedGeoChannel, args[0]); + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedGeo", R.string.NotificationActionPinnedGeo, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedGeoChannel", R.string.NotificationActionPinnedGeoChannel, args[0]); + } } + break; } - break; - } - case "PINNED_GEOLIVE": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedGeoLiveUser", R.string.NotificationActionPinnedGeoLiveUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedGeoLive", R.string.NotificationActionPinnedGeoLive, args[0], args[1]); + case "PINNED_GEOLIVE": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedGeoLiveUser", R.string.NotificationActionPinnedGeoLiveUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedGeoLiveChannel", R.string.NotificationActionPinnedGeoLiveChannel, args[0]); + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedGeoLive", R.string.NotificationActionPinnedGeoLive, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedGeoLiveChannel", R.string.NotificationActionPinnedGeoLiveChannel, args[0]); + } } + break; } - break; - } - case "PINNED_GAME": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedGameUser", R.string.NotificationActionPinnedGameUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedGame", R.string.NotificationActionPinnedGame, args[0], args[1]); + case "PINNED_GAME": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedGameUser", R.string.NotificationActionPinnedGameUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedGameChannel", R.string.NotificationActionPinnedGameChannel, args[0]); + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedGame", R.string.NotificationActionPinnedGame, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedGameChannel", R.string.NotificationActionPinnedGameChannel, args[0]); + } } + break; } - break; - } - case "PINNED_GAME_SCORE": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedGameScoreUser", R.string.NotificationActionPinnedGameScoreUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedGameScore", R.string.NotificationActionPinnedGameScore, args[0], args[1]); + case "PINNED_GAME_SCORE": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedGameScoreUser", R.string.NotificationActionPinnedGameScoreUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedGameScoreChannel", R.string.NotificationActionPinnedGameScoreChannel, args[0]); + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedGameScore", R.string.NotificationActionPinnedGameScore, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedGameScoreChannel", R.string.NotificationActionPinnedGameScoreChannel, args[0]); + } } + break; } - break; - } - case "PINNED_INVOICE": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedInvoiceUser", R.string.NotificationActionPinnedInvoiceUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedInvoice", R.string.NotificationActionPinnedInvoice, args[0], args[1]); + case "PINNED_INVOICE": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedInvoiceUser", R.string.NotificationActionPinnedInvoiceUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedInvoiceChannel", R.string.NotificationActionPinnedInvoiceChannel, args[0]); + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedInvoice", R.string.NotificationActionPinnedInvoice, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedInvoiceChannel", R.string.NotificationActionPinnedInvoiceChannel, args[0]); + } } + break; } - break; - } - case "PINNED_GIF": { - if (dialogId > 0) { - messageText = LocaleController.formatString("NotificationActionPinnedGifUser", R.string.NotificationActionPinnedGifUser, args[0], args[1]); - } else { - if (isGroup) { - messageText = LocaleController.formatString("NotificationActionPinnedGif", R.string.NotificationActionPinnedGif, args[0], args[1]); + case "PINNED_GIF": { + if (dialogId > 0) { + messageText = LocaleController.formatString("NotificationActionPinnedGifUser", R.string.NotificationActionPinnedGifUser, args[0], args[1]); } else { - messageText = LocaleController.formatString("NotificationActionPinnedGifChannel", R.string.NotificationActionPinnedGifChannel, args[0]); + if (isGroup) { + messageText = LocaleController.formatString("NotificationActionPinnedGif", R.string.NotificationActionPinnedGif, args[0], args[1]); + } else { + messageText = LocaleController.formatString("NotificationActionPinnedGifChannel", R.string.NotificationActionPinnedGifChannel, args[0]); + } } + break; } - break; - } - case "ENCRYPTED_MESSAGE": { - messageText = LocaleController.getString("YouHaveNewMessage", R.string.YouHaveNewMessage); - name = LocaleController.getString("SecretChatName", R.string.SecretChatName); - localMessage = true; - break; - } - case "CONTACT_JOINED": - case "AUTH_UNKNOWN": - case "AUTH_REGION": - case "LOCKED_MESSAGE": - case "ENCRYPTION_REQUEST": - case "ENCRYPTION_ACCEPT": - case "PHONE_CALL_REQUEST": - case "MESSAGE_MUTED": - case "PHONE_CALL_MISSED": { - //ignored - break; - } - default: { - if (BuildVars.LOGS_ENABLED) { - FileLog.w("unhandled loc_key = " + loc_key); + case "ENCRYPTED_MESSAGE": { + messageText = LocaleController.getString("YouHaveNewMessage", R.string.YouHaveNewMessage); + name = LocaleController.getString("SecretChatName", R.string.SecretChatName); + localMessage = true; + break; + } + case "REACT_TEXT": { + break; + } + case "CONTACT_JOINED": + case "AUTH_UNKNOWN": + case "AUTH_REGION": + case "LOCKED_MESSAGE": + case "ENCRYPTION_REQUEST": + case "ENCRYPTION_ACCEPT": + case "PHONE_CALL_REQUEST": + case "MESSAGE_MUTED": + case "PHONE_CALL_MISSED": { + //ignored + break; + } + + default: { + if (BuildVars.LOGS_ENABLED) { + FileLog.w("unhandled loc_key = " + loc_key); + } + break; } - break; } } if (messageText != null) { @@ -1098,6 +1114,108 @@ public class GcmPushListenerService extends FirebaseMessagingService { } } + private String getReactedText(String loc_key, String[] args) { + switch (loc_key) { + case "REACT_TEXT": { + return LocaleController.formatString("PushReactText", R.string.PushReactText, args); + } + case "REACT_NOTEXT": { + return LocaleController.formatString("PushReactNoText", R.string.PushReactNoText, args); + } + case "REACT_PHOTO": { + return LocaleController.formatString("PushReactPhoto", R.string.PushReactPhoto, args); + } + case "REACT_VIDEO": { + return LocaleController.formatString("PushReactVideo", R.string.PushReactVideo, args); + } + case "REACT_ROUND": { + return LocaleController.formatString("PushReactRound", R.string.PushReactRound, args); + } + case "REACT_DOC": { + return LocaleController.formatString("PushReactDoc", R.string.PushReactDoc, args); + } + case "REACT_STICKER": { + return LocaleController.formatString("PushReactSticker", R.string.PushReactSticker, args); + } + case "REACT_AUDIO": { + return LocaleController.formatString("PushReactAudio", R.string.PushReactAudio, args); + } + case "REACT_CONTACT": { + return LocaleController.formatString("PushReactContect", R.string.PushReactContect, args); + } + case "REACT_GEO": { + return LocaleController.formatString("PushReactGeo", R.string.PushReactGeo, args); + } + case "REACT_GEOLIVE": { + return LocaleController.formatString("PushReactGeoLocation", R.string.PushReactGeoLocation, args); + } + case "REACT_POLL": { + return LocaleController.formatString("PushReactPoll", R.string.PushReactPoll, args); + } + case "REACT_QUIZ": { + return LocaleController.formatString("PushReactQuiz", R.string.PushReactQuiz, args); + } + case "REACT_GAME": { + return LocaleController.formatString("PushReactGame", R.string.PushReactGame, args); + } + case "REACT_INVOICE": { + return LocaleController.formatString("PushReactInvoice", R.string.PushReactInvoice, args); + } + case "REACT_GIF": { + return LocaleController.formatString("PushReactGif", R.string.PushReactGif, args); + } + case "CHAT_REACT_TEXT": { + return LocaleController.formatString("PushChatReactText", R.string.PushChatReactText, args); + } + case "CHAT_REACT_NOTEXT": { + return LocaleController.formatString("PushChatReactNotext", R.string.PushChatReactNotext, args); + } + case "CHAT_REACT_PHOTO": { + return LocaleController.formatString("PushChatReactPhoto", R.string.PushChatReactPhoto, args); + } + case "CHAT_REACT_VIDEO": { + return LocaleController.formatString("PushChatReactVideo", R.string.PushChatReactVideo, args); + } + case "CHAT_REACT_ROUND": { + return LocaleController.formatString("PushChatReactRound", R.string.PushChatReactRound, args); + } + case "CHAT_REACT_DOC": { + return LocaleController.formatString("PushChatReactDoc", R.string.PushChatReactDoc, args); + } + case "CHAT_REACT_STICKER": { + return LocaleController.formatString("PushChatReactSticker", R.string.PushChatReactSticker, args); + } + case "CHAT_REACT_AUDIO": { + return LocaleController.formatString("PushChatReactAudio", R.string.PushChatReactAudio, args); + } + case "CHAT_REACT_CONTACT": { + return LocaleController.formatString("PushChatReactContact", R.string.PushChatReactContact, args); + } + case "CHAT_REACT_GEO": { + return LocaleController.formatString("PushChatReactGeo", R.string.PushChatReactGeo, args); + } + case "CHAT_REACT_GEOLIVE": { + return LocaleController.formatString("PushChatReactGeoLive", R.string.PushChatReactGeoLive, args); + } + case "CHAT_REACT_POLL": { + return LocaleController.formatString("PushChatReactPoll", R.string.PushChatReactPoll, args); + } + case "CHAT_REACT_QUIZ": { + return LocaleController.formatString("PushChatReactQuiz", R.string.PushChatReactQuiz, args); + } + case "CHAT_REACT_GAME": { + return LocaleController.formatString("PushChatReactGame", R.string.PushChatReactGame, args); + } + case "CHAT_REACT_INVOICE": { + return LocaleController.formatString("PushChatReactInvoice", R.string.PushChatReactInvoice, args); + } + case "CHAT_REACT_GIF": { + return LocaleController.formatString("PushChatReactGif", R.string.PushChatReactGif, args); + } + } + return null; + } + private void onDecryptError() { for (int a = 0; a < UserConfig.MAX_ACCOUNT_COUNT; a++) { if (UserConfig.getInstance(a).isClientActivated()) { diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/GenericProvider.java b/TMessagesProj/src/main/java/org/telegram/messenger/GenericProvider.java new file mode 100644 index 000000000..2be3b3c1f --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/messenger/GenericProvider.java @@ -0,0 +1,5 @@ +package org.telegram.messenger; + +public interface GenericProvider { + T provide(F obj); +} diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/ImageLoader.java b/TMessagesProj/src/main/java/org/telegram/messenger/ImageLoader.java index 5d041f190..8f0d23579 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/ImageLoader.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/ImageLoader.java @@ -20,8 +20,6 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.graphics.drawable.BitmapDrawable; -import androidx.exifinterface.media.ExifInterface; - import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.AsyncTask; @@ -32,7 +30,7 @@ import android.provider.MediaStore; import android.text.TextUtils; import android.util.SparseArray; -import com.google.android.exoplayer2.util.Log; +import androidx.exifinterface.media.ExifInterface; import org.json.JSONArray; import org.json.JSONObject; @@ -361,7 +359,7 @@ public class ImageLoader { } } } catch (Exception e) { - FileLog.e(e); + FileLog.e(e, false); } httpConnectionStream = httpConnection.getInputStream(); @@ -853,7 +851,7 @@ public class ImageLoader { float h_filter = Float.parseFloat(args[1]); w = Math.min(512, (int) (w_filter * AndroidUtilities.density)); h = Math.min(512, (int) (h_filter * AndroidUtilities.density)); - if (w_filter <= 90 && h_filter <= 90) { + if (w_filter <= 90 && h_filter <= 90 && !cacheImage.filter.contains("nolimit")) { w = Math.min(w, 160); h = Math.min(h, 160); limitFps = true; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/LanguageDetector.java b/TMessagesProj/src/main/java/org/telegram/messenger/LanguageDetector.java new file mode 100644 index 000000000..343175336 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/messenger/LanguageDetector.java @@ -0,0 +1,21 @@ +package org.telegram.messenger; + +public class LanguageDetector { + public interface StringCallback { + void run(String str); + } + public interface ExceptionCallback { + void run(Exception e); + } + + public static boolean hasSupport() { + return true; + } + + public static void detectLanguage(String text, StringCallback onSuccess, ExceptionCallback onFail) { + com.google.mlkit.nl.languageid.LanguageIdentification.getClient() + .identifyLanguage(text) + .addOnSuccessListener(onSuccess::run) + .addOnFailureListener(onFail::run); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java b/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java index 8915fcbe1..44aec5cbf 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java @@ -33,10 +33,12 @@ import java.io.FileWriter; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Calendar; +import java.util.Collection; import java.util.Currency; import java.util.Date; import java.util.HashMap; import java.util.Locale; +import java.util.Map; import java.util.TimeZone; public class LocaleController { @@ -412,6 +414,13 @@ public class LocaleController { } return languagesDict.get(key.toLowerCase().replace("-", "_")); } + public LocaleInfo getLanguageByPlural(String plural) { + Collection values = languagesDict.values(); + for (LocaleInfo l : values) + if (l.pluralLangCode != null && l.pluralLangCode.equals(plural)) + return l; + return null; + } private void addRules(String[] languages, PluralRules rules) { for (String language : languages) { diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java index 0507a0f75..96737c109 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java @@ -3669,52 +3669,83 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener, new Thread(() -> { try { - File dir; - if (isMusic) { - dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC); + if (Build.VERSION.SDK_INT >= 29) { + for (int b = 0, N = messageObjects.size(); b < N; b++) { + MessageObject message = messageObjects.get(b); + String path = message.messageOwner.attachPath; + String name = message.getDocumentName(); + if (path != null && path.length() > 0) { + File temp = new File(path); + if (!temp.exists()) { + path = null; + } + } + if (path == null || path.length() == 0) { + path = FileLoader.getPathToMessage(message.messageOwner).toString(); + } + File sourceFile = new File(path); + if (!sourceFile.exists()) { + waitingForFile = new CountDownLatch(1); + addMessageToLoad(message); + waitingForFile.await(); + } + if (cancelled) { + break; + } + if (sourceFile.exists()) { + saveFileInternal(isMusic ? 3 : 2, sourceFile, name); + } + } } else { - dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); - } - dir.mkdir(); - for (int b = 0, N = messageObjects.size(); b < N; b++) { - MessageObject message = messageObjects.get(b); - String name = message.getDocumentName(); - File destFile = new File(dir, name); - if (destFile.exists()) { - int idx = name.lastIndexOf('.'); - for (int a = 0; a < 10; a++) { - String newName; - if (idx != -1) { - newName = name.substring(0, idx) + "(" + (a + 1) + ")" + name.substring(idx); - } else { - newName = name + "(" + (a + 1) + ")"; - } - destFile = new File(dir, newName); - if (!destFile.exists()) { - break; + File dir; + if (isMusic) { + dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC); + } else { + dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); + } + dir.mkdir(); + for (int b = 0, N = messageObjects.size(); b < N; b++) { + MessageObject message = messageObjects.get(b); + String name = message.getDocumentName(); + File destFile = new File(dir, name); + if (destFile.exists()) { + int idx = name.lastIndexOf('.'); + for (int a = 0; a < 10; a++) { + String newName; + if (idx != -1) { + newName = name.substring(0, idx) + "(" + (a + 1) + ")" + name.substring(idx); + } else { + newName = name + "(" + (a + 1) + ")"; + } + destFile = new File(dir, newName); + if (!destFile.exists()) { + break; + } } } - } - if (!destFile.exists()) { - destFile.createNewFile(); - } - String path = message.messageOwner.attachPath; - if (path != null && path.length() > 0) { - File temp = new File(path); - if (!temp.exists()) { - path = null; + if (!destFile.exists()) { + destFile.createNewFile(); + } + String path = message.messageOwner.attachPath; + if (path != null && path.length() > 0) { + File temp = new File(path); + if (!temp.exists()) { + path = null; + } + } + if (path == null || path.length() == 0) { + path = FileLoader.getPathToMessage(message.messageOwner).toString(); + } + File sourceFile = new File(path); + if (!sourceFile.exists()) { + waitingForFile = new CountDownLatch(1); + addMessageToLoad(message); + waitingForFile.await(); + } + if (sourceFile.exists()) { + copyFile(sourceFile, destFile, message.getMimeType()); } } - if (path == null || path.length() == 0) { - path = FileLoader.getPathToMessage(message.messageOwner).toString(); - } - File sourceFile = new File(path); - if (!sourceFile.exists()) { - waitingForFile = new CountDownLatch(1); - addMessageToLoad(message); - waitingForFile.await(); - } - copyFile(sourceFile, destFile, message.getMimeType()); } checkIfFinished(); } catch (Exception e) { @@ -3927,59 +3958,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener, boolean result = true; if (Build.VERSION.SDK_INT >= 29) { - try { - int selectedType = type; - ContentValues contentValues = new ContentValues(); - String extension = MimeTypeMap.getFileExtensionFromUrl(sourceFile.getAbsolutePath()); - String mimeType = null; - if (extension != null) { - mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); - } - Uri uriToInsert = null; - if ((type == 0 || type == 1) && mimeType != null) { - if (mimeType.startsWith("image")) { - selectedType = 0; - } - if (mimeType.startsWith("video")) { - selectedType = 1; - } - } - if (selectedType == 0) { - uriToInsert = MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); - File dirDest = new File(Environment.DIRECTORY_PICTURES, "Telegram"); - contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, dirDest + File.separator); - contentValues.put(MediaStore.Images.Media.DISPLAY_NAME, AndroidUtilities.generateFileName(0, extension)); - contentValues.put(MediaStore.Images.Media.MIME_TYPE, mimeType); - } else if (selectedType == 1) { - File dirDest = new File(Environment.DIRECTORY_MOVIES, "Telegram"); - contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, dirDest + File.separator); - uriToInsert = MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); - contentValues.put(MediaStore.Video.Media.DISPLAY_NAME, AndroidUtilities.generateFileName(1, extension)); - } else if (selectedType == 2) { - File dirDest = new File(Environment.DIRECTORY_DOWNLOADS, "Telegram"); - contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, dirDest + File.separator); - uriToInsert = MediaStore.Downloads.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); - contentValues.put(MediaStore.Downloads.DISPLAY_NAME, sourceFile.getName()); - } else { - File dirDest = new File(Environment.DIRECTORY_MUSIC, "Telegram"); - contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, dirDest + File.separator); - uriToInsert = MediaStore.Audio.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); - contentValues.put(MediaStore.Audio.Media.DISPLAY_NAME, sourceFile.getName()); - } - - contentValues.put(MediaStore.MediaColumns.MIME_TYPE, mimeType); - - Uri dstUri = context.getContentResolver().insert(uriToInsert, contentValues); - if (dstUri != null) { - FileInputStream fileInputStream = new FileInputStream(sourceFile); - OutputStream outputStream = context.getContentResolver().openOutputStream(dstUri); - AndroidUtilities.copyFile(fileInputStream, outputStream); - fileInputStream.close(); - } - } catch (Exception e) { - FileLog.e(e); - result = false; - } + result = saveFileInternal(type, sourceFile, null); } else { File destFile; if (type == 0) { @@ -4099,6 +4078,75 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener, } } + private static boolean saveFileInternal(int type, File sourceFile, String filename) { + try { + int selectedType = type; + ContentValues contentValues = new ContentValues(); + String extension = MimeTypeMap.getFileExtensionFromUrl(sourceFile.getAbsolutePath()); + String mimeType = null; + if (extension != null) { + mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); + } + Uri uriToInsert = null; + if ((type == 0 || type == 1) && mimeType != null) { + if (mimeType.startsWith("image")) { + selectedType = 0; + } + if (mimeType.startsWith("video")) { + selectedType = 1; + } + } + if (selectedType == 0) { + if (filename == null) { + filename = AndroidUtilities.generateFileName(0, extension); + } + uriToInsert = MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); + File dirDest = new File(Environment.DIRECTORY_PICTURES, "Telegram"); + contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, dirDest + File.separator); + contentValues.put(MediaStore.Images.Media.DISPLAY_NAME, filename); + contentValues.put(MediaStore.Images.Media.MIME_TYPE, mimeType); + } else if (selectedType == 1) { + if (filename == null) { + filename = AndroidUtilities.generateFileName(1, extension); + } + File dirDest = new File(Environment.DIRECTORY_MOVIES, "Telegram"); + contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, dirDest + File.separator); + uriToInsert = MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); + contentValues.put(MediaStore.Video.Media.DISPLAY_NAME, filename); + } else if (selectedType == 2) { + if (filename == null) { + filename = sourceFile.getName(); + } + File dirDest = new File(Environment.DIRECTORY_DOWNLOADS, "Telegram"); + contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, dirDest + File.separator); + uriToInsert = MediaStore.Downloads.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); + contentValues.put(MediaStore.Downloads.DISPLAY_NAME, filename); + } else { + if (filename == null) { + filename = sourceFile.getName(); + } + File dirDest = new File(Environment.DIRECTORY_MUSIC, "Telegram"); + contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, dirDest + File.separator); + uriToInsert = MediaStore.Audio.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); + contentValues.put(MediaStore.Audio.Media.DISPLAY_NAME, filename); + } + + contentValues.put(MediaStore.MediaColumns.MIME_TYPE, mimeType); + + Uri dstUri = ApplicationLoader.applicationContext.getContentResolver().insert(uriToInsert, contentValues); + if (dstUri != null) { + FileInputStream fileInputStream = new FileInputStream(sourceFile); + OutputStream outputStream = ApplicationLoader.applicationContext.getContentResolver().openOutputStream(dstUri); + AndroidUtilities.copyFile(fileInputStream, outputStream); + fileInputStream.close(); + } + return true; + } catch (Exception e) { + FileLog.e(e); + return false; + } + } + public static String getStickerExt(Uri uri) { InputStream inputStream = null; try { diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java index cf06cdaa0..80637b205 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java @@ -10,6 +10,7 @@ package org.telegram.messenger; import android.app.Activity; import android.content.Context; +import android.content.Entity; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.ShortcutManager; @@ -32,9 +33,13 @@ import android.text.Spanned; import android.text.SpannedString; import android.text.TextUtils; import android.text.style.CharacterStyle; -import android.util.Log; import android.util.SparseArray; +import androidx.collection.LongSparseArray; +import androidx.core.content.pm.ShortcutInfoCompat; +import androidx.core.content.pm.ShortcutManagerCompat; +import androidx.core.graphics.drawable.IconCompat; + import org.telegram.SQLite.SQLiteCursor; import org.telegram.SQLite.SQLiteDatabase; import org.telegram.SQLite.SQLiteException; @@ -48,7 +53,6 @@ import org.telegram.tgnet.TLRPC; import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Components.AvatarDrawable; import org.telegram.ui.Components.Bulletin; -import org.telegram.ui.Components.SharedMediaLayout; import org.telegram.ui.Components.StickerSetBulletinLayout; import org.telegram.ui.Components.StickersArchiveAlert; import org.telegram.ui.Components.TextStyleSpan; @@ -58,7 +62,6 @@ import org.telegram.ui.LaunchActivity; import java.io.File; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -69,14 +72,15 @@ import java.util.Map; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; - -import androidx.collection.LongSparseArray; -import androidx.core.content.pm.ShortcutInfoCompat; -import androidx.core.content.pm.ShortcutManagerCompat; -import androidx.core.graphics.drawable.IconCompat; +import java.util.regex.Matcher; +import java.util.regex.Pattern; @SuppressWarnings("unchecked") public class MediaDataController extends BaseController { + private static Pattern BOLD_PATTERN = Pattern.compile("\\*\\*(.+?)\\*\\*"), + ITALIC_PATTERN = Pattern.compile("__(.+?)__"), + SPOILER_PATTERN = Pattern.compile("\\|\\|(.+?)\\|\\|"), + STRIKE_PATTERN = Pattern.compile("~~(.+?)~~"); public static String SHORTCUT_CATEGORY = "org.telegram.messenger.SHORTCUT_SHARE"; @@ -152,6 +156,14 @@ public class MediaDataController extends BaseController { public static final int TYPE_GREETINGS = 3; + private int reactionsUpdateHash; + private List reactionsList = new ArrayList<>(); + private List enabledReactionsList = new ArrayList<>(); + private HashMap reactionsMap = new HashMap<>(); + private String doubleTapReaction; + private boolean isLoadingReactions; + private int reactionsUpdateDate; + private ArrayList[] stickerSets = new ArrayList[]{new ArrayList<>(), new ArrayList<>(), new ArrayList<>(0), new ArrayList<>(), new ArrayList<>()}; private LongSparseArray[] stickersByIds = new LongSparseArray[]{new LongSparseArray<>(), new LongSparseArray<>(), new LongSparseArray<>(), new LongSparseArray<>(), new LongSparseArray<>()}; private LongSparseArray stickerSetsById = new LongSparseArray<>(); @@ -263,6 +275,136 @@ public class MediaDataController extends BaseController { } } + public void checkReactions() { + if (!isLoadingReactions && Math.abs(System.currentTimeMillis() / 1000 - reactionsUpdateDate) >= 60 * 60) { + loadReactions(true, false); + } + } + + public List getReactionsList() { + return reactionsList; + } + + public void loadReactions(boolean cache, boolean force) { + isLoadingReactions = true; + if (cache) { + getMessagesStorage().getStorageQueue().postRunnable(() -> { + SQLiteCursor c = null; + int hash = 0; + int date = 0; + List reactions = null; + try { + c = getMessagesStorage().getDatabase().queryFinalized("SELECT data, hash, date FROM reactions"); + if (c.next()) { + NativeByteBuffer data = c.byteBufferValue(0); + if (data != null) { + int count = data.readInt32(false); + reactions = new ArrayList<>(count); + for (int i = 0; i < count; i++) { + TLRPC.TL_availableReaction react = TLRPC.TL_availableReaction.TLdeserialize(data, data.readInt32(false), true); + reactions.add(react); + } + data.reuse(); + } + hash = c.intValue(1); + date = c.intValue(2); + } + } catch (Exception e) { + FileLog.e(e); + } finally { + if (c != null) { + c.dispose(); + } + } + processLoadedReactions(reactions, hash, date, true); + }); + } else { + TLRPC.TL_messages_getAvailableReactions req = new TLRPC.TL_messages_getAvailableReactions(); + req.hash = force ? 0 : reactionsUpdateHash; + getConnectionsManager().sendRequest(req, (response, error) -> { + int date = (int) (System.currentTimeMillis() / 1000); + if (response instanceof TLRPC.TL_messages_availableReactionsNotModified) { + processLoadedReactions(null, 0, date, false); + } else if (response instanceof TLRPC.TL_messages_availableReactions) { + TLRPC.TL_messages_availableReactions r = (TLRPC.TL_messages_availableReactions) response; + processLoadedReactions(r.reactions, r.hash, date, false); + } + }); + } + } + + private void processLoadedReactions(List reactions, int hash, int date, boolean cache) { + if (reactions != null && date != 0) { + reactionsList.clear(); + reactionsMap.clear(); + enabledReactionsList.clear(); + reactionsList.addAll(reactions); + for (int i = 0; i < reactionsList.size(); i++) { + reactionsList.get(i).positionInList = i; + reactionsMap.put(reactionsList.get(i).reaction, reactionsList.get(i)); + if (!reactionsList.get(i).inactive) { + enabledReactionsList.add(reactionsList.get(i)); + } + } + reactionsUpdateHash = hash; + } + reactionsUpdateDate = date; + if (reactions != null) { + AndroidUtilities.runOnUIThread(() -> { + for (int i = 0; i < reactions.size(); i++) { + ImageReceiver imageReceiver = new ImageReceiver(); + TLRPC.TL_availableReaction reaction = reactions.get(i); + imageReceiver.setImage(ImageLocation.getForDocument(reaction.activate_animation), null, null, null, 0, 1); + imageReceiver.setImage(ImageLocation.getForDocument(reaction.appear_animation), null, null, null, 0, 1); + imageReceiver = new ImageReceiver(); + imageReceiver.setImage(ImageLocation.getForDocument(reaction.static_icon), null, null, null, 0, 1); + } + NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.reactionsDidLoad); + }); + } + + if (!cache) { + putReactionsToCache(reactions, hash, date); + } else if (Math.abs(System.currentTimeMillis() / 1000 - date) >= 60 * 60) { + loadReactions(false, true); + } + } + + private void putReactionsToCache(List reactions, int hash, int date) { + ArrayList reactionsFinal = reactions != null ? new ArrayList<>(reactions) : null; + getMessagesStorage().getStorageQueue().postRunnable(() -> { + try { + if (reactionsFinal != null) { + SQLitePreparedStatement state = getMessagesStorage().getDatabase().executeFast("REPLACE INTO reactions VALUES(?, ?, ?)"); + state.requery(); + int size = 4; // Integer.BYTES + for (int a = 0; a < reactionsFinal.size(); a++) { + size += reactionsFinal.get(a).getObjectSize(); + } + NativeByteBuffer data = new NativeByteBuffer(size); + data.writeInt32(reactionsFinal.size()); + for (int a = 0; a < reactionsFinal.size(); a++) { + reactionsFinal.get(a).serializeToStream(data); + } + state.bindByteBuffer(1, data); + state.bindInteger(2, hash); + state.bindInteger(3, date); + state.step(); + data.reuse(); + state.dispose(); + } else { + SQLitePreparedStatement state = getMessagesStorage().getDatabase().executeFast("UPDATE reactions SET date = ?"); + state.requery(); + state.bindLong(1, date); + state.step(); + state.dispose(); + } + } catch (Exception e) { + FileLog.e(e); + } + }); + } + public void checkFeaturedStickers() { if (!loadingFeaturedStickers && (!featuredStickersLoaded || Math.abs(System.currentTimeMillis() / 1000 - loadFeaturedDate) >= 60 * 60)) { loadFeaturedStickers(true, false); @@ -4324,7 +4466,7 @@ public class MediaDataController extends BaseController { Collections.sort(entities, entityComparator); } - private static boolean checkInclusion(int index, ArrayList entities, boolean end) { + private static boolean checkInclusion(int index, List entities, boolean end) { if (entities == null || entities.isEmpty()) { return false; } @@ -4338,7 +4480,7 @@ public class MediaDataController extends BaseController { return false; } - private static boolean checkIntersection(int start, int end, ArrayList entities) { + private static boolean checkIntersection(int start, int end, List entities) { if (entities == null || entities.isEmpty()) { return false; } @@ -4352,16 +4494,6 @@ public class MediaDataController extends BaseController { return false; } - private static void removeOffsetAfter(int start, int countToRemove, ArrayList entities) { - int count = entities.size(); - for (int a = 0; a < count; a++) { - TLRPC.MessageEntity entity = entities.get(a); - if (entity.offset > start) { - entity.offset -= countToRemove; - } - } - } - public CharSequence substring(CharSequence source, int start, int end) { if (source instanceof SpannableStringBuilder) { return source.subSequence(start, end); @@ -4449,14 +4581,30 @@ public class MediaDataController extends BaseController { } } } - if (span != null && start < end) { - editable.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + if (span != null && start < end && start < editable.length()) { + editable.setSpan(span, start, Math.min(editable.length(), end), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } } catch (Exception e) { FileLog.e(e); } } + public static void addTextStyleRuns(TLRPC.DraftMessage msg, Spannable text) { + addTextStyleRuns(msg.entities, msg.message, text); + } + + public static void addTextStyleRuns(MessageObject msg, Spannable text) { + addTextStyleRuns(msg.messageOwner.entities, msg.messageText, text); + } + + public static void addTextStyleRuns(ArrayList entities, CharSequence messageText, Spannable text) { + for (TextStyleSpan prevSpan : text.getSpans(0, text.length(), TextStyleSpan.class)) + text.removeSpan(prevSpan); + for (TextStyleSpan.TextStyleRun run : MediaDataController.getTextStyleRuns(entities, messageText)) { + MediaDataController.addStyleToText(new TextStyleSpan(run), run.start, run.end, text, true); + } + } + public static ArrayList getTextStyleRuns(ArrayList entities, CharSequence text) { ArrayList runs = new ArrayList<>(); ArrayList entitiesCopy = new ArrayList<>(entities); @@ -4481,7 +4629,9 @@ public class MediaDataController extends BaseController { newRun.start = entity.offset; newRun.end = newRun.start + entity.length; TLRPC.MessageEntity urlEntity = null; - if (entity instanceof TLRPC.TL_messageEntityStrike) { + if (entity instanceof TLRPC.TL_messageEntitySpoiler) { + newRun.flags = TextStyleSpan.FLAG_STYLE_SPOILER; + } else if (entity instanceof TLRPC.TL_messageEntityStrike) { newRun.flags = TextStyleSpan.FLAG_STYLE_STRIKE; } else if (entity instanceof TLRPC.TL_messageEntityUnderline) { newRun.flags = TextStyleSpan.FLAG_STYLE_UNDERLINE; @@ -4572,42 +4722,26 @@ public class MediaDataController extends BaseController { } public void addStyle(int flags, int spanStart, int spanEnd, ArrayList entities) { - if ((flags & TextStyleSpan.FLAG_STYLE_BOLD) != 0) { - TLRPC.MessageEntity entity = new TLRPC.TL_messageEntityBold(); - entity.offset = spanStart; - entity.length = spanEnd - spanStart; - entities.add(entity); - } - if ((flags & TextStyleSpan.FLAG_STYLE_ITALIC) != 0) { - TLRPC.MessageEntity entity = new TLRPC.TL_messageEntityItalic(); - entity.offset = spanStart; - entity.length = spanEnd - spanStart; - entities.add(entity); - } - if ((flags & TextStyleSpan.FLAG_STYLE_MONO) != 0) { - TLRPC.MessageEntity entity = new TLRPC.TL_messageEntityCode(); - entity.offset = spanStart; - entity.length = spanEnd - spanStart; - entities.add(entity); - } - if ((flags & TextStyleSpan.FLAG_STYLE_STRIKE) != 0) { - TLRPC.MessageEntity entity = new TLRPC.TL_messageEntityStrike(); - entity.offset = spanStart; - entity.length = spanEnd - spanStart; - entities.add(entity); - } - if ((flags & TextStyleSpan.FLAG_STYLE_UNDERLINE) != 0) { - TLRPC.MessageEntity entity = new TLRPC.TL_messageEntityUnderline(); - entity.offset = spanStart; - entity.length = spanEnd - spanStart; - entities.add(entity); - } - if ((flags & TextStyleSpan.FLAG_STYLE_QUOTE) != 0) { - TLRPC.MessageEntity entity = new TLRPC.TL_messageEntityBlockquote(); - entity.offset = spanStart; - entity.length = spanEnd - spanStart; - entities.add(entity); - } + if ((flags & TextStyleSpan.FLAG_STYLE_SPOILER) != 0) + entities.add(setEntityStartEnd(new TLRPC.TL_messageEntitySpoiler(), spanStart, spanEnd)); + if ((flags & TextStyleSpan.FLAG_STYLE_BOLD) != 0) + entities.add(setEntityStartEnd(new TLRPC.TL_messageEntityBold(), spanStart, spanEnd)); + if ((flags & TextStyleSpan.FLAG_STYLE_ITALIC) != 0) + entities.add(setEntityStartEnd(new TLRPC.TL_messageEntityItalic(), spanStart, spanEnd)); + if ((flags & TextStyleSpan.FLAG_STYLE_MONO) != 0) + entities.add(setEntityStartEnd(new TLRPC.TL_messageEntityCode(), spanStart, spanEnd)); + if ((flags & TextStyleSpan.FLAG_STYLE_STRIKE) != 0) + entities.add(setEntityStartEnd(new TLRPC.TL_messageEntityStrike(), spanStart, spanEnd)); + if ((flags & TextStyleSpan.FLAG_STYLE_UNDERLINE) != 0) + entities.add(setEntityStartEnd(new TLRPC.TL_messageEntityUnderline(), spanStart, spanEnd)); + if ((flags & TextStyleSpan.FLAG_STYLE_QUOTE) != 0) + entities.add(setEntityStartEnd(new TLRPC.TL_messageEntityBlockquote(), spanStart, spanEnd)); + } + + private TLRPC.MessageEntity setEntityStartEnd(TLRPC.MessageEntity entity, int spanStart, int spanEnd) { + entity.offset = spanStart; + entity.length = spanEnd - spanStart; + return entity; } public ArrayList getEntities(CharSequence[] message, boolean allowStrike) { @@ -4621,9 +4755,6 @@ public class MediaDataController extends BaseController { boolean isPre = false; final String mono = "`"; final String pre = "```"; - final String bold = "**"; - final String italic = "__"; - final String strike = "~~"; while ((index = TextUtils.indexOf(message[0], !isPre ? mono : pre, lastIndex)) != -1) { if (start == -1) { isPre = message[0].length() - index > 2 && message[0].charAt(index + 1) == '`' && message[0].charAt(index + 2) == '`'; @@ -4746,79 +4877,40 @@ public class MediaDataController extends BaseController { } } - int count = allowStrike ? 3 : 2; - for (int c = 0; c < count; c++) { - lastIndex = 0; - start = -1; - String checkString; - char checkChar; - switch (c) { - case 0: - checkString = bold; - checkChar = '*'; - break; - case 1: - checkString = italic; - checkChar = '_'; - break; - case 2: - default: - checkString = strike; - checkChar = '~'; - break; - } - while ((index = TextUtils.indexOf(message[0], checkString, lastIndex)) != -1) { - if (start == -1) { - char prevChar = index == 0 ? ' ' : message[0].charAt(index - 1); - if (!checkInclusion(index, entities, false) && (prevChar == ' ' || prevChar == '\n')) { - start = index; - } - lastIndex = index + 2; - } else { - for (int a = index + 2; a < message[0].length(); a++) { - if (message[0].charAt(a) == checkChar) { - index++; - } else { - break; - } - } - lastIndex = index + 2; - if (checkInclusion(index, entities, false) || checkIntersection(start, index, entities)) { - start = -1; - continue; - } - if (start + 2 != index) { - if (entities == null) { - entities = new ArrayList<>(); - } - try { - message[0] = AndroidUtilities.concat(substring(message[0], 0, start), substring(message[0], start + 2, index), substring(message[0], index + 2, message[0].length())); - } catch (Exception e) { - message[0] = substring(message[0], 0, start).toString() + substring(message[0], start + 2, index).toString() + substring(message[0], index + 2, message[0].length()).toString(); - } - - TLRPC.MessageEntity entity; - if (c == 0) { - entity = new TLRPC.TL_messageEntityBold(); - } else if (c == 1) { - entity = new TLRPC.TL_messageEntityItalic(); - } else { - entity = new TLRPC.TL_messageEntityStrike(); - } - entity.offset = start; - entity.length = index - start - 2; - removeOffsetAfter(entity.offset + entity.length, 4, entities); - entities.add(entity); - lastIndex -= 4; - } - start = -1; - } - } + CharSequence cs = message[0]; + if (entities == null) entities = new ArrayList<>(); + cs = parsePattern(cs, BOLD_PATTERN, entities, obj -> new TLRPC.TL_messageEntityBold()); + cs = parsePattern(cs, ITALIC_PATTERN, entities, obj -> new TLRPC.TL_messageEntityItalic()); + cs = parsePattern(cs, SPOILER_PATTERN, entities, obj -> new TLRPC.TL_messageEntitySpoiler()); + if (allowStrike) { + cs = parsePattern(cs, STRIKE_PATTERN, entities, obj -> new TLRPC.TL_messageEntityStrike()); } + message[0] = cs; return entities; } + private CharSequence parsePattern(CharSequence cs, Pattern pattern, List entities, GenericProvider entityProvider) { + Matcher m = pattern.matcher(cs); + int offset = 0; + while (m.find()) { + if (checkInclusion(m.start(), entities, false) || checkIntersection(m.start(), m.end(), entities)) { + + } + + String gr = m.group(1); + cs = cs.subSequence(0, m.start() - offset) + gr + cs.subSequence(m.end() - offset, cs.length()); + + TLRPC.MessageEntity entity = entityProvider.provide(null); + entity.offset = m.start() + offset; + entity.length = gr.length(); + entities.add(entity); + + offset += m.end() - m.start() - gr.length(); + } + return cs; + } + //---------------- MESSAGES END ---------------- private LongSparseArray draftsFolderIds = new LongSparseArray<>(); @@ -5341,6 +5433,33 @@ public class MediaDataController extends BaseController { }); } + public HashMap getReactionsMap() { + return reactionsMap; + } + + public String getDoubleTapReaction() { + if (doubleTapReaction != null) { + return doubleTapReaction; + } + if (!getReactionsList().isEmpty()) { + String savedReaction = MessagesController.getEmojiSettings(currentAccount).getString("reaction_on_double_tap", null); + if (savedReaction != null && getReactionsMap().get(savedReaction) != null) { + doubleTapReaction = savedReaction; + return doubleTapReaction; + } + return getReactionsList().get(0).reaction; + } + return null; + } + + public void setDoubleTapReaction(String reaction) { + MessagesController.getEmojiSettings(currentAccount).edit().putString("reaction_on_double_tap", reaction).apply(); + doubleTapReaction = reaction; + } + + public List getEnabledReactionsList() { + return enabledReactionsList; + } //---------------- BOT END ---------------- //---------------- EMOJI START ---------------- diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java index 90839e32b..bcc950d7d 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java @@ -10,6 +10,7 @@ package org.telegram.messenger; import android.graphics.Typeface; import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Build; import android.text.Layout; @@ -25,6 +26,8 @@ import android.text.style.URLSpan; import android.text.util.Linkify; import android.util.Base64; +import androidx.collection.LongSparseArray; + import org.telegram.PhoneFormat.PhoneFormat; import org.telegram.messenger.browser.Browser; import org.telegram.tgnet.ConnectionsManager; @@ -33,6 +36,7 @@ import org.telegram.tgnet.TLObject; import org.telegram.tgnet.TLRPC; import org.telegram.ui.ActionBar.Theme; import org.telegram.ui.Cells.ChatMessageCell; +import org.telegram.ui.Components.spoilers.SpoilerEffect; import org.telegram.ui.Components.TextStyleSpan; import org.telegram.ui.Components.TypefaceSpan; import org.telegram.ui.Components.URLSpanBotCommand; @@ -54,10 +58,14 @@ import java.util.Calendar; import java.util.Collections; import java.util.GregorianCalendar; import java.util.HashMap; +import java.util.List; +import java.util.Stack; +import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Matcher; import java.util.regex.Pattern; import androidx.collection.LongSparseArray; +import androidx.core.math.MathUtils; public class MessageObject { @@ -90,6 +98,9 @@ public class MessageObject { public CharSequence caption; public MessageObject replyMessageObject; public int type = 1000; + public boolean reactionsVisibleOnScreen; + public long reactionsLastCheckTime; + public String customName; private int isRoundVideoCached; public long eventId; public int contentType; @@ -123,8 +134,12 @@ public class MessageObject { public boolean isRestrictedMessage; public long loadedFileSize; + public boolean isSpoilersRevealed; public byte[] sponsoredId; public int sponsoredChannelPost; + public TLRPC.ChatInvite sponsoredChatInvite; + public String sponsoredChatInviteHash; + public String botStartParam; public boolean animateComments; @@ -206,11 +221,16 @@ public class MessageObject { " & ", " . " }; + public Drawable customAvatarDrawable; public int getEmojiOnlyCount() { return emojiOnlyCount; } + public boolean shouldDrawReactionsInLayout() { + return getDialogId() < 0; + } + public static class SendAnimationData { public float x; public float y; @@ -347,6 +367,9 @@ public class MessageObject { } public static class TextLayoutBlock { + public final static int FLAG_RTL = 1, FLAG_NOT_RTL = 2; + + public AtomicReference spoilersPatchedTextLayout = new AtomicReference<>(); public StaticLayout textLayout; public float textYOffset; public int charactersOffset; @@ -354,9 +377,10 @@ public class MessageObject { public int height; public int heightByOffset; public byte directionFlags; + public List spoilers = new ArrayList<>(); public boolean isRtl() { - return (directionFlags & 1) != 0 && (directionFlags & 2) == 0; + return (directionFlags & FLAG_RTL) != 0 && (directionFlags & FLAG_NOT_RTL) == 0; } } @@ -818,13 +842,17 @@ public class MessageObject { } public MessageObject findPrimaryMessageObject() { + return findMessageWithFlags(MessageObject.POSITION_FLAG_TOP | MessageObject.POSITION_FLAG_LEFT); + } + + public MessageObject findMessageWithFlags(int flags) { if (!messages.isEmpty() && positions.isEmpty()) { calculate(); } for (int i = 0; i < messages.size(); i++) { MessageObject object = messages.get(i); MessageObject.GroupedMessagePosition position = positions.get(object); - if (position != null && (position.flags & (MessageObject.POSITION_FLAG_TOP | MessageObject.POSITION_FLAG_LEFT)) != 0) { + if (position != null && (position.flags & (flags)) == flags) { return object; } } @@ -1648,12 +1676,16 @@ public class MessageObject { message = new TLRPC.TL_message(); message.out = false; message.unread = false; - message.from_id = new TLRPC.TL_peerUser(); - message.from_id.user_id = event.user_id; message.peer_id = peer_id; message.date = event.date; TLRPC.Message newMessage = ((TLRPC.TL_channelAdminLogEventActionEditMessage) event.action).new_message; TLRPC.Message oldMessage = ((TLRPC.TL_channelAdminLogEventActionEditMessage) event.action).prev_message; + if (newMessage != null && newMessage.from_id != null) { + message.from_id = newMessage.from_id; + } else { + message.from_id = new TLRPC.TL_peerUser(); + message.from_id.user_id = event.user_id; + } if (newMessage.media != null && !(newMessage.media instanceof TLRPC.TL_messageMediaEmpty) && !(newMessage.media instanceof TLRPC.TL_messageMediaWebPage)/* && TextUtils.isEmpty(newMessage.message)*/) { boolean changedCaption; boolean changedMedia; @@ -1860,6 +1892,10 @@ public class MessageObject { } else if (event.action instanceof TLRPC.TL_channelAdminLogEventActionSendMessage) { message = ((TLRPC.TL_channelAdminLogEventActionSendMessage) event.action).message; messageText = replaceWithLink(LocaleController.getString("EventLogSendMessages", R.string.EventLogSendMessages), "un1", fromUser); + } else if (event.action instanceof TLRPC.TL_channelAdminLogEventActionChangeAvailableReactions) { + String oldReactions = TextUtils.join(", ", ((TLRPC.TL_channelAdminLogEventActionChangeAvailableReactions) event.action).prev_value); + String newReactions = TextUtils.join(", ", ((TLRPC.TL_channelAdminLogEventActionChangeAvailableReactions) event.action).new_value); + messageText = replaceWithLink(LocaleController.formatString("ActionReactionsChanged", R.string.ActionReactionsChanged, oldReactions, newReactions), "un1", fromUser); } else { messageText = "unsupported " + event.action; } @@ -2118,7 +2154,8 @@ public class MessageObject { mess = mess.subSequence(0, 20) + "..."; } mess = Emoji.replaceEmoji(mess, Theme.chat_msgTextPaint.getFontMetricsInt(), AndroidUtilities.dp(20), false); - messageText = replaceWithLink(LocaleController.formatString("ActionPinnedText", R.string.ActionPinnedText, mess), "un1", fromUser != null ? fromUser : chat); + MediaDataController.addTextStyleRuns(replyMessageObject, (Spannable) mess); + messageText = replaceWithLink(AndroidUtilities.formatSpannable(LocaleController.getString("ActionPinnedText", R.string.ActionPinnedText), mess), "un1", fromUser != null ? fromUser : chat); } else { messageText = replaceWithLink(LocaleController.getString("ActionPinnedNoText", R.string.ActionPinnedNoText), "un1", fromUser != null ? fromUser : chat); } @@ -4038,7 +4075,8 @@ public class MessageObject { entity instanceof TLRPC.TL_messageEntityPre || entity instanceof TLRPC.TL_messageEntityMentionName || entity instanceof TLRPC.TL_inputMessageEntityMentionName || - entity instanceof TLRPC.TL_messageEntityTextUrl) { + entity instanceof TLRPC.TL_messageEntityTextUrl || + entity instanceof TLRPC.TL_messageEntitySpoiler) { if (spans != null && spans.length > 0) { for (int b = 0; b < spans.length; b++) { if (spans[b] == null) { @@ -4058,7 +4096,9 @@ public class MessageObject { newRun.start = entity.offset; newRun.end = newRun.start + entity.length; TLRPC.MessageEntity urlEntity = null; - if (entity instanceof TLRPC.TL_messageEntityStrike) { + if (entity instanceof TLRPC.TL_messageEntitySpoiler) { + newRun.flags = TextStyleSpan.FLAG_STYLE_SPOILER; + } else if (entity instanceof TLRPC.TL_messageEntityStrike) { newRun.flags = TextStyleSpan.FLAG_STYLE_STRIKE; } else if (entity instanceof TLRPC.TL_messageEntityUnderline) { newRun.flags = TextStyleSpan.FLAG_STYLE_UNDERLINE; @@ -4165,6 +4205,7 @@ public class MessageObject { for (int a = 0; a < count; a++) { TextStyleSpan.TextStyleRun run = runs.get(a); + boolean setRun = false; String url = run.urlEntity != null ? TextUtils.substring(text, run.urlEntity.offset, run.urlEntity.offset + run.urlEntity.length) : null; if (run.urlEntity instanceof TLRPC.TL_messageEntityBotCommand) { spannable.setSpan(new URLSpanBotCommand(url, t, run), run.start, run.end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); @@ -4199,6 +4240,10 @@ public class MessageObject { } else if ((run.flags & TextStyleSpan.FLAG_STYLE_MONO) != 0) { spannable.setSpan(new URLSpanMono(spannable, run.start, run.end, t, run), run.start, run.end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } else { + setRun = true; + spannable.setSpan(new TextStyleSpan(run), run.start, run.end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } + if (!setRun && (run.flags & TextStyleSpan.FLAG_STYLE_SPOILER) != 0) { spannable.setSpan(new TextStyleSpan(run), run.start, run.end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } } @@ -4389,6 +4434,7 @@ public class MessageObject { block.textYOffset = 0; block.charactersOffset = 0; block.charactersEnd = textLayout.getText().length(); + if (emojiOnlyCount != 0) { switch (emojiOnlyCount) { case 1: @@ -4416,15 +4462,17 @@ public class MessageObject { block.charactersOffset = startCharacter; block.charactersEnd = endCharacter; try { + SpannableStringBuilder sb = SpannableStringBuilder.valueOf(messageText.subSequence(startCharacter, endCharacter)); if (hasUrls && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - block.textLayout = StaticLayout.Builder.obtain(messageText, startCharacter, endCharacter, paint, maxWidth + AndroidUtilities.dp(2)) + block.textLayout = StaticLayout.Builder.obtain(sb, 0, sb.length(), paint, maxWidth + AndroidUtilities.dp(2)) .setBreakStrategy(StaticLayout.BREAK_STRATEGY_HIGH_QUALITY) .setHyphenationFrequency(StaticLayout.HYPHENATION_FREQUENCY_NONE) .setAlignment(Layout.Alignment.ALIGN_NORMAL) .build(); } else { - block.textLayout = new StaticLayout(messageText, startCharacter, endCharacter, paint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); + block.textLayout = new StaticLayout(sb, 0, sb.length(), paint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); } + block.textYOffset = textLayout.getLineTop(linesOffset); if (a != 0) { block.height = (int) (block.textYOffset - prevOffset); @@ -4444,6 +4492,10 @@ public class MessageObject { } } } + block.spoilers.clear(); + if (!isSpoilersRevealed) { + SpoilerEffect.addSpoilers(null, block.textLayout, null, block.spoilers); + } textLayoutBlocks.add(block); @@ -4507,10 +4559,10 @@ public class MessageObject { if (lineLeft > 0) { textXOffset = Math.min(textXOffset, lineLeft); - block.directionFlags |= 1; + block.directionFlags |= TextLayoutBlock.FLAG_RTL; hasRtl = true; } else { - block.directionFlags |= 2; + block.directionFlags |= TextLayoutBlock.FLAG_NOT_RTL; } try { @@ -4542,9 +4594,9 @@ public class MessageObject { linesMaxWidth += lastLeft; } hasRtl = blocksCount != 1; - block.directionFlags |= 1; + block.directionFlags |= TextLayoutBlock.FLAG_RTL; } else { - block.directionFlags |= 2; + block.directionFlags |= TextLayoutBlock.FLAG_NOT_RTL; } textWidth = Math.max(textWidth, Math.min(maxWidth, linesMaxWidth)); @@ -4578,10 +4630,16 @@ public class MessageObject { } public boolean needDrawAvatar() { + if (customAvatarDrawable != null) { + return true; + } return !isSponsored() && (isFromUser() || isFromGroup() || eventId != 0 || messageOwner.fwd_from != null && messageOwner.fwd_from.saved_from_peer != null); } private boolean needDrawAvatarInternal() { + if (customAvatarDrawable != null) { + return true; + } return !isSponsored() && (isFromChat() && isFromUser() || isFromGroup() || eventId != 0 || messageOwner.fwd_from != null && messageOwner.fwd_from.saved_from_peer != null); } @@ -5829,7 +5887,7 @@ public class MessageObject { if (message.out && message instanceof TLRPC.TL_messageService) { return message.id != 1 && ChatObject.canUserDoAdminAction(chat, ChatObject.ACTION_DELETE_MESSAGES); } - return inScheduleMode || message.id != 1 && (chat.creator || chat.admin_rights != null && (chat.admin_rights.delete_messages || message.out && (chat.megagroup || chat.admin_rights.post_messages)) || chat.megagroup && message.out && message.from_id instanceof TLRPC.TL_peerUser); + return inScheduleMode || message.id != 1 && (chat.creator || chat.admin_rights != null && (chat.admin_rights.delete_messages || message.out && (chat.megagroup || chat.admin_rights.post_messages)) || chat.megagroup && message.out); } return inScheduleMode || isOut(message) || !ChatObject.isChannel(chat); } @@ -6181,4 +6239,75 @@ public class MessageObject { public boolean equals(MessageObject obj) { return getId() == obj.getId() && getDialogId() == obj.getDialogId(); } + + public boolean isReactionsAvailable() { + return !isEditing() && !isSponsored() && isSent() && messageOwner.action == null; + } + + public boolean selectReaction(String reaction, boolean fromDoubleTap) { + if (messageOwner.reactions == null) { + messageOwner.reactions = new TLRPC.TL_messageReactions(); + messageOwner.reactions.can_see_list = isFromGroup() || isFromUser(); + } + + TLRPC.TL_reactionCount choosenReaction = null; + TLRPC.TL_reactionCount newReaction = null; + for (int i = 0; i < messageOwner.reactions.results.size(); i++) { + if (messageOwner.reactions.results.get(i).chosen) { + choosenReaction = messageOwner.reactions.results.get(i); + } + if (messageOwner.reactions.results.get(i).reaction.equals(reaction)) { + newReaction = messageOwner.reactions.results.get(i); + } + } + + if (choosenReaction != null && (choosenReaction == newReaction || fromDoubleTap)) { + choosenReaction.chosen = false; + choosenReaction.count--; + if (choosenReaction.count <= 0) { + messageOwner.reactions.results.remove(choosenReaction); + } + if (messageOwner.reactions.can_see_list) { + for (int i = 0; i < messageOwner.reactions.recent_reactons.size(); i++) { + if (messageOwner.reactions.recent_reactons.get(i).user_id == UserConfig.getInstance(currentAccount).getClientUserId()) { + messageOwner.reactions.recent_reactons.remove(i); + i--; + } + } + } + return false; + } + + if (choosenReaction != null) { + choosenReaction.chosen = false; + choosenReaction.count--; + if (choosenReaction.count <= 0) { + messageOwner.reactions.results.remove(choosenReaction); + } + if (messageOwner.reactions.can_see_list) { + for (int i = 0; i < messageOwner.reactions.recent_reactons.size(); i++) { + if (messageOwner.reactions.recent_reactons.get(i).user_id == UserConfig.getInstance(currentAccount).getClientUserId()) { + messageOwner.reactions.recent_reactons.remove(i); + i--; + } + } + } + } + if (newReaction == null) { + newReaction = new TLRPC.TL_reactionCount(); + newReaction.reaction = reaction; + messageOwner.reactions.results.add(newReaction); + } + + newReaction.chosen = true; + newReaction.count++; + + if (messageOwner.reactions.can_see_list) { + TLRPC.TL_messageUserReaction action = new TLRPC.TL_messageUserReaction(); + messageOwner.reactions.recent_reactons.add(0, action); + action.user_id = UserConfig.getInstance(currentAccount).getClientUserId(); + action.reaction = reaction; + } + return true; + } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index 457b38b2d..7ffc00709 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -42,27 +42,26 @@ import org.telegram.tgnet.TLObject; import org.telegram.tgnet.TLRPC; import org.telegram.ui.ActionBar.AlertDialog; import org.telegram.ui.ActionBar.BaseFragment; -import org.telegram.ui.ActionBar.EmojiThemes; import org.telegram.ui.ActionBar.Theme; import org.telegram.ui.ChatActivity; import org.telegram.ui.Components.AlertsCreator; import org.telegram.ui.Components.BulletinFactory; import org.telegram.ui.Components.JoinCallAlert; import org.telegram.ui.Components.MotionBackgroundDrawable; +import org.telegram.ui.Components.SwipeGestureSettingsView; import org.telegram.ui.DialogsActivity; import org.telegram.ui.EditWidgetActivity; import org.telegram.ui.LaunchActivity; import org.telegram.ui.ProfileActivity; -import org.telegram.ui.Components.SwipeGestureSettingsView; import java.io.File; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; @@ -137,6 +136,10 @@ public class MessagesController extends BaseController implements NotificationCe private int pollsToCheckSize; private long lastViewsCheckTime; + private LongSparseArray> reactionsToCheck = new LongSparseArray<>(); + private long lastReactionsCheckTime; + private LongSparseArray> reactionsTempDialogs = new LongSparseArray<>(); + public ArrayList dialogFilters = new ArrayList<>(); public SparseArray dialogFiltersById = new SparseArray<>(); private boolean loadingSuggestedFilters; @@ -285,6 +288,8 @@ public class MessagesController extends BaseController implements NotificationCe public int mapProvider; public int availableMapProviders; public int updateCheckDelay; + public int chatReadMarkSizeThreshold; + public int chatReadMarkExpirePeriod; public String mapKey; public int maxMessageLength; public int maxCaptionLength; @@ -783,6 +788,8 @@ public class MessagesController extends BaseController implements NotificationCe showFiltersTooltip = mainPreferences.getBoolean("showFiltersTooltip", false); autoarchiveAvailable = mainPreferences.getBoolean("autoarchiveAvailable", false); groipCallVideoMaxParticipants = mainPreferences.getInt("groipCallVideoMaxParticipants", 30); + chatReadMarkSizeThreshold = mainPreferences.getInt("chatReadMarkSizeThreshold", 50); + chatReadMarkExpirePeriod = mainPreferences.getInt("chatReadMarkExpirePeriod", 7 * 86400); suggestStickersApiOnly = mainPreferences.getBoolean("suggestStickersApiOnly", false); roundVideoSize = mainPreferences.getInt("roundVideoSize", 384); roundVideoBitrate = mainPreferences.getInt("roundVideoBitrate", 1000); @@ -1129,7 +1136,6 @@ public class MessagesController extends BaseController implements NotificationCe getMessagesStorage().putDialogs(pinnedRemoteDialogs, 0); } - AndroidUtilities.runOnUIThread(() -> { if (remote != 2) { dialogFilters = filters; @@ -1626,6 +1632,28 @@ public class MessagesController extends BaseController implements NotificationCe } break; } + case "chat_read_mark_size_threshold": { + if (value.value instanceof TLRPC.TL_jsonNumber) { + TLRPC.TL_jsonNumber number = (TLRPC.TL_jsonNumber) value.value; + if (number.value != chatReadMarkSizeThreshold) { + chatReadMarkSizeThreshold = (int) number.value; + editor.putInt("chatReadMarkSizeThreshold", chatReadMarkSizeThreshold); + changed = true; + } + } + break; + } + case "chat_read_mark_expire_period": { + if (value.value instanceof TLRPC.TL_jsonNumber) { + TLRPC.TL_jsonNumber number = (TLRPC.TL_jsonNumber) value.value; + if (number.value != chatReadMarkExpirePeriod) { + chatReadMarkExpirePeriod = (int) number.value; + editor.putInt("chatReadMarkExpirePeriod", chatReadMarkExpirePeriod); + changed = true; + } + } + break; + } case "inapp_update_check_delay": { if (value.value instanceof TLRPC.TL_jsonNumber) { TLRPC.TL_jsonNumber number = (TLRPC.TL_jsonNumber) value.value; @@ -2582,6 +2610,7 @@ public class MessagesController extends BaseController implements NotificationCe channelViewsToSend.clear(); pollsToCheck.clear(); pollsToCheckSize = 0; + reactionsToCheck.clear(); dialogsServerOnly.clear(); dialogsForward.clear(); allDialogs.clear(); @@ -2813,6 +2842,12 @@ public class MessagesController extends BaseController implements NotificationCe object.pollVisibleOnScreen = false; } } + array = reactionsToCheck.get(dialogId); + if (array != null) { + for (int i = 0; i < array.size(); i++) { + array.valueAt(i).reactionsVisibleOnScreen = false; + } + } } } Utilities.stageQueue.postRunnable(() -> { @@ -5364,6 +5399,57 @@ public class MessagesController extends BaseController implements NotificationCe } } int currentServerTime = getConnectionsManager().getCurrentTime(); + if (Math.abs(System.currentTimeMillis() - lastReactionsCheckTime) >= 15000) { + lastReactionsCheckTime = System.currentTimeMillis(); + if (reactionsToCheck.size() > 0) { + AndroidUtilities.runOnUIThread(() -> { + long time = SystemClock.elapsedRealtime(); + for (int a = 0, N = reactionsToCheck.size(); a < N; a++) { + SparseArray array = reactionsToCheck.valueAt(a); + if (array == null) { + continue; + } + reactionsTempDialogs.clear(); + for (int b = 0, N2 = array.size(); b < N2; b++) { + MessageObject messageObject = array.valueAt(b); + List ids = reactionsTempDialogs.get(messageObject.getDialogId()); + if (ids == null) { + reactionsTempDialogs.put(messageObject.getDialogId(), ids = new ArrayList<>()); + } + ids.add(messageObject.getId()); + + int timeout = 15000; + if (Math.abs(time - messageObject.reactionsLastCheckTime) < timeout) { + if (!messageObject.reactionsVisibleOnScreen) { + array.remove(messageObject.getId()); + N2--; + b--; + } + } else { + messageObject.reactionsLastCheckTime = time; + } + } + if (array.size() == 0) { + reactionsToCheck.remove(reactionsToCheck.keyAt(a)); + N--; + a--; + } + } + + for (int i = 0; i < reactionsTempDialogs.size(); i++) { + TLRPC.TL_messages_getMessagesReactions req = new TLRPC.TL_messages_getMessagesReactions(); + req.peer = getInputPeer(reactionsTempDialogs.keyAt(i)); + req.id.addAll(reactionsTempDialogs.valueAt(i)); + getConnectionsManager().sendRequest(req, (response, error) -> { + if (error == null) { + TLRPC.Updates updates = (TLRPC.Updates) response; + processUpdates(updates, false); + } + }); + } + }); + } + } if (Math.abs(System.currentTimeMillis() - lastViewsCheckTime) >= 5000) { lastViewsCheckTime = System.currentTimeMillis(); if (channelViewsToSend.size() != 0) { @@ -8521,6 +8607,28 @@ public class MessagesController extends BaseController implements NotificationCe }); } + public void addToReactionsQueue(long dialogId, ArrayList visibleObjects) { + SparseArray array = reactionsToCheck.get(dialogId); + if (array == null) { + reactionsToCheck.put(dialogId, array = new SparseArray<>()); + } + for (int a = 0, N = array.size(); a < N; a++) { + MessageObject object = array.valueAt(a); + object.reactionsVisibleOnScreen = false; + } + int time = getConnectionsManager().getCurrentTime(); + for (int a = 0, N = visibleObjects.size(); a < N; a++) { + MessageObject messageObject = visibleObjects.get(a); + int id = messageObject.getId(); + MessageObject object = array.get(id); + if (object != null) { + object.reactionsVisibleOnScreen = true; + } else { + array.put(id, messageObject); + } + } + } + public void addToPollsQueue(long dialogId, ArrayList visibleObjects) { SparseArray array = pollsToCheck.get(dialogId); if (array == null) { @@ -13987,6 +14095,8 @@ public class MessagesController extends BaseController implements NotificationCe messageObject.sponsoredId = sponsoredMessage.random_id; messageObject.botStartParam = sponsoredMessage.start_param; messageObject.sponsoredChannelPost = sponsoredMessage.channel_post; + messageObject.sponsoredChatInvite = sponsoredMessage.chat_invite; + messageObject.sponsoredChatInviteHash = sponsoredMessage.chat_invite_hash; result.add(messageObject); } } @@ -14848,6 +14958,23 @@ public class MessagesController extends BaseController implements NotificationCe }); } + public void setChatReactions(long chatId, List reactions) { + TLRPC.TL_messages_setChatAvailableReactions req = new TLRPC.TL_messages_setChatAvailableReactions(); + req.peer = getInputPeer(-chatId); + req.available_reactions.addAll(reactions); + getConnectionsManager().sendRequest(req, (response, error) -> { + if (response != null) { + processUpdates((TLRPC.Updates) response, false); + TLRPC.ChatFull full = getChatFull(chatId); + if (full != null) { + full.available_reactions = new ArrayList<>(reactions); + getMessagesStorage().updateChatInfo(full, false); + } + AndroidUtilities.runOnUIThread(() -> getNotificationCenter().postNotificationName(NotificationCenter.chatAvailableReactionsUpdated, chatId)); + } + }); + } + public interface MessagesLoadedCallback { void onMessagesLoaded(boolean fromCache); diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java index 80294eb4d..69a0d5484 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java @@ -19,6 +19,9 @@ import android.util.Pair; import android.util.SparseArray; import android.util.SparseIntArray; +import androidx.annotation.UiThread; +import androidx.collection.LongSparseArray; + import org.telegram.PhoneFormat.PhoneFormat; import org.telegram.SQLite.SQLiteCursor; import org.telegram.SQLite.SQLiteDatabase; @@ -45,9 +48,6 @@ import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicLong; -import androidx.annotation.UiThread; -import androidx.collection.LongSparseArray; - public class MessagesStorage extends BaseController { public ArrayList getCachedMessagesInRange(long dialogId, int minDate, int maxDate) { @@ -117,7 +117,7 @@ public class MessagesStorage extends BaseController { private CountDownLatch openSync = new CountDownLatch(1); private static volatile MessagesStorage[] Instance = new MessagesStorage[UserConfig.MAX_ACCOUNT_COUNT]; - private final static int LAST_DB_VERSION = 86; + private final static int LAST_DB_VERSION = 87; private boolean databaseMigrationInProgress; public static MessagesStorage getInstance(int num) { @@ -422,6 +422,7 @@ public class MessagesStorage extends BaseController { database.executeFast("CREATE TABLE polls_v2(mid INTEGER, uid INTEGER, id INTEGER, PRIMARY KEY (mid, uid));").stepThis().dispose(); database.executeFast("CREATE INDEX IF NOT EXISTS polls_id_v2 ON polls_v2(id);").stepThis().dispose(); + database.executeFast("CREATE TABLE reactions(data BLOB, hash INTEGER, date INTEGER);").stepThis().dispose(); //version database.executeFast("PRAGMA user_version = " + LAST_DB_VERSION).stepThis().dispose(); } else { @@ -1549,6 +1550,12 @@ public class MessagesStorage extends BaseController { version = 86; } + if (version == 86) { + database.executeFast("CREATE TABLE IF NOT EXISTS reactions(data BLOB, hash INTEGER, date INTEGER);").stepThis().dispose(); + database.executeFast("PRAGMA user_version = 87").stepThis().dispose(); + version = 87; + } + FileLog.d("MessagesStorage db migration finished"); AndroidUtilities.runOnUIThread(() -> { databaseMigrationInProgress = false; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/NotificationCenter.java b/TMessagesProj/src/main/java/org/telegram/messenger/NotificationCenter.java index a9b64e0ea..404148a67 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/NotificationCenter.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/NotificationCenter.java @@ -8,12 +8,10 @@ package org.telegram.messenger; -import androidx.annotation.UiThread; - import android.os.SystemClock; import android.util.SparseArray; -import com.google.android.exoplayer2.util.Log; +import androidx.annotation.UiThread; import java.util.ArrayList; import java.util.HashMap; @@ -111,6 +109,8 @@ public class NotificationCenter { public static final int newPeopleNearbyAvailable = totalEvents++; public static final int stopAllHeavyOperations = totalEvents++; public static final int startAllHeavyOperations = totalEvents++; + public static final int stopSpoilers = totalEvents++; + public static final int startSpoilers = totalEvents++; public static final int sendingMessagesChanged = totalEvents++; public static final int didUpdateReactions = totalEvents++; public static final int didVerifyMessagesStickers = totalEvents++; @@ -228,6 +228,8 @@ public class NotificationCenter { public static final int onDatabaseMigration = totalEvents++; public static final int onEmojiInteractionsReceived = totalEvents++; public static final int emojiPreviewThemesChanged = totalEvents++; + public static final int reactionsDidLoad = totalEvents++; + public static final int chatAvailableReactionsUpdated = totalEvents++; private SparseArray> observers = new SparseArray<>(); private SparseArray> removeAfterBroadcast = new SparseArray<>(); diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java b/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java index 0f87754db..86c714745 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java @@ -1317,7 +1317,7 @@ public class NotificationsController extends BaseController { } } } - return messageObject.messageOwner.message; + return replaceSpoilers(messageObject); } long selfUsedId = getUserConfig().getClientUserId(); if (fromId == 0) { @@ -1843,6 +1843,27 @@ public class NotificationsController extends BaseController { return null; } + char[] spoilerChars = new char[] { + '⠌', '⡢', '⢑','⠨', + }; + + private String replaceSpoilers(MessageObject messageObject) { + String text = messageObject.messageOwner.message; + if (text == null || messageObject == null || messageObject.messageOwner == null || messageObject.messageOwner.entities == null) { + return null; + } + StringBuilder stringBuilder = new StringBuilder(text); + for (int i = 0; i < messageObject.messageOwner.entities.size(); i++) { + if (messageObject.messageOwner.entities.get(i) instanceof TLRPC.TL_messageEntitySpoiler) { + TLRPC.TL_messageEntitySpoiler spoiler = (TLRPC.TL_messageEntitySpoiler) messageObject.messageOwner.entities.get(i); + for (int j = 0; j < spoiler.length; j++) { + stringBuilder.setCharAt(spoiler.offset + j, spoilerChars[j % spoilerChars.length]); + } + } + } + return stringBuilder.toString(); + } + private String getStringForMessage(MessageObject messageObject, boolean shortMessage, boolean[] text, boolean[] preview) { if (AndroidUtilities.needShowPasscode() || SharedConfig.isWaitingForPasscodeEnter) { return LocaleController.getString("YouHaveNewMessage", R.string.YouHaveNewMessage); diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java b/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java index be0277a12..5f592a475 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java @@ -1462,7 +1462,8 @@ public class SendMessagesHelper extends BaseController implements NotificationCe entity instanceof TLRPC.TL_messageEntityItalic || entity instanceof TLRPC.TL_messageEntityPre || entity instanceof TLRPC.TL_messageEntityCode || - entity instanceof TLRPC.TL_messageEntityTextUrl) { + entity instanceof TLRPC.TL_messageEntityTextUrl || + entity instanceof TLRPC.TL_messageEntitySpoiler) { entities.add(entity); } } @@ -2657,7 +2658,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe return voteSendTime.get(pollId, 0L); } - public void sendReaction(MessageObject messageObject, CharSequence reaction, ChatActivity parentFragment) { + public void sendReaction(MessageObject messageObject, CharSequence reaction, ChatActivity parentFragment, Runnable callback) { if (messageObject == null || parentFragment == null) { return; } @@ -2671,16 +2672,10 @@ public class SendMessagesHelper extends BaseController implements NotificationCe getConnectionsManager().sendRequest(req, (response, error) -> { if (response != null) { getMessagesController().processUpdates((TLRPC.Updates) response, false); - } - /*AndroidUtilities.runOnUIThread(new Runnable() { - @Override - public void run() { - waitingForVote.remove(key); - if (finishRunnable != null) { - finishRunnable.run(); - } + if (callback != null) { + AndroidUtilities.runOnUIThread(callback); } - });*/ + } }); } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/SharedConfig.java b/TMessagesProj/src/main/java/org/telegram/messenger/SharedConfig.java index 11ccbd1a8..230297c39 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/SharedConfig.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/SharedConfig.java @@ -20,20 +20,23 @@ import android.text.TextUtils; import android.util.Base64; import android.util.SparseArray; +import androidx.annotation.IntDef; +import androidx.core.content.pm.ShortcutManagerCompat; + import org.json.JSONObject; import org.telegram.tgnet.ConnectionsManager; import org.telegram.tgnet.SerializedData; -import org.telegram.ui.Components.SharedMediaLayout; -import org.telegram.ui.Components.SwipeGestureSettingsView; import org.telegram.tgnet.TLRPC; +import org.telegram.ui.Components.SwipeGestureSettingsView; import java.io.File; import java.io.RandomAccessFile; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; - -import androidx.core.content.pm.ShortcutManagerCompat; +import java.util.Locale; public class SharedConfig { @@ -74,6 +77,7 @@ public class SharedConfig { public static boolean searchMessagesAsListUsed; public static boolean stickersReorderingHintUsed; public static boolean disableVoiceAudioEffects; + public static boolean drawSnowInChat; private static int lastLocalId = -210000; public static String storageCacheDir; @@ -377,6 +381,7 @@ public class SharedConfig { mediaColumnsCount = preferences.getInt("mediaColumnsCount", 3); fastScrollHintCount = preferences.getInt("fastScrollHintCount", 3); dontAskManageStorage = preferences.getBoolean("dontAskManageStorage", false); + drawSnowInChat = preferences.getBoolean("drawSnowInChat", BuildVars.DEBUG_VERSION); preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); showNotificationsForAllAccounts = preferences.getBoolean("AllAccounts", true); @@ -710,6 +715,14 @@ public class SharedConfig { editor.commit(); } + public static void toggleDrawSnowInChat() { + drawSnowInChat = !drawSnowInChat; + SharedPreferences preferences = MessagesController.getGlobalMainSettings(); + SharedPreferences.Editor editor = preferences.edit(); + editor.putBoolean("drawSnowInChat", drawSnowInChat); + editor.commit(); + } + public static void toggleNoiseSupression() { noiseSupression = !noiseSupression; SharedPreferences preferences = MessagesController.getGlobalMainSettings(); @@ -1119,25 +1132,38 @@ public class SharedConfig { public final static int PERFORMANCE_CLASS_AVERAGE = 1; public final static int PERFORMANCE_CLASS_HIGH = 2; + @Retention(RetentionPolicy.SOURCE) + @IntDef({ + PERFORMANCE_CLASS_LOW, + PERFORMANCE_CLASS_AVERAGE, + PERFORMANCE_CLASS_HIGH + }) + public @interface PerformanceClass {} + + @PerformanceClass public static int getDevicePerformanceClass() { if (devicePerformanceClass == -1) { - int maxCpuFreq = -1; - try { - RandomAccessFile reader = new RandomAccessFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", "r"); - String line = reader.readLine(); - if (line != null) { - maxCpuFreq = Utilities.parseInt(line) / 1000; - } - reader.close(); - } catch (Throwable ignore) { - - } int androidVersion = Build.VERSION.SDK_INT; int cpuCount = ConnectionsManager.CPU_COUNT; int memoryClass = ((ActivityManager) ApplicationLoader.applicationContext.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryClass(); + int totalCpuFreq = 0; + int freqResolved = 0; + for (int i = 0; i < cpuCount; i++) { + try { + RandomAccessFile reader = new RandomAccessFile(String.format(Locale.ENGLISH, "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", i), "r"); + String line = reader.readLine(); + if (line != null) { + totalCpuFreq += Utilities.parseInt(line) / 1000; + freqResolved++; + } + reader.close(); + } catch (Throwable ignore) {} + } + int maxCpuFreq = freqResolved == 0 ? -1 : (int) Math.ceil(totalCpuFreq / (float) freqResolved); + if (androidVersion < 21 || cpuCount <= 2 || memoryClass <= 100 || cpuCount <= 4 && maxCpuFreq != -1 && maxCpuFreq <= 1250 || cpuCount <= 4 && maxCpuFreq <= 1600 && memoryClass <= 128 && androidVersion <= 21 || cpuCount <= 4 && maxCpuFreq <= 1300 && memoryClass <= 128 && androidVersion <= 24) { devicePerformanceClass = PERFORMANCE_CLASS_LOW; - } else if (cpuCount < 8 || memoryClass <= 160 || maxCpuFreq != -1 && maxCpuFreq <= 1650 || maxCpuFreq == -1 && cpuCount == 8 && androidVersion <= 23) { + } else if (cpuCount < 8 || memoryClass <= 160 || maxCpuFreq != -1 && maxCpuFreq <= 2050 || maxCpuFreq == -1 && cpuCount == 8 && androidVersion <= 23) { devicePerformanceClass = PERFORMANCE_CLASS_AVERAGE; } else { devicePerformanceClass = PERFORMANCE_CLASS_HIGH; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java index b522187e4..45eaecd29 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java @@ -14,12 +14,15 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; +import com.carrotsearch.randomizedtesting.Xoroshiro128PlusRandom; + import java.io.File; import java.io.FileInputStream; import java.math.BigInteger; import java.nio.ByteBuffer; import java.security.MessageDigest; import java.security.SecureRandom; +import java.util.Random; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -27,6 +30,7 @@ public class Utilities { public static Pattern pattern = Pattern.compile("[\\-0-9]+"); public static SecureRandom random = new SecureRandom(); + public static Random fastRandom = new Xoroshiro128PlusRandom(random.nextLong()); public static volatile DispatchQueue stageQueue = new DispatchQueue("stageQueue"); public static volatile DispatchQueue globalQueue = new DispatchQueue("globalQueue"); diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/video/MediaCodecVideoConvertor.java b/TMessagesProj/src/main/java/org/telegram/messenger/video/MediaCodecVideoConvertor.java index 042bca03b..b5c6fb476 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/video/MediaCodecVideoConvertor.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/video/MediaCodecVideoConvertor.java @@ -166,7 +166,7 @@ public class MediaCodecVideoConvertor { inputSurface.makeCurrent(); encoder.start(); - // outputSurface = new OutputSurface(savedFilterState, videoPath, paintPath, mediaEntities, null, resultWidth, resultHeight, rotationValue, framerate, true); + outputSurface = new OutputSurface(savedFilterState, videoPath, paintPath, mediaEntities, null, resultWidth, resultHeight, rotationValue, framerate, true); ByteBuffer[] encoderOutputBuffers = null; ByteBuffer[] encoderInputBuffers = null; diff --git a/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java b/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java index 8a62a2595..b500edb78 100644 --- a/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java +++ b/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java @@ -883,14 +883,14 @@ public class ConnectionsManager extends BaseController { } done = true; } catch (Throwable e) { - FileLog.e(e); + FileLog.e(e, false); } finally { try { if (httpConnectionStream != null) { httpConnectionStream.close(); } } catch (Throwable e) { - FileLog.e(e); + FileLog.e(e, false); } try { if (outbuf != null) { @@ -907,7 +907,7 @@ public class ConnectionsManager extends BaseController { addresses.add(address.getHostAddress()); return new ResolvedDomain(addresses, SystemClock.elapsedRealtime()); } catch (Exception e) { - FileLog.e(e); + FileLog.e(e, false); } } return null; diff --git a/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java b/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java index d2d206cc3..2e5629ea7 100644 --- a/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java +++ b/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java @@ -12,8 +12,6 @@ import android.graphics.drawable.BitmapDrawable; import android.os.Build; import android.text.TextUtils; -import com.google.android.exoplayer2.util.Log; - import org.telegram.messenger.FileLog; import org.telegram.messenger.ImageLoader; import org.telegram.messenger.Utilities; @@ -41,7 +39,7 @@ public class TLRPC { //public static final int USER_FLAG_BOT = 0x00004000; //public static final int USER_FLAG_BOT_READING_HISTORY = 0x00008000; //public static final int USER_FLAG_BOT_CANT_JOIN_GROUP = 0x00010000; - //public static final int USER_FLAG_VERIFIED = 0x00020000; + //public static final int USER_FLAG_VERIFIED = 0x00020000; //public static final int CHAT_FLAG_CREATOR = 0x00000001; //public static final int CHAT_FLAG_USER_KICKED = 0x00000002; @@ -63,10 +61,10 @@ public class TLRPC { public static final int MESSAGE_FLAG_HAS_FROM_ID = 0x00000100; public static final int MESSAGE_FLAG_HAS_MEDIA = 0x00000200; public static final int MESSAGE_FLAG_HAS_VIEWS = 0x00000400; - public static final int MESSAGE_FLAG_HAS_BOT_ID = 0x00000800; - public static final int MESSAGE_FLAG_EDITED = 0x00008000; + public static final int MESSAGE_FLAG_HAS_BOT_ID = 0x00000800; + public static final int MESSAGE_FLAG_EDITED = 0x00008000; - public static final int LAYER = 135; + public static final int LAYER = 136; public static class TL_stats_megagroupStats extends TLObject { public static int constructor = 0xef7ff916; @@ -601,71 +599,71 @@ public class TLRPC { } } - public static class TL_help_termsOfService extends TLObject { - public static int constructor = 0x780a0310; + public static class TL_help_termsOfService extends TLObject { + public static int constructor = 0x780a0310; - public int flags; - public boolean popup; - public TL_dataJSON id; - public String text; - public ArrayList entities = new ArrayList<>(); - public int min_age_confirm; + public int flags; + public boolean popup; + public TL_dataJSON id; + public String text; + public ArrayList entities = new ArrayList<>(); + public int min_age_confirm; - public static TL_help_termsOfService TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_help_termsOfService.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_help_termsOfService", constructor)); - } else { - return null; - } - } - TL_help_termsOfService result = new TL_help_termsOfService(); - result.readParams(stream, exception); - return result; - } + public static TL_help_termsOfService TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_help_termsOfService.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_help_termsOfService", constructor)); + } else { + return null; + } + } + TL_help_termsOfService result = new TL_help_termsOfService(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - popup = (flags & 1) != 0; - id = TL_dataJSON.TLdeserialize(stream, stream.readInt32(exception), exception); - text = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - if ((flags & 2) != 0) { - min_age_confirm = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + popup = (flags & 1) != 0; + id = TL_dataJSON.TLdeserialize(stream, stream.readInt32(exception), exception); + text = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + if ((flags & 2) != 0) { + min_age_confirm = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = popup ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - id.serializeToStream(stream); - stream.writeString(text); - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - if ((flags & 2) != 0) { - stream.writeInt32(min_age_confirm); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = popup ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + id.serializeToStream(stream); + stream.writeString(text); + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + if ((flags & 2) != 0) { + stream.writeInt32(min_age_confirm); + } + } + } public static class TL_payments_paymentReceipt extends TLObject { public static int constructor = 0x70c4fe03; @@ -989,90 +987,90 @@ public class TLRPC { } } - public static abstract class messages_SentEncryptedMessage extends TLObject { - public int date; - public EncryptedFile file; + public static abstract class messages_SentEncryptedMessage extends TLObject { + public int date; + public EncryptedFile file; - public static messages_SentEncryptedMessage TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_SentEncryptedMessage result = null; - switch (constructor) { - case 0x560f8935: - result = new TL_messages_sentEncryptedMessage(); - break; - case 0x9493ff32: - result = new TL_messages_sentEncryptedFile(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_SentEncryptedMessage", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static messages_SentEncryptedMessage TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_SentEncryptedMessage result = null; + switch (constructor) { + case 0x560f8935: + result = new TL_messages_sentEncryptedMessage(); + break; + case 0x9493ff32: + result = new TL_messages_sentEncryptedFile(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_SentEncryptedMessage", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messages_sentEncryptedMessage extends messages_SentEncryptedMessage { - public static int constructor = 0x560f8935; + public static class TL_messages_sentEncryptedMessage extends messages_SentEncryptedMessage { + public static int constructor = 0x560f8935; - public void readParams(AbstractSerializedData stream, boolean exception) { - date = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(date); + } + } - public static class TL_messages_sentEncryptedFile extends messages_SentEncryptedMessage { - public static int constructor = 0x9493ff32; + public static class TL_messages_sentEncryptedFile extends messages_SentEncryptedMessage { + public static int constructor = 0x9493ff32; - public void readParams(AbstractSerializedData stream, boolean exception) { - date = stream.readInt32(exception); + public void readParams(AbstractSerializedData stream, boolean exception) { + date = stream.readInt32(exception); file = EncryptedFile.TLdeserialize(stream, stream.readInt32(exception), exception); - } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(date); - file.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(date); + file.serializeToStream(stream); + } + } - public static class TL_error extends TLObject { - public static int constructor = 0xc4b9f9bb; + public static class TL_error extends TLObject { + public static int constructor = 0xc4b9f9bb; - public int code; - public String text; + public int code; + public String text; - public static TL_error TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_error.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_error", constructor)); - } else { - return null; - } - } - TL_error result = new TL_error(); - result.readParams(stream, exception); - return result; - } + public static TL_error TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_error.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_error", constructor)); + } else { + return null; + } + } + TL_error result = new TL_error(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { code = stream.readInt32(exception); - text = stream.readString(exception); - } + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(code); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(code); + stream.writeString(text); + } + } public static abstract class UrlAuthResult extends TLObject { @@ -1147,496 +1145,496 @@ public class TLRPC { } } - public static class TL_messages_chatFull extends TLObject { - public static int constructor = 0xe5d7d19c; - - public ChatFull full_chat; - public ArrayList chats = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); - - public static TL_messages_chatFull TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messages_chatFull.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messages_chatFull", constructor)); - } else { - return null; - } - } - TL_messages_chatFull result = new TL_messages_chatFull(); - result.readParams(stream, exception); - return result; - } - - public void readParams(AbstractSerializedData stream, boolean exception) { - full_chat = ChatFull.TLdeserialize(stream, stream.readInt32(exception), exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - full_chat.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } - - public static class TL_account_passwordSettings extends TLObject { - public static int constructor = 0x9a5c33e5; - - public int flags; - public String email; - public TL_secureSecretSettings secure_settings; - - public static TL_account_passwordSettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_account_passwordSettings.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_account_passwordSettings", constructor)); - } else { - return null; - } - } - TL_account_passwordSettings result = new TL_account_passwordSettings(); - result.readParams(stream, exception); - return result; - } - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - if ((flags & 1) != 0) { - email = stream.readString(exception); - } - if ((flags & 2) != 0) { - secure_settings = TL_secureSecretSettings.TLdeserialize(stream, stream.readInt32(exception), exception); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - stream.writeString(email); - } - if ((flags & 2) != 0) { - secure_settings.serializeToStream(stream); - } - } - } - - public static abstract class DocumentAttribute extends TLObject { - public String alt; - public InputStickerSet stickerset; - public int duration; - public int flags; - public TL_maskCoords mask_coords; - public boolean round_message; - public boolean supports_streaming; - public String file_name; - public int w; - public int h; - public boolean mask; - public String title; - public String performer; - public boolean voice; - public byte[] waveform; - - public static DocumentAttribute TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - DocumentAttribute result = null; - switch (constructor) { - case 0x3a556302: - result = new TL_documentAttributeSticker_layer55(); - break; - case 0x51448e5: - result = new TL_documentAttributeAudio_old(); - break; - case 0x6319d612: - result = new TL_documentAttributeSticker(); - break; - case 0x11b58939: - result = new TL_documentAttributeAnimated(); - break; - case 0x15590068: - result = new TL_documentAttributeFilename(); - break; - case 0xef02ce6: - result = new TL_documentAttributeVideo(); - break; - case 0x5910cccb: - result = new TL_documentAttributeVideo_layer65(); - break; - case 0xded218e0: - result = new TL_documentAttributeAudio_layer45(); - break; - case 0xfb0a5727: - result = new TL_documentAttributeSticker_old(); - break; - case 0x9801d2f7: - result = new TL_documentAttributeHasStickers(); - break; - case 0x994c9882: - result = new TL_documentAttributeSticker_old2(); - break; - case 0x6c37c15c: - result = new TL_documentAttributeImageSize(); - break; - case 0x9852f9c6: - result = new TL_documentAttributeAudio(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in DocumentAttribute", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } - - public static class TL_documentAttributeSticker_layer55 extends TL_documentAttributeSticker { - public static int constructor = 0x3a556302; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - alt = stream.readString(exception); - stickerset = InputStickerSet.TLdeserialize(stream, stream.readInt32(exception), exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(alt); - stickerset.serializeToStream(stream); - } - } - - public static class TL_documentAttributeAudio_old extends TL_documentAttributeAudio { - public static int constructor = 0x51448e5; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - duration = stream.readInt32(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(duration); - } - } - - public static class TL_documentAttributeSticker extends DocumentAttribute { - public static int constructor = 0x6319d612; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - mask = (flags & 2) != 0; - alt = stream.readString(exception); - stickerset = InputStickerSet.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 1) != 0) { - mask_coords = TL_maskCoords.TLdeserialize(stream, stream.readInt32(exception), exception); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = mask ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - stream.writeString(alt); - stickerset.serializeToStream(stream); - if ((flags & 1) != 0) { - mask_coords.serializeToStream(stream); - } - } - } - - public static class TL_documentAttributeAnimated extends DocumentAttribute { - public static int constructor = 0x11b58939; - - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } - - public static class TL_documentAttributeFilename extends DocumentAttribute { - public static int constructor = 0x15590068; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - file_name = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(file_name); - } - } - - public static class TL_documentAttributeVideo extends DocumentAttribute { - public static int constructor = 0xef02ce6; - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - round_message = (flags & 1) != 0; - supports_streaming = (flags & 2) != 0; - duration = stream.readInt32(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = round_message ? (flags | 1) : (flags &~ 1); - flags = supports_streaming ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - stream.writeInt32(duration); - stream.writeInt32(w); - stream.writeInt32(h); - } - } - - public static class TL_documentAttributeVideo_layer65 extends TL_documentAttributeVideo { - public static int constructor = 0x5910cccb; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - duration = stream.readInt32(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(duration); - stream.writeInt32(w); - stream.writeInt32(h); - } - } - - public static class TL_documentAttributeAudio_layer45 extends TL_documentAttributeAudio { - public static int constructor = 0xded218e0; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - duration = stream.readInt32(exception); - title = stream.readString(exception); - performer = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(duration); - stream.writeString(title); - stream.writeString(performer); - } - } - - public static class TL_documentAttributeSticker_old extends TL_documentAttributeSticker { - public static int constructor = 0xfb0a5727; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } - - public static class TL_documentAttributeHasStickers extends DocumentAttribute { - public static int constructor = 0x9801d2f7; - - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } - - public static class TL_documentAttributeSticker_old2 extends TL_documentAttributeSticker { - public static int constructor = 0x994c9882; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - alt = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(alt); - } - } - - public static class TL_documentAttributeImageSize extends DocumentAttribute { - public static int constructor = 0x6c37c15c; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - w = stream.readInt32(exception); - h = stream.readInt32(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(w); - stream.writeInt32(h); - } - } - - public static class TL_documentAttributeAudio extends DocumentAttribute { - public static int constructor = 0x9852f9c6; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - voice = (flags & 1024) != 0; - duration = stream.readInt32(exception); - if ((flags & 1) != 0) { - title = stream.readString(exception); - } - if ((flags & 2) != 0) { - performer = stream.readString(exception); - } - if ((flags & 4) != 0) { - waveform = stream.readByteArray(exception); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = voice ? (flags | 1024) : (flags &~ 1024); - stream.writeInt32(flags); - stream.writeInt32(duration); - if ((flags & 1) != 0) { - stream.writeString(title); - } - if ((flags & 2) != 0) { - stream.writeString(performer); - } - if ((flags & 4) != 0) { - stream.writeByteArray(waveform); - } - } - } - - public static class TL_textPhone extends RichText { - public static int constructor = 0x1ccb966a; - - public RichText text; - public String phone; - - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - phone = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - stream.writeString(phone); - } - } - - public static class TL_textSuperscript extends RichText { - public static int constructor = 0xc7fb5e01; - - public RichText text; - - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } - - public static class TL_textImage extends RichText { - public static int constructor = 0x81ccf4f; - - public long document_id; - public int w; - public int h; - - public void readParams(AbstractSerializedData stream, boolean exception) { - document_id = stream.readInt64(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(document_id); - stream.writeInt32(w); - stream.writeInt32(h); - } - } - - public static class TL_textEmpty extends RichText { - public static int constructor = 0xdc3d824f; - - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } - - public static class TL_textUrl extends RichText { - public static int constructor = 0x3c2884c1; - - public RichText text; - - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - url = stream.readString(exception); - webpage_id = stream.readInt64(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - stream.writeString(url); - stream.writeInt64(webpage_id); - } - } + public static class TL_messages_chatFull extends TLObject { + public static int constructor = 0xe5d7d19c; + + public ChatFull full_chat; + public ArrayList chats = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); + + public static TL_messages_chatFull TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_chatFull.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_chatFull", constructor)); + } else { + return null; + } + } + TL_messages_chatFull result = new TL_messages_chatFull(); + result.readParams(stream, exception); + return result; + } + + public void readParams(AbstractSerializedData stream, boolean exception) { + full_chat = ChatFull.TLdeserialize(stream, stream.readInt32(exception), exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + full_chat.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } + + public static class TL_account_passwordSettings extends TLObject { + public static int constructor = 0x9a5c33e5; + + public int flags; + public String email; + public TL_secureSecretSettings secure_settings; + + public static TL_account_passwordSettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_account_passwordSettings.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_account_passwordSettings", constructor)); + } else { + return null; + } + } + TL_account_passwordSettings result = new TL_account_passwordSettings(); + result.readParams(stream, exception); + return result; + } + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + if ((flags & 1) != 0) { + email = stream.readString(exception); + } + if ((flags & 2) != 0) { + secure_settings = TL_secureSecretSettings.TLdeserialize(stream, stream.readInt32(exception), exception); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + stream.writeString(email); + } + if ((flags & 2) != 0) { + secure_settings.serializeToStream(stream); + } + } + } + + public static abstract class DocumentAttribute extends TLObject { + public String alt; + public InputStickerSet stickerset; + public int duration; + public int flags; + public TL_maskCoords mask_coords; + public boolean round_message; + public boolean supports_streaming; + public String file_name; + public int w; + public int h; + public boolean mask; + public String title; + public String performer; + public boolean voice; + public byte[] waveform; + + public static DocumentAttribute TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + DocumentAttribute result = null; + switch (constructor) { + case 0x3a556302: + result = new TL_documentAttributeSticker_layer55(); + break; + case 0x51448e5: + result = new TL_documentAttributeAudio_old(); + break; + case 0x6319d612: + result = new TL_documentAttributeSticker(); + break; + case 0x11b58939: + result = new TL_documentAttributeAnimated(); + break; + case 0x15590068: + result = new TL_documentAttributeFilename(); + break; + case 0xef02ce6: + result = new TL_documentAttributeVideo(); + break; + case 0x5910cccb: + result = new TL_documentAttributeVideo_layer65(); + break; + case 0xded218e0: + result = new TL_documentAttributeAudio_layer45(); + break; + case 0xfb0a5727: + result = new TL_documentAttributeSticker_old(); + break; + case 0x9801d2f7: + result = new TL_documentAttributeHasStickers(); + break; + case 0x994c9882: + result = new TL_documentAttributeSticker_old2(); + break; + case 0x6c37c15c: + result = new TL_documentAttributeImageSize(); + break; + case 0x9852f9c6: + result = new TL_documentAttributeAudio(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in DocumentAttribute", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } + + public static class TL_documentAttributeSticker_layer55 extends TL_documentAttributeSticker { + public static int constructor = 0x3a556302; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + alt = stream.readString(exception); + stickerset = InputStickerSet.TLdeserialize(stream, stream.readInt32(exception), exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(alt); + stickerset.serializeToStream(stream); + } + } + + public static class TL_documentAttributeAudio_old extends TL_documentAttributeAudio { + public static int constructor = 0x51448e5; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + duration = stream.readInt32(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(duration); + } + } + + public static class TL_documentAttributeSticker extends DocumentAttribute { + public static int constructor = 0x6319d612; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + mask = (flags & 2) != 0; + alt = stream.readString(exception); + stickerset = InputStickerSet.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 1) != 0) { + mask_coords = TL_maskCoords.TLdeserialize(stream, stream.readInt32(exception), exception); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = mask ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + stream.writeString(alt); + stickerset.serializeToStream(stream); + if ((flags & 1) != 0) { + mask_coords.serializeToStream(stream); + } + } + } + + public static class TL_documentAttributeAnimated extends DocumentAttribute { + public static int constructor = 0x11b58939; + + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } + + public static class TL_documentAttributeFilename extends DocumentAttribute { + public static int constructor = 0x15590068; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + file_name = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(file_name); + } + } + + public static class TL_documentAttributeVideo extends DocumentAttribute { + public static int constructor = 0xef02ce6; + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + round_message = (flags & 1) != 0; + supports_streaming = (flags & 2) != 0; + duration = stream.readInt32(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = round_message ? (flags | 1) : (flags &~ 1); + flags = supports_streaming ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + stream.writeInt32(duration); + stream.writeInt32(w); + stream.writeInt32(h); + } + } + + public static class TL_documentAttributeVideo_layer65 extends TL_documentAttributeVideo { + public static int constructor = 0x5910cccb; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + duration = stream.readInt32(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(duration); + stream.writeInt32(w); + stream.writeInt32(h); + } + } + + public static class TL_documentAttributeAudio_layer45 extends TL_documentAttributeAudio { + public static int constructor = 0xded218e0; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + duration = stream.readInt32(exception); + title = stream.readString(exception); + performer = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(duration); + stream.writeString(title); + stream.writeString(performer); + } + } + + public static class TL_documentAttributeSticker_old extends TL_documentAttributeSticker { + public static int constructor = 0xfb0a5727; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } + + public static class TL_documentAttributeHasStickers extends DocumentAttribute { + public static int constructor = 0x9801d2f7; + + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } + + public static class TL_documentAttributeSticker_old2 extends TL_documentAttributeSticker { + public static int constructor = 0x994c9882; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + alt = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(alt); + } + } + + public static class TL_documentAttributeImageSize extends DocumentAttribute { + public static int constructor = 0x6c37c15c; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + w = stream.readInt32(exception); + h = stream.readInt32(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(w); + stream.writeInt32(h); + } + } + + public static class TL_documentAttributeAudio extends DocumentAttribute { + public static int constructor = 0x9852f9c6; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + voice = (flags & 1024) != 0; + duration = stream.readInt32(exception); + if ((flags & 1) != 0) { + title = stream.readString(exception); + } + if ((flags & 2) != 0) { + performer = stream.readString(exception); + } + if ((flags & 4) != 0) { + waveform = stream.readByteArray(exception); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = voice ? (flags | 1024) : (flags &~ 1024); + stream.writeInt32(flags); + stream.writeInt32(duration); + if ((flags & 1) != 0) { + stream.writeString(title); + } + if ((flags & 2) != 0) { + stream.writeString(performer); + } + if ((flags & 4) != 0) { + stream.writeByteArray(waveform); + } + } + } + + public static class TL_textPhone extends RichText { + public static int constructor = 0x1ccb966a; + + public RichText text; + public String phone; + + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + phone = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + stream.writeString(phone); + } + } + + public static class TL_textSuperscript extends RichText { + public static int constructor = 0xc7fb5e01; + + public RichText text; + + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } + + public static class TL_textImage extends RichText { + public static int constructor = 0x81ccf4f; + + public long document_id; + public int w; + public int h; + + public void readParams(AbstractSerializedData stream, boolean exception) { + document_id = stream.readInt64(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(document_id); + stream.writeInt32(w); + stream.writeInt32(h); + } + } + + public static class TL_textEmpty extends RichText { + public static int constructor = 0xdc3d824f; + + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } + + public static class TL_textUrl extends RichText { + public static int constructor = 0x3c2884c1; + + public RichText text; + + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + url = stream.readString(exception); + webpage_id = stream.readInt64(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + stream.writeString(url); + stream.writeInt64(webpage_id); + } + } public static class TL_textAnchor extends RichText { public static int constructor = 0x35553762; @@ -1656,175 +1654,175 @@ public class TLRPC { } } - public static class TL_textStrike extends RichText { - public static int constructor = 0x9bf8bb95; + public static class TL_textStrike extends RichText { + public static int constructor = 0x9bf8bb95; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_textMarked extends RichText { - public static int constructor = 0x34b8621; + public static class TL_textMarked extends RichText { + public static int constructor = 0x34b8621; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_textFixed extends RichText { - public static int constructor = 0x6c3f19b9; + public static class TL_textFixed extends RichText { + public static int constructor = 0x6c3f19b9; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_textEmail extends RichText { - public static int constructor = 0xde5a0dd6; + public static class TL_textEmail extends RichText { + public static int constructor = 0xde5a0dd6; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - email = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + email = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - stream.writeString(email); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + stream.writeString(email); + } + } - public static class TL_textPlain extends RichText { - public static int constructor = 0x744694e0; + public static class TL_textPlain extends RichText { + public static int constructor = 0x744694e0; - public String text; + public String text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(text); + } + } - public static class TL_textConcat extends RichText { - public static int constructor = 0x7e6260d7; + public static class TL_textConcat extends RichText { + public static int constructor = 0x7e6260d7; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - RichText object = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - texts.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + RichText object = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + texts.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = texts.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - texts.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = texts.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + texts.get(a).serializeToStream(stream); + } + } + } - public static class TL_textBold extends RichText { - public static int constructor = 0x6724abc4; + public static class TL_textBold extends RichText { + public static int constructor = 0x6724abc4; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_textItalic extends RichText { - public static int constructor = 0xd912a59c; + public static class TL_textItalic extends RichText { + public static int constructor = 0xd912a59c; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_textUnderline extends RichText { - public static int constructor = 0xc12622c4; + public static class TL_textUnderline extends RichText { + public static int constructor = 0xc12622c4; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_textSubscript extends RichText { - public static int constructor = 0xed6a8504; + public static class TL_textSubscript extends RichText { + public static int constructor = 0xed6a8504; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } public static class TL_statsURL extends TLObject { public static int constructor = 0x47a971e0; @@ -1885,87 +1883,87 @@ public class TLRPC { } } - public static class TL_messages_botCallbackAnswer extends TLObject { - public static int constructor = 0x36585ea4; + public static class TL_messages_botCallbackAnswer extends TLObject { + public static int constructor = 0x36585ea4; - public int flags; - public boolean alert; - public boolean has_url; - public boolean native_ui; - public String message; - public String url; - public int cache_time; + public int flags; + public boolean alert; + public boolean has_url; + public boolean native_ui; + public String message; + public String url; + public int cache_time; - public static TL_messages_botCallbackAnswer TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messages_botCallbackAnswer.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messages_botCallbackAnswer", constructor)); - } else { - return null; - } - } - TL_messages_botCallbackAnswer result = new TL_messages_botCallbackAnswer(); - result.readParams(stream, exception); - return result; - } + public static TL_messages_botCallbackAnswer TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_botCallbackAnswer.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_botCallbackAnswer", constructor)); + } else { + return null; + } + } + TL_messages_botCallbackAnswer result = new TL_messages_botCallbackAnswer(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - alert = (flags & 2) != 0; - has_url = (flags & 8) != 0; - native_ui = (flags & 16) != 0; - if ((flags & 1) != 0) { - message = stream.readString(exception); - } - if ((flags & 4) != 0) { - url = stream.readString(exception); - } - cache_time = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + alert = (flags & 2) != 0; + has_url = (flags & 8) != 0; + native_ui = (flags & 16) != 0; + if ((flags & 1) != 0) { + message = stream.readString(exception); + } + if ((flags & 4) != 0) { + url = stream.readString(exception); + } + cache_time = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = alert ? (flags | 2) : (flags &~ 2); - flags = has_url ? (flags | 8) : (flags &~ 8); - flags = native_ui ? (flags | 16) : (flags &~ 16); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - stream.writeString(message); - } - if ((flags & 4) != 0) { - stream.writeString(url); - } - stream.writeInt32(cache_time); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = alert ? (flags | 2) : (flags &~ 2); + flags = has_url ? (flags | 8) : (flags &~ 8); + flags = native_ui ? (flags | 16) : (flags &~ 16); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + stream.writeString(message); + } + if ((flags & 4) != 0) { + stream.writeString(url); + } + stream.writeInt32(cache_time); + } + } - public static class TL_dataJSON extends TLObject { - public static int constructor = 0x7d748d04; + public static class TL_dataJSON extends TLObject { + public static int constructor = 0x7d748d04; - public String data; + public String data; - public static TL_dataJSON TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_dataJSON.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_dataJSON", constructor)); - } else { - return null; - } - } - TL_dataJSON result = new TL_dataJSON(); - result.readParams(stream, exception); - return result; - } + public static TL_dataJSON TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_dataJSON.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_dataJSON", constructor)); + } else { + return null; + } + } + TL_dataJSON result = new TL_dataJSON(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - data = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + data = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(data); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(data); + } + } public static class TL_contactStatus extends TLObject { public static int constructor = 0x16d9703b; @@ -2059,7 +2057,7 @@ public class TLRPC { public static class TL_groupCall extends GroupCall { public static int constructor = 0xd597650c; - + public void readParams(AbstractSerializedData stream, boolean exception) { flags = stream.readInt32(exception); @@ -2124,59 +2122,59 @@ public class TLRPC { } public static class TL_channelBannedRights_layer92 extends TLObject { - public static int constructor = 0x58cf4249; + public static int constructor = 0x58cf4249; - public int flags; - public boolean view_messages; - public boolean send_messages; - public boolean send_media; - public boolean send_stickers; - public boolean send_gifs; - public boolean send_games; - public boolean send_inline; - public boolean embed_links; - public int until_date; + public int flags; + public boolean view_messages; + public boolean send_messages; + public boolean send_media; + public boolean send_stickers; + public boolean send_gifs; + public boolean send_games; + public boolean send_inline; + public boolean embed_links; + public int until_date; - public static TL_channelBannedRights_layer92 TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_channelBannedRights_layer92.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_channelBannedRights_layer92", constructor)); - } else { - return null; - } - } - TL_channelBannedRights_layer92 result = new TL_channelBannedRights_layer92(); - result.readParams(stream, exception); - return result; - } + public static TL_channelBannedRights_layer92 TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_channelBannedRights_layer92.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_channelBannedRights_layer92", constructor)); + } else { + return null; + } + } + TL_channelBannedRights_layer92 result = new TL_channelBannedRights_layer92(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - view_messages = (flags & 1) != 0; - send_messages = (flags & 2) != 0; - send_media = (flags & 4) != 0; - send_stickers = (flags & 8) != 0; - send_gifs = (flags & 16) != 0; - send_games = (flags & 32) != 0; - send_inline = (flags & 64) != 0; - embed_links = (flags & 128) != 0; - until_date = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + view_messages = (flags & 1) != 0; + send_messages = (flags & 2) != 0; + send_media = (flags & 4) != 0; + send_stickers = (flags & 8) != 0; + send_gifs = (flags & 16) != 0; + send_games = (flags & 32) != 0; + send_inline = (flags & 64) != 0; + embed_links = (flags & 128) != 0; + until_date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = view_messages ? (flags | 1) : (flags &~ 1); - flags = send_messages ? (flags | 2) : (flags &~ 2); - flags = send_media ? (flags | 4) : (flags &~ 4); - flags = send_stickers ? (flags | 8) : (flags &~ 8); - flags = send_gifs ? (flags | 16) : (flags &~ 16); - flags = send_games ? (flags | 32) : (flags &~ 32); - flags = send_inline ? (flags | 64) : (flags &~ 64); - flags = embed_links ? (flags | 128) : (flags &~ 128); - stream.writeInt32(flags); - stream.writeInt32(until_date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = view_messages ? (flags | 1) : (flags &~ 1); + flags = send_messages ? (flags | 2) : (flags &~ 2); + flags = send_media ? (flags | 4) : (flags &~ 4); + flags = send_stickers ? (flags | 8) : (flags &~ 8); + flags = send_gifs ? (flags | 16) : (flags &~ 16); + flags = send_games ? (flags | 32) : (flags &~ 32); + flags = send_inline ? (flags | 64) : (flags &~ 64); + flags = embed_links ? (flags | 128) : (flags &~ 128); + stream.writeInt32(flags); + stream.writeInt32(until_date); + } + } public static abstract class DialogPeer extends TLObject { @@ -2231,7 +2229,7 @@ public class TLRPC { } public static class TL_messageUserReaction extends TLObject { - public static int constructor = 0xd267dcbc; + public static int constructor = 0x932844fa; public long user_id; public String reaction; @@ -2250,13 +2248,13 @@ public class TLRPC { } public void readParams(AbstractSerializedData stream, boolean exception) { - user_id = stream.readInt32(exception); + user_id = stream.readInt64(exception); reaction = stream.readString(exception); } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt32((int) user_id); + stream.writeInt64(user_id); stream.writeString(reaction); } } @@ -3223,62 +3221,62 @@ public class TLRPC { } public static abstract class EncryptedFile extends TLObject { - public long id; - public long access_hash; - public int size; - public int dc_id; - public int key_fingerprint; + public long id; + public long access_hash; + public int size; + public int dc_id; + public int key_fingerprint; - public static EncryptedFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - EncryptedFile result = null; - switch (constructor) { - case 0x4a70994c: - result = new TL_encryptedFile(); - break; - case 0xc21f497e: - result = new TL_encryptedFileEmpty(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in EncryptedFile", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static EncryptedFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + EncryptedFile result = null; + switch (constructor) { + case 0x4a70994c: + result = new TL_encryptedFile(); + break; + case 0xc21f497e: + result = new TL_encryptedFileEmpty(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in EncryptedFile", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_encryptedFile extends EncryptedFile { - public static int constructor = 0x4a70994c; + public static class TL_encryptedFile extends EncryptedFile { + public static int constructor = 0x4a70994c; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - size = stream.readInt32(exception); - dc_id = stream.readInt32(exception); - key_fingerprint = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + size = stream.readInt32(exception); + dc_id = stream.readInt32(exception); + key_fingerprint = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32(size); - stream.writeInt32(dc_id); - stream.writeInt32(key_fingerprint); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32(size); + stream.writeInt32(dc_id); + stream.writeInt32(key_fingerprint); + } + } - public static class TL_encryptedFileEmpty extends EncryptedFile { - public static int constructor = 0xc21f497e; + public static class TL_encryptedFileEmpty extends EncryptedFile { + public static int constructor = 0xc21f497e; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static abstract class Peer extends TLObject { @@ -3402,36 +3400,36 @@ public class TLRPC { } } - public static class TL_labeledPrice extends TLObject { - public static int constructor = 0xcb296bf8; + public static class TL_labeledPrice extends TLObject { + public static int constructor = 0xcb296bf8; - public String label; - public long amount; + public String label; + public long amount; - public static TL_labeledPrice TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_labeledPrice.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_labeledPrice", constructor)); - } else { - return null; - } - } - TL_labeledPrice result = new TL_labeledPrice(); - result.readParams(stream, exception); - return result; - } + public static TL_labeledPrice TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_labeledPrice.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_labeledPrice", constructor)); + } else { + return null; + } + } + TL_labeledPrice result = new TL_labeledPrice(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - label = stream.readString(exception); - amount = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + label = stream.readString(exception); + amount = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(label); - stream.writeInt64(amount); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(label); + stream.writeInt64(amount); + } + } public static class TL_messages_exportedChatInvites extends TLObject { public static int constructor = 0xbdc62dcc; @@ -3546,139 +3544,139 @@ public class TLRPC { } } - public static class TL_langPackDifference extends TLObject { - public static int constructor = 0xf385c1f6; + public static class TL_langPackDifference extends TLObject { + public static int constructor = 0xf385c1f6; - public String lang_code; - public int from_version; - public int version; - public ArrayList strings = new ArrayList<>(); + public String lang_code; + public int from_version; + public int version; + public ArrayList strings = new ArrayList<>(); - public static TL_langPackDifference TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_langPackDifference.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_langPackDifference", constructor)); - } else { - return null; - } - } - TL_langPackDifference result = new TL_langPackDifference(); - result.readParams(stream, exception); - return result; - } + public static TL_langPackDifference TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_langPackDifference.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_langPackDifference", constructor)); + } else { + return null; + } + } + TL_langPackDifference result = new TL_langPackDifference(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - lang_code = stream.readString(exception); - from_version = stream.readInt32(exception); - version = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - LangPackString object = LangPackString.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - strings.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + lang_code = stream.readString(exception); + from_version = stream.readInt32(exception); + version = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + LangPackString object = LangPackString.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + strings.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(lang_code); - stream.writeInt32(from_version); - stream.writeInt32(version); - stream.writeInt32(0x1cb5c415); - int count = strings.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - strings.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(lang_code); + stream.writeInt32(from_version); + stream.writeInt32(version); + stream.writeInt32(0x1cb5c415); + int count = strings.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + strings.get(a).serializeToStream(stream); + } + } + } - public static abstract class help_DeepLinkInfo extends TLObject { + public static abstract class help_DeepLinkInfo extends TLObject { - public static help_DeepLinkInfo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - help_DeepLinkInfo result = null; - switch (constructor) { - case 0x66afa166: - result = new TL_help_deepLinkInfoEmpty(); - break; - case 0x6a4ee832: - result = new TL_help_deepLinkInfo(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in help_DeepLinkInfo", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static help_DeepLinkInfo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + help_DeepLinkInfo result = null; + switch (constructor) { + case 0x66afa166: + result = new TL_help_deepLinkInfoEmpty(); + break; + case 0x6a4ee832: + result = new TL_help_deepLinkInfo(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in help_DeepLinkInfo", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_help_deepLinkInfoEmpty extends help_DeepLinkInfo { - public static int constructor = 0x66afa166; + public static class TL_help_deepLinkInfoEmpty extends help_DeepLinkInfo { + public static int constructor = 0x66afa166; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_help_deepLinkInfo extends help_DeepLinkInfo { - public static int constructor = 0x6a4ee832; + public static class TL_help_deepLinkInfo extends help_DeepLinkInfo { + public static int constructor = 0x6a4ee832; - public int flags; - public boolean update_app; - public String message; - public ArrayList entities = new ArrayList<>(); + public int flags; + public boolean update_app; + public String message; + public ArrayList entities = new ArrayList<>(); - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - update_app = (flags & 1) != 0; - message = stream.readString(exception); - if ((flags & 2) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + update_app = (flags & 1) != 0; + message = stream.readString(exception); + if ((flags & 2) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = update_app ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeString(message); - if ((flags & 2) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = update_app ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeString(message); + if ((flags & 2) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + } + } public static class TL_chatAdminRights extends TLObject { public static int constructor = 0x5fb224d5; @@ -4121,100 +4119,100 @@ public class TLRPC { } } - public static abstract class SecureFile extends TLObject { + public static abstract class SecureFile extends TLObject { - public static SecureFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - SecureFile result = null; - switch (constructor) { - case 0x64199744: - result = new TL_secureFileEmpty(); - break; - case 0xe0277a62: - result = new TL_secureFile(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in SecureFile", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static SecureFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + SecureFile result = null; + switch (constructor) { + case 0x64199744: + result = new TL_secureFileEmpty(); + break; + case 0xe0277a62: + result = new TL_secureFile(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in SecureFile", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_secureFileEmpty extends SecureFile { - public static int constructor = 0x64199744; + public static class TL_secureFileEmpty extends SecureFile { + public static int constructor = 0x64199744; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureFile extends SecureFile { - public static int constructor = 0xe0277a62; + public static class TL_secureFile extends SecureFile { + public static int constructor = 0xe0277a62; - public long id; - public long access_hash; - public int size; - public int dc_id; - public int date; - public byte[] file_hash; - public byte[] secret; + public long id; + public long access_hash; + public int size; + public int dc_id; + public int date; + public byte[] file_hash; + public byte[] secret; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - size = stream.readInt32(exception); - dc_id = stream.readInt32(exception); - date = stream.readInt32(exception); - file_hash = stream.readByteArray(exception); - secret = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + size = stream.readInt32(exception); + dc_id = stream.readInt32(exception); + date = stream.readInt32(exception); + file_hash = stream.readByteArray(exception); + secret = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32(size); - stream.writeInt32(dc_id); - stream.writeInt32(date); - stream.writeByteArray(file_hash); - stream.writeByteArray(secret); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32(size); + stream.writeInt32(dc_id); + stream.writeInt32(date); + stream.writeByteArray(file_hash); + stream.writeByteArray(secret); + } + } - public static class TL_messages_affectedMessages extends TLObject { - public static int constructor = 0x84d19185; + public static class TL_messages_affectedMessages extends TLObject { + public static int constructor = 0x84d19185; - public int pts; - public int pts_count; + public int pts; + public int pts_count; - public static TL_messages_affectedMessages TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messages_affectedMessages.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messages_affectedMessages", constructor)); - } else { - return null; - } - } - TL_messages_affectedMessages result = new TL_messages_affectedMessages(); - result.readParams(stream, exception); - return result; - } + public static TL_messages_affectedMessages TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_affectedMessages.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_affectedMessages", constructor)); + } else { + return null; + } + } + TL_messages_affectedMessages result = new TL_messages_affectedMessages(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - pts = stream.readInt32(exception); - pts_count = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + pts = stream.readInt32(exception); + pts_count = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(pts); - stream.writeInt32(pts_count); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(pts); + stream.writeInt32(pts_count); + } + } public static class TL_messages_chatInviteImporters extends TLObject { public static int constructor = 0x81b6b00a; @@ -4593,311 +4591,311 @@ public class TLRPC { } } - public static abstract class updates_Difference extends TLObject { - public ArrayList new_messages = new ArrayList<>(); - public ArrayList new_encrypted_messages = new ArrayList<>(); - public ArrayList other_updates = new ArrayList<>(); - public ArrayList chats = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); - public TL_updates_state state; - public TL_updates_state intermediate_state; - public int pts; - public int date; - public int seq; + public static abstract class updates_Difference extends TLObject { + public ArrayList new_messages = new ArrayList<>(); + public ArrayList new_encrypted_messages = new ArrayList<>(); + public ArrayList other_updates = new ArrayList<>(); + public ArrayList chats = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); + public TL_updates_state state; + public TL_updates_state intermediate_state; + public int pts; + public int date; + public int seq; - public static updates_Difference TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - updates_Difference result = null; - switch (constructor) { - case 0xf49ca0: - result = new TL_updates_difference(); - break; - case 0xa8fb1981: - result = new TL_updates_differenceSlice(); - break; - case 0x4afe8f6d: - result = new TL_updates_differenceTooLong(); - break; - case 0x5d75a138: - result = new TL_updates_differenceEmpty(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in updates_Difference", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static updates_Difference TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + updates_Difference result = null; + switch (constructor) { + case 0xf49ca0: + result = new TL_updates_difference(); + break; + case 0xa8fb1981: + result = new TL_updates_differenceSlice(); + break; + case 0x4afe8f6d: + result = new TL_updates_differenceTooLong(); + break; + case 0x5d75a138: + result = new TL_updates_differenceEmpty(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in updates_Difference", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_updates_difference extends updates_Difference { - public static int constructor = 0xf49ca0; + public static class TL_updates_difference extends updates_Difference { + public static int constructor = 0xf49ca0; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Message object = Message.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - new_messages.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - EncryptedMessage object = EncryptedMessage.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - new_encrypted_messages.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Update object = Update.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - other_updates.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - state = TL_updates_state.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Message object = Message.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + new_messages.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + EncryptedMessage object = EncryptedMessage.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + new_encrypted_messages.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Update object = Update.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + other_updates.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + state = TL_updates_state.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = new_messages.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - new_messages.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = new_encrypted_messages.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - new_encrypted_messages.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = other_updates.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - other_updates.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - state.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = new_messages.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + new_messages.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = new_encrypted_messages.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + new_encrypted_messages.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = other_updates.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + other_updates.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + state.serializeToStream(stream); + } + } - public static class TL_updates_differenceSlice extends updates_Difference { - public static int constructor = 0xa8fb1981; + public static class TL_updates_differenceSlice extends updates_Difference { + public static int constructor = 0xa8fb1981; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Message object = Message.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - new_messages.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - EncryptedMessage object = EncryptedMessage.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - new_encrypted_messages.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Update object = Update.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - other_updates.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - intermediate_state = TL_updates_state.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Message object = Message.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + new_messages.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + EncryptedMessage object = EncryptedMessage.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + new_encrypted_messages.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Update object = Update.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + other_updates.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + intermediate_state = TL_updates_state.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = new_messages.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - new_messages.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = new_encrypted_messages.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - new_encrypted_messages.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = other_updates.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - other_updates.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - intermediate_state.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = new_messages.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + new_messages.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = new_encrypted_messages.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + new_encrypted_messages.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = other_updates.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + other_updates.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + intermediate_state.serializeToStream(stream); + } + } - public static class TL_updates_differenceTooLong extends updates_Difference { - public static int constructor = 0x4afe8f6d; + public static class TL_updates_differenceTooLong extends updates_Difference { + public static int constructor = 0x4afe8f6d; - public void readParams(AbstractSerializedData stream, boolean exception) { - pts = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + pts = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(pts); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(pts); + } + } - public static class TL_updates_differenceEmpty extends updates_Difference { - public static int constructor = 0x5d75a138; + public static class TL_updates_differenceEmpty extends updates_Difference { + public static int constructor = 0x5d75a138; - public void readParams(AbstractSerializedData stream, boolean exception) { - date = stream.readInt32(exception); - seq = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + date = stream.readInt32(exception); + seq = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(date); - stream.writeInt32(seq); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(date); + stream.writeInt32(seq); + } + } public static abstract class PrivacyKey extends TLObject { @@ -5011,81 +5009,81 @@ public class TLRPC { } } - public static abstract class GeoPoint extends TLObject { + public static abstract class GeoPoint extends TLObject { public int flags; public double _long; public double lat; public int accuracy_radius; - public long access_hash; + public long access_hash; - public static GeoPoint TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - GeoPoint result = null; - switch (constructor) { - case 0x296f104: - result = new TL_geoPoint_layer119(); - break; - case 0x2049d70c: - result = new TL_geoPoint_layer81(); - break; - case 0x1117dd5f: - result = new TL_geoPointEmpty(); - break; + public static GeoPoint TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + GeoPoint result = null; + switch (constructor) { + case 0x296f104: + result = new TL_geoPoint_layer119(); + break; + case 0x2049d70c: + result = new TL_geoPoint_layer81(); + break; + case 0x1117dd5f: + result = new TL_geoPointEmpty(); + break; case 0xb2a2f663: result = new TL_geoPoint(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in GeoPoint", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in GeoPoint", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_geoPoint_layer119 extends TL_geoPoint { - public static int constructor = 0x296f104; + public static class TL_geoPoint_layer119 extends TL_geoPoint { + public static int constructor = 0x296f104; - public void readParams(AbstractSerializedData stream, boolean exception) { - _long = stream.readDouble(exception); - lat = stream.readDouble(exception); - access_hash = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + _long = stream.readDouble(exception); + lat = stream.readDouble(exception); + access_hash = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeDouble(_long); - stream.writeDouble(lat); - stream.writeInt64(access_hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeDouble(_long); + stream.writeDouble(lat); + stream.writeInt64(access_hash); + } + } - public static class TL_geoPoint_layer81 extends TL_geoPoint { - public static int constructor = 0x2049d70c; + public static class TL_geoPoint_layer81 extends TL_geoPoint { + public static int constructor = 0x2049d70c; - public void readParams(AbstractSerializedData stream, boolean exception) { - _long = stream.readDouble(exception); - lat = stream.readDouble(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + _long = stream.readDouble(exception); + lat = stream.readDouble(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeDouble(_long); - stream.writeDouble(lat); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeDouble(_long); + stream.writeDouble(lat); + } + } - public static class TL_geoPointEmpty extends GeoPoint { - public static int constructor = 0x1117dd5f; + public static class TL_geoPointEmpty extends GeoPoint { + public static int constructor = 0x1117dd5f; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_geoPoint extends GeoPoint { public static int constructor = 0xb2a2f663; @@ -5335,36 +5333,36 @@ public class TLRPC { } } - public static class TL_inputGroupCall extends TLObject { - public static int constructor = 0xd8aa840f; + public static class TL_inputGroupCall extends TLObject { + public static int constructor = 0xd8aa840f; - public long id; - public long access_hash; + public long id; + public long access_hash; - public static TL_inputGroupCall TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_inputGroupCall.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_inputGroupCall", constructor)); - } else { - return null; - } - } - TL_inputGroupCall result = new TL_inputGroupCall(); - result.readParams(stream, exception); - return result; - } + public static TL_inputGroupCall TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_inputGroupCall.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_inputGroupCall", constructor)); + } else { + return null; + } + } + TL_inputGroupCall result = new TL_inputGroupCall(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + } + } public static abstract class help_AppUpdate extends TLObject { @@ -5556,39 +5554,39 @@ public class TLRPC { } } - public static abstract class messages_FavedStickers extends TLObject { + public static abstract class messages_FavedStickers extends TLObject { public long hash; public ArrayList packs = new ArrayList<>(); public ArrayList stickers = new ArrayList<>(); - public static messages_FavedStickers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_FavedStickers result = null; - switch (constructor) { - case 0x9e8fa6d3: - result = new TL_messages_favedStickersNotModified(); - break; + public static messages_FavedStickers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_FavedStickers result = null; + switch (constructor) { + case 0x9e8fa6d3: + result = new TL_messages_favedStickersNotModified(); + break; case 0x2cb51097: result = new TL_messages_favedStickers(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_FavedStickers", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_FavedStickers", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messages_favedStickersNotModified extends messages_FavedStickers { - public static int constructor = 0x9e8fa6d3; + public static class TL_messages_favedStickersNotModified extends messages_FavedStickers { + public static int constructor = 0x9e8fa6d3; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messages_favedStickers extends messages_FavedStickers { public static int constructor = 0x2cb51097; @@ -5759,118 +5757,118 @@ public class TLRPC { } } - public static abstract class SendMessageAction extends TLObject { - public int progress; + public static abstract class SendMessageAction extends TLObject { + public int progress; - public static SendMessageAction TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - SendMessageAction result = null; - switch (constructor) { - case 0xdd6a8f48: - result = new TL_sendMessageGamePlayAction(); - break; - case 0xd52f73f7: - result = new TL_sendMessageRecordAudioAction(); - break; - case 0x92042ff7: - result = new TL_sendMessageUploadVideoAction_old(); - break; - case 0xe6ac8a6f: - result = new TL_sendMessageUploadAudioAction_old(); - break; - case 0xf351d7ab: - result = new TL_sendMessageUploadAudioAction(); - break; - case 0xd1d34a26: - result = new TL_sendMessageUploadPhotoAction(); - break; - case 0x8faee98e: - result = new TL_sendMessageUploadDocumentAction_old(); - break; - case 0xe9763aec: - result = new TL_sendMessageUploadVideoAction(); - break; - case 0xfd5ec8f5: - result = new TL_sendMessageCancelAction(); - break; - case 0x176f8ba1: - result = new TL_sendMessageGeoLocationAction(); - break; - case 0x628cbc6f: - result = new TL_sendMessageChooseContactAction(); - break; + public static SendMessageAction TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + SendMessageAction result = null; + switch (constructor) { + case 0xdd6a8f48: + result = new TL_sendMessageGamePlayAction(); + break; + case 0xd52f73f7: + result = new TL_sendMessageRecordAudioAction(); + break; + case 0x92042ff7: + result = new TL_sendMessageUploadVideoAction_old(); + break; + case 0xe6ac8a6f: + result = new TL_sendMessageUploadAudioAction_old(); + break; + case 0xf351d7ab: + result = new TL_sendMessageUploadAudioAction(); + break; + case 0xd1d34a26: + result = new TL_sendMessageUploadPhotoAction(); + break; + case 0x8faee98e: + result = new TL_sendMessageUploadDocumentAction_old(); + break; + case 0xe9763aec: + result = new TL_sendMessageUploadVideoAction(); + break; + case 0xfd5ec8f5: + result = new TL_sendMessageCancelAction(); + break; + case 0x176f8ba1: + result = new TL_sendMessageGeoLocationAction(); + break; + case 0x628cbc6f: + result = new TL_sendMessageChooseContactAction(); + break; case 0xb05ac6b1: result = new TL_sendMessageChooseStickerAction(); break; - case 0x88f27fbc: - result = new TL_sendMessageRecordRoundAction(); - break; - case 0x243e1c66: - result = new TL_sendMessageUploadRoundAction(); - break; - case 0x16bf744e: - result = new TL_sendMessageTypingAction(); - break; + case 0x88f27fbc: + result = new TL_sendMessageRecordRoundAction(); + break; + case 0x243e1c66: + result = new TL_sendMessageUploadRoundAction(); + break; + case 0x16bf744e: + result = new TL_sendMessageTypingAction(); + break; case 0xdbda9246: result = new TL_sendMessageHistoryImportAction(); break; - case 0x990a3c1a: - result = new TL_sendMessageUploadPhotoAction_old(); - break; - case 0xaa0cd9e4: - result = new TL_sendMessageUploadDocumentAction(); - break; + case 0x990a3c1a: + result = new TL_sendMessageUploadPhotoAction_old(); + break; + case 0xaa0cd9e4: + result = new TL_sendMessageUploadDocumentAction(); + break; case 0xd92c2285: result = new TL_speakingInGroupCallAction(); break; - case 0xa187d66f: - result = new TL_sendMessageRecordVideoAction(); - break; + case 0xa187d66f: + result = new TL_sendMessageRecordVideoAction(); + break; case 0x25972bcb: result = new TL_sendMessageEmojiInteraction(); break; case 0xb665902e: result = new TL_sendMessageEmojiInteractionSeen(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in SendMessageAction", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in SendMessageAction", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_sendMessageGamePlayAction extends SendMessageAction { - public static int constructor = 0xdd6a8f48; + public static class TL_sendMessageGamePlayAction extends SendMessageAction { + public static int constructor = 0xdd6a8f48; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_sendMessageRecordAudioAction extends SendMessageAction { - public static int constructor = 0xd52f73f7; + public static class TL_sendMessageRecordAudioAction extends SendMessageAction { + public static int constructor = 0xd52f73f7; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_sendMessageUploadVideoAction_old extends TL_sendMessageUploadVideoAction { - public static int constructor = 0x92042ff7; + public static class TL_sendMessageUploadVideoAction_old extends TL_sendMessageUploadVideoAction { + public static int constructor = 0x92042ff7; - public void readParams(AbstractSerializedData stream, boolean exception) { - } + public void readParams(AbstractSerializedData stream, boolean exception) { + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_sendMessageEmojiInteraction extends SendMessageAction { public static int constructor = 0x25972bcb; @@ -5894,97 +5892,97 @@ public class TLRPC { } public static class TL_sendMessageUploadAudioAction_old extends TL_sendMessageUploadAudioAction { - public static int constructor = 0xe6ac8a6f; + public static int constructor = 0xe6ac8a6f; - public void readParams(AbstractSerializedData stream, boolean exception) { - } + public void readParams(AbstractSerializedData stream, boolean exception) { + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_sendMessageUploadAudioAction extends SendMessageAction { - public static int constructor = 0xf351d7ab; + public static class TL_sendMessageUploadAudioAction extends SendMessageAction { + public static int constructor = 0xf351d7ab; - public void readParams(AbstractSerializedData stream, boolean exception) { - progress = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + progress = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(progress); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(progress); + } + } - public static class TL_sendMessageUploadPhotoAction extends SendMessageAction { - public static int constructor = 0xd1d34a26; + public static class TL_sendMessageUploadPhotoAction extends SendMessageAction { + public static int constructor = 0xd1d34a26; - public void readParams(AbstractSerializedData stream, boolean exception) { - progress = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + progress = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(progress); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(progress); + } + } - public static class TL_sendMessageUploadDocumentAction_old extends TL_sendMessageUploadDocumentAction { - public static int constructor = 0x8faee98e; + public static class TL_sendMessageUploadDocumentAction_old extends TL_sendMessageUploadDocumentAction { + public static int constructor = 0x8faee98e; - public void readParams(AbstractSerializedData stream, boolean exception) { - } + public void readParams(AbstractSerializedData stream, boolean exception) { + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_sendMessageUploadVideoAction extends SendMessageAction { - public static int constructor = 0xe9763aec; + public static class TL_sendMessageUploadVideoAction extends SendMessageAction { + public static int constructor = 0xe9763aec; - public void readParams(AbstractSerializedData stream, boolean exception) { - progress = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + progress = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(progress); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(progress); + } + } - public static class TL_sendMessageCancelAction extends SendMessageAction { - public static int constructor = 0xfd5ec8f5; + public static class TL_sendMessageCancelAction extends SendMessageAction { + public static int constructor = 0xfd5ec8f5; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_sendMessageGeoLocationAction extends SendMessageAction { - public static int constructor = 0x176f8ba1; + public static class TL_sendMessageGeoLocationAction extends SendMessageAction { + public static int constructor = 0x176f8ba1; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_sendMessageChooseContactAction extends SendMessageAction { - public static int constructor = 0x628cbc6f; + public static class TL_sendMessageChooseContactAction extends SendMessageAction { + public static int constructor = 0x628cbc6f; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_sendMessageChooseStickerAction extends SendMessageAction { public static int constructor = 0xb05ac6b1; @@ -5995,28 +5993,28 @@ public class TLRPC { } } - public static class TL_sendMessageRecordRoundAction extends SendMessageAction { - public static int constructor = 0x88f27fbc; + public static class TL_sendMessageRecordRoundAction extends SendMessageAction { + public static int constructor = 0x88f27fbc; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_sendMessageUploadRoundAction extends SendMessageAction { - public static int constructor = 0x243e1c66; + public static class TL_sendMessageUploadRoundAction extends SendMessageAction { + public static int constructor = 0x243e1c66; - public void readParams(AbstractSerializedData stream, boolean exception) { - progress = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + progress = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(progress); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(progress); + } + } public static class TL_sendMessageEmojiInteractionSeen extends SendMessageAction { public static int constructor = 0xb665902e; @@ -6033,14 +6031,14 @@ public class TLRPC { } } - public static class TL_sendMessageTypingAction extends SendMessageAction { - public static int constructor = 0x16bf744e; + public static class TL_sendMessageTypingAction extends SendMessageAction { + public static int constructor = 0x16bf744e; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_sendMessageHistoryImportAction extends SendMessageAction { public static int constructor = 0xdbda9246; @@ -6057,31 +6055,31 @@ public class TLRPC { } } - public static class TL_sendMessageUploadPhotoAction_old extends TL_sendMessageUploadPhotoAction { - public static int constructor = 0x990a3c1a; + public static class TL_sendMessageUploadPhotoAction_old extends TL_sendMessageUploadPhotoAction { + public static int constructor = 0x990a3c1a; - public void readParams(AbstractSerializedData stream, boolean exception) { - } + public void readParams(AbstractSerializedData stream, boolean exception) { + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_sendMessageUploadDocumentAction extends SendMessageAction { - public static int constructor = 0xaa0cd9e4; + public static class TL_sendMessageUploadDocumentAction extends SendMessageAction { + public static int constructor = 0xaa0cd9e4; - public void readParams(AbstractSerializedData stream, boolean exception) { - progress = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + progress = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(progress); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(progress); + } + } public static class TL_speakingInGroupCallAction extends SendMessageAction { public static int constructor = 0xd92c2285; @@ -6092,90 +6090,90 @@ public class TLRPC { } } - public static class TL_sendMessageRecordVideoAction extends SendMessageAction { - public static int constructor = 0xa187d66f; + public static class TL_sendMessageRecordVideoAction extends SendMessageAction { + public static int constructor = 0xa187d66f; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static abstract class auth_SentCodeType extends TLObject { - public int length; - public String pattern; + public static abstract class auth_SentCodeType extends TLObject { + public int length; + public String pattern; public String prefix; - public static auth_SentCodeType TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - auth_SentCodeType result = null; - switch (constructor) { - case 0x3dbb5986: - result = new TL_auth_sentCodeTypeApp(); - break; - case 0x5353e5a7: - result = new TL_auth_sentCodeTypeCall(); - break; - case 0xab03c6d9: - result = new TL_auth_sentCodeTypeFlashCall(); - break; + public static auth_SentCodeType TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + auth_SentCodeType result = null; + switch (constructor) { + case 0x3dbb5986: + result = new TL_auth_sentCodeTypeApp(); + break; + case 0x5353e5a7: + result = new TL_auth_sentCodeTypeCall(); + break; + case 0xab03c6d9: + result = new TL_auth_sentCodeTypeFlashCall(); + break; case 0x82006484: result = new TL_auth_sentCodeTypeMissedCall(); break; - case 0xc000bba2: - result = new TL_auth_sentCodeTypeSms(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in auth_SentCodeType", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0xc000bba2: + result = new TL_auth_sentCodeTypeSms(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in auth_SentCodeType", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_auth_sentCodeTypeApp extends auth_SentCodeType { - public static int constructor = 0x3dbb5986; + public static class TL_auth_sentCodeTypeApp extends auth_SentCodeType { + public static int constructor = 0x3dbb5986; - public void readParams(AbstractSerializedData stream, boolean exception) { - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(length); + } + } - public static class TL_auth_sentCodeTypeCall extends auth_SentCodeType { - public static int constructor = 0x5353e5a7; + public static class TL_auth_sentCodeTypeCall extends auth_SentCodeType { + public static int constructor = 0x5353e5a7; - public void readParams(AbstractSerializedData stream, boolean exception) { - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(length); + } + } - public static class TL_auth_sentCodeTypeFlashCall extends auth_SentCodeType { - public static int constructor = 0xab03c6d9; + public static class TL_auth_sentCodeTypeFlashCall extends auth_SentCodeType { + public static int constructor = 0xab03c6d9; - public void readParams(AbstractSerializedData stream, boolean exception) { - pattern = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + pattern = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(pattern); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(pattern); + } + } public static class TL_auth_sentCodeTypeMissedCall extends auth_SentCodeType { public static int constructor = 0x82006484; @@ -6192,84 +6190,84 @@ public class TLRPC { } } - public static class TL_auth_sentCodeTypeSms extends auth_SentCodeType { - public static int constructor = 0xc000bba2; + public static class TL_auth_sentCodeTypeSms extends auth_SentCodeType { + public static int constructor = 0xc000bba2; - public void readParams(AbstractSerializedData stream, boolean exception) { - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(length); + } + } - public static abstract class messages_StickerSetInstallResult extends TLObject { - public ArrayList sets = new ArrayList<>(); + public static abstract class messages_StickerSetInstallResult extends TLObject { + public ArrayList sets = new ArrayList<>(); - public static messages_StickerSetInstallResult TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_StickerSetInstallResult result = null; - switch (constructor) { - case 0x38641628: - result = new TL_messages_stickerSetInstallResultSuccess(); - break; - case 0x35e410a8: - result = new TL_messages_stickerSetInstallResultArchive(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_StickerSetInstallResult", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static messages_StickerSetInstallResult TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_StickerSetInstallResult result = null; + switch (constructor) { + case 0x38641628: + result = new TL_messages_stickerSetInstallResultSuccess(); + break; + case 0x35e410a8: + result = new TL_messages_stickerSetInstallResultArchive(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_StickerSetInstallResult", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messages_stickerSetInstallResultSuccess extends messages_StickerSetInstallResult { - public static int constructor = 0x38641628; + public static class TL_messages_stickerSetInstallResultSuccess extends messages_StickerSetInstallResult { + public static int constructor = 0x38641628; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_messages_stickerSetInstallResultArchive extends messages_StickerSetInstallResult { - public static int constructor = 0x35e410a8; + public static class TL_messages_stickerSetInstallResultArchive extends messages_StickerSetInstallResult { + public static int constructor = 0x35e410a8; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - StickerSetCovered object = StickerSetCovered.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - sets.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + StickerSetCovered object = StickerSetCovered.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + sets.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = sets.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - sets.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = sets.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + sets.get(a).serializeToStream(stream); + } + } + } public static class TL_peerSettings extends TLObject { public static int constructor = 0xa518110d; @@ -6482,133 +6480,133 @@ public class TLRPC { } } - public static class TL_channels_adminLogResults extends TLObject { - public static int constructor = 0xed8af74d; + public static class TL_channels_adminLogResults extends TLObject { + public static int constructor = 0xed8af74d; - public ArrayList events = new ArrayList<>(); - public ArrayList chats = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); + public ArrayList events = new ArrayList<>(); + public ArrayList chats = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); - public static TL_channels_adminLogResults TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_channels_adminLogResults.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_channels_adminLogResults", constructor)); - } else { - return null; - } - } - TL_channels_adminLogResults result = new TL_channels_adminLogResults(); - result.readParams(stream, exception); - return result; - } + public static TL_channels_adminLogResults TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_channels_adminLogResults.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_channels_adminLogResults", constructor)); + } else { + return null; + } + } + TL_channels_adminLogResults result = new TL_channels_adminLogResults(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_channelAdminLogEvent object = TL_channelAdminLogEvent.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - events.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_channelAdminLogEvent object = TL_channelAdminLogEvent.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + events.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = events.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - events.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = events.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + events.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } - public static class TL_inputPhoneContact extends TLObject { - public static int constructor = 0xf392b7f4; + public static class TL_inputPhoneContact extends TLObject { + public static int constructor = 0xf392b7f4; - public long client_id; - public String phone; - public String first_name; - public String last_name; + public long client_id; + public String phone; + public String first_name; + public String last_name; - public static TL_inputPhoneContact TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_inputPhoneContact.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_inputPhoneContact", constructor)); - } else { - return null; - } - } - TL_inputPhoneContact result = new TL_inputPhoneContact(); - result.readParams(stream, exception); - return result; - } + public static TL_inputPhoneContact TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_inputPhoneContact.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_inputPhoneContact", constructor)); + } else { + return null; + } + } + TL_inputPhoneContact result = new TL_inputPhoneContact(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - client_id = stream.readInt64(exception); - phone = stream.readString(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + client_id = stream.readInt64(exception); + phone = stream.readString(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(client_id); - stream.writeString(phone); - stream.writeString(first_name); - stream.writeString(last_name); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(client_id); + stream.writeString(phone); + stream.writeString(first_name); + stream.writeString(last_name); + } + } public static abstract class ThemeSettings extends TLObject { @@ -6797,36 +6795,36 @@ public class TLRPC { } } - public static class TL_pageCaption extends TLObject { - public static int constructor = 0x6f747657; + public static class TL_pageCaption extends TLObject { + public static int constructor = 0x6f747657; - public RichText text; - public RichText credit; + public RichText text; + public RichText credit; - public static TL_pageCaption TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_pageCaption.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_pageCaption", constructor)); - } else { - return null; - } - } - TL_pageCaption result = new TL_pageCaption(); - result.readParams(stream, exception); - return result; - } + public static TL_pageCaption TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_pageCaption.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_pageCaption", constructor)); + } else { + return null; + } + } + TL_pageCaption result = new TL_pageCaption(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - credit = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + credit = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - credit.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + credit.serializeToStream(stream); + } + } public static abstract class PrivacyRule extends TLObject { @@ -7088,194 +7086,194 @@ public class TLRPC { } } - public static class TL_messageMediaUnsupported_old extends TL_messageMediaUnsupported { - public static int constructor = 0x29632a36; + public static class TL_messageMediaUnsupported_old extends TL_messageMediaUnsupported { + public static int constructor = 0x29632a36; - public void readParams(AbstractSerializedData stream, boolean exception) { - bytes = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + bytes = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(bytes); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(bytes); + } + } - public static class TL_messageMediaAudio_layer45 extends MessageMedia { - public static int constructor = 0xc6b68300; + public static class TL_messageMediaAudio_layer45 extends MessageMedia { + public static int constructor = 0xc6b68300; - public void readParams(AbstractSerializedData stream, boolean exception) { - audio_unused = Audio.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + audio_unused = Audio.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - audio_unused.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + audio_unused.serializeToStream(stream); + } + } - public static class TL_messageMediaPhoto_old extends TL_messageMediaPhoto { - public static int constructor = 0xc8c45a2a; + public static class TL_messageMediaPhoto_old extends TL_messageMediaPhoto { + public static int constructor = 0xc8c45a2a; - public void readParams(AbstractSerializedData stream, boolean exception) { - photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - photo.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + photo.serializeToStream(stream); + } + } - public static class TL_messageMediaInvoice extends MessageMedia { - public static int constructor = 0x84551347; + public static class TL_messageMediaInvoice extends MessageMedia { + public static int constructor = 0x84551347; - public WebDocument photo; + public WebDocument photo; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - shipping_address_requested = (flags & 2) != 0; - test = (flags & 8) != 0; - title = stream.readString(exception); - description = stream.readString(exception); - if ((flags & 1) != 0) { - photo = WebDocument.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 4) != 0) { - receipt_msg_id = stream.readInt32(exception); - } - currency = stream.readString(exception); - total_amount = stream.readInt64(exception); - start_param = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + shipping_address_requested = (flags & 2) != 0; + test = (flags & 8) != 0; + title = stream.readString(exception); + description = stream.readString(exception); + if ((flags & 1) != 0) { + photo = WebDocument.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 4) != 0) { + receipt_msg_id = stream.readInt32(exception); + } + currency = stream.readString(exception); + total_amount = stream.readInt64(exception); + start_param = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = shipping_address_requested ? (flags | 2) : (flags &~ 2); - flags = test ? (flags | 8) : (flags &~ 8); - stream.writeInt32(flags); - stream.writeString(title); - stream.writeString(description); - if ((flags & 1) != 0) { - photo.serializeToStream(stream); - } - if ((flags & 4) != 0) { - stream.writeInt32(receipt_msg_id); - } - stream.writeString(currency); - stream.writeInt64(total_amount); - stream.writeString(start_param); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = shipping_address_requested ? (flags | 2) : (flags &~ 2); + flags = test ? (flags | 8) : (flags &~ 8); + stream.writeInt32(flags); + stream.writeString(title); + stream.writeString(description); + if ((flags & 1) != 0) { + photo.serializeToStream(stream); + } + if ((flags & 4) != 0) { + stream.writeInt32(receipt_msg_id); + } + stream.writeString(currency); + stream.writeInt64(total_amount); + stream.writeString(start_param); + } + } - public static class TL_messageMediaUnsupported extends MessageMedia { - public static int constructor = 0x9f84f49e; + public static class TL_messageMediaUnsupported extends MessageMedia { + public static int constructor = 0x9f84f49e; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_messageMediaEmpty extends MessageMedia { - public static int constructor = 0x3ded6320; + public static class TL_messageMediaEmpty extends MessageMedia { + public static int constructor = 0x3ded6320; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_messageMediaVenue extends MessageMedia { - public static int constructor = 0x2ec0533f; + public static class TL_messageMediaVenue extends MessageMedia { + public static int constructor = 0x2ec0533f; - public void readParams(AbstractSerializedData stream, boolean exception) { - geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); - title = stream.readString(exception); - address = stream.readString(exception); - provider = stream.readString(exception); - venue_id = stream.readString(exception); - venue_type = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); + title = stream.readString(exception); + address = stream.readString(exception); + provider = stream.readString(exception); + venue_id = stream.readString(exception); + venue_type = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - geo.serializeToStream(stream); - stream.writeString(title); - stream.writeString(address); - stream.writeString(provider); - stream.writeString(venue_id); - stream.writeString(venue_type); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + geo.serializeToStream(stream); + stream.writeString(title); + stream.writeString(address); + stream.writeString(provider); + stream.writeString(venue_id); + stream.writeString(venue_type); + } + } - public static class TL_messageMediaVenue_layer71 extends MessageMedia { - public static int constructor = 0x7912b71f; + public static class TL_messageMediaVenue_layer71 extends MessageMedia { + public static int constructor = 0x7912b71f; - public void readParams(AbstractSerializedData stream, boolean exception) { - geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); - title = stream.readString(exception); - address = stream.readString(exception); - provider = stream.readString(exception); - venue_id = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); + title = stream.readString(exception); + address = stream.readString(exception); + provider = stream.readString(exception); + venue_id = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - geo.serializeToStream(stream); - stream.writeString(title); - stream.writeString(address); - stream.writeString(provider); - stream.writeString(venue_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + geo.serializeToStream(stream); + stream.writeString(title); + stream.writeString(address); + stream.writeString(provider); + stream.writeString(venue_id); + } + } - public static class TL_messageMediaVideo_old extends TL_messageMediaVideo_layer45 { - public static int constructor = 0xa2d24290; + public static class TL_messageMediaVideo_old extends TL_messageMediaVideo_layer45 { + public static int constructor = 0xa2d24290; - public void readParams(AbstractSerializedData stream, boolean exception) { - video_unused = Video.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + video_unused = Video.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - video_unused.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + video_unused.serializeToStream(stream); + } + } - public static class TL_messageMediaDocument extends MessageMedia { - public static int constructor = 0x9cb070d7; + public static class TL_messageMediaDocument extends MessageMedia { + public static int constructor = 0x9cb070d7; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - if ((flags & 1) != 0) { - document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); - } else { - document = new TL_documentEmpty(); - } - if ((flags & 4) != 0) { - ttl_seconds = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + if ((flags & 1) != 0) { + document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + } else { + document = new TL_documentEmpty(); + } + if ((flags & 4) != 0) { + ttl_seconds = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - document.serializeToStream(stream); - } - if ((flags & 4) != 0) { - stream.writeInt32(ttl_seconds); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + document.serializeToStream(stream); + } + if ((flags & 4) != 0) { + stream.writeInt32(ttl_seconds); + } + } + } public static class TL_messageMediaDocument_layer74 extends TL_messageMediaDocument { public static int constructor = 0x7c4414d3; @@ -7286,8 +7284,8 @@ public class TLRPC { if ((flags & 1) != 0) { document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); } else { - document = new TL_documentEmpty(); - } + document = new TL_documentEmpty(); + } if ((flags & 2) != 0) { captionLegacy = stream.readString(exception); } @@ -7311,62 +7309,62 @@ public class TLRPC { } } - public static class TL_messageMediaDocument_old extends TL_messageMediaDocument { - public static int constructor = 0x2fda2204; + public static class TL_messageMediaDocument_old extends TL_messageMediaDocument { + public static int constructor = 0x2fda2204; - public void readParams(AbstractSerializedData stream, boolean exception) { - document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - document.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + document.serializeToStream(stream); + } + } - public static class TL_messageMediaDocument_layer68 extends TL_messageMediaDocument { - public static int constructor = 0xf3e02ea8; + public static class TL_messageMediaDocument_layer68 extends TL_messageMediaDocument { + public static int constructor = 0xf3e02ea8; - public void readParams(AbstractSerializedData stream, boolean exception) { - document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); - captionLegacy = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + captionLegacy = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - document.serializeToStream(stream); - stream.writeString(captionLegacy); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + document.serializeToStream(stream); + stream.writeString(captionLegacy); + } + } - public static class TL_messageMediaPhoto extends MessageMedia { - public static int constructor = 0x695150d7; + public static class TL_messageMediaPhoto extends MessageMedia { + public static int constructor = 0x695150d7; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - if ((flags & 1) != 0) { - photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - } else { - photo = new TL_photoEmpty(); - } - if ((flags & 4) != 0) { - ttl_seconds = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + if ((flags & 1) != 0) { + photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + } else { + photo = new TL_photoEmpty(); + } + if ((flags & 4) != 0) { + ttl_seconds = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - photo.serializeToStream(stream); - } - if ((flags & 4) != 0) { - stream.writeInt32(ttl_seconds); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + photo.serializeToStream(stream); + } + if ((flags & 4) != 0) { + stream.writeInt32(ttl_seconds); + } + } + } public static class TL_messageMediaPoll extends MessageMedia { public static int constructor = 0x4bd6e798; @@ -7394,8 +7392,8 @@ public class TLRPC { if ((flags & 1) != 0) { photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); } else { - photo = new TL_photoEmpty(); - } + photo = new TL_photoEmpty(); + } if ((flags & 2) != 0) { captionLegacy = stream.readString(exception); } @@ -7449,108 +7447,108 @@ public class TLRPC { } } - public static class TL_messageMediaGeoLive_layer119 extends TL_messageMediaGeoLive { - public static int constructor = 0x7c3c2609; + public static class TL_messageMediaGeoLive_layer119 extends TL_messageMediaGeoLive { + public static int constructor = 0x7c3c2609; - public void readParams(AbstractSerializedData stream, boolean exception) { - geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); - period = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); + period = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - geo.serializeToStream(stream); - stream.writeInt32(period); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + geo.serializeToStream(stream); + stream.writeInt32(period); + } + } - public static class TL_messageMediaGame extends MessageMedia { - public static int constructor = 0xfdb19008; + public static class TL_messageMediaGame extends MessageMedia { + public static int constructor = 0xfdb19008; - public void readParams(AbstractSerializedData stream, boolean exception) { - game = TL_game.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + game = TL_game.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - game.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + game.serializeToStream(stream); + } + } - public static class TL_messageMediaContact_layer81 extends TL_messageMediaContact { - public static int constructor = 0x5e7d2f39; + public static class TL_messageMediaContact_layer81 extends TL_messageMediaContact { + public static int constructor = 0x5e7d2f39; - public void readParams(AbstractSerializedData stream, boolean exception) { - phone_number = stream.readString(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - user_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + phone_number = stream.readString(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + user_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(phone_number); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeInt32((int) user_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(phone_number); + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeInt32((int) user_id); + } + } - public static class TL_messageMediaPhoto_layer68 extends TL_messageMediaPhoto { - public static int constructor = 0x3d8ce53d; + public static class TL_messageMediaPhoto_layer68 extends TL_messageMediaPhoto { + public static int constructor = 0x3d8ce53d; - public void readParams(AbstractSerializedData stream, boolean exception) { - photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - captionLegacy = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + captionLegacy = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - photo.serializeToStream(stream); - stream.writeString(captionLegacy); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + photo.serializeToStream(stream); + stream.writeString(captionLegacy); + } + } - public static class TL_messageMediaVideo_layer45 extends MessageMedia { - public static int constructor = 0x5bcf1675; + public static class TL_messageMediaVideo_layer45 extends MessageMedia { + public static int constructor = 0x5bcf1675; - public void readParams(AbstractSerializedData stream, boolean exception) { - video_unused = Video.TLdeserialize(stream, stream.readInt32(exception), exception); - captionLegacy = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + video_unused = Video.TLdeserialize(stream, stream.readInt32(exception), exception); + captionLegacy = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - video_unused.serializeToStream(stream); - stream.writeString(captionLegacy); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + video_unused.serializeToStream(stream); + stream.writeString(captionLegacy); + } + } - public static class TL_messageMediaContact_layer131 extends TL_messageMediaContact { - public static int constructor = 0xcbf24940; + public static class TL_messageMediaContact_layer131 extends TL_messageMediaContact { + public static int constructor = 0xcbf24940; - public void readParams(AbstractSerializedData stream, boolean exception) { - phone_number = stream.readString(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - vcard = stream.readString(exception); - user_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + phone_number = stream.readString(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + vcard = stream.readString(exception); + user_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(phone_number); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeString(vcard); - stream.writeInt32((int) user_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(phone_number); + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeString(vcard); + stream.writeInt32((int) user_id); + } + } public static class TL_messageMediaContact extends MessageMedia { public static int constructor = 0x70322949; @@ -7605,145 +7603,145 @@ public class TLRPC { } } - public static class TL_messageMediaGeo extends MessageMedia { - public static int constructor = 0x56e0d474; + public static class TL_messageMediaGeo extends MessageMedia { + public static int constructor = 0x56e0d474; - public void readParams(AbstractSerializedData stream, boolean exception) { - geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - geo.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + geo.serializeToStream(stream); + } + } - public static class TL_messageMediaWebPage extends MessageMedia { - public static int constructor = 0xa32dd600; + public static class TL_messageMediaWebPage extends MessageMedia { + public static int constructor = 0xa32dd600; - public void readParams(AbstractSerializedData stream, boolean exception) { - webpage = WebPage.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + webpage = WebPage.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - webpage.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + webpage.serializeToStream(stream); + } + } - public static abstract class LangPackString extends TLObject { - public int flags; - public String key; - public String zero_value; - public String one_value; - public String two_value; - public String few_value; - public String many_value; - public String other_value; - public String value; + public static abstract class LangPackString extends TLObject { + public int flags; + public String key; + public String zero_value; + public String one_value; + public String two_value; + public String few_value; + public String many_value; + public String other_value; + public String value; - public static LangPackString TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - LangPackString result = null; - switch (constructor) { - case 0x6c47ac9f: - result = new TL_langPackStringPluralized(); - break; - case 0xcad181f6: - result = new TL_langPackString(); - break; - case 0x2979eeb2: - result = new TL_langPackStringDeleted(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in LangPackString", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static LangPackString TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + LangPackString result = null; + switch (constructor) { + case 0x6c47ac9f: + result = new TL_langPackStringPluralized(); + break; + case 0xcad181f6: + result = new TL_langPackString(); + break; + case 0x2979eeb2: + result = new TL_langPackStringDeleted(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in LangPackString", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_langPackStringPluralized extends LangPackString { - public static int constructor = 0x6c47ac9f; + public static class TL_langPackStringPluralized extends LangPackString { + public static int constructor = 0x6c47ac9f; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - key = stream.readString(exception); - if ((flags & 1) != 0) { - zero_value = stream.readString(exception); - } - if ((flags & 2) != 0) { - one_value = stream.readString(exception); - } - if ((flags & 4) != 0) { - two_value = stream.readString(exception); - } - if ((flags & 8) != 0) { - few_value = stream.readString(exception); - } - if ((flags & 16) != 0) { - many_value = stream.readString(exception); - } - other_value = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + key = stream.readString(exception); + if ((flags & 1) != 0) { + zero_value = stream.readString(exception); + } + if ((flags & 2) != 0) { + one_value = stream.readString(exception); + } + if ((flags & 4) != 0) { + two_value = stream.readString(exception); + } + if ((flags & 8) != 0) { + few_value = stream.readString(exception); + } + if ((flags & 16) != 0) { + many_value = stream.readString(exception); + } + other_value = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeString(key); - if ((flags & 1) != 0) { - stream.writeString(zero_value); - } - if ((flags & 2) != 0) { - stream.writeString(one_value); - } - if ((flags & 4) != 0) { - stream.writeString(two_value); - } - if ((flags & 8) != 0) { - stream.writeString(few_value); - } - if ((flags & 16) != 0) { - stream.writeString(many_value); - } - stream.writeString(other_value); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeString(key); + if ((flags & 1) != 0) { + stream.writeString(zero_value); + } + if ((flags & 2) != 0) { + stream.writeString(one_value); + } + if ((flags & 4) != 0) { + stream.writeString(two_value); + } + if ((flags & 8) != 0) { + stream.writeString(few_value); + } + if ((flags & 16) != 0) { + stream.writeString(many_value); + } + stream.writeString(other_value); + } + } - public static class TL_langPackString extends LangPackString { - public static int constructor = 0xcad181f6; + public static class TL_langPackString extends LangPackString { + public static int constructor = 0xcad181f6; - public void readParams(AbstractSerializedData stream, boolean exception) { - key = stream.readString(exception); - value = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + key = stream.readString(exception); + value = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(key); - stream.writeString(value); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(key); + stream.writeString(value); + } + } - public static class TL_langPackStringDeleted extends LangPackString { - public static int constructor = 0x2979eeb2; + public static class TL_langPackStringDeleted extends LangPackString { + public static int constructor = 0x2979eeb2; - public void readParams(AbstractSerializedData stream, boolean exception) { - key = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + key = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(key); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(key); + } + } public static class TL_auth_sentCode extends TLObject { public static int constructor = 0x5e002502; @@ -7793,252 +7791,252 @@ public class TLRPC { } } - public static abstract class BotInlineResult extends TLObject { + public static abstract class BotInlineResult extends TLObject { - public int flags; - public String id; - public String type; - public Photo photo; - public Document document; - public String title; - public String description; - public String url; - public WebDocument thumb; - public WebDocument content; - public BotInlineMessage send_message; - public long query_id; + public int flags; + public String id; + public String type; + public Photo photo; + public Document document; + public String title; + public String description; + public String url; + public WebDocument thumb; + public WebDocument content; + public BotInlineMessage send_message; + public long query_id; - public static BotInlineResult TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - BotInlineResult result = null; - switch (constructor) { - case 0x11965f3a: - result = new TL_botInlineResult(); - break; - case 0x17db940b: - result = new TL_botInlineMediaResult(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in BotInlineResult", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static BotInlineResult TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + BotInlineResult result = null; + switch (constructor) { + case 0x11965f3a: + result = new TL_botInlineResult(); + break; + case 0x17db940b: + result = new TL_botInlineMediaResult(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in BotInlineResult", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_botInlineResult extends BotInlineResult { - public static int constructor = 0x11965f3a; + public static class TL_botInlineResult extends BotInlineResult { + public static int constructor = 0x11965f3a; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - id = stream.readString(exception); - type = stream.readString(exception); - if ((flags & 2) != 0) { - title = stream.readString(exception); - } - if ((flags & 4) != 0) { - description = stream.readString(exception); - } - if ((flags & 8) != 0) { - url = stream.readString(exception); - } - if ((flags & 16) != 0) { - thumb = WebDocument.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 32) != 0) { - content = WebDocument.TLdeserialize(stream, stream.readInt32(exception), exception); - } - send_message = BotInlineMessage.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + id = stream.readString(exception); + type = stream.readString(exception); + if ((flags & 2) != 0) { + title = stream.readString(exception); + } + if ((flags & 4) != 0) { + description = stream.readString(exception); + } + if ((flags & 8) != 0) { + url = stream.readString(exception); + } + if ((flags & 16) != 0) { + thumb = WebDocument.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 32) != 0) { + content = WebDocument.TLdeserialize(stream, stream.readInt32(exception), exception); + } + send_message = BotInlineMessage.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeString(id); - stream.writeString(type); - if ((flags & 2) != 0) { - stream.writeString(title); - } - if ((flags & 4) != 0) { - stream.writeString(description); - } - if ((flags & 8) != 0) { - stream.writeString(url); - } - if ((flags & 16) != 0) { - thumb.serializeToStream(stream); - } - if ((flags & 32) != 0) { - content.serializeToStream(stream); - } - send_message.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeString(id); + stream.writeString(type); + if ((flags & 2) != 0) { + stream.writeString(title); + } + if ((flags & 4) != 0) { + stream.writeString(description); + } + if ((flags & 8) != 0) { + stream.writeString(url); + } + if ((flags & 16) != 0) { + thumb.serializeToStream(stream); + } + if ((flags & 32) != 0) { + content.serializeToStream(stream); + } + send_message.serializeToStream(stream); + } + } - public static class TL_botInlineMediaResult extends BotInlineResult { - public static int constructor = 0x17db940b; + public static class TL_botInlineMediaResult extends BotInlineResult { + public static int constructor = 0x17db940b; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - id = stream.readString(exception); - type = stream.readString(exception); - if ((flags & 1) != 0) { - photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 2) != 0) { - document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 4) != 0) { - title = stream.readString(exception); - } - if ((flags & 8) != 0) { - description = stream.readString(exception); - } - send_message = BotInlineMessage.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + id = stream.readString(exception); + type = stream.readString(exception); + if ((flags & 1) != 0) { + photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 2) != 0) { + document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 4) != 0) { + title = stream.readString(exception); + } + if ((flags & 8) != 0) { + description = stream.readString(exception); + } + send_message = BotInlineMessage.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeString(id); - stream.writeString(type); - if ((flags & 1) != 0) { - photo.serializeToStream(stream); - } - if ((flags & 2) != 0) { - document.serializeToStream(stream); - } - if ((flags & 4) != 0) { - stream.writeString(title); - } - if ((flags & 8) != 0) { - stream.writeString(description); - } - send_message.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeString(id); + stream.writeString(type); + if ((flags & 1) != 0) { + photo.serializeToStream(stream); + } + if ((flags & 2) != 0) { + document.serializeToStream(stream); + } + if ((flags & 4) != 0) { + stream.writeString(title); + } + if ((flags & 8) != 0) { + stream.writeString(description); + } + send_message.serializeToStream(stream); + } + } - public static abstract class PeerNotifySettings extends TLObject { - public int flags; - public int mute_until; - public String sound; - public boolean show_previews; - public int events_mask; - public boolean silent; + public static abstract class PeerNotifySettings extends TLObject { + public int flags; + public int mute_until; + public String sound; + public boolean show_previews; + public int events_mask; + public boolean silent; - public static PeerNotifySettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - PeerNotifySettings result = null; - switch (constructor) { - case 0x9acda4c0: - result = new TL_peerNotifySettings_layer77(); - break; - case 0xaf509d20: - result = new TL_peerNotifySettings(); - break; - case 0x8d5e11ee: - result = new TL_peerNotifySettings_layer47(); - break; - case 0x70a68512: - result = new TL_peerNotifySettingsEmpty_layer77(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in PeerNotifySettings", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static PeerNotifySettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + PeerNotifySettings result = null; + switch (constructor) { + case 0x9acda4c0: + result = new TL_peerNotifySettings_layer77(); + break; + case 0xaf509d20: + result = new TL_peerNotifySettings(); + break; + case 0x8d5e11ee: + result = new TL_peerNotifySettings_layer47(); + break; + case 0x70a68512: + result = new TL_peerNotifySettingsEmpty_layer77(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in PeerNotifySettings", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_peerNotifySettings_layer77 extends TL_peerNotifySettings { - public static int constructor = 0x9acda4c0; + public static class TL_peerNotifySettings_layer77 extends TL_peerNotifySettings { + public static int constructor = 0x9acda4c0; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - show_previews = (flags & 1) != 0; - silent = (flags & 2) != 0; - mute_until = stream.readInt32(exception); - sound = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + show_previews = (flags & 1) != 0; + silent = (flags & 2) != 0; + mute_until = stream.readInt32(exception); + sound = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = show_previews ? (flags | 1) : (flags &~ 1); - flags = silent ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - stream.writeInt32(mute_until); - stream.writeString(sound); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = show_previews ? (flags | 1) : (flags &~ 1); + flags = silent ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + stream.writeInt32(mute_until); + stream.writeString(sound); + } + } - public static class TL_peerNotifySettings extends PeerNotifySettings { - public static int constructor = 0xaf509d20; + public static class TL_peerNotifySettings extends PeerNotifySettings { + public static int constructor = 0xaf509d20; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - if ((flags & 1) != 0) { - show_previews = stream.readBool(exception); - } - if ((flags & 2) != 0) { - silent = stream.readBool(exception); - } - if ((flags & 4) != 0) { - mute_until = stream.readInt32(exception); - } - if ((flags & 8) != 0) { - sound = stream.readString(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + if ((flags & 1) != 0) { + show_previews = stream.readBool(exception); + } + if ((flags & 2) != 0) { + silent = stream.readBool(exception); + } + if ((flags & 4) != 0) { + mute_until = stream.readInt32(exception); + } + if ((flags & 8) != 0) { + sound = stream.readString(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - stream.writeBool(show_previews); - } - if ((flags & 2) != 0) { - stream.writeBool(silent); - } - if ((flags & 4) != 0) { - stream.writeInt32(mute_until); - } - if ((flags & 8) != 0) { - stream.writeString(sound); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + stream.writeBool(show_previews); + } + if ((flags & 2) != 0) { + stream.writeBool(silent); + } + if ((flags & 4) != 0) { + stream.writeInt32(mute_until); + } + if ((flags & 8) != 0) { + stream.writeString(sound); + } + } + } - public static class TL_peerNotifySettings_layer47 extends TL_peerNotifySettings { - public static int constructor = 0x8d5e11ee; + public static class TL_peerNotifySettings_layer47 extends TL_peerNotifySettings { + public static int constructor = 0x8d5e11ee; - public void readParams(AbstractSerializedData stream, boolean exception) { - mute_until = stream.readInt32(exception); - sound = stream.readString(exception); - show_previews = stream.readBool(exception); - events_mask = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + mute_until = stream.readInt32(exception); + sound = stream.readString(exception); + show_previews = stream.readBool(exception); + events_mask = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(mute_until); - stream.writeString(sound); - stream.writeBool(show_previews); - stream.writeInt32(events_mask); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(mute_until); + stream.writeString(sound); + stream.writeBool(show_previews); + stream.writeInt32(events_mask); + } + } - public static class TL_peerNotifySettingsEmpty_layer77 extends PeerNotifySettings { - public static int constructor = 0x70a68512; + public static class TL_peerNotifySettingsEmpty_layer77 extends PeerNotifySettings { + public static int constructor = 0x70a68512; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static abstract class contacts_Blocked extends TLObject { @@ -8219,183 +8217,183 @@ public class TLRPC { } } - public static class TL_inputSecureValue extends TLObject { - public static int constructor = 0xdb21d0a7; + public static class TL_inputSecureValue extends TLObject { + public static int constructor = 0xdb21d0a7; - public int flags; - public SecureValueType type; - public TL_secureData data; - public InputSecureFile front_side; - public InputSecureFile reverse_side; - public InputSecureFile selfie; - public ArrayList translation = new ArrayList<>(); - public ArrayList files = new ArrayList<>(); - public SecurePlainData plain_data; + public int flags; + public SecureValueType type; + public TL_secureData data; + public InputSecureFile front_side; + public InputSecureFile reverse_side; + public InputSecureFile selfie; + public ArrayList translation = new ArrayList<>(); + public ArrayList files = new ArrayList<>(); + public SecurePlainData plain_data; - public static TL_inputSecureValue TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_inputSecureValue.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_inputSecureValue", constructor)); - } else { - return null; - } - } - TL_inputSecureValue result = new TL_inputSecureValue(); - result.readParams(stream, exception); - return result; - } + public static TL_inputSecureValue TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_inputSecureValue.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_inputSecureValue", constructor)); + } else { + return null; + } + } + TL_inputSecureValue result = new TL_inputSecureValue(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 1) != 0) { - data = TL_secureData.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 2) != 0) { - front_side = InputSecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 4) != 0) { - reverse_side = InputSecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 8) != 0) { - selfie = InputSecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 64) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - InputSecureFile object = InputSecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - translation.add(object); - } - } - if ((flags & 16) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - InputSecureFile object = InputSecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - files.add(object); - } - } - if ((flags & 32) != 0) { - plain_data = SecurePlainData.TLdeserialize(stream, stream.readInt32(exception), exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 1) != 0) { + data = TL_secureData.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 2) != 0) { + front_side = InputSecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 4) != 0) { + reverse_side = InputSecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 8) != 0) { + selfie = InputSecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 64) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + InputSecureFile object = InputSecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + translation.add(object); + } + } + if ((flags & 16) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + InputSecureFile object = InputSecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + files.add(object); + } + } + if ((flags & 32) != 0) { + plain_data = SecurePlainData.TLdeserialize(stream, stream.readInt32(exception), exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - type.serializeToStream(stream); - if ((flags & 1) != 0) { - data.serializeToStream(stream); - } - if ((flags & 2) != 0) { - front_side.serializeToStream(stream); - } - if ((flags & 4) != 0) { - reverse_side.serializeToStream(stream); - } - if ((flags & 8) != 0) { - selfie.serializeToStream(stream); - } - if ((flags & 64) != 0) { - stream.writeInt32(0x1cb5c415); - int count = translation.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - translation.get(a).serializeToStream(stream); - } - } - if ((flags & 16) != 0) { - stream.writeInt32(0x1cb5c415); - int count = files.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - files.get(a).serializeToStream(stream); - } - } - if ((flags & 32) != 0) { - plain_data.serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + type.serializeToStream(stream); + if ((flags & 1) != 0) { + data.serializeToStream(stream); + } + if ((flags & 2) != 0) { + front_side.serializeToStream(stream); + } + if ((flags & 4) != 0) { + reverse_side.serializeToStream(stream); + } + if ((flags & 8) != 0) { + selfie.serializeToStream(stream); + } + if ((flags & 64) != 0) { + stream.writeInt32(0x1cb5c415); + int count = translation.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + translation.get(a).serializeToStream(stream); + } + } + if ((flags & 16) != 0) { + stream.writeInt32(0x1cb5c415); + int count = files.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + files.get(a).serializeToStream(stream); + } + } + if ((flags & 32) != 0) { + plain_data.serializeToStream(stream); + } + } + } - public static abstract class messages_DhConfig extends TLObject { - public byte[] random; - public int g; - public byte[] p; - public int version; + public static abstract class messages_DhConfig extends TLObject { + public byte[] random; + public int g; + public byte[] p; + public int version; - public static messages_DhConfig TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_DhConfig result = null; - switch (constructor) { - case 0xc0e24635: - result = new TL_messages_dhConfigNotModified(); - break; - case 0x2c221edd: - result = new TL_messages_dhConfig(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_DhConfig", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static messages_DhConfig TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_DhConfig result = null; + switch (constructor) { + case 0xc0e24635: + result = new TL_messages_dhConfigNotModified(); + break; + case 0x2c221edd: + result = new TL_messages_dhConfig(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_DhConfig", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messages_dhConfigNotModified extends messages_DhConfig { - public static int constructor = 0xc0e24635; + public static class TL_messages_dhConfigNotModified extends messages_DhConfig { + public static int constructor = 0xc0e24635; - public void readParams(AbstractSerializedData stream, boolean exception) { - random = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + random = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(random); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(random); + } + } - public static class TL_messages_dhConfig extends messages_DhConfig { - public static int constructor = 0x2c221edd; + public static class TL_messages_dhConfig extends messages_DhConfig { + public static int constructor = 0x2c221edd; - public void readParams(AbstractSerializedData stream, boolean exception) { - g = stream.readInt32(exception); - p = stream.readByteArray(exception); - version = stream.readInt32(exception); - random = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + g = stream.readInt32(exception); + p = stream.readByteArray(exception); + version = stream.readInt32(exception); + random = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(g); - stream.writeByteArray(p); - stream.writeInt32(version); - stream.writeByteArray(random); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(g); + stream.writeByteArray(p); + stream.writeInt32(version); + stream.writeByteArray(random); + } + } public static class TL_globalPrivacySettings extends TLObject { public static int constructor = 0xbea2f424; @@ -8506,116 +8504,34 @@ public class TLRPC { } } - public static class TL_secureValueHash extends TLObject { - public static int constructor = 0xed1ecdb0; + public static class TL_secureValueHash extends TLObject { + public static int constructor = 0xed1ecdb0; - public SecureValueType type; - public byte[] hash; + public SecureValueType type; + public byte[] hash; - public static TL_secureValueHash TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_secureValueHash.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_secureValueHash", constructor)); - } else { - return null; - } - } - TL_secureValueHash result = new TL_secureValueHash(); - result.readParams(stream, exception); - return result; - } - - public void readParams(AbstractSerializedData stream, boolean exception) { - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - hash = stream.readByteArray(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeByteArray(hash); - } - } - - public static class TL_messageReactionsList extends TLObject { - public static int constructor = 0xe3ae6108; - - public int flags; - public int count; - public ArrayList reactions = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); - public String next_offset; - - public static TL_messageReactionsList TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messageReactionsList.constructor != constructor) { + public static TL_secureValueHash TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_secureValueHash.constructor != constructor) { if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messageReactionsList", constructor)); + throw new RuntimeException(String.format("can't parse magic %x in TL_secureValueHash", constructor)); } else { return null; } } - TL_messageReactionsList result = new TL_messageReactionsList(); + TL_secureValueHash result = new TL_secureValueHash(); result.readParams(stream, exception); return result; } public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - count = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_messageUserReaction object = TL_messageUserReaction.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - reactions.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - if ((flags & 1) != 0) { - next_offset = stream.readString(exception); - } + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + hash = stream.readByteArray(exception); } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeInt32(count); - stream.writeInt32(0x1cb5c415); - int count = reactions.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - reactions.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - if ((flags & 1) != 0) { - stream.writeString(next_offset); - } + type.serializeToStream(stream); + stream.writeByteArray(hash); } } @@ -8708,7 +8624,7 @@ public class TLRPC { } } - public static abstract class InputGeoPoint extends TLObject { + public static abstract class InputGeoPoint extends TLObject { public int flags; public double lat; @@ -8716,24 +8632,24 @@ public class TLRPC { public int accuracy_radius; public static InputGeoPoint TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - InputGeoPoint result = null; - switch (constructor) { + InputGeoPoint result = null; + switch (constructor) { case 0x48222faf: result = new TL_inputGeoPoint(); break; - case 0xe4c123d6: - result = new TL_inputGeoPointEmpty(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in InputGeoPoint", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0xe4c123d6: + result = new TL_inputGeoPointEmpty(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in InputGeoPoint", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } public static class TL_inputGeoPoint extends InputGeoPoint { public static int constructor = 0x48222faf; @@ -8759,207 +8675,207 @@ public class TLRPC { } } - public static class TL_inputGeoPointEmpty extends InputGeoPoint { - public static int constructor = 0xe4c123d6; + public static class TL_inputGeoPointEmpty extends InputGeoPoint { + public static int constructor = 0xe4c123d6; - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - } - } + } + } - public static class TL_help_inviteText extends TLObject { - public static int constructor = 0x18cb9f78; + public static class TL_help_inviteText extends TLObject { + public static int constructor = 0x18cb9f78; - public String message; + public String message; - public static TL_help_inviteText TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_help_inviteText.constructor != constructor) { - if (exception) { + public static TL_help_inviteText TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_help_inviteText.constructor != constructor) { + if (exception) { throw new RuntimeException(String.format("can't parse magic %x in TL_help_inviteText", constructor)); - } else { + } else { return null; - } - } + } + } TL_help_inviteText result = new TL_help_inviteText(); - result.readParams(stream, exception); - return result; - } + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - message = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + message = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeString(message); - } - } + stream.writeString(message); + } + } - public static abstract class Audio extends TLObject { - public long id; - public long access_hash; - public int date; - public int duration; - public String mime_type; - public int size; - public int dc_id; - public long user_id; - public byte[] key; - public byte[] iv; + public static abstract class Audio extends TLObject { + public long id; + public long access_hash; + public int date; + public int duration; + public String mime_type; + public int size; + public int dc_id; + public long user_id; + public byte[] key; + public byte[] iv; - public static Audio TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - Audio result = null; - switch (constructor) { - case 0x586988d8: - result = new TL_audioEmpty_layer45(); - break; - case 0xf9e35055: - result = new TL_audio_layer45(); - break; - case 0x427425e7: - result = new TL_audio_old(); - break; - case 0x555555F6: - result = new TL_audioEncrypted(); - break; - case 0xc7ac6496: - result = new TL_audio_old2(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in Audio", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static Audio TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + Audio result = null; + switch (constructor) { + case 0x586988d8: + result = new TL_audioEmpty_layer45(); + break; + case 0xf9e35055: + result = new TL_audio_layer45(); + break; + case 0x427425e7: + result = new TL_audio_old(); + break; + case 0x555555F6: + result = new TL_audioEncrypted(); + break; + case 0xc7ac6496: + result = new TL_audio_old2(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in Audio", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_audioEmpty_layer45 extends Audio { - public static int constructor = 0x586988d8; + public static class TL_audioEmpty_layer45 extends Audio { + public static int constructor = 0x586988d8; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + } + } - public static class TL_audio_layer45 extends Audio { - public static int constructor = 0xf9e35055; + public static class TL_audio_layer45 extends Audio { + public static int constructor = 0xf9e35055; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); - duration = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - dc_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + date = stream.readInt32(exception); + duration = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + dc_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32(date); - stream.writeInt32(duration); - stream.writeString(mime_type); - stream.writeInt32(size); - stream.writeInt32(dc_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32(date); + stream.writeInt32(duration); + stream.writeString(mime_type); + stream.writeInt32(size); + stream.writeInt32(dc_id); + } + } - public static class TL_audio_old extends TL_audio_layer45 { - public static int constructor = 0x427425e7; + public static class TL_audio_old extends TL_audio_layer45 { + public static int constructor = 0x427425e7; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - user_id = stream.readInt32(exception); - date = stream.readInt32(exception); - duration = stream.readInt32(exception); - size = stream.readInt32(exception); - dc_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + user_id = stream.readInt32(exception); + date = stream.readInt32(exception); + duration = stream.readInt32(exception); + size = stream.readInt32(exception); + dc_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32((int) user_id); - stream.writeInt32(date); - stream.writeInt32(duration); - stream.writeInt32(size); - stream.writeInt32(dc_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32((int) user_id); + stream.writeInt32(date); + stream.writeInt32(duration); + stream.writeInt32(size); + stream.writeInt32(dc_id); + } + } - public static class TL_audioEncrypted extends TL_audio_layer45 { - public static int constructor = 0x555555F6; + public static class TL_audioEncrypted extends TL_audio_layer45 { + public static int constructor = 0x555555F6; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - user_id = stream.readInt32(exception); - date = stream.readInt32(exception); - duration = stream.readInt32(exception); - size = stream.readInt32(exception); - dc_id = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + user_id = stream.readInt32(exception); + date = stream.readInt32(exception); + duration = stream.readInt32(exception); + size = stream.readInt32(exception); + dc_id = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32((int) user_id); - stream.writeInt32(date); - stream.writeInt32(duration); - stream.writeInt32(size); - stream.writeInt32(dc_id); - stream.writeByteArray(key); - stream.writeByteArray(iv); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32((int) user_id); + stream.writeInt32(date); + stream.writeInt32(duration); + stream.writeInt32(size); + stream.writeInt32(dc_id); + stream.writeByteArray(key); + stream.writeByteArray(iv); + } + } - public static class TL_audio_old2 extends TL_audio_layer45 { - public static int constructor = 0xc7ac6496; + public static class TL_audio_old2 extends TL_audio_layer45 { + public static int constructor = 0xc7ac6496; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - user_id = stream.readInt32(exception); - date = stream.readInt32(exception); - duration = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - dc_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + user_id = stream.readInt32(exception); + date = stream.readInt32(exception); + duration = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + dc_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32((int) user_id); - stream.writeInt32(date); - stream.writeInt32(duration); - stream.writeString(mime_type); - stream.writeInt32(size); - stream.writeInt32(dc_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32((int) user_id); + stream.writeInt32(date); + stream.writeInt32(duration); + stream.writeString(mime_type); + stream.writeInt32(size); + stream.writeInt32(dc_id); + } + } public static class TL_help_country extends TLObject { public static int constructor = 0xc3878e23; @@ -9027,69 +8943,69 @@ public class TLRPC { } } - public static abstract class SecurePasswordKdfAlgo extends TLObject { + public static abstract class SecurePasswordKdfAlgo extends TLObject { - public static SecurePasswordKdfAlgo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - SecurePasswordKdfAlgo result = null; - switch (constructor) { - case 0xbbf2dda0: - result = new TL_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(); - break; - case 0x86471d92: - result = new TL_securePasswordKdfAlgoSHA512(); - break; - case 0x4a8537: - result = new TL_securePasswordKdfAlgoUnknown(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in SecurePasswordKdfAlgo", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static SecurePasswordKdfAlgo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + SecurePasswordKdfAlgo result = null; + switch (constructor) { + case 0xbbf2dda0: + result = new TL_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(); + break; + case 0x86471d92: + result = new TL_securePasswordKdfAlgoSHA512(); + break; + case 0x4a8537: + result = new TL_securePasswordKdfAlgoUnknown(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in SecurePasswordKdfAlgo", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000 extends SecurePasswordKdfAlgo { - public static int constructor = 0xbbf2dda0; + public static class TL_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000 extends SecurePasswordKdfAlgo { + public static int constructor = 0xbbf2dda0; - public byte[] salt; + public byte[] salt; - public void readParams(AbstractSerializedData stream, boolean exception) { - salt = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + salt = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(salt); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(salt); + } + } - public static class TL_securePasswordKdfAlgoSHA512 extends SecurePasswordKdfAlgo { - public static int constructor = 0x86471d92; + public static class TL_securePasswordKdfAlgoSHA512 extends SecurePasswordKdfAlgo { + public static int constructor = 0x86471d92; - public byte[] salt; + public byte[] salt; - public void readParams(AbstractSerializedData stream, boolean exception) { - salt = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + salt = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(salt); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(salt); + } + } - public static class TL_securePasswordKdfAlgoUnknown extends SecurePasswordKdfAlgo { - public static int constructor = 0x4a8537; + public static class TL_securePasswordKdfAlgoUnknown extends SecurePasswordKdfAlgo { + public static int constructor = 0x4a8537; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messages_historyImport extends TLObject { public static int constructor = 0x1662af0b; @@ -9119,124 +9035,124 @@ public class TLRPC { } } - public static abstract class BotInfo extends TLObject { - public long user_id; - public String description; - public ArrayList commands = new ArrayList<>(); - public int version; + public static abstract class BotInfo extends TLObject { + public long user_id; + public String description; + public ArrayList commands = new ArrayList<>(); + public int version; - public static BotInfo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - BotInfo result = null; - switch (constructor) { - case 0xbb2e37ce: - result = new TL_botInfoEmpty_layer48(); - break; - case 0x98e81d3a: - result = new TL_botInfo_layer131(); - break; - case 0x9cf585d: - result = new TL_botInfo_layer48(); - break; + public static BotInfo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + BotInfo result = null; + switch (constructor) { + case 0xbb2e37ce: + result = new TL_botInfoEmpty_layer48(); + break; + case 0x98e81d3a: + result = new TL_botInfo_layer131(); + break; + case 0x9cf585d: + result = new TL_botInfo_layer48(); + break; case 0x1b74b335: result = new TL_botInfo(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in BotInfo", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in BotInfo", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_botInfoEmpty_layer48 extends TL_botInfo { - public static int constructor = 0xbb2e37ce; + public static class TL_botInfoEmpty_layer48 extends TL_botInfo { + public static int constructor = 0xbb2e37ce; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_botInfo_layer131 extends TL_botInfo { - public static int constructor = 0x98e81d3a; + public static class TL_botInfo_layer131 extends TL_botInfo { + public static int constructor = 0x98e81d3a; - public void readParams(AbstractSerializedData stream, boolean exception) { - user_id = stream.readInt32(exception); - description = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_botCommand object = TL_botCommand.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - commands.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + user_id = stream.readInt32(exception); + description = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_botCommand object = TL_botCommand.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + commands.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) user_id); - stream.writeString(description); - stream.writeInt32(0x1cb5c415); - int count = commands.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - commands.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) user_id); + stream.writeString(description); + stream.writeInt32(0x1cb5c415); + int count = commands.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + commands.get(a).serializeToStream(stream); + } + } + } - public static class TL_botInfo_layer48 extends TL_botInfo { - public static int constructor = 0x9cf585d; + public static class TL_botInfo_layer48 extends TL_botInfo { + public static int constructor = 0x9cf585d; - public void readParams(AbstractSerializedData stream, boolean exception) { - user_id = stream.readInt32(exception); - version = stream.readInt32(exception); - stream.readString(exception); - description = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_botCommand object = TL_botCommand.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - commands.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + user_id = stream.readInt32(exception); + version = stream.readInt32(exception); + stream.readString(exception); + description = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_botCommand object = TL_botCommand.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + commands.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) user_id); - stream.writeInt32(version); - stream.writeString(""); - stream.writeString(description); - stream.writeInt32(0x1cb5c415); - int count = commands.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - commands.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) user_id); + stream.writeInt32(version); + stream.writeString(""); + stream.writeString(description); + stream.writeInt32(0x1cb5c415); + int count = commands.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + commands.get(a).serializeToStream(stream); + } + } + } public static class TL_botInfo extends BotInfo { public static int constructor = 0x1b74b335; @@ -9275,63 +9191,63 @@ public class TLRPC { } } - public static abstract class InputGame extends TLObject { - public InputUser bot_id; - public String short_name; - public long id; - public long access_hash; + public static abstract class InputGame extends TLObject { + public InputUser bot_id; + public String short_name; + public long id; + public long access_hash; - public static InputGame TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - InputGame result = null; - switch (constructor) { - case 0xc331e80a: - result = new TL_inputGameShortName(); - break; - case 0x32c3e77: - result = new TL_inputGameID(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in InputGame", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static InputGame TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + InputGame result = null; + switch (constructor) { + case 0xc331e80a: + result = new TL_inputGameShortName(); + break; + case 0x32c3e77: + result = new TL_inputGameID(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in InputGame", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_inputGameShortName extends InputGame { - public static int constructor = 0xc331e80a; + public static class TL_inputGameShortName extends InputGame { + public static int constructor = 0xc331e80a; - public void readParams(AbstractSerializedData stream, boolean exception) { - bot_id = InputUser.TLdeserialize(stream, stream.readInt32(exception), exception); - short_name = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + bot_id = InputUser.TLdeserialize(stream, stream.readInt32(exception), exception); + short_name = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - bot_id.serializeToStream(stream); - stream.writeString(short_name); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + bot_id.serializeToStream(stream); + stream.writeString(short_name); + } + } - public static class TL_inputGameID extends InputGame { - public static int constructor = 0x32c3e77; + public static class TL_inputGameID extends InputGame { + public static int constructor = 0x32c3e77; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + } + } public static abstract class MessageReplies extends TLObject { @@ -9911,178 +9827,178 @@ public class TLRPC { } } - public static abstract class contacts_Contacts extends TLObject { - public ArrayList contacts = new ArrayList<>(); - public int saved_count; - public ArrayList users = new ArrayList<>(); + public static abstract class contacts_Contacts extends TLObject { + public ArrayList contacts = new ArrayList<>(); + public int saved_count; + public ArrayList users = new ArrayList<>(); - public static contacts_Contacts TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - contacts_Contacts result = null; - switch (constructor) { - case 0xb74ba9d2: - result = new TL_contacts_contactsNotModified(); - break; - case 0xeae87e42: - result = new TL_contacts_contacts(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in contacts_Contacts", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static contacts_Contacts TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + contacts_Contacts result = null; + switch (constructor) { + case 0xb74ba9d2: + result = new TL_contacts_contactsNotModified(); + break; + case 0xeae87e42: + result = new TL_contacts_contacts(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in contacts_Contacts", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_contacts_contactsNotModified extends contacts_Contacts { - public static int constructor = 0xb74ba9d2; + public static class TL_contacts_contactsNotModified extends contacts_Contacts { + public static int constructor = 0xb74ba9d2; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_contacts_contacts extends contacts_Contacts { - public static int constructor = 0xeae87e42; + public static class TL_contacts_contacts extends contacts_Contacts { + public static int constructor = 0xeae87e42; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_contact object = TL_contact.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - contacts.add(object); - } - saved_count = stream.readInt32(exception); - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_contact object = TL_contact.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + contacts.add(object); + } + saved_count = stream.readInt32(exception); + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = contacts.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - contacts.get(a).serializeToStream(stream); - } - stream.writeInt32(saved_count); - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = contacts.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + contacts.get(a).serializeToStream(stream); + } + stream.writeInt32(saved_count); + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } - public static abstract class SecureRequiredType extends TLObject { + public static abstract class SecureRequiredType extends TLObject { - public static SecureRequiredType TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - SecureRequiredType result = null; - switch (constructor) { - case 0x829d99da: - result = new TL_secureRequiredType(); - break; - case 0x27477b4: - result = new TL_secureRequiredTypeOneOf(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in SecureRequiredType", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static SecureRequiredType TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + SecureRequiredType result = null; + switch (constructor) { + case 0x829d99da: + result = new TL_secureRequiredType(); + break; + case 0x27477b4: + result = new TL_secureRequiredTypeOneOf(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in SecureRequiredType", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_secureRequiredType extends SecureRequiredType { - public static int constructor = 0x829d99da; + public static class TL_secureRequiredType extends SecureRequiredType { + public static int constructor = 0x829d99da; - public int flags; - public boolean native_names; - public boolean selfie_required; - public boolean translation_required; - public SecureValueType type; + public int flags; + public boolean native_names; + public boolean selfie_required; + public boolean translation_required; + public SecureValueType type; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - native_names = (flags & 1) != 0; - selfie_required = (flags & 2) != 0; - translation_required = (flags & 4) != 0; - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + native_names = (flags & 1) != 0; + selfie_required = (flags & 2) != 0; + translation_required = (flags & 4) != 0; + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = native_names ? (flags | 1) : (flags &~ 1); - flags = selfie_required ? (flags | 2) : (flags &~ 2); - flags = translation_required ? (flags | 4) : (flags &~ 4); - stream.writeInt32(flags); - type.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = native_names ? (flags | 1) : (flags &~ 1); + flags = selfie_required ? (flags | 2) : (flags &~ 2); + flags = translation_required ? (flags | 4) : (flags &~ 4); + stream.writeInt32(flags); + type.serializeToStream(stream); + } + } - public static class TL_secureRequiredTypeOneOf extends SecureRequiredType { - public static int constructor = 0x27477b4; + public static class TL_secureRequiredTypeOneOf extends SecureRequiredType { + public static int constructor = 0x27477b4; - public ArrayList types = new ArrayList<>(); + public ArrayList types = new ArrayList<>(); - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - SecureRequiredType object = SecureRequiredType.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - types.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + SecureRequiredType object = SecureRequiredType.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + types.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = types.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - types.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = types.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + types.get(a).serializeToStream(stream); + } + } + } public static abstract class InputPrivacyKey extends TLObject { @@ -10349,137 +10265,137 @@ public class TLRPC { } } - public static abstract class photos_Photos extends TLObject { - public ArrayList photos = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); - public int count; + public static abstract class photos_Photos extends TLObject { + public ArrayList photos = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); + public int count; - public static photos_Photos TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - photos_Photos result = null; - switch (constructor) { - case 0x8dca6aa5: - result = new TL_photos_photos(); - break; - case 0x15051f54: - result = new TL_photos_photosSlice(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in photos_Photos", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static photos_Photos TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + photos_Photos result = null; + switch (constructor) { + case 0x8dca6aa5: + result = new TL_photos_photos(); + break; + case 0x15051f54: + result = new TL_photos_photosSlice(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in photos_Photos", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_photos_photos extends photos_Photos { - public static int constructor = 0x8dca6aa5; + public static class TL_photos_photos extends photos_Photos { + public static int constructor = 0x8dca6aa5; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Photo object = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - photos.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = photos.size(); - stream.writeInt32(count); + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); for (int a = 0; a < count; a++) { - photos.get(a).serializeToStream(stream); + Photo object = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + photos.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = photos.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + photos.get(a).serializeToStream(stream); } stream.writeInt32(0x1cb5c415); count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } - public static class TL_photos_photosSlice extends photos_Photos { - public static int constructor = 0x15051f54; + public static class TL_photos_photosSlice extends photos_Photos { + public static int constructor = 0x15051f54; - public void readParams(AbstractSerializedData stream, boolean exception) { - count = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + public void readParams(AbstractSerializedData stream, boolean exception) { + count = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); } return; - } - int count = stream.readInt32(exception); + } + int count = stream.readInt32(exception); for (int a = 0; a < count; a++) { Photo object = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; + if (object == null) { + return; } photos.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(count); - stream.writeInt32(0x1cb5c415); - int count = photos.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(count); + stream.writeInt32(0x1cb5c415); + int count = photos.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { photos.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); + } + stream.writeInt32(0x1cb5c415); count = users.size(); stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); } } } @@ -10531,18 +10447,23 @@ public class TLRPC { public String theme_emoticon; public int requests_pending; public Peer default_send_as; + public ArrayList available_reactions = new ArrayList<>(); + public long inviterId; //custom public int invitesCount; //custom public static ChatFull TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { ChatFull result = null; switch (constructor) { - case 0x46a6ffb4: + case 0xd18ee226: result = new TL_chatFull(); break; - case 0x56662e2e: + case 0xe13c3d20: result = new TL_channelFull(); break; + case 0x56662e2e: + result = new TL_channelFull_layer135(); + break; case 0x59cff963: result = new TL_channelFull_layer134(); break; @@ -10627,6 +10548,9 @@ public class TLRPC { case 0xedd2a791: result = new TL_chatFull_layer92(); break; + case 0x46a6ffb4: + result = new TL_chatFull_layer135(); + break; case 0xfab31aa3: result = new TL_channelFull_old(); break; @@ -11857,7 +11781,7 @@ public class TLRPC { } } - public static class TL_chatFull extends ChatFull { + public static class TL_chatFull_layer135 extends ChatFull { public static int constructor = 0x46a6ffb4; public void readParams(AbstractSerializedData stream, boolean exception) { @@ -11982,7 +11906,7 @@ public class TLRPC { } } - public static class TL_channelFull extends ChatFull { + public static class TL_channelFull_layer135 extends ChatFull { public static int constructor = 0x56662e2e; public void readParams(AbstractSerializedData stream, boolean exception) { @@ -12682,6 +12606,419 @@ public class TLRPC { } } + public static class TL_chatFull extends ChatFull { + public static int constructor = 0xd18ee226; + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + can_set_username = (flags & 128) != 0; + has_scheduled = (flags & 256) != 0; + id = stream.readInt64(exception); + about = stream.readString(exception); + participants = ChatParticipants.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 4) != 0) { + chat_photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + } + notify_settings = PeerNotifySettings.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 8192) != 0) { + exported_invite = ExportedChatInvite.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 8) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + BotInfo object = BotInfo.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + bot_info.add(object); + } + } + if ((flags & 64) != 0) { + pinned_msg_id = stream.readInt32(exception); + } + if ((flags & 2048) != 0) { + folder_id = stream.readInt32(exception); + } + if ((flags & 4096) != 0) { + call = TL_inputGroupCall.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 16384) != 0) { + ttl_period = stream.readInt32(exception); + } + if ((flags & 32768) != 0) { + groupcall_default_join_as = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 65536) != 0) { + theme_emoticon = stream.readString(exception); + } + if ((flags & 131072) != 0) { + requests_pending = stream.readInt32(exception); + } + if ((flags & 131072) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + recent_requesters.add(stream.readInt64(exception)); + } + } + if ((flags & 262144) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + available_reactions.add(stream.readString(exception)); + } + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = can_set_username ? (flags | 128) : (flags &~ 128); + flags = has_scheduled ? (flags | 256) : (flags &~ 256); + stream.writeInt32(flags); + stream.writeInt64(id); + stream.writeString(about); + participants.serializeToStream(stream); + if ((flags & 4) != 0) { + chat_photo.serializeToStream(stream); + } + notify_settings.serializeToStream(stream); + if ((flags & 8192) != 0) { + exported_invite.serializeToStream(stream); + } + if ((flags & 8) != 0) { + stream.writeInt32(0x1cb5c415); + int count = bot_info.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + bot_info.get(a).serializeToStream(stream); + } + } + if ((flags & 64) != 0) { + stream.writeInt32(pinned_msg_id); + } + if ((flags & 2048) != 0) { + stream.writeInt32(folder_id); + } + if ((flags & 4096) != 0) { + call.serializeToStream(stream); + } + if ((flags & 16384) != 0) { + stream.writeInt32(ttl_period); + } + if ((flags & 32768) != 0) { + groupcall_default_join_as.serializeToStream(stream); + } + if ((flags & 65536) != 0) { + stream.writeString(theme_emoticon); + } + if ((flags & 131072) != 0) { + stream.writeInt32(requests_pending); + } + if ((flags & 131072) != 0) { + stream.writeInt32(0x1cb5c415); + int count = recent_requesters.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt64(recent_requesters.get(a)); + } + } + if ((flags & 262144) != 0) { + stream.writeInt32(0x1cb5c415); + int count = available_reactions.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeString(available_reactions.get(a)); + } + } + } + } + + public static class TL_channelFull extends ChatFull { + public static int constructor = 0xe13c3d20; + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + can_view_participants = (flags & 8) != 0; + can_set_username = (flags & 64) != 0; + can_set_stickers = (flags & 128) != 0; + hidden_prehistory = (flags & 1024) != 0; + can_set_location = (flags & 65536) != 0; + has_scheduled = (flags & 524288) != 0; + can_view_stats = (flags & 1048576) != 0; + blocked = (flags & 4194304) != 0; + id = stream.readInt64(exception); + about = stream.readString(exception); + if ((flags & 1) != 0) { + participants_count = stream.readInt32(exception); + } + if ((flags & 2) != 0) { + admins_count = stream.readInt32(exception); + } + if ((flags & 4) != 0) { + kicked_count = stream.readInt32(exception); + } + if ((flags & 4) != 0) { + banned_count = stream.readInt32(exception); + } + if ((flags & 8192) != 0) { + online_count = stream.readInt32(exception); + } + read_inbox_max_id = stream.readInt32(exception); + read_outbox_max_id = stream.readInt32(exception); + unread_count = stream.readInt32(exception); + chat_photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + notify_settings = PeerNotifySettings.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 8388608) != 0) { + exported_invite = ExportedChatInvite.TLdeserialize(stream, stream.readInt32(exception), exception); + } + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + BotInfo object = BotInfo.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + bot_info.add(object); + } + if ((flags & 16) != 0) { + migrated_from_chat_id = stream.readInt64(exception); + } + if ((flags & 16) != 0) { + migrated_from_max_id = stream.readInt32(exception); + } + if ((flags & 32) != 0) { + pinned_msg_id = stream.readInt32(exception); + } + if ((flags & 256) != 0) { + stickerset = StickerSet.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 512) != 0) { + available_min_id = stream.readInt32(exception); + } + if ((flags & 2048) != 0) { + folder_id = stream.readInt32(exception); + } + if ((flags & 16384) != 0) { + linked_chat_id = stream.readInt64(exception); + } + if ((flags & 32768) != 0) { + location = ChannelLocation.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 131072) != 0) { + slowmode_seconds = stream.readInt32(exception); + } + if ((flags & 262144) != 0) { + slowmode_next_send_date = stream.readInt32(exception); + } + if ((flags & 4096) != 0) { + stats_dc = stream.readInt32(exception); + } + pts = stream.readInt32(exception); + if ((flags & 2097152) != 0) { + call = TL_inputGroupCall.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 16777216) != 0) { + ttl_period = stream.readInt32(exception); + } + if ((flags & 33554432) != 0) { + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + pending_suggestions.add(stream.readString(exception)); + } + } + if ((flags & 67108864) != 0) { + groupcall_default_join_as = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 134217728) != 0) { + theme_emoticon = stream.readString(exception); + } + if ((flags & 268435456) != 0) { + requests_pending = stream.readInt32(exception); + } + if ((flags & 268435456) != 0) { + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + recent_requesters.add(stream.readInt64(exception)); + } + } + if ((flags & 536870912) != 0) { + default_send_as = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 1073741824) != 0) { + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + available_reactions.add(stream.readString(exception)); + } + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = can_view_participants ? (flags | 8) : (flags &~ 8); + flags = can_set_username ? (flags | 64) : (flags &~ 64); + flags = can_set_stickers ? (flags | 128) : (flags &~ 128); + flags = hidden_prehistory ? (flags | 1024) : (flags &~ 1024); + flags = can_set_location ? (flags | 65536) : (flags &~ 65536); + flags = has_scheduled ? (flags | 524288) : (flags &~ 524288); + flags = can_view_stats ? (flags | 1048576) : (flags &~ 1048576); + flags = blocked ? (flags | 4194304) : (flags &~ 4194304); + stream.writeInt32(flags); + stream.writeInt64(id); + stream.writeString(about); + if ((flags & 1) != 0) { + stream.writeInt32(participants_count); + } + if ((flags & 2) != 0) { + stream.writeInt32(admins_count); + } + if ((flags & 4) != 0) { + stream.writeInt32(kicked_count); + } + if ((flags & 4) != 0) { + stream.writeInt32(banned_count); + } + if ((flags & 8192) != 0) { + stream.writeInt32(online_count); + } + stream.writeInt32(read_inbox_max_id); + stream.writeInt32(read_outbox_max_id); + stream.writeInt32(unread_count); + chat_photo.serializeToStream(stream); + notify_settings.serializeToStream(stream); + if ((flags & 8388608) != 0) { + exported_invite.serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + int count = bot_info.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + bot_info.get(a).serializeToStream(stream); + } + if ((flags & 16) != 0) { + stream.writeInt64(migrated_from_chat_id); + } + if ((flags & 16) != 0) { + stream.writeInt32(migrated_from_max_id); + } + if ((flags & 32) != 0) { + stream.writeInt32(pinned_msg_id); + } + if ((flags & 256) != 0) { + stickerset.serializeToStream(stream); + } + if ((flags & 512) != 0) { + stream.writeInt32(available_min_id); + } + if ((flags & 2048) != 0) { + stream.writeInt32(folder_id); + } + if ((flags & 16384) != 0) { + stream.writeInt64(linked_chat_id); + } + if ((flags & 32768) != 0) { + location.serializeToStream(stream); + } + if ((flags & 131072) != 0) { + stream.writeInt32(slowmode_seconds); + } + if ((flags & 262144) != 0) { + stream.writeInt32(slowmode_next_send_date); + } + if ((flags & 4096) != 0) { + stream.writeInt32(stats_dc); + } + stream.writeInt32(pts); + if ((flags & 2097152) != 0) { + call.serializeToStream(stream); + } + if ((flags & 16777216) != 0) { + stream.writeInt32(ttl_period); + } + if ((flags & 33554432) != 0) { + stream.writeInt32(0x1cb5c415); + count = pending_suggestions.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeString(pending_suggestions.get(a)); + } + } + if ((flags & 67108864) != 0) { + groupcall_default_join_as.serializeToStream(stream); + } + if ((flags & 134217728) != 0) { + stream.writeString(theme_emoticon); + } + if ((flags & 268435456) != 0) { + stream.writeInt32(requests_pending); + } + if ((flags & 268435456) != 0) { + stream.writeInt32(0x1cb5c415); + count = recent_requesters.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt64(recent_requesters.get(a)); + } + } + if ((flags & 536870912) != 0) { + default_send_as.serializeToStream(stream); + } + if ((flags & 1073741824) != 0) { + stream.writeInt32(0x1cb5c415); + count = available_reactions.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeString(available_reactions.get(a)); + } + } + } + } + public static class TL_channelFull_layer131 extends TL_channelFull { public static int constructor = 0x548c3f93; @@ -14877,61 +15214,61 @@ public class TLRPC { } } - public static class TL_inputPeerNotifySettings extends TLObject { - public static int constructor = 0x9c3d198e; + public static class TL_inputPeerNotifySettings extends TLObject { + public static int constructor = 0x9c3d198e; - public int flags; - public boolean show_previews; - public boolean silent; - public int mute_until; - public String sound; + public int flags; + public boolean show_previews; + public boolean silent; + public int mute_until; + public String sound; - public static TL_inputPeerNotifySettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_inputPeerNotifySettings.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_inputPeerNotifySettings", constructor)); - } else { - return null; - } - } - TL_inputPeerNotifySettings result = new TL_inputPeerNotifySettings(); - result.readParams(stream, exception); - return result; - } + public static TL_inputPeerNotifySettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_inputPeerNotifySettings.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_inputPeerNotifySettings", constructor)); + } else { + return null; + } + } + TL_inputPeerNotifySettings result = new TL_inputPeerNotifySettings(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - if ((flags & 1) != 0) { - show_previews = stream.readBool(exception); - } - if ((flags & 2) != 0) { - silent = stream.readBool(exception); - } - if ((flags & 4) != 0) { - mute_until = stream.readInt32(exception); - } - if ((flags & 8) != 0) { - sound = stream.readString(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + if ((flags & 1) != 0) { + show_previews = stream.readBool(exception); + } + if ((flags & 2) != 0) { + silent = stream.readBool(exception); + } + if ((flags & 4) != 0) { + mute_until = stream.readInt32(exception); + } + if ((flags & 8) != 0) { + sound = stream.readString(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - stream.writeBool(show_previews); - } - if ((flags & 2) != 0) { - stream.writeBool(silent); - } - if ((flags & 4) != 0) { - stream.writeInt32(mute_until); - } - if ((flags & 8) != 0) { - stream.writeString(sound); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + stream.writeBool(show_previews); + } + if ((flags & 2) != 0) { + stream.writeBool(silent); + } + if ((flags & 4) != 0) { + stream.writeInt32(mute_until); + } + if ((flags & 8) != 0) { + stream.writeString(sound); + } + } + } public static abstract class auth_LoginToken extends TLObject { @@ -15175,27 +15512,27 @@ public class TLRPC { } } - public static class TL_null extends TLObject { - public static int constructor = 0x56730bcc; + public static class TL_null extends TLObject { + public static int constructor = 0x56730bcc; - public static TL_null TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_null.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_null", constructor)); - } else { - return null; - } - } - TL_null result = new TL_null(); - result.readParams(stream, exception); - return result; + public static TL_null TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_null.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_null", constructor)); + } else { + return null; + } + } + TL_null result = new TL_null(); + result.readParams(stream, exception); + return result; } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + stream.writeInt32(constructor); + } + } public static abstract class Page extends TLObject { @@ -15715,58 +16052,58 @@ public class TLRPC { } } - public static class TL_topPeerCategoryPeers extends TLObject { - public static int constructor = 0xfb834291; + public static class TL_topPeerCategoryPeers extends TLObject { + public static int constructor = 0xfb834291; - public TopPeerCategory category; - public int count; - public ArrayList peers = new ArrayList<>(); + public TopPeerCategory category; + public int count; + public ArrayList peers = new ArrayList<>(); - public static TL_topPeerCategoryPeers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_topPeerCategoryPeers.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_topPeerCategoryPeers", constructor)); - } else { - return null; - } - } - TL_topPeerCategoryPeers result = new TL_topPeerCategoryPeers(); - result.readParams(stream, exception); - return result; - } + public static TL_topPeerCategoryPeers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_topPeerCategoryPeers.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_topPeerCategoryPeers", constructor)); + } else { + return null; + } + } + TL_topPeerCategoryPeers result = new TL_topPeerCategoryPeers(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - category = TopPeerCategory.TLdeserialize(stream, stream.readInt32(exception), exception); - count = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_topPeer object = TL_topPeer.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - peers.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + category = TopPeerCategory.TLdeserialize(stream, stream.readInt32(exception), exception); + count = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_topPeer object = TL_topPeer.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + peers.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - category.serializeToStream(stream); - stream.writeInt32(count); - stream.writeInt32(0x1cb5c415); - int count = peers.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - peers.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + category.serializeToStream(stream); + stream.writeInt32(count); + stream.writeInt32(0x1cb5c415); + int count = peers.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + peers.get(a).serializeToStream(stream); + } + } + } public static abstract class InputUser extends TLObject { @@ -15853,14 +16190,14 @@ public class TLRPC { } } - public static abstract class KeyboardButton extends TLObject { - public String text; - public String url; - public int flags; - public boolean same_peer; - public String query; - public byte[] data; - public int button_id; + public static abstract class KeyboardButton extends TLObject { + public String text; + public String url; + public int flags; + public boolean same_peer; + public String query; + public byte[] data; + public int button_id; public boolean request_write_access; public InputUser bot; public String fwd_text; @@ -15872,48 +16209,48 @@ public class TLRPC { public static KeyboardButton TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { KeyboardButton result = null; switch (constructor) { - case 0xd02e7fd4: - result = new TL_inputKeyboardButtonUrlAuth(); - break; - case 0xa2fa4880: - result = new TL_keyboardButton(); - break; - case 0xfc796b3f: - result = new TL_keyboardButtonRequestGeoLocation(); - break; - case 0x258aff05: - result = new TL_keyboardButtonUrl(); + case 0xb16a6c29: + result = new TL_keyboardButtonRequestPhone(); break; case 0x50f41ccf: result = new TL_keyboardButtonGame(); break; - case 0x683a5e46: - result = new TL_keyboardButtonCallback_layer117(); + case 0x258aff05: + result = new TL_keyboardButtonUrl(); break; case 0x568a748: result = new TL_keyboardButtonSwitchInline(); break; - case 0xb16a6c29: - result = new TL_keyboardButtonRequestPhone(); + case 0xfc796b3f: + result = new TL_keyboardButtonRequestGeoLocation(); break; case 0x10b78d29: result = new TL_keyboardButtonUrlAuth(); break; + case 0xd02e7fd4: + result = new TL_inputKeyboardButtonUrlAuth(); + break; case 0xbbc7515d: result = new TL_keyboardButtonRequestPoll(); break; case 0xafd93fbb: result = new TL_keyboardButtonBuy(); break; + case 0x683a5e46: + result = new TL_keyboardButtonCallback_layer117(); + break; + case 0xa2fa4880: + result = new TL_keyboardButton(); + break; + case 0x35bbdb6b: + result = new TL_keyboardButtonCallback(); + break; case 0xe988037b: result = new TL_inputKeyboardButtonUserProfile(); break; case 0x308660c1: result = new TL_keyboardButtonUserProfile(); break; - case 0x35bbdb6b: - result = new TL_keyboardButtonCallback(); - break; } if (result == null && exception) { throw new RuntimeException(String.format("can't parse magic %x in KeyboardButton", constructor)); @@ -15925,83 +16262,83 @@ public class TLRPC { } } - public static class TL_keyboardButtonRequestPhone extends KeyboardButton { - public static int constructor = 0xb16a6c29; + public static class TL_keyboardButtonRequestPhone extends KeyboardButton { + public static int constructor = 0xb16a6c29; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(text); + } + } - public static class TL_keyboardButtonGame extends KeyboardButton { - public static int constructor = 0x50f41ccf; + public static class TL_keyboardButtonGame extends KeyboardButton { + public static int constructor = 0x50f41ccf; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(text); + } + } - public static class TL_keyboardButtonUrl extends KeyboardButton { - public static int constructor = 0x258aff05; + public static class TL_keyboardButtonUrl extends KeyboardButton { + public static int constructor = 0x258aff05; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = stream.readString(exception); - url = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = stream.readString(exception); + url = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(text); - stream.writeString(url); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(text); + stream.writeString(url); + } + } - public static class TL_keyboardButtonSwitchInline extends KeyboardButton { - public static int constructor = 0x568a748; + public static class TL_keyboardButtonSwitchInline extends KeyboardButton { + public static int constructor = 0x568a748; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - same_peer = (flags & 1) != 0; - text = stream.readString(exception); - query = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + same_peer = (flags & 1) != 0; + text = stream.readString(exception); + query = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = same_peer ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeString(text); - stream.writeString(query); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = same_peer ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeString(text); + stream.writeString(query); + } + } - public static class TL_keyboardButtonRequestGeoLocation extends KeyboardButton { - public static int constructor = 0xfc796b3f; + public static class TL_keyboardButtonRequestGeoLocation extends KeyboardButton { + public static int constructor = 0xfc796b3f; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(text); + } + } public static class TL_keyboardButtonUrlAuth extends KeyboardButton { public static int constructor = 0x10b78d29; @@ -16079,6 +16416,20 @@ public class TLRPC { } } + public static class TL_keyboardButtonBuy extends KeyboardButton { + public static int constructor = 0xafd93fbb; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + text = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(text); + } + } + public static class TL_inputKeyboardButtonUserProfile extends KeyboardButton { public static int constructor = 0xe988037b; @@ -16109,20 +16460,6 @@ public class TLRPC { } } - public static class TL_keyboardButtonBuy extends KeyboardButton { - public static int constructor = 0xafd93fbb; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - text = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(text); - } - } - public static class TL_keyboardButtonCallback extends KeyboardButton { public static int constructor = 0x35bbdb6b; @@ -16143,35 +16480,35 @@ public class TLRPC { } } - public static class TL_keyboardButtonCallback_layer117 extends TL_keyboardButtonCallback { - public static int constructor = 0x683a5e46; + public static class TL_keyboardButtonCallback_layer117 extends TL_keyboardButtonCallback { + public static int constructor = 0x683a5e46; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = stream.readString(exception); - data = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = stream.readString(exception); + data = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(text); - stream.writeByteArray(data); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(text); + stream.writeByteArray(data); + } + } - public static class TL_keyboardButton extends KeyboardButton { - public static int constructor = 0xa2fa4880; + public static class TL_keyboardButton extends KeyboardButton { + public static int constructor = 0xa2fa4880; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(text); + } + } public static abstract class VideoSize extends TLObject { @@ -16729,92 +17066,92 @@ public class TLRPC { } } - public static class TL_keyboardButtonRow extends TLObject { - public static int constructor = 0x77608b83; + public static class TL_keyboardButtonRow extends TLObject { + public static int constructor = 0x77608b83; - public ArrayList buttons = new ArrayList<>(); + public ArrayList buttons = new ArrayList<>(); - public static TL_keyboardButtonRow TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_keyboardButtonRow.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_keyboardButtonRow", constructor)); - } else { - return null; - } - } - TL_keyboardButtonRow result = new TL_keyboardButtonRow(); - result.readParams(stream, exception); - return result; - } + public static TL_keyboardButtonRow TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_keyboardButtonRow.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_keyboardButtonRow", constructor)); + } else { + return null; + } + } + TL_keyboardButtonRow result = new TL_keyboardButtonRow(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - KeyboardButton object = KeyboardButton.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - buttons.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + KeyboardButton object = KeyboardButton.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + buttons.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = buttons.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - buttons.get(a).serializeToStream(stream); - } - } - } + stream.writeInt32(0x1cb5c415); + int count = buttons.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + buttons.get(a).serializeToStream(stream); + } + } + } - public static abstract class Bool extends TLObject { + public static abstract class Bool extends TLObject { - public static Bool TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - Bool result = null; - switch (constructor) { - case 0x997275b5: - result = new TL_boolTrue(); + public static Bool TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + Bool result = null; + switch (constructor) { + case 0x997275b5: + result = new TL_boolTrue(); break; case 0xbc799737: - result = new TL_boolFalse(); + result = new TL_boolFalse(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in Bool", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in Bool", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_boolTrue extends Bool { - public static int constructor = 0x997275b5; + public static class TL_boolTrue extends Bool { + public static int constructor = 0x997275b5; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_boolFalse extends Bool { - public static int constructor = 0xbc799737; + public static class TL_boolFalse extends Bool { + public static int constructor = 0xbc799737; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messages_discussionMessage extends TLObject { public static int constructor = 0xa6341782; @@ -17039,71 +17376,71 @@ public class TLRPC { } } - public static abstract class WebPage extends TLObject { - public int flags; - public long id; - public String url; - public String display_url; - public int hash; - public String type; - public String site_name; - public String title; - public String description; - public Photo photo; - public String embed_url; - public String embed_type; - public int embed_width; - public int embed_height; - public int duration; - public String author; - public Document document; - public Page cached_page; - public int date; + public static abstract class WebPage extends TLObject { + public int flags; + public long id; + public String url; + public String display_url; + public int hash; + public String type; + public String site_name; + public String title; + public String description; + public Photo photo; + public String embed_url; + public String embed_type; + public int embed_width; + public int embed_height; + public int duration; + public String author; + public Document document; + public Page cached_page; + public int date; public ArrayList attributes = new ArrayList<>(); - public static WebPage TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - WebPage result = null; - switch (constructor) { + public static WebPage TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + WebPage result = null; + switch (constructor) { case 0xe89c45b2: result = new TL_webPage(); break; case 0xfa64e172: result = new TL_webPage_layer107(); break; - case 0x5f07b4bc: - result = new TL_webPage_layer104(); - break; - case 0xa31ea0b5: - result = new TL_webPage_old(); - break; - case 0xeb1477e8: - result = new TL_webPageEmpty(); - break; - case 0xd41a5167: - result = new TL_webPageUrlPending(); - break; + case 0x5f07b4bc: + result = new TL_webPage_layer104(); + break; + case 0xa31ea0b5: + result = new TL_webPage_old(); + break; + case 0xeb1477e8: + result = new TL_webPageEmpty(); + break; + case 0xd41a5167: + result = new TL_webPageUrlPending(); + break; case 0x7311ca11: result = new TL_webPageNotModified(); break; - case 0xc586da1c: - result = new TL_webPagePending(); - break; - case 0x85849473: - result = new TL_webPageNotModified_layer110(); - break; - case 0xca820ed7: - result = new TL_webPage_layer58(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in WebPage", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0xc586da1c: + result = new TL_webPagePending(); + break; + case 0x85849473: + result = new TL_webPageNotModified_layer110(); + break; + case 0xca820ed7: + result = new TL_webPage_layer58(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in WebPage", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } public static class TL_webPage extends WebPage { public static int constructor = 0xe89c45b2; @@ -17353,244 +17690,244 @@ public class TLRPC { } } - public static class TL_webPage_layer104 extends TL_webPage { - public static int constructor = 0x5f07b4bc; + public static class TL_webPage_layer104 extends TL_webPage { + public static int constructor = 0x5f07b4bc; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - id = stream.readInt64(exception); - url = stream.readString(exception); - display_url = stream.readString(exception); - hash = stream.readInt32(exception); - if ((flags & 1) != 0) { - type = stream.readString(exception); - } - if ((flags & 2) != 0) { - site_name = stream.readString(exception); - } - if ((flags & 4) != 0) { - title = stream.readString(exception); - } - if ((flags & 8) != 0) { - description = stream.readString(exception); - } - if ((flags & 16) != 0) { - photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 32) != 0) { - embed_url = stream.readString(exception); - } - if ((flags & 32) != 0) { - embed_type = stream.readString(exception); - } - if ((flags & 64) != 0) { - embed_width = stream.readInt32(exception); - } - if ((flags & 64) != 0) { - embed_height = stream.readInt32(exception); - } - if ((flags & 128) != 0) { - duration = stream.readInt32(exception); - } - if ((flags & 256) != 0) { - author = stream.readString(exception); - } - if ((flags & 512) != 0) { - document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 1024) != 0) { - cached_page = Page.TLdeserialize(stream, stream.readInt32(exception), exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + id = stream.readInt64(exception); + url = stream.readString(exception); + display_url = stream.readString(exception); + hash = stream.readInt32(exception); + if ((flags & 1) != 0) { + type = stream.readString(exception); + } + if ((flags & 2) != 0) { + site_name = stream.readString(exception); + } + if ((flags & 4) != 0) { + title = stream.readString(exception); + } + if ((flags & 8) != 0) { + description = stream.readString(exception); + } + if ((flags & 16) != 0) { + photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 32) != 0) { + embed_url = stream.readString(exception); + } + if ((flags & 32) != 0) { + embed_type = stream.readString(exception); + } + if ((flags & 64) != 0) { + embed_width = stream.readInt32(exception); + } + if ((flags & 64) != 0) { + embed_height = stream.readInt32(exception); + } + if ((flags & 128) != 0) { + duration = stream.readInt32(exception); + } + if ((flags & 256) != 0) { + author = stream.readString(exception); + } + if ((flags & 512) != 0) { + document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 1024) != 0) { + cached_page = Page.TLdeserialize(stream, stream.readInt32(exception), exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeInt64(id); - stream.writeString(url); - stream.writeString(display_url); - stream.writeInt32(hash); - if ((flags & 1) != 0) { - stream.writeString(type); - } - if ((flags & 2) != 0) { - stream.writeString(site_name); - } - if ((flags & 4) != 0) { - stream.writeString(title); - } - if ((flags & 8) != 0) { - stream.writeString(description); - } - if ((flags & 16) != 0) { - photo.serializeToStream(stream); - } - if ((flags & 32) != 0) { - stream.writeString(embed_url); - } - if ((flags & 32) != 0) { - stream.writeString(embed_type); - } - if ((flags & 64) != 0) { - stream.writeInt32(embed_width); - } - if ((flags & 64) != 0) { - stream.writeInt32(embed_height); - } - if ((flags & 128) != 0) { - stream.writeInt32(duration); - } - if ((flags & 256) != 0) { - stream.writeString(author); - } - if ((flags & 512) != 0) { - document.serializeToStream(stream); - } - if ((flags & 1024) != 0) { - cached_page.serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeInt64(id); + stream.writeString(url); + stream.writeString(display_url); + stream.writeInt32(hash); + if ((flags & 1) != 0) { + stream.writeString(type); + } + if ((flags & 2) != 0) { + stream.writeString(site_name); + } + if ((flags & 4) != 0) { + stream.writeString(title); + } + if ((flags & 8) != 0) { + stream.writeString(description); + } + if ((flags & 16) != 0) { + photo.serializeToStream(stream); + } + if ((flags & 32) != 0) { + stream.writeString(embed_url); + } + if ((flags & 32) != 0) { + stream.writeString(embed_type); + } + if ((flags & 64) != 0) { + stream.writeInt32(embed_width); + } + if ((flags & 64) != 0) { + stream.writeInt32(embed_height); + } + if ((flags & 128) != 0) { + stream.writeInt32(duration); + } + if ((flags & 256) != 0) { + stream.writeString(author); + } + if ((flags & 512) != 0) { + document.serializeToStream(stream); + } + if ((flags & 1024) != 0) { + cached_page.serializeToStream(stream); + } + } + } - public static class TL_webPage_old extends TL_webPage { - public static int constructor = 0xa31ea0b5; + public static class TL_webPage_old extends TL_webPage { + public static int constructor = 0xa31ea0b5; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - id = stream.readInt64(exception); - url = stream.readString(exception); - display_url = stream.readString(exception); - if ((flags & 1) != 0) { - type = stream.readString(exception); - } - if ((flags & 2) != 0) { - site_name = stream.readString(exception); - } - if ((flags & 4) != 0) { - title = stream.readString(exception); - } - if ((flags & 8) != 0) { - description = stream.readString(exception); - } - if ((flags & 16) != 0) { - photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 32) != 0) { - embed_url = stream.readString(exception); - } - if ((flags & 32) != 0) { - embed_type = stream.readString(exception); - } - if ((flags & 64) != 0) { - embed_width = stream.readInt32(exception); - } - if ((flags & 64) != 0) { - embed_height = stream.readInt32(exception); - } - if ((flags & 128) != 0) { - duration = stream.readInt32(exception); - } - if ((flags & 256) != 0) { - author = stream.readString(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + id = stream.readInt64(exception); + url = stream.readString(exception); + display_url = stream.readString(exception); + if ((flags & 1) != 0) { + type = stream.readString(exception); + } + if ((flags & 2) != 0) { + site_name = stream.readString(exception); + } + if ((flags & 4) != 0) { + title = stream.readString(exception); + } + if ((flags & 8) != 0) { + description = stream.readString(exception); + } + if ((flags & 16) != 0) { + photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 32) != 0) { + embed_url = stream.readString(exception); + } + if ((flags & 32) != 0) { + embed_type = stream.readString(exception); + } + if ((flags & 64) != 0) { + embed_width = stream.readInt32(exception); + } + if ((flags & 64) != 0) { + embed_height = stream.readInt32(exception); + } + if ((flags & 128) != 0) { + duration = stream.readInt32(exception); + } + if ((flags & 256) != 0) { + author = stream.readString(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeInt64(id); - stream.writeString(url); - stream.writeString(display_url); - if ((flags & 1) != 0) { - stream.writeString(type); - } - if ((flags & 2) != 0) { - stream.writeString(site_name); - } - if ((flags & 4) != 0) { - stream.writeString(title); - } - if ((flags & 8) != 0) { - stream.writeString(description); - } - if ((flags & 16) != 0) { - photo.serializeToStream(stream); - } - if ((flags & 32) != 0) { - stream.writeString(embed_url); - } - if ((flags & 32) != 0) { - stream.writeString(embed_type); - } - if ((flags & 64) != 0) { - stream.writeInt32(embed_width); - } - if ((flags & 64) != 0) { - stream.writeInt32(embed_height); - } - if ((flags & 128) != 0) { - stream.writeInt32(duration); - } - if ((flags & 256) != 0) { - stream.writeString(author); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeInt64(id); + stream.writeString(url); + stream.writeString(display_url); + if ((flags & 1) != 0) { + stream.writeString(type); + } + if ((flags & 2) != 0) { + stream.writeString(site_name); + } + if ((flags & 4) != 0) { + stream.writeString(title); + } + if ((flags & 8) != 0) { + stream.writeString(description); + } + if ((flags & 16) != 0) { + photo.serializeToStream(stream); + } + if ((flags & 32) != 0) { + stream.writeString(embed_url); + } + if ((flags & 32) != 0) { + stream.writeString(embed_type); + } + if ((flags & 64) != 0) { + stream.writeInt32(embed_width); + } + if ((flags & 64) != 0) { + stream.writeInt32(embed_height); + } + if ((flags & 128) != 0) { + stream.writeInt32(duration); + } + if ((flags & 256) != 0) { + stream.writeString(author); + } + } + } - public static class TL_webPageEmpty extends WebPage { - public static int constructor = 0xeb1477e8; + public static class TL_webPageEmpty extends WebPage { + public static int constructor = 0xeb1477e8; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + } + } - public static class TL_webPageUrlPending extends WebPage { - public static int constructor = 0xd41a5167; + public static class TL_webPageUrlPending extends WebPage { + public static int constructor = 0xd41a5167; - public void readParams(AbstractSerializedData stream, boolean exception) { - url = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + url = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(url); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(url); + } + } - public static class TL_webPagePending extends WebPage { - public static int constructor = 0xc586da1c; + public static class TL_webPagePending extends WebPage { + public static int constructor = 0xc586da1c; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - date = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt32(date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt32(date); + } + } - public static class TL_webPageNotModified_layer110 extends TL_webPageNotModified { - public static int constructor = 0x85849473; + public static class TL_webPageNotModified_layer110 extends TL_webPageNotModified { + public static int constructor = 0x85849473; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_webPageNotModified extends WebPage { public static int constructor = 0x7311ca11; @@ -17613,97 +17950,97 @@ public class TLRPC { } } - public static class TL_webPage_layer58 extends TL_webPage { - public static int constructor = 0xca820ed7; + public static class TL_webPage_layer58 extends TL_webPage { + public static int constructor = 0xca820ed7; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - id = stream.readInt64(exception); - url = stream.readString(exception); - display_url = stream.readString(exception); - if ((flags & 1) != 0) { - type = stream.readString(exception); - } - if ((flags & 2) != 0) { - site_name = stream.readString(exception); - } - if ((flags & 4) != 0) { - title = stream.readString(exception); - } - if ((flags & 8) != 0) { - description = stream.readString(exception); - } - if ((flags & 16) != 0) { - photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 32) != 0) { - embed_url = stream.readString(exception); - } - if ((flags & 32) != 0) { - embed_type = stream.readString(exception); - } - if ((flags & 64) != 0) { - embed_width = stream.readInt32(exception); - } - if ((flags & 64) != 0) { - embed_height = stream.readInt32(exception); - } - if ((flags & 128) != 0) { - duration = stream.readInt32(exception); - } - if ((flags & 256) != 0) { - author = stream.readString(exception); - } - if ((flags & 512) != 0) { - document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + id = stream.readInt64(exception); + url = stream.readString(exception); + display_url = stream.readString(exception); + if ((flags & 1) != 0) { + type = stream.readString(exception); + } + if ((flags & 2) != 0) { + site_name = stream.readString(exception); + } + if ((flags & 4) != 0) { + title = stream.readString(exception); + } + if ((flags & 8) != 0) { + description = stream.readString(exception); + } + if ((flags & 16) != 0) { + photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 32) != 0) { + embed_url = stream.readString(exception); + } + if ((flags & 32) != 0) { + embed_type = stream.readString(exception); + } + if ((flags & 64) != 0) { + embed_width = stream.readInt32(exception); + } + if ((flags & 64) != 0) { + embed_height = stream.readInt32(exception); + } + if ((flags & 128) != 0) { + duration = stream.readInt32(exception); + } + if ((flags & 256) != 0) { + author = stream.readString(exception); + } + if ((flags & 512) != 0) { + document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeInt64(id); - stream.writeString(url); - stream.writeString(display_url); - if ((flags & 1) != 0) { - stream.writeString(type); - } - if ((flags & 2) != 0) { - stream.writeString(site_name); - } - if ((flags & 4) != 0) { - stream.writeString(title); - } - if ((flags & 8) != 0) { - stream.writeString(description); - } - if ((flags & 16) != 0) { - photo.serializeToStream(stream); - } - if ((flags & 32) != 0) { - stream.writeString(embed_url); - } - if ((flags & 32) != 0) { - stream.writeString(embed_type); - } - if ((flags & 64) != 0) { - stream.writeInt32(embed_width); - } - if ((flags & 64) != 0) { - stream.writeInt32(embed_height); - } - if ((flags & 128) != 0) { - stream.writeInt32(duration); - } - if ((flags & 256) != 0) { - stream.writeString(author); - } - if ((flags & 512) != 0) { - document.serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeInt64(id); + stream.writeString(url); + stream.writeString(display_url); + if ((flags & 1) != 0) { + stream.writeString(type); + } + if ((flags & 2) != 0) { + stream.writeString(site_name); + } + if ((flags & 4) != 0) { + stream.writeString(title); + } + if ((flags & 8) != 0) { + stream.writeString(description); + } + if ((flags & 16) != 0) { + photo.serializeToStream(stream); + } + if ((flags & 32) != 0) { + stream.writeString(embed_url); + } + if ((flags & 32) != 0) { + stream.writeString(embed_type); + } + if ((flags & 64) != 0) { + stream.writeInt32(embed_width); + } + if ((flags & 64) != 0) { + stream.writeInt32(embed_height); + } + if ((flags & 128) != 0) { + stream.writeInt32(duration); + } + if ((flags & 256) != 0) { + stream.writeString(author); + } + if ((flags & 512) != 0) { + document.serializeToStream(stream); + } + } + } public static abstract class messages_FeaturedStickers extends TLObject { @@ -17800,456 +18137,456 @@ public class TLRPC { } } - public static abstract class SecureValueError extends TLObject { + public static abstract class SecureValueError extends TLObject { - public static SecureValueError TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - SecureValueError result = null; - switch (constructor) { - case 0x7a700873: - result = new TL_secureValueErrorFile(); - break; - case 0xbe3dfa: - result = new TL_secureValueErrorFrontSide(); - break; - case 0x666220e9: - result = new TL_secureValueErrorFiles(); - break; - case 0x868a2aa5: - result = new TL_secureValueErrorReverseSide(); - break; - case 0xa1144770: - result = new TL_secureValueErrorTranslationFile(); - break; - case 0x869d758f: - result = new TL_secureValueError(); - break; - case 0xe8a40bd9: - result = new TL_secureValueErrorData(); - break; - case 0x34636dd8: - result = new TL_secureValueErrorTranslationFiles(); - break; - case 0xe537ced6: - result = new TL_secureValueErrorSelfie(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in SecureValueError", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static SecureValueError TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + SecureValueError result = null; + switch (constructor) { + case 0x7a700873: + result = new TL_secureValueErrorFile(); + break; + case 0xbe3dfa: + result = new TL_secureValueErrorFrontSide(); + break; + case 0x666220e9: + result = new TL_secureValueErrorFiles(); + break; + case 0x868a2aa5: + result = new TL_secureValueErrorReverseSide(); + break; + case 0xa1144770: + result = new TL_secureValueErrorTranslationFile(); + break; + case 0x869d758f: + result = new TL_secureValueError(); + break; + case 0xe8a40bd9: + result = new TL_secureValueErrorData(); + break; + case 0x34636dd8: + result = new TL_secureValueErrorTranslationFiles(); + break; + case 0xe537ced6: + result = new TL_secureValueErrorSelfie(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in SecureValueError", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_secureValueErrorFile extends SecureValueError { - public static int constructor = 0x7a700873; + public static class TL_secureValueErrorFile extends SecureValueError { + public static int constructor = 0x7a700873; - public SecureValueType type; - public byte[] file_hash; - public String text; + public SecureValueType type; + public byte[] file_hash; + public String text; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - file_hash = stream.readByteArray(exception); - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + file_hash = stream.readByteArray(exception); + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeByteArray(file_hash); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + type.serializeToStream(stream); + stream.writeByteArray(file_hash); + stream.writeString(text); + } + } - public static class TL_secureValueErrorFrontSide extends SecureValueError { - public static int constructor = 0xbe3dfa; + public static class TL_secureValueErrorFrontSide extends SecureValueError { + public static int constructor = 0xbe3dfa; - public SecureValueType type; - public byte[] file_hash; - public String text; + public SecureValueType type; + public byte[] file_hash; + public String text; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - file_hash = stream.readByteArray(exception); - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + file_hash = stream.readByteArray(exception); + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeByteArray(file_hash); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + type.serializeToStream(stream); + stream.writeByteArray(file_hash); + stream.writeString(text); + } + } - public static class TL_secureValueErrorFiles extends SecureValueError { - public static int constructor = 0x666220e9; + public static class TL_secureValueErrorFiles extends SecureValueError { + public static int constructor = 0x666220e9; - public SecureValueType type; - public ArrayList file_hash = new ArrayList<>(); - public String text; + public SecureValueType type; + public ArrayList file_hash = new ArrayList<>(); + public String text; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - file_hash.add(stream.readByteArray(exception)); - } - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + file_hash.add(stream.readByteArray(exception)); + } + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = file_hash.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeByteArray(file_hash.get(a)); - } - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + type.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = file_hash.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeByteArray(file_hash.get(a)); + } + stream.writeString(text); + } + } - public static class TL_secureValueErrorReverseSide extends SecureValueError { - public static int constructor = 0x868a2aa5; + public static class TL_secureValueErrorReverseSide extends SecureValueError { + public static int constructor = 0x868a2aa5; - public SecureValueType type; - public byte[] file_hash; - public String text; + public SecureValueType type; + public byte[] file_hash; + public String text; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - file_hash = stream.readByteArray(exception); - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + file_hash = stream.readByteArray(exception); + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeByteArray(file_hash); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + type.serializeToStream(stream); + stream.writeByteArray(file_hash); + stream.writeString(text); + } + } - public static class TL_secureValueErrorTranslationFile extends SecureValueError { - public static int constructor = 0xa1144770; + public static class TL_secureValueErrorTranslationFile extends SecureValueError { + public static int constructor = 0xa1144770; - public SecureValueType type; - public byte[] file_hash; - public String text; + public SecureValueType type; + public byte[] file_hash; + public String text; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - file_hash = stream.readByteArray(exception); - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + file_hash = stream.readByteArray(exception); + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeByteArray(file_hash); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + type.serializeToStream(stream); + stream.writeByteArray(file_hash); + stream.writeString(text); + } + } - public static class TL_secureValueError extends SecureValueError { - public static int constructor = 0x869d758f; + public static class TL_secureValueError extends SecureValueError { + public static int constructor = 0x869d758f; - public SecureValueType type; - public byte[] hash; - public String text; + public SecureValueType type; + public byte[] hash; + public String text; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - hash = stream.readByteArray(exception); - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + hash = stream.readByteArray(exception); + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeByteArray(hash); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + type.serializeToStream(stream); + stream.writeByteArray(hash); + stream.writeString(text); + } + } - public static class TL_secureValueErrorData extends SecureValueError { - public static int constructor = 0xe8a40bd9; + public static class TL_secureValueErrorData extends SecureValueError { + public static int constructor = 0xe8a40bd9; - public SecureValueType type; - public byte[] data_hash; - public String field; - public String text; + public SecureValueType type; + public byte[] data_hash; + public String field; + public String text; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - data_hash = stream.readByteArray(exception); - field = stream.readString(exception); - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + data_hash = stream.readByteArray(exception); + field = stream.readString(exception); + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeByteArray(data_hash); - stream.writeString(field); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + type.serializeToStream(stream); + stream.writeByteArray(data_hash); + stream.writeString(field); + stream.writeString(text); + } + } - public static class TL_secureValueErrorTranslationFiles extends SecureValueError { - public static int constructor = 0x34636dd8; + public static class TL_secureValueErrorTranslationFiles extends SecureValueError { + public static int constructor = 0x34636dd8; - public SecureValueType type; - public ArrayList file_hash = new ArrayList<>(); - public String text; + public SecureValueType type; + public ArrayList file_hash = new ArrayList<>(); + public String text; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - file_hash.add(stream.readByteArray(exception)); - } - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + file_hash.add(stream.readByteArray(exception)); + } + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = file_hash.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeByteArray(file_hash.get(a)); - } - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + type.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = file_hash.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeByteArray(file_hash.get(a)); + } + stream.writeString(text); + } + } - public static class TL_secureValueErrorSelfie extends SecureValueError { - public static int constructor = 0xe537ced6; + public static class TL_secureValueErrorSelfie extends SecureValueError { + public static int constructor = 0xe537ced6; - public SecureValueType type; - public byte[] file_hash; - public String text; + public SecureValueType type; + public byte[] file_hash; + public String text; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - file_hash = stream.readByteArray(exception); - text = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + file_hash = stream.readByteArray(exception); + text = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeByteArray(file_hash); - stream.writeString(text); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + type.serializeToStream(stream); + stream.writeByteArray(file_hash); + stream.writeString(text); + } + } - public static class TL_secureValue extends TLObject { - public static int constructor = 0x187fa0ca; + public static class TL_secureValue extends TLObject { + public static int constructor = 0x187fa0ca; - public int flags; - public SecureValueType type; - public TL_secureData data; - public SecureFile front_side; - public SecureFile reverse_side; - public SecureFile selfie; - public ArrayList translation = new ArrayList<>(); - public ArrayList files = new ArrayList<>(); - public SecurePlainData plain_data; - public byte[] hash; + public int flags; + public SecureValueType type; + public TL_secureData data; + public SecureFile front_side; + public SecureFile reverse_side; + public SecureFile selfie; + public ArrayList translation = new ArrayList<>(); + public ArrayList files = new ArrayList<>(); + public SecurePlainData plain_data; + public byte[] hash; - public static TL_secureValue TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_secureValue.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_secureValue", constructor)); - } else { - return null; - } - } - TL_secureValue result = new TL_secureValue(); - result.readParams(stream, exception); - return result; - } + public static TL_secureValue TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_secureValue.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_secureValue", constructor)); + } else { + return null; + } + } + TL_secureValue result = new TL_secureValue(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 1) != 0) { - data = TL_secureData.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 2) != 0) { - front_side = SecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 4) != 0) { - reverse_side = SecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 8) != 0) { - selfie = SecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 64) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - SecureFile object = SecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - translation.add(object); - } - } - if ((flags & 16) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - SecureFile object = SecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - files.add(object); - } - } - if ((flags & 32) != 0) { - plain_data = SecurePlainData.TLdeserialize(stream, stream.readInt32(exception), exception); - } - hash = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 1) != 0) { + data = TL_secureData.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 2) != 0) { + front_side = SecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 4) != 0) { + reverse_side = SecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 8) != 0) { + selfie = SecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 64) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + SecureFile object = SecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + translation.add(object); + } + } + if ((flags & 16) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + SecureFile object = SecureFile.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + files.add(object); + } + } + if ((flags & 32) != 0) { + plain_data = SecurePlainData.TLdeserialize(stream, stream.readInt32(exception), exception); + } + hash = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - type.serializeToStream(stream); - if ((flags & 1) != 0) { - data.serializeToStream(stream); - } - if ((flags & 2) != 0) { - front_side.serializeToStream(stream); - } - if ((flags & 4) != 0) { - reverse_side.serializeToStream(stream); - } - if ((flags & 8) != 0) { - selfie.serializeToStream(stream); - } - if ((flags & 64) != 0) { - stream.writeInt32(0x1cb5c415); - int count = translation.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - translation.get(a).serializeToStream(stream); - } - } - if ((flags & 16) != 0) { - stream.writeInt32(0x1cb5c415); - int count = files.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - files.get(a).serializeToStream(stream); - } - } - if ((flags & 32) != 0) { - plain_data.serializeToStream(stream); - } - stream.writeByteArray(hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + type.serializeToStream(stream); + if ((flags & 1) != 0) { + data.serializeToStream(stream); + } + if ((flags & 2) != 0) { + front_side.serializeToStream(stream); + } + if ((flags & 4) != 0) { + reverse_side.serializeToStream(stream); + } + if ((flags & 8) != 0) { + selfie.serializeToStream(stream); + } + if ((flags & 64) != 0) { + stream.writeInt32(0x1cb5c415); + int count = translation.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + translation.get(a).serializeToStream(stream); + } + } + if ((flags & 16) != 0) { + stream.writeInt32(0x1cb5c415); + int count = files.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + files.get(a).serializeToStream(stream); + } + } + if ((flags & 32) != 0) { + plain_data.serializeToStream(stream); + } + stream.writeByteArray(hash); + } + } - public static abstract class PhoneCallDiscardReason extends TLObject { - public byte[] encrypted_key; + public static abstract class PhoneCallDiscardReason extends TLObject { + public byte[] encrypted_key; - public static PhoneCallDiscardReason TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - PhoneCallDiscardReason result = null; - switch (constructor) { - case 0x57adc690: - result = new TL_phoneCallDiscardReasonHangup(); - break; - case 0xfaf7e8c9: - result = new TL_phoneCallDiscardReasonBusy(); - break; - case 0x85e42301: - result = new TL_phoneCallDiscardReasonMissed(); - break; - case 0xe095c1a0: - result = new TL_phoneCallDiscardReasonDisconnect(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in PhoneCallDiscardReason", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static PhoneCallDiscardReason TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + PhoneCallDiscardReason result = null; + switch (constructor) { + case 0x57adc690: + result = new TL_phoneCallDiscardReasonHangup(); + break; + case 0xfaf7e8c9: + result = new TL_phoneCallDiscardReasonBusy(); + break; + case 0x85e42301: + result = new TL_phoneCallDiscardReasonMissed(); + break; + case 0xe095c1a0: + result = new TL_phoneCallDiscardReasonDisconnect(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in PhoneCallDiscardReason", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_phoneCallDiscardReasonHangup extends PhoneCallDiscardReason { - public static int constructor = 0x57adc690; + public static class TL_phoneCallDiscardReasonHangup extends PhoneCallDiscardReason { + public static int constructor = 0x57adc690; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_phoneCallDiscardReasonBusy extends PhoneCallDiscardReason { - public static int constructor = 0xfaf7e8c9; + public static class TL_phoneCallDiscardReasonBusy extends PhoneCallDiscardReason { + public static int constructor = 0xfaf7e8c9; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_phoneCallDiscardReasonMissed extends PhoneCallDiscardReason { - public static int constructor = 0x85e42301; + public static class TL_phoneCallDiscardReasonMissed extends PhoneCallDiscardReason { + public static int constructor = 0x85e42301; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_phoneCallDiscardReasonDisconnect extends PhoneCallDiscardReason { - public static int constructor = 0xe095c1a0; + public static class TL_phoneCallDiscardReasonDisconnect extends PhoneCallDiscardReason { + public static int constructor = 0xe095c1a0; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_dialogFilter extends TLObject { public static int constructor = 0x7438f7e8; @@ -18382,64 +18719,64 @@ public class TLRPC { } } - public static class TL_auth_passwordRecovery extends TLObject { - public static int constructor = 0x137948a5; + public static class TL_auth_passwordRecovery extends TLObject { + public static int constructor = 0x137948a5; - public String email_pattern; + public String email_pattern; - public static TL_auth_passwordRecovery TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_auth_passwordRecovery.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_auth_passwordRecovery", constructor)); - } else { - return null; - } - } - TL_auth_passwordRecovery result = new TL_auth_passwordRecovery(); - result.readParams(stream, exception); - return result; - } + public static TL_auth_passwordRecovery TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_auth_passwordRecovery.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_auth_passwordRecovery", constructor)); + } else { + return null; + } + } + TL_auth_passwordRecovery result = new TL_auth_passwordRecovery(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - email_pattern = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(email_pattern); - } - } - - public static class TL_botCommand extends TLObject { - public static int constructor = 0xc27ac8c7; - - public String command; - public String description; - - public static TL_botCommand TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_botCommand.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_botCommand", constructor)); - } else { - return null; - } - } - TL_botCommand result = new TL_botCommand(); - result.readParams(stream, exception); - return result; - } - - public void readParams(AbstractSerializedData stream, boolean exception) { - command = stream.readString(exception); - description = stream.readString(exception); + public void readParams(AbstractSerializedData stream, boolean exception) { + email_pattern = stream.readString(exception); } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(command); - stream.writeString(description); - } - } + stream.writeInt32(constructor); + stream.writeString(email_pattern); + } + } + + public static class TL_botCommand extends TLObject { + public static int constructor = 0xc27ac8c7; + + public String command; + public String description; + + public static TL_botCommand TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_botCommand.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_botCommand", constructor)); + } else { + return null; + } + } + TL_botCommand result = new TL_botCommand(); + result.readParams(stream, exception); + return result; + } + + public void readParams(AbstractSerializedData stream, boolean exception) { + command = stream.readString(exception); + description = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(command); + stream.writeString(description); + } + } public static abstract class InputNotifyPeer extends TLObject { @@ -18731,110 +19068,110 @@ public class TLRPC { } } - public static class TL_photos_photo extends TLObject { - public static int constructor = 0x20212ca8; + public static class TL_photos_photo extends TLObject { + public static int constructor = 0x20212ca8; - public Photo photo; - public ArrayList users = new ArrayList<>(); + public Photo photo; + public ArrayList users = new ArrayList<>(); public static TL_photos_photo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_photos_photo.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_photos_photo", constructor)); - } else { - return null; - } - } - TL_photos_photo result = new TL_photos_photo(); - result.readParams(stream, exception); - return result; + if (TL_photos_photo.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_photos_photo", constructor)); + } else { + return null; + } + } + TL_photos_photo result = new TL_photos_photo(); + result.readParams(stream, exception); + return result; } public void readParams(AbstractSerializedData stream, boolean exception) { - photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); photo.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = users.size(); - stream.writeInt32(count); + stream.writeInt32(0x1cb5c415); + int count = users.size(); + stream.writeInt32(count); for (int a = 0; a < count; a++) { users.get(a).serializeToStream(stream); - } - } - } + } + } + } - public static abstract class help_TermsOfServiceUpdate extends TLObject { + public static abstract class help_TermsOfServiceUpdate extends TLObject { - public static help_TermsOfServiceUpdate TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - help_TermsOfServiceUpdate result = null; - switch (constructor) { - case 0x28ecf961: - result = new TL_help_termsOfServiceUpdate(); - break; - case 0xe3309f7f: - result = new TL_help_termsOfServiceUpdateEmpty(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in help_TermsOfServiceUpdate", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static help_TermsOfServiceUpdate TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + help_TermsOfServiceUpdate result = null; + switch (constructor) { + case 0x28ecf961: + result = new TL_help_termsOfServiceUpdate(); + break; + case 0xe3309f7f: + result = new TL_help_termsOfServiceUpdateEmpty(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in help_TermsOfServiceUpdate", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_help_termsOfServiceUpdate extends help_TermsOfServiceUpdate { - public static int constructor = 0x28ecf961; + public static class TL_help_termsOfServiceUpdate extends help_TermsOfServiceUpdate { + public static int constructor = 0x28ecf961; - public int expires; - public TL_help_termsOfService terms_of_service; + public int expires; + public TL_help_termsOfService terms_of_service; - public void readParams(AbstractSerializedData stream, boolean exception) { - expires = stream.readInt32(exception); - terms_of_service = TL_help_termsOfService.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + expires = stream.readInt32(exception); + terms_of_service = TL_help_termsOfService.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(expires); - terms_of_service.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(expires); + terms_of_service.serializeToStream(stream); + } + } - public static class TL_help_termsOfServiceUpdateEmpty extends help_TermsOfServiceUpdate { - public static int constructor = 0xe3309f7f; + public static class TL_help_termsOfServiceUpdateEmpty extends help_TermsOfServiceUpdate { + public static int constructor = 0xe3309f7f; - public int expires; + public int expires; - public void readParams(AbstractSerializedData stream, boolean exception) { - expires = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + expires = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(expires); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(expires); + } + } public static class TL_messages_chatAdminsWithInvites extends TLObject { public static int constructor = 0xb69b72d7; @@ -19324,47 +19661,47 @@ public class TLRPC { } } - public static abstract class User extends TLObject { - public long id; - public String first_name; - public String last_name; - public String username; - public long access_hash; - public String phone; - public UserProfilePhoto photo; - public UserStatus status; - public int flags; - public boolean self; - public boolean contact; - public boolean mutual_contact; - public boolean deleted; - public boolean bot; - public boolean bot_chat_history; - public boolean bot_nochats; - public boolean verified; - public boolean restricted; - public boolean min; - public boolean bot_inline_geo; + public static abstract class User extends TLObject { + public long id; + public String first_name; + public String last_name; + public String username; + public long access_hash; + public String phone; + public UserProfilePhoto photo; + public UserStatus status; + public int flags; + public boolean self; + public boolean contact; + public boolean mutual_contact; + public boolean deleted; + public boolean bot; + public boolean bot_chat_history; + public boolean bot_nochats; + public boolean verified; + public boolean restricted; + public boolean min; + public boolean bot_inline_geo; public boolean support; public boolean scam; public boolean apply_min_photo; public boolean fake; - public int bot_info_version; - public String bot_inline_placeholder; - public String lang_code; - public boolean inactive; - public boolean explicit_content; + public int bot_info_version; + public String bot_inline_placeholder; + public String lang_code; + public boolean inactive; + public boolean explicit_content; public ArrayList restriction_reason = new ArrayList<>(); - public static User TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - User result = null; - switch (constructor) { - case 0xcab35e18: - result = new TL_userContact_old2(); - break; - case 0xf2fb8319: - result = new TL_userContact_old(); - break; + public static User TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + User result = null; + switch (constructor) { + case 0xcab35e18: + result = new TL_userContact_old2(); + break; + case 0xf2fb8319: + result = new TL_userContact_old(); + break; case 0xd3bc4b7a: result = new TL_userEmpty(); break; @@ -19374,109 +19711,109 @@ public class TLRPC { case 0x938458c1: result = new TL_user_layer131(); break; - case 0x2e13f4c3: - result = new TL_user_layer104(); - break; - case 0x720535ec: - result = new TL_userSelf_old(); - break; - case 0x1c60e608: - result = new TL_userSelf_old3(); - break; - case 0xd6016d7a: - result = new TL_userDeleted_old2(); - break; - case 0x200250ba: - result = new TL_userEmpty_layer131(); - break; - case 0x22e8ceb0: - result = new TL_userRequest_old(); - break; - case 0x5214c89d: - result = new TL_userForeign_old(); - break; - case 0x75cf7a8: - result = new TL_userForeign_old2(); - break; - case 0xd9ccc4ef: - result = new TL_userRequest_old2(); - break; - case 0xb29ad7cc: - result = new TL_userDeleted_old(); - break; - case 0xd10d979a: - result = new TL_user_layer65(); - break; - case 0x22e49072: - result = new TL_user_old(); - break; - case 0x7007b451: - result = new TL_userSelf_old2(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in User", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0x2e13f4c3: + result = new TL_user_layer104(); + break; + case 0x720535ec: + result = new TL_userSelf_old(); + break; + case 0x1c60e608: + result = new TL_userSelf_old3(); + break; + case 0xd6016d7a: + result = new TL_userDeleted_old2(); + break; + case 0x200250ba: + result = new TL_userEmpty_layer131(); + break; + case 0x22e8ceb0: + result = new TL_userRequest_old(); + break; + case 0x5214c89d: + result = new TL_userForeign_old(); + break; + case 0x75cf7a8: + result = new TL_userForeign_old2(); + break; + case 0xd9ccc4ef: + result = new TL_userRequest_old2(); + break; + case 0xb29ad7cc: + result = new TL_userDeleted_old(); + break; + case 0xd10d979a: + result = new TL_user_layer65(); + break; + case 0x22e49072: + result = new TL_user_old(); + break; + case 0x7007b451: + result = new TL_userSelf_old2(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in User", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_userContact_old2 extends User { - public static int constructor = 0xcab35e18; + public static class TL_userContact_old2 extends User { + public static int constructor = 0xcab35e18; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - username = stream.readString(exception); - access_hash = stream.readInt64(exception); - phone = stream.readString(exception); - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + username = stream.readString(exception); + access_hash = stream.readInt64(exception); + phone = stream.readString(exception); + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeString(username); - stream.writeInt64(access_hash); - stream.writeString(phone); - photo.serializeToStream(stream); - status.serializeToStream(stream); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeString(username); + stream.writeInt64(access_hash); + stream.writeString(phone); + photo.serializeToStream(stream); + status.serializeToStream(stream); + } + } - public static class TL_userContact_old extends TL_userContact_old2 { - public static int constructor = 0xf2fb8319; + public static class TL_userContact_old extends TL_userContact_old2 { + public static int constructor = 0xf2fb8319; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - access_hash = stream.readInt64(exception); - phone = stream.readString(exception); - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + access_hash = stream.readInt64(exception); + phone = stream.readString(exception); + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeInt64(access_hash); - stream.writeString(phone); - photo.serializeToStream(stream); - status.serializeToStream(stream); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeInt64(access_hash); + stream.writeString(phone); + photo.serializeToStream(stream); + status.serializeToStream(stream); + } + } public static class TL_userEmpty extends User { public static int constructor = 0xd3bc4b7a; @@ -19862,421 +20199,421 @@ public class TLRPC { } } - public static class TL_userSelf_old extends TL_userSelf_old3 { - public static int constructor = 0x720535ec; + public static class TL_userSelf_old extends TL_userSelf_old3 { + public static int constructor = 0x720535ec; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - phone = stream.readString(exception); - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - inactive = stream.readBool(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + phone = stream.readString(exception); + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + inactive = stream.readBool(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeString(phone); - photo.serializeToStream(stream); - status.serializeToStream(stream); - stream.writeBool(inactive); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeString(phone); + photo.serializeToStream(stream); + status.serializeToStream(stream); + stream.writeBool(inactive); + } + } - public static class TL_userSelf_old3 extends User { - public static int constructor = 0x1c60e608; + public static class TL_userSelf_old3 extends User { + public static int constructor = 0x1c60e608; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - username = stream.readString(exception); - phone = stream.readString(exception); - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + username = stream.readString(exception); + phone = stream.readString(exception); + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeString(username); - stream.writeString(phone); - photo.serializeToStream(stream); - status.serializeToStream(stream); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeString(username); + stream.writeString(phone); + photo.serializeToStream(stream); + status.serializeToStream(stream); + } + } - public static class TL_userDeleted_old2 extends User { - public static int constructor = 0xd6016d7a; + public static class TL_userDeleted_old2 extends User { + public static int constructor = 0xd6016d7a; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - username = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + username = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeString(username); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeString(username); + } + } - public static class TL_userEmpty_layer131 extends TL_userEmpty { - public static int constructor = 0x200250ba; + public static class TL_userEmpty_layer131 extends TL_userEmpty { + public static int constructor = 0x200250ba; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - } - } + } + } - public static class TL_userRequest_old extends TL_userRequest_old2 { - public static int constructor = 0x22e8ceb0; + public static class TL_userRequest_old extends TL_userRequest_old2 { + public static int constructor = 0x22e8ceb0; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - access_hash = stream.readInt64(exception); - phone = stream.readString(exception); - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + access_hash = stream.readInt64(exception); + phone = stream.readString(exception); + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeInt64(access_hash); - stream.writeString(phone); - photo.serializeToStream(stream); - status.serializeToStream(stream); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeInt64(access_hash); + stream.writeString(phone); + photo.serializeToStream(stream); + status.serializeToStream(stream); + } + } - public static class TL_userForeign_old extends TL_userForeign_old2 { - public static int constructor = 0x5214c89d; + public static class TL_userForeign_old extends TL_userForeign_old2 { + public static int constructor = 0x5214c89d; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - access_hash = stream.readInt64(exception); - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + access_hash = stream.readInt64(exception); + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeInt64(access_hash); - photo.serializeToStream(stream); - status.serializeToStream(stream); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeInt64(access_hash); + photo.serializeToStream(stream); + status.serializeToStream(stream); + } + } - public static class TL_userForeign_old2 extends User { - public static int constructor = 0x75cf7a8; + public static class TL_userForeign_old2 extends User { + public static int constructor = 0x75cf7a8; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - username = stream.readString(exception); - access_hash = stream.readInt64(exception); - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + username = stream.readString(exception); + access_hash = stream.readInt64(exception); + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeString(username); - stream.writeInt64(access_hash); - photo.serializeToStream(stream); - status.serializeToStream(stream); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeString(username); + stream.writeInt64(access_hash); + photo.serializeToStream(stream); + status.serializeToStream(stream); + } + } - public static class TL_userRequest_old2 extends User { - public static int constructor = 0xd9ccc4ef; + public static class TL_userRequest_old2 extends User { + public static int constructor = 0xd9ccc4ef; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - username = stream.readString(exception); - access_hash = stream.readInt64(exception); - phone = stream.readString(exception); - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + username = stream.readString(exception); + access_hash = stream.readInt64(exception); + phone = stream.readString(exception); + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeString(username); - stream.writeInt64(access_hash); - stream.writeString(phone); - photo.serializeToStream(stream); - status.serializeToStream(stream); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeString(username); + stream.writeInt64(access_hash); + stream.writeString(phone); + photo.serializeToStream(stream); + status.serializeToStream(stream); + } + } - public static class TL_userDeleted_old extends TL_userDeleted_old2 { - public static int constructor = 0xb29ad7cc; + public static class TL_userDeleted_old extends TL_userDeleted_old2 { + public static int constructor = 0xb29ad7cc; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + } + } - public static class TL_user_layer65 extends TL_user { - public static int constructor = 0xd10d979a; + public static class TL_user_layer65 extends TL_user { + public static int constructor = 0xd10d979a; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - self = (flags & 1024) != 0; - contact = (flags & 2048) != 0; - mutual_contact = (flags & 4096) != 0; - deleted = (flags & 8192) != 0; - bot = (flags & 16384) != 0; - bot_chat_history = (flags & 32768) != 0; - bot_nochats = (flags & 65536) != 0; - verified = (flags & 131072) != 0; - restricted = (flags & 262144) != 0; - min = (flags & 1048576) != 0; - bot_inline_geo = (flags & 2097152) != 0; - id = stream.readInt32(exception); - if ((flags & 1) != 0) { - access_hash = stream.readInt64(exception); - } - if ((flags & 2) != 0) { - first_name = stream.readString(exception); - } - if ((flags & 4) != 0) { - last_name = stream.readString(exception); - } - if ((flags & 8) != 0) { - username = stream.readString(exception); - } - if ((flags & 16) != 0) { - phone = stream.readString(exception); - } - if ((flags & 32) != 0) { - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 64) != 0) { - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 16384) != 0) { - bot_info_version = stream.readInt32(exception); - } - if ((flags & 262144) != 0) { - stream.readString(exception); - } - if ((flags & 524288) != 0) { - bot_inline_placeholder = stream.readString(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + self = (flags & 1024) != 0; + contact = (flags & 2048) != 0; + mutual_contact = (flags & 4096) != 0; + deleted = (flags & 8192) != 0; + bot = (flags & 16384) != 0; + bot_chat_history = (flags & 32768) != 0; + bot_nochats = (flags & 65536) != 0; + verified = (flags & 131072) != 0; + restricted = (flags & 262144) != 0; + min = (flags & 1048576) != 0; + bot_inline_geo = (flags & 2097152) != 0; + id = stream.readInt32(exception); + if ((flags & 1) != 0) { + access_hash = stream.readInt64(exception); + } + if ((flags & 2) != 0) { + first_name = stream.readString(exception); + } + if ((flags & 4) != 0) { + last_name = stream.readString(exception); + } + if ((flags & 8) != 0) { + username = stream.readString(exception); + } + if ((flags & 16) != 0) { + phone = stream.readString(exception); + } + if ((flags & 32) != 0) { + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 64) != 0) { + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 16384) != 0) { + bot_info_version = stream.readInt32(exception); + } + if ((flags & 262144) != 0) { + stream.readString(exception); + } + if ((flags & 524288) != 0) { + bot_inline_placeholder = stream.readString(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = self ? (flags | 1024) : (flags &~ 1024); - flags = contact ? (flags | 2048) : (flags &~ 2048); - flags = mutual_contact ? (flags | 4096) : (flags &~ 4096); - flags = deleted ? (flags | 8192) : (flags &~ 8192); - flags = bot ? (flags | 16384) : (flags &~ 16384); - flags = bot_chat_history ? (flags | 32768) : (flags &~ 32768); - flags = bot_nochats ? (flags | 65536) : (flags &~ 65536); - flags = verified ? (flags | 131072) : (flags &~ 131072); - flags = restricted ? (flags | 262144) : (flags &~ 262144); - flags = min ? (flags | 1048576) : (flags &~ 1048576); - flags = bot_inline_geo ? (flags | 2097152) : (flags &~ 2097152); - stream.writeInt32(flags); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = self ? (flags | 1024) : (flags &~ 1024); + flags = contact ? (flags | 2048) : (flags &~ 2048); + flags = mutual_contact ? (flags | 4096) : (flags &~ 4096); + flags = deleted ? (flags | 8192) : (flags &~ 8192); + flags = bot ? (flags | 16384) : (flags &~ 16384); + flags = bot_chat_history ? (flags | 32768) : (flags &~ 32768); + flags = bot_nochats ? (flags | 65536) : (flags &~ 65536); + flags = verified ? (flags | 131072) : (flags &~ 131072); + flags = restricted ? (flags | 262144) : (flags &~ 262144); + flags = min ? (flags | 1048576) : (flags &~ 1048576); + flags = bot_inline_geo ? (flags | 2097152) : (flags &~ 2097152); + stream.writeInt32(flags); stream.writeInt32((int) id); - if ((flags & 1) != 0) { - stream.writeInt64(access_hash); - } - if ((flags & 2) != 0) { - stream.writeString(first_name); - } - if ((flags & 4) != 0) { - stream.writeString(last_name); - } - if ((flags & 8) != 0) { - stream.writeString(username); - } - if ((flags & 16) != 0) { - stream.writeString(phone); - } - if ((flags & 32) != 0) { - photo.serializeToStream(stream); - } - if ((flags & 64) != 0) { - status.serializeToStream(stream); - } - if ((flags & 16384) != 0) { - stream.writeInt32(bot_info_version); - } - if ((flags & 262144) != 0) { - stream.writeString(""); - } - if ((flags & 524288) != 0) { - stream.writeString(bot_inline_placeholder); - } - } - } + if ((flags & 1) != 0) { + stream.writeInt64(access_hash); + } + if ((flags & 2) != 0) { + stream.writeString(first_name); + } + if ((flags & 4) != 0) { + stream.writeString(last_name); + } + if ((flags & 8) != 0) { + stream.writeString(username); + } + if ((flags & 16) != 0) { + stream.writeString(phone); + } + if ((flags & 32) != 0) { + photo.serializeToStream(stream); + } + if ((flags & 64) != 0) { + status.serializeToStream(stream); + } + if ((flags & 16384) != 0) { + stream.writeInt32(bot_info_version); + } + if ((flags & 262144) != 0) { + stream.writeString(""); + } + if ((flags & 524288) != 0) { + stream.writeString(bot_inline_placeholder); + } + } + } - public static class TL_user_old extends TL_user { - public static int constructor = 0x22e49072; + public static class TL_user_old extends TL_user { + public static int constructor = 0x22e49072; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - self = (flags & 1024) != 0; - contact = (flags & 2048) != 0; - mutual_contact = (flags & 4096) != 0; - deleted = (flags & 8192) != 0; - bot = (flags & 16384) != 0; - bot_chat_history = (flags & 32768) != 0; - bot_nochats = (flags & 65536) != 0; - verified = (flags & 131072) != 0; - explicit_content = (flags & 262144) != 0; - id = stream.readInt32(exception); - if ((flags & 1) != 0) { - access_hash = stream.readInt64(exception); - } - if ((flags & 2) != 0) { - first_name = stream.readString(exception); - } - if ((flags & 4) != 0) { - last_name = stream.readString(exception); - } - if ((flags & 8) != 0) { - username = stream.readString(exception); - } - if ((flags & 16) != 0) { - phone = stream.readString(exception); - } - if ((flags & 32) != 0) { - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 64) != 0) { - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 16384) != 0) { - bot_info_version = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + self = (flags & 1024) != 0; + contact = (flags & 2048) != 0; + mutual_contact = (flags & 4096) != 0; + deleted = (flags & 8192) != 0; + bot = (flags & 16384) != 0; + bot_chat_history = (flags & 32768) != 0; + bot_nochats = (flags & 65536) != 0; + verified = (flags & 131072) != 0; + explicit_content = (flags & 262144) != 0; + id = stream.readInt32(exception); + if ((flags & 1) != 0) { + access_hash = stream.readInt64(exception); + } + if ((flags & 2) != 0) { + first_name = stream.readString(exception); + } + if ((flags & 4) != 0) { + last_name = stream.readString(exception); + } + if ((flags & 8) != 0) { + username = stream.readString(exception); + } + if ((flags & 16) != 0) { + phone = stream.readString(exception); + } + if ((flags & 32) != 0) { + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 64) != 0) { + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 16384) != 0) { + bot_info_version = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = self ? (flags | 1024) : (flags &~ 1024); - flags = contact ? (flags | 2048) : (flags &~ 2048); - flags = mutual_contact ? (flags | 4096) : (flags &~ 4096); - flags = deleted ? (flags | 8192) : (flags &~ 8192); - flags = bot ? (flags | 16384) : (flags &~ 16384); - flags = bot_chat_history ? (flags | 32768) : (flags &~ 32768); - flags = bot_nochats ? (flags | 65536) : (flags &~ 65536); - flags = verified ? (flags | 131072) : (flags &~ 131072); - flags = explicit_content ? (flags | 262144) : (flags &~ 262144); - stream.writeInt32(flags); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = self ? (flags | 1024) : (flags &~ 1024); + flags = contact ? (flags | 2048) : (flags &~ 2048); + flags = mutual_contact ? (flags | 4096) : (flags &~ 4096); + flags = deleted ? (flags | 8192) : (flags &~ 8192); + flags = bot ? (flags | 16384) : (flags &~ 16384); + flags = bot_chat_history ? (flags | 32768) : (flags &~ 32768); + flags = bot_nochats ? (flags | 65536) : (flags &~ 65536); + flags = verified ? (flags | 131072) : (flags &~ 131072); + flags = explicit_content ? (flags | 262144) : (flags &~ 262144); + stream.writeInt32(flags); stream.writeInt32((int) id); - if ((flags & 1) != 0) { - stream.writeInt64(access_hash); - } - if ((flags & 2) != 0) { - stream.writeString(first_name); - } - if ((flags & 4) != 0) { - stream.writeString(last_name); - } - if ((flags & 8) != 0) { - stream.writeString(username); - } - if ((flags & 16) != 0) { - stream.writeString(phone); - } - if ((flags & 32) != 0) { - photo.serializeToStream(stream); - } - if ((flags & 64) != 0) { - status.serializeToStream(stream); - } - if ((flags & 16384) != 0) { - stream.writeInt32(bot_info_version); - } - } - } + if ((flags & 1) != 0) { + stream.writeInt64(access_hash); + } + if ((flags & 2) != 0) { + stream.writeString(first_name); + } + if ((flags & 4) != 0) { + stream.writeString(last_name); + } + if ((flags & 8) != 0) { + stream.writeString(username); + } + if ((flags & 16) != 0) { + stream.writeString(phone); + } + if ((flags & 32) != 0) { + photo.serializeToStream(stream); + } + if ((flags & 64) != 0) { + status.serializeToStream(stream); + } + if ((flags & 16384) != 0) { + stream.writeInt32(bot_info_version); + } + } + } - public static class TL_userSelf_old2 extends TL_userSelf_old3 { - public static int constructor = 0x7007b451; + public static class TL_userSelf_old2 extends TL_userSelf_old3 { + public static int constructor = 0x7007b451; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - username = stream.readString(exception); - phone = stream.readString(exception); - photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - inactive = stream.readBool(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + username = stream.readString(exception); + phone = stream.readString(exception); + photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + inactive = stream.readBool(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32((int) id); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeString(username); - stream.writeString(phone); - photo.serializeToStream(stream); - status.serializeToStream(stream); - stream.writeBool(inactive); - } - } + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeString(username); + stream.writeString(phone); + photo.serializeToStream(stream); + status.serializeToStream(stream); + stream.writeBool(inactive); + } + } public static abstract class RecentMeUrl extends TLObject { @@ -20508,124 +20845,124 @@ public class TLRPC { } } - public static class TL_messages_highScores extends TLObject { - public static int constructor = 0x9a3bfd99; + public static class TL_messages_highScores extends TLObject { + public static int constructor = 0x9a3bfd99; - public ArrayList scores = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); + public ArrayList scores = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); - public static TL_messages_highScores TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messages_highScores.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messages_highScores", constructor)); - } else { - return null; - } - } - TL_messages_highScores result = new TL_messages_highScores(); - result.readParams(stream, exception); - return result; - } + public static TL_messages_highScores TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_highScores.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_highScores", constructor)); + } else { + return null; + } + } + TL_messages_highScores result = new TL_messages_highScores(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_highScore object = TL_highScore.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - scores.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_highScore object = TL_highScore.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + scores.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = scores.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - scores.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = scores.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + scores.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } - public static class TL_phone_phoneCall extends TLObject { - public static int constructor = 0xec82e140; + public static class TL_phone_phoneCall extends TLObject { + public static int constructor = 0xec82e140; - public PhoneCall phone_call; - public ArrayList users = new ArrayList<>(); + public PhoneCall phone_call; + public ArrayList users = new ArrayList<>(); - public static TL_phone_phoneCall TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_phone_phoneCall.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_phone_phoneCall", constructor)); - } else { - return null; - } - } - TL_phone_phoneCall result = new TL_phone_phoneCall(); - result.readParams(stream, exception); - return result; - } + public static TL_phone_phoneCall TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_phone_phoneCall.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_phone_phoneCall", constructor)); + } else { + return null; + } + } + TL_phone_phoneCall result = new TL_phone_phoneCall(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - phone_call = PhoneCall.TLdeserialize(stream, stream.readInt32(exception), exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + phone_call = PhoneCall.TLdeserialize(stream, stream.readInt32(exception), exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - phone_call.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + phone_call.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } public static abstract class ChannelParticipantsFilter extends TLObject { @@ -20780,45 +21117,45 @@ public class TLRPC { } } - public static abstract class MessageAction extends TLObject { - public String title; - public String address; - public DecryptedMessageAction encryptedAction; - public String message; - public ArrayList users = new ArrayList<>(); - public TL_inputGroupCall call; - public long channel_id; - public Photo photo; - public long chat_id; - public long user_id; - public UserProfilePhoto newUserPhoto; - public long inviter_id; - public int ttl; - public int flags; - public long call_id; - public PhoneCallDiscardReason reason; - public int duration; - public String currency; - public long total_amount; - public long game_id; - public int score; - public boolean video; + public static abstract class MessageAction extends TLObject { + public String title; + public String address; + public DecryptedMessageAction encryptedAction; + public String message; + public ArrayList users = new ArrayList<>(); + public TL_inputGroupCall call; + public long channel_id; + public Photo photo; + public long chat_id; + public long user_id; + public UserProfilePhoto newUserPhoto; + public long inviter_id; + public int ttl; + public int flags; + public long call_id; + public PhoneCallDiscardReason reason; + public int duration; + public String currency; + public long total_amount; + public long game_id; + public int score; + public boolean video; - public static MessageAction TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - MessageAction result = null; - switch (constructor) { - case 0x555555F5: - result = new TL_messageActionLoginUnknownLocation(); - break; - case 0x555555F7: - result = new TL_messageEncryptedAction(); - break; - case 0xfae69f56: - result = new TL_messageActionCustomAction(); - break; - case 0xa6638b9a: - result = new TL_messageActionChatCreate_layer131(); - break; + public static MessageAction TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + MessageAction result = null; + switch (constructor) { + case 0x555555F5: + result = new TL_messageActionLoginUnknownLocation(); + break; + case 0x555555F7: + result = new TL_messageEncryptedAction(); + break; + case 0xfae69f56: + result = new TL_messageActionCustomAction(); + break; + case 0xa6638b9a: + result = new TL_messageActionChatCreate_layer131(); + break; case 0xbd47cbad: result = new TL_messageActionChatCreate(); break; @@ -20831,165 +21168,165 @@ public class TLRPC { case 0xa43f30cc: result = new TL_messageActionChatDeleteUser(); break; - case 0x51bdb021: - result = new TL_messageActionChatMigrateTo_layer131(); - break; + case 0x51bdb021: + result = new TL_messageActionChatMigrateTo_layer131(); + break; case 0xe1037f92: result = new TL_messageActionChatMigrateTo(); break; case 0xea3948e9: result = new TL_messageActionChannelMigrateFrom(); break; - case 0x7a0d7f42: - result = new TL_messageActionGroupCall(); - break; + case 0x7a0d7f42: + result = new TL_messageActionGroupCall(); + break; case 0xaa786345: result = new TL_messageActionSetChatTheme(); break; - case 0x4792929b: - result = new TL_messageActionScreenshotTaken(); - break; + case 0x4792929b: + result = new TL_messageActionScreenshotTaken(); + break; case 0x1baa035: result = new TL_messageActionPhoneNumberRequest(); break; case 0xebbca3cb: result = new TL_messageActionChatJoinedByRequest(); break; - case 0x9fbab604: - result = new TL_messageActionHistoryClear(); - break; - case 0x7fcb13a8: - result = new TL_messageActionChatEditPhoto(); - break; + case 0x9fbab604: + result = new TL_messageActionHistoryClear(); + break; + case 0x7fcb13a8: + result = new TL_messageActionChatEditPhoto(); + break; case 0x31224c3: result = new TL_messageActionChatJoinedByLink(); break; - case 0xb055eaee: - result = new TL_messageActionChannelMigrateFrom_layer131(); - break; - case 0x488a7337: - result = new TL_messageActionChatAddUser_layer131(); - break; - case 0xb2ae9b0c: - result = new TL_messageActionChatDeleteUser_layer131(); - break; - case 0x55555557: - result = new TL_messageActionCreatedBroadcastList(); - break; - case 0x55555550: - result = new TL_messageActionUserJoined(); - break; - case 0x55555551: - result = new TL_messageActionUserUpdatedPhoto(); - break; - case 0x5e3cfc4b: - result = new TL_messageActionChatAddUser_old(); - break; - case 0x55555552: - result = new TL_messageActionTTLChange(); - break; + case 0xb055eaee: + result = new TL_messageActionChannelMigrateFrom_layer131(); + break; + case 0x488a7337: + result = new TL_messageActionChatAddUser_layer131(); + break; + case 0xb2ae9b0c: + result = new TL_messageActionChatDeleteUser_layer131(); + break; + case 0x55555557: + result = new TL_messageActionCreatedBroadcastList(); + break; + case 0x55555550: + result = new TL_messageActionUserJoined(); + break; + case 0x55555551: + result = new TL_messageActionUserUpdatedPhoto(); + break; + case 0x5e3cfc4b: + result = new TL_messageActionChatAddUser_old(); + break; + case 0x55555552: + result = new TL_messageActionTTLChange(); + break; case 0xaa1afbfd: result = new TL_messageActionSetMessagesTTL(); break; case 0xd95c6154: result = new TL_messageActionSecureValuesSent(); break; - case 0xf89cf5e8: - result = new TL_messageActionChatJoinedByLink_layer131(); - break; + case 0xf89cf5e8: + result = new TL_messageActionChatJoinedByLink_layer131(); + break; case 0xf3f25f76: result = new TL_messageActionContactSignUp(); break; - case 0x95d2ac92: - result = new TL_messageActionChannelCreate(); - break; - case 0x94bd38ed: - result = new TL_messageActionPinMessage(); - break; + case 0x95d2ac92: + result = new TL_messageActionChannelCreate(); + break; + case 0x94bd38ed: + result = new TL_messageActionPinMessage(); + break; case 0x98e0d697: result = new TL_messageActionGeoProximityReached(); break; - case 0x95e3fbef: - result = new TL_messageActionChatDeletePhoto(); - break; + case 0x95e3fbef: + result = new TL_messageActionChatDeletePhoto(); + break; case 0x76b9f11a: result = new TL_messageActionInviteToGroupCall_layer131(); break; - case 0x80e11a7f: - result = new TL_messageActionPhoneCall(); - break; - case 0xb5a1ce5a: - result = new TL_messageActionChatEditTitle(); - break; - case 0xabe9affe: - result = new TL_messageActionBotAllowed(); - break; - case 0x40699cd0: - result = new TL_messageActionPaymentSent(); - break; - case 0xb6aef7b0: - result = new TL_messageActionEmpty(); - break; - case 0x92a72876: - result = new TL_messageActionGameScore(); - break; + case 0x80e11a7f: + result = new TL_messageActionPhoneCall(); + break; + case 0xb5a1ce5a: + result = new TL_messageActionChatEditTitle(); + break; + case 0xabe9affe: + result = new TL_messageActionBotAllowed(); + break; + case 0x40699cd0: + result = new TL_messageActionPaymentSent(); + break; + case 0xb6aef7b0: + result = new TL_messageActionEmpty(); + break; + case 0x92a72876: + result = new TL_messageActionGameScore(); + break; case 0xb3a07661: result = new TL_messageActionGroupCallScheduled(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in MessageAction", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in MessageAction", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messageActionLoginUnknownLocation extends MessageAction { - public static int constructor = 0x555555F5; + public static class TL_messageActionLoginUnknownLocation extends MessageAction { + public static int constructor = 0x555555F5; - public void readParams(AbstractSerializedData stream, boolean exception) { - title = stream.readString(exception); - address = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + title = stream.readString(exception); + address = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(title); - stream.writeString(address); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(title); + stream.writeString(address); + } + } - public static class TL_messageEncryptedAction extends MessageAction { - public static int constructor = 0x555555F7; + public static class TL_messageEncryptedAction extends MessageAction { + public static int constructor = 0x555555F7; - public void readParams(AbstractSerializedData stream, boolean exception) { - encryptedAction = DecryptedMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + encryptedAction = DecryptedMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - encryptedAction.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + encryptedAction.serializeToStream(stream); + } + } - public static class TL_messageActionCustomAction extends MessageAction { - public static int constructor = 0xfae69f56; + public static class TL_messageActionCustomAction extends MessageAction { + public static int constructor = 0xfae69f56; - public void readParams(AbstractSerializedData stream, boolean exception) { - message = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + message = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(message); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(message); + } + } public static class TL_messageActionChatCreate extends MessageAction { public static int constructor = 0xbd47cbad; @@ -21022,36 +21359,36 @@ public class TLRPC { } } - public static class TL_messageActionChatCreate_layer131 extends TL_messageActionChatCreate { - public static int constructor = 0xa6638b9a; + public static class TL_messageActionChatCreate_layer131 extends TL_messageActionChatCreate { + public static int constructor = 0xa6638b9a; - public void readParams(AbstractSerializedData stream, boolean exception) { - title = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - users.add((long) stream.readInt32(exception)); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + title = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + users.add((long) stream.readInt32(exception)); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(title); - stream.writeInt32(0x1cb5c415); - int count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt32((int) (long) users.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(title); + stream.writeInt32(0x1cb5c415); + int count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt32((int) (long) users.get(a)); + } + } + } public static class TL_messageActionInviteToGroupCall extends MessageAction { public static int constructor = 0x502f92f7; @@ -21202,51 +21539,51 @@ public class TLRPC { } } - public static class TL_messageActionChatMigrateTo_layer131 extends TL_messageActionChatMigrateTo { - public static int constructor = 0x51bdb021; + public static class TL_messageActionChatMigrateTo_layer131 extends TL_messageActionChatMigrateTo { + public static int constructor = 0x51bdb021; - public void readParams(AbstractSerializedData stream, boolean exception) { - channel_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + channel_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) channel_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) channel_id); + } + } - public static class TL_messageActionHistoryClear extends MessageAction { - public static int constructor = 0x9fbab604; + public static class TL_messageActionHistoryClear extends MessageAction { + public static int constructor = 0x9fbab604; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_messageActionChatEditPhoto extends MessageAction { - public static int constructor = 0x7fcb13a8; + public static class TL_messageActionChatEditPhoto extends MessageAction { + public static int constructor = 0x7fcb13a8; - public void readParams(AbstractSerializedData stream, boolean exception) { - photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - photo.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + photo.serializeToStream(stream); + } + } - public static class TL_messageActionScreenshotTaken extends MessageAction { - public static int constructor = 0x4792929b; + public static class TL_messageActionScreenshotTaken extends MessageAction { + public static int constructor = 0x4792929b; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messageActionPhoneNumberRequest extends MessageAction { public static int constructor = 0x1baa035; @@ -21294,73 +21631,73 @@ public class TLRPC { } } - public static class TL_messageActionChannelMigrateFrom_layer131 extends TL_messageActionChannelMigrateFrom { - public static int constructor = 0xb055eaee; + public static class TL_messageActionChannelMigrateFrom_layer131 extends TL_messageActionChannelMigrateFrom { + public static int constructor = 0xb055eaee; - public void readParams(AbstractSerializedData stream, boolean exception) { - title = stream.readString(exception); - chat_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + title = stream.readString(exception); + chat_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(title); - stream.writeInt32((int) chat_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(title); + stream.writeInt32((int) chat_id); + } + } - public static class TL_messageActionChatAddUser_layer131 extends TL_messageActionChatAddUser { - public static int constructor = 0x488a7337; + public static class TL_messageActionChatAddUser_layer131 extends TL_messageActionChatAddUser { + public static int constructor = 0x488a7337; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - users.add((long) stream.readInt32(exception)); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + users.add((long) stream.readInt32(exception)); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt32((int) (long) users.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt32((int) (long) users.get(a)); + } + } + } - public static class TL_messageActionChatDeleteUser_layer131 extends TL_messageActionChatDeleteUser { - public static int constructor = 0xb2ae9b0c; + public static class TL_messageActionChatDeleteUser_layer131 extends TL_messageActionChatDeleteUser { + public static int constructor = 0xb2ae9b0c; - public void readParams(AbstractSerializedData stream, boolean exception) { - user_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + user_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) user_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) user_id); + } + } - public static class TL_messageActionCreatedBroadcastList extends MessageAction { - public static int constructor = 0x55555557; + public static class TL_messageActionCreatedBroadcastList extends MessageAction { + public static int constructor = 0x55555557; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messageActionInviteToGroupCall_layer131 extends TL_messageActionInviteToGroupCall { public static int constructor = 0x76b9f11a; @@ -21393,28 +21730,28 @@ public class TLRPC { } } - public static class TL_messageActionUserJoined extends MessageAction { - public static int constructor = 0x55555550; + public static class TL_messageActionUserJoined extends MessageAction { + public static int constructor = 0x55555550; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_messageActionUserUpdatedPhoto extends MessageAction { - public static int constructor = 0x55555551; + public static class TL_messageActionUserUpdatedPhoto extends MessageAction { + public static int constructor = 0x55555551; - public void readParams(AbstractSerializedData stream, boolean exception) { - newUserPhoto = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + newUserPhoto = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - newUserPhoto.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + newUserPhoto.serializeToStream(stream); + } + } public static class TL_messageActionContactSignUp extends MessageAction { public static int constructor = 0xf3f25f76; @@ -21425,33 +21762,33 @@ public class TLRPC { } } - public static class TL_messageActionChatAddUser_old extends TL_messageActionChatAddUser { - public static int constructor = 0x5e3cfc4b; + public static class TL_messageActionChatAddUser_old extends TL_messageActionChatAddUser { + public static int constructor = 0x5e3cfc4b; - public void readParams(AbstractSerializedData stream, boolean exception) { - user_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + user_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) user_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) user_id); + } + } - public static class TL_messageActionTTLChange extends MessageAction { - public static int constructor = 0x55555552; + public static class TL_messageActionTTLChange extends MessageAction { + public static int constructor = 0x55555552; - public void readParams(AbstractSerializedData stream, boolean exception) { - ttl = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + ttl = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(ttl); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(ttl); + } + } public static class TL_messageActionSetMessagesTTL extends MessageAction { public static int constructor = 0xaa1afbfd; @@ -21468,33 +21805,33 @@ public class TLRPC { } } - public static class TL_messageActionChatJoinedByLink_layer131 extends TL_messageActionChatJoinedByLink { - public static int constructor = 0xf89cf5e8; + public static class TL_messageActionChatJoinedByLink_layer131 extends TL_messageActionChatJoinedByLink { + public static int constructor = 0xf89cf5e8; - public void readParams(AbstractSerializedData stream, boolean exception) { - inviter_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + inviter_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) inviter_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) inviter_id); + } + } - public static class TL_messageActionChannelCreate extends MessageAction { - public static int constructor = 0x95d2ac92; + public static class TL_messageActionChannelCreate extends MessageAction { + public static int constructor = 0x95d2ac92; - public void readParams(AbstractSerializedData stream, boolean exception) { - title = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + title = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(title); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(title); + } + } public static class TL_messageActionSecureValuesSent extends MessageAction { public static int constructor = 0xd95c6154; @@ -21530,14 +21867,14 @@ public class TLRPC { } } - public static class TL_messageActionPinMessage extends MessageAction { - public static int constructor = 0x94bd38ed; + public static class TL_messageActionPinMessage extends MessageAction { + public static int constructor = 0x94bd38ed; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messageActionGeoProximityReached extends MessageAction { public static int constructor = 0x98e0d697; @@ -21560,14 +21897,14 @@ public class TLRPC { } } - public static class TL_messageActionChatDeletePhoto extends MessageAction { - public static int constructor = 0x95e3fbef; + public static class TL_messageActionChatDeletePhoto extends MessageAction { + public static int constructor = 0x95e3fbef; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messageActionPhoneCall extends MessageAction { public static int constructor = 0x80e11a7f; @@ -21599,75 +21936,75 @@ public class TLRPC { } } - public static class TL_messageActionChatEditTitle extends MessageAction { - public static int constructor = 0xb5a1ce5a; + public static class TL_messageActionChatEditTitle extends MessageAction { + public static int constructor = 0xb5a1ce5a; - public void readParams(AbstractSerializedData stream, boolean exception) { - title = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + title = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(title); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(title); + } + } - public static class TL_messageActionPaymentSent extends MessageAction { - public static int constructor = 0x40699cd0; + public static class TL_messageActionPaymentSent extends MessageAction { + public static int constructor = 0x40699cd0; - public void readParams(AbstractSerializedData stream, boolean exception) { - currency = stream.readString(exception); - total_amount = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + currency = stream.readString(exception); + total_amount = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(currency); - stream.writeInt64(total_amount); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(currency); + stream.writeInt64(total_amount); + } + } - public static class TL_messageActionBotAllowed extends MessageAction { - public static int constructor = 0xabe9affe; + public static class TL_messageActionBotAllowed extends MessageAction { + public static int constructor = 0xabe9affe; - public String domain; + public String domain; - public void readParams(AbstractSerializedData stream, boolean exception) { - domain = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + domain = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(domain); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(domain); + } + } - public static class TL_messageActionEmpty extends MessageAction { - public static int constructor = 0xb6aef7b0; + public static class TL_messageActionEmpty extends MessageAction { + public static int constructor = 0xb6aef7b0; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_messageActionGameScore extends MessageAction { - public static int constructor = 0x92a72876; + public static class TL_messageActionGameScore extends MessageAction { + public static int constructor = 0x92a72876; - public void readParams(AbstractSerializedData stream, boolean exception) { - game_id = stream.readInt64(exception); - score = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + game_id = stream.readInt64(exception); + score = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(game_id); - stream.writeInt32(score); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(game_id); + stream.writeInt32(score); + } + } public static class TL_messageActionGroupCallScheduled extends MessageAction { public static int constructor = 0xb3a07661; @@ -21798,309 +22135,309 @@ public class TLRPC { } } - public static class TL_messages_archivedStickers extends TLObject { - public static int constructor = 0x4fcba9c8; + public static class TL_messages_archivedStickers extends TLObject { + public static int constructor = 0x4fcba9c8; - public int count; - public ArrayList sets = new ArrayList<>(); + public int count; + public ArrayList sets = new ArrayList<>(); - public static TL_messages_archivedStickers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messages_archivedStickers.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messages_archivedStickers", constructor)); - } else { - return null; - } - } - TL_messages_archivedStickers result = new TL_messages_archivedStickers(); - result.readParams(stream, exception); - return result; - } + public static TL_messages_archivedStickers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_archivedStickers.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_archivedStickers", constructor)); + } else { + return null; + } + } + TL_messages_archivedStickers result = new TL_messages_archivedStickers(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - count = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - StickerSetCovered object = StickerSetCovered.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - sets.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + count = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + StickerSetCovered object = StickerSetCovered.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + sets.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(count); - stream.writeInt32(0x1cb5c415); - int count = sets.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - sets.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(count); + stream.writeInt32(0x1cb5c415); + int count = sets.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + sets.get(a).serializeToStream(stream); + } + } + } - public static abstract class DecryptedMessage extends TLObject { - public long random_id; - public int ttl; - public String message; - public DecryptedMessageMedia media; - public DecryptedMessageAction action; - public byte[] random_bytes; - public int flags; - public ArrayList entities = new ArrayList<>(); - public String via_bot_name; - public long reply_to_random_id; - public long grouped_id; - public boolean silent; + public static abstract class DecryptedMessage extends TLObject { + public long random_id; + public int ttl; + public String message; + public DecryptedMessageMedia media; + public DecryptedMessageAction action; + public byte[] random_bytes; + public int flags; + public ArrayList entities = new ArrayList<>(); + public String via_bot_name; + public long reply_to_random_id; + public long grouped_id; + public boolean silent; - public static DecryptedMessage TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - DecryptedMessage result = null; - switch (constructor) { - case 0x204d3878: - result = new TL_decryptedMessage_layer17(); - break; - case 0x73164160: - result = new TL_decryptedMessageService(); - break; - case 0xaa48327d: - result = new TL_decryptedMessageService_layer8(); - break; - case 0x1f814f1f: - result = new TL_decryptedMessage_layer8(); - break; - case 0x91cc4674: - result = new TL_decryptedMessage(); - break; - case 0x36b091de: - result = new TL_decryptedMessage_layer45(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in DecryptedMessage", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static DecryptedMessage TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + DecryptedMessage result = null; + switch (constructor) { + case 0x204d3878: + result = new TL_decryptedMessage_layer17(); + break; + case 0x73164160: + result = new TL_decryptedMessageService(); + break; + case 0xaa48327d: + result = new TL_decryptedMessageService_layer8(); + break; + case 0x1f814f1f: + result = new TL_decryptedMessage_layer8(); + break; + case 0x91cc4674: + result = new TL_decryptedMessage(); + break; + case 0x36b091de: + result = new TL_decryptedMessage_layer45(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in DecryptedMessage", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_decryptedMessage_layer17 extends TL_decryptedMessage { - public static int constructor = 0x204d3878; + public static class TL_decryptedMessage_layer17 extends TL_decryptedMessage { + public static int constructor = 0x204d3878; - public void readParams(AbstractSerializedData stream, boolean exception) { - random_id = stream.readInt64(exception); - ttl = stream.readInt32(exception); - message = stream.readString(exception); - media = DecryptedMessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + random_id = stream.readInt64(exception); + ttl = stream.readInt32(exception); + message = stream.readString(exception); + media = DecryptedMessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(random_id); - stream.writeInt32(ttl); - stream.writeString(message); - media.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(random_id); + stream.writeInt32(ttl); + stream.writeString(message); + media.serializeToStream(stream); + } + } - public static class TL_decryptedMessageService extends DecryptedMessage { - public static int constructor = 0x73164160; + public static class TL_decryptedMessageService extends DecryptedMessage { + public static int constructor = 0x73164160; - public void readParams(AbstractSerializedData stream, boolean exception) { - random_id = stream.readInt64(exception); - action = DecryptedMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + random_id = stream.readInt64(exception); + action = DecryptedMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(random_id); - action.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(random_id); + action.serializeToStream(stream); + } + } - public static class TL_decryptedMessageService_layer8 extends TL_decryptedMessageService { - public static int constructor = 0xaa48327d; + public static class TL_decryptedMessageService_layer8 extends TL_decryptedMessageService { + public static int constructor = 0xaa48327d; - public void readParams(AbstractSerializedData stream, boolean exception) { - random_id = stream.readInt64(exception); - random_bytes = stream.readByteArray(exception); - action = DecryptedMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + random_id = stream.readInt64(exception); + random_bytes = stream.readByteArray(exception); + action = DecryptedMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(random_id); - stream.writeByteArray(random_bytes); - action.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(random_id); + stream.writeByteArray(random_bytes); + action.serializeToStream(stream); + } + } - public static class TL_decryptedMessage_layer8 extends TL_decryptedMessage { - public static int constructor = 0x1f814f1f; + public static class TL_decryptedMessage_layer8 extends TL_decryptedMessage { + public static int constructor = 0x1f814f1f; - public void readParams(AbstractSerializedData stream, boolean exception) { - random_id = stream.readInt64(exception); - random_bytes = stream.readByteArray(exception); - message = stream.readString(exception); - media = DecryptedMessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + random_id = stream.readInt64(exception); + random_bytes = stream.readByteArray(exception); + message = stream.readString(exception); + media = DecryptedMessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(random_id); - stream.writeByteArray(random_bytes); - stream.writeString(message); - media.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(random_id); + stream.writeByteArray(random_bytes); + stream.writeString(message); + media.serializeToStream(stream); + } + } - public static class TL_decryptedMessage extends DecryptedMessage { - public static int constructor = 0x91cc4674; + public static class TL_decryptedMessage extends DecryptedMessage { + public static int constructor = 0x91cc4674; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); silent = (flags & 32) != 0; - random_id = stream.readInt64(exception); - ttl = stream.readInt32(exception); - message = stream.readString(exception); - if ((flags & 512) != 0) { - media = DecryptedMessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 128) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - } - if ((flags & 2048) != 0) { - via_bot_name = stream.readString(exception); - } - if ((flags & 8) != 0) { - reply_to_random_id = stream.readInt64(exception); - } - if ((flags & 131072) != 0) { - grouped_id = stream.readInt64(exception); - } - } + random_id = stream.readInt64(exception); + ttl = stream.readInt32(exception); + message = stream.readString(exception); + if ((flags & 512) != 0) { + media = DecryptedMessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 128) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + } + if ((flags & 2048) != 0) { + via_bot_name = stream.readString(exception); + } + if ((flags & 8) != 0) { + reply_to_random_id = stream.readInt64(exception); + } + if ((flags & 131072) != 0) { + grouped_id = stream.readInt64(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); flags = silent ? (flags | 32) : (flags &~ 32); - stream.writeInt32(flags); - stream.writeInt64(random_id); - stream.writeInt32(ttl); - stream.writeString(message); - if ((flags & 512) != 0) { - media.serializeToStream(stream); - } - if ((flags & 128) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - if ((flags & 2048) != 0) { - stream.writeString(via_bot_name); - } - if ((flags & 8) != 0) { - stream.writeInt64(reply_to_random_id); - } - if ((flags & 131072) != 0) { - stream.writeInt64(grouped_id); - } - } - } + stream.writeInt32(flags); + stream.writeInt64(random_id); + stream.writeInt32(ttl); + stream.writeString(message); + if ((flags & 512) != 0) { + media.serializeToStream(stream); + } + if ((flags & 128) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + if ((flags & 2048) != 0) { + stream.writeString(via_bot_name); + } + if ((flags & 8) != 0) { + stream.writeInt64(reply_to_random_id); + } + if ((flags & 131072) != 0) { + stream.writeInt64(grouped_id); + } + } + } - public static class TL_decryptedMessage_layer45 extends TL_decryptedMessage { - public static int constructor = 0x36b091de; + public static class TL_decryptedMessage_layer45 extends TL_decryptedMessage { + public static int constructor = 0x36b091de; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - random_id = stream.readInt64(exception); - ttl = stream.readInt32(exception); - message = stream.readString(exception); - if ((flags & 512) != 0) { - media = DecryptedMessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 128) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - } - if ((flags & 2048) != 0) { - via_bot_name = stream.readString(exception); - } - if ((flags & 8) != 0) { - reply_to_random_id = stream.readInt64(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + random_id = stream.readInt64(exception); + ttl = stream.readInt32(exception); + message = stream.readString(exception); + if ((flags & 512) != 0) { + media = DecryptedMessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 128) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + } + if ((flags & 2048) != 0) { + via_bot_name = stream.readString(exception); + } + if ((flags & 8) != 0) { + reply_to_random_id = stream.readInt64(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeInt64(random_id); - stream.writeInt32(ttl); - stream.writeString(message); - if ((flags & 512) != 0) { - media.serializeToStream(stream); - } - if ((flags & 128) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - if ((flags & 2048) != 0) { - stream.writeString(via_bot_name); - } - if ((flags & 8) != 0) { - stream.writeInt64(reply_to_random_id); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeInt64(random_id); + stream.writeInt32(ttl); + stream.writeString(message); + if ((flags & 512) != 0) { + media.serializeToStream(stream); + } + if ((flags & 128) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + if ((flags & 2048) != 0) { + stream.writeString(via_bot_name); + } + if ((flags & 8) != 0) { + stream.writeInt64(reply_to_random_id); + } + } + } public static abstract class account_Themes extends TLObject { @@ -22344,68 +22681,70 @@ public class TLRPC { } } - public static class TL_inputWebDocument extends TLObject { - public static int constructor = 0x9bed434d; + public static class TL_inputWebDocument extends TLObject { + public static int constructor = 0x9bed434d; - public String url; - public int size; - public String mime_type; - public ArrayList attributes = new ArrayList<>(); + public String url; + public int size; + public String mime_type; + public ArrayList attributes = new ArrayList<>(); - public static TL_inputWebDocument TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_inputWebDocument.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_inputWebDocument", constructor)); - } else { - return null; - } - } - TL_inputWebDocument result = new TL_inputWebDocument(); - result.readParams(stream, exception); - return result; - } + public static TL_inputWebDocument TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_inputWebDocument.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_inputWebDocument", constructor)); + } else { + return null; + } + } + TL_inputWebDocument result = new TL_inputWebDocument(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - url = stream.readString(exception); - size = stream.readInt32(exception); - mime_type = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - attributes.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + url = stream.readString(exception); + size = stream.readInt32(exception); + mime_type = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + attributes.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(url); - stream.writeInt32(size); - stream.writeString(mime_type); - stream.writeInt32(0x1cb5c415); - int count = attributes.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - attributes.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(url); + stream.writeInt32(size); + stream.writeString(mime_type); + stream.writeInt32(0x1cb5c415); + int count = attributes.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + attributes.get(a).serializeToStream(stream); + } + } + } public static class TL_messageReactions extends TLObject { - public static int constructor = 0xb87a24d1; + public static int constructor = 0x87b6e36; public int flags; public boolean min; + public boolean can_see_list; public ArrayList results = new ArrayList<>(); + public ArrayList recent_reactons = new ArrayList<>(); public static TL_messageReactions TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { if (TL_messageReactions.constructor != constructor) { @@ -22423,6 +22762,7 @@ public class TLRPC { public void readParams(AbstractSerializedData stream, boolean exception) { flags = stream.readInt32(exception); min = (flags & 1) != 0; + can_see_list = (flags & 4) != 0; int magic = stream.readInt32(exception); if (magic != 0x1cb5c415) { if (exception) { @@ -22438,11 +22778,29 @@ public class TLRPC { } results.add(object); } + if ((flags & 2) != 0) { + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_messageUserReaction object = TL_messageUserReaction.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + recent_reactons.add(object); + } + } } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); flags = min ? (flags | 1) : (flags &~ 1); + flags = can_see_list ? (flags | 4) : (flags &~ 4); stream.writeInt32(flags); stream.writeInt32(0x1cb5c415); int count = results.size(); @@ -22450,242 +22808,250 @@ public class TLRPC { for (int a = 0; a < count; a++) { results.get(a).serializeToStream(stream); } + if ((flags & 2) != 0) { + stream.writeInt32(0x1cb5c415); + count = recent_reactons.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + recent_reactons.get(a).serializeToStream(stream); + } + } } } - public static abstract class Video extends TLObject { - public long id; - public long access_hash; - public long user_id; - public int date; - public int duration; - public int size; - public PhotoSize thumb; - public int dc_id; - public int w; - public int h; - public String mime_type; - public String caption; - public byte[] key; - public byte[] iv; + public static abstract class Video extends TLObject { + public long id; + public long access_hash; + public long user_id; + public int date; + public int duration; + public int size; + public PhotoSize thumb; + public int dc_id; + public int w; + public int h; + public String mime_type; + public String caption; + public byte[] key; + public byte[] iv; - public static Video TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - Video result = null; - switch (constructor) { - case 0xee9f4a4d: - result = new TL_video_old3(); - break; - case 0xf72887d3: - result = new TL_video_layer45(); - break; - case 0x55555553: - result = new TL_videoEncrypted(); - break; - case 0x5a04a49f: - result = new TL_video_old(); - break; - case 0x388fa391: - result = new TL_video_old2(); - break; - case 0xc10658a8: - result = new TL_videoEmpty_layer45(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in Video", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static Video TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + Video result = null; + switch (constructor) { + case 0xee9f4a4d: + result = new TL_video_old3(); + break; + case 0xf72887d3: + result = new TL_video_layer45(); + break; + case 0x55555553: + result = new TL_videoEncrypted(); + break; + case 0x5a04a49f: + result = new TL_video_old(); + break; + case 0x388fa391: + result = new TL_video_old2(); + break; + case 0xc10658a8: + result = new TL_videoEmpty_layer45(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in Video", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_video_old3 extends TL_video_layer45 { - public static int constructor = 0xee9f4a4d; + public static class TL_video_old3 extends TL_video_layer45 { + public static int constructor = 0xee9f4a4d; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - user_id = stream.readInt32(exception); - date = stream.readInt32(exception); - duration = stream.readInt32(exception); - size = stream.readInt32(exception); - thumb = PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception); - dc_id = stream.readInt32(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + user_id = stream.readInt32(exception); + date = stream.readInt32(exception); + duration = stream.readInt32(exception); + size = stream.readInt32(exception); + thumb = PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception); + dc_id = stream.readInt32(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32((int) user_id); - stream.writeInt32(date); - stream.writeInt32(duration); - stream.writeInt32(size); - thumb.serializeToStream(stream); - stream.writeInt32(dc_id); - stream.writeInt32(w); - stream.writeInt32(h); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32((int) user_id); + stream.writeInt32(date); + stream.writeInt32(duration); + stream.writeInt32(size); + thumb.serializeToStream(stream); + stream.writeInt32(dc_id); + stream.writeInt32(w); + stream.writeInt32(h); + } + } - public static class TL_video_layer45 extends Video { - public static int constructor = 0xf72887d3; + public static class TL_video_layer45 extends Video { + public static int constructor = 0xf72887d3; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); - duration = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - thumb = PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception); - dc_id = stream.readInt32(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + date = stream.readInt32(exception); + duration = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + thumb = PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception); + dc_id = stream.readInt32(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32(date); - stream.writeInt32(duration); - stream.writeString(mime_type); - stream.writeInt32(size); - thumb.serializeToStream(stream); - stream.writeInt32(dc_id); - stream.writeInt32(w); - stream.writeInt32(h); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32(date); + stream.writeInt32(duration); + stream.writeString(mime_type); + stream.writeInt32(size); + thumb.serializeToStream(stream); + stream.writeInt32(dc_id); + stream.writeInt32(w); + stream.writeInt32(h); + } + } - public static class TL_videoEncrypted extends TL_video_layer45 { - public static int constructor = 0x55555553; + public static class TL_videoEncrypted extends TL_video_layer45 { + public static int constructor = 0x55555553; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - user_id = stream.readInt32(exception); - date = stream.readInt32(exception); - caption = stream.readString(exception); - duration = stream.readInt32(exception); - size = stream.readInt32(exception); - thumb = PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception); - dc_id = stream.readInt32(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + user_id = stream.readInt32(exception); + date = stream.readInt32(exception); + caption = stream.readString(exception); + duration = stream.readInt32(exception); + size = stream.readInt32(exception); + thumb = PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception); + dc_id = stream.readInt32(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32((int) user_id); - stream.writeInt32(date); - stream.writeString(caption); - stream.writeInt32(duration); - stream.writeInt32(size); - thumb.serializeToStream(stream); - stream.writeInt32(dc_id); - stream.writeInt32(w); - stream.writeInt32(h); - stream.writeByteArray(key); - stream.writeByteArray(iv); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32((int) user_id); + stream.writeInt32(date); + stream.writeString(caption); + stream.writeInt32(duration); + stream.writeInt32(size); + thumb.serializeToStream(stream); + stream.writeInt32(dc_id); + stream.writeInt32(w); + stream.writeInt32(h); + stream.writeByteArray(key); + stream.writeByteArray(iv); + } + } - public static class TL_video_old extends TL_video_layer45 { - public static int constructor = 0x5a04a49f; + public static class TL_video_old extends TL_video_layer45 { + public static int constructor = 0x5a04a49f; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - user_id = stream.readInt32(exception); - date = stream.readInt32(exception); - caption = stream.readString(exception); - duration = stream.readInt32(exception); - size = stream.readInt32(exception); - thumb = PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception); - dc_id = stream.readInt32(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + user_id = stream.readInt32(exception); + date = stream.readInt32(exception); + caption = stream.readString(exception); + duration = stream.readInt32(exception); + size = stream.readInt32(exception); + thumb = PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception); + dc_id = stream.readInt32(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32((int) user_id); - stream.writeInt32(date); - stream.writeString(caption); - stream.writeInt32(duration); - stream.writeInt32(size); - thumb.serializeToStream(stream); - stream.writeInt32(dc_id); - stream.writeInt32(w); - stream.writeInt32(h); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32((int) user_id); + stream.writeInt32(date); + stream.writeString(caption); + stream.writeInt32(duration); + stream.writeInt32(size); + thumb.serializeToStream(stream); + stream.writeInt32(dc_id); + stream.writeInt32(w); + stream.writeInt32(h); + } + } - public static class TL_video_old2 extends TL_video_layer45 { - public static int constructor = 0x388fa391; + public static class TL_video_old2 extends TL_video_layer45 { + public static int constructor = 0x388fa391; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - user_id = stream.readInt32(exception); - date = stream.readInt32(exception); - caption = stream.readString(exception); - duration = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - thumb = PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception); - dc_id = stream.readInt32(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + user_id = stream.readInt32(exception); + date = stream.readInt32(exception); + caption = stream.readString(exception); + duration = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + thumb = PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception); + dc_id = stream.readInt32(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32((int) user_id); - stream.writeInt32(date); - stream.writeString(caption); - stream.writeInt32(duration); - stream.writeString(mime_type); - stream.writeInt32(size); - thumb.serializeToStream(stream); - stream.writeInt32(dc_id); - stream.writeInt32(w); - stream.writeInt32(h); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32((int) user_id); + stream.writeInt32(date); + stream.writeString(caption); + stream.writeInt32(duration); + stream.writeString(mime_type); + stream.writeInt32(size); + thumb.serializeToStream(stream); + stream.writeInt32(dc_id); + stream.writeInt32(w); + stream.writeInt32(h); + } + } - public static class TL_videoEmpty_layer45 extends Video { - public static int constructor = 0xc10658a8; + public static class TL_videoEmpty_layer45 extends Video { + public static int constructor = 0xc10658a8; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + } + } public static abstract class InputPaymentCredentials extends TLObject { @@ -22767,36 +23133,36 @@ public class TLRPC { } } - public static class TL_exportedMessageLink extends TLObject { - public static int constructor = 0x5dab1af4; + public static class TL_exportedMessageLink extends TLObject { + public static int constructor = 0x5dab1af4; - public String link; - public String html; + public String link; + public String html; - public static TL_exportedMessageLink TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_exportedMessageLink.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_exportedMessageLink", constructor)); - } else { - return null; - } - } - TL_exportedMessageLink result = new TL_exportedMessageLink(); - result.readParams(stream, exception); - return result; - } + public static TL_exportedMessageLink TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_exportedMessageLink.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_exportedMessageLink", constructor)); + } else { + return null; + } + } + TL_exportedMessageLink result = new TL_exportedMessageLink(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - link = stream.readString(exception); - html = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + link = stream.readString(exception); + html = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(link); - stream.writeString(html); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(link); + stream.writeString(html); + } + } public static class TL_groupCallParticipantVideo extends TLObject { public static int constructor = 0x67753ac8; @@ -23019,66 +23385,66 @@ public class TLRPC { } } - public static class TL_payments_validatedRequestedInfo extends TLObject { - public static int constructor = 0xd1451883; + public static class TL_payments_validatedRequestedInfo extends TLObject { + public static int constructor = 0xd1451883; - public int flags; - public String id; - public ArrayList shipping_options = new ArrayList<>(); + public int flags; + public String id; + public ArrayList shipping_options = new ArrayList<>(); - public static TL_payments_validatedRequestedInfo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_payments_validatedRequestedInfo.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_payments_validatedRequestedInfo", constructor)); - } else { - return null; - } - } - TL_payments_validatedRequestedInfo result = new TL_payments_validatedRequestedInfo(); - result.readParams(stream, exception); - return result; - } + public static TL_payments_validatedRequestedInfo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_payments_validatedRequestedInfo.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_payments_validatedRequestedInfo", constructor)); + } else { + return null; + } + } + TL_payments_validatedRequestedInfo result = new TL_payments_validatedRequestedInfo(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - if ((flags & 1) != 0) { - id = stream.readString(exception); - } - if ((flags & 2) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_shippingOption object = TL_shippingOption.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - shipping_options.add(object); - } - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + if ((flags & 1) != 0) { + id = stream.readString(exception); + } + if ((flags & 2) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_shippingOption object = TL_shippingOption.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + shipping_options.add(object); + } + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - stream.writeString(id); - } - if ((flags & 2) != 0) { - stream.writeInt32(0x1cb5c415); - int count = shipping_options.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - shipping_options.get(a).serializeToStream(stream); - } - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + stream.writeString(id); + } + if ((flags & 2) != 0) { + stream.writeInt32(0x1cb5c415); + int count = shipping_options.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + shipping_options.get(a).serializeToStream(stream); + } + } + } + } public static class TL_jsonObjectValue extends TLObject { public static int constructor = 0xc0de1bd9; @@ -23183,111 +23549,111 @@ public class TLRPC { } } - public static class TL_shippingOption extends TLObject { - public static int constructor = 0xb6213cdf; + public static class TL_shippingOption extends TLObject { + public static int constructor = 0xb6213cdf; - public String id; - public String title; - public ArrayList prices = new ArrayList<>(); + public String id; + public String title; + public ArrayList prices = new ArrayList<>(); - public static TL_shippingOption TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_shippingOption.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_shippingOption", constructor)); - } else { - return null; - } - } - TL_shippingOption result = new TL_shippingOption(); - result.readParams(stream, exception); - return result; - } + public static TL_shippingOption TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_shippingOption.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_shippingOption", constructor)); + } else { + return null; + } + } + TL_shippingOption result = new TL_shippingOption(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readString(exception); - title = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_labeledPrice object = TL_labeledPrice.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - prices.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readString(exception); + title = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_labeledPrice object = TL_labeledPrice.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + prices.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(id); - stream.writeString(title); - stream.writeInt32(0x1cb5c415); - int count = prices.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - prices.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(id); + stream.writeString(title); + stream.writeInt32(0x1cb5c415); + int count = prices.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + prices.get(a).serializeToStream(stream); + } + } + } - public static abstract class InputDocument extends TLObject { - public long id; - public long access_hash; - public byte[] file_reference; + public static abstract class InputDocument extends TLObject { + public long id; + public long access_hash; + public byte[] file_reference; - public static InputDocument TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - InputDocument result = null; - switch (constructor) { - case 0x72f0eaae: - result = new TL_inputDocumentEmpty(); - break; - case 0x1abfb575: - result = new TL_inputDocument(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in InputDocument", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static InputDocument TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + InputDocument result = null; + switch (constructor) { + case 0x72f0eaae: + result = new TL_inputDocumentEmpty(); + break; + case 0x1abfb575: + result = new TL_inputDocument(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in InputDocument", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_inputDocumentEmpty extends InputDocument { - public static int constructor = 0x72f0eaae; + public static class TL_inputDocumentEmpty extends InputDocument { + public static int constructor = 0x72f0eaae; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputDocument extends InputDocument { - public static int constructor = 0x1abfb575; + public static class TL_inputDocument extends InputDocument { + public static int constructor = 0x1abfb575; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - file_reference = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + file_reference = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeByteArray(file_reference); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeByteArray(file_reference); + } + } public static class TL_folderPeer extends TLObject { public static int constructor = 0xe9baa668; @@ -23409,177 +23775,177 @@ public class TLRPC { } } - public static abstract class SecureValueType extends TLObject { + public static abstract class SecureValueType extends TLObject { - public static SecureValueType TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - SecureValueType result = null; - switch (constructor) { - case 0xcbe31e26: - result = new TL_secureValueTypeAddress(); - break; - case 0x99e3806a: - result = new TL_secureValueTypePassportRegistration(); - break; - case 0xa0d0744b: - result = new TL_secureValueTypeIdentityCard(); - break; - case 0xfc36954e: - result = new TL_secureValueTypeUtilityBill(); - break; - case 0x89137c0d: - result = new TL_secureValueTypeBankStatement(); - break; - case 0x8e3ca7ee: - result = new TL_secureValueTypeEmail(); - break; - case 0x9d2a81e3: - result = new TL_secureValueTypePersonalDetails(); - break; - case 0xea02ec33: - result = new TL_secureValueTypeTemporaryRegistration(); - break; - case 0x3dac6a00: - result = new TL_secureValueTypePassport(); - break; - case 0x8b883488: - result = new TL_secureValueTypeRentalAgreement(); - break; - case 0x6e425c4: - result = new TL_secureValueTypeDriverLicense(); - break; - case 0xb320aadb: - result = new TL_secureValueTypePhone(); - break; - case 0x99a48f23: - result = new TL_secureValueTypeInternalPassport(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in SecureValueType", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static SecureValueType TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + SecureValueType result = null; + switch (constructor) { + case 0xcbe31e26: + result = new TL_secureValueTypeAddress(); + break; + case 0x99e3806a: + result = new TL_secureValueTypePassportRegistration(); + break; + case 0xa0d0744b: + result = new TL_secureValueTypeIdentityCard(); + break; + case 0xfc36954e: + result = new TL_secureValueTypeUtilityBill(); + break; + case 0x89137c0d: + result = new TL_secureValueTypeBankStatement(); + break; + case 0x8e3ca7ee: + result = new TL_secureValueTypeEmail(); + break; + case 0x9d2a81e3: + result = new TL_secureValueTypePersonalDetails(); + break; + case 0xea02ec33: + result = new TL_secureValueTypeTemporaryRegistration(); + break; + case 0x3dac6a00: + result = new TL_secureValueTypePassport(); + break; + case 0x8b883488: + result = new TL_secureValueTypeRentalAgreement(); + break; + case 0x6e425c4: + result = new TL_secureValueTypeDriverLicense(); + break; + case 0xb320aadb: + result = new TL_secureValueTypePhone(); + break; + case 0x99a48f23: + result = new TL_secureValueTypeInternalPassport(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in SecureValueType", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_secureValueTypeAddress extends SecureValueType { - public static int constructor = 0xcbe31e26; + public static class TL_secureValueTypeAddress extends SecureValueType { + public static int constructor = 0xcbe31e26; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypePassportRegistration extends SecureValueType { - public static int constructor = 0x99e3806a; + public static class TL_secureValueTypePassportRegistration extends SecureValueType { + public static int constructor = 0x99e3806a; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypeIdentityCard extends SecureValueType { - public static int constructor = 0xa0d0744b; + public static class TL_secureValueTypeIdentityCard extends SecureValueType { + public static int constructor = 0xa0d0744b; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypeUtilityBill extends SecureValueType { - public static int constructor = 0xfc36954e; + public static class TL_secureValueTypeUtilityBill extends SecureValueType { + public static int constructor = 0xfc36954e; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypeBankStatement extends SecureValueType { - public static int constructor = 0x89137c0d; + public static class TL_secureValueTypeBankStatement extends SecureValueType { + public static int constructor = 0x89137c0d; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypeEmail extends SecureValueType { - public static int constructor = 0x8e3ca7ee; + public static class TL_secureValueTypeEmail extends SecureValueType { + public static int constructor = 0x8e3ca7ee; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypePersonalDetails extends SecureValueType { - public static int constructor = 0x9d2a81e3; + public static class TL_secureValueTypePersonalDetails extends SecureValueType { + public static int constructor = 0x9d2a81e3; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypeTemporaryRegistration extends SecureValueType { - public static int constructor = 0xea02ec33; + public static class TL_secureValueTypeTemporaryRegistration extends SecureValueType { + public static int constructor = 0xea02ec33; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypePassport extends SecureValueType { - public static int constructor = 0x3dac6a00; + public static class TL_secureValueTypePassport extends SecureValueType { + public static int constructor = 0x3dac6a00; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypeRentalAgreement extends SecureValueType { - public static int constructor = 0x8b883488; + public static class TL_secureValueTypeRentalAgreement extends SecureValueType { + public static int constructor = 0x8b883488; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypeDriverLicense extends SecureValueType { - public static int constructor = 0x6e425c4; + public static class TL_secureValueTypeDriverLicense extends SecureValueType { + public static int constructor = 0x6e425c4; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypePhone extends SecureValueType { - public static int constructor = 0xb320aadb; + public static class TL_secureValueTypePhone extends SecureValueType { + public static int constructor = 0xb320aadb; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureValueTypeInternalPassport extends SecureValueType { - public static int constructor = 0x99a48f23; + public static class TL_secureValueTypeInternalPassport extends SecureValueType { + public static int constructor = 0x99a48f23; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_peerBlocked extends TLObject { public static int constructor = 0xe8fd8014; @@ -23612,230 +23978,230 @@ public class TLRPC { } } - public static class TL_messages_affectedHistory extends TLObject { + public static class TL_messages_affectedHistory extends TLObject { public static int constructor = 0xb45c69d1; - public int pts; - public int pts_count; - public int offset; + public int pts; + public int pts_count; + public int offset; - public static TL_messages_affectedHistory TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messages_affectedHistory.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messages_affectedHistory", constructor)); - } else { - return null; - } - } - TL_messages_affectedHistory result = new TL_messages_affectedHistory(); - result.readParams(stream, exception); - return result; + public static TL_messages_affectedHistory TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_affectedHistory.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_affectedHistory", constructor)); + } else { + return null; + } + } + TL_messages_affectedHistory result = new TL_messages_affectedHistory(); + result.readParams(stream, exception); + return result; } - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { pts = stream.readInt32(exception); - pts_count = stream.readInt32(exception); - offset = stream.readInt32(exception); - } + pts_count = stream.readInt32(exception); + offset = stream.readInt32(exception); + } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); stream.writeInt32(pts); - stream.writeInt32(pts_count); - stream.writeInt32(offset); - } - } + stream.writeInt32(pts_count); + stream.writeInt32(offset); + } + } - public static abstract class Document extends TLObject { + public static abstract class Document extends TLObject { public int flags; - public long id; - public long access_hash; - public byte[] file_reference; - public long user_id; - public int date; - public String file_name; - public String mime_type; - public int size; + public long id; + public long access_hash; + public byte[] file_reference; + public long user_id; + public int date; + public String file_name; + public String mime_type; + public int size; public ArrayList thumbs = new ArrayList<>(); public ArrayList video_thumbs = new ArrayList<>(); - public int version; - public int dc_id; - public byte[] key; - public byte[] iv; - public ArrayList attributes = new ArrayList<>(); + public int version; + public int dc_id; + public byte[] key; + public byte[] iv; + public ArrayList attributes = new ArrayList<>(); - public static Document TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - Document result = null; - switch (constructor) { + public static Document TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + Document result = null; + switch (constructor) { case 0x9ba29cc1: result = new TL_document_layer113(); break; - case 0x59534e4c: - result = new TL_document_layer92(); - break; - case 0x87232bc7: - result = new TL_document_layer82(); - break; - case 0x55555556: - result = new TL_documentEncrypted_old(); - break; + case 0x59534e4c: + result = new TL_document_layer92(); + break; + case 0x87232bc7: + result = new TL_document_layer82(); + break; + case 0x55555556: + result = new TL_documentEncrypted_old(); + break; case 0x1e87342b: result = new TL_document(); break; - case 0x9efc6326: - result = new TL_document_old(); - break; - case 0x36f8c871: - result = new TL_documentEmpty(); - break; - case 0x55555558: - result = new TL_documentEncrypted(); - break; - case 0xf9a39f4f: - result = new TL_document_layer53(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in Document", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0x9efc6326: + result = new TL_document_old(); + break; + case 0x36f8c871: + result = new TL_documentEmpty(); + break; + case 0x55555558: + result = new TL_documentEncrypted(); + break; + case 0xf9a39f4f: + result = new TL_document_layer53(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in Document", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_document_layer92 extends TL_document { - public static int constructor = 0x59534e4c; + public static class TL_document_layer92 extends TL_document { + public static int constructor = 0x59534e4c; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - file_reference = stream.readByteArray(exception); - date = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); - dc_id = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - attributes.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + file_reference = stream.readByteArray(exception); + date = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); + dc_id = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + attributes.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeByteArray(file_reference); - stream.writeInt32(date); - stream.writeString(mime_type); - stream.writeInt32(size); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeByteArray(file_reference); + stream.writeInt32(date); + stream.writeString(mime_type); + stream.writeInt32(size); thumbs.get(0).serializeToStream(stream); - stream.writeInt32(dc_id); - stream.writeInt32(0x1cb5c415); - int count = attributes.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - attributes.get(a).serializeToStream(stream); - } - } - } + stream.writeInt32(dc_id); + stream.writeInt32(0x1cb5c415); + int count = attributes.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + attributes.get(a).serializeToStream(stream); + } + } + } - public static class TL_document_layer82 extends TL_document { - public static int constructor = 0x87232bc7; + public static class TL_document_layer82 extends TL_document { + public static int constructor = 0x87232bc7; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); - dc_id = stream.readInt32(exception); - stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - attributes.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + date = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); + dc_id = stream.readInt32(exception); + stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + attributes.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32(date); - stream.writeString(mime_type); - stream.writeInt32(size); - thumbs.get(0).serializeToStream(stream); - stream.writeInt32(dc_id); - stream.writeInt32(0); - stream.writeInt32(0x1cb5c415); - int count = attributes.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - attributes.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32(date); + stream.writeString(mime_type); + stream.writeInt32(size); + thumbs.get(0).serializeToStream(stream); + stream.writeInt32(dc_id); + stream.writeInt32(0); + stream.writeInt32(0x1cb5c415); + int count = attributes.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + attributes.get(a).serializeToStream(stream); + } + } + } - public static class TL_documentEncrypted_old extends TL_document { - public static int constructor = 0x55555556; + public static class TL_documentEncrypted_old extends TL_document { + public static int constructor = 0x55555556; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); user_id = stream.readInt32(exception); - date = stream.readInt32(exception); - file_name = stream.readString(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); - dc_id = stream.readInt32(exception); + date = stream.readInt32(exception); + file_name = stream.readString(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); + dc_id = stream.readInt32(exception); key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - } + iv = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32((int) user_id); - stream.writeInt32(date); - stream.writeString(file_name); - stream.writeString(mime_type); - stream.writeInt32(size); - thumbs.get(0).serializeToStream(stream); - stream.writeInt32(dc_id); - stream.writeByteArray(key); - stream.writeByteArray(iv); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32((int) user_id); + stream.writeInt32(date); + stream.writeString(file_name); + stream.writeString(mime_type); + stream.writeInt32(size); + thumbs.get(0).serializeToStream(stream); + stream.writeInt32(dc_id); + stream.writeByteArray(key); + stream.writeByteArray(iv); + } + } public static class TL_document extends Document { public static int constructor = 0x1e87342b; @@ -24010,147 +24376,147 @@ public class TLRPC { } } - public static class TL_document_old extends TL_document { - public static int constructor = 0x9efc6326; + public static class TL_document_old extends TL_document { + public static int constructor = 0x9efc6326; - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { id = stream.readInt64(exception); access_hash = stream.readInt64(exception); - user_id = stream.readInt32(exception); - date = stream.readInt32(exception); + user_id = stream.readInt32(exception); + date = stream.readInt32(exception); file_name = stream.readString(exception); - mime_type = stream.readString(exception); + mime_type = stream.readString(exception); size = stream.readInt32(exception); thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); - dc_id = stream.readInt32(exception); - } + dc_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); stream.writeInt64(id); stream.writeInt64(access_hash); stream.writeInt32((int) user_id); stream.writeInt32(date); - stream.writeString(file_name); + stream.writeString(file_name); stream.writeString(mime_type); stream.writeInt32(size); - thumbs.get(0).serializeToStream(stream); - stream.writeInt32(dc_id); - } - } + thumbs.get(0).serializeToStream(stream); + stream.writeInt32(dc_id); + } + } - public static class TL_documentEmpty extends Document { - public static int constructor = 0x36f8c871; + public static class TL_documentEmpty extends Document { + public static int constructor = 0x36f8c871; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - } - } + stream.writeInt32(constructor); + stream.writeInt64(id); + } + } - public static class TL_documentEncrypted extends Document { - public static int constructor = 0x55555558; + public static class TL_documentEncrypted extends Document { + public static int constructor = 0x55555558; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); - dc_id = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - attributes.add(object); - } - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + date = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); + dc_id = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + attributes.add(object); + } + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32(date); - stream.writeString(mime_type); - stream.writeInt32(size); - thumbs.get(0).serializeToStream(stream); - stream.writeInt32(dc_id); - stream.writeInt32(0x1cb5c415); - int count = attributes.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - attributes.get(a).serializeToStream(stream); - } - stream.writeByteArray(key); - stream.writeByteArray(iv); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32(date); + stream.writeString(mime_type); + stream.writeInt32(size); + thumbs.get(0).serializeToStream(stream); + stream.writeInt32(dc_id); + stream.writeInt32(0x1cb5c415); + int count = attributes.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + attributes.get(a).serializeToStream(stream); + } + stream.writeByteArray(key); + stream.writeByteArray(iv); + } + } - public static class TL_document_layer53 extends TL_document { - public static int constructor = 0xf9a39f4f; + public static class TL_document_layer53 extends TL_document { + public static int constructor = 0xf9a39f4f; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); - dc_id = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - attributes.add(object); + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + date = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + thumbs.add(PhotoSize.TLdeserialize(0, 0, 0, stream, stream.readInt32(exception), exception)); + dc_id = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + attributes.add(object); } } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt64(id); + stream.writeInt64(id); stream.writeInt64(access_hash); - stream.writeInt32(date); + stream.writeInt32(date); stream.writeString(mime_type); - stream.writeInt32(size); + stream.writeInt32(size); thumbs.get(0).serializeToStream(stream); - stream.writeInt32(dc_id); + stream.writeInt32(dc_id); stream.writeInt32(0x1cb5c415); - int count = attributes.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - attributes.get(a).serializeToStream(stream); - } - } - } + int count = attributes.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + attributes.get(a).serializeToStream(stream); + } + } + } public static abstract class PasswordKdfAlgo extends TLObject { @@ -24207,11 +24573,11 @@ public class TLRPC { } } - public static abstract class PageBlock extends TLObject { - public boolean first; //custom - public boolean bottom; //custom - public int level; //custom - public int mid; //custom + public static abstract class PageBlock extends TLObject { + public boolean first; //custom + public boolean bottom; //custom + public int level; //custom + public int mid; //custom public int groupId; //custom public PhotoSize thumb; //custom public TLObject thumbObject; //custom @@ -24345,171 +24711,171 @@ public class TLRPC { } return result; } - } + } - public static class TL_pageBlockOrderedList extends PageBlock { - public static int constructor = 0x9a8ae1e1; + public static class TL_pageBlockOrderedList extends PageBlock { + public static int constructor = 0x9a8ae1e1; - public ArrayList items = new ArrayList<>(); + public ArrayList items = new ArrayList<>(); - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - PageListOrderedItem object = PageListOrderedItem.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - items.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + PageListOrderedItem object = PageListOrderedItem.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + items.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = items.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - items.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = items.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + items.get(a).serializeToStream(stream); + } + } + } - public static class TL_pageBlockEmbedPost extends PageBlock { - public static int constructor = 0xf259a80b; + public static class TL_pageBlockEmbedPost extends PageBlock { + public static int constructor = 0xf259a80b; - public String url; - public long webpage_id; - public long author_photo_id; - public String author; - public int date; - public ArrayList blocks = new ArrayList<>(); - public TL_pageCaption caption; + public String url; + public long webpage_id; + public long author_photo_id; + public String author; + public int date; + public ArrayList blocks = new ArrayList<>(); + public TL_pageCaption caption; - public void readParams(AbstractSerializedData stream, boolean exception) { - url = stream.readString(exception); - webpage_id = stream.readInt64(exception); - author_photo_id = stream.readInt64(exception); - author = stream.readString(exception); - date = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - blocks.add(object); - } - caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + url = stream.readString(exception); + webpage_id = stream.readInt64(exception); + author_photo_id = stream.readInt64(exception); + author = stream.readString(exception); + date = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + blocks.add(object); + } + caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(url); - stream.writeInt64(webpage_id); - stream.writeInt64(author_photo_id); - stream.writeString(author); - stream.writeInt32(date); - stream.writeInt32(0x1cb5c415); - int count = blocks.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - blocks.get(a).serializeToStream(stream); - } - caption.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(url); + stream.writeInt64(webpage_id); + stream.writeInt64(author_photo_id); + stream.writeString(author); + stream.writeInt32(date); + stream.writeInt32(0x1cb5c415); + int count = blocks.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + blocks.get(a).serializeToStream(stream); + } + caption.serializeToStream(stream); + } + } - public static class TL_pageBlockParagraph extends PageBlock { - public static int constructor = 0x467a0766; + public static class TL_pageBlockParagraph extends PageBlock { + public static int constructor = 0x467a0766; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_pageBlockKicker extends PageBlock { - public static int constructor = 0x1e148390; + public static class TL_pageBlockKicker extends PageBlock { + public static int constructor = 0x1e148390; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_pageBlockFooter extends PageBlock { - public static int constructor = 0x48870999; + public static class TL_pageBlockFooter extends PageBlock { + public static int constructor = 0x48870999; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_pageBlockHeader extends PageBlock { - public static int constructor = 0xbfd064ec; + public static class TL_pageBlockHeader extends PageBlock { + public static int constructor = 0xbfd064ec; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_pageBlockPreformatted extends PageBlock { - public static int constructor = 0xc070d93e; + public static class TL_pageBlockPreformatted extends PageBlock { + public static int constructor = 0xc070d93e; - public RichText text; - public String language; + public RichText text; + public String language; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - language = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + language = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - stream.writeString(language); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + stream.writeString(language); + } + } public static class TL_pageBlockRelatedArticles extends PageBlock { public static int constructor = 0x16115a96; @@ -24548,72 +24914,72 @@ public class TLRPC { } } - public static class TL_pageBlockSubheader extends PageBlock { - public static int constructor = 0xf12bb6e1; + public static class TL_pageBlockSubheader extends PageBlock { + public static int constructor = 0xf12bb6e1; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_pageBlockSlideshow extends PageBlock { - public static int constructor = 0x31f9590; + public static class TL_pageBlockSlideshow extends PageBlock { + public static int constructor = 0x31f9590; - public ArrayList items = new ArrayList<>(); - public TL_pageCaption caption; + public ArrayList items = new ArrayList<>(); + public TL_pageCaption caption; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - items.add(object); - } - caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + items.add(object); + } + caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = items.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - items.get(a).serializeToStream(stream); - } - caption.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = items.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + items.get(a).serializeToStream(stream); + } + caption.serializeToStream(stream); + } + } - public static class TL_pageBlockAnchor extends PageBlock { - public static int constructor = 0xce0d37b0; + public static class TL_pageBlockAnchor extends PageBlock { + public static int constructor = 0xce0d37b0; - public String name; + public String name; - public void readParams(AbstractSerializedData stream, boolean exception) { - name = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + name = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(name); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(name); + } + } public static class TL_pageBlockMap extends PageBlock { public static int constructor = 0xa44f3ef6; @@ -24642,130 +25008,130 @@ public class TLRPC { } } - public static class TL_pageBlockDivider extends PageBlock { - public static int constructor = 0xdb20b188; + public static class TL_pageBlockDivider extends PageBlock { + public static int constructor = 0xdb20b188; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_pageBlockPhoto extends PageBlock { - public static int constructor = 0x1759c560; + public static class TL_pageBlockPhoto extends PageBlock { + public static int constructor = 0x1759c560; - public int flags; - public long photo_id; - public TL_pageCaption caption; - public String url; - public long webpage_id; + public int flags; + public long photo_id; + public TL_pageCaption caption; + public String url; + public long webpage_id; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - photo_id = stream.readInt64(exception); - caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 1) != 0) { - url = stream.readString(exception); - } - if ((flags & 1) != 0) { - webpage_id = stream.readInt64(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + photo_id = stream.readInt64(exception); + caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 1) != 0) { + url = stream.readString(exception); + } + if ((flags & 1) != 0) { + webpage_id = stream.readInt64(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeInt64(photo_id); - caption.serializeToStream(stream); - if ((flags & 1) != 0) { - stream.writeString(url); - } - if ((flags & 1) != 0) { - stream.writeInt64(webpage_id); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeInt64(photo_id); + caption.serializeToStream(stream); + if ((flags & 1) != 0) { + stream.writeString(url); + } + if ((flags & 1) != 0) { + stream.writeInt64(webpage_id); + } + } + } - public static class TL_pageBlockList extends PageBlock { - public static int constructor = 0xe4e88011; + public static class TL_pageBlockList extends PageBlock { + public static int constructor = 0xe4e88011; public boolean ordered; - public ArrayList items = new ArrayList<>(); + public ArrayList items = new ArrayList<>(); - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - PageListItem object = PageListItem.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - items.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + PageListItem object = PageListItem.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + items.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = items.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - items.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = items.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + items.get(a).serializeToStream(stream); + } + } + } - public static class TL_pageBlockUnsupported extends PageBlock { - public static int constructor = 0x13567e8a; + public static class TL_pageBlockUnsupported extends PageBlock { + public static int constructor = 0x13567e8a; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_pageBlockCollage extends PageBlock { - public static int constructor = 0x65a0fa4d; + public static class TL_pageBlockCollage extends PageBlock { + public static int constructor = 0x65a0fa4d; - public ArrayList items = new ArrayList<>(); - public TL_pageCaption caption; + public ArrayList items = new ArrayList<>(); + public TL_pageCaption caption; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - items.add(object); - } - caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + items.add(object); + } + caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = items.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - items.get(a).serializeToStream(stream); - } - caption.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = items.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + items.get(a).serializeToStream(stream); + } + caption.serializeToStream(stream); + } + } public static class TL_pageBlockEmbed extends PageBlock { public static int constructor = 0xa8718dc5; @@ -24826,203 +25192,203 @@ public class TLRPC { } } - public static class TL_pageBlockSubtitle extends PageBlock { - public static int constructor = 0x8ffa9a1f; + public static class TL_pageBlockSubtitle extends PageBlock { + public static int constructor = 0x8ffa9a1f; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } - public static class TL_pageBlockBlockquote extends PageBlock { - public static int constructor = 0x263d7c26; + public static class TL_pageBlockBlockquote extends PageBlock { + public static int constructor = 0x263d7c26; - public RichText text; - public RichText caption; + public RichText text; + public RichText caption; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - caption = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + caption = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - caption.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + caption.serializeToStream(stream); + } + } - public static class TL_pageBlockDetails extends PageBlock { - public static int constructor = 0x76768bed; + public static class TL_pageBlockDetails extends PageBlock { + public static int constructor = 0x76768bed; - public int flags; - public boolean open; - public ArrayList blocks = new ArrayList<>(); - public RichText title; + public int flags; + public boolean open; + public ArrayList blocks = new ArrayList<>(); + public RichText title; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - open = (flags & 1) != 0; - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - blocks.add(object); - } - title = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + open = (flags & 1) != 0; + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + blocks.add(object); + } + title = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = open ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeInt32(0x1cb5c415); - int count = blocks.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - blocks.get(a).serializeToStream(stream); - } - title.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = open ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeInt32(0x1cb5c415); + int count = blocks.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + blocks.get(a).serializeToStream(stream); + } + title.serializeToStream(stream); + } + } - public static class TL_pageBlockChannel extends PageBlock { - public static int constructor = 0xef1751b5; + public static class TL_pageBlockChannel extends PageBlock { + public static int constructor = 0xef1751b5; - public Chat channel; + public Chat channel; - public void readParams(AbstractSerializedData stream, boolean exception) { - channel = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + channel = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - channel.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + channel.serializeToStream(stream); + } + } - public static class TL_pageBlockVideo extends PageBlock { - public static int constructor = 0x7c8fe7b6; + public static class TL_pageBlockVideo extends PageBlock { + public static int constructor = 0x7c8fe7b6; - public int flags; - public boolean autoplay; - public boolean loop; - public long video_id; - public TL_pageCaption caption; + public int flags; + public boolean autoplay; + public boolean loop; + public long video_id; + public TL_pageCaption caption; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - autoplay = (flags & 1) != 0; - loop = (flags & 2) != 0; - video_id = stream.readInt64(exception); - caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + autoplay = (flags & 1) != 0; + loop = (flags & 2) != 0; + video_id = stream.readInt64(exception); + caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = autoplay ? (flags | 1) : (flags &~ 1); - flags = loop ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - stream.writeInt64(video_id); - caption.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = autoplay ? (flags | 1) : (flags &~ 1); + flags = loop ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + stream.writeInt64(video_id); + caption.serializeToStream(stream); + } + } - public static class TL_pageBlockEmbed_layer60 extends TL_pageBlockEmbed { - public static int constructor = 0xd935d8fb; + public static class TL_pageBlockEmbed_layer60 extends TL_pageBlockEmbed { + public static int constructor = 0xd935d8fb; - public int flags; - public boolean full_width; - public boolean allow_scrolling; - public String url; - public String html; - public int w; - public int h; - public RichText caption; + public int flags; + public boolean full_width; + public boolean allow_scrolling; + public String url; + public String html; + public int w; + public int h; + public RichText caption; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - full_width = (flags & 1) != 0; - allow_scrolling = (flags & 8) != 0; - if ((flags & 2) != 0) { - url = stream.readString(exception); - } - if ((flags & 4) != 0) { - html = stream.readString(exception); - } - w = stream.readInt32(exception); - h = stream.readInt32(exception); - caption = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + full_width = (flags & 1) != 0; + allow_scrolling = (flags & 8) != 0; + if ((flags & 2) != 0) { + url = stream.readString(exception); + } + if ((flags & 4) != 0) { + html = stream.readString(exception); + } + w = stream.readInt32(exception); + h = stream.readInt32(exception); + caption = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = full_width ? (flags | 1) : (flags &~ 1); - flags = allow_scrolling ? (flags | 8) : (flags &~ 8); - stream.writeInt32(flags); - if ((flags & 2) != 0) { - stream.writeString(url); - } - if ((flags & 4) != 0) { - stream.writeString(html); - } - stream.writeInt32(w); - stream.writeInt32(h); - caption.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = full_width ? (flags | 1) : (flags &~ 1); + flags = allow_scrolling ? (flags | 8) : (flags &~ 8); + stream.writeInt32(flags); + if ((flags & 2) != 0) { + stream.writeString(url); + } + if ((flags & 4) != 0) { + stream.writeString(html); + } + stream.writeInt32(w); + stream.writeInt32(h); + caption.serializeToStream(stream); + } + } - public static class TL_pageBlockPullquote extends PageBlock { - public static int constructor = 0x4f4456d3; + public static class TL_pageBlockPullquote extends PageBlock { + public static int constructor = 0x4f4456d3; - public RichText text; - public RichText caption; + public RichText text; + public RichText caption; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - caption = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + caption = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - caption.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + caption.serializeToStream(stream); + } + } - public static class TL_pageBlockAudio extends PageBlock { - public static int constructor = 0x804361ea; + public static class TL_pageBlockAudio extends PageBlock { + public static int constructor = 0x804361ea; - public long audio_id; - public TL_pageCaption caption; + public long audio_id; + public TL_pageCaption caption; - public void readParams(AbstractSerializedData stream, boolean exception) { - audio_id = stream.readInt64(exception); - caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + audio_id = stream.readInt64(exception); + caption = TL_pageCaption.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(audio_id); - caption.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(audio_id); + caption.serializeToStream(stream); + } + } public static class TL_pageBlockTable extends PageBlock { public static int constructor = 0xbf4dea82; @@ -25070,53 +25436,53 @@ public class TLRPC { } } - public static class TL_pageBlockTitle extends PageBlock { - public static int constructor = 0x70abc3fd; + public static class TL_pageBlockTitle extends PageBlock { + public static int constructor = 0x70abc3fd; - public RichText text; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } public static class TL_pageBlockCover extends PageBlock { - public static int constructor = 0x39f23300; + public static int constructor = 0x39f23300; - public PageBlock cover; + public PageBlock cover; - public void readParams(AbstractSerializedData stream, boolean exception) { - cover = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + cover = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - cover.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + cover.serializeToStream(stream); + } + } - public static class TL_pageBlockAuthorDate extends PageBlock { - public static int constructor = 0xbaafe5e0; + public static class TL_pageBlockAuthorDate extends PageBlock { + public static int constructor = 0xbaafe5e0; - public RichText author; - public int published_date; + public RichText author; + public int published_date; - public void readParams(AbstractSerializedData stream, boolean exception) { - author = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - published_date = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + author = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + published_date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - author.serializeToStream(stream); - stream.writeInt32(published_date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + author.serializeToStream(stream); + stream.writeInt32(published_date); + } + } public static abstract class InputPrivacyRule extends TLObject { @@ -25322,42 +25688,42 @@ public class TLRPC { } } - public static class TL_maskCoords extends TLObject { - public static int constructor = 0xaed6dbb2; + public static class TL_maskCoords extends TLObject { + public static int constructor = 0xaed6dbb2; - public int n; - public double x; - public double y; - public double zoom; + public int n; + public double x; + public double y; + public double zoom; - public static TL_maskCoords TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_maskCoords.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_maskCoords", constructor)); - } else { - return null; - } - } - TL_maskCoords result = new TL_maskCoords(); - result.readParams(stream, exception); - return result; - } + public static TL_maskCoords TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_maskCoords.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_maskCoords", constructor)); + } else { + return null; + } + } + TL_maskCoords result = new TL_maskCoords(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - n = stream.readInt32(exception); - x = stream.readDouble(exception); - y = stream.readDouble(exception); - zoom = stream.readDouble(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + n = stream.readInt32(exception); + x = stream.readDouble(exception); + y = stream.readDouble(exception); + zoom = stream.readDouble(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(n); - stream.writeDouble(x); - stream.writeDouble(y); - stream.writeDouble(zoom); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(n); + stream.writeDouble(x); + stream.writeDouble(y); + stream.writeDouble(zoom); + } + } public static class TL_messages_votesList extends TLObject { public static int constructor = 0x823f649; @@ -25475,105 +25841,105 @@ public class TLRPC { } } - public static abstract class InputMedia extends TLObject { - public String phone_number; - public String first_name; - public String last_name; - public String vcard; - public int flags; - public int ttl_seconds; - public InputGeoPoint geo_point; - public InputFile file; - public ArrayList stickers = new ArrayList<>(); - public String title; - public String address; - public String provider; - public String venue_id; - public String venue_type; + public static abstract class InputMedia extends TLObject { + public String phone_number; + public String first_name; + public String last_name; + public String vcard; + public int flags; + public int ttl_seconds; + public InputGeoPoint geo_point; + public InputFile file; + public ArrayList stickers = new ArrayList<>(); + public String title; + public String address; + public String provider; + public String venue_id; + public String venue_type; public int heading; - public int period; - public boolean nosound_video; + public int period; + public boolean nosound_video; public boolean force_file; public boolean stopped; - public InputFile thumb; - public String mime_type; - public ArrayList attributes = new ArrayList<>(); - public int proximity_notification_radius; + public InputFile thumb; + public String mime_type; + public ArrayList attributes = new ArrayList<>(); + public int proximity_notification_radius; - public static InputMedia TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - InputMedia result = null; - switch (constructor) { - case 0xf8ab7dfb: - result = new TL_inputMediaContact(); - break; + public static InputMedia TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + InputMedia result = null; + switch (constructor) { + case 0xf8ab7dfb: + result = new TL_inputMediaContact(); + break; case 0x33473058: result = new TL_inputMediaDocument(); break; - case 0xd33f43f3: - result = new TL_inputMediaGame(); - break; + case 0xd33f43f3: + result = new TL_inputMediaGame(); + break; case 0xe66fbf7b: result = new TL_inputMediaDice(); break; - case 0xf9c44144: - result = new TL_inputMediaGeoPoint(); - break; - case 0xfb52dc99: - result = new TL_inputMediaDocumentExternal(); - break; - case 0x9664f57f: - result = new TL_inputMediaEmpty(); - break; + case 0xf9c44144: + result = new TL_inputMediaGeoPoint(); + break; + case 0xfb52dc99: + result = new TL_inputMediaDocumentExternal(); + break; + case 0x9664f57f: + result = new TL_inputMediaEmpty(); + break; case 0xf94e5f1: result = new TL_inputMediaPoll(); break; - case 0x1e287d04: - result = new TL_inputMediaUploadedPhoto(); - break; - case 0xc13d1c11: - result = new TL_inputMediaVenue(); - break; + case 0x1e287d04: + result = new TL_inputMediaUploadedPhoto(); + break; + case 0xc13d1c11: + result = new TL_inputMediaVenue(); + break; case 0x971fa843: result = new TL_inputMediaGeoLive(); break; - case 0x5b38c6c1: - result = new TL_inputMediaUploadedDocument(); - break; - case 0xe5bbfe1a: - result = new TL_inputMediaPhotoExternal(); - break; - case 0xb3ba0635: - result = new TL_inputMediaPhoto(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in InputMedia", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0x5b38c6c1: + result = new TL_inputMediaUploadedDocument(); + break; + case 0xe5bbfe1a: + result = new TL_inputMediaPhotoExternal(); + break; + case 0xb3ba0635: + result = new TL_inputMediaPhoto(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in InputMedia", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_inputMediaContact extends InputMedia { - public static int constructor = 0xf8ab7dfb; + public static class TL_inputMediaContact extends InputMedia { + public static int constructor = 0xf8ab7dfb; - public void readParams(AbstractSerializedData stream, boolean exception) { - phone_number = stream.readString(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - vcard = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + phone_number = stream.readString(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + vcard = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(phone_number); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeString(vcard); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(phone_number); + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeString(vcard); + } + } public static class TL_inputMediaDocument extends InputMedia { public static int constructor = 0x33473058; @@ -25605,20 +25971,20 @@ public class TLRPC { } } - public static class TL_inputMediaGame extends InputMedia { - public static int constructor = 0xd33f43f3; + public static class TL_inputMediaGame extends InputMedia { + public static int constructor = 0xd33f43f3; - public InputGame id; + public InputGame id; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = InputGame.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = InputGame.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - id.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + id.serializeToStream(stream); + } + } public static class TL_inputMediaDice extends InputMedia { public static int constructor = 0xe66fbf7b; @@ -25635,51 +26001,51 @@ public class TLRPC { } } - public static class TL_inputMediaGeoPoint extends InputMedia { - public static int constructor = 0xf9c44144; + public static class TL_inputMediaGeoPoint extends InputMedia { + public static int constructor = 0xf9c44144; - public void readParams(AbstractSerializedData stream, boolean exception) { - geo_point = InputGeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + geo_point = InputGeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - geo_point.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + geo_point.serializeToStream(stream); + } + } - public static class TL_inputMediaDocumentExternal extends InputMedia { - public static int constructor = 0xfb52dc99; + public static class TL_inputMediaDocumentExternal extends InputMedia { + public static int constructor = 0xfb52dc99; - public String url; + public String url; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - url = stream.readString(exception); - if ((flags & 1) != 0) { - ttl_seconds = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + url = stream.readString(exception); + if ((flags & 1) != 0) { + ttl_seconds = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeString(url); - if ((flags & 1) != 0) { - stream.writeInt32(ttl_seconds); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeString(url); + if ((flags & 1) != 0) { + stream.writeInt32(ttl_seconds); + } + } + } - public static class TL_inputMediaEmpty extends InputMedia { - public static int constructor = 0x9664f57f; + public static class TL_inputMediaEmpty extends InputMedia { + public static int constructor = 0x9664f57f; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_inputMediaPoll extends InputMedia { public static int constructor = 0xf94e5f1; @@ -25753,76 +26119,76 @@ public class TLRPC { } } - public static class TL_inputMediaUploadedPhoto extends InputMedia { - public static int constructor = 0x1e287d04; + public static class TL_inputMediaUploadedPhoto extends InputMedia { + public static int constructor = 0x1e287d04; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - file = InputFile.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 1) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - InputDocument object = InputDocument.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - stickers.add(object); - } - } - if ((flags & 2) != 0) { - ttl_seconds = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + file = InputFile.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 1) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + InputDocument object = InputDocument.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + stickers.add(object); + } + } + if ((flags & 2) != 0) { + ttl_seconds = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - file.serializeToStream(stream); - if ((flags & 1) != 0) { - stream.writeInt32(0x1cb5c415); - int count = stickers.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stickers.get(a).serializeToStream(stream); - } - } - if ((flags & 2) != 0) { - stream.writeInt32(ttl_seconds); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + file.serializeToStream(stream); + if ((flags & 1) != 0) { + stream.writeInt32(0x1cb5c415); + int count = stickers.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stickers.get(a).serializeToStream(stream); + } + } + if ((flags & 2) != 0) { + stream.writeInt32(ttl_seconds); + } + } + } - public static class TL_inputMediaVenue extends InputMedia { - public static int constructor = 0xc13d1c11; + public static class TL_inputMediaVenue extends InputMedia { + public static int constructor = 0xc13d1c11; - public void readParams(AbstractSerializedData stream, boolean exception) { - geo_point = InputGeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); - title = stream.readString(exception); - address = stream.readString(exception); - provider = stream.readString(exception); - venue_id = stream.readString(exception); - venue_type = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + geo_point = InputGeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); + title = stream.readString(exception); + address = stream.readString(exception); + provider = stream.readString(exception); + venue_id = stream.readString(exception); + venue_type = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - geo_point.serializeToStream(stream); - stream.writeString(title); - stream.writeString(address); - stream.writeString(provider); - stream.writeString(venue_id); - stream.writeString(venue_type); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + geo_point.serializeToStream(stream); + stream.writeString(title); + stream.writeString(address); + stream.writeString(provider); + stream.writeString(venue_id); + stream.writeString(venue_type); + } + } public static class TL_inputMediaGeoLive extends InputMedia { public static int constructor = 0x971fa843; @@ -25940,196 +26306,196 @@ public class TLRPC { } } - public static class TL_inputMediaPhotoExternal extends InputMedia { - public static int constructor = 0xe5bbfe1a; + public static class TL_inputMediaPhotoExternal extends InputMedia { + public static int constructor = 0xe5bbfe1a; - public String url; + public String url; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - url = stream.readString(exception); - if ((flags & 1) != 0) { - ttl_seconds = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + url = stream.readString(exception); + if ((flags & 1) != 0) { + ttl_seconds = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeString(url); - if ((flags & 1) != 0) { - stream.writeInt32(ttl_seconds); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeString(url); + if ((flags & 1) != 0) { + stream.writeInt32(ttl_seconds); + } + } + } - public static class TL_inputMediaPhoto extends InputMedia { - public static int constructor = 0xb3ba0635; + public static class TL_inputMediaPhoto extends InputMedia { + public static int constructor = 0xb3ba0635; - public InputPhoto id; + public InputPhoto id; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - id = InputPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 1) != 0) { - ttl_seconds = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + id = InputPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 1) != 0) { + ttl_seconds = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - id.serializeToStream(stream); - if ((flags & 1) != 0) { - stream.writeInt32(ttl_seconds); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + id.serializeToStream(stream); + if ((flags & 1) != 0) { + stream.writeInt32(ttl_seconds); + } + } + } - public static abstract class StickerSetCovered extends TLObject { - public StickerSet set; - public ArrayList covers = new ArrayList<>(); - public Document cover; + public static abstract class StickerSetCovered extends TLObject { + public StickerSet set; + public ArrayList covers = new ArrayList<>(); + public Document cover; - public static StickerSetCovered TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - StickerSetCovered result = null; - switch (constructor) { - case 0x3407e51b: - result = new TL_stickerSetMultiCovered(); - break; - case 0x6410a5d2: - result = new TL_stickerSetCovered(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in StickerSetCovered", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } - - public static class TL_stickerSetMultiCovered extends StickerSetCovered { - public static int constructor = 0x3407e51b; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - set = StickerSet.TLdeserialize(stream, stream.readInt32(exception), exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Document object = Document.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - covers.add(object); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - set.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = covers.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - covers.get(a).serializeToStream(stream); - } - } - } - - public static class TL_stickerSetCovered extends StickerSetCovered { - public static int constructor = 0x6410a5d2; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - set = StickerSet.TLdeserialize(stream, stream.readInt32(exception), exception); - cover = Document.TLdeserialize(stream, stream.readInt32(exception), exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - set.serializeToStream(stream); - cover.serializeToStream(stream); - } - } - - public static abstract class EncryptedMessage extends TLObject { - public long random_id; - public int chat_id; - public int date; - public byte[] bytes; - public EncryptedFile file; - - public static EncryptedMessage TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - EncryptedMessage result = null; - switch (constructor) { - case 0x23734b06: - result = new TL_encryptedMessageService(); - break; - case 0xed18c118: - result = new TL_encryptedMessage(); + public static StickerSetCovered TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + StickerSetCovered result = null; + switch (constructor) { + case 0x3407e51b: + result = new TL_stickerSetMultiCovered(); + break; + case 0x6410a5d2: + result = new TL_stickerSetCovered(); break; } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in EncryptedMessage", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in StickerSetCovered", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_encryptedMessageService extends EncryptedMessage { - public static int constructor = 0x23734b06; + public static class TL_stickerSetMultiCovered extends StickerSetCovered { + public static int constructor = 0x3407e51b; - public void readParams(AbstractSerializedData stream, boolean exception) { - random_id = stream.readInt64(exception); - chat_id = stream.readInt32(exception); - date = stream.readInt32(exception); - bytes = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + set = StickerSet.TLdeserialize(stream, stream.readInt32(exception), exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Document object = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + covers.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(random_id); - stream.writeInt32(chat_id); - stream.writeInt32(date); - stream.writeByteArray(bytes); - } - } - - public static class TL_encryptedMessage extends EncryptedMessage { - public static int constructor = 0xed18c118; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - random_id = stream.readInt64(exception); - chat_id = stream.readInt32(exception); - date = stream.readInt32(exception); - bytes = stream.readByteArray(exception); - file = EncryptedFile.TLdeserialize(stream, stream.readInt32(exception), exception); - } - - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt64(random_id); + set.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = covers.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + covers.get(a).serializeToStream(stream); + } + } + } + + public static class TL_stickerSetCovered extends StickerSetCovered { + public static int constructor = 0x6410a5d2; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + set = StickerSet.TLdeserialize(stream, stream.readInt32(exception), exception); + cover = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + set.serializeToStream(stream); + cover.serializeToStream(stream); + } + } + + public static abstract class EncryptedMessage extends TLObject { + public long random_id; + public int chat_id; + public int date; + public byte[] bytes; + public EncryptedFile file; + + public static EncryptedMessage TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + EncryptedMessage result = null; + switch (constructor) { + case 0x23734b06: + result = new TL_encryptedMessageService(); + break; + case 0xed18c118: + result = new TL_encryptedMessage(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in EncryptedMessage", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } + + public static class TL_encryptedMessageService extends EncryptedMessage { + public static int constructor = 0x23734b06; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + random_id = stream.readInt64(exception); + chat_id = stream.readInt32(exception); + date = stream.readInt32(exception); + bytes = stream.readByteArray(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(random_id); stream.writeInt32(chat_id); stream.writeInt32(date); - stream.writeByteArray(bytes); - file.serializeToStream(stream); - } - } + stream.writeByteArray(bytes); + } + } + + public static class TL_encryptedMessage extends EncryptedMessage { + public static int constructor = 0xed18c118; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + random_id = stream.readInt64(exception); + chat_id = stream.readInt32(exception); + date = stream.readInt32(exception); + bytes = stream.readByteArray(exception); + file = EncryptedFile.TLdeserialize(stream, stream.readInt32(exception), exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(random_id); + stream.writeInt32(chat_id); + stream.writeInt32(date); + stream.writeByteArray(bytes); + file.serializeToStream(stream); + } + } public static abstract class InputStickerSet extends TLObject { @@ -26305,104 +26671,104 @@ public class TLRPC { } } - public static abstract class UserStatus extends TLObject { - public int expires; + public static abstract class UserStatus extends TLObject { + public int expires; - public static UserStatus TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - UserStatus result = null; - switch (constructor) { - case 0x8c703f: - result = new TL_userStatusOffline(); - break; - case 0x7bf09fc: - result = new TL_userStatusLastWeek(); - break; - case 0x9d05049: - result = new TL_userStatusEmpty(); - break; - case 0x77ebc742: - result = new TL_userStatusLastMonth(); - break; - case 0xedb93949: - result = new TL_userStatusOnline(); - break; - case 0xe26f42f1: - result = new TL_userStatusRecently(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in UserStatus", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static UserStatus TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + UserStatus result = null; + switch (constructor) { + case 0x8c703f: + result = new TL_userStatusOffline(); + break; + case 0x7bf09fc: + result = new TL_userStatusLastWeek(); + break; + case 0x9d05049: + result = new TL_userStatusEmpty(); + break; + case 0x77ebc742: + result = new TL_userStatusLastMonth(); + break; + case 0xedb93949: + result = new TL_userStatusOnline(); + break; + case 0xe26f42f1: + result = new TL_userStatusRecently(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in UserStatus", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_userStatusOffline extends UserStatus { + public static class TL_userStatusOffline extends UserStatus { public static int constructor = 0x8c703f; - public void readParams(AbstractSerializedData stream, boolean exception) { - expires = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + expires = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(expires); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(expires); + } + } - public static class TL_userStatusLastWeek extends UserStatus { - public static int constructor = 0x7bf09fc; + public static class TL_userStatusLastWeek extends UserStatus { + public static int constructor = 0x7bf09fc; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_userStatusEmpty extends UserStatus { - public static int constructor = 0x9d05049; + public static class TL_userStatusEmpty extends UserStatus { + public static int constructor = 0x9d05049; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_userStatusLastMonth extends UserStatus { - public static int constructor = 0x77ebc742; + public static class TL_userStatusLastMonth extends UserStatus { + public static int constructor = 0x77ebc742; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); } } public static class TL_userStatusOnline extends UserStatus { - public static int constructor = 0xedb93949; + public static int constructor = 0xedb93949; - public void readParams(AbstractSerializedData stream, boolean exception) { - expires = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + expires = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(expires); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(expires); + } + } - public static class TL_userStatusRecently extends UserStatus { - public static int constructor = 0xe26f42f1; + public static class TL_userStatusRecently extends UserStatus { + public static int constructor = 0xe26f42f1; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messages_peerSettings extends TLObject { public static int constructor = 0x6880b94d; @@ -26504,36 +26870,36 @@ public class TLRPC { } } - public static class TL_messages_messageEditData extends TLObject { - public static int constructor = 0x26b5dde6; + public static class TL_messages_messageEditData extends TLObject { + public static int constructor = 0x26b5dde6; - public int flags; - public boolean caption; + public int flags; + public boolean caption; - public static TL_messages_messageEditData TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messages_messageEditData.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messages_messageEditData", constructor)); - } else { - return null; - } - } - TL_messages_messageEditData result = new TL_messages_messageEditData(); - result.readParams(stream, exception); - return result; - } + public static TL_messages_messageEditData TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_messageEditData.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_messageEditData", constructor)); + } else { + return null; + } + } + TL_messages_messageEditData result = new TL_messages_messageEditData(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - caption = (flags & 1) != 0; - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + caption = (flags & 1) != 0; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = caption ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = caption ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + } + } public static abstract class MessageUserVote extends TLObject { @@ -26772,36 +27138,36 @@ public class TLRPC { } } - public static class TL_inlineBotSwitchPM extends TLObject { - public static int constructor = 0x3c20629f; + public static class TL_inlineBotSwitchPM extends TLObject { + public static int constructor = 0x3c20629f; - public String text; - public String start_param; + public String text; + public String start_param; - public static TL_inlineBotSwitchPM TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_inlineBotSwitchPM.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_inlineBotSwitchPM", constructor)); - } else { - return null; - } - } - TL_inlineBotSwitchPM result = new TL_inlineBotSwitchPM(); - result.readParams(stream, exception); - return result; - } + public static TL_inlineBotSwitchPM TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_inlineBotSwitchPM.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_inlineBotSwitchPM", constructor)); + } else { + return null; + } + } + TL_inlineBotSwitchPM result = new TL_inlineBotSwitchPM(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - text = stream.readString(exception); - start_param = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + text = stream.readString(exception); + start_param = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(text); - stream.writeString(start_param); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(text); + stream.writeString(start_param); + } + } public static abstract class Update extends TLObject { @@ -29051,158 +29417,158 @@ public class TLRPC { } } - public static class TL_receivedNotifyMessage extends TLObject { - public static int constructor = 0xa384b779; + public static class TL_receivedNotifyMessage extends TLObject { + public static int constructor = 0xa384b779; - public int id; - public int flags; + public int id; + public int flags; - public static TL_receivedNotifyMessage TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_receivedNotifyMessage.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_receivedNotifyMessage", constructor)); - } else { - return null; - } - } - TL_receivedNotifyMessage result = new TL_receivedNotifyMessage(); - result.readParams(stream, exception); - return result; - } + public static TL_receivedNotifyMessage TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_receivedNotifyMessage.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_receivedNotifyMessage", constructor)); + } else { + return null; + } + } + TL_receivedNotifyMessage result = new TL_receivedNotifyMessage(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - flags = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + flags = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(id); - stream.writeInt32(flags); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(id); + stream.writeInt32(flags); + } + } - public static abstract class InputEncryptedFile extends TLObject { - public long id; - public long access_hash; - public int parts; - public int key_fingerprint; - public String md5_checksum; + public static abstract class InputEncryptedFile extends TLObject { + public long id; + public long access_hash; + public int parts; + public int key_fingerprint; + public String md5_checksum; public static InputEncryptedFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - InputEncryptedFile result = null; - switch (constructor) { - case 0x5a17b5e5: - result = new TL_inputEncryptedFile(); - break; - case 0x2dc173c8: - result = new TL_inputEncryptedFileBigUploaded(); - break; - case 0x1837c364: - result = new TL_inputEncryptedFileEmpty(); + InputEncryptedFile result = null; + switch (constructor) { + case 0x5a17b5e5: + result = new TL_inputEncryptedFile(); break; - case 0x64bd0306: - result = new TL_inputEncryptedFileUploaded(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in InputEncryptedFile", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0x2dc173c8: + result = new TL_inputEncryptedFileBigUploaded(); + break; + case 0x1837c364: + result = new TL_inputEncryptedFileEmpty(); + break; + case 0x64bd0306: + result = new TL_inputEncryptedFileUploaded(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in InputEncryptedFile", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_inputEncryptedFile extends InputEncryptedFile { - public static int constructor = 0x5a17b5e5; + public static class TL_inputEncryptedFile extends InputEncryptedFile { + public static int constructor = 0x5a17b5e5; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - } - } - - public static class TL_inputEncryptedFileBigUploaded extends InputEncryptedFile { - public static int constructor = 0x2dc173c8; - - - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { id = stream.readInt64(exception); - parts = stream.readInt32(exception); - key_fingerprint = stream.readInt32(exception); - } + access_hash = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); stream.writeInt64(id); - stream.writeInt32(parts); - stream.writeInt32(key_fingerprint); - } - } + stream.writeInt64(access_hash); + } + } - public static class TL_inputEncryptedFileEmpty extends InputEncryptedFile { - public static int constructor = 0x1837c364; + public static class TL_inputEncryptedFileBigUploaded extends InputEncryptedFile { + public static int constructor = 0x2dc173c8; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + parts = stream.readInt32(exception); + key_fingerprint = stream.readInt32(exception); + } - public static class TL_inputEncryptedFileUploaded extends InputEncryptedFile { - public static int constructor = 0x64bd0306; + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt32(parts); + stream.writeInt32(key_fingerprint); + } + } + + public static class TL_inputEncryptedFileEmpty extends InputEncryptedFile { + public static int constructor = 0x1837c364; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - parts = stream.readInt32(exception); - md5_checksum = stream.readString(exception); - key_fingerprint = stream.readInt32(exception); - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt32(parts); - stream.writeString(md5_checksum); - stream.writeInt32(key_fingerprint); - } - } + public static class TL_inputEncryptedFileUploaded extends InputEncryptedFile { + public static int constructor = 0x64bd0306; - public static abstract class messages_AllStickers extends TLObject { - public String hash; - public ArrayList sets = new ArrayList<>(); - public ArrayList packs = new ArrayList<>(); - public ArrayList documents = new ArrayList<>(); - public static messages_AllStickers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_AllStickers result = null; - switch (constructor) { + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + parts = stream.readInt32(exception); + md5_checksum = stream.readString(exception); + key_fingerprint = stream.readInt32(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt32(parts); + stream.writeString(md5_checksum); + stream.writeInt32(key_fingerprint); + } + } + + public static abstract class messages_AllStickers extends TLObject { + public String hash; + public ArrayList sets = new ArrayList<>(); + public ArrayList packs = new ArrayList<>(); + public ArrayList documents = new ArrayList<>(); + + public static messages_AllStickers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_AllStickers result = null; + switch (constructor) { case 0xcdbbcebb: result = new TL_messages_allStickers(); break; - case 0xe86602c3: - result = new TL_messages_allStickersNotModified(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_AllStickers", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0xe86602c3: + result = new TL_messages_allStickersNotModified(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_AllStickers", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } public static class TL_messages_allStickers extends messages_AllStickers { public static int constructor = 0xcdbbcebb; @@ -29240,14 +29606,14 @@ public class TLRPC { } } - public static class TL_messages_allStickersNotModified extends messages_AllStickers { - public static int constructor = 0xe86602c3; + public static class TL_messages_allStickersNotModified extends messages_AllStickers { + public static int constructor = 0xe86602c3; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messages_messageViews extends TLObject { public static int constructor = 0xb6c4f543; @@ -29340,297 +29706,297 @@ public class TLRPC { } } - public static abstract class DecryptedMessageAction extends TLObject { - public int ttl_seconds; - public int layer; - public ArrayList random_ids = new ArrayList<>(); - public long exchange_id; - public long key_fingerprint; - public SendMessageAction action; - public byte[] g_b; - public int start_seq_no; - public int end_seq_no; - public byte[] g_a; + public static abstract class DecryptedMessageAction extends TLObject { + public int ttl_seconds; + public int layer; + public ArrayList random_ids = new ArrayList<>(); + public long exchange_id; + public long key_fingerprint; + public SendMessageAction action; + public byte[] g_b; + public int start_seq_no; + public int end_seq_no; + public byte[] g_a; - public static DecryptedMessageAction TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - DecryptedMessageAction result = null; - switch (constructor) { - case 0xa1733aec: - result = new TL_decryptedMessageActionSetMessageTTL(); - break; - case 0xf3048883: - result = new TL_decryptedMessageActionNotifyLayer(); - break; - case 0x65614304: - result = new TL_decryptedMessageActionDeleteMessages(); - break; - case 0xec2e0b9b: - result = new TL_decryptedMessageActionCommitKey(); - break; - case 0xdd05ec6b: - result = new TL_decryptedMessageActionAbortKey(); - break; - case 0x6719e45c: - result = new TL_decryptedMessageActionFlushHistory(); - break; - case 0xccb27641: - result = new TL_decryptedMessageActionTyping(); - break; - case 0x6fe1735b: - result = new TL_decryptedMessageActionAcceptKey(); - break; - case 0xc4f40be: - result = new TL_decryptedMessageActionReadMessages(); - break; - case 0x511110b0: - result = new TL_decryptedMessageActionResend(); - break; - case 0xf3c9611b: - result = new TL_decryptedMessageActionRequestKey(); - break; - case 0x8ac1f475: - result = new TL_decryptedMessageActionScreenshotMessages(); - break; - case 0xa82fdd63: - result = new TL_decryptedMessageActionNoop(); - break; - } - if (result == null && exception) { + public static DecryptedMessageAction TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + DecryptedMessageAction result = null; + switch (constructor) { + case 0xa1733aec: + result = new TL_decryptedMessageActionSetMessageTTL(); + break; + case 0xf3048883: + result = new TL_decryptedMessageActionNotifyLayer(); + break; + case 0x65614304: + result = new TL_decryptedMessageActionDeleteMessages(); + break; + case 0xec2e0b9b: + result = new TL_decryptedMessageActionCommitKey(); + break; + case 0xdd05ec6b: + result = new TL_decryptedMessageActionAbortKey(); + break; + case 0x6719e45c: + result = new TL_decryptedMessageActionFlushHistory(); + break; + case 0xccb27641: + result = new TL_decryptedMessageActionTyping(); + break; + case 0x6fe1735b: + result = new TL_decryptedMessageActionAcceptKey(); + break; + case 0xc4f40be: + result = new TL_decryptedMessageActionReadMessages(); + break; + case 0x511110b0: + result = new TL_decryptedMessageActionResend(); + break; + case 0xf3c9611b: + result = new TL_decryptedMessageActionRequestKey(); + break; + case 0x8ac1f475: + result = new TL_decryptedMessageActionScreenshotMessages(); + break; + case 0xa82fdd63: + result = new TL_decryptedMessageActionNoop(); + break; + } + if (result == null && exception) { throw new RuntimeException(String.format("can't parse magic %x in DecryptedMessageAction", constructor)); - } - if (result != null) { + } + if (result != null) { result.readParams(stream, exception); } - return result; - } - } - - public static class TL_decryptedMessageActionSetMessageTTL extends DecryptedMessageAction { - public static int constructor = 0xa1733aec; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - ttl_seconds = stream.readInt32(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(ttl_seconds); - } - } - - public static class TL_decryptedMessageActionNotifyLayer extends DecryptedMessageAction { - public static int constructor = 0xf3048883; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - layer = stream.readInt32(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(layer); - } - } - - public static class TL_decryptedMessageActionDeleteMessages extends DecryptedMessageAction { - public static int constructor = 0x65614304; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - random_ids.add(stream.readInt64(exception)); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = random_ids.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt64(random_ids.get(a)); - } + return result; } - } + } - public static class TL_decryptedMessageActionCommitKey extends DecryptedMessageAction { - public static int constructor = 0xec2e0b9b; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - exchange_id = stream.readInt64(exception); - key_fingerprint = stream.readInt64(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(exchange_id); - stream.writeInt64(key_fingerprint); - } - } - - public static class TL_decryptedMessageActionAbortKey extends DecryptedMessageAction { - public static int constructor = 0xdd05ec6b; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - exchange_id = stream.readInt64(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(exchange_id); - } - } - - public static class TL_decryptedMessageActionFlushHistory extends DecryptedMessageAction { - public static int constructor = 0x6719e45c; - - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } - - public static class TL_decryptedMessageActionTyping extends DecryptedMessageAction { - public static int constructor = 0xccb27641; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - action = SendMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - action.serializeToStream(stream); - } - } - - public static class TL_decryptedMessageActionAcceptKey extends DecryptedMessageAction { - public static int constructor = 0x6fe1735b; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - exchange_id = stream.readInt64(exception); - g_b = stream.readByteArray(exception); - key_fingerprint = stream.readInt64(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(exchange_id); - stream.writeByteArray(g_b); - stream.writeInt64(key_fingerprint); - } - } - - public static class TL_decryptedMessageActionReadMessages extends DecryptedMessageAction { - public static int constructor = 0xc4f40be; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - random_ids.add(stream.readInt64(exception)); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = random_ids.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt64(random_ids.get(a)); - } - } - } - - public static class TL_decryptedMessageActionResend extends DecryptedMessageAction { - public static int constructor = 0x511110b0; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - start_seq_no = stream.readInt32(exception); - end_seq_no = stream.readInt32(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(start_seq_no); - stream.writeInt32(end_seq_no); - } - } - - public static class TL_decryptedMessageActionRequestKey extends DecryptedMessageAction { - public static int constructor = 0xf3c9611b; + public static class TL_decryptedMessageActionSetMessageTTL extends DecryptedMessageAction { + public static int constructor = 0xa1733aec; public void readParams(AbstractSerializedData stream, boolean exception) { - exchange_id = stream.readInt64(exception); - g_a = stream.readByteArray(exception); - } + ttl_seconds = stream.readInt32(exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(exchange_id); - stream.writeByteArray(g_a); - } - } - - public static class TL_decryptedMessageActionScreenshotMessages extends DecryptedMessageAction { - public static int constructor = 0x8ac1f475; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - random_ids.add(stream.readInt64(exception)); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = random_ids.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt64(random_ids.get(a)); - } - } + stream.writeInt32(constructor); + stream.writeInt32(ttl_seconds); + } } - public static class TL_decryptedMessageActionNoop extends DecryptedMessageAction { - public static int constructor = 0xa82fdd63; + public static class TL_decryptedMessageActionNotifyLayer extends DecryptedMessageAction { + public static int constructor = 0xf3048883; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + layer = stream.readInt32(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(layer); + } + } + + public static class TL_decryptedMessageActionDeleteMessages extends DecryptedMessageAction { + public static int constructor = 0x65614304; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + random_ids.add(stream.readInt64(exception)); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = random_ids.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt64(random_ids.get(a)); + } + } + } + + public static class TL_decryptedMessageActionCommitKey extends DecryptedMessageAction { + public static int constructor = 0xec2e0b9b; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + exchange_id = stream.readInt64(exception); + key_fingerprint = stream.readInt64(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(exchange_id); + stream.writeInt64(key_fingerprint); + } + } + + public static class TL_decryptedMessageActionAbortKey extends DecryptedMessageAction { + public static int constructor = 0xdd05ec6b; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + exchange_id = stream.readInt64(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(exchange_id); + } + } + + public static class TL_decryptedMessageActionFlushHistory extends DecryptedMessageAction { + public static int constructor = 0x6719e45c; + + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } + + public static class TL_decryptedMessageActionTyping extends DecryptedMessageAction { + public static int constructor = 0xccb27641; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + action = SendMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + action.serializeToStream(stream); + } + } + + public static class TL_decryptedMessageActionAcceptKey extends DecryptedMessageAction { + public static int constructor = 0x6fe1735b; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + exchange_id = stream.readInt64(exception); + g_b = stream.readByteArray(exception); + key_fingerprint = stream.readInt64(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(exchange_id); + stream.writeByteArray(g_b); + stream.writeInt64(key_fingerprint); + } + } + + public static class TL_decryptedMessageActionReadMessages extends DecryptedMessageAction { + public static int constructor = 0xc4f40be; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + random_ids.add(stream.readInt64(exception)); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = random_ids.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt64(random_ids.get(a)); + } + } + } + + public static class TL_decryptedMessageActionResend extends DecryptedMessageAction { + public static int constructor = 0x511110b0; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + start_seq_no = stream.readInt32(exception); + end_seq_no = stream.readInt32(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(start_seq_no); + stream.writeInt32(end_seq_no); + } + } + + public static class TL_decryptedMessageActionRequestKey extends DecryptedMessageAction { + public static int constructor = 0xf3c9611b; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + exchange_id = stream.readInt64(exception); + g_a = stream.readByteArray(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(exchange_id); + stream.writeByteArray(g_a); + } + } + + public static class TL_decryptedMessageActionScreenshotMessages extends DecryptedMessageAction { + public static int constructor = 0x8ac1f475; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + random_ids.add(stream.readInt64(exception)); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = random_ids.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt64(random_ids.get(a)); + } + } + } + + public static class TL_decryptedMessageActionNoop extends DecryptedMessageAction { + public static int constructor = 0xa82fdd63; + + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static abstract class InputCheckPasswordSRP extends TLObject { @@ -30043,57 +30409,60 @@ public class TLRPC { } } - public static abstract class MessageEntity extends TLObject { - public int offset; - public int length; - public String url; - public String language; + public static abstract class MessageEntity extends TLObject { + public int offset; + public int length; + public String url; + public String language; - public static MessageEntity TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - MessageEntity result = null; - switch (constructor) { - case 0x76a6d327: - result = new TL_messageEntityTextUrl(); - break; - case 0x6cef8ac7: - result = new TL_messageEntityBotCommand(); - break; - case 0x64e475c2: - result = new TL_messageEntityEmail(); - break; - case 0x73924be0: - result = new TL_messageEntityPre(); - break; - case 0xbb92ba95: - result = new TL_messageEntityUnknown(); - break; - case 0x6ed02538: - result = new TL_messageEntityUrl(); - break; - case 0x826f8b60: - result = new TL_messageEntityItalic(); - break; - case 0xfa04579d: - result = new TL_messageEntityMention(); - break; - case 0x352dca58: - result = new TL_messageEntityMentionName_layer131(); - break; - case 0x208e68c9: - result = new TL_inputMessageEntityMentionName(); - break; - case 0x4c4e743f: - result = new TL_messageEntityCashtag(); - break; - case 0xbd610bc9: - result = new TL_messageEntityBold(); - break; - case 0x6f635b0d: - result = new TL_messageEntityHashtag(); - break; - case 0x28a20571: - result = new TL_messageEntityCode(); - break; + public static MessageEntity TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + MessageEntity result = null; + switch (constructor) { + case 0x76a6d327: + result = new TL_messageEntityTextUrl(); + break; + case 0x6cef8ac7: + result = new TL_messageEntityBotCommand(); + break; + case 0x64e475c2: + result = new TL_messageEntityEmail(); + break; + case 0x73924be0: + result = new TL_messageEntityPre(); + break; + case 0xbb92ba95: + result = new TL_messageEntityUnknown(); + break; + case 0x6ed02538: + result = new TL_messageEntityUrl(); + break; + case 0x826f8b60: + result = new TL_messageEntityItalic(); + break; + case 0xfa04579d: + result = new TL_messageEntityMention(); + break; + case 0x32ca960f: + result = new TL_messageEntitySpoiler(); + break; + case 0x352dca58: + result = new TL_messageEntityMentionName_layer131(); + break; + case 0x208e68c9: + result = new TL_inputMessageEntityMentionName(); + break; + case 0x4c4e743f: + result = new TL_messageEntityCashtag(); + break; + case 0xbd610bc9: + result = new TL_messageEntityBold(); + break; + case 0x6f635b0d: + result = new TL_messageEntityHashtag(); + break; + case 0x28a20571: + result = new TL_messageEntityCode(); + break; case 0xbf0693d4: result = new TL_messageEntityStrike(); break; @@ -30106,254 +30475,269 @@ public class TLRPC { case 0x761e6af4: result = new TL_messageEntityBankCard(); break; - case 0x9b69e34b: - result = new TL_messageEntityPhone(); - break; + case 0x9b69e34b: + result = new TL_messageEntityPhone(); + break; case 0xdc7b1140: result = new TL_messageEntityMentionName(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in MessageEntity", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in MessageEntity", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messageEntityTextUrl extends MessageEntity { - public static int constructor = 0x76a6d327; + public static class TL_messageEntityTextUrl extends MessageEntity { + public static int constructor = 0x76a6d327; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - url = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + url = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - stream.writeString(url); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + stream.writeString(url); + } + } - public static class TL_messageEntityBotCommand extends MessageEntity { - public static int constructor = 0x6cef8ac7; + public static class TL_messageEntityBotCommand extends MessageEntity { + public static int constructor = 0x6cef8ac7; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } - public static class TL_messageEntityEmail extends MessageEntity { - public static int constructor = 0x64e475c2; + public static class TL_messageEntityEmail extends MessageEntity { + public static int constructor = 0x64e475c2; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } - public static class TL_messageEntityPre extends MessageEntity { - public static int constructor = 0x73924be0; + public static class TL_messageEntityPre extends MessageEntity { + public static int constructor = 0x73924be0; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - language = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + language = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - stream.writeString(language); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + stream.writeString(language); + } + } - public static class TL_messageEntityUnknown extends MessageEntity { - public static int constructor = 0xbb92ba95; + public static class TL_messageEntityUnknown extends MessageEntity { + public static int constructor = 0xbb92ba95; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } - public static class TL_messageEntityUrl extends MessageEntity { - public static int constructor = 0x6ed02538; + public static class TL_messageEntityUrl extends MessageEntity { + public static int constructor = 0x6ed02538; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } - public static class TL_messageEntityItalic extends MessageEntity { - public static int constructor = 0x826f8b60; + public static class TL_messageEntityItalic extends MessageEntity { + public static int constructor = 0x826f8b60; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } - public static class TL_messageEntityMention extends MessageEntity { - public static int constructor = 0xfa04579d; + public static class TL_messageEntityMention extends MessageEntity { + public static int constructor = 0xfa04579d; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } - public static class TL_messageEntityMentionName_layer131 extends TL_messageEntityMentionName { - public static int constructor = 0x352dca58; + public static class TL_messageEntitySpoiler extends MessageEntity { + public static int constructor = 0x32ca960f; + + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } + + public static class TL_messageEntityMentionName_layer131 extends TL_messageEntityMentionName { + public static int constructor = 0x352dca58; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - user_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + user_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - stream.writeInt32((int) user_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + stream.writeInt32((int) user_id); + } + } - public static class TL_inputMessageEntityMentionName extends MessageEntity { - public static int constructor = 0x208e68c9; + public static class TL_inputMessageEntityMentionName extends MessageEntity { + public static int constructor = 0x208e68c9; - public InputUser user_id; + public InputUser user_id; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - user_id = InputUser.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + user_id = InputUser.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - user_id.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + user_id.serializeToStream(stream); + } + } - public static class TL_messageEntityCashtag extends MessageEntity { - public static int constructor = 0x4c4e743f; + public static class TL_messageEntityCashtag extends MessageEntity { + public static int constructor = 0x4c4e743f; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } - public static class TL_messageEntityBold extends MessageEntity { - public static int constructor = 0xbd610bc9; + public static class TL_messageEntityBold extends MessageEntity { + public static int constructor = 0xbd610bc9; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } - public static class TL_messageEntityHashtag extends MessageEntity { - public static int constructor = 0x6f635b0d; + public static class TL_messageEntityHashtag extends MessageEntity { + public static int constructor = 0x6f635b0d; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } - public static class TL_messageEntityCode extends MessageEntity { - public static int constructor = 0x28a20571; + public static class TL_messageEntityCode extends MessageEntity { + public static int constructor = 0x28a20571; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } public static class TL_messageEntityStrike extends MessageEntity { public static int constructor = 0xbf0693d4; @@ -30419,20 +30803,20 @@ public class TLRPC { } } - public static class TL_messageEntityPhone extends MessageEntity { - public static int constructor = 0x9b69e34b; + public static class TL_messageEntityPhone extends MessageEntity { + public static int constructor = 0x9b69e34b; - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(length); + } + } public static class TL_messageEntityMentionName extends MessageEntity { public static int constructor = 0xdc7b1140; @@ -30935,163 +31319,163 @@ public class TLRPC { } } - public static class TL_encryptedChatRequested_old extends TL_encryptedChatRequested { - public static int constructor = 0xfda9a7b7; + public static class TL_encryptedChatRequested_old extends TL_encryptedChatRequested { + public static int constructor = 0xfda9a7b7; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); - admin_id = stream.readInt32(exception); - participant_id = stream.readInt32(exception); - g_a = stream.readByteArray(exception); - nonce = stream.readByteArray(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(id); - stream.writeInt64(access_hash); - stream.writeInt32(date); - stream.writeInt32((int) admin_id); - stream.writeInt32((int) participant_id); - stream.writeByteArray(g_a); - stream.writeByteArray(nonce); - } - } - - public static class TL_encryptedChatRequested_layer115 extends EncryptedChat { - public static int constructor = 0xc878527e; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); + date = stream.readInt32(exception); admin_id = stream.readInt32(exception); - participant_id = stream.readInt32(exception); - g_a = stream.readByteArray(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(id); - stream.writeInt64(access_hash); - stream.writeInt32(date); - stream.writeInt32((int) admin_id); - stream.writeInt32((int) participant_id); - stream.writeByteArray(g_a); - } - } - - public static class TL_encryptedChat_layer131 extends TL_encryptedChat { - public static int constructor = 0xfa56ce36; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); - admin_id = stream.readInt32(exception); participant_id = stream.readInt32(exception); - g_a_or_b = stream.readByteArray(exception); - key_fingerprint = stream.readInt64(exception); + g_a = stream.readByteArray(exception); + nonce = stream.readByteArray(exception); } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt32(id); - stream.writeInt64(access_hash); - stream.writeInt32(date); - stream.writeInt32((int) admin_id); - stream.writeInt32((int) participant_id); - stream.writeByteArray(g_a_or_b); - stream.writeInt64(key_fingerprint); - } - } + stream.writeInt32(id); + stream.writeInt64(access_hash); + stream.writeInt32(date); + stream.writeInt32((int) admin_id); + stream.writeInt32((int) participant_id); + stream.writeByteArray(g_a); + stream.writeByteArray(nonce); + } + } - public static class TL_encryptedChat_old extends TL_encryptedChat { - public static int constructor = 0x6601d14f; + public static class TL_encryptedChatRequested_layer115 extends EncryptedChat { + public static int constructor = 0xc878527e; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); - admin_id = stream.readInt32(exception); + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + access_hash = stream.readInt64(exception); + date = stream.readInt32(exception); + admin_id = stream.readInt32(exception); participant_id = stream.readInt32(exception); - g_a_or_b = stream.readByteArray(exception); - nonce = stream.readByteArray(exception); - key_fingerprint = stream.readInt64(exception); - } + g_a = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt32(id); - stream.writeInt64(access_hash); - stream.writeInt32(date); - stream.writeInt32((int) admin_id); - stream.writeInt32((int) participant_id); - stream.writeByteArray(g_a_or_b); - stream.writeByteArray(nonce); - stream.writeInt64(key_fingerprint); - } - } + stream.writeInt32(id); + stream.writeInt64(access_hash); + stream.writeInt32(date); + stream.writeInt32((int) admin_id); + stream.writeInt32((int) participant_id); + stream.writeByteArray(g_a); + } + } - public static class TL_encryptedChatEmpty extends EncryptedChat { + public static class TL_encryptedChat_layer131 extends TL_encryptedChat { + public static int constructor = 0xfa56ce36; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + access_hash = stream.readInt64(exception); + date = stream.readInt32(exception); + admin_id = stream.readInt32(exception); + participant_id = stream.readInt32(exception); + g_a_or_b = stream.readByteArray(exception); + key_fingerprint = stream.readInt64(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(id); + stream.writeInt64(access_hash); + stream.writeInt32(date); + stream.writeInt32((int) admin_id); + stream.writeInt32((int) participant_id); + stream.writeByteArray(g_a_or_b); + stream.writeInt64(key_fingerprint); + } + } + + public static class TL_encryptedChat_old extends TL_encryptedChat { + public static int constructor = 0x6601d14f; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + access_hash = stream.readInt64(exception); + date = stream.readInt32(exception); + admin_id = stream.readInt32(exception); + participant_id = stream.readInt32(exception); + g_a_or_b = stream.readByteArray(exception); + nonce = stream.readByteArray(exception); + key_fingerprint = stream.readInt64(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(id); + stream.writeInt64(access_hash); + stream.writeInt32(date); + stream.writeInt32((int) admin_id); + stream.writeInt32((int) participant_id); + stream.writeByteArray(g_a_or_b); + stream.writeByteArray(nonce); + stream.writeInt64(key_fingerprint); + } + } + + public static class TL_encryptedChatEmpty extends EncryptedChat { public static int constructor = 0xab7ec0a0; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(id); - } - } + stream.writeInt32(constructor); + stream.writeInt32(id); + } + } - public static class TL_encryptedChatWaiting_layer131 extends TL_encryptedChatWaiting { - public static int constructor = 0x3bf703dc; + public static class TL_encryptedChatWaiting_layer131 extends TL_encryptedChatWaiting { + public static int constructor = 0x3bf703dc; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); - admin_id = stream.readInt32(exception); - participant_id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + access_hash = stream.readInt64(exception); + date = stream.readInt32(exception); + admin_id = stream.readInt32(exception); + participant_id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(id); - stream.writeInt64(access_hash); - stream.writeInt32(date); - stream.writeInt32((int) admin_id); - stream.writeInt32((int) participant_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(id); + stream.writeInt64(access_hash); + stream.writeInt32(date); + stream.writeInt32((int) admin_id); + stream.writeInt32((int) participant_id); + } + } - public static class TL_encryptedChatDiscarded_layer122 extends TL_encryptedChatDiscarded { - public static int constructor = 0x13d6dd27; + public static class TL_encryptedChatDiscarded_layer122 extends TL_encryptedChatDiscarded { + public static int constructor = 0x13d6dd27; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(id); + } + } public static class TL_encryptedChatDiscarded extends EncryptedChat { public static int constructor = 0x1e1c7c45; - + public void readParams(AbstractSerializedData stream, boolean exception) { flags = stream.readInt32(exception); @@ -31189,34 +31573,34 @@ public class TLRPC { public static abstract class messages_FoundStickerSets extends TLObject { - public static messages_FoundStickerSets TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_FoundStickerSets result = null; - switch (constructor) { - case 0xd54b65d: - result = new TL_messages_foundStickerSetsNotModified(); - break; + public static messages_FoundStickerSets TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_FoundStickerSets result = null; + switch (constructor) { + case 0xd54b65d: + result = new TL_messages_foundStickerSetsNotModified(); + break; case 0x8af09dd2: result = new TL_messages_foundStickerSets(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_FoundStickerSets", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_FoundStickerSets", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messages_foundStickerSetsNotModified extends messages_FoundStickerSets { - public static int constructor = 0xd54b65d; + public static class TL_messages_foundStickerSetsNotModified extends messages_FoundStickerSets { + public static int constructor = 0xd54b65d; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messages_foundStickerSets extends messages_FoundStickerSets { public static int constructor = 0x8af09dd2; @@ -31407,39 +31791,39 @@ public class TLRPC { } } - public static class TL_secureData extends TLObject { - public static int constructor = 0x8aeabec3; + public static class TL_secureData extends TLObject { + public static int constructor = 0x8aeabec3; - public byte[] data; - public byte[] data_hash; - public byte[] secret; + public byte[] data; + public byte[] data_hash; + public byte[] secret; - public static TL_secureData TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_secureData.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_secureData", constructor)); - } else { - return null; - } - } - TL_secureData result = new TL_secureData(); - result.readParams(stream, exception); - return result; - } + public static TL_secureData TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_secureData.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_secureData", constructor)); + } else { + return null; + } + } + TL_secureData result = new TL_secureData(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - data = stream.readByteArray(exception); - data_hash = stream.readByteArray(exception); - secret = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + data = stream.readByteArray(exception); + data_hash = stream.readByteArray(exception); + secret = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(data); - stream.writeByteArray(data_hash); - stream.writeByteArray(secret); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(data); + stream.writeByteArray(data_hash); + stream.writeByteArray(secret); + } + } public static class TL_config extends TLObject { public static int constructor = 0x330b4067; @@ -31677,281 +32061,281 @@ public class TLRPC { } } - public static abstract class contacts_TopPeers extends TLObject { + public static abstract class contacts_TopPeers extends TLObject { - public static contacts_TopPeers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - contacts_TopPeers result = null; - switch (constructor) { - case 0x70b772a8: - result = new TL_contacts_topPeers(); - break; - case 0xb52c939d: - result = new TL_contacts_topPeersDisabled(); - break; - case 0xde266ef5: - result = new TL_contacts_topPeersNotModified(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in contacts_TopPeers", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static contacts_TopPeers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + contacts_TopPeers result = null; + switch (constructor) { + case 0x70b772a8: + result = new TL_contacts_topPeers(); + break; + case 0xb52c939d: + result = new TL_contacts_topPeersDisabled(); + break; + case 0xde266ef5: + result = new TL_contacts_topPeersNotModified(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in contacts_TopPeers", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_contacts_topPeers extends contacts_TopPeers { - public static int constructor = 0x70b772a8; + public static class TL_contacts_topPeers extends contacts_TopPeers { + public static int constructor = 0x70b772a8; - public ArrayList categories = new ArrayList<>(); - public ArrayList chats = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); + public ArrayList categories = new ArrayList<>(); + public ArrayList chats = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_topPeerCategoryPeers object = TL_topPeerCategoryPeers.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - categories.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_topPeerCategoryPeers object = TL_topPeerCategoryPeers.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + categories.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = categories.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - categories.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = categories.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + categories.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } - public static class TL_contacts_topPeersDisabled extends contacts_TopPeers { - public static int constructor = 0xb52c939d; + public static class TL_contacts_topPeersDisabled extends contacts_TopPeers { + public static int constructor = 0xb52c939d; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_contacts_topPeersNotModified extends contacts_TopPeers { - public static int constructor = 0xde266ef5; + public static class TL_contacts_topPeersNotModified extends contacts_TopPeers { + public static int constructor = 0xde266ef5; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_help_support extends TLObject { - public static int constructor = 0x17c6b5f6; + public static class TL_help_support extends TLObject { + public static int constructor = 0x17c6b5f6; - public String phone_number; - public User user; + public String phone_number; + public User user; - public static TL_help_support TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_help_support.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_help_support", constructor)); - } else { - return null; - } - } - TL_help_support result = new TL_help_support(); - result.readParams(stream, exception); - return result; - } + public static TL_help_support TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_help_support.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_help_support", constructor)); + } else { + return null; + } + } + TL_help_support result = new TL_help_support(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - phone_number = stream.readString(exception); - user = User.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + phone_number = stream.readString(exception); + user = User.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); stream.writeString(phone_number); - user.serializeToStream(stream); - } - } + user.serializeToStream(stream); + } + } - public static class TL_account_tmpPassword extends TLObject { - public static int constructor = 0xdb64fd34; + public static class TL_account_tmpPassword extends TLObject { + public static int constructor = 0xdb64fd34; - public byte[] tmp_password; - public int valid_until; + public byte[] tmp_password; + public int valid_until; - public static TL_account_tmpPassword TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_account_tmpPassword.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_account_tmpPassword", constructor)); - } else { - return null; - } - } - TL_account_tmpPassword result = new TL_account_tmpPassword(); - result.readParams(stream, exception); - return result; - } + public static TL_account_tmpPassword TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_account_tmpPassword.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_account_tmpPassword", constructor)); + } else { + return null; + } + } + TL_account_tmpPassword result = new TL_account_tmpPassword(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - tmp_password = stream.readByteArray(exception); - valid_until = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + tmp_password = stream.readByteArray(exception); + valid_until = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(tmp_password); - stream.writeInt32(valid_until); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(tmp_password); + stream.writeInt32(valid_until); + } + } - public static abstract class messages_Chats extends TLObject { - public ArrayList chats = new ArrayList<>(); - public int count; + public static abstract class messages_Chats extends TLObject { + public ArrayList chats = new ArrayList<>(); + public int count; - public static messages_Chats TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_Chats result = null; - switch (constructor) { - case 0x64ff9fd5: - result = new TL_messages_chats(); - break; - case 0x9cd81144: - result = new TL_messages_chatsSlice(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_Chats", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static messages_Chats TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_Chats result = null; + switch (constructor) { + case 0x64ff9fd5: + result = new TL_messages_chats(); + break; + case 0x9cd81144: + result = new TL_messages_chatsSlice(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_Chats", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messages_chats extends messages_Chats { - public static int constructor = 0x64ff9fd5; + public static class TL_messages_chats extends messages_Chats { + public static int constructor = 0x64ff9fd5; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + } + } - public static class TL_messages_chatsSlice extends messages_Chats { - public static int constructor = 0x9cd81144; + public static class TL_messages_chatsSlice extends messages_Chats { + public static int constructor = 0x9cd81144; - public void readParams(AbstractSerializedData stream, boolean exception) { - count = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + count = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(count); - stream.writeInt32(0x1cb5c415); - int count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(count); + stream.writeInt32(0x1cb5c415); + int count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + } + } public static abstract class InputChannel extends TLObject { @@ -32292,162 +32676,162 @@ public class TLRPC { } } - public static abstract class messages_BotResults extends TLObject { - public int flags; - public boolean gallery; - public long query_id; - public String next_offset; - public TL_inlineBotSwitchPM switch_pm; - public ArrayList results = new ArrayList<>(); - public int cache_time; - public ArrayList users = new ArrayList<>(); + public static abstract class messages_BotResults extends TLObject { + public int flags; + public boolean gallery; + public long query_id; + public String next_offset; + public TL_inlineBotSwitchPM switch_pm; + public ArrayList results = new ArrayList<>(); + public int cache_time; + public ArrayList users = new ArrayList<>(); - public static messages_BotResults TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_BotResults result = null; - switch (constructor) { - case 0xccd3563d: - result = new TL_messages_botResults_layer71(); - break; - case 0x947ca848: - result = new TL_messages_botResults(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_BotResults", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static messages_BotResults TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_BotResults result = null; + switch (constructor) { + case 0xccd3563d: + result = new TL_messages_botResults_layer71(); + break; + case 0x947ca848: + result = new TL_messages_botResults(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_BotResults", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messages_botResults_layer71 extends TL_messages_botResults { - public static int constructor = 0xccd3563d; + public static class TL_messages_botResults_layer71 extends TL_messages_botResults { + public static int constructor = 0xccd3563d; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - gallery = (flags & 1) != 0; - query_id = stream.readInt64(exception); - if ((flags & 2) != 0) { - next_offset = stream.readString(exception); - } - if ((flags & 4) != 0) { - switch_pm = TL_inlineBotSwitchPM.TLdeserialize(stream, stream.readInt32(exception), exception); - } - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - BotInlineResult object = BotInlineResult.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - results.add(object); - } - cache_time = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + gallery = (flags & 1) != 0; + query_id = stream.readInt64(exception); + if ((flags & 2) != 0) { + next_offset = stream.readString(exception); + } + if ((flags & 4) != 0) { + switch_pm = TL_inlineBotSwitchPM.TLdeserialize(stream, stream.readInt32(exception), exception); + } + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + BotInlineResult object = BotInlineResult.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + results.add(object); + } + cache_time = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = gallery ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeInt64(query_id); - if ((flags & 2) != 0) { - stream.writeString(next_offset); - } - if ((flags & 4) != 0) { - switch_pm.serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - int count = results.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - results.get(a).serializeToStream(stream); - } - stream.writeInt32(cache_time); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = gallery ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeInt64(query_id); + if ((flags & 2) != 0) { + stream.writeString(next_offset); + } + if ((flags & 4) != 0) { + switch_pm.serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + int count = results.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + results.get(a).serializeToStream(stream); + } + stream.writeInt32(cache_time); + } + } - public static class TL_messages_botResults extends messages_BotResults { - public static int constructor = 0x947ca848; + public static class TL_messages_botResults extends messages_BotResults { + public static int constructor = 0x947ca848; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - gallery = (flags & 1) != 0; - query_id = stream.readInt64(exception); - if ((flags & 2) != 0) { - next_offset = stream.readString(exception); - } - if ((flags & 4) != 0) { - switch_pm = TL_inlineBotSwitchPM.TLdeserialize(stream, stream.readInt32(exception), exception); - } - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - BotInlineResult object = BotInlineResult.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - results.add(object); - } - cache_time = stream.readInt32(exception); - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + gallery = (flags & 1) != 0; + query_id = stream.readInt64(exception); + if ((flags & 2) != 0) { + next_offset = stream.readString(exception); + } + if ((flags & 4) != 0) { + switch_pm = TL_inlineBotSwitchPM.TLdeserialize(stream, stream.readInt32(exception), exception); + } + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + BotInlineResult object = BotInlineResult.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + results.add(object); + } + cache_time = stream.readInt32(exception); + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = gallery ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeInt64(query_id); - if ((flags & 2) != 0) { - stream.writeString(next_offset); - } - if ((flags & 4) != 0) { - switch_pm.serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - int count = results.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - results.get(a).serializeToStream(stream); - } - stream.writeInt32(cache_time); - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = gallery ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeInt64(query_id); + if ((flags & 2) != 0) { + stream.writeString(next_offset); + } + if ((flags & 4) != 0) { + switch_pm.serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + int count = results.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + results.get(a).serializeToStream(stream); + } + stream.writeInt32(cache_time); + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } public static class TL_inputFolderPeer extends TLObject { public static int constructor = 0xfbd2c296; @@ -32565,125 +32949,125 @@ public class TLRPC { } } - public static class TL_inputBotInlineMessageID extends TLObject { - public static int constructor = 0x890c3d89; + public static class TL_inputBotInlineMessageID extends TLObject { + public static int constructor = 0x890c3d89; - public int dc_id; - public long id; - public long access_hash; + public int dc_id; + public long id; + public long access_hash; - public static TL_inputBotInlineMessageID TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_inputBotInlineMessageID.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_inputBotInlineMessageID", constructor)); - } else { - return null; - } - } - TL_inputBotInlineMessageID result = new TL_inputBotInlineMessageID(); - result.readParams(stream, exception); - return result; - } + public static TL_inputBotInlineMessageID TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_inputBotInlineMessageID.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_inputBotInlineMessageID", constructor)); + } else { + return null; + } + } + TL_inputBotInlineMessageID result = new TL_inputBotInlineMessageID(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - dc_id = stream.readInt32(exception); - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + dc_id = stream.readInt32(exception); + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(dc_id); - stream.writeInt64(id); - stream.writeInt64(access_hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(dc_id); + stream.writeInt64(id); + stream.writeInt64(access_hash); + } + } - public static abstract class SecurePlainData extends TLObject { + public static abstract class SecurePlainData extends TLObject { - public static SecurePlainData TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - SecurePlainData result = null; - switch (constructor) { - case 0x21ec5a5f: - result = new TL_securePlainEmail(); - break; - case 0x7d6099dd: - result = new TL_securePlainPhone(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in SecurePlainData", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static SecurePlainData TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + SecurePlainData result = null; + switch (constructor) { + case 0x21ec5a5f: + result = new TL_securePlainEmail(); + break; + case 0x7d6099dd: + result = new TL_securePlainPhone(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in SecurePlainData", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_securePlainEmail extends SecurePlainData { - public static int constructor = 0x21ec5a5f; + public static class TL_securePlainEmail extends SecurePlainData { + public static int constructor = 0x21ec5a5f; - public String email; + public String email; - public void readParams(AbstractSerializedData stream, boolean exception) { - email = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + email = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(email); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(email); + } + } - public static class TL_securePlainPhone extends SecurePlainData { - public static int constructor = 0x7d6099dd; + public static class TL_securePlainPhone extends SecurePlainData { + public static int constructor = 0x7d6099dd; - public String phone; + public String phone; - public void readParams(AbstractSerializedData stream, boolean exception) { - phone = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + phone = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(phone); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(phone); + } + } - public static class TL_secureSecretSettings extends TLObject { - public static int constructor = 0x1527bcac; + public static class TL_secureSecretSettings extends TLObject { + public static int constructor = 0x1527bcac; - public SecurePasswordKdfAlgo secure_algo; - public byte[] secure_secret; - public long secure_secret_id; + public SecurePasswordKdfAlgo secure_algo; + public byte[] secure_secret; + public long secure_secret_id; - public static TL_secureSecretSettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_secureSecretSettings.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_secureSecretSettings", constructor)); - } else { - return null; - } - } - TL_secureSecretSettings result = new TL_secureSecretSettings(); - result.readParams(stream, exception); - return result; - } + public static TL_secureSecretSettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_secureSecretSettings.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_secureSecretSettings", constructor)); + } else { + return null; + } + } + TL_secureSecretSettings result = new TL_secureSecretSettings(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - secure_algo = SecurePasswordKdfAlgo.TLdeserialize(stream, stream.readInt32(exception), exception); - secure_secret = stream.readByteArray(exception); - secure_secret_id = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + secure_algo = SecurePasswordKdfAlgo.TLdeserialize(stream, stream.readInt32(exception), exception); + secure_secret = stream.readByteArray(exception); + secure_secret_id = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - secure_algo.serializeToStream(stream); - stream.writeByteArray(secure_secret); - stream.writeInt64(secure_secret_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + secure_algo.serializeToStream(stream); + stream.writeByteArray(secure_secret); + stream.writeInt64(secure_secret_id); + } + } public static class TL_emojiLanguage extends TLObject { public static int constructor = 0xb3fb5361; @@ -32956,173 +33340,173 @@ public class TLRPC { } } - public static abstract class updates_ChannelDifference extends TLObject { - public int flags; - public boolean isFinal; - public int pts; - public int timeout; - public ArrayList new_messages = new ArrayList<>(); - public ArrayList other_updates = new ArrayList<>(); - public ArrayList chats = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); + public static abstract class updates_ChannelDifference extends TLObject { + public int flags; + public boolean isFinal; + public int pts; + public int timeout; + public ArrayList new_messages = new ArrayList<>(); + public ArrayList other_updates = new ArrayList<>(); + public ArrayList chats = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); public Dialog dialog; - public ArrayList messages = new ArrayList<>(); + public ArrayList messages = new ArrayList<>(); - public static updates_ChannelDifference TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - updates_ChannelDifference result = null; - switch (constructor) { - case 0x3e11affb: - result = new TL_updates_channelDifferenceEmpty(); - break; - case 0x2064674e: - result = new TL_updates_channelDifference(); - break; + public static updates_ChannelDifference TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + updates_ChannelDifference result = null; + switch (constructor) { + case 0x3e11affb: + result = new TL_updates_channelDifferenceEmpty(); + break; + case 0x2064674e: + result = new TL_updates_channelDifference(); + break; case 0xa4bcc6fe: result = new TL_updates_channelDifferenceTooLong(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in updates_ChannelDifference", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in updates_ChannelDifference", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_updates_channelDifferenceEmpty extends updates_ChannelDifference { - public static int constructor = 0x3e11affb; + public static class TL_updates_channelDifferenceEmpty extends updates_ChannelDifference { + public static int constructor = 0x3e11affb; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - isFinal = (flags & 1) != 0; - pts = stream.readInt32(exception); - if ((flags & 2) != 0) { - timeout = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + isFinal = (flags & 1) != 0; + pts = stream.readInt32(exception); + if ((flags & 2) != 0) { + timeout = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = isFinal ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeInt32(pts); - if ((flags & 2) != 0) { - stream.writeInt32(timeout); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = isFinal ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeInt32(pts); + if ((flags & 2) != 0) { + stream.writeInt32(timeout); + } + } + } - public static class TL_updates_channelDifference extends updates_ChannelDifference { - public static int constructor = 0x2064674e; + public static class TL_updates_channelDifference extends updates_ChannelDifference { + public static int constructor = 0x2064674e; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - isFinal = (flags & 1) != 0; - pts = stream.readInt32(exception); - if ((flags & 2) != 0) { - timeout = stream.readInt32(exception); - } - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Message object = Message.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - new_messages.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Update object = Update.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - other_updates.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + isFinal = (flags & 1) != 0; + pts = stream.readInt32(exception); + if ((flags & 2) != 0) { + timeout = stream.readInt32(exception); + } + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Message object = Message.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + new_messages.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Update object = Update.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + other_updates.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = isFinal ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeInt32(pts); - if ((flags & 2) != 0) { - stream.writeInt32(timeout); - } - stream.writeInt32(0x1cb5c415); - int count = new_messages.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - new_messages.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = other_updates.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - other_updates.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = isFinal ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeInt32(pts); + if ((flags & 2) != 0) { + stream.writeInt32(timeout); + } + stream.writeInt32(0x1cb5c415); + int count = new_messages.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + new_messages.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = other_updates.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + other_updates.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } public static class TL_updates_channelDifferenceTooLong extends updates_ChannelDifference { public static int constructor = 0xa4bcc6fe; @@ -33211,37 +33595,39 @@ public class TLRPC { } } - public static abstract class ChannelMessagesFilter extends TLObject { - public int flags; - public boolean exclude_new_messages; - public ArrayList ranges = new ArrayList<>(); + public static abstract class ChannelMessagesFilter extends TLObject { + public int flags; + public boolean exclude_new_messages; + public ArrayList ranges = new ArrayList<>(); - public static ChannelMessagesFilter TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - ChannelMessagesFilter result = null; - switch (constructor) { - case 0x94d42ee7: - result = new TL_channelMessagesFilterEmpty(); - break; - case 0xcd77d957: - result = new TL_channelMessagesFilter(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in ChannelMessagesFilter", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static ChannelMessagesFilter TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + ChannelMessagesFilter result = null; + switch (constructor) { + case 0x94d42ee7: + result = new TL_channelMessagesFilterEmpty(); + break; + case 0xcd77d957: + result = new TL_channelMessagesFilter(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in ChannelMessagesFilter", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } public static class TL_sponsoredMessage extends TLObject { - public static int constructor = 0xd151e19a; + public static int constructor = 0x3a836df8; public int flags; public byte[] random_id; public Peer from_id; + public ChatInvite chat_invite; + public String chat_invite_hash; public int channel_post; public String start_param; public String message; @@ -33263,7 +33649,15 @@ public class TLRPC { public void readParams(AbstractSerializedData stream, boolean exception) { flags = stream.readInt32(exception); random_id = stream.readByteArray(exception); - from_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 8) != 0) { + from_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 16) != 0) { + chat_invite = ChatInvite.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 16) != 0) { + chat_invite_hash = stream.readString(exception); + } if ((flags & 4) != 0) { channel_post = stream.readInt32(exception); } @@ -33294,7 +33688,15 @@ public class TLRPC { stream.writeInt32(constructor); stream.writeInt32(flags); stream.writeByteArray(random_id); - from_id.serializeToStream(stream); + if ((flags & 8) != 0) { + from_id.serializeToStream(stream); + } + if ((flags & 16) != 0) { + chat_invite.serializeToStream(stream); + } + if ((flags & 16) != 0) { + stream.writeString(chat_invite_hash); + } if ((flags & 4) != 0) { stream.writeInt32(channel_post); } @@ -33313,265 +33715,265 @@ public class TLRPC { } } - public static class TL_account_authorizationForm extends TLObject { - public static int constructor = 0xad2e1cd8; + public static class TL_account_authorizationForm extends TLObject { + public static int constructor = 0xad2e1cd8; - public int flags; - public ArrayList required_types = new ArrayList<>(); - public ArrayList values = new ArrayList<>(); - public ArrayList errors = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); - public String privacy_policy_url; + public int flags; + public ArrayList required_types = new ArrayList<>(); + public ArrayList values = new ArrayList<>(); + public ArrayList errors = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); + public String privacy_policy_url; - public static TL_account_authorizationForm TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_account_authorizationForm.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_account_authorizationForm", constructor)); - } else { - return null; - } - } - TL_account_authorizationForm result = new TL_account_authorizationForm(); - result.readParams(stream, exception); - return result; - } + public static TL_account_authorizationForm TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_account_authorizationForm.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_account_authorizationForm", constructor)); + } else { + return null; + } + } + TL_account_authorizationForm result = new TL_account_authorizationForm(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - SecureRequiredType object = SecureRequiredType.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - required_types.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_secureValue object = TL_secureValue.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - values.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - SecureValueError object = SecureValueError.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - errors.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - if ((flags & 1) != 0) { - privacy_policy_url = stream.readString(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + SecureRequiredType object = SecureRequiredType.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + required_types.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_secureValue object = TL_secureValue.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + values.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + SecureValueError object = SecureValueError.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + errors.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + if ((flags & 1) != 0) { + privacy_policy_url = stream.readString(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeInt32(0x1cb5c415); - int count = required_types.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - required_types.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = values.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - values.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = errors.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - errors.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - if ((flags & 1) != 0) { - stream.writeString(privacy_policy_url); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeInt32(0x1cb5c415); + int count = required_types.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + required_types.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = values.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + values.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = errors.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + errors.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + if ((flags & 1) != 0) { + stream.writeString(privacy_policy_url); + } + } + } - public static class TL_help_recentMeUrls extends TLObject { - public static int constructor = 0xe0310d7; + public static class TL_help_recentMeUrls extends TLObject { + public static int constructor = 0xe0310d7; - public ArrayList urls = new ArrayList<>(); - public ArrayList chats = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); + public ArrayList urls = new ArrayList<>(); + public ArrayList chats = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); - public static TL_help_recentMeUrls TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_help_recentMeUrls.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_help_recentMeUrls", constructor)); - } else { - return null; - } - } - TL_help_recentMeUrls result = new TL_help_recentMeUrls(); - result.readParams(stream, exception); - return result; - } + public static TL_help_recentMeUrls TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_help_recentMeUrls.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_help_recentMeUrls", constructor)); + } else { + return null; + } + } + TL_help_recentMeUrls result = new TL_help_recentMeUrls(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - RecentMeUrl object = RecentMeUrl.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - urls.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + RecentMeUrl object = RecentMeUrl.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + urls.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = urls.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - urls.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = urls.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + urls.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } - public static class TL_channelMessagesFilterEmpty extends ChannelMessagesFilter { - public static int constructor = 0x94d42ee7; + public static class TL_channelMessagesFilterEmpty extends ChannelMessagesFilter { + public static int constructor = 0x94d42ee7; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_channelMessagesFilter extends ChannelMessagesFilter { - public static int constructor = 0xcd77d957; + public static class TL_channelMessagesFilter extends ChannelMessagesFilter { + public static int constructor = 0xcd77d957; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - exclude_new_messages = (flags & 2) != 0; - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_messageRange object = TL_messageRange.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - ranges.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + exclude_new_messages = (flags & 2) != 0; + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_messageRange object = TL_messageRange.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + ranges.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = exclude_new_messages ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - stream.writeInt32(0x1cb5c415); - int count = ranges.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - ranges.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = exclude_new_messages ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + stream.writeInt32(0x1cb5c415); + int count = ranges.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + ranges.get(a).serializeToStream(stream); + } + } + } public static class TL_bankCardOpenUrl extends TLObject { public static int constructor = 0xf568028a; @@ -33620,7 +34022,7 @@ public class TLRPC { } } TL_contacts_resolvedPeer result = new TL_contacts_resolvedPeer(); - result.readParams(stream, exception); + result.readParams(stream, exception); return result; } @@ -33797,252 +34199,252 @@ public class TLRPC { } } - public static class TL_inputSingleMedia extends TLObject { - public static int constructor = 0x1cc6e91f; + public static class TL_inputSingleMedia extends TLObject { + public static int constructor = 0x1cc6e91f; - public int flags; - public InputMedia media; - public long random_id; - public String message; - public ArrayList entities = new ArrayList<>(); + public int flags; + public InputMedia media; + public long random_id; + public String message; + public ArrayList entities = new ArrayList<>(); - public static TL_inputSingleMedia TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_inputSingleMedia.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_inputSingleMedia", constructor)); - } else { - return null; - } - } - TL_inputSingleMedia result = new TL_inputSingleMedia(); - result.readParams(stream, exception); - return result; - } + public static TL_inputSingleMedia TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_inputSingleMedia.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_inputSingleMedia", constructor)); + } else { + return null; + } + } + TL_inputSingleMedia result = new TL_inputSingleMedia(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - media = InputMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - random_id = stream.readInt64(exception); - message = stream.readString(exception); - if ((flags & 1) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + media = InputMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + random_id = stream.readInt64(exception); + message = stream.readString(exception); + if ((flags & 1) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - media.serializeToStream(stream); - stream.writeInt64(random_id); - stream.writeString(message); - if ((flags & 1) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + media.serializeToStream(stream); + stream.writeInt64(random_id); + stream.writeString(message); + if ((flags & 1) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + } + } - public static class TL_inputPhoneCall extends TLObject { - public static int constructor = 0x1e36fded; + public static class TL_inputPhoneCall extends TLObject { + public static int constructor = 0x1e36fded; - public long id; - public long access_hash; + public long id; + public long access_hash; - public static TL_inputPhoneCall TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_inputPhoneCall.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_inputPhoneCall", constructor)); - } else { - return null; - } - } - TL_inputPhoneCall result = new TL_inputPhoneCall(); - result.readParams(stream, exception); - return result; - } + public static TL_inputPhoneCall TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_inputPhoneCall.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_inputPhoneCall", constructor)); + } else { + return null; + } + } + TL_inputPhoneCall result = new TL_inputPhoneCall(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + } + } - public static abstract class WebDocument extends TLObject { - public String url; - public long access_hash; - public int size; - public String mime_type; - public ArrayList attributes = new ArrayList<>(); + public static abstract class WebDocument extends TLObject { + public String url; + public long access_hash; + public int size; + public String mime_type; + public ArrayList attributes = new ArrayList<>(); - public static WebDocument TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - WebDocument result = null; - switch (constructor) { - case 0xf9c8bcc6: - result = new TL_webDocumentNoProxy(); - break; - case 0xc61acbd8: - result = new TL_webDocument_layer81(); - break; - case 0x1c570ed1: - result = new TL_webDocument(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in WebDocument", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static WebDocument TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + WebDocument result = null; + switch (constructor) { + case 0xf9c8bcc6: + result = new TL_webDocumentNoProxy(); + break; + case 0xc61acbd8: + result = new TL_webDocument_layer81(); + break; + case 0x1c570ed1: + result = new TL_webDocument(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in WebDocument", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_webDocumentNoProxy extends WebDocument { - public static int constructor = 0xf9c8bcc6; + public static class TL_webDocumentNoProxy extends WebDocument { + public static int constructor = 0xf9c8bcc6; - public void readParams(AbstractSerializedData stream, boolean exception) { - url = stream.readString(exception); - size = stream.readInt32(exception); - mime_type = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - attributes.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + url = stream.readString(exception); + size = stream.readInt32(exception); + mime_type = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + attributes.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(url); - stream.writeInt32(size); - stream.writeString(mime_type); - stream.writeInt32(0x1cb5c415); - int count = attributes.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - attributes.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(url); + stream.writeInt32(size); + stream.writeString(mime_type); + stream.writeInt32(0x1cb5c415); + int count = attributes.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + attributes.get(a).serializeToStream(stream); + } + } + } - public static class TL_webDocument_layer81 extends TL_webDocument { - public static int constructor = 0xc61acbd8; + public static class TL_webDocument_layer81 extends TL_webDocument { + public static int constructor = 0xc61acbd8; - public void readParams(AbstractSerializedData stream, boolean exception) { - url = stream.readString(exception); - access_hash = stream.readInt64(exception); - size = stream.readInt32(exception); - mime_type = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - attributes.add(object); - } - stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + url = stream.readString(exception); + access_hash = stream.readInt64(exception); + size = stream.readInt32(exception); + mime_type = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + attributes.add(object); + } + stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(url); - stream.writeInt64(access_hash); - stream.writeInt32(size); - stream.writeString(mime_type); - stream.writeInt32(0x1cb5c415); - int count = attributes.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - attributes.get(a).serializeToStream(stream); - } - stream.writeInt32(0); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(url); + stream.writeInt64(access_hash); + stream.writeInt32(size); + stream.writeString(mime_type); + stream.writeInt32(0x1cb5c415); + int count = attributes.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + attributes.get(a).serializeToStream(stream); + } + stream.writeInt32(0); + } + } - public static class TL_webDocument extends WebDocument { - public static int constructor = 0x1c570ed1; + public static class TL_webDocument extends WebDocument { + public static int constructor = 0x1c570ed1; - public void readParams(AbstractSerializedData stream, boolean exception) { - url = stream.readString(exception); - access_hash = stream.readInt64(exception); - size = stream.readInt32(exception); - mime_type = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - attributes.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + url = stream.readString(exception); + access_hash = stream.readInt64(exception); + size = stream.readInt32(exception); + mime_type = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + attributes.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(url); - stream.writeInt64(access_hash); - stream.writeInt32(size); - stream.writeString(mime_type); - stream.writeInt32(0x1cb5c415); - int count = attributes.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - attributes.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(url); + stream.writeInt64(access_hash); + stream.writeInt32(size); + stream.writeString(mime_type); + stream.writeInt32(0x1cb5c415); + int count = attributes.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + attributes.get(a).serializeToStream(stream); + } + } + } public static abstract class help_PromoData extends TLObject { @@ -34163,27 +34565,27 @@ public class TLRPC { } } - public static abstract class ChannelParticipant extends TLObject { + public static abstract class ChannelParticipant extends TLObject { public Peer peer; - public long kicked_by; - public int date; - public TL_channelBannedRights_layer92 banned_rights_layer92; - public long inviter_id; - public int flags; - public boolean can_edit; + public long kicked_by; + public int date; + public TL_channelBannedRights_layer92 banned_rights_layer92; + public long inviter_id; + public int flags; + public boolean can_edit; public boolean self; - public boolean left; - public long promoted_by; - public TL_channelAdminRights_layer92 admin_rights_layer92; + public boolean left; + public long promoted_by; + public TL_channelAdminRights_layer92 admin_rights_layer92; public TL_chatAdminRights admin_rights; public TL_chatBannedRights banned_rights; public String rank; public boolean via_invite; public long user_id; - public static ChannelParticipant TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - ChannelParticipant result = null; - switch (constructor) { + public static ChannelParticipant TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + ChannelParticipant result = null; + switch (constructor) { case 0x222c1886: result = new TL_channelParticipantBanned_layer92(); break; @@ -34250,16 +34652,16 @@ public class TLRPC { case 0x8cc5e69a: result = new TL_channelParticipantKicked_layer67(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in ChannelParticipant", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in ChannelParticipant", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } public static class TL_channelParticipant extends ChannelParticipant { public static int constructor = 0xc00c07c0; @@ -34484,75 +34886,75 @@ public class TLRPC { } } - public static class TL_channelParticipantCreator_layer103 extends TL_channelParticipantCreator { - public static int constructor = 0xe3e2e1f9; + public static class TL_channelParticipantCreator_layer103 extends TL_channelParticipantCreator { + public static int constructor = 0xe3e2e1f9; - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { peer = new TLRPC.TL_peerUser(); peer.user_id = stream.readInt32(exception); - } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) peer.user_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) peer.user_id); + } + } - public static class TL_channelParticipant_layer131 extends TL_channelParticipant { - public static int constructor = 0x15ebac1d; + public static class TL_channelParticipant_layer131 extends TL_channelParticipant { + public static int constructor = 0x15ebac1d; - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { peer = new TLRPC.TL_peerUser(); peer.user_id = stream.readInt32(exception); - date = stream.readInt32(exception); - } + date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) peer.user_id); - stream.writeInt32(date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) peer.user_id); + stream.writeInt32(date); + } + } - public static class TL_channelParticipantKicked_layer67 extends ChannelParticipant { - public static int constructor = 0x8cc5e69a; + public static class TL_channelParticipantKicked_layer67 extends ChannelParticipant { + public static int constructor = 0x8cc5e69a; - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { peer = new TLRPC.TL_peerUser(); peer.user_id = stream.readInt32(exception); - kicked_by = stream.readInt32(exception); - date = stream.readInt32(exception); - } + kicked_by = stream.readInt32(exception); + date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) peer.user_id); - stream.writeInt32((int) kicked_by); - stream.writeInt32(date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) peer.user_id); + stream.writeInt32((int) kicked_by); + stream.writeInt32(date); + } + } - public static class TL_channelParticipantSelf_layer131 extends TL_channelParticipantSelf { - public static int constructor = 0xa3289a6d; + public static class TL_channelParticipantSelf_layer131 extends TL_channelParticipantSelf { + public static int constructor = 0xa3289a6d; - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { peer = new TLRPC.TL_peerUser(); peer.user_id = stream.readInt32(exception); - inviter_id = stream.readInt32(exception); - date = stream.readInt32(exception); - } + inviter_id = stream.readInt32(exception); + date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) peer.user_id); - stream.writeInt32((int) inviter_id); - stream.writeInt32(date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) peer.user_id); + stream.writeInt32((int) inviter_id); + stream.writeInt32(date); + } + } public static class TL_channelParticipantAdmin_layer131 extends TL_channelParticipantAdmin { public static int constructor = 0xccbebbaf; @@ -34641,71 +35043,71 @@ public class TLRPC { } } - public static class TL_channelParticipantModerator_layer67 extends TL_channelParticipantAdmin { - public static int constructor = 0x91057fef; + public static class TL_channelParticipantModerator_layer67 extends TL_channelParticipantAdmin { + public static int constructor = 0x91057fef; - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { peer = new TLRPC.TL_peerUser(); peer.user_id = stream.readInt32(exception); - inviter_id = stream.readInt32(exception); - date = stream.readInt32(exception); - } + inviter_id = stream.readInt32(exception); + date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) peer.user_id); - stream.writeInt32((int) inviter_id); - stream.writeInt32(date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) peer.user_id); + stream.writeInt32((int) inviter_id); + stream.writeInt32(date); + } + } - public static class TL_channelParticipantEditor_layer67 extends TL_channelParticipantAdmin { - public static int constructor = 0x98192d61; + public static class TL_channelParticipantEditor_layer67 extends TL_channelParticipantAdmin { + public static int constructor = 0x98192d61; - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { peer = new TLRPC.TL_peerUser(); peer.user_id = stream.readInt32(exception); - inviter_id = stream.readInt32(exception); - date = stream.readInt32(exception); - } + inviter_id = stream.readInt32(exception); + date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) peer.user_id); - stream.writeInt32((int) inviter_id); - stream.writeInt32(date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) peer.user_id); + stream.writeInt32((int) inviter_id); + stream.writeInt32(date); + } + } - public static class TL_channelParticipantAdmin_layer92 extends TL_channelParticipantAdmin { - public static int constructor = 0xa82fa898; + public static class TL_channelParticipantAdmin_layer92 extends TL_channelParticipantAdmin { + public static int constructor = 0xa82fa898; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - can_edit = (flags & 1) != 0; + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + can_edit = (flags & 1) != 0; peer = new TLRPC.TL_peerUser(); peer.user_id = stream.readInt32(exception); - inviter_id = stream.readInt32(exception); - promoted_by = stream.readInt32(exception); - date = stream.readInt32(exception); - admin_rights_layer92 = TL_channelAdminRights_layer92.TLdeserialize(stream, stream.readInt32(exception), exception); + inviter_id = stream.readInt32(exception); + promoted_by = stream.readInt32(exception); + date = stream.readInt32(exception); + admin_rights_layer92 = TL_channelAdminRights_layer92.TLdeserialize(stream, stream.readInt32(exception), exception); admin_rights = Chat.mergeAdminRights(admin_rights_layer92); - } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = can_edit ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeInt32((int) peer.user_id); - stream.writeInt32((int) inviter_id); - stream.writeInt32((int) promoted_by); - stream.writeInt32(date); - admin_rights_layer92.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = can_edit ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeInt32((int) peer.user_id); + stream.writeInt32((int) inviter_id); + stream.writeInt32((int) promoted_by); + stream.writeInt32(date); + admin_rights_layer92.serializeToStream(stream); + } + } public static class TL_channelParticipantAdmin_layer103 extends TL_channelParticipantAdmin { public static int constructor = 0x5daa6e23; @@ -34740,82 +35142,82 @@ public class TLRPC { } } - public static abstract class InputStickeredMedia extends TLObject { + public static abstract class InputStickeredMedia extends TLObject { - public static InputStickeredMedia TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - InputStickeredMedia result = null; - switch (constructor) { - case 0x438865b: - result = new TL_inputStickeredMediaDocument(); - break; - case 0x4a992157: - result = new TL_inputStickeredMediaPhoto(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in InputStickeredMedia", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static InputStickeredMedia TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + InputStickeredMedia result = null; + switch (constructor) { + case 0x438865b: + result = new TL_inputStickeredMediaDocument(); + break; + case 0x4a992157: + result = new TL_inputStickeredMediaPhoto(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in InputStickeredMedia", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_inputStickeredMediaDocument extends InputStickeredMedia { - public static int constructor = 0x438865b; + public static class TL_inputStickeredMediaDocument extends InputStickeredMedia { + public static int constructor = 0x438865b; - public InputDocument id; + public InputDocument id; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = InputDocument.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = InputDocument.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - id.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + id.serializeToStream(stream); + } + } - public static class TL_inputStickeredMediaPhoto extends InputStickeredMedia { - public static int constructor = 0x4a992157; + public static class TL_inputStickeredMediaPhoto extends InputStickeredMedia { + public static int constructor = 0x4a992157; - public InputPhoto id; + public InputPhoto id; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = InputPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = InputPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - id.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + id.serializeToStream(stream); + } + } - public static abstract class channels_ChannelParticipants extends TLObject { - public int count; - public ArrayList participants = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); + public static abstract class channels_ChannelParticipants extends TLObject { + public int count; + public ArrayList participants = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); - public static channels_ChannelParticipants TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - channels_ChannelParticipants result = null; - switch (constructor) { + public static channels_ChannelParticipants TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + channels_ChannelParticipants result = null; + switch (constructor) { case 0x9ab0feaf: result = new TL_channels_channelParticipants(); break; - case 0xf0173fe9: - result = new TL_channels_channelParticipantsNotModified(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in channels_ChannelParticipants", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0xf0173fe9: + result = new TL_channels_channelParticipantsNotModified(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in channels_ChannelParticipants", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } public static class TL_channels_channelParticipants extends channels_ChannelParticipants { public static int constructor = 0x9ab0feaf; @@ -34898,14 +35300,14 @@ public class TLRPC { } } - public static class TL_channels_channelParticipantsNotModified extends channels_ChannelParticipants { - public static int constructor = 0xf0173fe9; + public static class TL_channels_channelParticipantsNotModified extends channels_ChannelParticipants { + public static int constructor = 0xf0173fe9; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static abstract class WallPaperSettings extends TLObject { @@ -35068,130 +35470,130 @@ public class TLRPC { } } - public static class TL_contacts_found extends TLObject { - public static int constructor = 0xb3134d9d; + public static class TL_contacts_found extends TLObject { + public static int constructor = 0xb3134d9d; - public ArrayList my_results = new ArrayList<>(); - public ArrayList results = new ArrayList<>(); - public ArrayList chats = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); + public ArrayList my_results = new ArrayList<>(); + public ArrayList results = new ArrayList<>(); + public ArrayList chats = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); - public static TL_contacts_found TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_contacts_found.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_contacts_found", constructor)); - } else { - return null; - } - } - TL_contacts_found result = new TL_contacts_found(); - result.readParams(stream, exception); - return result; - } + public static TL_contacts_found TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_contacts_found.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_contacts_found", constructor)); + } else { + return null; + } + } + TL_contacts_found result = new TL_contacts_found(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Peer object = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - my_results.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Peer object = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - results.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Peer object = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + my_results.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Peer object = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + results.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = my_results.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - my_results.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = results.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - results.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = my_results.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + my_results.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = results.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + results.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } - public static abstract class ChatParticipants extends TLObject { - public int flags; - public long chat_id; - public ChatParticipant self_participant; - public ArrayList participants = new ArrayList<>(); - public int version; - public long admin_id; + public static abstract class ChatParticipants extends TLObject { + public int flags; + public long chat_id; + public ChatParticipant self_participant; + public ArrayList participants = new ArrayList<>(); + public int version; + public long admin_id; - public static ChatParticipants TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - ChatParticipants result = null; - switch (constructor) { + public static ChatParticipants TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + ChatParticipants result = null; + switch (constructor) { case 0xfc900c2b: result = new TL_chatParticipantsForbidden_layer131(); break; @@ -35210,16 +35612,16 @@ public class TLRPC { case 0xfd2bb8a: result = new TL_chatParticipantsForbidden_old(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in ChatParticipants", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in ChatParticipants", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } public static class TL_chatParticipantsForbidden_layer131 extends TL_chatParticipantsForbidden { public static int constructor = 0xfc900c2b; @@ -35392,557 +35794,557 @@ public class TLRPC { } } - public static class TL_game extends TLObject { - public static int constructor = 0xbdf9653b; - - public int flags; - public long id; - public long access_hash; - public String short_name; - public String title; - public String description; - public Photo photo; - public Document document; - - public static TL_game TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_game.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_game", constructor)); - } else { - return null; - } - } - TL_game result = new TL_game(); - result.readParams(stream, exception); - return result; - } - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - short_name = stream.readString(exception); - title = stream.readString(exception); - description = stream.readString(exception); - photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 1) != 0) { - document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeString(short_name); - stream.writeString(title); - stream.writeString(description); - photo.serializeToStream(stream); - if ((flags & 1) != 0) { - document.serializeToStream(stream); - } - } - } - - public static abstract class DecryptedMessageMedia extends TLObject { - public int duration; - public String mime_type; - public int size; - public byte[] key; - public byte[] iv; - public double lat; - public double _long; - public String phone_number; - public String first_name; - public String last_name; - public long user_id; - public int thumb_w; - public int thumb_h; - public ArrayList attributes = new ArrayList<>(); - public String caption; - public String url; - public int w; - public int h; - public String file_name; - public String title; - public String address; - public String provider; - public String venue_id; - public long id; - public long access_hash; - public int date; - public int dc_id; - - public static DecryptedMessageMedia TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - DecryptedMessageMedia result = null; - switch (constructor) { - case 0x57e0a9cb: - result = new TL_decryptedMessageMediaAudio(); - break; - case 0x35480a59: - result = new TL_decryptedMessageMediaGeoPoint(); - break; - case 0x588a0a97: - result = new TL_decryptedMessageMediaContact(); - break; - case 0x89f5c4a: - result = new TL_decryptedMessageMediaEmpty(); - break; - case 0x7afe8ae2: - result = new TL_decryptedMessageMediaDocument(); - break; - case 0xe50511d8: - result = new TL_decryptedMessageMediaWebPage(); - break; - case 0xf1fa8d78: - result = new TL_decryptedMessageMediaPhoto(); - break; - case 0x970c8c0e: - result = new TL_decryptedMessageMediaVideo(); - break; - case 0xb095434b: - result = new TL_decryptedMessageMediaDocument_layer8(); - break; - case 0x4cee6ef3: - result = new TL_decryptedMessageMediaVideo_layer8(); - break; - case 0x8a0df56f: - result = new TL_decryptedMessageMediaVenue(); - break; - case 0xfa95b0dd: - result = new TL_decryptedMessageMediaExternalDocument(); - break; - case 0x524a415d: - result = new TL_decryptedMessageMediaVideo_layer17(); - break; - case 0x6080758f: - result = new TL_decryptedMessageMediaAudio_layer8(); - break; - case 0x32798a8c: - result = new TL_decryptedMessageMediaPhoto_layer8(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in DecryptedMessageMedia", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } - - public static class TL_decryptedMessageMediaAudio extends DecryptedMessageMedia { - public static int constructor = 0x57e0a9cb; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - duration = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(duration); - stream.writeString(mime_type); - stream.writeInt32(size); - stream.writeByteArray(key); - stream.writeByteArray(iv); - } - } - - public static class TL_decryptedMessageMediaGeoPoint extends DecryptedMessageMedia { - public static int constructor = 0x35480a59; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - lat = stream.readDouble(exception); - _long = stream.readDouble(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeDouble(lat); - stream.writeDouble(_long); - } - } - - public static class TL_decryptedMessageMediaContact extends DecryptedMessageMedia { - public static int constructor = 0x588a0a97; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - phone_number = stream.readString(exception); - first_name = stream.readString(exception); - last_name = stream.readString(exception); - user_id = stream.readInt32(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(phone_number); - stream.writeString(first_name); - stream.writeString(last_name); - stream.writeInt32((int) user_id); - } - } - - public static class TL_decryptedMessageMediaEmpty extends DecryptedMessageMedia { - public static int constructor = 0x89f5c4a; - - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } - - public static class TL_decryptedMessageMediaDocument extends DecryptedMessageMedia { - public static int constructor = 0x7afe8ae2; - - public byte[] thumb; - - public void readParams(AbstractSerializedData stream, boolean exception) { - thumb = stream.readByteArray(exception); - thumb_w = stream.readInt32(exception); - thumb_h = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - attributes.add(object); - } - caption = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(thumb); - stream.writeInt32(thumb_w); - stream.writeInt32(thumb_h); - stream.writeString(mime_type); - stream.writeInt32(size); - stream.writeByteArray(key); - stream.writeByteArray(iv); - stream.writeInt32(0x1cb5c415); - int count = attributes.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - attributes.get(a).serializeToStream(stream); - } - stream.writeString(caption); - } - } - - public static class TL_decryptedMessageMediaWebPage extends DecryptedMessageMedia { - public static int constructor = 0xe50511d8; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - url = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(url); - } - } - - public static class TL_decryptedMessageMediaPhoto extends DecryptedMessageMedia { - public static int constructor = 0xf1fa8d78; - - public byte[] thumb; - - public void readParams(AbstractSerializedData stream, boolean exception) { - thumb = stream.readByteArray(exception); - thumb_w = stream.readInt32(exception); - thumb_h = stream.readInt32(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - size = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - caption = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(thumb); - stream.writeInt32(thumb_w); - stream.writeInt32(thumb_h); - stream.writeInt32(w); - stream.writeInt32(h); - stream.writeInt32(size); - stream.writeByteArray(key); - stream.writeByteArray(iv); - stream.writeString(caption); - } - } - - public static class TL_decryptedMessageMediaVideo extends DecryptedMessageMedia { - public static int constructor = 0x970c8c0e; - - public byte[] thumb; - - public void readParams(AbstractSerializedData stream, boolean exception) { - thumb = stream.readByteArray(exception); - thumb_w = stream.readInt32(exception); - thumb_h = stream.readInt32(exception); - duration = stream.readInt32(exception); - mime_type = stream.readString(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - size = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - caption = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(thumb); - stream.writeInt32(thumb_w); - stream.writeInt32(thumb_h); - stream.writeInt32(duration); - stream.writeString(mime_type); - stream.writeInt32(w); - stream.writeInt32(h); - stream.writeInt32(size); - stream.writeByteArray(key); - stream.writeByteArray(iv); - stream.writeString(caption); - } - } - - public static class TL_decryptedMessageMediaDocument_layer8 extends TL_decryptedMessageMediaDocument { - public static int constructor = 0xb095434b; - - public byte[] thumb; - - public void readParams(AbstractSerializedData stream, boolean exception) { - thumb = stream.readByteArray(exception); - thumb_w = stream.readInt32(exception); - thumb_h = stream.readInt32(exception); - file_name = stream.readString(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(thumb); - stream.writeInt32(thumb_w); - stream.writeInt32(thumb_h); - stream.writeString(file_name); - stream.writeString(mime_type); - stream.writeInt32(size); - stream.writeByteArray(key); - stream.writeByteArray(iv); - } - } - - public static class TL_decryptedMessageMediaVideo_layer8 extends TL_decryptedMessageMediaVideo { - public static int constructor = 0x4cee6ef3; - - public byte[] thumb; - - public void readParams(AbstractSerializedData stream, boolean exception) { - thumb = stream.readByteArray(exception); - thumb_w = stream.readInt32(exception); - thumb_h = stream.readInt32(exception); - duration = stream.readInt32(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - size = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(thumb); - stream.writeInt32(thumb_w); - stream.writeInt32(thumb_h); - stream.writeInt32(duration); - stream.writeInt32(w); - stream.writeInt32(h); - stream.writeInt32(size); - stream.writeByteArray(key); - stream.writeByteArray(iv); - } - } - - public static class TL_decryptedMessageMediaVenue extends DecryptedMessageMedia { - public static int constructor = 0x8a0df56f; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - lat = stream.readDouble(exception); - _long = stream.readDouble(exception); - title = stream.readString(exception); - address = stream.readString(exception); - provider = stream.readString(exception); - venue_id = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeDouble(lat); - stream.writeDouble(_long); - stream.writeString(title); - stream.writeString(address); - stream.writeString(provider); - stream.writeString(venue_id); - } - } - - public static class TL_decryptedMessageMediaExternalDocument extends DecryptedMessageMedia { - public static int constructor = 0xfa95b0dd; - - public PhotoSize thumb; - - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - date = stream.readInt32(exception); - mime_type = stream.readString(exception); - size = stream.readInt32(exception); - thumb = PhotoSize.TLdeserialize(0, id, 0, stream, stream.readInt32(exception), exception); - dc_id = stream.readInt32(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - attributes.add(object); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeInt32(date); - stream.writeString(mime_type); - stream.writeInt32(size); - thumb.serializeToStream(stream); - stream.writeInt32(dc_id); - stream.writeInt32(0x1cb5c415); - int count = attributes.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - attributes.get(a).serializeToStream(stream); - } - } - } - - public static class TL_decryptedMessageMediaVideo_layer17 extends TL_decryptedMessageMediaVideo { - public static int constructor = 0x524a415d; - - public byte[] thumb; - - public void readParams(AbstractSerializedData stream, boolean exception) { - thumb = stream.readByteArray(exception); - thumb_w = stream.readInt32(exception); - thumb_h = stream.readInt32(exception); - duration = stream.readInt32(exception); - mime_type = stream.readString(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - size = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(thumb); - stream.writeInt32(thumb_w); - stream.writeInt32(thumb_h); - stream.writeInt32(duration); - stream.writeString(mime_type); - stream.writeInt32(w); - stream.writeInt32(h); - stream.writeInt32(size); - stream.writeByteArray(key); - stream.writeByteArray(iv); - } - } - - public static class TL_decryptedMessageMediaAudio_layer8 extends TL_decryptedMessageMediaAudio { - public static int constructor = 0x6080758f; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - duration = stream.readInt32(exception); - size = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(duration); - stream.writeInt32(size); - stream.writeByteArray(key); - stream.writeByteArray(iv); - } - } - - public static class TL_decryptedMessageMediaPhoto_layer8 extends TL_decryptedMessageMediaPhoto { - public static int constructor = 0x32798a8c; - - public byte[] thumb; - - public void readParams(AbstractSerializedData stream, boolean exception) { - thumb = stream.readByteArray(exception); - thumb_w = stream.readInt32(exception); - thumb_h = stream.readInt32(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - size = stream.readInt32(exception); - key = stream.readByteArray(exception); - iv = stream.readByteArray(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(thumb); - stream.writeInt32(thumb_w); - stream.writeInt32(thumb_h); - stream.writeInt32(w); - stream.writeInt32(h); - stream.writeInt32(size); - stream.writeByteArray(key); - stream.writeByteArray(iv); - } - } + public static class TL_game extends TLObject { + public static int constructor = 0xbdf9653b; + + public int flags; + public long id; + public long access_hash; + public String short_name; + public String title; + public String description; + public Photo photo; + public Document document; + + public static TL_game TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_game.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_game", constructor)); + } else { + return null; + } + } + TL_game result = new TL_game(); + result.readParams(stream, exception); + return result; + } + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + short_name = stream.readString(exception); + title = stream.readString(exception); + description = stream.readString(exception); + photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 1) != 0) { + document = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeString(short_name); + stream.writeString(title); + stream.writeString(description); + photo.serializeToStream(stream); + if ((flags & 1) != 0) { + document.serializeToStream(stream); + } + } + } + + public static abstract class DecryptedMessageMedia extends TLObject { + public int duration; + public String mime_type; + public int size; + public byte[] key; + public byte[] iv; + public double lat; + public double _long; + public String phone_number; + public String first_name; + public String last_name; + public long user_id; + public int thumb_w; + public int thumb_h; + public ArrayList attributes = new ArrayList<>(); + public String caption; + public String url; + public int w; + public int h; + public String file_name; + public String title; + public String address; + public String provider; + public String venue_id; + public long id; + public long access_hash; + public int date; + public int dc_id; + + public static DecryptedMessageMedia TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + DecryptedMessageMedia result = null; + switch (constructor) { + case 0x57e0a9cb: + result = new TL_decryptedMessageMediaAudio(); + break; + case 0x35480a59: + result = new TL_decryptedMessageMediaGeoPoint(); + break; + case 0x588a0a97: + result = new TL_decryptedMessageMediaContact(); + break; + case 0x89f5c4a: + result = new TL_decryptedMessageMediaEmpty(); + break; + case 0x7afe8ae2: + result = new TL_decryptedMessageMediaDocument(); + break; + case 0xe50511d8: + result = new TL_decryptedMessageMediaWebPage(); + break; + case 0xf1fa8d78: + result = new TL_decryptedMessageMediaPhoto(); + break; + case 0x970c8c0e: + result = new TL_decryptedMessageMediaVideo(); + break; + case 0xb095434b: + result = new TL_decryptedMessageMediaDocument_layer8(); + break; + case 0x4cee6ef3: + result = new TL_decryptedMessageMediaVideo_layer8(); + break; + case 0x8a0df56f: + result = new TL_decryptedMessageMediaVenue(); + break; + case 0xfa95b0dd: + result = new TL_decryptedMessageMediaExternalDocument(); + break; + case 0x524a415d: + result = new TL_decryptedMessageMediaVideo_layer17(); + break; + case 0x6080758f: + result = new TL_decryptedMessageMediaAudio_layer8(); + break; + case 0x32798a8c: + result = new TL_decryptedMessageMediaPhoto_layer8(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in DecryptedMessageMedia", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } + + public static class TL_decryptedMessageMediaAudio extends DecryptedMessageMedia { + public static int constructor = 0x57e0a9cb; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + duration = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(duration); + stream.writeString(mime_type); + stream.writeInt32(size); + stream.writeByteArray(key); + stream.writeByteArray(iv); + } + } + + public static class TL_decryptedMessageMediaGeoPoint extends DecryptedMessageMedia { + public static int constructor = 0x35480a59; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + lat = stream.readDouble(exception); + _long = stream.readDouble(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeDouble(lat); + stream.writeDouble(_long); + } + } + + public static class TL_decryptedMessageMediaContact extends DecryptedMessageMedia { + public static int constructor = 0x588a0a97; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + phone_number = stream.readString(exception); + first_name = stream.readString(exception); + last_name = stream.readString(exception); + user_id = stream.readInt32(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(phone_number); + stream.writeString(first_name); + stream.writeString(last_name); + stream.writeInt32((int) user_id); + } + } + + public static class TL_decryptedMessageMediaEmpty extends DecryptedMessageMedia { + public static int constructor = 0x89f5c4a; + + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } + + public static class TL_decryptedMessageMediaDocument extends DecryptedMessageMedia { + public static int constructor = 0x7afe8ae2; + + public byte[] thumb; + + public void readParams(AbstractSerializedData stream, boolean exception) { + thumb = stream.readByteArray(exception); + thumb_w = stream.readInt32(exception); + thumb_h = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + attributes.add(object); + } + caption = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(thumb); + stream.writeInt32(thumb_w); + stream.writeInt32(thumb_h); + stream.writeString(mime_type); + stream.writeInt32(size); + stream.writeByteArray(key); + stream.writeByteArray(iv); + stream.writeInt32(0x1cb5c415); + int count = attributes.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + attributes.get(a).serializeToStream(stream); + } + stream.writeString(caption); + } + } + + public static class TL_decryptedMessageMediaWebPage extends DecryptedMessageMedia { + public static int constructor = 0xe50511d8; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + url = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(url); + } + } + + public static class TL_decryptedMessageMediaPhoto extends DecryptedMessageMedia { + public static int constructor = 0xf1fa8d78; + + public byte[] thumb; + + public void readParams(AbstractSerializedData stream, boolean exception) { + thumb = stream.readByteArray(exception); + thumb_w = stream.readInt32(exception); + thumb_h = stream.readInt32(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + size = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + caption = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(thumb); + stream.writeInt32(thumb_w); + stream.writeInt32(thumb_h); + stream.writeInt32(w); + stream.writeInt32(h); + stream.writeInt32(size); + stream.writeByteArray(key); + stream.writeByteArray(iv); + stream.writeString(caption); + } + } + + public static class TL_decryptedMessageMediaVideo extends DecryptedMessageMedia { + public static int constructor = 0x970c8c0e; + + public byte[] thumb; + + public void readParams(AbstractSerializedData stream, boolean exception) { + thumb = stream.readByteArray(exception); + thumb_w = stream.readInt32(exception); + thumb_h = stream.readInt32(exception); + duration = stream.readInt32(exception); + mime_type = stream.readString(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + size = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + caption = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(thumb); + stream.writeInt32(thumb_w); + stream.writeInt32(thumb_h); + stream.writeInt32(duration); + stream.writeString(mime_type); + stream.writeInt32(w); + stream.writeInt32(h); + stream.writeInt32(size); + stream.writeByteArray(key); + stream.writeByteArray(iv); + stream.writeString(caption); + } + } + + public static class TL_decryptedMessageMediaDocument_layer8 extends TL_decryptedMessageMediaDocument { + public static int constructor = 0xb095434b; + + public byte[] thumb; + + public void readParams(AbstractSerializedData stream, boolean exception) { + thumb = stream.readByteArray(exception); + thumb_w = stream.readInt32(exception); + thumb_h = stream.readInt32(exception); + file_name = stream.readString(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(thumb); + stream.writeInt32(thumb_w); + stream.writeInt32(thumb_h); + stream.writeString(file_name); + stream.writeString(mime_type); + stream.writeInt32(size); + stream.writeByteArray(key); + stream.writeByteArray(iv); + } + } + + public static class TL_decryptedMessageMediaVideo_layer8 extends TL_decryptedMessageMediaVideo { + public static int constructor = 0x4cee6ef3; + + public byte[] thumb; + + public void readParams(AbstractSerializedData stream, boolean exception) { + thumb = stream.readByteArray(exception); + thumb_w = stream.readInt32(exception); + thumb_h = stream.readInt32(exception); + duration = stream.readInt32(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + size = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(thumb); + stream.writeInt32(thumb_w); + stream.writeInt32(thumb_h); + stream.writeInt32(duration); + stream.writeInt32(w); + stream.writeInt32(h); + stream.writeInt32(size); + stream.writeByteArray(key); + stream.writeByteArray(iv); + } + } + + public static class TL_decryptedMessageMediaVenue extends DecryptedMessageMedia { + public static int constructor = 0x8a0df56f; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + lat = stream.readDouble(exception); + _long = stream.readDouble(exception); + title = stream.readString(exception); + address = stream.readString(exception); + provider = stream.readString(exception); + venue_id = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeDouble(lat); + stream.writeDouble(_long); + stream.writeString(title); + stream.writeString(address); + stream.writeString(provider); + stream.writeString(venue_id); + } + } + + public static class TL_decryptedMessageMediaExternalDocument extends DecryptedMessageMedia { + public static int constructor = 0xfa95b0dd; + + public PhotoSize thumb; + + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + date = stream.readInt32(exception); + mime_type = stream.readString(exception); + size = stream.readInt32(exception); + thumb = PhotoSize.TLdeserialize(0, id, 0, stream, stream.readInt32(exception), exception); + dc_id = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + DocumentAttribute object = DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + attributes.add(object); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeInt32(date); + stream.writeString(mime_type); + stream.writeInt32(size); + thumb.serializeToStream(stream); + stream.writeInt32(dc_id); + stream.writeInt32(0x1cb5c415); + int count = attributes.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + attributes.get(a).serializeToStream(stream); + } + } + } + + public static class TL_decryptedMessageMediaVideo_layer17 extends TL_decryptedMessageMediaVideo { + public static int constructor = 0x524a415d; + + public byte[] thumb; + + public void readParams(AbstractSerializedData stream, boolean exception) { + thumb = stream.readByteArray(exception); + thumb_w = stream.readInt32(exception); + thumb_h = stream.readInt32(exception); + duration = stream.readInt32(exception); + mime_type = stream.readString(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + size = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(thumb); + stream.writeInt32(thumb_w); + stream.writeInt32(thumb_h); + stream.writeInt32(duration); + stream.writeString(mime_type); + stream.writeInt32(w); + stream.writeInt32(h); + stream.writeInt32(size); + stream.writeByteArray(key); + stream.writeByteArray(iv); + } + } + + public static class TL_decryptedMessageMediaAudio_layer8 extends TL_decryptedMessageMediaAudio { + public static int constructor = 0x6080758f; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + duration = stream.readInt32(exception); + size = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(duration); + stream.writeInt32(size); + stream.writeByteArray(key); + stream.writeByteArray(iv); + } + } + + public static class TL_decryptedMessageMediaPhoto_layer8 extends TL_decryptedMessageMediaPhoto { + public static int constructor = 0x32798a8c; + + public byte[] thumb; + + public void readParams(AbstractSerializedData stream, boolean exception) { + thumb = stream.readByteArray(exception); + thumb_w = stream.readInt32(exception); + thumb_h = stream.readInt32(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + size = stream.readInt32(exception); + key = stream.readByteArray(exception); + iv = stream.readByteArray(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(thumb); + stream.writeInt32(thumb_w); + stream.writeInt32(thumb_h); + stream.writeInt32(w); + stream.writeInt32(h); + stream.writeInt32(size); + stream.writeByteArray(key); + stream.writeByteArray(iv); + } + } public static abstract class EmojiKeyword extends TLObject { @@ -36066,15 +36468,15 @@ public class TLRPC { } } - public static abstract class ChatParticipant extends TLObject { + public static abstract class ChatParticipant extends TLObject { - public long user_id; - public long inviter_id; - public int date; + public long user_id; + public long inviter_id; + public int date; - public static ChatParticipant TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - ChatParticipant result = null; - switch (constructor) { + public static ChatParticipant TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + ChatParticipant result = null; + switch (constructor) { case 0xe2d6e436: result = new TL_chatParticipantAdmin_layer131(); break; @@ -36093,16 +36495,16 @@ public class TLRPC { case 0xe46bcee4: result = new TL_chatParticipantCreator(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in ChatParticipant", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in ChatParticipant", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } public static class TL_chatParticipantAdmin_layer131 extends TL_chatParticipantAdmin { public static int constructor = 0xe2d6e436; @@ -36204,6 +36606,59 @@ public class TLRPC { } } + public static class TL_availableReaction extends TLObject { + public static int constructor = 0x21d7c4b; + + public int flags; + public boolean inactive; + public String reaction; + public String title; + public Document static_icon; + public Document appear_animation; + public Document select_animation; + public Document activate_animation; + public Document effect_animation; + public int positionInList; //custom + + public static TL_availableReaction TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_availableReaction.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_availableReaction", constructor)); + } else { + return null; + } + } + TL_availableReaction result = new TL_availableReaction(); + result.readParams(stream, exception); + return result; + } + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + inactive = (flags & 1) != 0; + reaction = stream.readString(exception); + title = stream.readString(exception); + static_icon = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + appear_animation = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + select_animation = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + activate_animation = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + effect_animation = Document.TLdeserialize(stream, stream.readInt32(exception), exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = inactive ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeString(reaction); + stream.writeString(title); + static_icon.serializeToStream(stream); + appear_animation.serializeToStream(stream); + select_animation.serializeToStream(stream); + activate_animation.serializeToStream(stream); + effect_animation.serializeToStream(stream); + } + } + public static class TL_webAuthorization extends TLObject { public static int constructor = 0xa6f8f452; @@ -36256,115 +36711,115 @@ public class TLRPC { } } - public static abstract class InputSecureFile extends TLObject { + public static abstract class InputSecureFile extends TLObject { - public static InputSecureFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - InputSecureFile result = null; - switch (constructor) { - case 0x3334b0f0: - result = new TL_inputSecureFileUploaded(); - break; - case 0x5367e5be: - result = new TL_inputSecureFile(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in InputSecureFile", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static InputSecureFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + InputSecureFile result = null; + switch (constructor) { + case 0x3334b0f0: + result = new TL_inputSecureFileUploaded(); + break; + case 0x5367e5be: + result = new TL_inputSecureFile(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in InputSecureFile", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_inputSecureFileUploaded extends InputSecureFile { - public static int constructor = 0x3334b0f0; + public static class TL_inputSecureFileUploaded extends InputSecureFile { + public static int constructor = 0x3334b0f0; - public long id; - public int parts; - public String md5_checksum; - public byte[] file_hash; - public byte[] secret; + public long id; + public int parts; + public String md5_checksum; + public byte[] file_hash; + public byte[] secret; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - parts = stream.readInt32(exception); - md5_checksum = stream.readString(exception); - file_hash = stream.readByteArray(exception); - secret = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + parts = stream.readInt32(exception); + md5_checksum = stream.readString(exception); + file_hash = stream.readByteArray(exception); + secret = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt32(parts); - stream.writeString(md5_checksum); - stream.writeByteArray(file_hash); - stream.writeByteArray(secret); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt32(parts); + stream.writeString(md5_checksum); + stream.writeByteArray(file_hash); + stream.writeByteArray(secret); + } + } - public static class TL_inputSecureFile extends InputSecureFile { - public static int constructor = 0x5367e5be; + public static class TL_inputSecureFile extends InputSecureFile { + public static int constructor = 0x5367e5be; - public long id; - public long access_hash; + public long id; + public long access_hash; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + } + } - public static class TL_postAddress extends TLObject { - public static int constructor = 0x1e8caaeb; + public static class TL_postAddress extends TLObject { + public static int constructor = 0x1e8caaeb; - public String street_line1; - public String street_line2; - public String city; - public String state; - public String country_iso2; - public String post_code; + public String street_line1; + public String street_line2; + public String city; + public String state; + public String country_iso2; + public String post_code; - public static TL_postAddress TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_postAddress.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_postAddress", constructor)); - } else { - return null; - } - } - TL_postAddress result = new TL_postAddress(); - result.readParams(stream, exception); - return result; - } + public static TL_postAddress TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_postAddress.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_postAddress", constructor)); + } else { + return null; + } + } + TL_postAddress result = new TL_postAddress(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - street_line1 = stream.readString(exception); - street_line2 = stream.readString(exception); - city = stream.readString(exception); - state = stream.readString(exception); - country_iso2 = stream.readString(exception); - post_code = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + street_line1 = stream.readString(exception); + street_line2 = stream.readString(exception); + city = stream.readString(exception); + state = stream.readString(exception); + country_iso2 = stream.readString(exception); + post_code = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(street_line1); - stream.writeString(street_line2); - stream.writeString(city); - stream.writeString(state); - stream.writeString(country_iso2); - stream.writeString(post_code); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(street_line1); + stream.writeString(street_line2); + stream.writeString(city); + stream.writeString(state); + stream.writeString(country_iso2); + stream.writeString(post_code); + } + } public static abstract class ChannelAdminLogEventAction extends TLObject { @@ -36455,12 +36910,12 @@ public class TLRPC { case 0x23209745: result = new TL_channelAdminLogEventActionStartGroupCall(); break; + case 0x9cf7f76a: + result = new TL_channelAdminLogEventActionChangeAvailableReactions(); + break; case 0x50c7ac8: result = new TL_channelAdminLogEventActionChangeLinkedChat(); break; - case 0x278f2868: - result = new TL_channelAdminLogEventActionSendMessage(); - break; case 0x1b7907ae: result = new TL_channelAdminLogEventActionToggleInvites(); break; @@ -36970,6 +37425,54 @@ public class TLRPC { } } + public static class TL_channelAdminLogEventActionChangeAvailableReactions extends ChannelAdminLogEventAction { + public static int constructor = 0x9cf7f76a; + + public ArrayList prev_value = new ArrayList<>(); + public ArrayList new_value = new ArrayList<>(); + + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + prev_value.add(stream.readString(exception)); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + new_value.add(stream.readString(exception)); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = prev_value.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeString(prev_value.get(a)); + } + stream.writeInt32(0x1cb5c415); + count = new_value.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeString(new_value.get(a)); + } + } + } + public static class TL_channelAdminLogEventActionToggleInvites extends ChannelAdminLogEventAction { public static int constructor = 0x1b7907ae; @@ -37066,75 +37569,75 @@ public class TLRPC { } } - public static abstract class InputWebFileLocation extends TLObject { + public static abstract class InputWebFileLocation extends TLObject { - public static InputWebFileLocation TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - InputWebFileLocation result = null; - switch (constructor) { - case 0x9f2221c9: - result = new TL_inputWebFileGeoPointLocation(); - break; - case 0xc239d686: - result = new TL_inputWebFileLocation(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in InputWebFileLocation", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static InputWebFileLocation TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + InputWebFileLocation result = null; + switch (constructor) { + case 0x9f2221c9: + result = new TL_inputWebFileGeoPointLocation(); + break; + case 0xc239d686: + result = new TL_inputWebFileLocation(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in InputWebFileLocation", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_inputWebFileGeoPointLocation extends InputWebFileLocation { - public static int constructor = 0x9f2221c9; + public static class TL_inputWebFileGeoPointLocation extends InputWebFileLocation { + public static int constructor = 0x9f2221c9; - public InputGeoPoint geo_point; - public long access_hash; - public int w; - public int h; - public int zoom; - public int scale; + public InputGeoPoint geo_point; + public long access_hash; + public int w; + public int h; + public int zoom; + public int scale; - public void readParams(AbstractSerializedData stream, boolean exception) { - geo_point = InputGeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); - access_hash = stream.readInt64(exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - zoom = stream.readInt32(exception); - scale = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + geo_point = InputGeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception); + access_hash = stream.readInt64(exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + zoom = stream.readInt32(exception); + scale = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - geo_point.serializeToStream(stream); - stream.writeInt64(access_hash); - stream.writeInt32(w); - stream.writeInt32(h); - stream.writeInt32(zoom); - stream.writeInt32(scale); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + geo_point.serializeToStream(stream); + stream.writeInt64(access_hash); + stream.writeInt32(w); + stream.writeInt32(h); + stream.writeInt32(zoom); + stream.writeInt32(scale); + } + } - public static class TL_inputWebFileLocation extends InputWebFileLocation { - public static int constructor = 0xc239d686; + public static class TL_inputWebFileLocation extends InputWebFileLocation { + public static int constructor = 0xc239d686; - public String url; - public long access_hash; + public String url; + public long access_hash; - public void readParams(AbstractSerializedData stream, boolean exception) { - url = stream.readString(exception); - access_hash = stream.readInt64(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + url = stream.readString(exception); + access_hash = stream.readInt64(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(url); - stream.writeInt64(access_hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(url); + stream.writeInt64(access_hash); + } + } public static abstract class PeerLocated extends TLObject { @@ -37277,36 +37780,36 @@ public class TLRPC { } } - public static class TL_account_sentEmailCode extends TLObject { - public static int constructor = 0x811f854f; + public static class TL_account_sentEmailCode extends TLObject { + public static int constructor = 0x811f854f; - public String email_pattern; - public int length; + public String email_pattern; + public int length; - public static TL_account_sentEmailCode TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_account_sentEmailCode.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_account_sentEmailCode", constructor)); - } else { - return null; - } - } - TL_account_sentEmailCode result = new TL_account_sentEmailCode(); - result.readParams(stream, exception); - return result; - } + public static TL_account_sentEmailCode TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_account_sentEmailCode.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_account_sentEmailCode", constructor)); + } else { + return null; + } + } + TL_account_sentEmailCode result = new TL_account_sentEmailCode(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - email_pattern = stream.readString(exception); - length = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + email_pattern = stream.readString(exception); + length = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(email_pattern); - stream.writeInt32(length); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(email_pattern); + stream.writeInt32(length); + } + } public static class TL_messages_inactiveChats extends TLObject { public static int constructor = 0xa927fec5; @@ -37395,88 +37898,88 @@ public class TLRPC { } } - public static class TL_channelAdminRights_layer92 extends TLObject { - public static int constructor = 0x5d7ceba5; + public static class TL_channelAdminRights_layer92 extends TLObject { + public static int constructor = 0x5d7ceba5; - public int flags; - public boolean change_info; - public boolean post_messages; - public boolean edit_messages; - public boolean delete_messages; - public boolean ban_users; - public boolean invite_users; - public boolean pin_messages; - public boolean add_admins; - public boolean manage_call; + public int flags; + public boolean change_info; + public boolean post_messages; + public boolean edit_messages; + public boolean delete_messages; + public boolean ban_users; + public boolean invite_users; + public boolean pin_messages; + public boolean add_admins; + public boolean manage_call; - public static TL_channelAdminRights_layer92 TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_channelAdminRights_layer92.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_channelAdminRights_layer92", constructor)); - } else { - return null; - } - } - TL_channelAdminRights_layer92 result = new TL_channelAdminRights_layer92(); - result.readParams(stream, exception); - return result; - } + public static TL_channelAdminRights_layer92 TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_channelAdminRights_layer92.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_channelAdminRights_layer92", constructor)); + } else { + return null; + } + } + TL_channelAdminRights_layer92 result = new TL_channelAdminRights_layer92(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - change_info = (flags & 1) != 0; - post_messages = (flags & 2) != 0; - edit_messages = (flags & 4) != 0; - delete_messages = (flags & 8) != 0; - ban_users = (flags & 16) != 0; - invite_users = (flags & 32) != 0; - pin_messages = (flags & 128) != 0; - add_admins = (flags & 512) != 0; - manage_call = (flags & 1024) != 0; - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + change_info = (flags & 1) != 0; + post_messages = (flags & 2) != 0; + edit_messages = (flags & 4) != 0; + delete_messages = (flags & 8) != 0; + ban_users = (flags & 16) != 0; + invite_users = (flags & 32) != 0; + pin_messages = (flags & 128) != 0; + add_admins = (flags & 512) != 0; + manage_call = (flags & 1024) != 0; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = change_info ? (flags | 1) : (flags &~ 1); - flags = post_messages ? (flags | 2) : (flags &~ 2); - flags = edit_messages ? (flags | 4) : (flags &~ 4); - flags = delete_messages ? (flags | 8) : (flags &~ 8); - flags = ban_users ? (flags | 16) : (flags &~ 16); - flags = invite_users ? (flags | 32) : (flags &~ 32); - flags = pin_messages ? (flags | 128) : (flags &~ 128); - flags = add_admins ? (flags | 512) : (flags &~ 512); - flags = manage_call ? (flags | 1024) : (flags &~ 1024); - stream.writeInt32(flags); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = change_info ? (flags | 1) : (flags &~ 1); + flags = post_messages ? (flags | 2) : (flags &~ 2); + flags = edit_messages ? (flags | 4) : (flags &~ 4); + flags = delete_messages ? (flags | 8) : (flags &~ 8); + flags = ban_users ? (flags | 16) : (flags &~ 16); + flags = invite_users ? (flags | 32) : (flags &~ 32); + flags = pin_messages ? (flags | 128) : (flags &~ 128); + flags = add_admins ? (flags | 512) : (flags &~ 512); + flags = manage_call ? (flags | 1024) : (flags &~ 1024); + stream.writeInt32(flags); + } + } - public static abstract class Chat extends TLObject { - public long id; - public String title; - public int date; - public int flags; - public boolean creator; - public boolean kicked; - public boolean deactivated; - public boolean left; + public static abstract class Chat extends TLObject { + public long id; + public String title; + public int date; + public int flags; + public boolean creator; + public boolean kicked; + public boolean deactivated; + public boolean left; public boolean has_geo; public boolean slowmode_enabled; - public ChatPhoto photo; - public int participants_count; - public int version; - public boolean broadcast; - public boolean megagroup; - public long access_hash; - public int until_date; - public boolean moderator; - public boolean verified; - public boolean restricted; - public boolean signatures; - public String username; - public boolean min; + public ChatPhoto photo; + public int participants_count; + public int version; + public boolean broadcast; + public boolean megagroup; + public long access_hash; + public int until_date; + public boolean moderator; + public boolean verified; + public boolean restricted; + public boolean signatures; + public String username; + public boolean min; public boolean scam; public boolean has_link; - public boolean explicit_content; + public boolean explicit_content; public boolean call_active; public boolean call_not_empty; public boolean fake; @@ -37488,7 +37991,7 @@ public class TLRPC { public TL_chatAdminRights admin_rights; public TL_chatBannedRights banned_rights; public TL_chatBannedRights default_banned_rights; - public InputChannel migrated_to; + public InputChannel migrated_to; public static Chat TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { Chat result = null; @@ -37573,8 +38076,8 @@ public class TLRPC { } protected static TL_chatBannedRights mergeBannedRights(TL_channelBannedRights_layer92 rights) { - if (rights == null) { - return null; + if (rights == null) { + return null; } TL_chatBannedRights newRights = new TL_chatBannedRights(); newRights.view_messages = rights.view_messages; @@ -37608,58 +38111,58 @@ public class TLRPC { newRights.add_admins = rights.add_admins; return newRights; } - } + } - public static class TL_chatForbidden_old extends TL_chatForbidden { - public static int constructor = 0xfb0ccc41; + public static class TL_chatForbidden_old extends TL_chatForbidden { + public static int constructor = 0xfb0ccc41; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - title = stream.readString(exception); - date = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + title = stream.readString(exception); + date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) id); - stream.writeString(title); - stream.writeInt32(date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) id); + stream.writeString(title); + stream.writeInt32(date); + } + } - public static class TL_chat_old2 extends TL_chat { - public static int constructor = 0x7312bc48; + public static class TL_chat_old2 extends TL_chat { + public static int constructor = 0x7312bc48; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - creator = (flags & 1) != 0; - kicked = (flags & 2) != 0; - left = (flags & 4) != 0; - deactivated = (flags & 32) != 0; - id = stream.readInt32(exception); - title = stream.readString(exception); - photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - participants_count = stream.readInt32(exception); - date = stream.readInt32(exception); - version = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + creator = (flags & 1) != 0; + kicked = (flags & 2) != 0; + left = (flags & 4) != 0; + deactivated = (flags & 32) != 0; + id = stream.readInt32(exception); + title = stream.readString(exception); + photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + participants_count = stream.readInt32(exception); + date = stream.readInt32(exception); + version = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = creator ? (flags | 1) : (flags &~ 1); - flags = kicked ? (flags | 2) : (flags &~ 2); - flags = left ? (flags | 4) : (flags &~ 4); - flags = deactivated ? (flags | 32) : (flags &~ 32); - stream.writeInt32(flags); - stream.writeInt32((int) id); - stream.writeString(title); - photo.serializeToStream(stream); - stream.writeInt32(participants_count); - stream.writeInt32(date); - stream.writeInt32(version); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = creator ? (flags | 1) : (flags &~ 1); + flags = kicked ? (flags | 2) : (flags &~ 2); + flags = left ? (flags | 4) : (flags &~ 4); + flags = deactivated ? (flags | 32) : (flags &~ 32); + stream.writeInt32(flags); + stream.writeInt32((int) id); + stream.writeString(title); + photo.serializeToStream(stream); + stream.writeInt32(participants_count); + stream.writeInt32(date); + stream.writeInt32(version); + } + } public static class TL_chat extends Chat { public static int constructor = 0x41cbf256; @@ -37805,132 +38308,132 @@ public class TLRPC { } } - public static class TL_channelForbidden_layer131 extends TL_channelForbidden { - public static int constructor = 0x289da732; + public static class TL_channelForbidden_layer131 extends TL_channelForbidden { + public static int constructor = 0x289da732; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - broadcast = (flags & 32) != 0; - megagroup = (flags & 256) != 0; - id = stream.readInt32(exception); - access_hash = stream.readInt64(exception); - title = stream.readString(exception); - if ((flags & 65536) != 0) { - until_date = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + broadcast = (flags & 32) != 0; + megagroup = (flags & 256) != 0; + id = stream.readInt32(exception); + access_hash = stream.readInt64(exception); + title = stream.readString(exception); + if ((flags & 65536) != 0) { + until_date = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = broadcast ? (flags | 32) : (flags &~ 32); - flags = megagroup ? (flags | 256) : (flags &~ 256); - stream.writeInt32(flags); - stream.writeInt32((int) id); - stream.writeInt64(access_hash); - stream.writeString(title); - if ((flags & 65536) != 0) { - stream.writeInt32(until_date); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = broadcast ? (flags | 32) : (flags &~ 32); + flags = megagroup ? (flags | 256) : (flags &~ 256); + stream.writeInt32(flags); + stream.writeInt32((int) id); + stream.writeInt64(access_hash); + stream.writeString(title); + if ((flags & 65536) != 0) { + stream.writeInt32(until_date); + } + } + } - public static class TL_channelForbidden_layer67 extends TL_channelForbidden { - public static int constructor = 0x8537784f; + public static class TL_channelForbidden_layer67 extends TL_channelForbidden { + public static int constructor = 0x8537784f; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - broadcast = (flags & 32) != 0; - megagroup = (flags & 256) != 0; - id = stream.readInt32(exception); - access_hash = stream.readInt64(exception); - title = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + broadcast = (flags & 32) != 0; + megagroup = (flags & 256) != 0; + id = stream.readInt32(exception); + access_hash = stream.readInt64(exception); + title = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = broadcast ? (flags | 32) : (flags &~ 32); - flags = megagroup ? (flags | 256) : (flags &~ 256); - stream.writeInt32(flags); - stream.writeInt32((int) id); - stream.writeInt64(access_hash); - stream.writeString(title); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = broadcast ? (flags | 32) : (flags &~ 32); + flags = megagroup ? (flags | 256) : (flags &~ 256); + stream.writeInt32(flags); + stream.writeInt32((int) id); + stream.writeInt64(access_hash); + stream.writeString(title); + } + } - public static class TL_channel_layer48 extends TL_channel { - public static int constructor = 0x4b1b7506; + public static class TL_channel_layer48 extends TL_channel { + public static int constructor = 0x4b1b7506; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - creator = (flags & 1) != 0; - kicked = (flags & 2) != 0; - left = (flags & 4) != 0; - moderator = (flags & 16) != 0; - broadcast = (flags & 32) != 0; - verified = (flags & 128) != 0; - megagroup = (flags & 256) != 0; - restricted = (flags & 512) != 0; - signatures = (flags & 2048) != 0; - id = stream.readInt32(exception); - access_hash = stream.readInt64(exception); - title = stream.readString(exception); - if ((flags & 64) != 0) { - username = stream.readString(exception); - } - photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - date = stream.readInt32(exception); - version = stream.readInt32(exception); - if ((flags & 512) != 0) { - stream.readString(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + creator = (flags & 1) != 0; + kicked = (flags & 2) != 0; + left = (flags & 4) != 0; + moderator = (flags & 16) != 0; + broadcast = (flags & 32) != 0; + verified = (flags & 128) != 0; + megagroup = (flags & 256) != 0; + restricted = (flags & 512) != 0; + signatures = (flags & 2048) != 0; + id = stream.readInt32(exception); + access_hash = stream.readInt64(exception); + title = stream.readString(exception); + if ((flags & 64) != 0) { + username = stream.readString(exception); + } + photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + date = stream.readInt32(exception); + version = stream.readInt32(exception); + if ((flags & 512) != 0) { + stream.readString(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = creator ? (flags | 1) : (flags &~ 1); - flags = kicked ? (flags | 2) : (flags &~ 2); - flags = left ? (flags | 4) : (flags &~ 4); - flags = moderator ? (flags | 16) : (flags &~ 16); - flags = broadcast ? (flags | 32) : (flags &~ 32); - flags = verified ? (flags | 128) : (flags &~ 128); - flags = megagroup ? (flags | 256) : (flags &~ 256); - flags = restricted ? (flags | 512) : (flags &~ 512); - flags = signatures ? (flags | 2048) : (flags &~ 2048); - stream.writeInt32(flags); - stream.writeInt32((int) id); - stream.writeInt64(access_hash); - stream.writeString(title); - if ((flags & 64) != 0) { - stream.writeString(username); - } - photo.serializeToStream(stream); - stream.writeInt32(date); - stream.writeInt32(version); - if ((flags & 512) != 0) { - stream.writeString(""); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = creator ? (flags | 1) : (flags &~ 1); + flags = kicked ? (flags | 2) : (flags &~ 2); + flags = left ? (flags | 4) : (flags &~ 4); + flags = moderator ? (flags | 16) : (flags &~ 16); + flags = broadcast ? (flags | 32) : (flags &~ 32); + flags = verified ? (flags | 128) : (flags &~ 128); + flags = megagroup ? (flags | 256) : (flags &~ 256); + flags = restricted ? (flags | 512) : (flags &~ 512); + flags = signatures ? (flags | 2048) : (flags &~ 2048); + stream.writeInt32(flags); + stream.writeInt32((int) id); + stream.writeInt64(access_hash); + stream.writeString(title); + if ((flags & 64) != 0) { + stream.writeString(username); + } + photo.serializeToStream(stream); + stream.writeInt32(date); + stream.writeInt32(version); + if ((flags & 512) != 0) { + stream.writeString(""); + } + } + } - public static class TL_channelForbidden_layer52 extends TL_channelForbidden { - public static int constructor = 0x2d85832c; + public static class TL_channelForbidden_layer52 extends TL_channelForbidden { + public static int constructor = 0x2d85832c; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - access_hash = stream.readInt64(exception); - title = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + access_hash = stream.readInt64(exception); + title = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) id); - stream.writeInt64(access_hash); - stream.writeString(title); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) id); + stream.writeInt64(access_hash); + stream.writeString(title); + } + } public static class TL_channel extends Chat { public static int constructor = 0x8261ac61; @@ -38065,154 +38568,154 @@ public class TLRPC { } } - public static class TL_chatForbidden_layer131 extends TL_chatForbidden { - public static int constructor = 0x7328bdb; + public static class TL_chatForbidden_layer131 extends TL_chatForbidden { + public static int constructor = 0x7328bdb; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - title = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + title = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) id); - stream.writeString(title); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) id); + stream.writeString(title); + } + } - public static class TL_channel_layer67 extends TL_channel { - public static int constructor = 0xa14dca52; + public static class TL_channel_layer67 extends TL_channel { + public static int constructor = 0xa14dca52; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - creator = (flags & 1) != 0; - kicked = (flags & 2) != 0; - left = (flags & 4) != 0; - moderator = (flags & 16) != 0; - broadcast = (flags & 32) != 0; - verified = (flags & 128) != 0; - megagroup = (flags & 256) != 0; - restricted = (flags & 512) != 0; - signatures = (flags & 2048) != 0; - min = (flags & 4096) != 0; - id = stream.readInt32(exception); - if ((flags & 8192) != 0) { - access_hash = stream.readInt64(exception); - } - title = stream.readString(exception); - if ((flags & 64) != 0) { - username = stream.readString(exception); - } - photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - date = stream.readInt32(exception); - version = stream.readInt32(exception); - if ((flags & 512) != 0) { - stream.readString(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + creator = (flags & 1) != 0; + kicked = (flags & 2) != 0; + left = (flags & 4) != 0; + moderator = (flags & 16) != 0; + broadcast = (flags & 32) != 0; + verified = (flags & 128) != 0; + megagroup = (flags & 256) != 0; + restricted = (flags & 512) != 0; + signatures = (flags & 2048) != 0; + min = (flags & 4096) != 0; + id = stream.readInt32(exception); + if ((flags & 8192) != 0) { + access_hash = stream.readInt64(exception); + } + title = stream.readString(exception); + if ((flags & 64) != 0) { + username = stream.readString(exception); + } + photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + date = stream.readInt32(exception); + version = stream.readInt32(exception); + if ((flags & 512) != 0) { + stream.readString(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = creator ? (flags | 1) : (flags &~ 1); - flags = kicked ? (flags | 2) : (flags &~ 2); - flags = left ? (flags | 4) : (flags &~ 4); - flags = moderator ? (flags | 16) : (flags &~ 16); - flags = broadcast ? (flags | 32) : (flags &~ 32); - flags = verified ? (flags | 128) : (flags &~ 128); - flags = megagroup ? (flags | 256) : (flags &~ 256); - flags = restricted ? (flags | 512) : (flags &~ 512); - flags = signatures ? (flags | 2048) : (flags &~ 2048); - flags = min ? (flags | 4096) : (flags &~ 4096); - stream.writeInt32(flags); - stream.writeInt32((int) id); - if ((flags & 8192) != 0) { - stream.writeInt64(access_hash); - } - stream.writeString(title); - if ((flags & 64) != 0) { - stream.writeString(username); - } - photo.serializeToStream(stream); - stream.writeInt32(date); - stream.writeInt32(version); - if ((flags & 512) != 0) { - stream.writeString(""); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = creator ? (flags | 1) : (flags &~ 1); + flags = kicked ? (flags | 2) : (flags &~ 2); + flags = left ? (flags | 4) : (flags &~ 4); + flags = moderator ? (flags | 16) : (flags &~ 16); + flags = broadcast ? (flags | 32) : (flags &~ 32); + flags = verified ? (flags | 128) : (flags &~ 128); + flags = megagroup ? (flags | 256) : (flags &~ 256); + flags = restricted ? (flags | 512) : (flags &~ 512); + flags = signatures ? (flags | 2048) : (flags &~ 2048); + flags = min ? (flags | 4096) : (flags &~ 4096); + stream.writeInt32(flags); + stream.writeInt32((int) id); + if ((flags & 8192) != 0) { + stream.writeInt64(access_hash); + } + stream.writeString(title); + if ((flags & 64) != 0) { + stream.writeString(username); + } + photo.serializeToStream(stream); + stream.writeInt32(date); + stream.writeInt32(version); + if ((flags & 512) != 0) { + stream.writeString(""); + } + } + } - public static class TL_channel_old extends TL_channel { - public static int constructor = 0x678e9587; + public static class TL_channel_old extends TL_channel { + public static int constructor = 0x678e9587; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - creator = (flags & 1) != 0; - kicked = (flags & 2) != 0; - left = (flags & 4) != 0; - moderator = (flags & 16) != 0; - broadcast = (flags & 32) != 0; - verified = (flags & 128) != 0; - megagroup = (flags & 256) != 0; - explicit_content = (flags & 512) != 0; - id = stream.readInt32(exception); - access_hash = stream.readInt64(exception); - title = stream.readString(exception); - if ((flags & 64) != 0) { - username = stream.readString(exception); - } - photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - date = stream.readInt32(exception); - version = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + creator = (flags & 1) != 0; + kicked = (flags & 2) != 0; + left = (flags & 4) != 0; + moderator = (flags & 16) != 0; + broadcast = (flags & 32) != 0; + verified = (flags & 128) != 0; + megagroup = (flags & 256) != 0; + explicit_content = (flags & 512) != 0; + id = stream.readInt32(exception); + access_hash = stream.readInt64(exception); + title = stream.readString(exception); + if ((flags & 64) != 0) { + username = stream.readString(exception); + } + photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + date = stream.readInt32(exception); + version = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = creator ? (flags | 1) : (flags &~ 1); - flags = kicked ? (flags | 2) : (flags &~ 2); - flags = left ? (flags | 4) : (flags &~ 4); - flags = moderator ? (flags | 16) : (flags &~ 16); - flags = broadcast ? (flags | 32) : (flags &~ 32); - flags = verified ? (flags | 128) : (flags &~ 128); - flags = megagroup ? (flags | 256) : (flags &~ 256); - flags = explicit_content ? (flags | 512) : (flags &~ 512); - stream.writeInt32(flags); - stream.writeInt32((int) id); - stream.writeInt64(access_hash); - stream.writeString(title); - if ((flags & 64) != 0) { - stream.writeString(username); - } - photo.serializeToStream(stream); - stream.writeInt32(date); - stream.writeInt32(version); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = creator ? (flags | 1) : (flags &~ 1); + flags = kicked ? (flags | 2) : (flags &~ 2); + flags = left ? (flags | 4) : (flags &~ 4); + flags = moderator ? (flags | 16) : (flags &~ 16); + flags = broadcast ? (flags | 32) : (flags &~ 32); + flags = verified ? (flags | 128) : (flags &~ 128); + flags = megagroup ? (flags | 256) : (flags &~ 256); + flags = explicit_content ? (flags | 512) : (flags &~ 512); + stream.writeInt32(flags); + stream.writeInt32((int) id); + stream.writeInt64(access_hash); + stream.writeString(title); + if ((flags & 64) != 0) { + stream.writeString(username); + } + photo.serializeToStream(stream); + stream.writeInt32(date); + stream.writeInt32(version); + } + } - public static class TL_chat_old extends TL_chat { - public static int constructor = 0x6e9c9bc7; + public static class TL_chat_old extends TL_chat { + public static int constructor = 0x6e9c9bc7; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - title = stream.readString(exception); - photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - participants_count = stream.readInt32(exception); - date = stream.readInt32(exception); - left = stream.readBool(exception); - version = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + title = stream.readString(exception); + photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + participants_count = stream.readInt32(exception); + date = stream.readInt32(exception); + left = stream.readBool(exception); + version = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32((int) id); - stream.writeString(title); - photo.serializeToStream(stream); - stream.writeInt32(participants_count); - stream.writeInt32(date); - stream.writeBool(left); - stream.writeInt32(version); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32((int) id); + stream.writeString(title); + photo.serializeToStream(stream); + stream.writeInt32(participants_count); + stream.writeInt32(date); + stream.writeBool(left); + stream.writeInt32(version); + } + } public static class TL_channel_layer131 extends TL_channel { public static int constructor = 0xd31a961e; @@ -38596,121 +39099,121 @@ public class TLRPC { } } - public static class TL_channel_layer92 extends TL_channel { - public static int constructor = 0xc88974ac; + public static class TL_channel_layer92 extends TL_channel { + public static int constructor = 0xc88974ac; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - creator = (flags & 1) != 0; - left = (flags & 4) != 0; - broadcast = (flags & 32) != 0; - verified = (flags & 128) != 0; - megagroup = (flags & 256) != 0; - restricted = (flags & 512) != 0; - signatures = (flags & 2048) != 0; - min = (flags & 4096) != 0; - id = stream.readInt32(exception); - if ((flags & 8192) != 0) { - access_hash = stream.readInt64(exception); - } - title = stream.readString(exception); - if ((flags & 64) != 0) { - username = stream.readString(exception); - } - photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - date = stream.readInt32(exception); - version = stream.readInt32(exception); - if ((flags & 512) != 0) { - stream.readString(exception); - } - if ((flags & 16384) != 0) { - admin_rights_layer92 = TL_channelAdminRights_layer92.TLdeserialize(stream, stream.readInt32(exception), exception); + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + creator = (flags & 1) != 0; + left = (flags & 4) != 0; + broadcast = (flags & 32) != 0; + verified = (flags & 128) != 0; + megagroup = (flags & 256) != 0; + restricted = (flags & 512) != 0; + signatures = (flags & 2048) != 0; + min = (flags & 4096) != 0; + id = stream.readInt32(exception); + if ((flags & 8192) != 0) { + access_hash = stream.readInt64(exception); + } + title = stream.readString(exception); + if ((flags & 64) != 0) { + username = stream.readString(exception); + } + photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + date = stream.readInt32(exception); + version = stream.readInt32(exception); + if ((flags & 512) != 0) { + stream.readString(exception); + } + if ((flags & 16384) != 0) { + admin_rights_layer92 = TL_channelAdminRights_layer92.TLdeserialize(stream, stream.readInt32(exception), exception); admin_rights = mergeAdminRights(admin_rights_layer92); - } - if ((flags & 32768) != 0) { - banned_rights_layer92 = TL_channelBannedRights_layer92.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 32768) != 0) { + banned_rights_layer92 = TL_channelBannedRights_layer92.TLdeserialize(stream, stream.readInt32(exception), exception); banned_rights = mergeBannedRights(banned_rights_layer92); - } - if ((flags & 131072) != 0) { - participants_count = stream.readInt32(exception); - } - } + } + if ((flags & 131072) != 0) { + participants_count = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = creator ? (flags | 1) : (flags &~ 1); - flags = left ? (flags | 4) : (flags &~ 4); - flags = broadcast ? (flags | 32) : (flags &~ 32); - flags = verified ? (flags | 128) : (flags &~ 128); - flags = megagroup ? (flags | 256) : (flags &~ 256); - flags = restricted ? (flags | 512) : (flags &~ 512); - flags = signatures ? (flags | 2048) : (flags &~ 2048); - flags = min ? (flags | 4096) : (flags &~ 4096); - stream.writeInt32(flags); - stream.writeInt32((int) id); - if ((flags & 8192) != 0) { - stream.writeInt64(access_hash); - } - stream.writeString(title); - if ((flags & 64) != 0) { - stream.writeString(username); - } - photo.serializeToStream(stream); - stream.writeInt32(date); - stream.writeInt32(version); - if ((flags & 512) != 0) { - stream.writeString(""); - } - if ((flags & 16384) != 0) { - admin_rights_layer92.serializeToStream(stream); - } - if ((flags & 32768) != 0) { - banned_rights_layer92.serializeToStream(stream); - } - if ((flags & 131072) != 0) { - stream.writeInt32(participants_count); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = creator ? (flags | 1) : (flags &~ 1); + flags = left ? (flags | 4) : (flags &~ 4); + flags = broadcast ? (flags | 32) : (flags &~ 32); + flags = verified ? (flags | 128) : (flags &~ 128); + flags = megagroup ? (flags | 256) : (flags &~ 256); + flags = restricted ? (flags | 512) : (flags &~ 512); + flags = signatures ? (flags | 2048) : (flags &~ 2048); + flags = min ? (flags | 4096) : (flags &~ 4096); + stream.writeInt32(flags); + stream.writeInt32((int) id); + if ((flags & 8192) != 0) { + stream.writeInt64(access_hash); + } + stream.writeString(title); + if ((flags & 64) != 0) { + stream.writeString(username); + } + photo.serializeToStream(stream); + stream.writeInt32(date); + stream.writeInt32(version); + if ((flags & 512) != 0) { + stream.writeString(""); + } + if ((flags & 16384) != 0) { + admin_rights_layer92.serializeToStream(stream); + } + if ((flags & 32768) != 0) { + banned_rights_layer92.serializeToStream(stream); + } + if ((flags & 131072) != 0) { + stream.writeInt32(participants_count); + } + } + } - public static class TL_chat_layer92 extends TL_chat { - public static int constructor = 0xd91cdd54; + public static class TL_chat_layer92 extends TL_chat { + public static int constructor = 0xd91cdd54; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - creator = (flags & 1) != 0; - kicked = (flags & 2) != 0; - left = (flags & 4) != 0; - deactivated = (flags & 32) != 0; - id = stream.readInt32(exception); - title = stream.readString(exception); - photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); - participants_count = stream.readInt32(exception); - date = stream.readInt32(exception); - version = stream.readInt32(exception); - if ((flags & 64) != 0) { - migrated_to = InputChannel.TLdeserialize(stream, stream.readInt32(exception), exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + creator = (flags & 1) != 0; + kicked = (flags & 2) != 0; + left = (flags & 4) != 0; + deactivated = (flags & 32) != 0; + id = stream.readInt32(exception); + title = stream.readString(exception); + photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception); + participants_count = stream.readInt32(exception); + date = stream.readInt32(exception); + version = stream.readInt32(exception); + if ((flags & 64) != 0) { + migrated_to = InputChannel.TLdeserialize(stream, stream.readInt32(exception), exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = creator ? (flags | 1) : (flags &~ 1); - flags = kicked ? (flags | 2) : (flags &~ 2); - flags = left ? (flags | 4) : (flags &~ 4); - flags = deactivated ? (flags | 32) : (flags &~ 32); - stream.writeInt32(flags); - stream.writeInt32((int) id); - stream.writeString(title); - photo.serializeToStream(stream); - stream.writeInt32(participants_count); - stream.writeInt32(date); - stream.writeInt32(version); - if ((flags & 64) != 0) { - migrated_to.serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = creator ? (flags | 1) : (flags &~ 1); + flags = kicked ? (flags | 2) : (flags &~ 2); + flags = left ? (flags | 4) : (flags &~ 4); + flags = deactivated ? (flags | 32) : (flags &~ 32); + stream.writeInt32(flags); + stream.writeInt32((int) id); + stream.writeString(title); + photo.serializeToStream(stream); + stream.writeInt32(participants_count); + stream.writeInt32(date); + stream.writeInt32(version); + if ((flags & 64) != 0) { + migrated_to.serializeToStream(stream); + } + } + } public static class TL_restrictionReason extends TLObject { public static int constructor = 0xd072acb4; @@ -39142,196 +39645,196 @@ public class TLRPC { } } - public static abstract class storage_FileType extends TLObject { + public static abstract class storage_FileType extends TLObject { - public static storage_FileType TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - storage_FileType result = null; - switch (constructor) { - case 0xaa963b05: - result = new TL_storage_fileUnknown(); - break; - case 0xb3cea0e4: - result = new TL_storage_fileMp4(); - break; - case 0x1081464c: - result = new TL_storage_fileWebp(); - break; - case 0xa4f63c0: - result = new TL_storage_filePng(); - break; - case 0xcae1aadf: - result = new TL_storage_fileGif(); - break; - case 0xae1e508d: - result = new TL_storage_filePdf(); - break; - case 0x528a0677: - result = new TL_storage_fileMp3(); - break; - case 0x7efe0e: - result = new TL_storage_fileJpeg(); - break; - case 0x4b09ebbc: - result = new TL_storage_fileMov(); - break; - case 0x40bc6f52: - result = new TL_storage_filePartial(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in storage_FileType", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static storage_FileType TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + storage_FileType result = null; + switch (constructor) { + case 0xaa963b05: + result = new TL_storage_fileUnknown(); + break; + case 0xb3cea0e4: + result = new TL_storage_fileMp4(); + break; + case 0x1081464c: + result = new TL_storage_fileWebp(); + break; + case 0xa4f63c0: + result = new TL_storage_filePng(); + break; + case 0xcae1aadf: + result = new TL_storage_fileGif(); + break; + case 0xae1e508d: + result = new TL_storage_filePdf(); + break; + case 0x528a0677: + result = new TL_storage_fileMp3(); + break; + case 0x7efe0e: + result = new TL_storage_fileJpeg(); + break; + case 0x4b09ebbc: + result = new TL_storage_fileMov(); + break; + case 0x40bc6f52: + result = new TL_storage_filePartial(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in storage_FileType", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_storage_fileUnknown extends storage_FileType { - public static int constructor = 0xaa963b05; + public static class TL_storage_fileUnknown extends storage_FileType { + public static int constructor = 0xaa963b05; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_storage_fileMp4 extends storage_FileType { - public static int constructor = 0xb3cea0e4; + public static class TL_storage_fileMp4 extends storage_FileType { + public static int constructor = 0xb3cea0e4; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_storage_fileWebp extends storage_FileType { - public static int constructor = 0x1081464c; + public static class TL_storage_fileWebp extends storage_FileType { + public static int constructor = 0x1081464c; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_storage_filePng extends storage_FileType { - public static int constructor = 0xa4f63c0; + public static class TL_storage_filePng extends storage_FileType { + public static int constructor = 0xa4f63c0; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_storage_fileGif extends storage_FileType { - public static int constructor = 0xcae1aadf; + public static class TL_storage_fileGif extends storage_FileType { + public static int constructor = 0xcae1aadf; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_storage_filePdf extends storage_FileType { - public static int constructor = 0xae1e508d; + public static class TL_storage_filePdf extends storage_FileType { + public static int constructor = 0xae1e508d; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_storage_fileMp3 extends storage_FileType { - public static int constructor = 0x528a0677; + public static class TL_storage_fileMp3 extends storage_FileType { + public static int constructor = 0x528a0677; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_storage_fileJpeg extends storage_FileType { - public static int constructor = 0x7efe0e; + public static class TL_storage_fileJpeg extends storage_FileType { + public static int constructor = 0x7efe0e; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_storage_fileMov extends storage_FileType { - public static int constructor = 0x4b09ebbc; + public static class TL_storage_fileMov extends storage_FileType { + public static int constructor = 0x4b09ebbc; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_storage_filePartial extends storage_FileType { - public static int constructor = 0x40bc6f52; + public static class TL_storage_filePartial extends storage_FileType { + public static int constructor = 0x40bc6f52; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static abstract class auth_CodeType extends TLObject { + public static abstract class auth_CodeType extends TLObject { - public static auth_CodeType TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - auth_CodeType result = null; - switch (constructor) { - case 0x72a3158c: - result = new TL_auth_codeTypeSms(); - break; - case 0x741cd3e3: - result = new TL_auth_codeTypeCall(); - break; - case 0x226ccefb: - result = new TL_auth_codeTypeFlashCall(); - break; + public static auth_CodeType TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + auth_CodeType result = null; + switch (constructor) { + case 0x72a3158c: + result = new TL_auth_codeTypeSms(); + break; + case 0x741cd3e3: + result = new TL_auth_codeTypeCall(); + break; + case 0x226ccefb: + result = new TL_auth_codeTypeFlashCall(); + break; case 0xd61ad6ee: result = new TL_auth_codeTypeMissedCall(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in auth_CodeType", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in auth_CodeType", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_auth_codeTypeSms extends auth_CodeType { - public static int constructor = 0x72a3158c; + public static class TL_auth_codeTypeSms extends auth_CodeType { + public static int constructor = 0x72a3158c; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_auth_codeTypeCall extends auth_CodeType { - public static int constructor = 0x741cd3e3; + public static class TL_auth_codeTypeCall extends auth_CodeType { + public static int constructor = 0x741cd3e3; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_auth_codeTypeFlashCall extends auth_CodeType { - public static int constructor = 0x226ccefb; + public static class TL_auth_codeTypeFlashCall extends auth_CodeType { + public static int constructor = 0x226ccefb; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_auth_codeTypeMissedCall extends auth_CodeType { public static int constructor = 0xd61ad6ee; @@ -39342,158 +39845,158 @@ public class TLRPC { } } - public static abstract class MessagesFilter extends TLObject { - public int flags; - public boolean missed; + public static abstract class MessagesFilter extends TLObject { + public int flags; + public boolean missed; - public static MessagesFilter TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - MessagesFilter result = null; - switch (constructor) { - case 0xffc86587: - result = new TL_inputMessagesFilterGif(); - break; - case 0x3751b49e: - result = new TL_inputMessagesFilterMusic(); - break; - case 0x3a20ecb8: - result = new TL_inputMessagesFilterChatPhotos(); - break; - case 0x9609a51c: - result = new TL_inputMessagesFilterPhotos(); - break; - case 0x7ef0dd87: - result = new TL_inputMessagesFilterUrl(); - break; - case 0x9eddf188: - result = new TL_inputMessagesFilterDocument(); - break; - case 0x56e9f0e4: - result = new TL_inputMessagesFilterPhotoVideo(); - break; - case 0xd95e73bb: - result = new TL_inputMessagesFilterPhotoVideoDocuments(); - break; - case 0xe7026d0d: - result = new TL_inputMessagesFilterGeo(); - break; + public static MessagesFilter TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + MessagesFilter result = null; + switch (constructor) { + case 0xffc86587: + result = new TL_inputMessagesFilterGif(); + break; + case 0x3751b49e: + result = new TL_inputMessagesFilterMusic(); + break; + case 0x3a20ecb8: + result = new TL_inputMessagesFilterChatPhotos(); + break; + case 0x9609a51c: + result = new TL_inputMessagesFilterPhotos(); + break; + case 0x7ef0dd87: + result = new TL_inputMessagesFilterUrl(); + break; + case 0x9eddf188: + result = new TL_inputMessagesFilterDocument(); + break; + case 0x56e9f0e4: + result = new TL_inputMessagesFilterPhotoVideo(); + break; + case 0xd95e73bb: + result = new TL_inputMessagesFilterPhotoVideoDocuments(); + break; + case 0xe7026d0d: + result = new TL_inputMessagesFilterGeo(); + break; case 0x1bb00451: result = new TL_inputMessagesFilterPinned(); break; - case 0xc1f8e69a: - result = new TL_inputMessagesFilterMyMentions(); - break; - case 0x7a7c17a4: - result = new TL_inputMessagesFilterRoundVoice(); - break; - case 0xe062db83: - result = new TL_inputMessagesFilterContacts(); - break; - case 0x50f5c392: - result = new TL_inputMessagesFilterVoice(); - break; - case 0x9fc00e65: - result = new TL_inputMessagesFilterVideo(); - break; - case 0x80c99768: - result = new TL_inputMessagesFilterPhoneCalls(); - break; - case 0x57e2f66c: - result = new TL_inputMessagesFilterEmpty(); - break; - case 0xb549da53: - result = new TL_inputMessagesFilterRoundVideo(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in MessagesFilter", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0xc1f8e69a: + result = new TL_inputMessagesFilterMyMentions(); + break; + case 0x7a7c17a4: + result = new TL_inputMessagesFilterRoundVoice(); + break; + case 0xe062db83: + result = new TL_inputMessagesFilterContacts(); + break; + case 0x50f5c392: + result = new TL_inputMessagesFilterVoice(); + break; + case 0x9fc00e65: + result = new TL_inputMessagesFilterVideo(); + break; + case 0x80c99768: + result = new TL_inputMessagesFilterPhoneCalls(); + break; + case 0x57e2f66c: + result = new TL_inputMessagesFilterEmpty(); + break; + case 0xb549da53: + result = new TL_inputMessagesFilterRoundVideo(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in MessagesFilter", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_inputMessagesFilterGif extends MessagesFilter { - public static int constructor = 0xffc86587; + public static class TL_inputMessagesFilterGif extends MessagesFilter { + public static int constructor = 0xffc86587; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterMusic extends MessagesFilter { - public static int constructor = 0x3751b49e; + public static class TL_inputMessagesFilterMusic extends MessagesFilter { + public static int constructor = 0x3751b49e; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterChatPhotos extends MessagesFilter { - public static int constructor = 0x3a20ecb8; + public static class TL_inputMessagesFilterChatPhotos extends MessagesFilter { + public static int constructor = 0x3a20ecb8; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterPhotos extends MessagesFilter { - public static int constructor = 0x9609a51c; + public static class TL_inputMessagesFilterPhotos extends MessagesFilter { + public static int constructor = 0x9609a51c; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterUrl extends MessagesFilter { - public static int constructor = 0x7ef0dd87; + public static class TL_inputMessagesFilterUrl extends MessagesFilter { + public static int constructor = 0x7ef0dd87; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterDocument extends MessagesFilter { - public static int constructor = 0x9eddf188; + public static class TL_inputMessagesFilterDocument extends MessagesFilter { + public static int constructor = 0x9eddf188; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterPhotoVideo extends MessagesFilter { - public static int constructor = 0x56e9f0e4; + public static class TL_inputMessagesFilterPhotoVideo extends MessagesFilter { + public static int constructor = 0x56e9f0e4; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterPhotoVideoDocuments extends MessagesFilter { - public static int constructor = 0xd95e73bb; + public static class TL_inputMessagesFilterPhotoVideoDocuments extends MessagesFilter { + public static int constructor = 0xd95e73bb; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterGeo extends MessagesFilter { - public static int constructor = 0xe7026d0d; + public static class TL_inputMessagesFilterGeo extends MessagesFilter { + public static int constructor = 0xe7026d0d; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_inputMessagesFilterPinned extends MessagesFilter { public static int constructor = 0x1bb00451; @@ -39504,84 +40007,84 @@ public class TLRPC { } } - public static class TL_inputMessagesFilterMyMentions extends MessagesFilter { - public static int constructor = 0xc1f8e69a; + public static class TL_inputMessagesFilterMyMentions extends MessagesFilter { + public static int constructor = 0xc1f8e69a; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterRoundVoice extends MessagesFilter { - public static int constructor = 0x7a7c17a4; + public static class TL_inputMessagesFilterRoundVoice extends MessagesFilter { + public static int constructor = 0x7a7c17a4; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterVoice extends MessagesFilter { - public static int constructor = 0x50f5c392; + public static class TL_inputMessagesFilterVoice extends MessagesFilter { + public static int constructor = 0x50f5c392; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterContacts extends MessagesFilter { - public static int constructor = 0xe062db83; + public static class TL_inputMessagesFilterContacts extends MessagesFilter { + public static int constructor = 0xe062db83; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterVideo extends MessagesFilter { - public static int constructor = 0x9fc00e65; + public static class TL_inputMessagesFilterVideo extends MessagesFilter { + public static int constructor = 0x9fc00e65; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterPhoneCalls extends MessagesFilter { - public static int constructor = 0x80c99768; + public static class TL_inputMessagesFilterPhoneCalls extends MessagesFilter { + public static int constructor = 0x80c99768; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - missed = (flags & 1) != 0; - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + missed = (flags & 1) != 0; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = missed ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = missed ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + } + } - public static class TL_inputMessagesFilterEmpty extends MessagesFilter { - public static int constructor = 0x57e2f66c; + public static class TL_inputMessagesFilterEmpty extends MessagesFilter { + public static int constructor = 0x57e2f66c; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputMessagesFilterRoundVideo extends MessagesFilter { - public static int constructor = 0xb549da53; + public static class TL_inputMessagesFilterRoundVideo extends MessagesFilter { + public static int constructor = 0xb549da53; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_phone_groupParticipants extends TLObject { public static int constructor = 0xf47751b6; @@ -39683,138 +40186,138 @@ public class TLRPC { } } - public static abstract class PageListOrderedItem extends TLObject { + public static abstract class PageListOrderedItem extends TLObject { - public static PageListOrderedItem TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - PageListOrderedItem result = null; - switch (constructor) { - case 0x5e068047: - result = new TL_pageListOrderedItemText(); - break; - case 0x98dd8936: - result = new TL_pageListOrderedItemBlocks(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in PageListOrderedItem", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static PageListOrderedItem TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + PageListOrderedItem result = null; + switch (constructor) { + case 0x5e068047: + result = new TL_pageListOrderedItemText(); + break; + case 0x98dd8936: + result = new TL_pageListOrderedItemBlocks(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in PageListOrderedItem", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_pageListOrderedItemText extends PageListOrderedItem { - public static int constructor = 0x5e068047; + public static class TL_pageListOrderedItemText extends PageListOrderedItem { + public static int constructor = 0x5e068047; - public String num; - public RichText text; + public String num; + public RichText text; - public void readParams(AbstractSerializedData stream, boolean exception) { - num = stream.readString(exception); - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + num = stream.readString(exception); + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(num); - text.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(num); + text.serializeToStream(stream); + } + } - public static class TL_pageListOrderedItemBlocks extends PageListOrderedItem { - public static int constructor = 0x98dd8936; + public static class TL_pageListOrderedItemBlocks extends PageListOrderedItem { + public static int constructor = 0x98dd8936; - public String num; - public ArrayList blocks = new ArrayList<>(); + public String num; + public ArrayList blocks = new ArrayList<>(); - public void readParams(AbstractSerializedData stream, boolean exception) { - num = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - blocks.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + num = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + blocks.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(num); - stream.writeInt32(0x1cb5c415); - int count = blocks.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - blocks.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(num); + stream.writeInt32(0x1cb5c415); + int count = blocks.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + blocks.get(a).serializeToStream(stream); + } + } + } - public static class TL_messages_messageEmpty extends TLObject { - public static int constructor = 0x3f4e0648; + public static class TL_messages_messageEmpty extends TLObject { + public static int constructor = 0x3f4e0648; - public static TL_messages_messageEmpty TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messages_messageEmpty.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messages_messageEmpty", constructor)); - } else { - return null; - } - } - TL_messages_messageEmpty result = new TL_messages_messageEmpty(); - result.readParams(stream, exception); - return result; - } + public static TL_messages_messageEmpty TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_messageEmpty.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_messageEmpty", constructor)); + } else { + return null; + } + } + TL_messages_messageEmpty result = new TL_messages_messageEmpty(); + result.readParams(stream, exception); + return result; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_secureCredentialsEncrypted extends TLObject { - public static int constructor = 0x33f0ea47; + public static class TL_secureCredentialsEncrypted extends TLObject { + public static int constructor = 0x33f0ea47; - public byte[] data; - public byte[] hash; - public byte[] secret; + public byte[] data; + public byte[] hash; + public byte[] secret; - public static TL_secureCredentialsEncrypted TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_secureCredentialsEncrypted.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_secureCredentialsEncrypted", constructor)); - } else { - return null; - } - } - TL_secureCredentialsEncrypted result = new TL_secureCredentialsEncrypted(); - result.readParams(stream, exception); - return result; - } + public static TL_secureCredentialsEncrypted TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_secureCredentialsEncrypted.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_secureCredentialsEncrypted", constructor)); + } else { + return null; + } + } + TL_secureCredentialsEncrypted result = new TL_secureCredentialsEncrypted(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - data = stream.readByteArray(exception); - hash = stream.readByteArray(exception); - secret = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + data = stream.readByteArray(exception); + hash = stream.readByteArray(exception); + secret = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(data); - stream.writeByteArray(hash); - stream.writeByteArray(secret); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(data); + stream.writeByteArray(hash); + stream.writeByteArray(secret); + } + } public static abstract class MessageFwdHeader extends TLObject { @@ -40318,38 +40821,38 @@ public class TLRPC { } } - public static abstract class messages_SavedGifs extends TLObject { - public long hash; - public ArrayList gifs = new ArrayList<>(); + public static abstract class messages_SavedGifs extends TLObject { + public long hash; + public ArrayList gifs = new ArrayList<>(); - public static messages_SavedGifs TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_SavedGifs result = null; - switch (constructor) { - case 0xe8025ca2: - result = new TL_messages_savedGifsNotModified(); - break; + public static messages_SavedGifs TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_SavedGifs result = null; + switch (constructor) { + case 0xe8025ca2: + result = new TL_messages_savedGifsNotModified(); + break; case 0x84a02a0d: result = new TL_messages_savedGifs(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_SavedGifs", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_SavedGifs", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messages_savedGifsNotModified extends messages_SavedGifs { - public static int constructor = 0xe8025ca2; + public static class TL_messages_savedGifsNotModified extends messages_SavedGifs { + public static int constructor = 0xe8025ca2; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messages_savedGifs extends messages_SavedGifs { public static int constructor = 0x84a02a0d; @@ -40386,36 +40889,36 @@ public class TLRPC { } } - public static abstract class PhotoSize extends TLObject { - public String type; - public FileLocation location; - public int w; - public int h; - public int size; - public byte[] bytes; + public static abstract class PhotoSize extends TLObject { + public String type; + public FileLocation location; + public int w; + public int h; + public int size; + public byte[] bytes; - public static PhotoSize TLdeserialize(long photo_id, long document_id, long sticker_set_id, AbstractSerializedData stream, int constructor, boolean exception) { - PhotoSize result = null; - switch (constructor) { + public static PhotoSize TLdeserialize(long photo_id, long document_id, long sticker_set_id, AbstractSerializedData stream, int constructor, boolean exception) { + PhotoSize result = null; + switch (constructor) { case 0xd8214d41: result = new TL_photoPathSize(); break; - case 0x77bfb61b: - result = new TL_photoSize_layer127(); - break; - case 0xe17e23c: - result = new TL_photoSizeEmpty(); - break; + case 0x77bfb61b: + result = new TL_photoSize_layer127(); + break; + case 0xe17e23c: + result = new TL_photoSizeEmpty(); + break; case 0x5aa86a51: result = new TL_photoSizeProgressive_layer127(); break; case 0xe0b0bc2e: result = new TL_photoStrippedSize(); break; - case 0xe9a734fa: - result = new TL_photoCachedSize_layer127(); - break; + case 0xe9a734fa: + result = new TL_photoCachedSize_layer127(); + break; case 0x75c78e60: result = new TL_photoSize(); break; @@ -40425,14 +40928,14 @@ public class TLRPC { case 0xfa3efb95: result = new TL_photoSizeProgressive(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in PhotoSize", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - if (result.location == null) { - if (!TextUtils.isEmpty(result.type) && (photo_id != 0 || document_id != 0 || sticker_set_id != 0)) { + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in PhotoSize", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + if (result.location == null) { + if (!TextUtils.isEmpty(result.type) && (photo_id != 0 || document_id != 0 || sticker_set_id != 0)) { result.location = new TL_fileLocationToBeDeprecated(); if (photo_id != 0) { result.location.volume_id = -photo_id; @@ -40448,10 +40951,10 @@ public class TLRPC { result.location = new TL_fileLocationUnavailable(); } } - } - return result; - } - } + } + return result; + } + } public static class TL_photoStrippedSize extends PhotoSize { public static int constructor = 0xe0b0bc2e; @@ -40510,63 +41013,63 @@ public class TLRPC { } } - public static class TL_photoSize_layer127 extends TL_photoSize { - public static int constructor = 0x77bfb61b; + public static class TL_photoSize_layer127 extends TL_photoSize { + public static int constructor = 0x77bfb61b; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = stream.readString(exception); - location = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - size = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = stream.readString(exception); + location = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + size = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(type); - location.serializeToStream(stream); - stream.writeInt32(w); - stream.writeInt32(h); - stream.writeInt32(size); - } - } - - public static class TL_photoSizeEmpty extends PhotoSize { - public static int constructor = 0xe17e23c; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - type = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(type); - } - } - - public static class TL_photoCachedSize_layer127 extends TL_photoCachedSize { - public static int constructor = 0xe9a734fa; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - type = stream.readString(exception); - location = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception); - w = stream.readInt32(exception); - h = stream.readInt32(exception); - bytes = stream.readByteArray(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(type); - location.serializeToStream(stream); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(type); + location.serializeToStream(stream); stream.writeInt32(w); - stream.writeInt32(h); + stream.writeInt32(h); + stream.writeInt32(size); + } + } + + public static class TL_photoSizeEmpty extends PhotoSize { + public static int constructor = 0xe17e23c; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + type = stream.readString(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(type); + } + } + + public static class TL_photoCachedSize_layer127 extends TL_photoCachedSize { + public static int constructor = 0xe9a734fa; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + type = stream.readString(exception); + location = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception); + w = stream.readInt32(exception); + h = stream.readInt32(exception); + bytes = stream.readByteArray(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(type); + location.serializeToStream(stream); + stream.writeInt32(w); + stream.writeInt32(h); stream.writeByteArray(bytes); - } - } + } + } public static class TL_photoSize extends PhotoSize { public static int constructor = 0x75c78e60; @@ -40873,178 +41376,178 @@ public class TLRPC { } } - public static abstract class InputFile extends TLObject { - public long id; - public int parts; - public String name; - public String md5_checksum; + public static abstract class InputFile extends TLObject { + public long id; + public int parts; + public String name; + public String md5_checksum; - public static InputFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - InputFile result = null; - switch (constructor) { - case 0xfa4f0bb5: - result = new TL_inputFileBig(); - break; - case 0xf52ff27f: - result = new TL_inputFile(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in InputFile", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static InputFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + InputFile result = null; + switch (constructor) { + case 0xfa4f0bb5: + result = new TL_inputFileBig(); + break; + case 0xf52ff27f: + result = new TL_inputFile(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in InputFile", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_inputFileBig extends InputFile { - public static int constructor = 0xfa4f0bb5; + public static class TL_inputFileBig extends InputFile { + public static int constructor = 0xfa4f0bb5; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - parts = stream.readInt32(exception); - name = stream.readString(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + parts = stream.readInt32(exception); + name = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt32(parts); - stream.writeString(name); - } - } - - public static class TL_inputFile extends InputFile { - public static int constructor = 0xf52ff27f; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - parts = stream.readInt32(exception); - name = stream.readString(exception); - md5_checksum = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt32(parts); - stream.writeString(name); - stream.writeString(md5_checksum); - } - } + stream.writeInt64(id); + stream.writeInt32(parts); + stream.writeString(name); + } + } - public static class TL_account_webAuthorizations extends TLObject { - public static int constructor = 0xed56c9fc; + public static class TL_inputFile extends InputFile { + public static int constructor = 0xf52ff27f; - public ArrayList authorizations = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); - public static TL_account_webAuthorizations TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_account_webAuthorizations.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_account_webAuthorizations", constructor)); - } else { - return null; - } - } - TL_account_webAuthorizations result = new TL_account_webAuthorizations(); - result.readParams(stream, exception); - return result; - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + parts = stream.readInt32(exception); + name = stream.readString(exception); + md5_checksum = stream.readString(exception); + } - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_webAuthorization object = TL_webAuthorization.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - authorizations.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt32(parts); + stream.writeString(name); + stream.writeString(md5_checksum); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = authorizations.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - authorizations.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - } - } + public static class TL_account_webAuthorizations extends TLObject { + public static int constructor = 0xed56c9fc; - public static class TL_updates_state extends TLObject { - public static int constructor = 0xa56c2a3e; + public ArrayList authorizations = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); - public int pts; - public int qts; - public int date; - public int seq; - public int unread_count; + public static TL_account_webAuthorizations TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_account_webAuthorizations.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_account_webAuthorizations", constructor)); + } else { + return null; + } + } + TL_account_webAuthorizations result = new TL_account_webAuthorizations(); + result.readParams(stream, exception); + return result; + } - public static TL_updates_state TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_updates_state.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_updates_state", constructor)); - } else { - return null; - } - } - TL_updates_state result = new TL_updates_state(); - result.readParams(stream, exception); - return result; - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_webAuthorization object = TL_webAuthorization.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + authorizations.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + } - public void readParams(AbstractSerializedData stream, boolean exception) { - pts = stream.readInt32(exception); - qts = stream.readInt32(exception); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = authorizations.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + authorizations.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + } + } + + public static class TL_updates_state extends TLObject { + public static int constructor = 0xa56c2a3e; + + public int pts; + public int qts; + public int date; + public int seq; + public int unread_count; + + public static TL_updates_state TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_updates_state.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_updates_state", constructor)); + } else { + return null; + } + } + TL_updates_state result = new TL_updates_state(); + result.readParams(stream, exception); + return result; + } + + public void readParams(AbstractSerializedData stream, boolean exception) { + pts = stream.readInt32(exception); + qts = stream.readInt32(exception); date = stream.readInt32(exception); - seq = stream.readInt32(exception); - unread_count = stream.readInt32(exception); - } + seq = stream.readInt32(exception); + unread_count = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt32(pts); + stream.writeInt32(pts); stream.writeInt32(qts); stream.writeInt32(date); - stream.writeInt32(seq); - stream.writeInt32(unread_count); - } - } + stream.writeInt32(seq); + stream.writeInt32(unread_count); + } + } public static class TL_reactionCount extends TLObject { public static int constructor = 0x6fb250d1; @@ -41083,6 +41586,74 @@ public class TLRPC { } } + public static abstract class messages_AvailableReactions extends TLObject { + + public static messages_AvailableReactions TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_AvailableReactions result = null; + switch (constructor) { + case 0x9f071957: + result = new TL_messages_availableReactionsNotModified(); + break; + case 0x768e3aad: + result = new TL_messages_availableReactions(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_AvailableReactions", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } + + public static class TL_messages_availableReactionsNotModified extends messages_AvailableReactions { + public static int constructor = 0x9f071957; + + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } + + public static class TL_messages_availableReactions extends messages_AvailableReactions { + public static int constructor = 0x768e3aad; + + public int hash; + public ArrayList reactions = new ArrayList<>(); + + public void readParams(AbstractSerializedData stream, boolean exception) { + hash = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_availableReaction object = TL_availableReaction.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + reactions.add(object); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(hash); + stream.writeInt32(0x1cb5c415); + int count = reactions.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + reactions.get(a).serializeToStream(stream); + } + } + } + public static abstract class UserFull extends TLObject { public int flags; @@ -41543,36 +42114,36 @@ public class TLRPC { } } - public static abstract class Updates extends TLObject { - public ArrayList updates = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); - public ArrayList chats = new ArrayList<>(); - public int date; - public int seq; - public int flags; - public boolean out; - public boolean mentioned; - public boolean media_unread; - public boolean silent; - public int id; - public long user_id; - public String message; - public int pts; - public int pts_count; - public MessageFwdHeader fwd_from; - public long via_bot_id; + public static abstract class Updates extends TLObject { + public ArrayList updates = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); + public ArrayList chats = new ArrayList<>(); + public int date; + public int seq; + public int flags; + public boolean out; + public boolean mentioned; + public boolean media_unread; + public boolean silent; + public int id; + public long user_id; + public String message; + public int pts; + public int pts_count; + public MessageFwdHeader fwd_from; + public long via_bot_id; public TL_messageReplyHeader reply_to; - public ArrayList entities = new ArrayList<>(); - public MessageMedia media; - public Update update; - public long from_id; - public long chat_id; - public int seq_start; + public ArrayList entities = new ArrayList<>(); + public MessageMedia media; + public Update update; + public long from_id; + public long chat_id; + public int seq_start; public int ttl_period; - public static Updates TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - Updates result = null; - switch (constructor) { + public static Updates TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + Updates result = null; + switch (constructor) { case 0x74ae4240: result = new TL_updates(); break; @@ -41594,71 +42165,71 @@ public class TLRPC { case 0xe317af7e: result = new TL_updatesTooLong(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in Updates", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in Updates", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_updates extends Updates { - public static int constructor = 0x74ae4240; + public static class TL_updates extends Updates { + public static int constructor = 0x74ae4240; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Update object = Update.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - updates.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - date = stream.readInt32(exception); - seq = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Update object = Update.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + updates.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + date = stream.readInt32(exception); + seq = stream.readInt32(exception); + } + } public static class TL_updateShortMessage extends Updates { public static int constructor = 0x313bc7f8; @@ -41745,15 +42316,15 @@ public class TLRPC { } } - public static class TL_updateShort extends Updates { - public static int constructor = 0x78d4dec1; + public static class TL_updateShort extends Updates { + public static int constructor = 0x78d4dec1; - public void readParams(AbstractSerializedData stream, boolean exception) { - update = Update.TLdeserialize(stream, stream.readInt32(exception), exception); - date = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + update = Update.TLdeserialize(stream, stream.readInt32(exception), exception); + date = stream.readInt32(exception); + } + } public static class TL_updateShortChatMessage extends Updates { public static int constructor = 0x4d6deea5; @@ -41804,65 +42375,65 @@ public class TLRPC { } } - public static class TL_updatesCombined extends Updates { - public static int constructor = 0x725b04c3; + public static class TL_updatesCombined extends Updates { + public static int constructor = 0x725b04c3; - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Update object = Update.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - updates.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - date = stream.readInt32(exception); - seq_start = stream.readInt32(exception); - seq = stream.readInt32(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Update object = Update.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + updates.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + date = stream.readInt32(exception); + seq_start = stream.readInt32(exception); + seq = stream.readInt32(exception); + } + } - public static class TL_updatesTooLong extends Updates { - public static int constructor = 0xe317af7e; - } + public static class TL_updatesTooLong extends Updates { + public static int constructor = 0xe317af7e; + } public static abstract class WallPaper extends TLObject { @@ -42015,184 +42586,184 @@ public class TLRPC { } } - public static class TL_paymentSavedCredentialsCard extends TLObject { - public static int constructor = 0xcdc27a1f; + public static class TL_paymentSavedCredentialsCard extends TLObject { + public static int constructor = 0xcdc27a1f; - public String id; - public String title; + public String id; + public String title; - public static TL_paymentSavedCredentialsCard TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_paymentSavedCredentialsCard.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_paymentSavedCredentialsCard", constructor)); - } else { - return null; - } - } - TL_paymentSavedCredentialsCard result = new TL_paymentSavedCredentialsCard(); - result.readParams(stream, exception); - return result; - } - - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readString(exception); - title = stream.readString(exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(id); - stream.writeString(title); - } - } - - public static abstract class PageListItem extends TLObject { - - public static PageListItem TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - PageListItem result = null; - switch (constructor) { - case 0x25e073fc: - result = new TL_pageListItemBlocks(); - break; - case 0xb92fb6cd: - result = new TL_pageListItemText(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in PageListItem", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } - - public static class TL_pageListItemBlocks extends PageListItem { - public static int constructor = 0x25e073fc; - - public ArrayList blocks = new ArrayList<>(); - - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - blocks.add(object); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = blocks.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - blocks.get(a).serializeToStream(stream); - } - } - } - - public static class TL_pageListItemText extends PageListItem { - public static int constructor = 0xb92fb6cd; - - public RichText text; - - public void readParams(AbstractSerializedData stream, boolean exception) { - text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - text.serializeToStream(stream); - } - } - - public static class TL_stickerPack extends TLObject { - public static int constructor = 0x12b299d4; - - public String emoticon; - public ArrayList documents = new ArrayList<>(); - - public static TL_stickerPack TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_stickerPack.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_stickerPack", constructor)); - } else { - return null; - } - } - TL_stickerPack result = new TL_stickerPack(); - result.readParams(stream, exception); - return result; + public static TL_paymentSavedCredentialsCard TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_paymentSavedCredentialsCard.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_paymentSavedCredentialsCard", constructor)); + } else { + return null; + } + } + TL_paymentSavedCredentialsCard result = new TL_paymentSavedCredentialsCard(); + result.readParams(stream, exception); + return result; } public void readParams(AbstractSerializedData stream, boolean exception) { - emoticon = stream.readString(exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - documents.add(stream.readInt64(exception)); - } - } + id = stream.readString(exception); + title = stream.readString(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(emoticon); - stream.writeInt32(0x1cb5c415); - int count = documents.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt64(documents.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(id); + stream.writeString(title); + } + } - public static class TL_inputEncryptedChat extends TLObject { - public static int constructor = 0xf141b5e1; + public static abstract class PageListItem extends TLObject { - public int chat_id; - public long access_hash; + public static PageListItem TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + PageListItem result = null; + switch (constructor) { + case 0x25e073fc: + result = new TL_pageListItemBlocks(); + break; + case 0xb92fb6cd: + result = new TL_pageListItemText(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in PageListItem", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static TL_inputEncryptedChat TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_inputEncryptedChat.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_inputEncryptedChat", constructor)); - } else { - return null; - } - } - TL_inputEncryptedChat result = new TL_inputEncryptedChat(); - result.readParams(stream, exception); - return result; + public static class TL_pageListItemBlocks extends PageListItem { + public static int constructor = 0x25e073fc; + + public ArrayList blocks = new ArrayList<>(); + + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + PageBlock object = PageBlock.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + blocks.add(object); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = blocks.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + blocks.get(a).serializeToStream(stream); + } + } + } + + public static class TL_pageListItemText extends PageListItem { + public static int constructor = 0xb92fb6cd; + + public RichText text; + + public void readParams(AbstractSerializedData stream, boolean exception) { + text = RichText.TLdeserialize(stream, stream.readInt32(exception), exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + text.serializeToStream(stream); + } + } + + public static class TL_stickerPack extends TLObject { + public static int constructor = 0x12b299d4; + + public String emoticon; + public ArrayList documents = new ArrayList<>(); + + public static TL_stickerPack TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_stickerPack.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_stickerPack", constructor)); + } else { + return null; + } + } + TL_stickerPack result = new TL_stickerPack(); + result.readParams(stream, exception); + return result; } public void readParams(AbstractSerializedData stream, boolean exception) { - chat_id = stream.readInt32(exception); - access_hash = stream.readInt64(exception); - } + emoticon = stream.readString(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + documents.add(stream.readInt64(exception)); + } + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(emoticon); + stream.writeInt32(0x1cb5c415); + int count = documents.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt64(documents.get(a)); + } + } + } + + public static class TL_inputEncryptedChat extends TLObject { + public static int constructor = 0xf141b5e1; + + public int chat_id; + public long access_hash; + + public static TL_inputEncryptedChat TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_inputEncryptedChat.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_inputEncryptedChat", constructor)); + } else { + return null; + } + } + TL_inputEncryptedChat result = new TL_inputEncryptedChat(); + result.readParams(stream, exception); + return result; + } + + public void readParams(AbstractSerializedData stream, boolean exception) { + chat_id = stream.readInt32(exception); + access_hash = stream.readInt64(exception); + } + + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); stream.writeInt32(chat_id); - stream.writeInt64(access_hash); - } - } + stream.writeInt64(access_hash); + } + } public static abstract class InputChatPhoto extends TLObject { @@ -42279,129 +42850,211 @@ public class TLRPC { } } - public static class TL_nearestDc extends TLObject { - public static int constructor = 0x8e1a1775; + public static class TL_nearestDc extends TLObject { + public static int constructor = 0x8e1a1775; - public String country; - public int this_dc; - public int nearest_dc; + public String country; + public int this_dc; + public int nearest_dc; - public static TL_nearestDc TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_nearestDc.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_nearestDc", constructor)); - } else { - return null; - } - } - TL_nearestDc result = new TL_nearestDc(); - result.readParams(stream, exception); - return result; - } + public static TL_nearestDc TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_nearestDc.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_nearestDc", constructor)); + } else { + return null; + } + } + TL_nearestDc result = new TL_nearestDc(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { + public void readParams(AbstractSerializedData stream, boolean exception) { country = stream.readString(exception); - this_dc = stream.readInt32(exception); - nearest_dc = stream.readInt32(exception); - } + this_dc = stream.readInt32(exception); + nearest_dc = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); stream.writeString(country); - stream.writeInt32(this_dc); - stream.writeInt32(nearest_dc); - } - } + stream.writeInt32(this_dc); + stream.writeInt32(nearest_dc); + } + } - public static class TL_payments_savedInfo extends TLObject { - public static int constructor = 0xfb8fe43c; + public static class TL_payments_savedInfo extends TLObject { + public static int constructor = 0xfb8fe43c; - public int flags; - public boolean has_saved_credentials; - public TL_paymentRequestedInfo saved_info; + public int flags; + public boolean has_saved_credentials; + public TL_paymentRequestedInfo saved_info; - public static TL_payments_savedInfo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_payments_savedInfo.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_payments_savedInfo", constructor)); - } else { - return null; - } - } - TL_payments_savedInfo result = new TL_payments_savedInfo(); - result.readParams(stream, exception); - return result; - } + public static TL_payments_savedInfo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_payments_savedInfo.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_payments_savedInfo", constructor)); + } else { + return null; + } + } + TL_payments_savedInfo result = new TL_payments_savedInfo(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - has_saved_credentials = (flags & 2) != 0; - if ((flags & 1) != 0) { - saved_info = TL_paymentRequestedInfo.TLdeserialize(stream, stream.readInt32(exception), exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + has_saved_credentials = (flags & 2) != 0; + if ((flags & 1) != 0) { + saved_info = TL_paymentRequestedInfo.TLdeserialize(stream, stream.readInt32(exception), exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = has_saved_credentials ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - saved_info.serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = has_saved_credentials ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + saved_info.serializeToStream(stream); + } + } + } - public static abstract class InputPhoto extends TLObject { - public long id; - public long access_hash; - public byte[] file_reference; + public static abstract class InputPhoto extends TLObject { + public long id; + public long access_hash; + public byte[] file_reference; - public static InputPhoto TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - InputPhoto result = null; - switch (constructor) { - case 0x1cd7bf0d: - result = new TL_inputPhotoEmpty(); - break; - case 0x3bb3b94a: - result = new TL_inputPhoto(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in InputPhoto", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static InputPhoto TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + InputPhoto result = null; + switch (constructor) { + case 0x1cd7bf0d: + result = new TL_inputPhotoEmpty(); + break; + case 0x3bb3b94a: + result = new TL_inputPhoto(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in InputPhoto", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_inputPhotoEmpty extends InputPhoto { - public static int constructor = 0x1cd7bf0d; + public static class TL_inputPhotoEmpty extends InputPhoto { + public static int constructor = 0x1cd7bf0d; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_inputPhoto extends InputPhoto { - public static int constructor = 0x3bb3b94a; + public static class TL_inputPhoto extends InputPhoto { + public static int constructor = 0x3bb3b94a; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt64(exception); - access_hash = stream.readInt64(exception); - file_reference = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt64(exception); + access_hash = stream.readInt64(exception); + file_reference = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(id); - stream.writeInt64(access_hash); - stream.writeByteArray(file_reference); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(id); + stream.writeInt64(access_hash); + stream.writeByteArray(file_reference); + } + } + + public static class TL_messages_messageReactionsList extends TLObject { + public static int constructor = 0xa366923c; + + public int flags; + public int count; + public ArrayList reactions = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); + public String next_offset; + + public static TL_messages_messageReactionsList TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_messageReactionsList.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_messageReactionsList", constructor)); + } else { + return null; + } + } + TL_messages_messageReactionsList result = new TL_messages_messageReactionsList(); + result.readParams(stream, exception); + return result; + } + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + count = stream.readInt32(exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_messageUserReaction object = TL_messageUserReaction.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + reactions.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + if ((flags & 1) != 0) { + next_offset = stream.readString(exception); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeInt32(count); + stream.writeInt32(0x1cb5c415); + int count = reactions.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + reactions.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + if ((flags & 1) != 0) { + stream.writeString(next_offset); + } + } + } public static class TL_importedContact extends TLObject { public static int constructor = 0xc13e3c50; @@ -42462,27 +43115,27 @@ public class TLRPC { } } - public static abstract class messages_RecentStickers extends TLObject { + public static abstract class messages_RecentStickers extends TLObject { - public static messages_RecentStickers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_RecentStickers result = null; - switch (constructor) { + public static messages_RecentStickers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_RecentStickers result = null; + switch (constructor) { case 0x88d37c56: result = new TL_messages_recentStickers(); break; - case 0xb17f890: - result = new TL_messages_recentStickersNotModified(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_RecentStickers", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0xb17f890: + result = new TL_messages_recentStickersNotModified(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_RecentStickers", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } public static class TL_messages_recentStickers extends messages_RecentStickers { public static int constructor = 0x88d37c56; @@ -42561,14 +43214,14 @@ public class TLRPC { } } - public static class TL_messages_recentStickersNotModified extends messages_RecentStickers { - public static int constructor = 0xb17f890; + public static class TL_messages_recentStickersNotModified extends messages_RecentStickers { + public static int constructor = 0xb17f890; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_pageRelatedArticle extends TLObject { public static int constructor = 0xb390dc08; @@ -42639,64 +43292,64 @@ public class TLRPC { } } - public static class TL_accountDaysTTL extends TLObject { - public static int constructor = 0xb8d0afdf; + public static class TL_accountDaysTTL extends TLObject { + public static int constructor = 0xb8d0afdf; - public int days; + public int days; - public static TL_accountDaysTTL TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_accountDaysTTL.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_accountDaysTTL", constructor)); - } else { - return null; - } - } - TL_accountDaysTTL result = new TL_accountDaysTTL(); - result.readParams(stream, exception); - return result; - } + public static TL_accountDaysTTL TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_accountDaysTTL.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_accountDaysTTL", constructor)); + } else { + return null; + } + } + TL_accountDaysTTL result = new TL_accountDaysTTL(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - days = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + days = stream.readInt32(exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(days); - } - } + stream.writeInt32(constructor); + stream.writeInt32(days); + } + } - public static abstract class messages_Stickers extends TLObject { + public static abstract class messages_Stickers extends TLObject { - public static messages_Stickers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - messages_Stickers result = null; - switch (constructor) { - case 0xf1749a22: - result = new TL_messages_stickersNotModified(); - break; + public static messages_Stickers TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + messages_Stickers result = null; + switch (constructor) { + case 0xf1749a22: + result = new TL_messages_stickersNotModified(); + break; case 0x30a6ec7e: result = new TL_messages_stickers(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in messages_Stickers", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in messages_Stickers", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_messages_stickersNotModified extends messages_Stickers { - public static int constructor = 0xf1749a22; + public static class TL_messages_stickersNotModified extends messages_Stickers { + public static int constructor = 0xf1749a22; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messages_stickers extends messages_Stickers { public static int constructor = 0x30a6ec7e; @@ -42976,54 +43629,54 @@ public class TLRPC { } } - public static abstract class help_PassportConfig extends TLObject { + public static abstract class help_PassportConfig extends TLObject { - public static help_PassportConfig TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - help_PassportConfig result = null; - switch (constructor) { - case 0xbfb9f457: - result = new TL_help_passportConfigNotModified(); - break; - case 0xa098d6af: - result = new TL_help_passportConfig(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in help_PassportConfig", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static help_PassportConfig TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + help_PassportConfig result = null; + switch (constructor) { + case 0xbfb9f457: + result = new TL_help_passportConfigNotModified(); + break; + case 0xa098d6af: + result = new TL_help_passportConfig(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in help_PassportConfig", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_help_passportConfigNotModified extends help_PassportConfig { - public static int constructor = 0xbfb9f457; + public static class TL_help_passportConfigNotModified extends help_PassportConfig { + public static int constructor = 0xbfb9f457; - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_help_passportConfig extends help_PassportConfig { - public static int constructor = 0xa098d6af; + public static class TL_help_passportConfig extends help_PassportConfig { + public static int constructor = 0xa098d6af; - public int hash; - public TL_dataJSON countries_langs; + public int hash; + public TL_dataJSON countries_langs; - public void readParams(AbstractSerializedData stream, boolean exception) { - hash = stream.readInt32(exception); - countries_langs = TL_dataJSON.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + hash = stream.readInt32(exception); + countries_langs = TL_dataJSON.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(hash); - countries_langs.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(hash); + countries_langs.serializeToStream(stream); + } + } public static class TL_phone_exportedGroupCallInvite extends TLObject { public static int constructor = 0x204bd158; @@ -43053,174 +43706,174 @@ public class TLRPC { } } - public static class TL_account_passwordInputSettings extends TLObject { - public static int constructor = 0xc23727c9; + public static class TL_account_passwordInputSettings extends TLObject { + public static int constructor = 0xc23727c9; - public int flags; - public PasswordKdfAlgo new_algo; - public byte[] new_password_hash; - public String hint; - public String email; - public TL_secureSecretSettings new_secure_settings; + public int flags; + public PasswordKdfAlgo new_algo; + public byte[] new_password_hash; + public String hint; + public String email; + public TL_secureSecretSettings new_secure_settings; - public static TL_account_passwordInputSettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_account_passwordInputSettings.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_account_passwordInputSettings", constructor)); - } else { - return null; - } - } - TL_account_passwordInputSettings result = new TL_account_passwordInputSettings(); - result.readParams(stream, exception); - return result; - } + public static TL_account_passwordInputSettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_account_passwordInputSettings.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_account_passwordInputSettings", constructor)); + } else { + return null; + } + } + TL_account_passwordInputSettings result = new TL_account_passwordInputSettings(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - if ((flags & 1) != 0) { - new_algo = PasswordKdfAlgo.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 1) != 0) { - new_password_hash = stream.readByteArray(exception); - } - if ((flags & 1) != 0) { - hint = stream.readString(exception); - } - if ((flags & 2) != 0) { - email = stream.readString(exception); - } - if ((flags & 4) != 0) { - new_secure_settings = TL_secureSecretSettings.TLdeserialize(stream, stream.readInt32(exception), exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + if ((flags & 1) != 0) { + new_algo = PasswordKdfAlgo.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 1) != 0) { + new_password_hash = stream.readByteArray(exception); + } + if ((flags & 1) != 0) { + hint = stream.readString(exception); + } + if ((flags & 2) != 0) { + email = stream.readString(exception); + } + if ((flags & 4) != 0) { + new_secure_settings = TL_secureSecretSettings.TLdeserialize(stream, stream.readInt32(exception), exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - new_algo.serializeToStream(stream); - } - if ((flags & 1) != 0) { - stream.writeByteArray(new_password_hash); - } - if ((flags & 1) != 0) { - stream.writeString(hint); - } - if ((flags & 2) != 0) { - stream.writeString(email); - } - if ((flags & 4) != 0) { - new_secure_settings.serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + new_algo.serializeToStream(stream); + } + if ((flags & 1) != 0) { + stream.writeByteArray(new_password_hash); + } + if ((flags & 1) != 0) { + stream.writeString(hint); + } + if ((flags & 2) != 0) { + stream.writeString(email); + } + if ((flags & 4) != 0) { + new_secure_settings.serializeToStream(stream); + } + } + } - public static class TL_dcOption extends TLObject { - public static int constructor = 0x18b7a10d; + public static class TL_dcOption extends TLObject { + public static int constructor = 0x18b7a10d; - public int flags; - public boolean ipv6; - public boolean media_only; - public boolean tcpo_only; - public boolean cdn; - public boolean isStatic; - public int id; - public String ip_address; - public int port; - public byte[] secret; + public int flags; + public boolean ipv6; + public boolean media_only; + public boolean tcpo_only; + public boolean cdn; + public boolean isStatic; + public int id; + public String ip_address; + public int port; + public byte[] secret; - public static TL_dcOption TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_dcOption.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_dcOption", constructor)); - } else { - return null; - } - } - TL_dcOption result = new TL_dcOption(); - result.readParams(stream, exception); - return result; - } + public static TL_dcOption TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_dcOption.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_dcOption", constructor)); + } else { + return null; + } + } + TL_dcOption result = new TL_dcOption(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - ipv6 = (flags & 1) != 0; - media_only = (flags & 2) != 0; - tcpo_only = (flags & 4) != 0; - cdn = (flags & 8) != 0; - isStatic = (flags & 16) != 0; - id = stream.readInt32(exception); - ip_address = stream.readString(exception); - port = stream.readInt32(exception); - if ((flags & 1024) != 0) { - secret = stream.readByteArray(exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + ipv6 = (flags & 1) != 0; + media_only = (flags & 2) != 0; + tcpo_only = (flags & 4) != 0; + cdn = (flags & 8) != 0; + isStatic = (flags & 16) != 0; + id = stream.readInt32(exception); + ip_address = stream.readString(exception); + port = stream.readInt32(exception); + if ((flags & 1024) != 0) { + secret = stream.readByteArray(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = ipv6 ? (flags | 1) : (flags &~ 1); - flags = media_only ? (flags | 2) : (flags &~ 2); - flags = tcpo_only ? (flags | 4) : (flags &~ 4); - flags = cdn ? (flags | 8) : (flags &~ 8); - flags = isStatic ? (flags | 16) : (flags &~ 16); - stream.writeInt32(flags); - stream.writeInt32(id); - stream.writeString(ip_address); - stream.writeInt32(port); - if ((flags & 1024) != 0) { - stream.writeByteArray(secret); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = ipv6 ? (flags | 1) : (flags &~ 1); + flags = media_only ? (flags | 2) : (flags &~ 2); + flags = tcpo_only ? (flags | 4) : (flags &~ 4); + flags = cdn ? (flags | 8) : (flags &~ 8); + flags = isStatic ? (flags | 16) : (flags &~ 16); + stream.writeInt32(flags); + stream.writeInt32(id); + stream.writeString(ip_address); + stream.writeInt32(port); + if ((flags & 1024) != 0) { + stream.writeByteArray(secret); + } + } + } - public static class TL_pageTableRow extends TLObject { - public static int constructor = 0xe0c0c5e5; + public static class TL_pageTableRow extends TLObject { + public static int constructor = 0xe0c0c5e5; - public ArrayList cells = new ArrayList<>(); + public ArrayList cells = new ArrayList<>(); - public static TL_pageTableRow TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_pageTableRow.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_pageTableRow", constructor)); - } else { - return null; - } - } - TL_pageTableRow result = new TL_pageTableRow(); - result.readParams(stream, exception); - return result; - } + public static TL_pageTableRow TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_pageTableRow.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_pageTableRow", constructor)); + } else { + return null; + } + } + TL_pageTableRow result = new TL_pageTableRow(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - TL_pageTableCell object = TL_pageTableCell.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - cells.add(object); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_pageTableCell object = TL_pageTableCell.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + cells.add(object); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = cells.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - cells.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = cells.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + cells.get(a).serializeToStream(stream); + } + } + } public static class TL_emojiURL extends TLObject { public static int constructor = 0xa575739d; @@ -43250,45 +43903,45 @@ public class TLRPC { } } - public static class TL_decryptedMessageLayer extends TLObject { - public static int constructor = 0x1be31789; + public static class TL_decryptedMessageLayer extends TLObject { + public static int constructor = 0x1be31789; - public byte[] random_bytes; - public int layer; - public int in_seq_no; - public int out_seq_no; - public DecryptedMessage message; + public byte[] random_bytes; + public int layer; + public int in_seq_no; + public int out_seq_no; + public DecryptedMessage message; - public static TL_decryptedMessageLayer TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_decryptedMessageLayer.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_decryptedMessageLayer", constructor)); - } else { - return null; - } - } - TL_decryptedMessageLayer result = new TL_decryptedMessageLayer(); - result.readParams(stream, exception); - return result; - } + public static TL_decryptedMessageLayer TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_decryptedMessageLayer.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_decryptedMessageLayer", constructor)); + } else { + return null; + } + } + TL_decryptedMessageLayer result = new TL_decryptedMessageLayer(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - random_bytes = stream.readByteArray(exception); - layer = stream.readInt32(exception); + public void readParams(AbstractSerializedData stream, boolean exception) { + random_bytes = stream.readByteArray(exception); + layer = stream.readInt32(exception); in_seq_no = stream.readInt32(exception); out_seq_no = stream.readInt32(exception); - message = DecryptedMessage.TLdeserialize(stream, stream.readInt32(exception), exception); - } + message = DecryptedMessage.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(random_bytes); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(random_bytes); stream.writeInt32(layer); - stream.writeInt32(in_seq_no); - stream.writeInt32(out_seq_no); - message.serializeToStream(stream); - } - } + stream.writeInt32(in_seq_no); + stream.writeInt32(out_seq_no); + message.serializeToStream(stream); + } + } public static class TL_groupCallParticipant extends TLObject { public static int constructor = 0xeba636fe; @@ -43413,186 +44066,186 @@ public class TLRPC { } } - public static class TL_fileHash extends TLObject { - public static int constructor = 0x6242c773; + public static class TL_fileHash extends TLObject { + public static int constructor = 0x6242c773; - public int offset; - public int limit; - public byte[] hash; + public int offset; + public int limit; + public byte[] hash; - public static TL_fileHash TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_fileHash.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_fileHash", constructor)); - } else { - return null; - } - } - TL_fileHash result = new TL_fileHash(); - result.readParams(stream, exception); - return result; - } + public static TL_fileHash TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_fileHash.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_fileHash", constructor)); + } else { + return null; + } + } + TL_fileHash result = new TL_fileHash(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - offset = stream.readInt32(exception); - limit = stream.readInt32(exception); - hash = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + offset = stream.readInt32(exception); + limit = stream.readInt32(exception); + hash = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(limit); - stream.writeByteArray(hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(offset); + stream.writeInt32(limit); + stream.writeByteArray(hash); + } + } - public static class TL_messages_peerDialogs extends TLObject { - public static int constructor = 0x3371c354; + public static class TL_messages_peerDialogs extends TLObject { + public static int constructor = 0x3371c354; - public ArrayList

dialogs = new ArrayList<>(); - public ArrayList messages = new ArrayList<>(); - public ArrayList chats = new ArrayList<>(); - public ArrayList users = new ArrayList<>(); - public TL_updates_state state; + public ArrayList dialogs = new ArrayList<>(); + public ArrayList messages = new ArrayList<>(); + public ArrayList chats = new ArrayList<>(); + public ArrayList users = new ArrayList<>(); + public TL_updates_state state; - public static TL_messages_peerDialogs TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messages_peerDialogs.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messages_peerDialogs", constructor)); - } else { - return null; - } - } - TL_messages_peerDialogs result = new TL_messages_peerDialogs(); - result.readParams(stream, exception); - return result; - } + public static TL_messages_peerDialogs TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_peerDialogs.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_peerDialogs", constructor)); + } else { + return null; + } + } + TL_messages_peerDialogs result = new TL_messages_peerDialogs(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Dialog object = Dialog.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - dialogs.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Message object = Message.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - messages.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - chats.add(object); - } - magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - users.add(object); - } - state = TL_updates_state.TLdeserialize(stream, stream.readInt32(exception), exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Dialog object = Dialog.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + dialogs.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Message object = Message.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + messages.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + chats.add(object); + } + magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + users.add(object); + } + state = TL_updates_state.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = dialogs.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - dialogs.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = messages.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - messages.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = chats.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - chats.get(a).serializeToStream(stream); - } - stream.writeInt32(0x1cb5c415); - count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - state.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = dialogs.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + dialogs.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = messages.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + messages.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = chats.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + chats.get(a).serializeToStream(stream); + } + stream.writeInt32(0x1cb5c415); + count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + state.serializeToStream(stream); + } + } - public static class TL_topPeer extends TLObject { - public static int constructor = 0xedcdc05b; + public static class TL_topPeer extends TLObject { + public static int constructor = 0xedcdc05b; - public Peer peer; - public double rating; + public Peer peer; + public double rating; - public static TL_topPeer TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_topPeer.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_topPeer", constructor)); - } else { - return null; - } - } - TL_topPeer result = new TL_topPeer(); - result.readParams(stream, exception); - return result; - } + public static TL_topPeer TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_topPeer.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_topPeer", constructor)); + } else { + return null; + } + } + TL_topPeer result = new TL_topPeer(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - peer = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - rating = stream.readDouble(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + peer = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + rating = stream.readDouble(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - stream.writeDouble(rating); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + stream.writeDouble(rating); + } + } public static abstract class account_ResetPasswordResult extends TLObject { @@ -43944,61 +44597,61 @@ public class TLRPC { } } - public static class TL_paymentRequestedInfo extends TLObject { - public static int constructor = 0x909c3f94; + public static class TL_paymentRequestedInfo extends TLObject { + public static int constructor = 0x909c3f94; - public int flags; - public String name; - public String phone; - public String email; - public TL_postAddress shipping_address; + public int flags; + public String name; + public String phone; + public String email; + public TL_postAddress shipping_address; - public static TL_paymentRequestedInfo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_paymentRequestedInfo.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_paymentRequestedInfo", constructor)); - } else { - return null; - } - } - TL_paymentRequestedInfo result = new TL_paymentRequestedInfo(); - result.readParams(stream, exception); - return result; - } + public static TL_paymentRequestedInfo TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_paymentRequestedInfo.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_paymentRequestedInfo", constructor)); + } else { + return null; + } + } + TL_paymentRequestedInfo result = new TL_paymentRequestedInfo(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - if ((flags & 1) != 0) { - name = stream.readString(exception); - } - if ((flags & 2) != 0) { - phone = stream.readString(exception); - } - if ((flags & 4) != 0) { - email = stream.readString(exception); - } - if ((flags & 8) != 0) { - shipping_address = TL_postAddress.TLdeserialize(stream, stream.readInt32(exception), exception); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + if ((flags & 1) != 0) { + name = stream.readString(exception); + } + if ((flags & 2) != 0) { + phone = stream.readString(exception); + } + if ((flags & 4) != 0) { + email = stream.readString(exception); + } + if ((flags & 8) != 0) { + shipping_address = TL_postAddress.TLdeserialize(stream, stream.readInt32(exception), exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - stream.writeString(name); - } - if ((flags & 2) != 0) { - stream.writeString(phone); - } - if ((flags & 4) != 0) { - stream.writeString(email); - } - if ((flags & 8) != 0) { - shipping_address.serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + stream.writeString(name); + } + if ((flags & 2) != 0) { + stream.writeString(phone); + } + if ((flags & 4) != 0) { + stream.writeString(email); + } + if ((flags & 8) != 0) { + shipping_address.serializeToStream(stream); + } + } + } public static class TL_auth_sendCode extends TLObject { public static int constructor = 0xa677244f; @@ -44042,24 +44695,24 @@ public class TLRPC { } } - public static class TL_auth_signIn extends TLObject { - public static int constructor = 0xbcd51581; + public static class TL_auth_signIn extends TLObject { + public static int constructor = 0xbcd51581; - public String phone_number; - public String phone_code_hash; - public String phone_code; + public String phone_number; + public String phone_code_hash; + public String phone_code; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return auth_Authorization.TLdeserialize(stream, constructor, exception); + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return auth_Authorization.TLdeserialize(stream, constructor, exception); } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(phone_number); - stream.writeString(phone_code_hash); - stream.writeString(phone_code); - } - } + stream.writeInt32(constructor); + stream.writeString(phone_number); + stream.writeString(phone_code_hash); + stream.writeString(phone_code); + } + } public static class TL_auth_logOut extends TLObject { public static int constructor = 0x3e72ba19; @@ -44074,33 +44727,33 @@ public class TLRPC { } } - public static class TL_auth_resetAuthorizations extends TLObject { - public static int constructor = 0x9fab0d1a; + public static class TL_auth_resetAuthorizations extends TLObject { + public static int constructor = 0x9fab0d1a; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } - - public static class TL_auth_exportAuthorization extends TLObject { - public static int constructor = 0xe5bfffcd; - - public int dc_id; - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_auth_exportedAuthorization.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(dc_id); - } - } + stream.writeInt32(constructor); + } + } + + public static class TL_auth_exportAuthorization extends TLObject { + public static int constructor = 0xe5bfffcd; + + public int dc_id; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_auth_exportedAuthorization.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(dc_id); + } + } public static class TL_auth_importAuthorization extends TLObject { public static int constructor = 0xa57a7dad; @@ -44244,92 +44897,92 @@ public class TLRPC { } } - public static class TL_account_updateNotifySettings extends TLObject { - public static int constructor = 0x84be5b93; + public static class TL_account_updateNotifySettings extends TLObject { + public static int constructor = 0x84be5b93; - public InputNotifyPeer peer; - public TL_inputPeerNotifySettings settings; + public InputNotifyPeer peer; + public TL_inputPeerNotifySettings settings; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - settings.serializeToStream(stream); - } - } - - public static class TL_account_getNotifySettings extends TLObject { - public static int constructor = 0x12b3ad31; - - public InputNotifyPeer peer; - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return PeerNotifySettings.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - } - } + stream.writeInt32(constructor); + peer.serializeToStream(stream); + settings.serializeToStream(stream); + } + } - public static class TL_account_resetNotifySettings extends TLObject { - public static int constructor = 0xdb7e1747; + public static class TL_account_getNotifySettings extends TLObject { + public static int constructor = 0x12b3ad31; + public InputNotifyPeer peer; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return PeerNotifySettings.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + stream.writeInt32(constructor); + peer.serializeToStream(stream); + } + } - public static class TL_account_updateProfile extends TLObject { - public static int constructor = 0x78515775; + public static class TL_account_resetNotifySettings extends TLObject { + public static int constructor = 0xdb7e1747; - public int flags; - public String first_name; - public String last_name; - public String about; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return User.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - stream.writeString(first_name); - } - if ((flags & 2) != 0) { - stream.writeString(last_name); - } - if ((flags & 4) != 0) { - stream.writeString(about); - } - } - } - - public static class TL_account_updateStatus extends TLObject { - public static int constructor = 0x6628562c; - - public boolean offline; - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeBool(offline); - } - } + stream.writeInt32(constructor); + } + } + + public static class TL_account_updateProfile extends TLObject { + public static int constructor = 0x78515775; + + public int flags; + public String first_name; + public String last_name; + public String about; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return User.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + stream.writeString(first_name); + } + if ((flags & 2) != 0) { + stream.writeString(last_name); + } + if ((flags & 4) != 0) { + stream.writeString(about); + } + } + } + + public static class TL_account_updateStatus extends TLObject { + public static int constructor = 0x6628562c; + + public boolean offline; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeBool(offline); + } + } public static class TL_account_getWallPapers extends TLObject { public static int constructor = 0x7967d36; @@ -44346,34 +44999,34 @@ public class TLRPC { } } - public static class TL_users_getUsers extends TLObject { - public static int constructor = 0xd91a548; + public static class TL_users_getUsers extends TLObject { + public static int constructor = 0xd91a548; - public ArrayList id = new ArrayList<>(); + public ArrayList id = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + User object = User.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = id.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - id.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = id.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + id.get(a).serializeToStream(stream); + } + } + } public static class TL_account_reportPeer extends TLObject { public static int constructor = 0xc5ba3d86; @@ -44490,27 +45143,27 @@ public class TLRPC { } } - public static class TL_contacts_getStatuses extends TLObject { - public static int constructor = 0xc4a353ee; + public static class TL_contacts_getStatuses extends TLObject { + public static int constructor = 0xc4a353ee; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - TL_contactStatus object = TL_contactStatus.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + TL_contactStatus object = TL_contactStatus.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); } return vector; - } + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + stream.writeInt32(constructor); + } + } public static class TL_contacts_getContacts extends TLObject { public static int constructor = 0x5dd69e12; @@ -44527,25 +45180,25 @@ public class TLRPC { } } - public static class TL_contacts_importContacts extends TLObject { - public static int constructor = 0x2c800be5; + public static class TL_contacts_importContacts extends TLObject { + public static int constructor = 0x2c800be5; - public ArrayList contacts = new ArrayList<>(); + public ArrayList contacts = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_contacts_importedContacts.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_contacts_importedContacts.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = contacts.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - contacts.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = contacts.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + contacts.get(a).serializeToStream(stream); + } + } + } public static class TL_contacts_deleteContacts extends TLObject { public static int constructor = 0x96a0e00; @@ -44617,88 +45270,88 @@ public class TLRPC { } } - public static class TL_contacts_getBlocked extends TLObject { + public static class TL_contacts_getBlocked extends TLObject { public static int constructor = 0xf57c350f; - public int offset; - public int limit; + public int offset; + public int limit; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return contacts_Blocked.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return contacts_Blocked.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt32(offset); - stream.writeInt32(limit); - } - } + stream.writeInt32(offset); + stream.writeInt32(limit); + } + } - public static class TL_contacts_exportCard extends TLObject { - public static int constructor = 0x84e53737; + public static class TL_contacts_exportCard extends TLObject { + public static int constructor = 0x84e53737; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - vector.objects.add(stream.readInt32(exception)); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + vector.objects.add(stream.readInt32(exception)); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_contacts_importCard extends TLObject { - public static int constructor = 0x4fe196fe; + public static class TL_contacts_importCard extends TLObject { + public static int constructor = 0x4fe196fe; - public ArrayList export_card = new ArrayList<>(); + public ArrayList export_card = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return User.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return User.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = export_card.size(); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = export_card.size(); stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt32(export_card.get(a)); - } - } - } + for (int a = 0; a < count; a++) { + stream.writeInt32(export_card.get(a)); + } + } + } - public static class TL_contacts_resetSaved extends TLObject { - public static int constructor = 0x879537f1; + public static class TL_contacts_resetSaved extends TLObject { + public static int constructor = 0x879537f1; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_contacts_toggleTopPeers extends TLObject { - public static int constructor = 0x8514bdda; + public static class TL_contacts_toggleTopPeers extends TLObject { + public static int constructor = 0x8514bdda; - public boolean enabled; + public boolean enabled; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeBool(enabled); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeBool(enabled); + } + } public static class TL_contacts_addContact extends TLObject { public static int constructor = 0xe8f463d0; @@ -44786,25 +45439,25 @@ public class TLRPC { } } - public static class TL_messages_getMessages extends TLObject { - public static int constructor = 0x4222fa74; + public static class TL_messages_getMessages extends TLObject { + public static int constructor = 0x4222fa74; - public ArrayList id = new ArrayList<>(); + public ArrayList id = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return messages_Messages.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return messages_Messages.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = id.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt32(id.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = id.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt32(id.get(a)); + } + } + } public static class TL_messages_getDialogs extends TLObject { public static int constructor = 0xa0f4cb4f; @@ -44911,48 +45564,48 @@ public class TLRPC { } } - public static class TL_help_getTermsOfServiceUpdate extends TLObject { - public static int constructor = 0x2ca51fd1; + public static class TL_help_getTermsOfServiceUpdate extends TLObject { + public static int constructor = 0x2ca51fd1; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return help_TermsOfServiceUpdate.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return help_TermsOfServiceUpdate.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_help_acceptTermsOfService extends TLObject { - public static int constructor = 0xee72f79a; + public static class TL_help_acceptTermsOfService extends TLObject { + public static int constructor = 0xee72f79a; - public TL_dataJSON id; + public TL_dataJSON id; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - id.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + id.serializeToStream(stream); + } + } - public static class TL_help_getPassportConfig extends TLObject { - public static int constructor = 0xc661ad08; + public static class TL_help_getPassportConfig extends TLObject { + public static int constructor = 0xc661ad08; - public int hash; + public int hash; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return help_PassportConfig.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return help_PassportConfig.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(hash); + } + } public static class TL_help_getSupportName extends TLObject { public static int constructor = 0xd360e72c; @@ -45068,22 +45721,22 @@ public class TLRPC { } } - public static class TL_messages_readHistory extends TLObject { - public static int constructor = 0xe306d3a; + public static class TL_messages_readHistory extends TLObject { + public static int constructor = 0xe306d3a; - public InputPeer peer; - public int max_id; + public InputPeer peer; + public int max_id; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_affectedMessages.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_affectedMessages.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - stream.writeInt32(max_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + stream.writeInt32(max_id); + } + } public static class TL_messages_deleteHistory extends TLObject { public static int constructor = 0xb08f922a; @@ -45116,22 +45769,22 @@ public class TLRPC { } } - public static class TL_channels_togglePreHistoryHidden extends TLObject { - public static int constructor = 0xeabbb94c; + public static class TL_channels_togglePreHistoryHidden extends TLObject { + public static int constructor = 0xeabbb94c; - public InputChannel channel; - public boolean enabled; + public InputChannel channel; + public boolean enabled; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Updates.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Updates.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - channel.serializeToStream(stream); - stream.writeBool(enabled); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + channel.serializeToStream(stream); + stream.writeBool(enabled); + } + } public static class TL_channels_getGroupsForDiscussion extends TLObject { public static int constructor = 0xf5dad378; @@ -45272,82 +45925,82 @@ public class TLRPC { } } - public static class TL_messages_deleteMessages extends TLObject { - public static int constructor = 0xe58e95d2; + public static class TL_messages_deleteMessages extends TLObject { + public static int constructor = 0xe58e95d2; - public int flags; - public boolean revoke; - public ArrayList id = new ArrayList<>(); + public int flags; + public boolean revoke; + public ArrayList id = new ArrayList<>(); - public static TL_messages_deleteMessages TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_messages_deleteMessages.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_messages_deleteMessages", constructor)); - } else { - return null; - } - } - TL_messages_deleteMessages result = new TL_messages_deleteMessages(); - result.readParams(stream, exception); - return result; - } + public static TL_messages_deleteMessages TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_messages_deleteMessages.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_messages_deleteMessages", constructor)); + } else { + return null; + } + } + TL_messages_deleteMessages result = new TL_messages_deleteMessages(); + result.readParams(stream, exception); + return result; + } - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_affectedMessages.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_affectedMessages.TLdeserialize(stream, constructor, exception); + } - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - revoke = (flags & 1) != 0; - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - id.add(stream.readInt32(exception)); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + revoke = (flags & 1) != 0; + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + id.add(stream.readInt32(exception)); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = revoke ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeInt32(0x1cb5c415); - int count = id.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt32(id.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = revoke ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeInt32(0x1cb5c415); + int count = id.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt32(id.get(a)); + } + } + } - public static class TL_messages_receivedMessages extends TLObject { - public static int constructor = 0x5a954c0; + public static class TL_messages_receivedMessages extends TLObject { + public static int constructor = 0x5a954c0; public int max_id; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - TL_receivedNotifyMessage object = TL_receivedNotifyMessage.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + TL_receivedNotifyMessage object = TL_receivedNotifyMessage.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(max_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(max_id); + } + } public static class TL_messages_setTyping extends TLObject { public static int constructor = 0x58943ee2; @@ -45531,20 +46184,20 @@ public class TLRPC { } } - public static class TL_messages_reportSpam extends TLObject { - public static int constructor = 0xcf1592db; + public static class TL_messages_reportSpam extends TLObject { + public static int constructor = 0xcf1592db; - public InputPeer peer; + public InputPeer peer; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + } + } public static class TL_messages_getPeerSettings extends TLObject { public static int constructor = 0xefd9a6a2; @@ -45696,27 +46349,27 @@ public class TLRPC { } } - public static class TL_messages_createChat extends TLObject { - public static int constructor = 0x9cb126e; + public static class TL_messages_createChat extends TLObject { + public static int constructor = 0x9cb126e; - public ArrayList users = new ArrayList<>(); - public String title; + public ArrayList users = new ArrayList<>(); + public String title; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Updates.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Updates.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32(0x1cb5c415); - int count = users.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - users.get(a).serializeToStream(stream); - } - stream.writeString(title); - } - } + int count = users.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + users.get(a).serializeToStream(stream); + } + stream.writeString(title); + } + } public static class TL_messages_getSearchResultsCalendar extends TLObject { public static int constructor = 0x49f0bde9; @@ -45739,68 +46392,68 @@ public class TLRPC { } } - public static class TL_updates_getState extends TLObject { - public static int constructor = 0xedd4882a; + public static class TL_updates_getState extends TLObject { + public static int constructor = 0xedd4882a; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_updates_state.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_updates_state.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + stream.writeInt32(constructor); + } + } - public static class TL_updates_getDifference extends TLObject { - public static int constructor = 0x25939651; + public static class TL_updates_getDifference extends TLObject { + public static int constructor = 0x25939651; - public int flags; - public int pts; - public int pts_total_limit; - public int date; - public int qts; + public int flags; + public int pts; + public int pts_total_limit; + public int date; + public int qts; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return updates_Difference.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return updates_Difference.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeInt32(pts); - if ((flags & 1) != 0) { - stream.writeInt32(pts_total_limit); - } - stream.writeInt32(date); - stream.writeInt32(qts); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeInt32(pts); + if ((flags & 1) != 0) { + stream.writeInt32(pts_total_limit); + } + stream.writeInt32(date); + stream.writeInt32(qts); + } + } - public static class TL_updates_getChannelDifference extends TLObject { - public static int constructor = 0x3173d78; + public static class TL_updates_getChannelDifference extends TLObject { + public static int constructor = 0x3173d78; - public int flags; - public boolean force; - public InputChannel channel; - public ChannelMessagesFilter filter; - public int pts; - public int limit; + public int flags; + public boolean force; + public InputChannel channel; + public ChannelMessagesFilter filter; + public int pts; + public int limit; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return updates_ChannelDifference.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return updates_ChannelDifference.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = force ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - channel.serializeToStream(stream); - filter.serializeToStream(stream); - stream.writeInt32(pts); - stream.writeInt32(limit); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = force ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + channel.serializeToStream(stream); + filter.serializeToStream(stream); + stream.writeInt32(pts); + stream.writeInt32(limit); + } + } public static class TL_photos_updateProfilePhoto extends TLObject { public static int constructor = 0x72d4742c; @@ -45844,30 +46497,30 @@ public class TLRPC { } } - public static class TL_photos_deletePhotos extends TLObject { - public static int constructor = 0x87cf7f2f; + public static class TL_photos_deletePhotos extends TLObject { + public static int constructor = 0x87cf7f2f; - public ArrayList id = new ArrayList<>(); + public ArrayList id = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - vector.objects.add(stream.readInt64(exception)); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + vector.objects.add(stream.readInt64(exception)); + } return vector; - } + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); stream.writeInt32(0x1cb5c415); - int count = id.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { + int count = id.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { id.get(a).serializeToStream(stream); - } - } - } + } + } + } public static class TL_upload_getFile extends TLObject { public static int constructor = 0xb15a9afc; @@ -45894,46 +46547,46 @@ public class TLRPC { } } - public static class TL_help_getConfig extends TLObject { + public static class TL_help_getConfig extends TLObject { public static int constructor = 0xc4f9186b; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_config.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_config.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_help_getNearestDc extends TLObject { - public static int constructor = 0x1fb33026; + public static class TL_help_getNearestDc extends TLObject { + public static int constructor = 0x1fb33026; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_nearestDc.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_nearestDc.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_help_getAppUpdate extends TLObject { - public static int constructor = 0x522d5a7d; + public static class TL_help_getAppUpdate extends TLObject { + public static int constructor = 0x522d5a7d; - public String source; + public String source; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return help_AppUpdate.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return help_AppUpdate.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(source); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(source); + } + } public static class TL_help_getAppConfig extends TLObject { public static int constructor = 0x98914110; @@ -45948,133 +46601,133 @@ public class TLRPC { } } - public static class TL_help_saveAppLog extends TLObject { - public static int constructor = 0x6f02f748; + public static class TL_help_saveAppLog extends TLObject { + public static int constructor = 0x6f02f748; - public ArrayList events = new ArrayList<>(); + public ArrayList events = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = events.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - events.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = events.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + events.get(a).serializeToStream(stream); + } + } + } - public static class TL_help_getInviteText extends TLObject { - public static int constructor = 0x4d392343; + public static class TL_help_getInviteText extends TLObject { + public static int constructor = 0x4d392343; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_help_inviteText.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_help_inviteText.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_photos_getUserPhotos extends TLObject { - public static int constructor = 0x91cd32a8; + public static class TL_photos_getUserPhotos extends TLObject { + public static int constructor = 0x91cd32a8; - public InputUser user_id; - public int offset; - public long max_id; - public int limit; + public InputUser user_id; + public int offset; + public long max_id; + public int limit; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return photos_Photos.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return photos_Photos.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); user_id.serializeToStream(stream); - stream.writeInt32(offset); - stream.writeInt64(max_id); - stream.writeInt32(limit); - } - } + stream.writeInt32(offset); + stream.writeInt64(max_id); + stream.writeInt32(limit); + } + } - public static class TL_messages_forwardMessage extends TLObject { - public static int constructor = 0x33963bf9; + public static class TL_messages_forwardMessage extends TLObject { + public static int constructor = 0x33963bf9; - public InputPeer peer; - public int id; - public long random_id; + public InputPeer peer; + public int id; + public long random_id; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { return Updates.TLdeserialize(stream, constructor, exception); } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - peer.serializeToStream(stream); - stream.writeInt32(id); - stream.writeInt64(random_id); - } - } + peer.serializeToStream(stream); + stream.writeInt32(id); + stream.writeInt64(random_id); + } + } - public static class TL_messages_getDhConfig extends TLObject { - public static int constructor = 0x26cf8950; + public static class TL_messages_getDhConfig extends TLObject { + public static int constructor = 0x26cf8950; - public int version; - public int random_length; + public int version; + public int random_length; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return messages_DhConfig.TLdeserialize(stream, constructor, exception); + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return messages_DhConfig.TLdeserialize(stream, constructor, exception); } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - stream.writeInt32(version); - stream.writeInt32(random_length); - } - } + stream.writeInt32(version); + stream.writeInt32(random_length); + } + } - public static class TL_messages_requestEncryption extends TLObject { - public static int constructor = 0xf64daf43; + public static class TL_messages_requestEncryption extends TLObject { + public static int constructor = 0xf64daf43; - public InputUser user_id; - public int random_id; - public byte[] g_a; + public InputUser user_id; + public int random_id; + public byte[] g_a; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return EncryptedChat.TLdeserialize(stream, constructor, exception); + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return EncryptedChat.TLdeserialize(stream, constructor, exception); } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - user_id.serializeToStream(stream); - stream.writeInt32(random_id); - stream.writeByteArray(g_a); - } - } + stream.writeInt32(constructor); + user_id.serializeToStream(stream); + stream.writeInt32(random_id); + stream.writeByteArray(g_a); + } + } - public static class TL_messages_acceptEncryption extends TLObject { - public static int constructor = 0x3dbc0415; + public static class TL_messages_acceptEncryption extends TLObject { + public static int constructor = 0x3dbc0415; - public TL_inputEncryptedChat peer; - public byte[] g_b; - public long key_fingerprint; + public TL_inputEncryptedChat peer; + public byte[] g_b; + public long key_fingerprint; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { return EncryptedChat.TLdeserialize(stream, constructor, exception); - } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - stream.writeByteArray(g_b); - stream.writeInt64(key_fingerprint); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + stream.writeByteArray(g_b); + stream.writeInt64(key_fingerprint); + } + } public static class TL_messages_discardEncryption extends TLObject { public static int constructor = 0xf393aea0; @@ -46095,234 +46748,234 @@ public class TLRPC { } } - public static class TL_messages_setEncryptedTyping extends TLObject { - public static int constructor = 0x791451ed; + public static class TL_messages_setEncryptedTyping extends TLObject { + public static int constructor = 0x791451ed; - public TL_inputEncryptedChat peer; - public boolean typing; + public TL_inputEncryptedChat peer; + public boolean typing; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - stream.writeBool(typing); - } - } - - public static class TL_messages_readEncryptedHistory extends TLObject { - public static int constructor = 0x7f4b690a; - - public TL_inputEncryptedChat peer; - public int max_date; - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - stream.writeInt32(max_date); - } - } - - public static class TL_messages_receivedQueue extends TLObject { - public static int constructor = 0x55a5bb66; - - public int max_qts; - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - vector.objects.add(stream.readInt64(exception)); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(max_qts); - } - } + stream.writeInt32(constructor); + peer.serializeToStream(stream); + stream.writeBool(typing); + } + } - public static class TL_messages_reportEncryptedSpam extends TLObject { - public static int constructor = 0x4b0c8c0f; + public static class TL_messages_readEncryptedHistory extends TLObject { + public static int constructor = 0x7f4b690a; - public TL_inputEncryptedChat peer; + public TL_inputEncryptedChat peer; + public int max_date; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + stream.writeInt32(max_date); + } + } - public static class TL_help_getSupport extends TLObject { + public static class TL_messages_receivedQueue extends TLObject { + public static int constructor = 0x55a5bb66; + + public int max_qts; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + vector.objects.add(stream.readInt64(exception)); + } + return vector; + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(max_qts); + } + } + + public static class TL_messages_reportEncryptedSpam extends TLObject { + public static int constructor = 0x4b0c8c0f; + + public TL_inputEncryptedChat peer; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + } + } + + public static class TL_help_getSupport extends TLObject { public static int constructor = 0x9cdf08cd; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_help_support.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_help_support.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_messages_readMessageContents extends TLObject { - public static int constructor = 0x36a73f77; + public static class TL_messages_readMessageContents extends TLObject { + public static int constructor = 0x36a73f77; - public ArrayList id = new ArrayList<>(); + public ArrayList id = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_affectedMessages.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_affectedMessages.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); stream.writeInt32(0x1cb5c415); - int count = id.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt32(id.get(a)); - } - } - } + int count = id.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt32(id.get(a)); + } + } + } - public static class TL_account_checkUsername extends TLObject { - public static int constructor = 0x2714d86c; + public static class TL_account_checkUsername extends TLObject { + public static int constructor = 0x2714d86c; - public String username; + public String username; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(username); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(username); + } + } - public static class TL_account_updateUsername extends TLObject { - public static int constructor = 0x3e0bdd7c; + public static class TL_account_updateUsername extends TLObject { + public static int constructor = 0x3e0bdd7c; - public String username; + public String username; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return User.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return User.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(username); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(username); + } + } - public static class TL_contacts_search extends TLObject { - public static int constructor = 0x11f812d8; + public static class TL_contacts_search extends TLObject { + public static int constructor = 0x11f812d8; - public String q; - public int limit; + public String q; + public int limit; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_contacts_found.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_contacts_found.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(q); - stream.writeInt32(limit); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(q); + stream.writeInt32(limit); + } + } - public static class TL_account_getPrivacy extends TLObject { + public static class TL_account_getPrivacy extends TLObject { public static int constructor = 0xdadbc950; - public InputPrivacyKey key; + public InputPrivacyKey key; public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_account_privacyRules.TLdeserialize(stream, constructor, exception); - } + return TL_account_privacyRules.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - key.serializeToStream(stream); - } - } + stream.writeInt32(constructor); + key.serializeToStream(stream); + } + } - public static class TL_account_setPrivacy extends TLObject { - public static int constructor = 0xc9f81ce8; + public static class TL_account_setPrivacy extends TLObject { + public static int constructor = 0xc9f81ce8; - public InputPrivacyKey key; - public ArrayList rules = new ArrayList<>(); + public InputPrivacyKey key; + public ArrayList rules = new ArrayList<>(); public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_account_privacyRules.TLdeserialize(stream, constructor, exception); - } + return TL_account_privacyRules.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - key.serializeToStream(stream); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + key.serializeToStream(stream); stream.writeInt32(0x1cb5c415); - int count = rules.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { + int count = rules.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { rules.get(a).serializeToStream(stream); - } - } - } + } + } + } public static class TL_account_deleteAccount extends TLObject { - public static int constructor = 0x418d4e0b; + public static int constructor = 0x418d4e0b; - public String reason; + public String reason; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(reason); - } - } - - public static class TL_account_getAccountTTL extends TLObject { - public static int constructor = 0x8fc711d; - - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_accountDaysTTL.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + stream.writeInt32(constructor); + stream.writeString(reason); + } + } - public static class TL_account_setAccountTTL extends TLObject { - public static int constructor = 0x2442485e; + public static class TL_account_getAccountTTL extends TLObject { + public static int constructor = 0x8fc711d; - public TL_accountDaysTTL ttl; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_accountDaysTTL.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - ttl.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } + + public static class TL_account_setAccountTTL extends TLObject { + public static int constructor = 0x2442485e; + + public TL_accountDaysTTL ttl; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + ttl.serializeToStream(stream); + } + } public static class TL_contacts_resolveUsername extends TLObject { public static int constructor = 0xf93ccba3; @@ -46376,22 +47029,22 @@ public class TLRPC { } } - public static class TL_contacts_resetTopPeerRating extends TLObject { - public static int constructor = 0x1ae373ac; + public static class TL_contacts_resetTopPeerRating extends TLObject { + public static int constructor = 0x1ae373ac; - public TopPeerCategory category; - public InputPeer peer; + public TopPeerCategory category; + public InputPeer peer; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - category.serializeToStream(stream); - peer.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + category.serializeToStream(stream); + peer.serializeToStream(stream); + } + } public static class TL_account_sendChangePhoneCode extends TLObject { public static int constructor = 0x82574ae5; @@ -46410,65 +47063,65 @@ public class TLRPC { } } - public static class TL_account_changePhone extends TLObject { + public static class TL_account_changePhone extends TLObject { public static int constructor = 0x70c32edb; - public String phone_number; - public String phone_code_hash; - public String phone_code; + public String phone_number; + public String phone_code_hash; + public String phone_code; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return User.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return User.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(phone_number); - stream.writeString(phone_code_hash); - stream.writeString(phone_code); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(phone_number); + stream.writeString(phone_code_hash); + stream.writeString(phone_code); + } + } - public static class TL_account_getWebAuthorizations extends TLObject { - public static int constructor = 0x182e6d6f; + public static class TL_account_getWebAuthorizations extends TLObject { + public static int constructor = 0x182e6d6f; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_account_webAuthorizations.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_account_webAuthorizations.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_account_resetWebAuthorization extends TLObject { - public static int constructor = 0x2d01b9ef; + public static class TL_account_resetWebAuthorization extends TLObject { + public static int constructor = 0x2d01b9ef; - public long hash; + public long hash; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(hash); + } + } - public static class TL_account_resetWebAuthorizations extends TLObject { - public static int constructor = 0x682d2594; + public static class TL_account_resetWebAuthorizations extends TLObject { + public static int constructor = 0x682d2594; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_account_getMultiWallPapers extends TLObject { public static int constructor = 0x65ad71dc; @@ -46548,93 +47201,93 @@ public class TLRPC { } } - public static class TL_account_getAllSecureValues extends TLObject { - public static int constructor = 0xb288bc7d; + public static class TL_account_getAllSecureValues extends TLObject { + public static int constructor = 0xb288bc7d; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - TL_secureValue object = TL_secureValue.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + TL_secureValue object = TL_secureValue.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_account_getSecureValue extends TLObject { - public static int constructor = 0x73665bc2; + public static class TL_account_getSecureValue extends TLObject { + public static int constructor = 0x73665bc2; - public ArrayList types = new ArrayList<>(); + public ArrayList types = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - TL_secureValue object = TL_secureValue.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + TL_secureValue object = TL_secureValue.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = types.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - types.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = types.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + types.get(a).serializeToStream(stream); + } + } + } - public static class TL_account_saveSecureValue extends TLObject { - public static int constructor = 0x899fe31d; + public static class TL_account_saveSecureValue extends TLObject { + public static int constructor = 0x899fe31d; - public TL_inputSecureValue value; - public long secure_secret_id; + public TL_inputSecureValue value; + public long secure_secret_id; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_secureValue.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_secureValue.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - value.serializeToStream(stream); - stream.writeInt64(secure_secret_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + value.serializeToStream(stream); + stream.writeInt64(secure_secret_id); + } + } - public static class TL_account_deleteSecureValue extends TLObject { - public static int constructor = 0xb880bc4b; + public static class TL_account_deleteSecureValue extends TLObject { + public static int constructor = 0xb880bc4b; - public ArrayList types = new ArrayList<>(); + public ArrayList types = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = types.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - types.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = types.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + types.get(a).serializeToStream(stream); + } + } + } public static class TL_account_getAuthorizationForm extends TLObject { public static int constructor = 0xa929597a; @@ -46700,56 +47353,56 @@ public class TLRPC { } } - public static class TL_account_verifyPhone extends TLObject { - public static int constructor = 0x4dd3a7f6; + public static class TL_account_verifyPhone extends TLObject { + public static int constructor = 0x4dd3a7f6; - public String phone_number; - public String phone_code_hash; - public String phone_code; + public String phone_number; + public String phone_code_hash; + public String phone_code; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(phone_number); - stream.writeString(phone_code_hash); - stream.writeString(phone_code); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(phone_number); + stream.writeString(phone_code_hash); + stream.writeString(phone_code); + } + } - public static class TL_account_sendVerifyEmailCode extends TLObject { - public static int constructor = 0x7011509f; + public static class TL_account_sendVerifyEmailCode extends TLObject { + public static int constructor = 0x7011509f; - public String email; + public String email; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_account_sentEmailCode.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_account_sentEmailCode.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(email); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(email); + } + } - public static class TL_account_verifyEmail extends TLObject { - public static int constructor = 0xecba39db; + public static class TL_account_verifyEmail extends TLObject { + public static int constructor = 0xecba39db; - public String email; - public String code; + public String email; + public String code; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(email); - stream.writeString(code); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(email); + stream.writeString(code); + } + } public static class TL_account_confirmPasswordEmail extends TLObject { public static int constructor = 0x8fdf1920; @@ -47123,87 +47776,87 @@ public class TLRPC { } } - public static class TL_account_updateDeviceLocked extends TLObject { - public static int constructor = 0x38df3532; + public static class TL_account_updateDeviceLocked extends TLObject { + public static int constructor = 0x38df3532; - public int period; + public int period; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(period); - } - } + stream.writeInt32(constructor); + stream.writeInt32(period); + } + } - public static class TL_messages_getWebPagePreview extends TLObject { - public static int constructor = 0x8b68b0cc; + public static class TL_messages_getWebPagePreview extends TLObject { + public static int constructor = 0x8b68b0cc; - public int flags; - public String message; - public ArrayList entities = new ArrayList<>(); + public int flags; + public String message; + public ArrayList entities = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return MessageMedia.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - stream.writeString(message); - if ((flags & 8) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - } - } - - public static class TL_account_getAuthorizations extends TLObject { - public static int constructor = 0xe320c158; - - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_account_authorizations.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return MessageMedia.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + stream.writeInt32(constructor); + stream.writeInt32(flags); + stream.writeString(message); + if ((flags & 8) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + } + } - public static class TL_account_resetAuthorization extends TLObject { - public static int constructor = 0xdf77f3bc; + public static class TL_account_getAuthorizations extends TLObject { + public static int constructor = 0xe320c158; - public long hash; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_account_authorizations.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt64(hash); - } - } + stream.writeInt32(constructor); + } + } - public static class TL_account_getPassword extends TLObject { + public static class TL_account_resetAuthorization extends TLObject { + public static int constructor = 0xdf77f3bc; + + public long hash; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt64(hash); + } + } + + public static class TL_account_getPassword extends TLObject { public static int constructor = 0x548a30f5; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_account_password.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_account_password.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + stream.writeInt32(constructor); + } + } public static class TL_account_getPasswordSettings extends TLObject { public static int constructor = 0x9cd4eaf9; @@ -47303,16 +47956,16 @@ public class TLRPC { } } - public static class TL_auth_requestPasswordRecovery extends TLObject { - public static int constructor = 0xd897bc66; + public static class TL_auth_requestPasswordRecovery extends TLObject { + public static int constructor = 0xd897bc66; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_auth_passwordRecovery.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_auth_passwordRecovery.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); + stream.writeInt32(constructor); } } @@ -47337,39 +47990,39 @@ public class TLRPC { } } - public static class TL_auth_resendCode extends TLObject { - public static int constructor = 0x3ef1a9bf; + public static class TL_auth_resendCode extends TLObject { + public static int constructor = 0x3ef1a9bf; - public String phone_number; - public String phone_code_hash; + public String phone_number; + public String phone_code_hash; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_auth_sentCode.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_auth_sentCode.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(phone_number); - stream.writeString(phone_code_hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(phone_number); + stream.writeString(phone_code_hash); + } + } - public static class TL_auth_cancelCode extends TLObject { - public static int constructor = 0x1f040578; + public static class TL_auth_cancelCode extends TLObject { + public static int constructor = 0x1f040578; - public String phone_number; - public String phone_code_hash; + public String phone_number; + public String phone_code_hash; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(phone_number); - stream.writeString(phone_code_hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(phone_number); + stream.writeString(phone_code_hash); + } + } public static class TL_messages_exportChatInvite extends TLObject { public static int constructor = 0xa02ce5d5; @@ -47404,103 +48057,103 @@ public class TLRPC { } } - public static class TL_messages_checkChatInvite extends TLObject { - public static int constructor = 0x3eadb1bb; + public static class TL_messages_checkChatInvite extends TLObject { + public static int constructor = 0x3eadb1bb; - public String hash; + public String hash; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return ChatInvite.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(hash); - } - } - - public static class TL_messages_importChatInvite extends TLObject { - public static int constructor = 0x6c50051c; - - public String hash; - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Updates.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(hash); - } - } - - public static class TL_messages_getStickerSet extends TLObject { - public static int constructor = 0x2619a90e; - - public InputStickerSet stickerset; - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_stickerSet.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stickerset.serializeToStream(stream); - } - } - - public static class TL_messages_installStickerSet extends TLObject { - public static int constructor = 0xc78fe460; - - public InputStickerSet stickerset; - public boolean archived; - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return messages_StickerSetInstallResult.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stickerset.serializeToStream(stream); - stream.writeBool(archived); - } - } - - public static class TL_messages_uninstallStickerSet extends TLObject { - public static int constructor = 0xf96e55de; - - public InputStickerSet stickerset; - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return ChatInvite.TLdeserialize(stream, constructor, exception); + } public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stickerset.serializeToStream(stream); - } - } + stream.writeInt32(constructor); + stream.writeString(hash); + } + } - public static class TL_messages_startBot extends TLObject { - public static int constructor = 0xe6df7378; + public static class TL_messages_importChatInvite extends TLObject { + public static int constructor = 0x6c50051c; - public InputUser bot; - public InputPeer peer; - public long random_id; - public String start_param; + public String hash; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Updates.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Updates.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - bot.serializeToStream(stream); - peer.serializeToStream(stream); - stream.writeInt64(random_id); - stream.writeString(start_param); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(hash); + } + } + + public static class TL_messages_getStickerSet extends TLObject { + public static int constructor = 0x2619a90e; + + public InputStickerSet stickerset; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_stickerSet.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stickerset.serializeToStream(stream); + } + } + + public static class TL_messages_installStickerSet extends TLObject { + public static int constructor = 0xc78fe460; + + public InputStickerSet stickerset; + public boolean archived; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return messages_StickerSetInstallResult.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stickerset.serializeToStream(stream); + stream.writeBool(archived); + } + } + + public static class TL_messages_uninstallStickerSet extends TLObject { + public static int constructor = 0xf96e55de; + + public InputStickerSet stickerset; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stickerset.serializeToStream(stream); + } + } + + public static class TL_messages_startBot extends TLObject { + public static int constructor = 0xe6df7378; + + public InputUser bot; + public InputPeer peer; + public long random_id; + public String start_param; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Updates.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + bot.serializeToStream(stream); + peer.serializeToStream(stream); + stream.writeInt64(random_id); + stream.writeString(start_param); + } + } public static class TL_messages_getMessagesViews extends TLObject { public static int constructor = 0x5784d3e1; @@ -47541,49 +48194,49 @@ public class TLRPC { } } - public static class TL_messages_saveGif extends TLObject { - public static int constructor = 0x327a30cb; + public static class TL_messages_saveGif extends TLObject { + public static int constructor = 0x327a30cb; - public InputDocument id; - public boolean unsave; + public InputDocument id; + public boolean unsave; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - id.serializeToStream(stream); - stream.writeBool(unsave); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + id.serializeToStream(stream); + stream.writeBool(unsave); + } + } - public static class TL_messages_getInlineBotResults extends TLObject { - public static int constructor = 0x514e999d; + public static class TL_messages_getInlineBotResults extends TLObject { + public static int constructor = 0x514e999d; - public int flags; - public InputUser bot; - public InputPeer peer; - public InputGeoPoint geo_point; - public String query; - public String offset; + public int flags; + public InputUser bot; + public InputPeer peer; + public InputGeoPoint geo_point; + public String query; + public String offset; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return messages_BotResults.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return messages_BotResults.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - bot.serializeToStream(stream); - peer.serializeToStream(stream); - if ((flags & 1) != 0) { - geo_point.serializeToStream(stream); - } - stream.writeString(query); - stream.writeString(offset); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + bot.serializeToStream(stream); + peer.serializeToStream(stream); + if ((flags & 1) != 0) { + geo_point.serializeToStream(stream); + } + stream.writeString(query); + stream.writeString(offset); + } + } public static class TL_messages_sendInlineBotResult extends TLObject { public static int constructor = 0x7aa11297; @@ -47628,22 +48281,22 @@ public class TLRPC { } } - public static class TL_messages_getMessageEditData extends TLObject { - public static int constructor = 0xfda68d36; + public static class TL_messages_getMessageEditData extends TLObject { + public static int constructor = 0xfda68d36; - public InputPeer peer; - public int id; + public InputPeer peer; + public int id; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_messageEditData.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_messageEditData.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - stream.writeInt32(id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + stream.writeInt32(id); + } + } public static class TL_messages_editMessage extends TLObject { public static int constructor = 0x48f71778; @@ -47720,101 +48373,101 @@ public class TLRPC { } } - public static class TL_messages_setBotCallbackAnswer extends TLObject { - public static int constructor = 0xd58f130a; + public static class TL_messages_setBotCallbackAnswer extends TLObject { + public static int constructor = 0xd58f130a; - public int flags; - public boolean alert; - public long query_id; - public String message; - public String url; - public int cache_time; + public int flags; + public boolean alert; + public long query_id; + public String message; + public String url; + public int cache_time; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = alert ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - stream.writeInt64(query_id); - if ((flags & 1) != 0) { - stream.writeString(message); - } - if ((flags & 4) != 0) { - stream.writeString(url); - } - stream.writeInt32(cache_time); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = alert ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + stream.writeInt64(query_id); + if ((flags & 1) != 0) { + stream.writeString(message); + } + if ((flags & 4) != 0) { + stream.writeString(url); + } + stream.writeInt32(cache_time); + } + } - public static class TL_messages_getPeerDialogs extends TLObject { - public static int constructor = 0xe470bcfd; + public static class TL_messages_getPeerDialogs extends TLObject { + public static int constructor = 0xe470bcfd; - public ArrayList peers = new ArrayList<>(); + public ArrayList peers = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_peerDialogs.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_peerDialogs.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = peers.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - peers.get(a).serializeToStream(stream); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = peers.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + peers.get(a).serializeToStream(stream); + } + } + } - public static class TL_messages_saveDraft extends TLObject { - public static int constructor = 0xbc39e14b; + public static class TL_messages_saveDraft extends TLObject { + public static int constructor = 0xbc39e14b; - public int flags; - public boolean no_webpage; - public int reply_to_msg_id; - public InputPeer peer; - public String message; - public ArrayList entities = new ArrayList<>(); + public int flags; + public boolean no_webpage; + public int reply_to_msg_id; + public InputPeer peer; + public String message; + public ArrayList entities = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = no_webpage ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - if ((flags & 1) != 0) { - stream.writeInt32(reply_to_msg_id); - } - peer.serializeToStream(stream); - stream.writeString(message); - if ((flags & 8) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = no_webpage ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + if ((flags & 1) != 0) { + stream.writeInt32(reply_to_msg_id); + } + peer.serializeToStream(stream); + stream.writeString(message); + if ((flags & 8) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + } + } - public static class TL_messages_getAllDrafts extends TLObject { - public static int constructor = 0x6a3f8d65; + public static class TL_messages_getAllDrafts extends TLObject { + public static int constructor = 0x6a3f8d65; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Updates.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Updates.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messages_getFeaturedStickers extends TLObject { public static int constructor = 0x64780b14; @@ -47831,25 +48484,25 @@ public class TLRPC { } } - public static class TL_messages_readFeaturedStickers extends TLObject { - public static int constructor = 0x5b118126; + public static class TL_messages_readFeaturedStickers extends TLObject { + public static int constructor = 0x5b118126; - public ArrayList id = new ArrayList<>(); + public ArrayList id = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(0x1cb5c415); - int count = id.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt64(id.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(0x1cb5c415); + int count = id.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt64(id.get(a)); + } + } + } public static class TL_messages_getRecentStickers extends TLObject { public static int constructor = 0x9da9403b; @@ -47870,116 +48523,116 @@ public class TLRPC { } } - public static class TL_messages_saveRecentSticker extends TLObject { - public static int constructor = 0x392718f8; + public static class TL_messages_saveRecentSticker extends TLObject { + public static int constructor = 0x392718f8; - public int flags; - public boolean attached; - public InputDocument id; - public boolean unsave; + public int flags; + public boolean attached; + public InputDocument id; + public boolean unsave; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = attached ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - id.serializeToStream(stream); - stream.writeBool(unsave); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = attached ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + id.serializeToStream(stream); + stream.writeBool(unsave); + } + } - public static class TL_messages_clearRecentStickers extends TLObject { - public static int constructor = 0x8999602d; + public static class TL_messages_clearRecentStickers extends TLObject { + public static int constructor = 0x8999602d; - public int flags; - public boolean attached; + public int flags; + public boolean attached; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = attached ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = attached ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + } + } - public static class TL_messages_getArchivedStickers extends TLObject { - public static int constructor = 0x57f17692; + public static class TL_messages_getArchivedStickers extends TLObject { + public static int constructor = 0x57f17692; - public int flags; - public boolean masks; - public long offset_id; - public int limit; + public int flags; + public boolean masks; + public long offset_id; + public int limit; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_archivedStickers.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_archivedStickers.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = masks ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeInt64(offset_id); - stream.writeInt32(limit); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = masks ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeInt64(offset_id); + stream.writeInt32(limit); + } + } - public static class TL_messages_setGameScore extends TLObject { - public static int constructor = 0x8ef8ecc0; + public static class TL_messages_setGameScore extends TLObject { + public static int constructor = 0x8ef8ecc0; - public int flags; - public boolean edit_message; - public boolean force; - public InputPeer peer; - public int id; - public InputUser user_id; - public int score; + public int flags; + public boolean edit_message; + public boolean force; + public InputPeer peer; + public int id; + public InputUser user_id; + public int score; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Updates.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Updates.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = edit_message ? (flags | 1) : (flags &~ 1); - flags = force ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - peer.serializeToStream(stream); - stream.writeInt32(id); - user_id.serializeToStream(stream); - stream.writeInt32(score); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = edit_message ? (flags | 1) : (flags &~ 1); + flags = force ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + peer.serializeToStream(stream); + stream.writeInt32(id); + user_id.serializeToStream(stream); + stream.writeInt32(score); + } + } - public static class TL_messages_setInlineGameScore extends TLObject { - public static int constructor = 0x15ad9f64; + public static class TL_messages_setInlineGameScore extends TLObject { + public static int constructor = 0x15ad9f64; - public int flags; - public boolean edit_message; - public boolean force; - public TL_inputBotInlineMessageID id; - public InputUser user_id; - public int score; + public int flags; + public boolean edit_message; + public boolean force; + public TL_inputBotInlineMessageID id; + public InputUser user_id; + public int score; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = edit_message ? (flags | 1) : (flags &~ 1); - flags = force ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - id.serializeToStream(stream); - user_id.serializeToStream(stream); - stream.writeInt32(score); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = edit_message ? (flags | 1) : (flags &~ 1); + flags = force ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + id.serializeToStream(stream); + user_id.serializeToStream(stream); + stream.writeInt32(score); + } + } public static class TL_messages_getMaskStickers extends TLObject { public static int constructor = 0x640f82b8; @@ -47996,65 +48649,65 @@ public class TLRPC { } } - public static class TL_messages_getGameHighScores extends TLObject { - public static int constructor = 0xe822649d; + public static class TL_messages_getGameHighScores extends TLObject { + public static int constructor = 0xe822649d; - public InputPeer peer; - public int id; - public InputUser user_id; + public InputPeer peer; + public int id; + public InputUser user_id; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_highScores.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_highScores.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - stream.writeInt32(id); - user_id.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + stream.writeInt32(id); + user_id.serializeToStream(stream); + } + } - public static class TL_messages_getInlineGameHighScores extends TLObject { - public static int constructor = 0xf635e1b; + public static class TL_messages_getInlineGameHighScores extends TLObject { + public static int constructor = 0xf635e1b; - public TL_inputBotInlineMessageID id; - public InputUser user_id; + public TL_inputBotInlineMessageID id; + public InputUser user_id; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_highScores.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_highScores.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - id.serializeToStream(stream); - user_id.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + id.serializeToStream(stream); + user_id.serializeToStream(stream); + } + } - public static class TL_messages_getAttachedStickers extends TLObject { - public static int constructor = 0xcc5b67cc; + public static class TL_messages_getAttachedStickers extends TLObject { + public static int constructor = 0xcc5b67cc; - public InputStickeredMedia media; + public InputStickeredMedia media; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - StickerSetCovered object = StickerSetCovered.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + StickerSetCovered object = StickerSetCovered.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - media.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + media.serializeToStream(stream); + } + } public static class TL_messages_getCommonChats extends TLObject { public static int constructor = 0xe40ca104; @@ -48095,41 +48748,41 @@ public class TLRPC { } } - public static class TL_messages_getWebPage extends TLObject { - public static int constructor = 0x32ca8f91; + public static class TL_messages_getWebPage extends TLObject { + public static int constructor = 0x32ca8f91; - public String url; - public int hash; + public String url; + public int hash; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return WebPage.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return WebPage.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(url); - stream.writeInt32(hash); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(url); + stream.writeInt32(hash); + } + } - public static class TL_messages_toggleDialogPin extends TLObject { - public static int constructor = 0xa731e257; + public static class TL_messages_toggleDialogPin extends TLObject { + public static int constructor = 0xa731e257; - public int flags; - public boolean pinned; - public InputDialogPeer peer; + public int flags; + public boolean pinned; + public InputDialogPeer peer; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = pinned ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - peer.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = pinned ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + peer.serializeToStream(stream); + } + } public static class TL_messages_reorderPinnedDialogs extends TLObject { public static int constructor = 0x3b1adf37; @@ -48172,41 +48825,41 @@ public class TLRPC { } } - public static class TL_messages_uploadMedia extends TLObject { - public static int constructor = 0x519bc2b1; + public static class TL_messages_uploadMedia extends TLObject { + public static int constructor = 0x519bc2b1; - public InputPeer peer; - public InputMedia media; + public InputPeer peer; + public InputMedia media; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return MessageMedia.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return MessageMedia.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - media.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + media.serializeToStream(stream); + } + } - public static class TL_messages_sendScreenshotNotification extends TLObject { - public static int constructor = 0xc97df020; + public static class TL_messages_sendScreenshotNotification extends TLObject { + public static int constructor = 0xc97df020; - public InputPeer peer; - public int reply_to_msg_id; - public long random_id; + public InputPeer peer; + public int reply_to_msg_id; + public long random_id; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Updates.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Updates.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - stream.writeInt32(reply_to_msg_id); - stream.writeInt64(random_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + stream.writeInt32(reply_to_msg_id); + stream.writeInt64(random_id); + } + } public static class TL_messages_getFavedStickers extends TLObject { public static int constructor = 0x4f1aaa9; @@ -48223,62 +48876,62 @@ public class TLRPC { } } - public static class TL_messages_faveSticker extends TLObject { - public static int constructor = 0xb9ffc55b; + public static class TL_messages_faveSticker extends TLObject { + public static int constructor = 0xb9ffc55b; - public InputDocument id; - public boolean unfave; + public InputDocument id; + public boolean unfave; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - id.serializeToStream(stream); - stream.writeBool(unfave); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + id.serializeToStream(stream); + stream.writeBool(unfave); + } + } - public static class TL_messages_getUnreadMentions extends TLObject { - public static int constructor = 0x46578472; + public static class TL_messages_getUnreadMentions extends TLObject { + public static int constructor = 0x46578472; - public InputPeer peer; - public int offset_id; - public int add_offset; - public int limit; - public int max_id; - public int min_id; + public InputPeer peer; + public int offset_id; + public int add_offset; + public int limit; + public int max_id; + public int min_id; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return messages_Messages.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return messages_Messages.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - stream.writeInt32(offset_id); - stream.writeInt32(add_offset); - stream.writeInt32(limit); - stream.writeInt32(max_id); - stream.writeInt32(min_id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + stream.writeInt32(offset_id); + stream.writeInt32(add_offset); + stream.writeInt32(limit); + stream.writeInt32(max_id); + stream.writeInt32(min_id); + } + } - public static class TL_messages_readMentions extends TLObject { - public static int constructor = 0xf0189d3; + public static class TL_messages_readMentions extends TLObject { + public static int constructor = 0xf0189d3; - public InputPeer peer; + public InputPeer peer; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_affectedHistory.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_affectedHistory.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + } + } public static class TL_messages_getRecentLocations extends TLObject { public static int constructor = 0x702a40e0; @@ -48341,18 +48994,18 @@ public class TLRPC { } } - public static class TL_messages_clearAllDrafts extends TLObject { - public static int constructor = 0x7e58ee9c; + public static class TL_messages_clearAllDrafts extends TLObject { + public static int constructor = 0x7e58ee9c; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_messages_updatePinnedMessage extends TLObject { public static int constructor = 0xd2aaf7ec; @@ -48832,6 +49485,73 @@ public class TLRPC { } } + public static class TL_messages_getMessageReactionsList extends TLObject { + public static int constructor = 0xe0ee6b77; + + public int flags; + public InputPeer peer; + public int id; + public String reaction; + public String offset; + public int limit; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_messageReactionsList.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + peer.serializeToStream(stream); + stream.writeInt32(id); + if ((flags & 1) != 0) { + stream.writeString(reaction); + } + if ((flags & 2) != 0) { + stream.writeString(offset); + } + stream.writeInt32(limit); + } + } + + public static class TL_messages_setChatAvailableReactions extends TLObject { + public static int constructor = 0x14050ea6; + + public InputPeer peer; + public ArrayList available_reactions = new ArrayList<>(); + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Updates.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = available_reactions.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeString(available_reactions.get(a)); + } + } + } + + public static class TL_messages_getAvailableReactions extends TLObject { + public static int constructor = 0x18dea0ac; + + public int hash; + + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return messages_AvailableReactions.TLdeserialize(stream, constructor, exception); + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(hash); + } + } + + public static class TL_messages_searchResultsCalendar extends TLObject { public static int constructor = 0x147ee23c; @@ -48967,35 +49687,6 @@ public class TLRPC { } } - public static class TL_messages_getMessageReactionsList extends TLObject { - public static int constructor = 0x15b1376a; - - public int flags; - public InputPeer peer; - public int id; - public String reaction; - public String offset; - public int limit; - - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messageReactionsList.TLdeserialize(stream, constructor, exception); - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - peer.serializeToStream(stream); - stream.writeInt32(id); - if ((flags & 1) != 0) { - stream.writeString(reaction); - } - if ((flags & 2) != 0) { - stream.writeString(offset); - } - stream.writeInt32(limit); - } - } - public static class TL_messages_getPollVotes extends TLObject { public static int constructor = 0xb86e380e; @@ -49609,20 +50300,20 @@ public class TLRPC { } } - public static class TL_help_getAppChangelog extends TLObject { - public static int constructor = 0x9010ef6f; + public static class TL_help_getAppChangelog extends TLObject { + public static int constructor = 0x9010ef6f; - public String prev_app_version; + public String prev_app_version; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Updates.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Updates.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(prev_app_version); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(prev_app_version); + } + } public static class TL_messages_toggleStickerSets extends TLObject { public static int constructor = 0xb5052fea; @@ -49652,22 +50343,22 @@ public class TLRPC { } } - public static class TL_messages_uploadEncryptedFile extends TLObject { - public static int constructor = 0x5057c497; + public static class TL_messages_uploadEncryptedFile extends TLObject { + public static int constructor = 0x5057c497; - public TL_inputEncryptedChat peer; - public InputEncryptedFile file; + public TL_inputEncryptedChat peer; + public InputEncryptedFile file; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return EncryptedFile.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return EncryptedFile.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - peer.serializeToStream(stream); - file.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + peer.serializeToStream(stream); + file.serializeToStream(stream); + } + } public static class TL_messages_searchStickerSets extends TLObject { public static int constructor = 0x35705b8a; @@ -49690,24 +50381,24 @@ public class TLRPC { } } - public static class TL_messages_markDialogUnread extends TLObject { - public static int constructor = 0xc286d98f; + public static class TL_messages_markDialogUnread extends TLObject { + public static int constructor = 0xc286d98f; - public int flags; - public boolean unread; - public InputDialogPeer peer; + public int flags; + public boolean unread; + public InputDialogPeer peer; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - peer.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = unread ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + peer.serializeToStream(stream); + } + } public static class TL_messages_getDialogUnreadMarks extends TLObject { public static int constructor = 0x22e24e22; @@ -49731,97 +50422,97 @@ public class TLRPC { } } - public static class TL_help_setBotUpdatesStatus extends TLObject { - public static int constructor = 0xec22cfcd; + public static class TL_help_setBotUpdatesStatus extends TLObject { + public static int constructor = 0xec22cfcd; - public int pending_updates_count; - public String message; + public int pending_updates_count; + public String message; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(pending_updates_count); - stream.writeString(message); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(pending_updates_count); + stream.writeString(message); + } + } - public static class TL_messages_reorderStickerSets extends TLObject { - public static int constructor = 0x78337739; + public static class TL_messages_reorderStickerSets extends TLObject { + public static int constructor = 0x78337739; - public int flags; - public boolean masks; - public ArrayList order = new ArrayList<>(); + public int flags; + public boolean masks; + public ArrayList order = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = masks ? (flags | 1) : (flags &~ 1); - stream.writeInt32(flags); - stream.writeInt32(0x1cb5c415); - int count = order.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt64(order.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = masks ? (flags | 1) : (flags &~ 1); + stream.writeInt32(flags); + stream.writeInt32(0x1cb5c415); + int count = order.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt64(order.get(a)); + } + } + } - public static class TL_messages_getDocumentByHash extends TLObject { - public static int constructor = 0x338e2464; + public static class TL_messages_getDocumentByHash extends TLObject { + public static int constructor = 0x338e2464; - public byte[] sha256; - public int size; - public String mime_type; + public byte[] sha256; + public int size; + public String mime_type; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Document.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Document.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(sha256); - stream.writeInt32(size); - stream.writeString(mime_type); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(sha256); + stream.writeInt32(size); + stream.writeString(mime_type); + } + } - public static class TL_help_getRecentMeUrls extends TLObject { - public static int constructor = 0x3dc0f114; + public static class TL_help_getRecentMeUrls extends TLObject { + public static int constructor = 0x3dc0f114; - public String referer; + public String referer; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_help_recentMeUrls.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_help_recentMeUrls.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(referer); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(referer); + } + } - public static class TL_help_getDeepLinkInfo extends TLObject { - public static int constructor = 0x3fedc75f; + public static class TL_help_getDeepLinkInfo extends TLObject { + public static int constructor = 0x3fedc75f; - public String path; + public String path; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return help_DeepLinkInfo.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return help_DeepLinkInfo.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(path); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(path); + } + } - public static class TL_channels_readHistory extends TLObject { + public static class TL_channels_readHistory extends TLObject { public static int constructor = 0xcc104937; public InputChannel channel; @@ -49838,55 +50529,55 @@ public class TLRPC { } } - public static class TL_channels_deleteMessages extends TLObject { - public static int constructor = 0x84c1fd4e; + public static class TL_channels_deleteMessages extends TLObject { + public static int constructor = 0x84c1fd4e; - public InputChannel channel; - public ArrayList id = new ArrayList<>(); + public InputChannel channel; + public ArrayList id = new ArrayList<>(); - public static TL_channels_deleteMessages TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_channels_deleteMessages.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_channels_deleteMessages", constructor)); - } else { - return null; - } - } - TL_channels_deleteMessages result = new TL_channels_deleteMessages(); - result.readParams(stream, exception); - return result; - } + public static TL_channels_deleteMessages TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_channels_deleteMessages.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_channels_deleteMessages", constructor)); + } else { + return null; + } + } + TL_channels_deleteMessages result = new TL_channels_deleteMessages(); + result.readParams(stream, exception); + return result; + } - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_messages_affectedMessages.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_messages_affectedMessages.TLdeserialize(stream, constructor, exception); + } - public void readParams(AbstractSerializedData stream, boolean exception) { - channel = InputChannel.TLdeserialize(stream, stream.readInt32(exception), exception); - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - id.add(stream.readInt32(exception)); - } - } + public void readParams(AbstractSerializedData stream, boolean exception) { + channel = InputChannel.TLdeserialize(stream, stream.readInt32(exception), exception); + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + id.add(stream.readInt32(exception)); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - channel.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = id.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt32(id.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + channel.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = id.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt32(id.get(a)); + } + } + } public static class TL_channels_deleteParticipantHistory extends TLObject { public static int constructor = 0x367544db; @@ -50238,22 +50929,22 @@ public class TLRPC { } } - public static class TL_channels_toggleSignatures extends TLObject { - public static int constructor = 0x1f69b606; + public static class TL_channels_toggleSignatures extends TLObject { + public static int constructor = 0x1f69b606; - public InputChannel channel; - public boolean enabled; + public InputChannel channel; + public boolean enabled; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Updates.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Updates.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - channel.serializeToStream(stream); - stream.writeBool(enabled); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + channel.serializeToStream(stream); + stream.writeBool(enabled); + } + } public static class TL_channels_getAdminedPublicChannels extends TLObject { public static int constructor = 0xf8b036af; @@ -50293,82 +50984,82 @@ public class TLRPC { } } - public static class TL_channels_getAdminLog extends TLObject { - public static int constructor = 0x33ddf480; + public static class TL_channels_getAdminLog extends TLObject { + public static int constructor = 0x33ddf480; - public int flags; - public InputChannel channel; - public String q; - public TL_channelAdminLogEventsFilter events_filter; - public ArrayList admins = new ArrayList<>(); - public long max_id; - public long min_id; - public int limit; + public int flags; + public InputChannel channel; + public String q; + public TL_channelAdminLogEventsFilter events_filter; + public ArrayList admins = new ArrayList<>(); + public long max_id; + public long min_id; + public int limit; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_channels_adminLogResults.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_channels_adminLogResults.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(flags); - channel.serializeToStream(stream); - stream.writeString(q); - if ((flags & 1) != 0) { - events_filter.serializeToStream(stream); - } - if ((flags & 2) != 0) { - stream.writeInt32(0x1cb5c415); - int count = admins.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - admins.get(a).serializeToStream(stream); - } - } - stream.writeInt64(max_id); - stream.writeInt64(min_id); - stream.writeInt32(limit); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(flags); + channel.serializeToStream(stream); + stream.writeString(q); + if ((flags & 1) != 0) { + events_filter.serializeToStream(stream); + } + if ((flags & 2) != 0) { + stream.writeInt32(0x1cb5c415); + int count = admins.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + admins.get(a).serializeToStream(stream); + } + } + stream.writeInt64(max_id); + stream.writeInt64(min_id); + stream.writeInt32(limit); + } + } - public static class TL_channels_setStickers extends TLObject { - public static int constructor = 0xea8ca4f9; + public static class TL_channels_setStickers extends TLObject { + public static int constructor = 0xea8ca4f9; - public InputChannel channel; - public InputStickerSet stickerset; + public InputChannel channel; + public InputStickerSet stickerset; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - channel.serializeToStream(stream); - stickerset.serializeToStream(stream); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + channel.serializeToStream(stream); + stickerset.serializeToStream(stream); + } + } - public static class TL_channels_readMessageContents extends TLObject { - public static int constructor = 0xeab5dc38; + public static class TL_channels_readMessageContents extends TLObject { + public static int constructor = 0xeab5dc38; - public InputChannel channel; - public ArrayList id = new ArrayList<>(); + public InputChannel channel; + public ArrayList id = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - channel.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = id.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeInt32(id.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + channel.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = id.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeInt32(id.get(a)); + } + } + } public static class TL_channels_deleteHistory extends TLObject { public static int constructor = 0xaf369d42; @@ -51367,37 +52058,37 @@ public class TLRPC { } } - public static class TL_payments_getSavedInfo extends TLObject { - public static int constructor = 0x227d824b; + public static class TL_payments_getSavedInfo extends TLObject { + public static int constructor = 0x227d824b; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_payments_savedInfo.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_payments_savedInfo.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } - public static class TL_payments_clearSavedInfo extends TLObject { - public static int constructor = 0xd83d70c1; + public static class TL_payments_clearSavedInfo extends TLObject { + public static int constructor = 0xd83d70c1; - public int flags; - public boolean credentials; - public boolean info; + public int flags; + public boolean credentials; + public boolean info; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return Bool.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return Bool.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = credentials ? (flags | 1) : (flags &~ 1); - flags = info ? (flags | 2) : (flags &~ 2); - stream.writeInt32(flags); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = credentials ? (flags | 1) : (flags &~ 1); + flags = info ? (flags | 2) : (flags &~ 2); + stream.writeInt32(flags); + } + } public static class TL_payments_getBankCardData extends TLObject { public static int constructor = 0x2e79d779; @@ -51414,51 +52105,51 @@ public class TLRPC { } } - public static class TL_langpack_getLangPack extends TLObject { - public static int constructor = 0x9ab5c58e; + public static class TL_langpack_getLangPack extends TLObject { + public static int constructor = 0x9ab5c58e; - public String lang_code; + public String lang_code; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_langPackDifference.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_langPackDifference.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(lang_code); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(lang_code); + } + } - public static class TL_langpack_getStrings extends TLObject { - public static int constructor = 0x2e1ee318; + public static class TL_langpack_getStrings extends TLObject { + public static int constructor = 0x2e1ee318; - public String lang_code; - public ArrayList keys = new ArrayList<>(); + public String lang_code; + public ArrayList keys = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - LangPackString object = LangPackString.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + LangPackString object = LangPackString.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(lang_code); - stream.writeInt32(0x1cb5c415); - int count = keys.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - stream.writeString(keys.get(a)); - } - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(lang_code); + stream.writeInt32(0x1cb5c415); + int count = keys.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + stream.writeString(keys.get(a)); + } + } + } public static class TL_langpack_getDifference extends TLObject { public static int constructor = 0xcd984aa5; @@ -51479,27 +52170,27 @@ public class TLRPC { } } - public static class TL_langpack_getLanguages extends TLObject { - public static int constructor = 0x800fd57d; + public static class TL_langpack_getLanguages extends TLObject { + public static int constructor = 0x800fd57d; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - TL_langPackLanguage object = TL_langPackLanguage.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + TL_langPackLanguage object = TL_langPackLanguage.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + } + } public static class TL_langpack_getLanguage extends TLObject { public static int constructor = 0x6a596502; @@ -51677,75 +52368,75 @@ public class TLRPC { } } - //RichText start - public static abstract class RichText extends TLObject { - public String url; - public long webpage_id; - public String email; - public ArrayList texts = new ArrayList<>(); - public RichText parentRichText; + //RichText start + public static abstract class RichText extends TLObject { + public String url; + public long webpage_id; + public String email; + public ArrayList texts = new ArrayList<>(); + public RichText parentRichText; - public static RichText TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - RichText result = null; - switch (constructor) { - case 0x1ccb966a: - result = new TL_textPhone(); - break; - case 0xc7fb5e01: - result = new TL_textSuperscript(); - break; - case 0x81ccf4f: - result = new TL_textImage(); - break; - case 0xc12622c4: - result = new TL_textUnderline(); - break; - case 0xed6a8504: - result = new TL_textSubscript(); - break; - case 0x3c2884c1: - result = new TL_textUrl(); - break; + public static RichText TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + RichText result = null; + switch (constructor) { + case 0x1ccb966a: + result = new TL_textPhone(); + break; + case 0xc7fb5e01: + result = new TL_textSuperscript(); + break; + case 0x81ccf4f: + result = new TL_textImage(); + break; + case 0xc12622c4: + result = new TL_textUnderline(); + break; + case 0xed6a8504: + result = new TL_textSubscript(); + break; + case 0x3c2884c1: + result = new TL_textUrl(); + break; case 0x35553762: result = new TL_textAnchor(); break; - case 0xdc3d824f: - result = new TL_textEmpty(); - break; - case 0xde5a0dd6: - result = new TL_textEmail(); - break; - case 0x744694e0: - result = new TL_textPlain(); - break; - case 0x6724abc4: - result = new TL_textBold(); - break; - case 0x9bf8bb95: - result = new TL_textStrike(); - break; - case 0x7e6260d7: - result = new TL_textConcat(); - break; - case 0xd912a59c: - result = new TL_textItalic(); - break; - case 0x34b8621: - result = new TL_textMarked(); - break; - case 0x6c3f19b9: - result = new TL_textFixed(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in RichText", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + case 0xdc3d824f: + result = new TL_textEmpty(); + break; + case 0xde5a0dd6: + result = new TL_textEmail(); + break; + case 0x744694e0: + result = new TL_textPlain(); + break; + case 0x6724abc4: + result = new TL_textBold(); + break; + case 0x9bf8bb95: + result = new TL_textStrike(); + break; + case 0x7e6260d7: + result = new TL_textConcat(); + break; + case 0xd912a59c: + result = new TL_textItalic(); + break; + case 0x34b8621: + result = new TL_textMarked(); + break; + case 0x6c3f19b9: + result = new TL_textFixed(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in RichText", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } public static class TL_pageBlockList_layer82 extends TL_pageBlockList { public static int constructor = 0x3a58c7f4; @@ -51784,7 +52475,7 @@ public class TLRPC { } } } - //RichText end + //RichText end public static class TL_channels_sendAsPeers extends TLObject { public static int constructor = 0x8356cda9; @@ -51877,223 +52568,223 @@ public class TLRPC { } } - //MessageMedia start - public static abstract class MessageMedia extends TLObject { - public byte[] bytes; - public Audio audio_unused; - public int flags; - public boolean shipping_address_requested; - public Photo photo; - public GeoPoint geo; + //MessageMedia start + public static abstract class MessageMedia extends TLObject { + public byte[] bytes; + public Audio audio_unused; + public int flags; + public boolean shipping_address_requested; + public Photo photo; + public GeoPoint geo; public int heading; - public String currency; - public String description; - public int receipt_msg_id; - public long total_amount; - public String start_param; - public String title; - public String address; - public String provider; - public String venue_id; - public Video video_unused; - public Document document; - public String captionLegacy; - public TL_game game; - public String phone_number; - public String first_name; - public String last_name; - public String vcard; + public String currency; + public String description; + public int receipt_msg_id; + public long total_amount; + public String start_param; + public String title; + public String address; + public String provider; + public String venue_id; + public Video video_unused; + public Document document; + public String captionLegacy; + public TL_game game; + public String phone_number; + public String first_name; + public String last_name; + public String vcard; public long user_id; - public WebPage webpage; - public String venue_type; - public boolean test; - public int period; + public WebPage webpage; + public String venue_type; + public boolean test; + public int period; public int ttl_seconds; public int proximity_notification_radius; - public static MessageMedia TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - MessageMedia result = null; - switch (constructor) { - case 0x29632a36: - result = new TL_messageMediaUnsupported_old(); - break; - case 0xc6b68300: - result = new TL_messageMediaAudio_layer45(); - break; - case 0xc8c45a2a: - result = new TL_messageMediaPhoto_old(); - break; - case 0x84551347: - result = new TL_messageMediaInvoice(); - break; - case 0x9f84f49e: - result = new TL_messageMediaUnsupported(); - break; - case 0x3ded6320: - result = new TL_messageMediaEmpty(); - break; - case 0x7912b71f: - result = new TL_messageMediaVenue_layer71(); - break; + public static MessageMedia TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + MessageMedia result = null; + switch (constructor) { + case 0x29632a36: + result = new TL_messageMediaUnsupported_old(); + break; + case 0xc6b68300: + result = new TL_messageMediaAudio_layer45(); + break; + case 0xc8c45a2a: + result = new TL_messageMediaPhoto_old(); + break; + case 0x84551347: + result = new TL_messageMediaInvoice(); + break; + case 0x9f84f49e: + result = new TL_messageMediaUnsupported(); + break; + case 0x3ded6320: + result = new TL_messageMediaEmpty(); + break; + case 0x7912b71f: + result = new TL_messageMediaVenue_layer71(); + break; case 0xb940c666: result = new TL_messageMediaGeoLive(); break; - case 0x7c3c2609: - result = new TL_messageMediaGeoLive_layer119(); - break; - case 0x2ec0533f: - result = new TL_messageMediaVenue(); - break; - case 0xa2d24290: - result = new TL_messageMediaVideo_old(); - break; - case 0x2fda2204: - result = new TL_messageMediaDocument_old(); - break; - case 0xf3e02ea8: - result = new TL_messageMediaDocument_layer68(); - break; - case 0xfdb19008: - result = new TL_messageMediaGame(); - break; + case 0x7c3c2609: + result = new TL_messageMediaGeoLive_layer119(); + break; + case 0x2ec0533f: + result = new TL_messageMediaVenue(); + break; + case 0xa2d24290: + result = new TL_messageMediaVideo_old(); + break; + case 0x2fda2204: + result = new TL_messageMediaDocument_old(); + break; + case 0xf3e02ea8: + result = new TL_messageMediaDocument_layer68(); + break; + case 0xfdb19008: + result = new TL_messageMediaGame(); + break; case 0x7c4414d3: result = new TL_messageMediaDocument_layer74(); break; - case 0x5e7d2f39: - result = new TL_messageMediaContact_layer81(); - break; - case 0x695150d7: - result = new TL_messageMediaPhoto(); - break; + case 0x5e7d2f39: + result = new TL_messageMediaContact_layer81(); + break; + case 0x695150d7: + result = new TL_messageMediaPhoto(); + break; case 0x4bd6e798: result = new TL_messageMediaPoll(); break; case 0xb5223b0f: result = new TL_messageMediaPhoto_layer74(); break; - case 0x3d8ce53d: - result = new TL_messageMediaPhoto_layer68(); - break; - case 0x5bcf1675: - result = new TL_messageMediaVideo_layer45(); - break; + case 0x3d8ce53d: + result = new TL_messageMediaPhoto_layer68(); + break; + case 0x5bcf1675: + result = new TL_messageMediaVideo_layer45(); + break; case 0x3f7ee58b: result = new TL_messageMediaDice(); break; case 0x638fe46b: result = new TL_messageMediaDice_layer111(); break; - case 0x56e0d474: - result = new TL_messageMediaGeo(); - break; - case 0xa32dd600: - result = new TL_messageMediaWebPage(); - break; - case 0x9cb070d7: - result = new TL_messageMediaDocument(); - break; - case 0xcbf24940: - result = new TL_messageMediaContact_layer131(); - break; + case 0x56e0d474: + result = new TL_messageMediaGeo(); + break; + case 0xa32dd600: + result = new TL_messageMediaWebPage(); + break; + case 0x9cb070d7: + result = new TL_messageMediaDocument(); + break; + case 0xcbf24940: + result = new TL_messageMediaContact_layer131(); + break; case 0x70322949: result = new TL_messageMediaContact(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in MessageMedia", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - if (result.video_unused != null) { - TL_messageMediaDocument mediaDocument = new TL_messageMediaDocument(); - if (result.video_unused instanceof TL_videoEncrypted) { - mediaDocument.document = new TL_documentEncrypted(); - mediaDocument.document.key = result.video_unused.key; - mediaDocument.document.iv = result.video_unused.iv; - } else { - mediaDocument.document = new TL_document(); - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in MessageMedia", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + if (result.video_unused != null) { + TL_messageMediaDocument mediaDocument = new TL_messageMediaDocument(); + if (result.video_unused instanceof TL_videoEncrypted) { + mediaDocument.document = new TL_documentEncrypted(); + mediaDocument.document.key = result.video_unused.key; + mediaDocument.document.iv = result.video_unused.iv; + } else { + mediaDocument.document = new TL_document(); + } mediaDocument.flags = 3; - mediaDocument.document.file_reference = new byte[0]; - mediaDocument.document.id = result.video_unused.id; - mediaDocument.document.access_hash = result.video_unused.access_hash; - mediaDocument.document.date = result.video_unused.date; - if (result.video_unused.mime_type != null) { - mediaDocument.document.mime_type = result.video_unused.mime_type; - } else { - mediaDocument.document.mime_type = "video/mp4"; - } - mediaDocument.document.size = result.video_unused.size; - mediaDocument.document.thumbs.add(result.video_unused.thumb); - mediaDocument.document.dc_id = result.video_unused.dc_id; - mediaDocument.captionLegacy = result.captionLegacy; - TL_documentAttributeVideo attributeVideo = new TL_documentAttributeVideo(); - attributeVideo.w = result.video_unused.w; - attributeVideo.h = result.video_unused.h; - attributeVideo.duration = result.video_unused.duration; - mediaDocument.document.attributes.add(attributeVideo); - result = mediaDocument; - if (mediaDocument.captionLegacy == null) { - mediaDocument.captionLegacy = ""; - } - } else if (result.audio_unused != null) { - TL_messageMediaDocument mediaDocument = new TL_messageMediaDocument(); - if (result.audio_unused instanceof TL_audioEncrypted) { - mediaDocument.document = new TL_documentEncrypted(); - mediaDocument.document.key = result.audio_unused.key; - mediaDocument.document.iv = result.audio_unused.iv; - } else { - mediaDocument.document = new TL_document(); - } + mediaDocument.document.file_reference = new byte[0]; + mediaDocument.document.id = result.video_unused.id; + mediaDocument.document.access_hash = result.video_unused.access_hash; + mediaDocument.document.date = result.video_unused.date; + if (result.video_unused.mime_type != null) { + mediaDocument.document.mime_type = result.video_unused.mime_type; + } else { + mediaDocument.document.mime_type = "video/mp4"; + } + mediaDocument.document.size = result.video_unused.size; + mediaDocument.document.thumbs.add(result.video_unused.thumb); + mediaDocument.document.dc_id = result.video_unused.dc_id; + mediaDocument.captionLegacy = result.captionLegacy; + TL_documentAttributeVideo attributeVideo = new TL_documentAttributeVideo(); + attributeVideo.w = result.video_unused.w; + attributeVideo.h = result.video_unused.h; + attributeVideo.duration = result.video_unused.duration; + mediaDocument.document.attributes.add(attributeVideo); + result = mediaDocument; + if (mediaDocument.captionLegacy == null) { + mediaDocument.captionLegacy = ""; + } + } else if (result.audio_unused != null) { + TL_messageMediaDocument mediaDocument = new TL_messageMediaDocument(); + if (result.audio_unused instanceof TL_audioEncrypted) { + mediaDocument.document = new TL_documentEncrypted(); + mediaDocument.document.key = result.audio_unused.key; + mediaDocument.document.iv = result.audio_unused.iv; + } else { + mediaDocument.document = new TL_document(); + } mediaDocument.flags = 3; - mediaDocument.document.file_reference = new byte[0]; - mediaDocument.document.id = result.audio_unused.id; - mediaDocument.document.access_hash = result.audio_unused.access_hash; - mediaDocument.document.date = result.audio_unused.date; - if (result.audio_unused.mime_type != null) { - mediaDocument.document.mime_type = result.audio_unused.mime_type; - } else { - mediaDocument.document.mime_type = "audio/ogg"; - } - mediaDocument.document.size = result.audio_unused.size; - TL_photoSizeEmpty thumb = new TL_photoSizeEmpty(); + mediaDocument.document.file_reference = new byte[0]; + mediaDocument.document.id = result.audio_unused.id; + mediaDocument.document.access_hash = result.audio_unused.access_hash; + mediaDocument.document.date = result.audio_unused.date; + if (result.audio_unused.mime_type != null) { + mediaDocument.document.mime_type = result.audio_unused.mime_type; + } else { + mediaDocument.document.mime_type = "audio/ogg"; + } + mediaDocument.document.size = result.audio_unused.size; + TL_photoSizeEmpty thumb = new TL_photoSizeEmpty(); thumb.type = "s"; - mediaDocument.document.thumbs.add(thumb); - mediaDocument.document.dc_id = result.audio_unused.dc_id; - mediaDocument.captionLegacy = result.captionLegacy; - TL_documentAttributeAudio attributeAudio = new TL_documentAttributeAudio(); - attributeAudio.duration = result.audio_unused.duration; - attributeAudio.voice = true; - mediaDocument.document.attributes.add(attributeAudio); - result = mediaDocument; - if (mediaDocument.captionLegacy == null) { - mediaDocument.captionLegacy = ""; - } - } - } - return result; - } - } - //MessageMedia end + mediaDocument.document.thumbs.add(thumb); + mediaDocument.document.dc_id = result.audio_unused.dc_id; + mediaDocument.captionLegacy = result.captionLegacy; + TL_documentAttributeAudio attributeAudio = new TL_documentAttributeAudio(); + attributeAudio.duration = result.audio_unused.duration; + attributeAudio.voice = true; + mediaDocument.document.attributes.add(attributeAudio); + result = mediaDocument; + if (mediaDocument.captionLegacy == null) { + mediaDocument.captionLegacy = ""; + } + } + } + return result; + } + } + //MessageMedia end - //PageBlock start - public static class TL_pageBlockAuthorDate_layer60 extends TL_pageBlockAuthorDate { - public static int constructor = 0x3d5b64f2; + //PageBlock start + public static class TL_pageBlockAuthorDate_layer60 extends TL_pageBlockAuthorDate { + public static int constructor = 0x3d5b64f2; - public void readParams(AbstractSerializedData stream, boolean exception) { - String authorString = stream.readString(exception); - author = new TL_textPlain(); - ((TL_textPlain) author).text = authorString; - published_date = stream.readInt32(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + String authorString = stream.readString(exception); + author = new TL_textPlain(); + ((TL_textPlain) author).text = authorString; + published_date = stream.readInt32(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeString(((TL_textPlain) author).text); - stream.writeInt32(published_date); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeString(((TL_textPlain) author).text); + stream.writeInt32(published_date); + } + } public static class TL_pageBlockEmbedPost_layer82 extends TL_pageBlockEmbedPost { public static int constructor = 0x292c7be9; @@ -52319,7 +53010,7 @@ public class TLRPC { caption.text.serializeToStream(stream); } } - //PageBlock end + //PageBlock end //EncryptedChat start public static abstract class EncryptedChat extends TLObject { @@ -52342,8 +53033,8 @@ public class TLRPC { public int layer; //custom public int seq_in; //custom public int seq_out; //custom - public int in_seq_no; //custom - public int mtproto_seq; //custom + public int in_seq_no; //custom + public int mtproto_seq; //custom public byte[] key_hash; //custom public short key_use_count_in; //custom public short key_use_count_out; //custom @@ -52414,28 +53105,28 @@ public class TLRPC { public String message; public MessageMedia media; public int flags; - public boolean mentioned; - public boolean media_unread; - public boolean out; - public boolean unread; + public boolean mentioned; + public boolean media_unread; + public boolean out; + public boolean unread; public ArrayList entities = new ArrayList<>(); - public String via_bot_name; + public String via_bot_name; public ReplyMarkup reply_markup; - public int views; + public int views; public int forwards; public MessageReplies replies; - public int edit_date; - public boolean silent; - public boolean post; + public int edit_date; + public boolean silent; + public boolean post; public boolean from_scheduled; public boolean legacy; public boolean edit_hide; public boolean pinned; - public MessageFwdHeader fwd_from; - public long via_bot_id; + public MessageFwdHeader fwd_from; + public long via_bot_id; public TL_messageReplyHeader reply_to; public String post_author; - public long grouped_id; + public long grouped_id; public TL_messageReactions reactions; public ArrayList restriction_reason = new ArrayList<>(); public int ttl_period; @@ -52443,7 +53134,7 @@ public class TLRPC { public int send_state = 0; //custom public int fwd_msg_id = 0; //custom public String attachPath = ""; //custom - public HashMap params; //custom + public HashMap params; //custom public long random_id; //custom public int local_id = 0; //custom public long dialog_id; //custom @@ -52452,9 +53143,9 @@ public class TLRPC { public int layer; //custom public int seq_in; //custom public int seq_out; //custom - public boolean with_my_score; + public boolean with_my_score; public Message replyMessage; //custom - public int reqId; //custom + public int reqId; //custom public int realId; //custom public int stickerVerified = 1; //custom public boolean isThreadMessage; //custom @@ -52471,36 +53162,36 @@ public class TLRPC { case 0xc3060325: result = new TL_message_old4(); break; - case 0x555555fa: - result = new TL_message_secret(); - break; - case 0x555555f9: - result = new TL_message_secret_layer72(); - break; + case 0x555555fa: + result = new TL_message_secret(); + break; + case 0x555555f9: + result = new TL_message_secret_layer72(); + break; case 0x90dddc11: result = new TL_message_layer72(); break; - case 0xc09be45f: - result = new TL_message_layer68(); - break; - case 0xc992e15c: - result = new TL_message_layer47(); - break; - case 0x5ba66c13: - result = new TL_message_old7(); - break; + case 0xc09be45f: + result = new TL_message_layer68(); + break; + case 0xc992e15c: + result = new TL_message_layer47(); + break; + case 0x5ba66c13: + result = new TL_message_old7(); + break; case 0xc06b9607: - result = new TL_messageService_layer48(); - break; + result = new TL_messageService_layer48(); + break; case 0x83e5de54: result = new TL_messageEmpty_layer122(); break; case 0x2bebfa86: result = new TL_message_old6(); break; - case 0x44f9b43d: - result = new TL_message_layer104(); - break; + case 0x44f9b43d: + result = new TL_message_layer104(); + break; case 0x90a6ca84: result = new TL_messageEmpty(); break; @@ -52541,23 +53232,26 @@ public class TLRPC { result = new TL_message_layer131(); break; case 0x85d6cbe2: + result = new TL_message_layer135(); + break; + case 0x38116ee0: result = new TL_message(); break; - case 0x9e19a1f6: - result = new TL_messageService_layer118(); - break; + case 0x9e19a1f6: + result = new TL_messageService_layer118(); + break; case 0x286fa604: result = new TL_messageService_layer123(); break; case 0x2b085862: result = new TL_messageService(); break; - case 0xf07814c8: - result = new TL_message_old5(); - break; + case 0xf07814c8: + result = new TL_message_old5(); + break; } if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in Message", constructor)); + throw new RuntimeException(String.format("can't parse magic %x in Message", constructor)); } if (result != null) { result.readParams(stream, exception); @@ -52569,28 +53263,28 @@ public class TLRPC { } public void readAttachPath(AbstractSerializedData stream, long currentUserId) { - boolean hasMedia = media != null && !(media instanceof TL_messageMediaEmpty) && !(media instanceof TL_messageMediaWebPage); - boolean fixCaption = !TextUtils.isEmpty(message) && - (media instanceof TL_messageMediaPhoto_old || - media instanceof TL_messageMediaPhoto_layer68 || - media instanceof TL_messageMediaPhoto_layer74 || - media instanceof TL_messageMediaDocument_old || - media instanceof TL_messageMediaDocument_layer68 || - media instanceof TL_messageMediaDocument_layer74) - && message.startsWith("-1"); - if ((out || peer_id != null && from_id != null && peer_id.user_id != 0 && peer_id.user_id == from_id.user_id && from_id.user_id == currentUserId) && (id < 0 || hasMedia || send_state == 3) || legacy) { - if (hasMedia && fixCaption) { - if (message.length() > 6 && message.charAt(2) == '_') { - params = new HashMap<>(); - params.put("ve", message); - } - if (params != null || message.length() == 2) { - message = ""; - } - } - if (stream.remaining() > 0) { - attachPath = stream.readString(false); - if (attachPath != null) { + boolean hasMedia = media != null && !(media instanceof TL_messageMediaEmpty) && !(media instanceof TL_messageMediaWebPage); + boolean fixCaption = !TextUtils.isEmpty(message) && + (media instanceof TL_messageMediaPhoto_old || + media instanceof TL_messageMediaPhoto_layer68 || + media instanceof TL_messageMediaPhoto_layer74 || + media instanceof TL_messageMediaDocument_old || + media instanceof TL_messageMediaDocument_layer68 || + media instanceof TL_messageMediaDocument_layer74) + && message.startsWith("-1"); + if ((out || peer_id != null && from_id != null && peer_id.user_id != 0 && peer_id.user_id == from_id.user_id && from_id.user_id == currentUserId) && (id < 0 || hasMedia || send_state == 3) || legacy) { + if (hasMedia && fixCaption) { + if (message.length() > 6 && message.charAt(2) == '_') { + params = new HashMap<>(); + params.put("ve", message); + } + if (params != null || message.length() == 2) { + message = ""; + } + } + if (stream.remaining() > 0) { + attachPath = stream.readString(false); + if (attachPath != null) { if ((id < 0 || send_state == 3 || legacy) && attachPath.startsWith("||")) { String args[] = attachPath.split("\\|\\|"); if (args.length > 0) { @@ -52612,15 +53306,15 @@ public class TLRPC { attachPath = attachPath.trim(); } } - } - } - if ((flags & MESSAGE_FLAG_FWD) != 0 && id < 0) { - fwd_msg_id = stream.readInt32(false); - } - } + } + } + if ((flags & MESSAGE_FLAG_FWD) != 0 && id < 0) { + fwd_msg_id = stream.readInt32(false); + } + } - protected void writeAttachPath(AbstractSerializedData stream) { - if (this instanceof TL_message_secret || this instanceof TL_message_secret_layer72) { + protected void writeAttachPath(AbstractSerializedData stream) { + if (this instanceof TL_message_secret || this instanceof TL_message_secret_layer72) { String path = attachPath != null ? attachPath : ""; if (send_state == 1 && params != null && params.size() > 0) { for (HashMap.Entry entry : params.entrySet()) { @@ -52629,43 +53323,43 @@ public class TLRPC { path = "||" + path; } stream.writeString(path); - } else { - String path = !TextUtils.isEmpty(attachPath) ? attachPath : " "; - if (legacy) { - if (params == null) { + } else { + String path = !TextUtils.isEmpty(attachPath) ? attachPath : " "; + if (legacy) { + if (params == null) { params = new HashMap<>(); } - layer = LAYER; + layer = LAYER; params.put("legacy_layer", "" + LAYER); } - if ((id < 0 || send_state == 3 || legacy) && params != null && params.size() > 0) { - for (HashMap.Entry entry : params.entrySet()) { - path = entry.getKey() + "|=|" + entry.getValue() + "||" + path; - } - path = "||" + path; - } - stream.writeString(path); - if ((flags & MESSAGE_FLAG_FWD) != 0 && id < 0) { - stream.writeInt32(fwd_msg_id); - } - } - } + if ((id < 0 || send_state == 3 || legacy) && params != null && params.size() > 0) { + for (HashMap.Entry entry : params.entrySet()) { + path = entry.getKey() + "|=|" + entry.getValue() + "||" + path; + } + path = "||" + path; + } + stream.writeString(path); + if ((flags & MESSAGE_FLAG_FWD) != 0 && id < 0) { + stream.writeInt32(fwd_msg_id); + } + } + } } - public static class TL_messageEmpty_layer122 extends TL_messageEmpty { - public static int constructor = 0x83e5de54; + public static class TL_messageEmpty_layer122 extends TL_messageEmpty { + public static int constructor = 0x83e5de54; - public void readParams(AbstractSerializedData stream, boolean exception) { - id = stream.readInt32(exception); - peer_id = new TL_peerUser(); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + id = stream.readInt32(exception); + peer_id = new TL_peerUser(); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(id); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(id); + } + } public static class TL_messageEmpty extends Message { public static int constructor = 0x90a6ca84; @@ -52690,39 +53384,39 @@ public class TLRPC { } } - public static class TL_messageService_old2 extends TL_messageService { - public static int constructor = 0x1d86f70e; + public static class TL_messageService_old2 extends TL_messageService { + public static int constructor = 0x1d86f70e; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; - id = stream.readInt32(exception); + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + id = stream.readInt32(exception); from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - date = stream.readInt32(exception); - action = MessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); - flags |= MESSAGE_FLAG_HAS_FROM_ID; - } + date = stream.readInt32(exception); + action = MessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); + flags |= MESSAGE_FLAG_HAS_FROM_ID; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); - stream.writeInt32(flags); - stream.writeInt32(id); - stream.writeInt32((int) from_id.user_id); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + stream.writeInt32(flags); + stream.writeInt32(id); + stream.writeInt32((int) from_id.user_id); peer_id.serializeToStream(stream); - stream.writeInt32(date); - action.serializeToStream(stream); - } - } + stream.writeInt32(date); + action.serializeToStream(stream); + } + } public static class TL_message_layer72 extends TL_message { public static int constructor = 0x90dddc11; @@ -52754,12 +53448,12 @@ public class TLRPC { message = stream.readString(exception); if ((flags & 512) != 0) { media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null) { - ttl = media.ttl_seconds; - } - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } + if (media != null) { + ttl = media.ttl_seconds; + } + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } } if ((flags & 64) != 0) { reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); @@ -52843,350 +53537,350 @@ public class TLRPC { } } - public static class TL_message_layer68 extends TL_message { - public static int constructor = 0xc09be45f; + public static class TL_message_layer68 extends TL_message { + public static int constructor = 0xc09be45f; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; - silent = (flags & 8192) != 0; - post = (flags & 16384) != 0; - with_my_score = (flags & 1073741824) != 0; - id = stream.readInt32(exception); - if ((flags & 256) != 0) { + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + silent = (flags & 8192) != 0; + post = (flags & 16384) != 0; + with_my_score = (flags & 1073741824) != 0; + id = stream.readInt32(exception); + if ((flags & 256) != 0) { from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); - } - peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if (from_id == null) { - from_id = peer_id; - } - if ((flags & 4) != 0) { - fwd_from = MessageFwdHeader.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 2048) != 0) { - via_bot_id = stream.readInt32(exception); - } - if ((flags & 8) != 0) { - reply_to = new TLRPC.TL_messageReplyHeader(); - reply_to.reply_to_msg_id = stream.readInt32(exception); - } - date = stream.readInt32(exception); - message = stream.readString(exception); - if ((flags & 512) != 0) { - media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } - } else { - media = new TL_messageMediaEmpty(); - } - if ((flags & 64) != 0) { - reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 128) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - } - if ((flags & 1024) != 0) { - views = stream.readInt32(exception); - } - if ((flags & 32768) != 0) { - edit_date = stream.readInt32(exception); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); - flags = silent ? (flags | 8192) : (flags &~ 8192); - flags = post ? (flags | 16384) : (flags &~ 16384); - flags = with_my_score ? (flags | 1073741824) : (flags &~ 1073741824); - stream.writeInt32(flags); - stream.writeInt32(id); - if ((flags & 256) != 0) { - stream.writeInt32((int) from_id.user_id); - } - peer_id.serializeToStream(stream); - if ((flags & 4) != 0) { - fwd_from.serializeToStream(stream); - } - if ((flags & 2048) != 0) { - stream.writeInt32((int) via_bot_id); - } - if ((flags & 8) != 0) { - stream.writeInt32(reply_to.reply_to_msg_id); - } - stream.writeInt32(date); - stream.writeString(message); - if ((flags & 512) != 0) { - media.serializeToStream(stream); - } - if ((flags & 64) != 0) { - reply_markup.serializeToStream(stream); - } - if ((flags & 128) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - if ((flags & 1024) != 0) { - stream.writeInt32(views); - } - if ((flags & 32768) != 0) { - stream.writeInt32(edit_date); - } - writeAttachPath(stream); - } - } - - public static class TL_message_layer47 extends TL_message { - public static int constructor = 0xc992e15c; - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; - id = stream.readInt32(exception); - if ((flags & 256) != 0) { - from_id = new TLRPC.TL_peerUser(); - from_id.user_id = stream.readInt32(exception); - } - peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if (from_id == null) { - from_id = peer_id; - } - if ((flags & 4) != 0) { - fwd_from = new TL_messageFwdHeader(); - Peer peer = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if (peer != null) { - fwd_from.from_id = peer; - fwd_from.flags |= 1; - } - fwd_from.date = stream.readInt32(exception); - } - if ((flags & 2048) != 0) { - via_bot_id = stream.readInt32(exception); - } - if ((flags & 8) != 0) { - reply_to = new TLRPC.TL_messageReplyHeader(); - reply_to.reply_to_msg_id = stream.readInt32(exception); - } - date = stream.readInt32(exception); - message = stream.readString(exception); - if ((flags & 512) != 0) { - media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } - } else { - media = new TL_messageMediaEmpty(); - } - if ((flags & 64) != 0) { - reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 128) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - } - if ((flags & 1024) != 0) { - views = stream.readInt32(exception); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); - stream.writeInt32(flags); - stream.writeInt32(id); - if ((flags & 256) != 0) { - stream.writeInt32((int) from_id.user_id); - } - peer_id.serializeToStream(stream); - if ((flags & 4) != 0) { - if (fwd_from.from_id != null) { - fwd_from.from_id.serializeToStream(stream); - } - stream.writeInt32(fwd_from.date); - } - if ((flags & 2048) != 0) { - stream.writeInt32((int) via_bot_id); - } - if ((flags & 8) != 0) { - stream.writeInt32(reply_to.reply_to_msg_id); - } - stream.writeInt32(date); - stream.writeString(message); - if ((flags & 512) != 0) { - media.serializeToStream(stream); - } - if ((flags & 64) != 0) { - reply_markup.serializeToStream(stream); - } - if ((flags & 128) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - if ((flags & 1024) != 0) { - stream.writeInt32(views); - } - writeAttachPath(stream); - } - } - - public static class TL_message_old7 extends TL_message { - public static int constructor = 0x5ba66c13; - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; - id = stream.readInt32(exception); - if ((flags & 256) != 0) { - from_id = new TLRPC.TL_peerUser(); - from_id.user_id = stream.readInt32(exception); - } + } peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); if (from_id == null) { from_id = peer_id; } - if ((flags & 4) != 0) { - fwd_from = new TL_messageFwdHeader(); - Peer peer = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if (peer != null) { - fwd_from.from_id = peer; - fwd_from.flags |= 1; - } - fwd_from.date = stream.readInt32(exception); - } - if ((flags & 8) != 0) { + if ((flags & 4) != 0) { + fwd_from = MessageFwdHeader.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 2048) != 0) { + via_bot_id = stream.readInt32(exception); + } + if ((flags & 8) != 0) { reply_to = new TLRPC.TL_messageReplyHeader(); reply_to.reply_to_msg_id = stream.readInt32(exception); - } - date = stream.readInt32(exception); - message = stream.readString(exception); - if ((flags & 512) != 0) { - media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } - } else { - media = new TL_messageMediaEmpty(); - } + } + date = stream.readInt32(exception); + message = stream.readString(exception); + if ((flags & 512) != 0) { + media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + } else { + media = new TL_messageMediaEmpty(); + } if ((flags & 64) != 0) { - reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 128) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - } - if ((flags & 1024) != 0) { - views = stream.readInt32(exception); - } - } + reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 128) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + } + if ((flags & 1024) != 0) { + views = stream.readInt32(exception); + } + if ((flags & 32768) != 0) { + edit_date = stream.readInt32(exception); + } + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); - stream.writeInt32(flags); - stream.writeInt32(id); - if ((flags & 256) != 0) { - stream.writeInt32((int) from_id.user_id); - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = silent ? (flags | 8192) : (flags &~ 8192); + flags = post ? (flags | 16384) : (flags &~ 16384); + flags = with_my_score ? (flags | 1073741824) : (flags &~ 1073741824); + stream.writeInt32(flags); + stream.writeInt32(id); + if ((flags & 256) != 0) { + stream.writeInt32((int) from_id.user_id); + } peer_id.serializeToStream(stream); if ((flags & 4) != 0) { - if (fwd_from.from_id != null) { + fwd_from.serializeToStream(stream); + } + if ((flags & 2048) != 0) { + stream.writeInt32((int) via_bot_id); + } + if ((flags & 8) != 0) { + stream.writeInt32(reply_to.reply_to_msg_id); + } + stream.writeInt32(date); + stream.writeString(message); + if ((flags & 512) != 0) { + media.serializeToStream(stream); + } + if ((flags & 64) != 0) { + reply_markup.serializeToStream(stream); + } + if ((flags & 128) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + if ((flags & 1024) != 0) { + stream.writeInt32(views); + } + if ((flags & 32768) != 0) { + stream.writeInt32(edit_date); + } + writeAttachPath(stream); + } + } + + public static class TL_message_layer47 extends TL_message { + public static int constructor = 0xc992e15c; + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + id = stream.readInt32(exception); + if ((flags & 256) != 0) { + from_id = new TLRPC.TL_peerUser(); + from_id.user_id = stream.readInt32(exception); + } + peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + if (from_id == null) { + from_id = peer_id; + } + if ((flags & 4) != 0) { + fwd_from = new TL_messageFwdHeader(); + Peer peer = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + if (peer != null) { + fwd_from.from_id = peer; + fwd_from.flags |= 1; + } + fwd_from.date = stream.readInt32(exception); + } + if ((flags & 2048) != 0) { + via_bot_id = stream.readInt32(exception); + } + if ((flags & 8) != 0) { + reply_to = new TLRPC.TL_messageReplyHeader(); + reply_to.reply_to_msg_id = stream.readInt32(exception); + } + date = stream.readInt32(exception); + message = stream.readString(exception); + if ((flags & 512) != 0) { + media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + } else { + media = new TL_messageMediaEmpty(); + } + if ((flags & 64) != 0) { + reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 128) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + } + if ((flags & 1024) != 0) { + views = stream.readInt32(exception); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + stream.writeInt32(flags); + stream.writeInt32(id); + if ((flags & 256) != 0) { + stream.writeInt32((int) from_id.user_id); + } + peer_id.serializeToStream(stream); + if ((flags & 4) != 0) { + if (fwd_from.from_id != null) { fwd_from.from_id.serializeToStream(stream); - } - stream.writeInt32(fwd_from.date); - } - if ((flags & 8) != 0) { - stream.writeInt32(reply_to.reply_to_msg_id); - } - stream.writeInt32(date); - stream.writeString(message); - if ((flags & 512) != 0) { - media.serializeToStream(stream); - } - if ((flags & 64) != 0) { - reply_markup.serializeToStream(stream); - } - if ((flags & 128) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - if ((flags & 1024) != 0) { - stream.writeInt32(views); - } - writeAttachPath(stream); - } - } + } + stream.writeInt32(fwd_from.date); + } + if ((flags & 2048) != 0) { + stream.writeInt32((int) via_bot_id); + } + if ((flags & 8) != 0) { + stream.writeInt32(reply_to.reply_to_msg_id); + } + stream.writeInt32(date); + stream.writeString(message); + if ((flags & 512) != 0) { + media.serializeToStream(stream); + } + if ((flags & 64) != 0) { + reply_markup.serializeToStream(stream); + } + if ((flags & 128) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + if ((flags & 1024) != 0) { + stream.writeInt32(views); + } + writeAttachPath(stream); + } + } + + public static class TL_message_old7 extends TL_message { + public static int constructor = 0x5ba66c13; + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + id = stream.readInt32(exception); + if ((flags & 256) != 0) { + from_id = new TLRPC.TL_peerUser(); + from_id.user_id = stream.readInt32(exception); + } + peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + if (from_id == null) { + from_id = peer_id; + } + if ((flags & 4) != 0) { + fwd_from = new TL_messageFwdHeader(); + Peer peer = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + if (peer != null) { + fwd_from.from_id = peer; + fwd_from.flags |= 1; + } + fwd_from.date = stream.readInt32(exception); + } + if ((flags & 8) != 0) { + reply_to = new TLRPC.TL_messageReplyHeader(); + reply_to.reply_to_msg_id = stream.readInt32(exception); + } + date = stream.readInt32(exception); + message = stream.readString(exception); + if ((flags & 512) != 0) { + media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + } else { + media = new TL_messageMediaEmpty(); + } + if ((flags & 64) != 0) { + reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 128) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + } + if ((flags & 1024) != 0) { + views = stream.readInt32(exception); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + stream.writeInt32(flags); + stream.writeInt32(id); + if ((flags & 256) != 0) { + stream.writeInt32((int) from_id.user_id); + } + peer_id.serializeToStream(stream); + if ((flags & 4) != 0) { + if (fwd_from.from_id != null) { + fwd_from.from_id.serializeToStream(stream); + } + stream.writeInt32(fwd_from.date); + } + if ((flags & 8) != 0) { + stream.writeInt32(reply_to.reply_to_msg_id); + } + stream.writeInt32(date); + stream.writeString(message); + if ((flags & 512) != 0) { + media.serializeToStream(stream); + } + if ((flags & 64) != 0) { + reply_markup.serializeToStream(stream); + } + if ((flags & 128) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + if ((flags & 1024) != 0) { + stream.writeInt32(views); + } + writeAttachPath(stream); + } + } public static class TL_messageForwarded_old2 extends Message { public static int constructor = 0xa367e716; @@ -53194,34 +53888,34 @@ public class TLRPC { public void readParams(AbstractSerializedData stream, boolean exception) { flags = stream.readInt32(exception); - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; id = stream.readInt32(exception); - fwd_from = new TL_messageFwdHeader(); - fwd_from.from_id = new TLRPC.TL_peerUser(); - fwd_from.from_id.user_id = stream.readInt32(exception); - fwd_from.flags |= 1; - fwd_from.date = stream.readInt32(exception); + fwd_from = new TL_messageFwdHeader(); + fwd_from.from_id = new TLRPC.TL_peerUser(); + fwd_from.from_id.user_id = stream.readInt32(exception); + fwd_from.flags |= 1; + fwd_from.date = stream.readInt32(exception); from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); date = stream.readInt32(exception); message = stream.readString(exception); flags |= MESSAGE_FLAG_FWD | MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA; - media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } - } + media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); stream.writeInt32(flags); stream.writeInt32(id); stream.writeInt32((int) fwd_from.from_id.user_id); @@ -53235,6 +53929,187 @@ public class TLRPC { } public static class TL_message extends Message { + public static int constructor = 0x38116ee0; + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + silent = (flags & 8192) != 0; + post = (flags & 16384) != 0; + from_scheduled = (flags & 262144) != 0; + legacy = (flags & 524288) != 0; + edit_hide = (flags & 2097152) != 0; + pinned = (flags & 16777216) != 0; + noforwards = (flags & 67108864) != 0; + id = stream.readInt32(exception); + if ((flags & 256) != 0) { + from_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + } + peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 4) != 0) { + fwd_from = MessageFwdHeader.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 2048) != 0) { + via_bot_id = stream.readInt64(exception); + } + if ((flags & 8) != 0) { + reply_to = TL_messageReplyHeader.TLdeserialize(stream, stream.readInt32(exception), exception); + } + date = stream.readInt32(exception); + message = stream.readString(exception); + if ((flags & 512) != 0) { + media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + if (media != null) { + ttl = media.ttl_seconds; + } + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + } + if ((flags & 64) != 0) { + reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 128) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + } + if ((flags & 1024) != 0) { + views = stream.readInt32(exception); + } + if ((flags & 1024) != 0) { + forwards = stream.readInt32(exception); + } + if ((flags & 8388608) != 0) { + replies = MessageReplies.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 32768) != 0) { + edit_date = stream.readInt32(exception); + } + if ((flags & 65536) != 0) { + post_author = stream.readString(exception); + } + if ((flags & 131072) != 0) { + grouped_id = stream.readInt64(exception); + } + if ((flags & 1048576) != 0) { + reactions = TL_messageReactions.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 4194304) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + TL_restrictionReason object = TL_restrictionReason.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + restriction_reason.add(object); + } + } + if ((flags & 33554432) != 0) { + ttl_period = stream.readInt32(exception); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = silent ? (flags | 8192) : (flags &~ 8192); + flags = post ? (flags | 16384) : (flags &~ 16384); + flags = from_scheduled ? (flags | 262144) : (flags &~ 262144); + flags = legacy ? (flags | 524288) : (flags &~ 524288); + flags = edit_hide ? (flags | 2097152) : (flags &~ 2097152); + flags = pinned ? (flags | 16777216) : (flags &~ 16777216); + flags = noforwards ? (flags | 67108864) : (flags &~ 67108864); + stream.writeInt32(flags); + stream.writeInt32(id); + if ((flags & 256) != 0) { + from_id.serializeToStream(stream); + } + peer_id.serializeToStream(stream); + if ((flags & 4) != 0) { + fwd_from.serializeToStream(stream); + } + if ((flags & 2048) != 0) { + stream.writeInt64(via_bot_id); + } + if ((flags & 8) != 0) { + reply_to.serializeToStream(stream); + } + stream.writeInt32(date); + stream.writeString(message); + if ((flags & 512) != 0) { + media.serializeToStream(stream); + } + if ((flags & 64) != 0) { + reply_markup.serializeToStream(stream); + } + if ((flags & 128) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + if ((flags & 1024) != 0) { + stream.writeInt32(views); + } + if ((flags & 1024) != 0) { + stream.writeInt32(forwards); + } + if ((flags & 8388608) != 0) { + replies.serializeToStream(stream); + } + if ((flags & 32768) != 0) { + stream.writeInt32(edit_date); + } + if ((flags & 65536) != 0) { + stream.writeString(post_author); + } + if ((flags & 131072) != 0) { + stream.writeInt64(grouped_id); + } + if ((flags & 1048576) != 0) { + reactions.serializeToStream(stream); + } + if ((flags & 4194304) != 0) { + stream.writeInt32(0x1cb5c415); + int count = restriction_reason.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + restriction_reason.get(a).serializeToStream(stream); + } + } + if ((flags & 33554432) != 0) { + stream.writeInt32(ttl_period); + } + } + } + + public static class TL_message_layer135 extends TL_message { public static int constructor = 0x85d6cbe2; @@ -54382,260 +55257,170 @@ public class TLRPC { } } - public static class TL_message_layer104 extends TL_message { - public static int constructor = 0x44f9b43d; - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; - silent = (flags & 8192) != 0; - post = (flags & 16384) != 0; - from_scheduled = (flags & 262144) != 0; - legacy = (flags & 524288) != 0; - id = stream.readInt32(exception); - if ((flags & 256) != 0) { - from_id = new TLRPC.TL_peerUser(); - from_id.user_id = stream.readInt32(exception); - } - peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 4) != 0) { - fwd_from = MessageFwdHeader.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 2048) != 0) { - via_bot_id = stream.readInt32(exception); - } - if ((flags & 8) != 0) { - reply_to = new TLRPC.TL_messageReplyHeader(); - reply_to.reply_to_msg_id = stream.readInt32(exception); - } - date = stream.readInt32(exception); - message = stream.readString(exception); - if ((flags & 512) != 0) { - media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null) { - ttl = media.ttl_seconds; //custom - } - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } - } - if ((flags & 64) != 0) { - reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 128) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - } - if ((flags & 1024) != 0) { - views = stream.readInt32(exception); - } - if ((flags & 32768) != 0) { - edit_date = stream.readInt32(exception); - } - if ((flags & 65536) != 0) { - post_author = stream.readString(exception); - } - if ((flags & 131072) != 0) { - grouped_id = stream.readInt64(exception); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); - flags = silent ? (flags | 8192) : (flags &~ 8192); - flags = post ? (flags | 16384) : (flags &~ 16384); - flags = from_scheduled ? (flags | 262144) : (flags &~ 262144); - flags = legacy ? (flags | 524288) : (flags &~ 524288); - stream.writeInt32(flags); - stream.writeInt32(id); - if ((flags & 256) != 0) { - stream.writeInt32((int) from_id.user_id); - } - peer_id.serializeToStream(stream); - if ((flags & 4) != 0) { - fwd_from.serializeToStream(stream); - } - if ((flags & 2048) != 0) { - stream.writeInt32((int) via_bot_id); - } - if ((flags & 8) != 0) { - stream.writeInt32(reply_to.reply_to_msg_id); - } - stream.writeInt32(date); - stream.writeString(message); - if ((flags & 512) != 0) { - media.serializeToStream(stream); - } - if ((flags & 64) != 0) { - reply_markup.serializeToStream(stream); - } - if ((flags & 128) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - if ((flags & 1024) != 0) { - stream.writeInt32(views); - } - if ((flags & 32768) != 0) { - stream.writeInt32(edit_date); - } - if ((flags & 65536) != 0) { - stream.writeString(post_author); - } - if ((flags & 131072) != 0) { - stream.writeInt64(grouped_id); - } - writeAttachPath(stream); - } - } - - public static class TL_message_old6 extends TL_message { - public static int constructor = 0x2bebfa86; - - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception) | MESSAGE_FLAG_HAS_FROM_ID; - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; - id = stream.readInt32(exception); - from_id = new TLRPC.TL_peerUser(); - from_id.user_id = stream.readInt32(exception); - peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 4) != 0) { - fwd_from = new TL_messageFwdHeader(); - fwd_from.from_id = new TLRPC.TL_peerUser(); - fwd_from.from_id.user_id = stream.readInt32(exception); - fwd_from.flags |= 1; - fwd_from.date = stream.readInt32(exception); - } - if ((flags & 8) != 0) { - reply_to = new TLRPC.TL_messageReplyHeader(); - reply_to.reply_to_msg_id = stream.readInt32(exception); - } - date = stream.readInt32(exception); - message = stream.readString(exception); - if ((flags & 512) != 0) { - media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } - } else { - media = new TL_messageMediaEmpty(); - } - if ((flags & 64) != 0) { - reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); - } - if ((flags & 128) != 0) { - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); - stream.writeInt32(flags); - stream.writeInt32(id); - stream.writeInt32((int) from_id.user_id); - peer_id.serializeToStream(stream); - if ((flags & 4) != 0) { - stream.writeInt32((int) fwd_from.from_id.user_id); - stream.writeInt32(fwd_from.date); - } - if ((flags & 8) != 0) { - stream.writeInt32(reply_to.reply_to_msg_id); - } - stream.writeInt32(date); - stream.writeString(message); - if ((flags & 512) != 0) { - media.serializeToStream(stream); - } - if ((flags & 64) != 0) { - reply_markup.serializeToStream(stream); - } - if ((flags & 128) != 0) { - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - } - writeAttachPath(stream); - } - } - - public static class TL_message_old5 extends TL_message { - public static int constructor = 0xf07814c8; - + public static class TL_message_layer104 extends TL_message { + public static int constructor = 0x44f9b43d; public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception) | MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA; - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; + flags = stream.readInt32(exception); + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + silent = (flags & 8192) != 0; + post = (flags & 16384) != 0; + from_scheduled = (flags & 262144) != 0; + legacy = (flags & 524288) != 0; id = stream.readInt32(exception); - from_id = new TLRPC.TL_peerUser(); - from_id.user_id = stream.readInt32(exception); + if ((flags & 256) != 0) { + from_id = new TLRPC.TL_peerUser(); + from_id.user_id = stream.readInt32(exception); + } peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 4) != 0) { - fwd_from = new TL_messageFwdHeader(); - fwd_from.from_id = new TLRPC.TL_peerUser(); - fwd_from.from_id.user_id = stream.readInt32(exception); - fwd_from.flags |= 1; - fwd_from.date = stream.readInt32(exception); - } + if ((flags & 4) != 0) { + fwd_from = MessageFwdHeader.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 2048) != 0) { + via_bot_id = stream.readInt32(exception); + } if ((flags & 8) != 0) { reply_to = new TLRPC.TL_messageReplyHeader(); reply_to.reply_to_msg_id = stream.readInt32(exception); } date = stream.readInt32(exception); message = stream.readString(exception); - media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } + if ((flags & 512) != 0) { + media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + if (media != null) { + ttl = media.ttl_seconds; //custom + } + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + } + if ((flags & 64) != 0) { + reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 128) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + } + if ((flags & 1024) != 0) { + views = stream.readInt32(exception); + } + if ((flags & 32768) != 0) { + edit_date = stream.readInt32(exception); + } + if ((flags & 65536) != 0) { + post_author = stream.readString(exception); + } + if ((flags & 131072) != 0) { + grouped_id = stream.readInt64(exception); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = silent ? (flags | 8192) : (flags &~ 8192); + flags = post ? (flags | 16384) : (flags &~ 16384); + flags = from_scheduled ? (flags | 262144) : (flags &~ 262144); + flags = legacy ? (flags | 524288) : (flags &~ 524288); + stream.writeInt32(flags); + stream.writeInt32(id); + if ((flags & 256) != 0) { + stream.writeInt32((int) from_id.user_id); + } + peer_id.serializeToStream(stream); + if ((flags & 4) != 0) { + fwd_from.serializeToStream(stream); + } + if ((flags & 2048) != 0) { + stream.writeInt32((int) via_bot_id); + } + if ((flags & 8) != 0) { + stream.writeInt32(reply_to.reply_to_msg_id); + } + stream.writeInt32(date); + stream.writeString(message); + if ((flags & 512) != 0) { + media.serializeToStream(stream); + } + if ((flags & 64) != 0) { + reply_markup.serializeToStream(stream); + } + if ((flags & 128) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + if ((flags & 1024) != 0) { + stream.writeInt32(views); + } + if ((flags & 32768) != 0) { + stream.writeInt32(edit_date); + } + if ((flags & 65536) != 0) { + stream.writeString(post_author); + } + if ((flags & 131072) != 0) { + stream.writeInt64(grouped_id); + } + writeAttachPath(stream); + } + } + + public static class TL_message_old6 extends TL_message { + public static int constructor = 0x2bebfa86; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception) | MESSAGE_FLAG_HAS_FROM_ID; + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + id = stream.readInt32(exception); + from_id = new TLRPC.TL_peerUser(); + from_id.user_id = stream.readInt32(exception); + peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 4) != 0) { + fwd_from = new TL_messageFwdHeader(); + fwd_from.from_id = new TLRPC.TL_peerUser(); + fwd_from.from_id.user_id = stream.readInt32(exception); + fwd_from.flags |= 1; + fwd_from.date = stream.readInt32(exception); + } + if ((flags & 8) != 0) { + reply_to = new TLRPC.TL_messageReplyHeader(); + reply_to.reply_to_msg_id = stream.readInt32(exception); + } + date = stream.readInt32(exception); + message = stream.readString(exception); + if ((flags & 512) != 0) { + media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + } else { + media = new TL_messageMediaEmpty(); + } if ((flags & 64) != 0) { reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); } @@ -54660,15 +55445,105 @@ public class TLRPC { public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); stream.writeInt32(flags); stream.writeInt32(id); stream.writeInt32((int) from_id.user_id); peer_id.serializeToStream(stream); - if ((flags & 4) != 0) { + if ((flags & 4) != 0) { + stream.writeInt32((int) fwd_from.from_id.user_id); + stream.writeInt32(fwd_from.date); + } + if ((flags & 8) != 0) { + stream.writeInt32(reply_to.reply_to_msg_id); + } + stream.writeInt32(date); + stream.writeString(message); + if ((flags & 512) != 0) { + media.serializeToStream(stream); + } + if ((flags & 64) != 0) { + reply_markup.serializeToStream(stream); + } + if ((flags & 128) != 0) { + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + } + writeAttachPath(stream); + } + } + + public static class TL_message_old5 extends TL_message { + public static int constructor = 0xf07814c8; + + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception) | MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA; + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + id = stream.readInt32(exception); + from_id = new TLRPC.TL_peerUser(); + from_id.user_id = stream.readInt32(exception); + peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + if ((flags & 4) != 0) { + fwd_from = new TL_messageFwdHeader(); + fwd_from.from_id = new TLRPC.TL_peerUser(); + fwd_from.from_id.user_id = stream.readInt32(exception); + fwd_from.flags |= 1; + fwd_from.date = stream.readInt32(exception); + } + if ((flags & 8) != 0) { + reply_to = new TLRPC.TL_messageReplyHeader(); + reply_to.reply_to_msg_id = stream.readInt32(exception); + } + date = stream.readInt32(exception); + message = stream.readString(exception); + media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + if ((flags & 64) != 0) { + reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); + } + if ((flags & 128) != 0) { + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + stream.writeInt32(flags); + stream.writeInt32(id); + stream.writeInt32((int) from_id.user_id); + peer_id.serializeToStream(stream); + if ((flags & 4) != 0) { stream.writeInt32((int) fwd_from.from_id.user_id); stream.writeInt32(fwd_from.date); } @@ -54689,53 +55564,53 @@ public class TLRPC { entities.get(a).serializeToStream(stream); } } - writeAttachPath(stream); + writeAttachPath(stream); } } - public static class TL_messageService_layer48 extends TL_messageService { - public static int constructor = 0xc06b9607; + public static class TL_messageService_layer48 extends TL_messageService { + public static int constructor = 0xc06b9607; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; - silent = (flags & 8192) != 0; - post = (flags & 16384) != 0; - id = stream.readInt32(exception); - if ((flags & 256) != 0) { + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + silent = (flags & 8192) != 0; + post = (flags & 16384) != 0; + id = stream.readInt32(exception); + if ((flags & 256) != 0) { from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); - } + } peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if (from_id == null) { - from_id = peer_id; - } - date = stream.readInt32(exception); - action = MessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); - } + if (from_id == null) { + from_id = peer_id; + } + date = stream.readInt32(exception); + action = MessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); - flags = silent ? (flags | 8192) : (flags &~ 8192); - flags = post ? (flags | 16384) : (flags &~ 16384); - stream.writeInt32(flags); - stream.writeInt32(id); - if ((flags & 256) != 0) { - stream.writeInt32((int) from_id.user_id); - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = silent ? (flags | 8192) : (flags &~ 8192); + flags = post ? (flags | 16384) : (flags &~ 16384); + stream.writeInt32(flags); + stream.writeInt32(id); + if ((flags & 256) != 0) { + stream.writeInt32((int) from_id.user_id); + } peer_id.serializeToStream(stream); - stream.writeInt32(date); - action.serializeToStream(stream); - } - } + stream.writeInt32(date); + action.serializeToStream(stream); + } + } public static class TL_message_old4 extends TL_message { public static int constructor = 0xc3060325; @@ -54743,21 +55618,21 @@ public class TLRPC { public void readParams(AbstractSerializedData stream, boolean exception) { flags = stream.readInt32(exception) | MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA; - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; id = stream.readInt32(exception); from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 4) != 0) { - fwd_from = new TL_messageFwdHeader(); - fwd_from.from_id = new TLRPC.TL_peerUser(); - fwd_from.from_id.user_id = stream.readInt32(exception); - fwd_from.flags |= 1; - fwd_from.date = stream.readInt32(exception); - } + if ((flags & 4) != 0) { + fwd_from = new TL_messageFwdHeader(); + fwd_from.from_id = new TLRPC.TL_peerUser(); + fwd_from.from_id.user_id = stream.readInt32(exception); + fwd_from.flags |= 1; + fwd_from.date = stream.readInt32(exception); + } if ((flags & 8) != 0) { reply_to = new TLRPC.TL_messageReplyHeader(); reply_to.reply_to_msg_id = stream.readInt32(exception); @@ -54765,9 +55640,9 @@ public class TLRPC { date = stream.readInt32(exception); message = stream.readString(exception); media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } if ((flags & 64) != 0) { reply_markup = ReplyMarkup.TLdeserialize(stream, stream.readInt32(exception), exception); } @@ -54775,10 +55650,10 @@ public class TLRPC { public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); stream.writeInt32(flags); stream.writeInt32(id); stream.writeInt32((int) from_id.user_id); @@ -54796,7 +55671,7 @@ public class TLRPC { if ((flags & 64) != 0) { reply_markup.serializeToStream(stream); } - writeAttachPath(stream); + writeAttachPath(stream); } } @@ -54805,21 +55680,21 @@ public class TLRPC { public void readParams(AbstractSerializedData stream, boolean exception) { flags = stream.readInt32(exception) | MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA; - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; id = stream.readInt32(exception); from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 4) != 0) { - fwd_from = new TL_messageFwdHeader(); - fwd_from.from_id = new TLRPC.TL_peerUser(); - fwd_from.from_id.user_id = stream.readInt32(exception); - fwd_from.flags |= 1; - fwd_from.date = stream.readInt32(exception); - } + if ((flags & 4) != 0) { + fwd_from = new TL_messageFwdHeader(); + fwd_from.from_id = new TLRPC.TL_peerUser(); + fwd_from.from_id.user_id = stream.readInt32(exception); + fwd_from.flags |= 1; + fwd_from.date = stream.readInt32(exception); + } if ((flags & 8) != 0) { reply_to = new TLRPC.TL_messageReplyHeader(); reply_to.reply_to_msg_id = stream.readInt32(exception); @@ -54827,24 +55702,24 @@ public class TLRPC { date = stream.readInt32(exception); message = stream.readString(exception); media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); stream.writeInt32(flags); stream.writeInt32(id); stream.writeInt32((int) from_id.user_id); peer_id.serializeToStream(stream); if ((flags & 4) != 0) { stream.writeInt32((int) fwd_from.from_id.user_id); - stream.writeInt32(fwd_from.date); + stream.writeInt32(fwd_from.date); } if ((flags & 8) != 0) { stream.writeInt32(reply_to.reply_to_msg_id); @@ -54852,7 +55727,7 @@ public class TLRPC { stream.writeInt32(date); stream.writeString(message); media.serializeToStream(stream); - writeAttachPath(stream); + writeAttachPath(stream); } } @@ -54862,10 +55737,10 @@ public class TLRPC { public void readParams(AbstractSerializedData stream, boolean exception) { flags = stream.readInt32(exception) | MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA; - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; id = stream.readInt32(exception); from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); @@ -54873,17 +55748,17 @@ public class TLRPC { date = stream.readInt32(exception); message = stream.readString(exception); media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); stream.writeInt32(flags); stream.writeInt32(id); stream.writeInt32((int) from_id.user_id); @@ -54904,8 +55779,8 @@ public class TLRPC { from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - out = stream.readBool(exception); - unread = stream.readBool(exception); + out = stream.readBool(exception); + unread = stream.readBool(exception); flags |= MESSAGE_FLAG_HAS_FROM_ID; date = stream.readInt32(exception); action = MessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); @@ -54929,23 +55804,23 @@ public class TLRPC { public void readParams(AbstractSerializedData stream, boolean exception) { id = stream.readInt32(exception); - fwd_from = new TL_messageFwdHeader(); - fwd_from.from_id = new TLRPC.TL_peerUser(); - fwd_from.from_id.user_id = stream.readInt32(exception); - fwd_from.flags |= 1; - fwd_from.date = stream.readInt32(exception); + fwd_from = new TL_messageFwdHeader(); + fwd_from.from_id = new TLRPC.TL_peerUser(); + fwd_from.from_id.user_id = stream.readInt32(exception); + fwd_from.flags |= 1; + fwd_from.date = stream.readInt32(exception); from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - out = stream.readBool(exception); - unread = stream.readBool(exception); + out = stream.readBool(exception); + unread = stream.readBool(exception); flags |= MESSAGE_FLAG_FWD | MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA; date = stream.readInt32(exception); message = stream.readString(exception); media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } } public void serializeToStream(AbstractSerializedData stream) { @@ -54955,8 +55830,8 @@ public class TLRPC { stream.writeInt32(fwd_from.date); stream.writeInt32((int) from_id.user_id); peer_id.serializeToStream(stream); - stream.writeBool(out); - stream.writeBool(unread); + stream.writeBool(out); + stream.writeBool(unread); stream.writeInt32(date); stream.writeString(message); media.serializeToStream(stream); @@ -54972,15 +55847,15 @@ public class TLRPC { from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - out = stream.readBool(exception); - unread = stream.readBool(exception); + out = stream.readBool(exception); + unread = stream.readBool(exception); flags |= MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA; date = stream.readInt32(exception); message = stream.readString(exception); media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } } public void serializeToStream(AbstractSerializedData stream) { @@ -54988,8 +55863,8 @@ public class TLRPC { stream.writeInt32(id); stream.writeInt32((int) from_id.user_id); peer_id.serializeToStream(stream); - stream.writeBool(out); - stream.writeBool(unread); + stream.writeBool(out); + stream.writeBool(unread); stream.writeInt32(date); stream.writeString(message); media.serializeToStream(stream); @@ -54997,169 +55872,15 @@ public class TLRPC { } } - public static class TL_message_secret extends TL_message { - public static int constructor = 0x555555fa; - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; - id = stream.readInt32(exception); - ttl = stream.readInt32(exception); - from_id = new TLRPC.TL_peerUser(); - from_id.user_id = stream.readInt32(exception); - peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - date = stream.readInt32(exception); - message = stream.readString(exception); - media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - if ((flags & 2048) != 0) { - via_bot_name = stream.readString(exception); - } - if ((flags & 8) != 0) { - reply_to = new TL_messageReplyHeader(); - reply_to.reply_to_random_id = stream.readInt64(exception); - } - if ((flags & 131072) != 0) { - grouped_id = stream.readInt64(exception); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); - stream.writeInt32(flags); - stream.writeInt32(id); - stream.writeInt32(ttl); - stream.writeInt32((int) from_id.user_id); - peer_id.serializeToStream(stream); - stream.writeInt32(date); - stream.writeString(message); - media.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - if ((flags & 2048) != 0) { - stream.writeString(via_bot_name); - } - if ((flags & 8) != 0) { - stream.writeInt64(reply_to.reply_to_random_id); - } - if ((flags & 131072) != 0) { - stream.writeInt64(grouped_id); - } - writeAttachPath(stream); - } - } - - public static class TL_message_secret_layer72 extends TL_message { - public static int constructor = 0x555555f9; - - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; - id = stream.readInt32(exception); - ttl = stream.readInt32(exception); - from_id = new TLRPC.TL_peerUser(); - from_id.user_id = stream.readInt32(exception); - peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - date = stream.readInt32(exception); - message = stream.readString(exception); - media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } - int magic = stream.readInt32(exception); - if (magic != 0x1cb5c415) { - if (exception) { - throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); - } - return; - } - int count = stream.readInt32(exception); - for (int a = 0; a < count; a++) { - MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return; - } - entities.add(object); - } - if ((flags & 2048) != 0) { - via_bot_name = stream.readString(exception); - } - if ((flags & 8) != 0) { - reply_to = new TL_messageReplyHeader(); - reply_to.reply_to_random_id = stream.readInt64(exception); - } - } - - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); - stream.writeInt32(flags); - stream.writeInt32(id); - stream.writeInt32(ttl); - stream.writeInt32((int) from_id.user_id); - peer_id.serializeToStream(stream); - stream.writeInt32(date); - stream.writeString(message); - media.serializeToStream(stream); - stream.writeInt32(0x1cb5c415); - int count = entities.size(); - stream.writeInt32(count); - for (int a = 0; a < count; a++) { - entities.get(a).serializeToStream(stream); - } - if ((flags & 2048) != 0) { - stream.writeString(via_bot_name); - } - if ((flags & 8) != 0) { - stream.writeInt64(reply_to.reply_to_random_id); - } - writeAttachPath(stream); - } - } - - public static class TL_message_secret_old extends TL_message_secret { - public static int constructor = 0x555555F8; + public static class TL_message_secret extends TL_message { + public static int constructor = 0x555555fa; public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception) | MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA; - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; + flags = stream.readInt32(exception); + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; id = stream.readInt32(exception); ttl = stream.readInt32(exception); from_id = new TLRPC.TL_peerUser(); @@ -55168,17 +55889,171 @@ public class TLRPC { date = stream.readInt32(exception); message = stream.readString(exception); media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); - if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { - message = media.captionLegacy; - } + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + if ((flags & 2048) != 0) { + via_bot_name = stream.readString(exception); + } + if ((flags & 8) != 0) { + reply_to = new TL_messageReplyHeader(); + reply_to.reply_to_random_id = stream.readInt64(exception); + } + if ((flags & 131072) != 0) { + grouped_id = stream.readInt64(exception); + } } public void serializeToStream(AbstractSerializedData stream) { stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + stream.writeInt32(flags); + stream.writeInt32(id); + stream.writeInt32(ttl); + stream.writeInt32((int) from_id.user_id); + peer_id.serializeToStream(stream); + stream.writeInt32(date); + stream.writeString(message); + media.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + if ((flags & 2048) != 0) { + stream.writeString(via_bot_name); + } + if ((flags & 8) != 0) { + stream.writeInt64(reply_to.reply_to_random_id); + } + if ((flags & 131072) != 0) { + stream.writeInt64(grouped_id); + } + writeAttachPath(stream); + } + } + + public static class TL_message_secret_layer72 extends TL_message { + public static int constructor = 0x555555f9; + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + id = stream.readInt32(exception); + ttl = stream.readInt32(exception); + from_id = new TLRPC.TL_peerUser(); + from_id.user_id = stream.readInt32(exception); + peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + date = stream.readInt32(exception); + message = stream.readString(exception); + media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + int magic = stream.readInt32(exception); + if (magic != 0x1cb5c415) { + if (exception) { + throw new RuntimeException(String.format("wrong Vector magic, got %x", magic)); + } + return; + } + int count = stream.readInt32(exception); + for (int a = 0; a < count; a++) { + MessageEntity object = MessageEntity.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return; + } + entities.add(object); + } + if ((flags & 2048) != 0) { + via_bot_name = stream.readString(exception); + } + if ((flags & 8) != 0) { + reply_to = new TL_messageReplyHeader(); + reply_to.reply_to_random_id = stream.readInt64(exception); + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + stream.writeInt32(flags); + stream.writeInt32(id); + stream.writeInt32(ttl); + stream.writeInt32((int) from_id.user_id); + peer_id.serializeToStream(stream); + stream.writeInt32(date); + stream.writeString(message); + media.serializeToStream(stream); + stream.writeInt32(0x1cb5c415); + int count = entities.size(); + stream.writeInt32(count); + for (int a = 0; a < count; a++) { + entities.get(a).serializeToStream(stream); + } + if ((flags & 2048) != 0) { + stream.writeString(via_bot_name); + } + if ((flags & 8) != 0) { + stream.writeInt64(reply_to.reply_to_random_id); + } + writeAttachPath(stream); + } + } + + public static class TL_message_secret_old extends TL_message_secret { + public static int constructor = 0x555555F8; + + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception) | MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA; + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + id = stream.readInt32(exception); + ttl = stream.readInt32(exception); + from_id = new TLRPC.TL_peerUser(); + from_id.user_id = stream.readInt32(exception); + peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); + date = stream.readInt32(exception); + message = stream.readString(exception); + media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception); + if (media != null && !TextUtils.isEmpty(media.captionLegacy)) { + message = media.captionLegacy; + } + } + + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); stream.writeInt32(flags); stream.writeInt32(id); stream.writeInt32(ttl); @@ -55290,55 +56165,55 @@ public class TLRPC { } } - public static class TL_messageService_layer118 extends TL_messageService { - public static int constructor = 0x9e19a1f6; + public static class TL_messageService_layer118 extends TL_messageService { + public static int constructor = 0x9e19a1f6; - public void readParams(AbstractSerializedData stream, boolean exception) { - flags = stream.readInt32(exception); - unread = (flags & 1) != 0; - out = (flags & 2) != 0; - mentioned = (flags & 16) != 0; - media_unread = (flags & 32) != 0; - silent = (flags & 8192) != 0; - post = (flags & 16384) != 0; + public void readParams(AbstractSerializedData stream, boolean exception) { + flags = stream.readInt32(exception); + unread = (flags & 1) != 0; + out = (flags & 2) != 0; + mentioned = (flags & 16) != 0; + media_unread = (flags & 32) != 0; + silent = (flags & 8192) != 0; + post = (flags & 16384) != 0; legacy = (flags & 524288) != 0; - id = stream.readInt32(exception); - if ((flags & 256) != 0) { + id = stream.readInt32(exception); + if ((flags & 256) != 0) { from_id = new TLRPC.TL_peerUser(); from_id.user_id = stream.readInt32(exception); - } + } peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception); - if ((flags & 8) != 0) { + if ((flags & 8) != 0) { reply_to = new TLRPC.TL_messageReplyHeader(); reply_to.reply_to_msg_id = stream.readInt32(exception); - } - date = stream.readInt32(exception); - action = MessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); - } + } + date = stream.readInt32(exception); + action = MessageAction.TLdeserialize(stream, stream.readInt32(exception), exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - flags = unread ? (flags | 1) : (flags &~ 1); - flags = out ? (flags | 2) : (flags &~ 2); - flags = mentioned ? (flags | 16) : (flags &~ 16); - flags = media_unread ? (flags | 32) : (flags &~ 32); - flags = silent ? (flags | 8192) : (flags &~ 8192); - flags = post ? (flags | 16384) : (flags &~ 16384); + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + flags = unread ? (flags | 1) : (flags &~ 1); + flags = out ? (flags | 2) : (flags &~ 2); + flags = mentioned ? (flags | 16) : (flags &~ 16); + flags = media_unread ? (flags | 32) : (flags &~ 32); + flags = silent ? (flags | 8192) : (flags &~ 8192); + flags = post ? (flags | 16384) : (flags &~ 16384); flags = legacy ? (flags | 524288) : (flags &~ 524288); - stream.writeInt32(flags); - stream.writeInt32(id); - if ((flags & 256) != 0) { - stream.writeInt32((int) from_id.user_id); - } + stream.writeInt32(flags); + stream.writeInt32(id); + if ((flags & 256) != 0) { + stream.writeInt32((int) from_id.user_id); + } peer_id.serializeToStream(stream); - if ((flags & 8) != 0) { - stream.writeInt32(reply_to.reply_to_msg_id); - } - stream.writeInt32(date); - action.serializeToStream(stream); + if ((flags & 8) != 0) { + stream.writeInt32(reply_to.reply_to_msg_id); + } + stream.writeInt32(date); + action.serializeToStream(stream); writeAttachPath(stream); - } - } + } + } //Message end //TL_dialog start @@ -55467,13 +56342,13 @@ public class TLRPC { } //TL_dialog end - //ChatParticipant start - public static class TL_chatChannelParticipant extends ChatParticipant { - public static int constructor = 0xc8d7493e; + //ChatParticipant start + public static class TL_chatChannelParticipant extends ChatParticipant { + public static int constructor = 0xc8d7493e; - public ChannelParticipant channelParticipant; - } - //ChatParticipant end + public ChannelParticipant channelParticipant; + } + //ChatParticipant end //Chat start public static class TL_chatEmpty extends Chat { @@ -55534,7 +56409,7 @@ public class TLRPC { return; } if (bytes != null) { - bytes.reuse(); + bytes.reuse(); bytes = null; } } @@ -55604,294 +56479,294 @@ public class TLRPC { } } - public static class TL_upload_getWebFile extends TLObject { - public static int constructor = 0x24e6818d; + public static class TL_upload_getWebFile extends TLObject { + public static int constructor = 0x24e6818d; - public InputWebFileLocation location; - public int offset; - public int limit; + public InputWebFileLocation location; + public int offset; + public int limit; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return TL_upload_webFile.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return TL_upload_webFile.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - location.serializeToStream(stream); - stream.writeInt32(offset); - stream.writeInt32(limit); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + location.serializeToStream(stream); + stream.writeInt32(offset); + stream.writeInt32(limit); + } + } - public static class TL_upload_getCdnFile extends TLObject { - public static int constructor = 0x2000bcc3; + public static class TL_upload_getCdnFile extends TLObject { + public static int constructor = 0x2000bcc3; - public byte[] file_token; - public int offset; - public int limit; + public byte[] file_token; + public int offset; + public int limit; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return upload_CdnFile.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return upload_CdnFile.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(file_token); - stream.writeInt32(offset); - stream.writeInt32(limit); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(file_token); + stream.writeInt32(offset); + stream.writeInt32(limit); + } + } - public static class TL_upload_reuploadCdnFile extends TLObject { - public static int constructor = 0x9b2754a8; + public static class TL_upload_reuploadCdnFile extends TLObject { + public static int constructor = 0x9b2754a8; - public byte[] file_token; - public byte[] request_token; + public byte[] file_token; + public byte[] request_token; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - TL_fileHash object = TL_fileHash.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + TL_fileHash object = TL_fileHash.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(file_token); - stream.writeByteArray(request_token); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(file_token); + stream.writeByteArray(request_token); + } + } - public static class TL_upload_getCdnFileHashes extends TLObject { - public static int constructor = 0x4da54231; + public static class TL_upload_getCdnFileHashes extends TLObject { + public static int constructor = 0x4da54231; - public byte[] file_token; - public int offset; + public byte[] file_token; + public int offset; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - TL_fileHash object = TL_fileHash.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + TL_fileHash object = TL_fileHash.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(file_token); - stream.writeInt32(offset); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(file_token); + stream.writeInt32(offset); + } + } - public static class TL_upload_getFileHashes extends TLObject { - public static int constructor = 0xc7025931; + public static class TL_upload_getFileHashes extends TLObject { + public static int constructor = 0xc7025931; - public InputFileLocation location; - public int offset; + public InputFileLocation location; + public int offset; - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - Vector vector = new Vector(); - int size = stream.readInt32(exception); - for (int a = 0; a < size; a++) { - TL_fileHash object = TL_fileHash.TLdeserialize(stream, stream.readInt32(exception), exception); - if (object == null) { - return vector; - } - vector.objects.add(object); - } - return vector; - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + Vector vector = new Vector(); + int size = stream.readInt32(exception); + for (int a = 0; a < size; a++) { + TL_fileHash object = TL_fileHash.TLdeserialize(stream, stream.readInt32(exception), exception); + if (object == null) { + return vector; + } + vector.objects.add(object); + } + return vector; + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - location.serializeToStream(stream); - stream.writeInt32(offset); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + location.serializeToStream(stream); + stream.writeInt32(offset); + } + } - public static class TL_upload_webFile extends TLObject { - public static int constructor = 0x21e753bc; + public static class TL_upload_webFile extends TLObject { + public static int constructor = 0x21e753bc; - public int size; - public String mime_type; - public storage_FileType file_type; - public int mtime; - public NativeByteBuffer bytes; + public int size; + public String mime_type; + public storage_FileType file_type; + public int mtime; + public NativeByteBuffer bytes; - public static TL_upload_webFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - if (TL_upload_webFile.constructor != constructor) { - if (exception) { - throw new RuntimeException(String.format("can't parse magic %x in TL_upload_webFile", constructor)); - } else { - return null; - } - } - TL_upload_webFile result = new TL_upload_webFile(); - result.readParams(stream, exception); - return result; - } + public static TL_upload_webFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + if (TL_upload_webFile.constructor != constructor) { + if (exception) { + throw new RuntimeException(String.format("can't parse magic %x in TL_upload_webFile", constructor)); + } else { + return null; + } + } + TL_upload_webFile result = new TL_upload_webFile(); + result.readParams(stream, exception); + return result; + } - public void readParams(AbstractSerializedData stream, boolean exception) { - size = stream.readInt32(exception); - mime_type = stream.readString(exception); - file_type = storage_FileType.TLdeserialize(stream, stream.readInt32(exception), exception); - mtime = stream.readInt32(exception); - bytes = stream.readByteBuffer(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + size = stream.readInt32(exception); + mime_type = stream.readString(exception); + file_type = storage_FileType.TLdeserialize(stream, stream.readInt32(exception), exception); + mtime = stream.readInt32(exception); + bytes = stream.readByteBuffer(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeInt32(size); - stream.writeString(mime_type); - file_type.serializeToStream(stream); - stream.writeInt32(mtime); - stream.writeByteBuffer(bytes); - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeInt32(size); + stream.writeString(mime_type); + file_type.serializeToStream(stream); + stream.writeInt32(mtime); + stream.writeByteBuffer(bytes); + } - @Override - public void freeResources() { - if (disableFree) { - return; - } - if (bytes != null) { - bytes.reuse(); - bytes = null; - } - } - } + @Override + public void freeResources() { + if (disableFree) { + return; + } + if (bytes != null) { + bytes.reuse(); + bytes = null; + } + } + } - public static abstract class upload_File extends TLObject { - public storage_FileType type; - public int mtime; - public NativeByteBuffer bytes; - public int dc_id; - public byte[] file_token; - public byte[] encryption_key; - public byte[] encryption_iv; + public static abstract class upload_File extends TLObject { + public storage_FileType type; + public int mtime; + public NativeByteBuffer bytes; + public int dc_id; + public byte[] file_token; + public byte[] encryption_key; + public byte[] encryption_iv; public ArrayList file_hashes = new ArrayList<>(); - public static upload_File TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - upload_File result = null; - switch (constructor) { - case 0x96a18d5: - result = new TL_upload_file(); - break; + public static upload_File TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + upload_File result = null; + switch (constructor) { + case 0x96a18d5: + result = new TL_upload_file(); + break; case 0xf18cda44: result = new TL_upload_fileCdnRedirect(); break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in upload_File", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in upload_File", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static abstract class upload_CdnFile extends TLObject { - public NativeByteBuffer bytes; - public byte[] request_token; + public static abstract class upload_CdnFile extends TLObject { + public NativeByteBuffer bytes; + public byte[] request_token; - public static upload_CdnFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { - upload_CdnFile result = null; - switch (constructor) { - case 0xa99fca4f: - result = new TL_upload_cdnFile(); - break; - case 0xeea8e46e: - result = new TL_upload_cdnFileReuploadNeeded(); - break; - } - if (result == null && exception) { - throw new RuntimeException(String.format("can't parse magic %x in upload_CdnFile", constructor)); - } - if (result != null) { - result.readParams(stream, exception); - } - return result; - } - } + public static upload_CdnFile TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) { + upload_CdnFile result = null; + switch (constructor) { + case 0xa99fca4f: + result = new TL_upload_cdnFile(); + break; + case 0xeea8e46e: + result = new TL_upload_cdnFileReuploadNeeded(); + break; + } + if (result == null && exception) { + throw new RuntimeException(String.format("can't parse magic %x in upload_CdnFile", constructor)); + } + if (result != null) { + result.readParams(stream, exception); + } + return result; + } + } - public static class TL_upload_cdnFile extends upload_CdnFile { - public static int constructor = 0xa99fca4f; + public static class TL_upload_cdnFile extends upload_CdnFile { + public static int constructor = 0xa99fca4f; - public void readParams(AbstractSerializedData stream, boolean exception) { - bytes = stream.readByteBuffer(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + bytes = stream.readByteBuffer(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteBuffer(bytes); - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteBuffer(bytes); + } - @Override - public void freeResources() { - if (disableFree) { - return; - } - if (bytes != null) { - bytes.reuse(); - bytes = null; - } - } - } + @Override + public void freeResources() { + if (disableFree) { + return; + } + if (bytes != null) { + bytes.reuse(); + bytes = null; + } + } + } - public static class TL_upload_cdnFileReuploadNeeded extends upload_CdnFile { - public static int constructor = 0xeea8e46e; + public static class TL_upload_cdnFileReuploadNeeded extends upload_CdnFile { + public static int constructor = 0xeea8e46e; - public void readParams(AbstractSerializedData stream, boolean exception) { - request_token = stream.readByteArray(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + request_token = stream.readByteArray(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - stream.writeByteArray(request_token); - } - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + stream.writeByteArray(request_token); + } + } - public static class TL_upload_file extends upload_File { - public static int constructor = 0x96a18d5; + public static class TL_upload_file extends upload_File { + public static int constructor = 0x96a18d5; - public void readParams(AbstractSerializedData stream, boolean exception) { - type = storage_FileType.TLdeserialize(stream, stream.readInt32(exception), exception); - mtime = stream.readInt32(exception); - bytes = stream.readByteBuffer(exception); - } + public void readParams(AbstractSerializedData stream, boolean exception) { + type = storage_FileType.TLdeserialize(stream, stream.readInt32(exception), exception); + mtime = stream.readInt32(exception); + bytes = stream.readByteBuffer(exception); + } - public void serializeToStream(AbstractSerializedData stream) { - stream.writeInt32(constructor); - type.serializeToStream(stream); - stream.writeInt32(mtime); - stream.writeByteBuffer(bytes); - } + public void serializeToStream(AbstractSerializedData stream) { + stream.writeInt32(constructor); + type.serializeToStream(stream); + stream.writeInt32(mtime); + stream.writeByteBuffer(bytes); + } - @Override - public void freeResources() { - if (disableFree) { - return; - } - if (bytes != null) { - bytes.reuse(); - bytes = null; - } - } - } + @Override + public void freeResources() { + if (disableFree) { + return; + } + if (bytes != null) { + bytes.reuse(); + bytes = null; + } + } + } public static class TL_upload_fileCdnRedirect extends upload_File { public static int constructor = 0xf18cda44; @@ -55911,11 +56786,11 @@ public class TLRPC { } int count = stream.readInt32(exception); for (int a = 0; a < count; a++) { - TL_fileHash object = TL_fileHash.TLdeserialize(stream, stream.readInt32(exception), exception); + TL_fileHash object = TL_fileHash.TLdeserialize(stream, stream.readInt32(exception), exception); if (object == null) { return; } - file_hashes.add(object); + file_hashes.add(object); } } @@ -55929,7 +56804,7 @@ public class TLRPC { int count = file_hashes.size(); stream.writeInt32(count); for (int a = 0; a < count; a++) { - file_hashes.get(a).serializeToStream(stream); + file_hashes.get(a).serializeToStream(stream); } } } @@ -56056,25 +56931,25 @@ public class TLRPC { } } - public static class TL_messages_sendEncryptedMultiMedia extends TLObject { - public static int constructor = 0xcacacaca; + public static class TL_messages_sendEncryptedMultiMedia extends TLObject { + public static int constructor = 0xcacacaca; - public ArrayList messages = new ArrayList<>(); - public ArrayList files = new ArrayList<>(); + public ArrayList messages = new ArrayList<>(); + public ArrayList files = new ArrayList<>(); - public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { - return messages_SentEncryptedMessage.TLdeserialize(stream, constructor, exception); - } + public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) { + return messages_SentEncryptedMessage.TLdeserialize(stream, constructor, exception); + } - public void serializeToStream(AbstractSerializedData stream) { + public void serializeToStream(AbstractSerializedData stream) { - } + } - @Override - public void freeResources() { + @Override + public void freeResources() { - } - } + } + } public static class TL_messages_sendEncrypted extends TLObject { public static int constructor = 0x44fa7a15; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java index 6a2e75ac6..838a6a18f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java @@ -38,7 +38,6 @@ import android.view.ViewPropertyAnimator; import android.widget.FrameLayout; import android.widget.ImageView; -import org.checkerframework.checker.units.qual.A; import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.LocaleController; import org.telegram.messenger.R; @@ -208,7 +207,7 @@ public class ActionBar extends FrameLayout { manualStart = true; if (snowflakesEffect == null) { fireworksEffect = null; - snowflakesEffect = new SnowflakesEffect(); + snowflakesEffect = new SnowflakesEffect(0); titleTextView[0].invalidate(); invalidate(); } else { @@ -256,7 +255,7 @@ public class ActionBar extends FrameLayout { if (Theme.canStartHolidayAnimation()) { if (snowflakesEffect == null) { - snowflakesEffect = new SnowflakesEffect(); + snowflakesEffect = new SnowflakesEffect(0); } } else if (!manualStart) { if (snowflakesEffect != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java index 6d5e79ba3..3a71d88af 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java @@ -24,14 +24,6 @@ import android.graphics.Rect; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Build; - -import androidx.annotation.Keep; - -import android.os.SystemClock; - -import androidx.core.graphics.ColorUtils; -import androidx.core.math.MathUtils; - import android.view.Gravity; import android.view.HapticFeedbackConstants; import android.view.KeyEvent; @@ -44,12 +36,12 @@ import android.view.ViewOutlineProvider; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.widget.FrameLayout; -import android.widget.LinearLayout; -import com.google.android.exoplayer2.util.Log; +import androidx.annotation.Keep; +import androidx.core.graphics.ColorUtils; +import androidx.core.math.MathUtils; import org.telegram.messenger.AndroidUtilities; -import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.FileLog; import org.telegram.messenger.MessagesController; import org.telegram.messenger.R; @@ -1813,7 +1805,7 @@ public class ActionBarLayout extends FrameLayout { themeAnimatorSet = null; } boolean startAnimation = false; - int fragmentCount = settings.onlyTopFragment ? 1 : 2; + int fragmentCount = settings.onlyTopFragment ? 1 : fragmentsStack.size(); for (int i = 0; i < fragmentCount; i++) { BaseFragment fragment; if (i == 0) { @@ -1846,7 +1838,7 @@ public class ActionBarLayout extends FrameLayout { } if (i == 0) { if (settings.applyTheme) { - if (settings.accentId != -1) { + if (settings.accentId != -1 && settings.theme != null) { settings.theme.setCurrentAccentId(settings.accentId); Theme.saveThemeAccents(settings.theme, true, false, true, false); } @@ -1865,11 +1857,13 @@ public class ActionBarLayout extends FrameLayout { } } if (startAnimation) { - int count = fragmentsStack.size() - (inPreviewMode || transitionAnimationPreviewMode ? 2 : 1); - for (int a = 0; a < count; a++) { - BaseFragment fragment = fragmentsStack.get(a); - fragment.clearViews(); - fragment.setParentLayout(this); + if (!settings.onlyTopFragment) { + int count = fragmentsStack.size() - (inPreviewMode || transitionAnimationPreviewMode ? 2 : 1); + for (int a = 0; a < count; a++) { + BaseFragment fragment = fragmentsStack.get(a); + fragment.clearViews(); + fragment.setParentLayout(this); + } } if (settings.instant) { setThemeAnimationValue(1.0f); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenu.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenu.java index 1357ef5bd..5641922a6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenu.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenu.java @@ -318,6 +318,17 @@ public class ActionBarMenu extends LinearLayout { return w; } + public int getVisibleItemsMeasuredWidth() { + int w = 0; + for (int i = 0, count = getChildCount(); i < count; i++) { + View view = getChildAt(i); + if (view instanceof ActionBarMenuItem && view.getVisibility() != View.GONE) { + w += view.getMeasuredWidth(); + } + } + return w; + } + public boolean searchFieldVisible() { int count = getChildCount(); for (int a = 0; a < count; a++) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java index f70624ac3..1d7f70f14 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java @@ -1590,7 +1590,6 @@ public class ActionBarMenuItem extends FrameLayout { if (view != null && view.getVisibility() != GONE) { view.setVisibility(GONE); measurePopup = true; - checkHideMenuItem(); } } @@ -1638,7 +1637,6 @@ public class ActionBarMenuItem extends FrameLayout { if (view != null && view.getVisibility() != VISIBLE) { view.setVisibility(VISIBLE); measurePopup = true; - checkHideMenuItem(); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java index 0aace7e05..c29e0a8ff 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java @@ -21,8 +21,6 @@ import android.graphics.PorterDuffColorFilter; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Build; - -import androidx.annotation.Keep; import android.view.KeyEvent; import android.view.View; import android.view.ViewGroup; @@ -34,12 +32,16 @@ import android.widget.LinearLayout; import android.widget.PopupWindow; import android.widget.ScrollView; +import androidx.annotation.Keep; +import androidx.annotation.Nullable; + import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.FileLog; import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.UserConfig; import org.telegram.ui.Components.LayoutHelper; +import org.telegram.ui.Components.PopupSwipeBackLayout; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -84,6 +86,7 @@ public class ActionBarPopupWindow extends PopupWindow { } public static class ActionBarPopupWindowLayout extends FrameLayout { + public final static int FLAG_USE_SWIPEBACK = 1; private OnDispatchKeyEventListener mOnDispatchKeyEventListener; private float backScaleX = 1; @@ -98,6 +101,7 @@ public class ActionBarPopupWindow extends PopupWindow { private int gapEndY = -1000000; private Rect bgPaddings = new Rect(); + private PopupSwipeBackLayout swipeBackLayout; private ScrollView scrollView; protected LinearLayout linearLayout; @@ -116,6 +120,10 @@ public class ActionBarPopupWindow extends PopupWindow { } public ActionBarPopupWindowLayout(Context context, int resId, Theme.ResourcesProvider resourcesProvider) { + this(context, resId, resourcesProvider, 0); + } + + public ActionBarPopupWindowLayout(Context context, int resId, Theme.ResourcesProvider resourcesProvider, int flags) { super(context); this.resourcesProvider = resourcesProvider; @@ -128,10 +136,17 @@ public class ActionBarPopupWindow extends PopupWindow { setPadding(AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8)); setWillNotDraw(false); + if ((flags & FLAG_USE_SWIPEBACK) > 0) { + swipeBackLayout = new PopupSwipeBackLayout(context, resourcesProvider); + addView(swipeBackLayout, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT)); + } + try { scrollView = new ScrollView(context); scrollView.setVerticalScrollBarEnabled(false); - addView(scrollView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT)); + if (swipeBackLayout != null) { + swipeBackLayout.addView(scrollView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT)); + } else addView(scrollView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT)); } catch (Throwable e) { FileLog.e(e); } @@ -181,11 +196,23 @@ public class ActionBarPopupWindow extends PopupWindow { linearLayout.setOrientation(LinearLayout.VERTICAL); if (scrollView != null) { scrollView.addView(linearLayout, new ScrollView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); + } else if (swipeBackLayout != null) { + swipeBackLayout.addView(linearLayout, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT)); } else { addView(linearLayout, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT)); } } + @Nullable + public PopupSwipeBackLayout getSwipeBack() { + return swipeBackLayout; + } + + public int addViewToSwipeBack(View v) { + swipeBackLayout.addView(v); + return swipeBackLayout.getChildCount() - 1; + } + public void setFitItems(boolean value) { fitItems = value; } @@ -712,4 +739,4 @@ public class ActionBarPopupWindow extends PopupWindow { public void setEmptyOutAnimation(long time) { outEmptyTime = time; } -} +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java index 377108284..a25418f98 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java @@ -28,6 +28,8 @@ import android.view.Window; import android.view.accessibility.AccessibilityManager; import android.widget.FrameLayout; +import com.google.android.exoplayer2.util.Log; + import org.telegram.messenger.AccountInstance; import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.ApplicationLoader; @@ -696,7 +698,7 @@ public abstract class BaseFragment { } public int getThemedColor(String key) { - return Theme.getColor(key); + return Theme.getColor(key, getResourceProvider()); } public Drawable getThemedDrawable(String key) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BottomSheet.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BottomSheet.java index adafad47e..53764774a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BottomSheet.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BottomSheet.java @@ -33,6 +33,8 @@ import androidx.annotation.RequiresApi; import androidx.core.view.NestedScrollingParent; import androidx.core.view.NestedScrollingParentHelper; import androidx.core.view.ViewCompat; +import androidx.core.widget.NestedScrollView; + import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; @@ -298,13 +300,15 @@ public class BottomSheet extends Dialog { } } - boolean processTouchEvent(MotionEvent ev, boolean intercept) { + private float y = 0f; + public boolean processTouchEvent(MotionEvent ev, boolean intercept) { if (dismissed) { return false; } if (onContainerTouchEvent(ev)) { return true; } + if (canDismissWithTouchOutside() && ev != null && (ev.getAction() == MotionEvent.ACTION_DOWN || ev.getAction() == MotionEvent.ACTION_MOVE) && (!startedTracking && !maybeStartTracking && ev.getPointerCount() == 1)) { startedTrackingX = (int) ev.getX(); startedTrackingY = (int) ev.getY(); @@ -312,6 +316,7 @@ public class BottomSheet extends Dialog { dismiss(); return true; } + onScrollUpBegin(y); startedTrackingPointerId = ev.getPointerId(0); maybeStartTracking = true; cancelCurrentAnimation(); @@ -324,6 +329,7 @@ public class BottomSheet extends Dialog { } float dx = Math.abs((int) (ev.getX() - startedTrackingX)); float dy = (int) ev.getY() - startedTrackingY; + boolean canScrollUp = onScrollUp(y + dy); velocityTracker.addMovement(ev); if (!disableScroll && maybeStartTracking && !startedTracking && (dy > 0 && dy / 3.0f > Math.abs(dx) && Math.abs(dy) >= touchSlop)) { startedTrackingY = (int) ev.getY(); @@ -331,12 +337,10 @@ public class BottomSheet extends Dialog { startedTracking = true; requestDisallowInterceptTouchEvent(true); } else if (startedTracking) { - float translationY = containerView.getTranslationY(); - translationY += dy; - if (translationY < 0) { - translationY = 0; - } - containerView.setTranslationY(translationY); + y += dy; + if (!canScrollUp) + y = Math.max(y, 0); + containerView.setTranslationY(Math.max(y, 0)); startedTrackingY = (int) ev.getY(); container.invalidate(); } @@ -345,14 +349,13 @@ public class BottomSheet extends Dialog { velocityTracker = VelocityTracker.obtain(); } velocityTracker.computeCurrentVelocity(1000); - float translationY = containerView.getTranslationY(); - if (startedTracking || translationY != 0) { + onScrollUpEnd(y); + if (startedTracking || y > 0) { checkDismiss(velocityTracker.getXVelocity(), velocityTracker.getYVelocity()); - startedTracking = false; } else { maybeStartTracking = false; - startedTracking = false; } + startedTracking = false; if (velocityTracker != null) { velocityTracker.recycle(); velocityTracker = null; @@ -1058,6 +1061,12 @@ public class BottomSheet extends Dialog { protected boolean onContainerTouchEvent(MotionEvent event) { return false; } + protected boolean onScrollUp(float translationY) { + return false; + } + protected void onScrollUpEnd(float translationY) { + } + protected void onScrollUpBegin(float translationY) {} public void setCustomView(View view) { customView = view; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/EmojiThemes.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/EmojiThemes.java index ab2c786d6..330fa4ed8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/EmojiThemes.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/EmojiThemes.java @@ -29,7 +29,7 @@ import java.util.Map; public class EmojiThemes { public boolean showAsDefaultStub; - String emoji; + public String emoji; int currentIndex = 0; ArrayList items = new ArrayList<>(); @@ -186,6 +186,27 @@ public class EmojiThemes { return themeItem; } + public static EmojiThemes createHome() { + EmojiThemes themeItem = new EmojiThemes(); + themeItem.emoji = "\uD83C\uDFE0"; + + ThemeItem blue = new ThemeItem(); + blue.themeInfo = getDefaultThemeInfo(false); + if (blue.themeInfo.getKey().equals("Blue")) { + blue.accentId = 99; + } + themeItem.items.add(blue); + + ThemeItem nightBlue = new ThemeItem(); + nightBlue.themeInfo = getDefaultThemeInfo(true); + if (nightBlue.themeInfo.getKey().equals("Night")) { + nightBlue.accentId = 0; + } + themeItem.items.add(nightBlue); + + return themeItem; + } + public void initColors() { getPreviewColors(0, 0); getPreviewColors(0, 1); @@ -202,7 +223,10 @@ public class EmojiThemes { public TLRPC.WallPaper getWallpaper(int index) { int settingsIndex = items.get(index).settingsIndex; if (settingsIndex >= 0) { - return getTlTheme(index).settings.get(settingsIndex).wallpaper; + TLRPC.TL_theme tlTheme = getTlTheme(index); + if (tlTheme != null) { + return tlTheme.settings.get(settingsIndex).wallpaper; + } } return null; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/SimpleTextView.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/SimpleTextView.java index 1fb192bc0..dea158815 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/SimpleTextView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/SimpleTextView.java @@ -12,13 +12,17 @@ import android.content.Context; import android.graphics.Canvas; import android.graphics.LinearGradient; import android.graphics.Paint; +import android.graphics.Path; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; +import android.graphics.Rect; +import android.graphics.Region; import android.graphics.Shader; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.os.SystemClock; import android.text.Layout; +import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.StaticLayout; import android.text.TextPaint; @@ -31,6 +35,11 @@ import org.telegram.messenger.AndroidUtilities; import org.telegram.ui.Cells.DialogCell; import org.telegram.ui.Components.EmptyStubSpan; import org.telegram.ui.Components.StaticLayoutEx; +import org.telegram.ui.Components.spoilers.SpoilerEffect; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; public class SimpleTextView extends View implements Drawable.Callback { @@ -88,6 +97,10 @@ public class SimpleTextView extends View implements Drawable.Callback { private int minusWidth; private int fullTextMaxLines = 3; + private List spoilers = new ArrayList<>(); + private Stack spoilersPool = new Stack<>(); + private Path path = new Path(); + public SimpleTextView(Context context) { super(context); textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); @@ -294,6 +307,13 @@ public class SimpleTextView extends View implements Drawable.Callback { }*/ layout = new StaticLayout(string, 0, string.length(), textPaint, scrollNonFitText ? AndroidUtilities.dp(2000) : width + AndroidUtilities.dp(8), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); } + + spoilersPool.addAll(spoilers); + spoilers.clear(); + if (layout != null && layout.getText() instanceof Spannable) { + SpoilerEffect.addSpoilers(this, layout, spoilersPool, spoilers); + } + calcOffset(width); } catch (Exception ignore) { @@ -702,13 +722,38 @@ public class SimpleTextView extends View implements Drawable.Callback { if (fullAlpha > 0 && fullLayoutLeftOffset != 0) { canvas.save(); canvas.translate(-fullLayoutLeftOffset * fullAlpha + fullLayoutLeftCharactersOffset * fullAlpha, 0); + + canvas.save(); + clipOutSpoilers(canvas); layout.draw(canvas); canvas.restore(); + + drawSpoilers(canvas); + canvas.restore(); } else { + canvas.save(); + clipOutSpoilers(canvas); layout.draw(canvas); + canvas.restore(); + + drawSpoilers(canvas); } } + private void clipOutSpoilers(Canvas canvas) { + path.rewind(); + for (SpoilerEffect eff : spoilers) { + Rect b = eff.getBounds(); + path.addRect(b.left, b.top, b.right, b.bottom, Path.Direction.CW); + } + canvas.clipPath(path, Region.Op.DIFFERENCE); + } + + private void drawSpoilers(Canvas canvas) { + for (SpoilerEffect eff : spoilers) + eff.draw(canvas); + } + private void updateScrollAnimation() { if (!scrollNonFitText || !textDoesNotFit && scrollingOffset == 0) { return; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java index fd875e8fe..86c6a4157 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java @@ -60,6 +60,11 @@ import android.util.SparseArray; import android.util.StateSet; import android.view.View; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.UiThread; +import androidx.core.graphics.ColorUtils; + import org.json.JSONArray; import org.json.JSONObject; import org.telegram.messenger.AndroidUtilities; @@ -77,13 +82,13 @@ import org.telegram.messenger.MessagesController; import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.SharedConfig; +import org.telegram.messenger.SvgHelper; import org.telegram.messenger.UserConfig; import org.telegram.messenger.Utilities; import org.telegram.messenger.time.SunDate; import org.telegram.tgnet.ConnectionsManager; import org.telegram.tgnet.SerializedData; import org.telegram.tgnet.TLRPC; -import org.telegram.ui.Cells.ThemesHorizontalListCell; import org.telegram.ui.Components.AudioVisualizerDrawable; import org.telegram.ui.Components.BackgroundGradientDrawable; import org.telegram.ui.Components.ChatThemeBottomSheet; @@ -100,7 +105,6 @@ import org.telegram.ui.Components.RoundStatusDrawable; import org.telegram.ui.Components.ScamDrawable; import org.telegram.ui.Components.SendingFileDrawable; import org.telegram.ui.Components.StatusDrawable; -import org.telegram.messenger.SvgHelper; import org.telegram.ui.Components.ThemeEditorView; import org.telegram.ui.Components.TypingDotsDrawable; import org.telegram.ui.RoundVideoProgressShadow; @@ -123,11 +127,6 @@ import java.util.Locale; import java.util.Map; import java.util.concurrent.CountDownLatch; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.annotation.UiThread; -import androidx.core.graphics.ColorUtils; - public class Theme { public static final String DEFAULT_BACKGROUND_SLUG = "d"; @@ -2417,7 +2416,7 @@ public class Theme { public boolean createBackground(File file, String toPath) { try { - Bitmap bitmap = ThemesHorizontalListCell.getScaledBitmap(AndroidUtilities.dp(640), AndroidUtilities.dp(360), file.getAbsolutePath(), null, 0); + Bitmap bitmap = AndroidUtilities.getScaledBitmap(AndroidUtilities.dp(640), AndroidUtilities.dp(360), file.getAbsolutePath(), null, 0); if (bitmap != null && patternBgColor != 0) { Bitmap finalBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), bitmap.getConfig()); Canvas canvas = new Canvas(finalBitmap); @@ -3676,6 +3675,12 @@ public class Theme { public final static String key_statisticChartLine_indigo = "statisticChartLine_indigo"; public final static String key_statisticChartLineEmpty = "statisticChartLineEmpty"; + public static final String key_chat_outReactionButtonBackground = "chat_outReactionButtonBackground"; + public static final String key_chat_inReactionButtonBackground = "chat_inReactionButtonBackground"; + public static final String key_chat_outReactionButtonText = "chat_outReactionButtonText"; + public static final String key_chat_inReactionButtonText = "chat_inReactionButtonText"; + + public static final String key_drawable_botInline = "drawableBotInline"; public static final String key_drawable_botLink = "drawableBotLink"; public static final String key_drawable_commentSticker = "drawableCommentSticker"; @@ -3722,6 +3727,8 @@ public class Theme { public static final String key_drawable_lockIconDrawable = "drawableLockIcon"; public static final String key_drawable_chat_pollHintDrawableOut = "drawable_chat_pollHintDrawableOut"; public static final String key_drawable_chat_pollHintDrawableIn = "drawable_chat_pollHintDrawableIn"; + + private static final HashMap defaultChatDrawables = new HashMap<>(); private static final HashMap defaultChatDrawableColorKeys = new HashMap<>(); @@ -4528,6 +4535,11 @@ public class Theme { defaultColors.put(key_voipgroup_windowBackgroundWhiteInputField, 0xffdbdbdb); defaultColors.put(key_voipgroup_windowBackgroundWhiteInputFieldActivated, 0xff37a9f0); + defaultColors.put(key_chat_outReactionButtonBackground, 0xff78c272); + defaultColors.put(key_chat_inReactionButtonBackground, 0xff72b5e8); + defaultColors.put(key_chat_inReactionButtonText, 0xffffffff); + defaultColors.put(key_chat_outReactionButtonText, 0xffffffff); + fallbackKeys.put(key_chat_inAdminText, key_chat_inTimeText); fallbackKeys.put(key_chat_inAdminSelectedText, key_chat_inTimeSelectedText); @@ -4664,6 +4676,11 @@ public class Theme { fallbackKeys.put(key_returnToCallMutedBackground, key_windowBackgroundWhite); fallbackKeys.put(key_dialogSwipeRemove, key_avatar_backgroundRed); + fallbackKeys.put(key_chat_inReactionButtonBackground, key_chat_inLoader); + fallbackKeys.put(key_chat_outReactionButtonBackground, key_chat_outLoader); + fallbackKeys.put(key_chat_inReactionButtonText, key_chat_inPreviewInstantText); + fallbackKeys.put(key_chat_outReactionButtonText, key_chat_outPreviewInstantText); + themeAccentExclusionKeys.addAll(Arrays.asList(keys_avatar_background)); themeAccentExclusionKeys.addAll(Arrays.asList(keys_avatar_nameInMessage)); themeAccentExclusionKeys.add(key_chat_attachFileBackground); @@ -9098,7 +9115,7 @@ public class Theme { return colorInteger; } } - return getColor(key); + return getColor(key); } public static int getColor(String key) { return getColor(key, null, false); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/AvailableReactionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/AvailableReactionCell.java new file mode 100644 index 000000000..cd114d622 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/AvailableReactionCell.java @@ -0,0 +1,128 @@ +package org.telegram.ui.Cells; + +import android.content.Context; +import android.graphics.Canvas; +import android.text.TextUtils; +import android.util.TypedValue; +import android.view.Gravity; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.DocumentObject; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.SvgHelper; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.Components.BackupImageView; +import org.telegram.ui.Components.CheckBox2; +import org.telegram.ui.Components.LayoutHelper; +import org.telegram.ui.Components.Switch; + +public class AvailableReactionCell extends FrameLayout { + private TextView textView; + private BackupImageView imageView; + private Switch switchView; + private CheckBox2 checkBox; + private View overlaySelectorView; + public TLRPC.TL_availableReaction react; + + public AvailableReactionCell(@NonNull Context context, boolean checkbox) { + super(context); + + textView = new TextView(context); + textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + textView.setLines(1); + textView.setMaxLines(1); + textView.setSingleLine(true); + textView.setEllipsize(TextUtils.TruncateAt.END); + textView.setGravity(LayoutHelper.getAbsoluteGravityStart() | Gravity.CENTER_VERTICAL); + addView(textView, LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START | Gravity.CENTER_VERTICAL, 81, 0, 91, 0)); + + imageView = new BackupImageView(context); + imageView.setAspectFit(true); + imageView.setLayerNum(1); + addView(imageView, LayoutHelper.createFrameRelatively(32, 32, Gravity.START | Gravity.CENTER_VERTICAL, 23, 0, 0, 0)); + + if (checkbox) { + checkBox = new CheckBox2(context, 26, null); + checkBox.setDrawUnchecked(false); + checkBox.setColor(null, null, Theme.key_radioBackgroundChecked); + checkBox.setDrawBackgroundAsArc(-1); + addView(checkBox, LayoutHelper.createFrameRelatively(26, 26, Gravity.END | Gravity.CENTER_VERTICAL, 0, 0, 22, 0)); + } else { + switchView = new Switch(context); + switchView.setColors(Theme.key_switchTrack, Theme.key_switchTrackChecked, Theme.key_switchTrackBlueThumb, Theme.key_switchTrackBlueThumbChecked); + addView(switchView, LayoutHelper.createFrameRelatively(37, 20, Gravity.END | Gravity.CENTER_VERTICAL, 0, 0, 22, 0)); + } + overlaySelectorView = new View(context); + overlaySelectorView.setBackground(Theme.getSelectorDrawable(false)); + addView(overlaySelectorView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + setWillNotDraw(false); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec((int) (AndroidUtilities.dp(58) + Theme.dividerPaint.getStrokeWidth()), MeasureSpec.EXACTLY)); + } + + /** + * Binds reaction to the view + * @param react Reaction to bind + * @param checked If view should be checked + */ + public void bind(TLRPC.TL_availableReaction react, boolean checked) { + boolean animated = false; + if (react != null && this.react != null && react.reaction.equals(this.react.reaction)) { + animated = true; + } + this.react = react; + textView.setText(react.title); + SvgHelper.SvgDrawable svgThumb = DocumentObject.getSvgThumb(react.static_icon, Theme.key_windowBackgroundGray, 1.0f); + imageView.setImage(ImageLocation.getForDocument(react.static_icon), "50_50", "webp", svgThumb, react); + setChecked(checked, animated); + } + + /** + * Sets view checked + * @param checked If checked or not + */ + public void setChecked(boolean checked) { + setChecked(checked, false); + } + + /** + * Sets view checked + * @param checked If checked or not + * @param animated If we should animate change + */ + public void setChecked(boolean checked, boolean animated) { + if (switchView != null) { + switchView.setChecked(checked, animated); + } + if (checkBox != null) { + checkBox.setChecked(checked, animated); + } + } + + @Override + protected void onDraw(Canvas canvas) { + canvas.drawColor(Theme.getColor(Theme.key_windowBackgroundWhite)); + float w = Theme.dividerPaint.getStrokeWidth(); + int l = 0, r = 0; + int pad = AndroidUtilities.dp(81); + if (LocaleController.isRTL) { + r = pad; + } else { + l = pad; + } + + canvas.drawLine(getPaddingLeft() + l, getHeight() - w, getWidth() - getPaddingRight() - r, getHeight() - w, Theme.dividerPaint); + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java index 78dd6fcaf..0d6a16e08 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java @@ -34,6 +34,7 @@ import org.telegram.messenger.ImageLocation; import org.telegram.messenger.ImageReceiver; import org.telegram.messenger.LocaleController; import org.telegram.messenger.MessageObject; +import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.SharedConfig; import org.telegram.messenger.UserConfig; @@ -43,11 +44,28 @@ import org.telegram.tgnet.TLRPC; import org.telegram.ui.ActionBar.Theme; import org.telegram.ui.Components.AvatarDrawable; import org.telegram.ui.Components.URLSpanNoUnderline; +import org.telegram.ui.Components.spoilers.SpoilerEffect; import org.telegram.ui.PhotoViewer; import java.util.ArrayList; +import java.util.List; +import java.util.Stack; -public class ChatActionCell extends BaseCell implements DownloadController.FileDownloadProgressListener { +public class ChatActionCell extends BaseCell implements DownloadController.FileDownloadProgressListener, NotificationCenter.NotificationCenterDelegate { + + @Override + public void didReceivedNotification(int id, int account, Object... args) { + if (id == NotificationCenter.startSpoilers) { + setSpoilersSuppressed(false); + } else if (id == NotificationCenter.stopSpoilers) { + setSpoilersSuppressed(true); + } + } + + public void setSpoilersSuppressed(boolean s) { + for (SpoilerEffect eff : spoilers) + eff.setSuppressUpdates(s); + } private boolean canDrawInParent; @@ -92,6 +110,9 @@ public class ChatActionCell extends BaseCell implements DownloadController.FileD private int previousWidth; private boolean imagePressed; + public List spoilers = new ArrayList<>(); + private Stack spoilersPool = new Stack<>(); + TextPaint textPaint; private float viewTop; @@ -407,6 +428,12 @@ public class ChatActionCell extends BaseCell implements DownloadController.FileD int maxWidth = width - AndroidUtilities.dp(30); invalidatePath = true; textLayout = new StaticLayout(text, (TextPaint) getThemedPaint(Theme.key_paint_chatActionText), maxWidth, Layout.Alignment.ALIGN_CENTER, 1.0f, 0.0f, false); + + spoilersPool.addAll(spoilers); + spoilers.clear(); + if (text instanceof Spannable) + SpoilerEffect.addSpoilers(this, textLayout, (Spannable) text, spoilersPool, spoilers); + textHeight = 0; textWidth = 0; try { @@ -494,8 +521,17 @@ public class ChatActionCell extends BaseCell implements DownloadController.FileD if (textLayout.getPaint() != textPaint) { buildLayout(); } + canvas.save(); + SpoilerEffect.clipOutCanvas(canvas, spoilers); textLayout.draw(canvas); canvas.restore(); + + for (SpoilerEffect eff : spoilers) { + eff.setColor(textLayout.getPaint().getColor()); + eff.draw(canvas); + } + + canvas.restore(); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java index 5b5e7a595..7de23e267 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java @@ -88,6 +88,7 @@ import org.telegram.messenger.MediaController; import org.telegram.messenger.MediaDataController; import org.telegram.messenger.MessageObject; import org.telegram.messenger.MessagesController; +import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.SendMessagesHelper; import org.telegram.messenger.SharedConfig; @@ -121,11 +122,14 @@ import org.telegram.ui.Components.MsgClockDrawable; import org.telegram.ui.Components.Point; import org.telegram.ui.Components.RLottieDrawable; import org.telegram.ui.Components.RadialProgress2; +import org.telegram.ui.Components.Reactions.ReactionsLayoutInBubble; +import org.telegram.ui.Components.RecyclerListView; import org.telegram.ui.Components.RoundVideoPlayingDrawable; import org.telegram.ui.Components.SeekBar; import org.telegram.ui.Components.SeekBarAccessibilityDelegate; import org.telegram.ui.Components.SeekBarWaveform; import org.telegram.ui.Components.SlotsDrawable; +import org.telegram.ui.Components.spoilers.SpoilerEffect; import org.telegram.ui.Components.StaticLayoutEx; import org.telegram.ui.Components.TextStyleSpan; import org.telegram.ui.Components.TimerParticles; @@ -144,9 +148,12 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Locale; +import java.util.Stack; +import java.util.concurrent.atomic.AtomicReference; -public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate, ImageReceiver.ImageReceiverDelegate, DownloadController.FileDownloadProgressListener, TextSelectionHelper.SelectableView { +public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate, ImageReceiver.ImageReceiverDelegate, DownloadController.FileDownloadProgressListener, TextSelectionHelper.SelectableView, NotificationCenter.NotificationCenterDelegate { public RadialProgress2 getRadialProgress() { return radialProgress; @@ -158,6 +165,82 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate invalidate(); } + public ReactionsLayoutInBubble.ReactionButton getReactionButton(String reaction) { + return reactionsLayoutInBubble.getReactionButton(reaction); + } + + // primary message for group + // contains caption, reactions etc for all group + public MessageObject getPrimaryMessageObject() { + MessageObject messageObject = null; + if (currentMessageObject != null && currentMessagesGroup != null && currentMessageObject.hasValidGroupId()) { + messageObject = currentMessagesGroup.findPrimaryMessageObject(); + } + if (messageObject != null) { + return messageObject; + } + return currentMessageObject; + } + + @Override + public void didReceivedNotification(int id, int account, Object... args) { + if (id == NotificationCenter.startSpoilers) { + setSpoilersSuppressed(false); + } else if (id == NotificationCenter.stopSpoilers) { + setSpoilersSuppressed(true); + } + } + + public void setSpoilersSuppressed(boolean s) { + for (SpoilerEffect eff : captionSpoilers) + eff.setSuppressUpdates(s); + for (SpoilerEffect eff : replySpoilers) + eff.setSuppressUpdates(s); + if (getMessageObject() != null && getMessageObject().textLayoutBlocks != null) { + for (MessageObject.TextLayoutBlock bl : getMessageObject().textLayoutBlocks) { + for (SpoilerEffect eff : bl.spoilers) { + eff.setSuppressUpdates(s); + } + } + } + } + + public boolean hasSpoilers() { + if (hasCaptionLayout() && !captionSpoilers.isEmpty() || replyTextLayout != null && !replySpoilers.isEmpty()) { + return true; + } + if (getMessageObject() != null && getMessageObject().textLayoutBlocks != null) { + for (MessageObject.TextLayoutBlock bl : getMessageObject().textLayoutBlocks) { + if (!bl.spoilers.isEmpty()) { + return true; + } + } + } + return false; + } + + private void updateSpoilersVisiblePart(int top, int bottom) { + if (hasCaptionLayout()) { + float off = -captionY; + for (SpoilerEffect eff : captionSpoilers) { + eff.setVisibleBounds(0, top + off, getWidth(), bottom + off); + } + } + if (replyTextLayout != null) { + float off = -replyStartY - replyTextLayout.getHeight(); + for (SpoilerEffect eff : replySpoilers) { + eff.setVisibleBounds(0, top + off, getWidth(), bottom + off); + } + } + if (getMessageObject() != null && getMessageObject().textLayoutBlocks != null) { + for (MessageObject.TextLayoutBlock bl : getMessageObject().textLayoutBlocks) { + for (SpoilerEffect eff : bl.spoilers) { + eff.setVisibleBounds(0, top - bl.textYOffset - textY, getWidth(), bottom - bl.textYOffset - textY); + } + } + } + } + public interface ChatMessageCellDelegate { default void didPressUserAvatar(ChatMessageCell cell, TLRPC.User user, float touchX, float touchY) { } @@ -209,7 +292,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate default void didPressBotButton(ChatMessageCell cell, TLRPC.KeyboardButton button) { } - default void didPressReaction(ChatMessageCell cell, TLRPC.TL_reactionCount reaction) { + default void didPressReaction(ChatMessageCell cell, TLRPC.TL_reactionCount reaction, boolean longpress) { } default void didPressVoteButtons(ChatMessageCell cell, ArrayList buttons, int showCount, int x, int y) { @@ -330,6 +413,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate private MessageObject.GroupedMessages currentMessagesGroup; private MessageObject.GroupedMessagePosition currentPosition; private boolean groupPhotoInvisible; + public final ReactionsLayoutInBubble reactionsLayoutInBubble = new ReactionsLayoutInBubble(this); + + private boolean invalidateSpoilersParent; private int textX; private int unmovedTextX; @@ -444,6 +530,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate private RectF instantButtonRect = new RectF(); private int[] pressedState = new int[]{android.R.attr.state_enabled, android.R.attr.state_pressed}; private float animatingLoadingProgressProgress; + CharSequence accessibilityText; private RoundVideoPlayingDrawable roundVideoPlayingDrawable; @@ -592,6 +679,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate private int widthForButtons; private int pressedBotButton; + private SpoilerEffect spoilerPressed; + private boolean isCaptionSpoilerPressed; + private boolean isSpoilerRevealing; + private MessageObject currentMessageObject; private MessageObject messageObjectToSet; private MessageObject.GroupedMessages groupedMessagesToSet; @@ -686,6 +777,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate public StaticLayout replyNameLayout; public StaticLayout replyTextLayout; + private AtomicReference spoilersPatchedReplyTextLayout = new AtomicReference<>(); public ImageReceiver replyImageReceiver; public int replyStartX; public int replyStartY; @@ -835,6 +927,14 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate private final Theme.ResourcesProvider resourcesProvider; private final boolean canDrawBackgroundInParent; + // Public for enter transition + public List replySpoilers = new ArrayList<>(); + private Stack replySpoilersPool = new Stack<>(); + private List captionSpoilers = new ArrayList<>(); + private Stack captionSpoilersPool = new Stack<>(); + private AtomicReference captionPatchedSpoilersLayout = new AtomicReference<>(); + private Path sPath = new Path(); + public ChatMessageCell(Context context) { this(context, false, null); } @@ -900,6 +1000,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } }; roundVideoPlayingDrawable = new RoundVideoPlayingDrawable(this, resourcesProvider); + setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); } private void createPollUI() { @@ -2008,6 +2109,116 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate return result; } + private boolean checkSpoilersMotionEvent(MotionEvent event) { + if (isSpoilerRevealing) + return false; + + int x = (int) event.getX(); + int y = (int) event.getY(); + int act = event.getActionMasked(); + if (act == MotionEvent.ACTION_DOWN) { + if (x >= textX && y >= textY && x <= textX + currentMessageObject.textWidth && y <= textY + currentMessageObject.textHeight) { + List blocks = currentMessageObject.textLayoutBlocks; + for (int i = 0; i < blocks.size(); i++) { + if (blocks.get(i).textYOffset > y) { + break; + } + MessageObject.TextLayoutBlock block = blocks.get(i); + int offX = block.isRtl() ? (int) currentMessageObject.textXOffset : 0; + for (SpoilerEffect eff : block.spoilers) { + if (eff.getBounds().contains(x - textX + offX, (int) (y - textY - block.textYOffset))) { + spoilerPressed = eff; + isCaptionSpoilerPressed = false; + return true; + } + } + } + } + + if (hasCaptionLayout() && x >= captionX && y >= captionY && x <= captionX + captionLayout.getWidth() && y <= captionY + captionLayout.getHeight()) { + for (SpoilerEffect eff : captionSpoilers) { + if (eff.getBounds().contains((int)(x - captionX), (int)(y - captionY))) { + spoilerPressed = eff; + isCaptionSpoilerPressed = true; + return true; + } + } + } + } else if (act == MotionEvent.ACTION_UP && spoilerPressed != null) { + playSoundEffect(SoundEffectConstants.CLICK); + + sPath.rewind(); + if (isCaptionSpoilerPressed) { + for (SpoilerEffect eff : captionSpoilers) { + Rect b = eff.getBounds(); + sPath.addRect(b.left, b.top, b.right, b.bottom, Path.Direction.CW); + } + } else { + for (MessageObject.TextLayoutBlock block : currentMessageObject.textLayoutBlocks) { + for (SpoilerEffect eff : block.spoilers) { + Rect b = eff.getBounds(); + sPath.addRect(b.left, b.top + block.textYOffset, b.right, b.bottom + block.textYOffset, Path.Direction.CW); + } + } + } + sPath.computeBounds(rect, false); + float width = rect.width(), height = rect.height(); + float rad = (float) Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)); + + isSpoilerRevealing = true; + spoilerPressed.setOnRippleEndCallback(()->post(()->{ + isSpoilerRevealing = false; + getMessageObject().isSpoilersRevealed = true; + if (isCaptionSpoilerPressed) { + captionSpoilers.clear(); + } else if (currentMessageObject.textLayoutBlocks != null) { + for (MessageObject.TextLayoutBlock block : currentMessageObject.textLayoutBlocks) { + block.spoilers.clear(); + } + } + invalidate(); + })); + if (isCaptionSpoilerPressed) { + for (SpoilerEffect eff : captionSpoilers) { + eff.startRipple(x - captionX, y - captionY, rad); + } + } else if (currentMessageObject.textLayoutBlocks != null) { + for (MessageObject.TextLayoutBlock block : currentMessageObject.textLayoutBlocks) { + int offX = block.isRtl() ? (int) currentMessageObject.textXOffset : 0; + for (SpoilerEffect eff : block.spoilers) { + eff.startRipple(x - textX + offX, y - block.textYOffset - textY, rad); + } + } + } + if (getParent() instanceof RecyclerListView) { + ViewGroup vg = (ViewGroup) getParent(); + for (int i = 0; i < vg.getChildCount(); i++) { + View ch = vg.getChildAt(i); + if (ch instanceof ChatMessageCell) { + ChatMessageCell cell = (ChatMessageCell) ch; + if (cell.getMessageObject() != null && cell.getMessageObject().getReplyMsgId() == getMessageObject().getId()) { + if (!cell.replySpoilers.isEmpty()) { + cell.replySpoilers.get(0).setOnRippleEndCallback(()->post(()->{ + cell.getMessageObject().replyMessageObject.isSpoilersRevealed = true; + cell.replySpoilers.clear(); + cell.invalidate(); + })); + for (SpoilerEffect eff : cell.replySpoilers) { + eff.startRipple(eff.getBounds().centerX(), eff.getBounds().centerY(), rad); + } + } + } + } + } + } + + spoilerPressed = null; + return true; + } + + return false; + } + private boolean checkBotButtonMotionEvent(MotionEvent event) { if (botButtons.isEmpty() || currentMessageObject.eventId != 0) { return false; @@ -2044,8 +2255,6 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate BotButton button = botButtons.get(pressedBotButton); if (button.button != null) { delegate.didPressBotButton(this, button.button); - } else if (button.reaction != null) { - delegate.didPressReaction(this, button.reaction); } } pressedBotButton = -1; @@ -2071,6 +2280,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate return true; } + if (chekReactionsTouchEvent(event)) { + return true; + } + if (videoPlayerRewinder != null && videoPlayerRewinder.rewindCount > 0) { if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL) { getParent().requestDisallowInterceptTouchEvent(false); @@ -2085,8 +2298,11 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate lastTouchY = event.getY(); backgroundDrawable.setTouchCoords(lastTouchX, lastTouchY); - boolean result = checkTextBlockMotionEvent(event); + boolean result = checkSpoilersMotionEvent(event); + if (!result) { + result = checkTextBlockMotionEvent(event); + } if (!result) { result = checkPinchToZoom(event); } @@ -2128,6 +2344,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } if (event.getAction() == MotionEvent.ACTION_CANCEL) { + spoilerPressed = null; + isCaptionSpoilerPressed = false; buttonPressed = 0; miniButtonPressed = 0; pressedBotButton = -1; @@ -2356,6 +2574,34 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate return result; } + private boolean chekReactionsTouchEvent(MotionEvent event) { + if (currentMessageObject.hasValidGroupId() && currentMessagesGroup != null && !currentMessagesGroup.isDocuments) { + ViewGroup parent = (ViewGroup) getParent(); + for (int i = 0; i < parent.getChildCount(); i++) { + View v = parent.getChildAt(i); + if (v instanceof ChatMessageCell) { + ChatMessageCell cell = (ChatMessageCell) v; + MessageObject.GroupedMessages group = cell.getCurrentMessagesGroup(); + MessageObject.GroupedMessagePosition position = cell.getCurrentPosition(); + if (group != null && group.groupId == currentMessagesGroup.groupId && + (position.flags & MessageObject.POSITION_FLAG_BOTTOM) != 0 && + (position.flags & MessageObject.POSITION_FLAG_LEFT) != 0) { + if (cell == this) { + return reactionsLayoutInBubble.chekTouchEvent(event); + } else { + event.offsetLocation(this.getLeft() - cell.getLeft(), this.getTop() - cell.getTop()); + boolean result = cell.reactionsLayoutInBubble.chekTouchEvent(event); + event.offsetLocation(-(this.getLeft() - cell.getLeft()), -(this.getTop() - cell.getTop())); + return result; + } + } + } + } + return false; + } + return reactionsLayoutInBubble.chekTouchEvent(event); + } + private boolean checkPinchToZoom(MotionEvent ev) { PinchToZoomHelper pinchToZoomHelper = delegate == null ? null : delegate.getPinchToZoomHelper(); @@ -2590,6 +2836,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate parentHeight = parentH; backgroundHeight = parentH; viewTop = visibleTop; + if (parent != parentHeight || parentOffset != this.parentViewTopOffset) { this.parentViewTopOffset = parentOffset; parentHeight = parent; @@ -2828,6 +3075,15 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate return null; } + private void updateCaptionSpoilers() { + captionSpoilersPool.addAll(captionSpoilers); + captionSpoilers.clear(); + + if (captionLayout != null && !getMessageObject().isSpoilersRevealed) { + SpoilerEffect.addSpoilers(this, captionLayout, captionSpoilersPool, captionSpoilers); + } + } + private boolean isUserDataChanged() { if (currentMessageObject != null && (!hasLinkPreview && currentMessageObject.messageOwner.media != null && currentMessageObject.messageOwner.media.webpage instanceof TLRPC.TL_webPage)) { return true; @@ -2931,6 +3187,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); + + NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.startSpoilers); + NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.stopSpoilers); + cancelShakeAnimation(); if (animationRunning) { return; @@ -2982,6 +3242,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate statusDrawableAnimator.removeAllListeners(); statusDrawableAnimator.cancel(); } + reactionsLayoutInBubble.onDetachFromWindow(); statusDrawableAnimationInProgress = false; } @@ -2989,6 +3250,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate protected void onAttachedToWindow() { super.onAttachedToWindow(); + NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.startSpoilers); + NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.stopSpoilers); + if (currentMessageObject != null) { currentMessageObject.animateComments = false; } @@ -3061,6 +3325,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate boolean showSeekbar = MediaController.getInstance().isPlayingMessage(currentMessageObject); toSeekBarProgress = showSeekbar ? 1f : 0f; } + reactionsLayoutInBubble.onAttachToWindow(); } private void setMessageContent(MessageObject messageObject, MessageObject.GroupedMessages groupedMessages, boolean bottomNear, boolean topNear) { @@ -3081,6 +3346,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate newReply != lastReplyMessage; boolean groupChanged = groupedMessages != currentMessagesGroup; boolean pollChanged = false; + if (dataChanged || messageChanged || messageIdChanged) { + accessibilityText = null; + } if (drawCommentButton || drawSideButton == 3 && !((hasDiscussion && messageObject.isLinkedToChat(linkedChatId) || isRepliesChat) && (currentPosition == null || currentPosition.siblingHeights == null && (currentPosition.flags & MessageObject.POSITION_FLAG_BOTTOM) != 0 || currentPosition.siblingHeights != null && (currentPosition.flags & MessageObject.POSITION_FLAG_TOP) == 0))) { dataChanged = true; } @@ -3171,6 +3439,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate isThreadPost = isThreadChat && messageObject.messageOwner.fwd_from != null && messageObject.messageOwner.fwd_from.channel_post != 0; isAvatarVisible = !isThreadPost && isChat && !messageObject.isOutOwner() && messageObject.needDrawAvatar() && (currentPosition == null || currentPosition.edge); boolean drawAvatar = isChat && !isThreadPost && !messageObject.isOutOwner() && messageObject.needDrawAvatar(); + if (messageObject.customAvatarDrawable != null) { + isAvatarVisible = true; + drawAvatar = true; + } wasLayout = false; groupPhotoInvisible = false; animatingDrawVideoImageButton = 0; @@ -3226,6 +3498,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } } } + spoilerPressed = null; + isCaptionSpoilerPressed = false; + isSpoilerRevealing = false; linkPreviewPressed = false; buttonPressed = 0; additionalTimeOffsetY = 0; @@ -3296,7 +3571,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } int captionNewLine = 0; availableTimeWidth = 0; - lastReactions = messageObject.messageOwner.reactions; + photoImage.setForceLoading(false); photoImage.setNeedsQualityThumb(false); photoImage.setShouldGenerateQualityThumb(false); @@ -3305,6 +3580,16 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate photoImage.setMediaStartEndTime(-1, -1); boolean canChangeRadius = true; + if (currentPosition == null || ((currentPosition.flags & MessageObject.POSITION_FLAG_BOTTOM) != 0)) { + if (currentPosition != null) { + reactionsLayoutInBubble.setMessage(groupedMessages.findPrimaryMessageObject(), !messageObject.shouldDrawReactionsInLayout(), resourcesProvider); + } else { + reactionsLayoutInBubble.setMessage(messageObject, !messageObject.shouldDrawReactionsInLayout(), resourcesProvider); + } + } else { + reactionsLayoutInBubble.setMessage(null, false, resourcesProvider); + } + if (messageChanged) { firstVisibleBlockNum = 0; lastVisibleBlockNum = 0; @@ -3415,8 +3700,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (messageObject.type == 0) { drawForwardedName = !isRepliesChat; - int maxWidth; + if (drawAvatar) { if (AndroidUtilities.isTablet()) { maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(122); @@ -3601,6 +3886,22 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate backgroundWidth = messageObject.textWidth + getExtraTextX() * 2 + (hasGamePreview || hasInvoicePreview ? AndroidUtilities.dp(10) : 0); totalHeight = messageObject.textHeight + AndroidUtilities.dp(19.5f) + namesOffset; + + if (!reactionsLayoutInBubble.isSmall) { + reactionsLayoutInBubble.measure(maxWidth); + if (!reactionsLayoutInBubble.isEmpty) { + reactionsLayoutInBubble.totalHeight = reactionsLayoutInBubble.height + AndroidUtilities.dp(8); + if (reactionsLayoutInBubble.width > backgroundWidth) { + backgroundWidth = reactionsLayoutInBubble.width; + } + + if ((hasLinkPreview || hasInvoicePreview) && !drawInstantView) { + reactionsLayoutInBubble.totalHeight += AndroidUtilities.dp(6); + reactionsLayoutInBubble.positionOffsetY += AndroidUtilities.dp(3); + } + totalHeight += reactionsLayoutInBubble.totalHeight; + } + } if (drawPinnedTop) { namesOffset -= AndroidUtilities.dp(1); } @@ -4502,28 +4803,58 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } } } + if (!reactionsLayoutInBubble.isSmall) { + if (!reactionsLayoutInBubble.isEmpty) { + reactionsLayoutInBubble.measure(backgroundWidth - AndroidUtilities.dp(32)); + reactionsLayoutInBubble.totalHeight = reactionsLayoutInBubble.height + AndroidUtilities.dp(12); + reactionsLayoutInBubble.positionOffsetY += -AndroidUtilities.dp(4); + if (backgroundWidth - AndroidUtilities.dp(32) - reactionsLayoutInBubble.lastLineX < timeWidth) { + reactionsLayoutInBubble.totalHeight += AndroidUtilities.dp(12); + reactionsLayoutInBubble.positionOffsetY += -AndroidUtilities.dp(12); + } + totalHeight += reactionsLayoutInBubble.totalHeight; + } + } } else if (messageObject.type == 2) { drawForwardedName = !isRepliesChat; drawName = messageObject.isFromGroup() && messageObject.isSupergroup() || messageObject.isImportedForward() && messageObject.messageOwner.fwd_from.from_id == null; + int maxWidth; if (AndroidUtilities.isTablet()) { - backgroundWidth = Math.min(AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(drawAvatar ? 102 : 50), AndroidUtilities.dp(270)); + backgroundWidth = maxWidth = Math.min(AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(drawAvatar ? 102 : 50), AndroidUtilities.dp(270)); } else { - backgroundWidth = Math.min(getParentWidth() - AndroidUtilities.dp(drawAvatar ? 102 : 50), AndroidUtilities.dp(270)); + backgroundWidth = maxWidth = Math.min(getParentWidth() - AndroidUtilities.dp(drawAvatar ? 102 : 50), AndroidUtilities.dp(270)); } createDocumentLayout(backgroundWidth, messageObject); + setMessageObjectInternal(messageObject); totalHeight = AndroidUtilities.dp(70) + namesOffset; if (drawPinnedTop) { namesOffset -= AndroidUtilities.dp(1); } + if (!reactionsLayoutInBubble.isSmall) { + reactionsLayoutInBubble.measure(maxWidth - AndroidUtilities.dp(24)); + if (!reactionsLayoutInBubble.isEmpty) { + reactionsLayoutInBubble.totalHeight = reactionsLayoutInBubble.height + AndroidUtilities.dp(12); + measureTime(messageObject); + if (reactionsLayoutInBubble.width > backgroundWidth) { + backgroundWidth = reactionsLayoutInBubble.width; + } + if (reactionsLayoutInBubble.lastLineX + timeWidth + AndroidUtilities.dp(24) > backgroundWidth) { + reactionsLayoutInBubble.totalHeight += AndroidUtilities.dp(12); + reactionsLayoutInBubble.positionOffsetY -= AndroidUtilities.dp(12); + } + totalHeight += reactionsLayoutInBubble.totalHeight; + } + } } else if (messageObject.type == 14) { drawName = (messageObject.isFromGroup() && messageObject.isSupergroup() || messageObject.isImportedForward() && messageObject.messageOwner.fwd_from.from_id == null) && (currentPosition == null || (currentPosition.flags & MessageObject.POSITION_FLAG_TOP) != 0); + int maxWidth; if (AndroidUtilities.isTablet()) { - backgroundWidth = Math.min(AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(drawAvatar ? 102 : 50), AndroidUtilities.dp(270)); + backgroundWidth = maxWidth = Math.min(AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(drawAvatar ? 102 : 50), AndroidUtilities.dp(270)); } else { - backgroundWidth = Math.min(getParentWidth() - AndroidUtilities.dp(drawAvatar ? 102 : 50), AndroidUtilities.dp(270)); + backgroundWidth = maxWidth = Math.min(getParentWidth() - AndroidUtilities.dp(drawAvatar ? 102 : 50), AndroidUtilities.dp(270)); } createDocumentLayout(backgroundWidth, messageObject); @@ -4543,6 +4874,24 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (drawPinnedTop) { namesOffset -= AndroidUtilities.dp(1); } + if (!reactionsLayoutInBubble.isSmall) { + reactionsLayoutInBubble.measure(maxWidth - AndroidUtilities.dp(24)); + if (!reactionsLayoutInBubble.isEmpty) { + reactionsLayoutInBubble.totalHeight = reactionsLayoutInBubble.height + AndroidUtilities.dp(12); + measureTime(messageObject); + if (reactionsLayoutInBubble.width > backgroundWidth) { + backgroundWidth = reactionsLayoutInBubble.width; + } + if (reactionsLayoutInBubble.lastLineX + timeWidth + AndroidUtilities.dp(24) > backgroundWidth) { + reactionsLayoutInBubble.totalHeight += AndroidUtilities.dp(12); + reactionsLayoutInBubble.positionOffsetY -= AndroidUtilities.dp(12); + } + if (!messageObject.isRestrictedMessage && messageObject.caption != null) { + reactionsLayoutInBubble.positionOffsetY += AndroidUtilities.dp(14); + } + totalHeight += reactionsLayoutInBubble.totalHeight; + } + } } else if (messageObject.type == MessageObject.TYPE_POLL) { if (timerParticles == null) { timerParticles = new TimerParticles(); @@ -4807,11 +5156,22 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate instantTextWidth = Math.max(instantTextWidth, (int) Math.ceil(Theme.chat_instantViewPaint.measureText(str))); } int timeWidthTotal = timeWidth + (messageObject.isOutOwner() ? AndroidUtilities.dp(20) : 0) + getExtraTimeX(); - if (timeWidthTotal >= (backgroundWidth - AndroidUtilities.dp(76) - instantTextWidth) / 2) { + if (!reactionsLayoutInBubble.isSmall && reactionsLayoutInBubble.isEmpty && timeWidthTotal >= (backgroundWidth - AndroidUtilities.dp(76) - instantTextWidth) / 2) { totalHeight += AndroidUtilities.dp(18); insantTextNewLine = true; } } + if (!reactionsLayoutInBubble.isSmall) { + if (!reactionsLayoutInBubble.isEmpty) { + reactionsLayoutInBubble.measure(maxWidth); + totalHeight += reactionsLayoutInBubble.height + AndroidUtilities.dp(12); + int timeWidthTotal = timeWidth + (messageObject.isOutOwner() ? AndroidUtilities.dp(20) : 0) + getExtraTimeX(); + if (timeWidthTotal >= (backgroundWidth - AndroidUtilities.dp(24) - reactionsLayoutInBubble.lastLineX)) { + totalHeight += AndroidUtilities.dp(16); + reactionsLayoutInBubble.positionOffsetY -= AndroidUtilities.dp(16); + } + } + } } else { drawForwardedName = messageObject.messageOwner.fwd_from != null && !(messageObject.isAnyKindOfSticker() && messageObject.isDice()); if (!messageObject.isAnyKindOfSticker() && messageObject.type != MessageObject.TYPE_ROUND_VIDEO) { @@ -4853,11 +5213,12 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate int maxWidth = backgroundWidth - AndroidUtilities.dp(86 + 52); int widthForCaption = 0; createDocumentLayout(maxWidth, messageObject); + int width = backgroundWidth - AndroidUtilities.dp(31); + widthForCaption = width - AndroidUtilities.dp(10) - getExtraTextX() * 2; + if (!messageObject.isRestrictedMessage && !TextUtils.isEmpty(messageObject.caption)) { try { currentCaption = messageObject.caption; - int width = backgroundWidth - AndroidUtilities.dp(31); - widthForCaption = width - AndroidUtilities.dp(10) - getExtraTextX() * 2; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { captionLayout = StaticLayout.Builder.obtain(messageObject.caption, 0, messageObject.caption.length(), Theme.chat_msgTextPaint, widthForCaption) .setBreakStrategy(StaticLayout.BREAK_STRATEGY_HIGH_QUALITY) @@ -4867,6 +5228,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } else { captionLayout = new StaticLayout(messageObject.caption, Theme.chat_msgTextPaint, widthForCaption, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); } + updateCaptionSpoilers(); } catch (Exception e) { FileLog.e(e); } @@ -4890,7 +5252,12 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } } } - + if (!reactionsLayoutInBubble.isSmall) { + reactionsLayoutInBubble.measure(widthForCaption); + if (!reactionsLayoutInBubble.isEmpty && reactionsLayoutInBubble.width + AndroidUtilities.dp(31) > maxTextWidth) { + maxTextWidth = reactionsLayoutInBubble.width + AndroidUtilities.dp(31); + } + } if (maxTextWidth > 0 && currentPosition == null) { backgroundWidth = maxTextWidth; maxWidth = maxTextWidth - AndroidUtilities.dp(31); @@ -4910,13 +5277,24 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate int lineCount = infoLayout.getLineCount(); measureTime(messageObject); int timeLeft = backgroundWidth - AndroidUtilities.dp(40 + 18 + 56 + 8) - infoWidth; - if (timeLeft < timeWidth) { + if (timeLeft < timeWidth && (reactionsLayoutInBubble.isSmall || reactionsLayoutInBubble.isEmpty)) { photoHeight += AndroidUtilities.dp(12); } else if (lineCount == 1) { photoHeight += AndroidUtilities.dp(4); } } } + if (!reactionsLayoutInBubble.isSmall && !reactionsLayoutInBubble.isEmpty) { + reactionsLayoutInBubble.positionOffsetY += AndroidUtilities.dp(12); + reactionsLayoutInBubble.totalHeight = reactionsLayoutInBubble.height + AndroidUtilities.dp(8); + measureTime(messageObject); + int timeLeft = backgroundWidth - reactionsLayoutInBubble.lastLineX - AndroidUtilities.dp(24); + if (timeLeft < timeWidth) { + reactionsLayoutInBubble.totalHeight += AndroidUtilities.dp(12); + reactionsLayoutInBubble.positionOffsetY -= AndroidUtilities.dp(12); + } + additionHeight += reactionsLayoutInBubble.totalHeight; + } } else if (messageObject.type == 4) { //geo TLRPC.GeoPoint point = messageObject.messageOwner.media.geo; double lat = point.lat; @@ -5068,6 +5446,16 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate photoImage.setImage(currentUrl, null, null, null, 0); } } + if (!reactionsLayoutInBubble.isSmall) { + reactionsLayoutInBubble.measure(backgroundWidth - AndroidUtilities.dp(16)); + reactionsLayoutInBubble.totalHeight = reactionsLayoutInBubble.height + AndroidUtilities.dp(14); + measureTime(messageObject); + if (reactionsLayoutInBubble.lastLineX + timeWidth + AndroidUtilities.dp(24) > backgroundWidth) { + reactionsLayoutInBubble.totalHeight += AndroidUtilities.dp(12); + reactionsLayoutInBubble.positionOffsetY -= AndroidUtilities.dp(12); + } + additionHeight += reactionsLayoutInBubble.totalHeight; + } } else if (messageObject.isAnyKindOfSticker()) { drawBackground = false; boolean isWebpSticker = messageObject.type == MessageObject.TYPE_STICKER; @@ -5083,11 +5471,11 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate photoWidth = photoHeight = 512; } float maxHeight; - float maxWidth; + int maxWidth; if (AndroidUtilities.isTablet()) { - maxHeight = maxWidth = AndroidUtilities.getMinTabletSide() * 0.4f; + maxHeight = maxWidth = (int) (AndroidUtilities.getMinTabletSide() * 0.4f); } else { - maxHeight = maxWidth = Math.min(getParentWidth(), AndroidUtilities.displaySize.y) * 0.5f; + maxHeight = maxWidth = (int) (Math.min(getParentWidth(), AndroidUtilities.displaySize.y) * 0.5f); } String filter; if (messageObject.isAnimatedEmoji() || messageObject.isDice()) { @@ -5099,7 +5487,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate photoHeight = (int) maxHeight; photoWidth = photoHeight + AndroidUtilities.dp(100); } - photoHeight *= maxWidth / photoWidth; + photoHeight *= maxWidth / (float) photoWidth; photoWidth = (int) maxWidth; if (photoHeight > maxHeight) { photoWidth *= maxHeight / photoHeight; @@ -5163,6 +5551,12 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } else { photoImage.setImage(null, null, null, null, messageObject, 0); } + if (!reactionsLayoutInBubble.isSmall) { + reactionsLayoutInBubble.measure(maxWidth); + reactionsLayoutInBubble.drawServiceShaderBackground = true; + additionHeight += reactionsLayoutInBubble.height + AndroidUtilities.dp(8); + reactionsLayoutInBubble.positionOffsetY += AndroidUtilities.dp(4); + } } else { currentPhotoObject = FileLoader.getClosestPhotoSizeWithSize(messageObject.photoThumbs, AndroidUtilities.getPhotoSize()); photoParentObject = messageObject.photoThumbsObject; @@ -5455,7 +5849,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } else { minCaptionWidth = (int) (Math.min(getParentWidth(), AndroidUtilities.displaySize.y) * 0.65f); } - if (!messageObject.needDrawBluredPreview() && currentCaption != null && photoWidth < minCaptionWidth) { + if (!messageObject.needDrawBluredPreview() && (currentCaption != null || (!reactionsLayoutInBubble.isEmpty && !reactionsLayoutInBubble.isSmall) && photoWidth < minCaptionWidth)) { widthForCaption = minCaptionWidth; fixPhotoWidth = true; } else { @@ -5480,6 +5874,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } else { captionLayout = new StaticLayout(currentCaption, Theme.chat_msgTextPaint, widthForCaption, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); } + updateCaptionSpoilers(); int lineCount = captionLayout.getLineCount(); if (lineCount > 0) { if (fixPhotoWidth) { @@ -5503,19 +5898,62 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate additionHeight += addedCaptionHeight; int widthToCheck = Math.max(captionWidth, photoWidth - AndroidUtilities.dp(10)); float lastLineWidth = captionLayout.getLineWidth(captionLayout.getLineCount() - 1) + captionLayout.getLineLeft(captionLayout.getLineCount() - 1); - if (!shouldDrawTimeOnMedia() && widthToCheck + AndroidUtilities.dp(2) - lastLineWidth < timeWidthTotal + getExtraTimeX()) { + if ((reactionsLayoutInBubble.isEmpty || reactionsLayoutInBubble.isSmall) && !shouldDrawTimeOnMedia() && widthToCheck + AndroidUtilities.dp(2) - lastLineWidth < timeWidthTotal + getExtraTimeX()) { additionHeight += AndroidUtilities.dp(14); addedCaptionHeight += AndroidUtilities.dp(14); captionNewLine = 1; } } else { captionLayout = null; + updateCaptionSpoilers(); } } } catch (Exception e) { FileLog.e(e); } } + if (!reactionsLayoutInBubble.isSmall) { + boolean useBackgroundWidth = backgroundWidth - AndroidUtilities.dp(24) > widthForCaption; + int maxWidth = Math.max(backgroundWidth - AndroidUtilities.dp(24), widthForCaption); + reactionsLayoutInBubble.measure(maxWidth); + if (!reactionsLayoutInBubble.isEmpty) { + if (shouldDrawTimeOnMedia()) { + reactionsLayoutInBubble.drawServiceShaderBackground = true; + } + int heightLocal = reactionsLayoutInBubble.height; + if (captionLayout == null) { + heightLocal += AndroidUtilities.dp(12); + heightLocal += AndroidUtilities.dp(4); + } else { + heightLocal += AndroidUtilities.dp(12); + reactionsLayoutInBubble.positionOffsetY += AndroidUtilities.dp(12); + } + reactionsLayoutInBubble.totalHeight = heightLocal; + additionHeight += reactionsLayoutInBubble.totalHeight; + + if (!shouldDrawTimeOnMedia()) { + + int widthToCheck = Math.min(maxWidth, reactionsLayoutInBubble.width + timeWidthTotal + getExtraTimeX() + AndroidUtilities.dp(2)); + float lastLineWidth = reactionsLayoutInBubble.lastLineX; + if (!shouldDrawTimeOnMedia() && widthToCheck - lastLineWidth < timeWidthTotal + getExtraTimeX()) { + additionHeight += AndroidUtilities.dp(14); + reactionsLayoutInBubble.totalHeight += AndroidUtilities.dp(14); + reactionsLayoutInBubble.positionOffsetY -= AndroidUtilities.dp(14); + captionNewLine = 1; + if (!useBackgroundWidth && captionWidth < reactionsLayoutInBubble.width) { + captionWidth = reactionsLayoutInBubble.width; + } + } else if (!useBackgroundWidth) { + if (reactionsLayoutInBubble.lastLineX + timeWidthTotal > captionWidth) { + captionWidth = reactionsLayoutInBubble.lastLineX + timeWidthTotal; + } + if (reactionsLayoutInBubble.width > captionWidth) { + captionWidth = reactionsLayoutInBubble.width; + } + } + } + } + } int minWidth = (int) (Theme.chat_infoPaint.measureText("100%") + AndroidUtilities.dp(100/*48*/)/* + timeWidth*/); if (currentMessagesGroup == null && (documentAttachType == DOCUMENT_ATTACH_TYPE_VIDEO || documentAttachType == DOCUMENT_ATTACH_TYPE_GIF) && photoWidth < minWidth) { @@ -5740,6 +6178,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate invalidate(); } + // if ((currentPosition == null || currentMessageObject.isMusic() || currentMessageObject.isDocument()) && !messageObject.isAnyKindOfSticker() && addedCaptionHeight == 0) { if (!messageObject.isRestrictedMessage && captionLayout == null && messageObject.caption != null) { try { @@ -5755,6 +6194,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } else { captionLayout = new StaticLayout(messageObject.caption, Theme.chat_msgTextPaint, widthForCaption, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); } + updateCaptionSpoilers(); } catch (Exception e) { FileLog.e(e); } @@ -5870,7 +6310,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate botButtonsByPosition.clear(); botButtonsLayout = null; } - if (!messageObject.isRestrictedMessage && currentPosition == null && (messageObject.messageOwner.reply_markup instanceof TLRPC.TL_replyInlineMarkup || messageObject.messageOwner.reactions != null && !messageObject.messageOwner.reactions.results.isEmpty())) { + if (!messageObject.isRestrictedMessage && currentPosition == null && (messageObject.messageOwner.reply_markup instanceof TLRPC.TL_replyInlineMarkup)) { int rows; if (messageObject.messageOwner.reply_markup instanceof TLRPC.TL_replyInlineMarkup) { @@ -5950,45 +6390,6 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } } } - } else { - int buttonsCount = messageObject.messageOwner.reactions.results.size(); - int buttonWidth = (widthForButtons - AndroidUtilities.dp(5) * (buttonsCount - 1) - AndroidUtilities.dp(2)) / buttonsCount; - for (int b = 0; b < buttonsCount; b++) { - TLRPC.TL_reactionCount reaction = messageObject.messageOwner.reactions.results.get(b); - BotButton botButton = new BotButton(); - botButton.reaction = reaction; - String key = reaction.reaction; - String position = 0 + "" + b; - BotButton oldButton; - if (oldByPosition != null) { - oldButton = oldByPosition.get(position); - } else { - oldButton = oldByData.get(key); - } - if (oldButton != null) { - botButton.progressAlpha = oldButton.progressAlpha; - botButton.angle = oldButton.angle; - botButton.lastUpdateTime = oldButton.lastUpdateTime; - } else { - botButton.lastUpdateTime = System.currentTimeMillis(); - } - botButtonsByData.put(key, botButton); - botButtonsByPosition.put(position, botButton); - botButton.x = b * (buttonWidth + AndroidUtilities.dp(5)); - botButton.y = AndroidUtilities.dp(5); - botButton.width = buttonWidth; - botButton.height = AndroidUtilities.dp(44); - - TextPaint botButtonPaint = (TextPaint) getThemedPaint(Theme.key_paint_chatBotButton); - CharSequence buttonText = Emoji.replaceEmoji(String.format("%d %s", reaction.count, reaction.reaction), botButtonPaint.getFontMetricsInt(), AndroidUtilities.dp(15), false); - buttonText = TextUtils.ellipsize(buttonText, botButtonPaint, buttonWidth - AndroidUtilities.dp(10), TextUtils.TruncateAt.END); - - botButton.title = new StaticLayout(buttonText, botButtonPaint, buttonWidth - AndroidUtilities.dp(10), Layout.Alignment.ALIGN_CENTER, 1.0f, 0.0f, false); - botButtons.add(botButton); - if (b == buttonsCount - 1) { - maxButtonsWidth = Math.max(maxButtonsWidth, botButton.x + botButton.width); - } - } } widthForButtons = maxButtonsWidth; } else { @@ -6320,6 +6721,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate invalidate(); } + public void setInvalidateSpoilersParent(boolean invalidateSpoilersParent) { + this.invalidateSpoilersParent = invalidateSpoilersParent; + } + public void setInvalidatesParent(boolean value) { invalidatesParent = value; } @@ -6605,17 +7010,25 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } private void calcBackgroundWidth(int maxWidth, int timeMore, int maxChildWidth) { - if (hasLinkPreview || hasOldCaptionPreview || hasGamePreview || hasInvoicePreview || maxWidth - currentMessageObject.lastLineWidth < timeMore || currentMessageObject.hasRtl) { + boolean newLineForTime; + int lastLineWidth = (reactionsLayoutInBubble.isEmpty || reactionsLayoutInBubble.isSmall) ? currentMessageObject.lastLineWidth : reactionsLayoutInBubble.lastLineX; + if (!reactionsLayoutInBubble.isEmpty && !reactionsLayoutInBubble.isSmall) { + newLineForTime = maxWidth - lastLineWidth < timeMore || currentMessageObject.hasRtl; + } else { + newLineForTime = hasLinkPreview || hasOldCaptionPreview || hasGamePreview || hasInvoicePreview || maxWidth - lastLineWidth < timeMore || currentMessageObject.hasRtl; + } + + if (newLineForTime) { totalHeight += AndroidUtilities.dp(14); hasNewLineForTime = true; - backgroundWidth = Math.max(maxChildWidth, currentMessageObject.lastLineWidth) + AndroidUtilities.dp(31); + backgroundWidth = Math.max(maxChildWidth, lastLineWidth) + AndroidUtilities.dp(31); backgroundWidth = Math.max(backgroundWidth, (currentMessageObject.isOutOwner() ? timeWidth + AndroidUtilities.dp(17) : timeWidth) + AndroidUtilities.dp(31)); } else { - int diff = maxChildWidth - getExtraTextX() - currentMessageObject.lastLineWidth; + int diff = maxChildWidth - getExtraTextX() - lastLineWidth; if (diff >= 0 && diff <= timeMore) { backgroundWidth = maxChildWidth + timeMore - diff + AndroidUtilities.dp(31); } else { - backgroundWidth = Math.max(maxChildWidth, currentMessageObject.lastLineWidth + timeMore) + AndroidUtilities.dp(31); + backgroundWidth = Math.max(maxChildWidth, lastLineWidth + timeMore) + AndroidUtilities.dp(31); } } } @@ -7383,10 +7796,16 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } private void drawContent(Canvas canvas) { - if (needNewVisiblePart && currentMessageObject.type == 0) { + boolean newPart = needNewVisiblePart && currentMessageObject.type == 0, hasSpoilers = hasSpoilers(); + if (newPart || hasSpoilers) { getLocalVisibleRect(scrollRect); - setVisiblePart(scrollRect.top, scrollRect.bottom - scrollRect.top, parentHeight, parentViewTopOffset, viewTop, parentWidth, backgroundHeight); - needNewVisiblePart = false; + if (hasSpoilers) { + updateSpoilersVisiblePart(scrollRect.top, scrollRect.bottom); + } + if (newPart) { + setVisiblePart(scrollRect.top, scrollRect.bottom - scrollRect.top, parentHeight, parentViewTopOffset, viewTop, parentWidth, backgroundHeight); + needNewVisiblePart = false; + } } float buttonX = this.buttonX; @@ -7644,7 +8063,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate canvas.translate(timeAudioX + songX, AndroidUtilities.dp(13) + namesOffset + mediaOffsetY); songLayout.draw(canvas); canvas.restore(); - + boolean showSeekbar = MediaController.getInstance().isPlayingMessage(currentMessageObject); if (showSeekbar && toSeekBarProgress != 1f) { toSeekBarProgress += 16f / 100f; @@ -7763,7 +8182,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (captionLayout != null) { updateCaptionLayout(); } - if (!currentMessageObject.preview && (currentPosition == null || currentMessagesGroup != null && currentMessagesGroup.isDocuments) && !transitionParams.transformGroupToSingleMessage && !(enterTransitionInPorgress && currentMessageObject.isVoice())) { + updateReactionLayoutPosition(); + if (!currentMessageObject.preview && (currentPosition == null || currentMessagesGroup != null && currentMessagesGroup.isDocuments) && !transitionParams.animateBackgroundBoundsInner && !(enterTransitionInPorgress && currentMessageObject.isVoice())) { drawCaptionLayout(canvas, false, 1f); } @@ -7939,6 +8359,46 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate transitionParams.recordDrawingState(); } + private void updateReactionLayoutPosition() { + if (!reactionsLayoutInBubble.isEmpty && (currentPosition == null || ((currentPosition.flags & MessageObject.POSITION_FLAG_BOTTOM) != 0 && (currentPosition.flags & MessageObject.POSITION_FLAG_LEFT) != 0)) && !reactionsLayoutInBubble.isSmall) { + if (currentMessageObject.isOutOwner()) { + reactionsLayoutInBubble.x = getCurrentBackgroundLeft() + AndroidUtilities.dp(11); + } else { + reactionsLayoutInBubble.x = getCurrentBackgroundLeft() + AndroidUtilities.dp(!mediaBackground && drawPinnedBottom ? 11 : 17); + if (mediaBackground) { + reactionsLayoutInBubble.x -= AndroidUtilities.dp(9); + } + } + reactionsLayoutInBubble.y = getBackgroundDrawableBottom() - AndroidUtilities.dp(10) - reactionsLayoutInBubble.height; + reactionsLayoutInBubble.y -= (drawCommentButton ? AndroidUtilities.dp(43) : 0); + if (hasNewLineForTime) { + reactionsLayoutInBubble.y -= AndroidUtilities.dp(16); + } + if (captionLayout != null) { + reactionsLayoutInBubble.y -= AndroidUtilities.dp(14); + } + reactionsLayoutInBubble.y = reactionsLayoutInBubble.y + reactionsLayoutInBubble.positionOffsetY; + } + if (reactionsLayoutInBubble.isSmall && !reactionsLayoutInBubble.isEmpty) { + int timeYOffset; + if (shouldDrawTimeOnMedia()) { + timeYOffset = -(drawCommentButton ? AndroidUtilities.dp(41.3f) : 0); + } else { + if (currentMessageObject.isSponsored()) { + timeYOffset = -AndroidUtilities.dp(48); + if (hasNewLineForTime) { + timeYOffset -= AndroidUtilities.dp(16); + } + } else { + timeYOffset = -(drawCommentButton ? AndroidUtilities.dp(43) : 0); + } + } + reactionsLayoutInBubble.y = (int) (shouldDrawTimeOnMedia() ? photoImage.getImageY2() + additionalTimeOffsetY - AndroidUtilities.dp(7.3f) - timeLayout.getHeight() : layoutHeight - AndroidUtilities.dp(pinnedBottom || pinnedTop ? 7.5f : 6.5f) - timeLayout.getHeight() + timeYOffset); + reactionsLayoutInBubble.y += timeLayout.getHeight() / 2f - AndroidUtilities.dp(7); + reactionsLayoutInBubble.x = (int) timeX; + } + } + public void drawLinkPreview(Canvas canvas, float alpha) { if (!currentMessageObject.isSponsored() && !hasLinkPreview && !hasGamePreview && !hasInvoicePreview) { return; @@ -8408,6 +8868,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate restore = canvas.saveLayerAlpha(rect, (int) (alpha * 255), Canvas.ALL_SAVE_FLAG); } } + int spoilersColor = currentMessageObject.isOut() && !ChatObject.isChannelAndNotMegaGroup(currentMessageObject.getChatId(), currentAccount) ? getThemedColor(Theme.key_chat_outTimeText) : Theme.chat_msgTextPaint.getColor(); for (int a = firstVisibleBlockNum; a <= lastVisibleBlockNum; a++) { if (a >= textLayoutBlocks.size()) { break; @@ -8431,7 +8892,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } try { Emoji.emojiDrawingYOffset = -transitionYOffsetForDrawables; - block.textLayout.draw(canvas); + SpoilerEffect.renderWithRipple(this, invalidateSpoilersParent, spoilersColor, 0, block.spoilersPatchedTextLayout, block.textLayout, block.spoilers, canvas); Emoji.emojiDrawingYOffset = 0; } catch (Exception e) { FileLog.e(e); @@ -8475,6 +8936,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (drawCommentButton && drawSideButton != 3) { captionY -= AndroidUtilities.dp(shouldDrawTimeOnMedia() ? 41.3f : 43); } + if (!reactionsLayoutInBubble.isEmpty && !reactionsLayoutInBubble.isSmall) { + captionY -= reactionsLayoutInBubble.totalHeight; + } } captionX += getExtraTextX(); } @@ -9583,6 +10047,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate timeWidth += AndroidUtilities.dp(18); } } + if (reactionsLayoutInBubble.isSmall) { + reactionsLayoutInBubble.measure(Integer.MAX_VALUE); + timeWidth += reactionsLayoutInBubble.width; + } if (signString != null) { if (availableTimeWidth == 0) { availableTimeWidth = AndroidUtilities.dp(1000); @@ -9689,7 +10157,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate updateCurrentUserAndChat(); if (isAvatarVisible) { - if (currentUser != null) { + if (messageObject.customAvatarDrawable != null) { + avatarImage.setImageBitmap(messageObject.customAvatarDrawable); + } else if (currentUser != null) { if (currentUser.photo != null) { currentPhoto = currentUser.photo.photo_small; } else { @@ -9766,7 +10236,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate adminWidth = 0; } - if (needAuthorName) { + if (messageObject.customName != null) { + currentNameString = messageObject.customName; + } else if (needAuthorName) { currentNameString = getAuthorName(); } else { currentNameString = ""; @@ -10010,6 +10482,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate mess = mess.replace('\n', ' '); stringFinalText = Emoji.replaceEmoji(mess, Theme.chat_replyTextPaint.getFontMetricsInt(), AndroidUtilities.dp(14), false); stringFinalText = TextUtils.ellipsize(stringFinalText, Theme.chat_replyTextPaint, maxWidth, TextUtils.TruncateAt.END); + MediaDataController.addTextStyleRuns(messageObject.replyMessageObject.messageOwner.entities, messageObject.replyMessageObject.caption, (Spannable) stringFinalText); } else if (messageObject.replyMessageObject.messageText != null && messageObject.replyMessageObject.messageText.length() > 0) { String mess = messageObject.replyMessageObject.messageText.toString(); if (mess.length() > 150) { @@ -10018,6 +10491,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate mess = mess.replace('\n', ' '); stringFinalText = Emoji.replaceEmoji(mess, Theme.chat_replyTextPaint.getFontMetricsInt(), AndroidUtilities.dp(14), false); stringFinalText = TextUtils.ellipsize(stringFinalText, Theme.chat_replyTextPaint, maxWidth, TextUtils.TruncateAt.END); + if (stringFinalText instanceof Spannable) { + MediaDataController.addTextStyleRuns(messageObject.replyMessageObject, (Spannable) stringFinalText); + } } } else { replyImageReceiver.setImageBitmap((Drawable) null); @@ -10077,11 +10553,20 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate try { replyTextWidth = AndroidUtilities.dp(4 + (needReplyImage ? 44 : 0)); if (stringFinalText != null) { - replyTextLayout = new StaticLayout(stringFinalText, Theme.chat_replyTextPaint, maxWidth + AndroidUtilities.dp(10), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); + SpannableStringBuilder sb = new SpannableStringBuilder(stringFinalText); + for (TextStyleSpan span : sb.getSpans(0, sb.length(), TextStyleSpan.class)) { + if ((span.getTextStyleRun().flags & TextStyleSpan.FLAG_STYLE_MONO) != 0) { + sb.removeSpan(span); + } + } + replyTextLayout = new StaticLayout(sb, Theme.chat_replyTextPaint, maxWidth + AndroidUtilities.dp(10), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); if (replyTextLayout.getLineCount() > 0) { replyTextWidth += (int) Math.ceil(replyTextLayout.getLineWidth(0)) + AndroidUtilities.dp(8); replyTextOffset = (int) replyTextLayout.getLineLeft(0); } + replySpoilers.clear(); + if (getMessageObject().replyMessageObject != null && !getMessageObject().replyMessageObject.isSpoilersRevealed) + SpoilerEffect.addSpoilers(this, replyTextLayout, replySpoilersPool, replySpoilers); } } catch (Exception e) { FileLog.e(e); @@ -10146,6 +10631,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (drawCommentButton) { h += AndroidUtilities.dp(shouldDrawTimeOnMedia() ? 41.3f : 43); } + if (!reactionsLayoutInBubble.isEmpty && currentMessageObject.shouldDrawReactionsInLayout()) { + h += reactionsLayoutInBubble.totalHeight; + } return h; } @@ -10488,6 +10976,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate parent.invalidate(); } } + if (restore != Integer.MIN_VALUE) { canvas.restoreToCount(restore); } @@ -10904,7 +11393,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } public void drawOutboundsContent(Canvas canvas) { - if (transitionParams.animateBackgroundBoundsInner) { + if (transitionParams.animateBackgroundWidth) { if (!transitionParams.transitionBotButtons.isEmpty()) { drawBotButtons(canvas, transitionParams.transitionBotButtons, 1f - transitionParams.animateChangeProgress); } @@ -11437,12 +11926,13 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (replyTextLayout != null) { canvas.save(); canvas.translate(forwardNameX, replyStartY + AndroidUtilities.dp(19)); - replyTextLayout.draw(canvas); + + int spoilersColor = currentMessageObject.isOut() && !ChatObject.isChannelAndNotMegaGroup(currentMessageObject.getChatId(), currentAccount) ? getThemedColor(Theme.key_chat_outTimeText) : replyTextLayout.getPaint().getColor(); + SpoilerEffect.renderWithRipple(this, invalidateSpoilersParent, spoilersColor, -AndroidUtilities.dp(2), spoilersPatchedReplyTextLayout, replyTextLayout, replySpoilers, canvas); canvas.restore(); } } } - if (restore != Integer.MIN_VALUE) { canvas.restoreToCount(restore); } @@ -11456,6 +11946,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate return drawCommentButton; } + public StaticLayout getCaptionLayout() { return captionLayout; } @@ -11557,12 +12048,33 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } else { drawCaptionLayout(canvas, captionLayout, selectionOnly, alpha); } + + if ((currentPosition == null || ((currentPosition.flags & MessageObject.POSITION_FLAG_BOTTOM) != 0 && (currentPosition.flags & MessageObject.POSITION_FLAG_LEFT) != 0)) && !reactionsLayoutInBubble.isSmall) { + if (reactionsLayoutInBubble.drawServiceShaderBackground) { + applyServiceShaderMatrix(getMeasuredWidth(), backgroundHeight, getX(), viewTop); + } + if (reactionsLayoutInBubble.drawServiceShaderBackground || !transitionParams.animateBackgroundBoundsInner || currentPosition != null) { + reactionsLayoutInBubble.draw(canvas, transitionParams.animateChange ? transitionParams.animateChangeProgress : 1f); + } else { + canvas.save(); + canvas.clipRect(0, 0, getMeasuredWidth(), getBackgroundDrawableBottom() + transitionParams.deltaBottom); + reactionsLayoutInBubble.draw(canvas, transitionParams.animateChange ? transitionParams.animateChangeProgress : 1f); + canvas.restore(); + } + + } } private void drawCaptionLayout(Canvas canvas, StaticLayout captionLayout, boolean selectionOnly, float alpha) { if (currentBackgroundDrawable != null && drawCommentButton && timeLayout != null) { int x; - float y = layoutHeight - AndroidUtilities.dp(18) - timeLayout.getHeight(); + float y = layoutHeight + transitionParams.deltaBottom - AndroidUtilities.dp(18) - timeLayout.getHeight(); + if (currentMessagesGroup != null) { + y += currentMessagesGroup.transitionParams.offsetBottom; + if (currentMessagesGroup.transitionParams.backgroundChangeBounds) { + y -= getTranslationY(); + } + } if (mediaBackground) { x = backgroundDrawableLeft + AndroidUtilities.dp(12) + getExtraTextX(); } else { @@ -11636,13 +12148,20 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } } } - if (!mediaBackground || captionLayout != null) { + if (!mediaBackground || captionLayout != null || (!reactionsLayoutInBubble.isEmpty && !reactionsLayoutInBubble.isSmall)) { if (isDrawSelectionBackground()) { Theme.chat_replyLinePaint.setColor(getThemedColor(currentMessageObject.isOutOwner() ? Theme.key_chat_outVoiceSeekbarSelected : Theme.key_chat_inVoiceSeekbarSelected)); } else { Theme.chat_replyLinePaint.setColor(getThemedColor(currentMessageObject.isOutOwner() ? Theme.key_chat_outVoiceSeekbar : Theme.key_chat_inVoiceSeekbar)); } float ly = layoutHeight - AndroidUtilities.dp(45.1f - h2); + ly += transitionParams.deltaBottom; + if (currentMessagesGroup != null) { + ly += currentMessagesGroup.transitionParams.offsetBottom; + if (currentMessagesGroup.transitionParams.backgroundChangeBounds) { + ly -= getTranslationY(); + } + } canvas.drawLine(x, ly, endX - AndroidUtilities.dp(14), ly, Theme.chat_replyLinePaint); } if (commentLayout != null && drawSideButton != 3) { @@ -11802,25 +12321,20 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate float captionY = this.captionY; float captionX = this.captionX; - if (currentMessagesGroup != null && currentMessagesGroup.transitionParams.backgroundChangeBounds) { - if (!transitionParams.animateReplaceCaptionLayout) { + + if (transitionParams.animateBackgroundBoundsInner) { + if (transitionParams.transformGroupToSingleMessage) { captionY -= getTranslationY(); - } - captionX += currentMessagesGroup.transitionParams.offsetLeft; - } else { - if (transitionParams.animateBackgroundBoundsInner) { - if (transitionParams.transformGroupToSingleMessage) { - captionY -= getTranslationY(); - captionX += transitionParams.deltaLeft; - } else if (transitionParams.moveCaption) { - captionX = this.captionX * transitionParams.animateChangeProgress + transitionParams.captionFromX * (1f - transitionParams.animateChangeProgress); - captionY = this.captionY * transitionParams.animateChangeProgress + transitionParams.captionFromY * (1f - transitionParams.animateChangeProgress); - } else { - captionX += transitionParams.deltaLeft; - } + captionX += transitionParams.deltaLeft; + } else if (transitionParams.moveCaption) { + captionX = this.captionX * transitionParams.animateChangeProgress + transitionParams.captionFromX * (1f - transitionParams.animateChangeProgress); + captionY = this.captionY * transitionParams.animateChangeProgress + transitionParams.captionFromY * (1f - transitionParams.animateChangeProgress); + } else { + captionX += transitionParams.deltaLeft; } } + int restore = Integer.MIN_VALUE; if (renderingAlpha != 1.0f) { rect.set(captionX, captionY, captionX + captionLayout.getWidth(), captionY + captionLayout.getHeight()); @@ -11858,7 +12372,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate getDelegate().getTextSelectionHelper().drawCaption(currentMessageObject.isOutOwner(), captionLayout, canvas); } Emoji.emojiDrawingYOffset = -transitionYOffsetForDrawables; - captionLayout.draw(canvas); + + int spoilersColor = currentMessageObject.isOut() && !ChatObject.isChannelAndNotMegaGroup(currentMessageObject.getChatId(), currentAccount) ? getThemedColor(Theme.key_chat_outTimeText) : captionLayout.getPaint().getColor(); + SpoilerEffect.renderWithRipple(this, invalidateSpoilersParent, spoilersColor, 0, captionPatchedSpoilersLayout, captionLayout, captionSpoilers, canvas); + Emoji.emojiDrawingYOffset = 0; } catch (Exception e) { FileLog.e(e); @@ -11878,7 +12395,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (overideShouldDrawTimeOnMedia != 0) { return overideShouldDrawTimeOnMedia == 1; } - return mediaBackground && captionLayout == null/* || isMedia && drawCommentButton && !isRepliesChat*/; + return mediaBackground && captionLayout == null && (reactionsLayoutInBubble.isEmpty || reactionsLayoutInBubble.isSmall || currentMessageObject.isAnyKindOfSticker() || currentMessageObject.isRoundVideo())/* || isMedia && drawCommentButton && !isRepliesChat*/; } public void drawTime(Canvas canvas, float alpha, boolean fromParent) { @@ -11978,6 +12495,15 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (transitionParams.animateBackgroundBoundsInner) { timeX += animationOffsetX; timeTitleTimeX += animationOffsetX; + + } + if (reactionsLayoutInBubble.isSmall) { + Log.d("kek", transitionParams.shouldAnimateTimeX + " " + transitionParams.animateBackgroundBoundsInner + " " + transitionParams.animateFromTimeX + " " + this.timeX); + if (transitionParams.animateBackgroundBoundsInner && transitionParams.deltaRight != 0) { + timeTitleTimeX += reactionsLayoutInBubble.getCurrentWidth(1f); + } else { + timeTitleTimeX += reactionsLayoutInBubble.getCurrentWidth(transitionParams.animateChangeProgress); + } } int timeYOffset; @@ -12017,6 +12543,11 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate paint.setAlpha(oldAlpha); float additionalX = -timeLayout.getLineLeft(0); + if (reactionsLayoutInBubble.isSmall) { + updateReactionLayoutPosition(); + reactionsLayoutInBubble.draw(canvas, transitionParams.animateChangeProgress); + } + if (ChatObject.isChannel(currentChat) && !currentChat.megagroup || (currentMessageObject.messageOwner.flags & TLRPC.MESSAGE_FLAG_HAS_VIEWS) != 0 || repliesLayout != null || isPinned) { additionalX += this.timeWidth - timeLayout.getLineWidth(0); @@ -12080,8 +12611,15 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate timeYOffset = -(drawCommentButton ? AndroidUtilities.dp(43) : 0); } float additionalX = -timeLayout.getLineLeft(0); + if (reactionsLayoutInBubble.isSmall) { + updateReactionLayoutPosition(); + reactionsLayoutInBubble.draw(canvas, transitionParams.animateChangeProgress); + } if (ChatObject.isChannel(currentChat) && !currentChat.megagroup || (currentMessageObject.messageOwner.flags & TLRPC.MESSAGE_FLAG_HAS_VIEWS) != 0 || (repliesLayout != null || transitionParams.animateReplies) || (isPinned || transitionParams.animatePinned)) { additionalX += this.timeWidth - timeLayout.getLineWidth(0); + if (reactionsLayoutInBubble.isSmall && !reactionsLayoutInBubble.isEmpty) { + additionalX -= reactionsLayoutInBubble.width; + } int currentStatus = transitionParams.createStatusDrawableParams(); if (transitionParams.lastStatusDrawableParams >= 0 && transitionParams.lastStatusDrawableParams != currentStatus && !statusDrawableAnimationInProgress) { @@ -12126,6 +12664,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate ((View)getParent()).invalidate(); } } + canvas.save(); if (transitionParams.animateEditedEnter && transitionParams.animateChangeProgress != 1f) { if (transitionParams.animateEditedLayout != null) { @@ -12307,7 +12846,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate float scale = 0.5f + 0.5f * progress; alpha *= progress; - float offsetX = 0; + float offsetX = reactionsLayoutInBubble.isSmall ? reactionsLayoutInBubble.getCurrentWidth(1f) : 0; int timeAlpha = Theme.chat_timePaint.getAlpha(); float timeY = shouldDrawTimeOnMedia() ? photoImage.getImageY2() + additionalTimeOffsetY - AndroidUtilities.dp(7.3f) - timeLayout.getHeight() : layoutHeight - AndroidUtilities.dp(pinnedBottom || pinnedTop ? 7.5f : 6.5f) - timeLayout.getHeight() + timeYOffset; if (repliesLayout != null || transitionParams.animateReplies) { @@ -13417,7 +13956,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (drawInstantView) { int textX = (int) (photoImage.getImageX() - AndroidUtilities.dp(2)); - int instantY = currentBackgroundDrawable.getBounds().bottom - AndroidUtilities.dp(36 + 28); + int instantY = layoutHeight - AndroidUtilities.dp(36 + 30); + if (!reactionsLayoutInBubble.isEmpty && !reactionsLayoutInBubble.isSmall) { + instantY -= reactionsLayoutInBubble.totalHeight; + } Paint backPaint = Theme.chat_instantViewRectPaint; if (currentMessageObject.isOutOwner()) { Theme.chat_instantViewPaint.setColor(getThemedColor(Theme.key_chat_outPreviewInstantText)); @@ -13506,7 +14048,14 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } x1 = backgroundDrawableLeft + transitionParams.deltaLeft + AndroidUtilities.dp(8) + roundPlayingDrawableProgress + offsetX; - y1 = layoutHeight + transitionParams.deltaBottom - AndroidUtilities.dp(28 - (drawPinnedBottom ? 2 : 0)); + y1 = layoutHeight - AndroidUtilities.dp(28 - (drawPinnedBottom ? 2 : 0)); + if (!reactionsLayoutInBubble.isEmpty) { + y1 -= reactionsLayoutInBubble.totalHeight; + } + transitionParams.lastDrawRoundVideoDotY = y1; + if (transitionParams.animateRoundVideoDotY) { + y1 = transitionParams.animateFromRoundVideoDotY * (1f - transitionParams.animateChangeProgress) + y1 * transitionParams.animateChangeProgress; + } rect.set(x1, y1, x1 + timeWidthAudio + AndroidUtilities.dp(8 + 12 + 2), y1 + AndroidUtilities.dp(17)); int oldAlpha = getThemedPaint(Theme.key_paint_chatActionBackground).getAlpha(); @@ -13940,108 +14489,130 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (virtualViewId == HOST_VIEW_ID) { AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain(ChatMessageCell.this); onInitializeAccessibilityNodeInfo(info); - StringBuilder sb = new StringBuilder(); - if (isChat && currentUser != null && !currentMessageObject.isOut()) { - sb.append(UserObject.getUserName(currentUser)); - sb.append('\n'); - } - if (drawForwardedName) { - for (int a = 0; a < 2; a++) { - if (forwardedNameLayout[a] != null) { - sb.append(forwardedNameLayout[a].getText()); - sb.append(a == 0 ? " " : "\n"); + if (accessibilityText == null) { + SpannableStringBuilder sb = new SpannableStringBuilder(); + if (isChat && currentUser != null && !currentMessageObject.isOut()) { + sb.append(UserObject.getUserName(currentUser)); + sb.append('\n'); + } + if (drawForwardedName) { + for (int a = 0; a < 2; a++) { + if (forwardedNameLayout[a] != null) { + sb.append(forwardedNameLayout[a].getText()); + sb.append(a == 0 ? " " : "\n"); + } } } - } - if (!TextUtils.isEmpty(currentMessageObject.messageText)) { - sb.append(currentMessageObject.messageText); - } - if (documentAttach != null && (documentAttachType == DOCUMENT_ATTACH_TYPE_DOCUMENT || documentAttachType == DOCUMENT_ATTACH_TYPE_GIF || documentAttachType == DOCUMENT_ATTACH_TYPE_VIDEO)) { - if (buttonState == 1 && loadingProgressLayout != null) { - sb.append("\n"); - final boolean sending = currentMessageObject.isSending(); - final String key = sending ? "AccDescrUploadProgress" : "AccDescrDownloadProgress"; - final int resId = sending ? R.string.AccDescrUploadProgress : R.string.AccDescrDownloadProgress; - sb.append(LocaleController.formatString(key, resId, AndroidUtilities.formatFileSize(currentMessageObject.loadedFileSize), AndroidUtilities.formatFileSize(lastLoadingSizeTotal))); - } else if (buttonState == 0 || documentAttachType == DOCUMENT_ATTACH_TYPE_DOCUMENT) { - sb.append(", "); - sb.append(AndroidUtilities.formatFileSize(documentAttach.size)); + if (!TextUtils.isEmpty(currentMessageObject.messageText)) { + sb.append(currentMessageObject.messageText); } - if (documentAttachType == DOCUMENT_ATTACH_TYPE_VIDEO) { + if (documentAttach != null && (documentAttachType == DOCUMENT_ATTACH_TYPE_DOCUMENT || documentAttachType == DOCUMENT_ATTACH_TYPE_GIF || documentAttachType == DOCUMENT_ATTACH_TYPE_VIDEO)) { + if (buttonState == 1 && loadingProgressLayout != null) { + sb.append("\n"); + final boolean sending = currentMessageObject.isSending(); + final String key = sending ? "AccDescrUploadProgress" : "AccDescrDownloadProgress"; + final int resId = sending ? R.string.AccDescrUploadProgress : R.string.AccDescrDownloadProgress; + sb.append(LocaleController.formatString(key, resId, AndroidUtilities.formatFileSize(currentMessageObject.loadedFileSize), AndroidUtilities.formatFileSize(lastLoadingSizeTotal))); + } else if (buttonState == 0 || documentAttachType == DOCUMENT_ATTACH_TYPE_DOCUMENT) { + sb.append(", "); + sb.append(AndroidUtilities.formatFileSize(documentAttach.size)); + } + if (documentAttachType == DOCUMENT_ATTACH_TYPE_VIDEO) { + sb.append(", "); + sb.append(LocaleController.formatDuration(currentMessageObject.getDuration())); + } + } + if (currentMessageObject.isMusic()) { + sb.append("\n"); + sb.append(LocaleController.formatString("AccDescrMusicInfo", R.string.AccDescrMusicInfo, currentMessageObject.getMusicAuthor(), currentMessageObject.getMusicTitle())); sb.append(", "); sb.append(LocaleController.formatDuration(currentMessageObject.getDuration())); - } - } - if (currentMessageObject.isMusic()) { - sb.append("\n"); - sb.append(LocaleController.formatString("AccDescrMusicInfo", R.string.AccDescrMusicInfo, currentMessageObject.getMusicAuthor(), currentMessageObject.getMusicTitle())); - sb.append(", "); - sb.append(LocaleController.formatDuration(currentMessageObject.getDuration())); - } else if (currentMessageObject.isVoice() || isRoundVideo) { - sb.append(", "); - sb.append(LocaleController.formatDuration(currentMessageObject.getDuration())); - if (currentMessageObject.isContentUnread()) { + } else if (currentMessageObject.isVoice() || isRoundVideo) { sb.append(", "); - sb.append(LocaleController.getString("AccDescrMsgNotPlayed", R.string.AccDescrMsgNotPlayed)); - } - } - if (lastPoll != null) { - sb.append(", "); - sb.append(lastPoll.question); - sb.append(", "); - String title; - if (pollClosed) { - title = LocaleController.getString("FinalResults", R.string.FinalResults); - } else { - if (lastPoll.quiz) { - if (lastPoll.public_voters) { - title = LocaleController.getString("QuizPoll", R.string.QuizPoll); - } else { - title = LocaleController.getString("AnonymousQuizPoll", R.string.AnonymousQuizPoll); - } - } else if (lastPoll.public_voters) { - title = LocaleController.getString("PublicPoll", R.string.PublicPoll); - } else { - title = LocaleController.getString("AnonymousPoll", R.string.AnonymousPoll); - } - } - sb.append(title); - } - if (currentMessageObject.messageOwner.media != null && !TextUtils.isEmpty(currentMessageObject.caption)) { - sb.append("\n"); - sb.append(currentMessageObject.caption); - } - if (currentMessageObject.isOut()) { - if (currentMessageObject.isSent()) { - sb.append("\n"); - if (currentMessageObject.scheduled) { - sb.append(LocaleController.formatString("AccDescrScheduledDate", R.string.AccDescrScheduledDate, currentTimeString)); - } else { - sb.append(LocaleController.formatString("AccDescrSentDate", R.string.AccDescrSentDate, LocaleController.getString("TodayAt", R.string.TodayAt) + " " + currentTimeString)); + sb.append(LocaleController.formatDuration(currentMessageObject.getDuration())); + if (currentMessageObject.isContentUnread()) { sb.append(", "); - sb.append(currentMessageObject.isUnread() ? LocaleController.getString("AccDescrMsgUnread", R.string.AccDescrMsgUnread) : LocaleController.getString("AccDescrMsgRead", R.string.AccDescrMsgRead)); + sb.append(LocaleController.getString("AccDescrMsgNotPlayed", R.string.AccDescrMsgNotPlayed)); } - } else if (currentMessageObject.isSending()) { - sb.append("\n"); - sb.append(LocaleController.getString("AccDescrMsgSending", R.string.AccDescrMsgSending)); - final float sendingProgress = radialProgress.getProgress(); - if (sendingProgress > 0f) { - sb.append(", ").append(Math.round(sendingProgress * 100)).append("%"); - } - } else if (currentMessageObject.isSendError()) { - sb.append("\n"); - sb.append(LocaleController.getString("AccDescrMsgSendingError", R.string.AccDescrMsgSendingError)); } - } else { + if (lastPoll != null) { + sb.append(", "); + sb.append(lastPoll.question); + sb.append(", "); + String title; + if (pollClosed) { + title = LocaleController.getString("FinalResults", R.string.FinalResults); + } else { + if (lastPoll.quiz) { + if (lastPoll.public_voters) { + title = LocaleController.getString("QuizPoll", R.string.QuizPoll); + } else { + title = LocaleController.getString("AnonymousQuizPoll", R.string.AnonymousQuizPoll); + } + } else if (lastPoll.public_voters) { + title = LocaleController.getString("PublicPoll", R.string.PublicPoll); + } else { + title = LocaleController.getString("AnonymousPoll", R.string.AnonymousPoll); + } + } + sb.append(title); + } + if (currentMessageObject.messageOwner.media != null && !TextUtils.isEmpty(currentMessageObject.caption)) { + sb.append("\n"); + sb.append(currentMessageObject.caption); + } + if (currentMessageObject.isOut()) { + if (currentMessageObject.isSent()) { + sb.append("\n"); + if (currentMessageObject.scheduled) { + sb.append(LocaleController.formatString("AccDescrScheduledDate", R.string.AccDescrScheduledDate, currentTimeString)); + } else { + sb.append(LocaleController.formatString("AccDescrSentDate", R.string.AccDescrSentDate, LocaleController.getString("TodayAt", R.string.TodayAt) + " " + currentTimeString)); + sb.append(", "); + sb.append(currentMessageObject.isUnread() ? LocaleController.getString("AccDescrMsgUnread", R.string.AccDescrMsgUnread) : LocaleController.getString("AccDescrMsgRead", R.string.AccDescrMsgRead)); + } + } else if (currentMessageObject.isSending()) { + sb.append("\n"); + sb.append(LocaleController.getString("AccDescrMsgSending", R.string.AccDescrMsgSending)); + final float sendingProgress = radialProgress.getProgress(); + if (sendingProgress > 0f) { + sb.append(", ").append(Integer.toString(Math.round(sendingProgress * 100))).append("%"); + } + } else if (currentMessageObject.isSendError()) { + sb.append("\n"); + sb.append(LocaleController.getString("AccDescrMsgSendingError", R.string.AccDescrMsgSendingError)); + } + } else { + sb.append("\n"); + sb.append(LocaleController.formatString("AccDescrReceivedDate", R.string.AccDescrReceivedDate, LocaleController.getString("TodayAt", R.string.TodayAt) + " " + currentTimeString)); + } + if ((currentMessageObject.messageOwner.flags & TLRPC.MESSAGE_FLAG_HAS_VIEWS) != 0) { + sb.append("\n"); + sb.append(LocaleController.formatPluralString("AccDescrNumberOfViews", currentMessageObject.messageOwner.views)); + } sb.append("\n"); - sb.append(LocaleController.formatString("AccDescrReceivedDate", R.string.AccDescrReceivedDate, LocaleController.getString("TodayAt", R.string.TodayAt) + " " + currentTimeString)); + + CharacterStyle[] links = sb.getSpans(0, sb.length(), ClickableSpan.class); + + for (CharacterStyle link : links) { + int start = sb.getSpanStart(link); + int end = sb.getSpanEnd(link); + sb.removeSpan(link); + + ClickableSpan underlineSpan = new ClickableSpan() { + @Override + public void onClick(View view) { + if (delegate != null) { + delegate.didPressUrl(ChatMessageCell.this, link, false); + } + } + }; + sb.setSpan(underlineSpan, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } + accessibilityText = sb; } - if ((currentMessageObject.messageOwner.flags & TLRPC.MESSAGE_FLAG_HAS_VIEWS) != 0) { - sb.append("\n"); - sb.append(LocaleController.formatPluralString("AccDescrNumberOfViews", currentMessageObject.messageOwner.views)); - } - sb.append("\n"); - info.setContentDescription(sb.toString()); + + info.setText(accessibilityText); info.setEnabled(true); if (Build.VERSION.SDK_INT >= 19) { AccessibilityNodeInfo.CollectionItemInfo itemInfo = info.getCollectionItemInfo(); @@ -14089,26 +14660,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate seekBarAccessibilityDelegate.onInitializeAccessibilityNodeInfoInternal(info); } - int i; - if (currentMessageObject.messageText instanceof Spannable) { - Spannable buffer = (Spannable) currentMessageObject.messageText; - CharacterStyle[] links = buffer.getSpans(0, buffer.length(), ClickableSpan.class); - i = 0; - for (CharacterStyle link : links) { - info.addChild(ChatMessageCell.this, LINK_IDS_START + i); - i++; - } - } - if (currentMessageObject.caption instanceof Spannable && captionLayout != null) { - Spannable buffer = (Spannable) currentMessageObject.caption; - CharacterStyle[] links = buffer.getSpans(0, buffer.length(), ClickableSpan.class); - i = 0; - for (CharacterStyle link : links) { - info.addChild(ChatMessageCell.this, LINK_CAPTION_IDS_START + i); - i++; - } - } - i = 0; + int i = 0; for (BotButton button : botButtons) { info.addChild(ChatMessageCell.this, BOT_BUTTONS_START + i); i++; @@ -14409,8 +14961,6 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (delegate != null) { if (button.button != null) { delegate.didPressBotButton(ChatMessageCell.this, button.button); - } else if (button.reaction != null) { - delegate.didPressReaction(ChatMessageCell.this, button.reaction); } } sendAccessibilityEventForVirtualView(virtualViewId, AccessibilityEvent.TYPE_VIEW_CLICKED); @@ -14583,6 +15133,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate public StaticLayout lastDrawDocTitleLayout; public StaticLayout lastDrawInfoLayout; public boolean updatePhotoImageX; + public boolean animateRoundVideoDotY; + public float lastDrawRoundVideoDotY; + public float animateFromRoundVideoDotY; private boolean lastIsPinned; private boolean animatePinned; @@ -14635,6 +15188,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate public boolean wasDraw; public boolean animateBackgroundBoundsInner; + public boolean animateBackgroundWidth; public boolean ignoreAlpha; public boolean drawPinnedBottomBackground; public float changePinnedBottomProgress = 1f; @@ -14773,6 +15327,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate lastForwardNameX = forwardNameX; lastForwardedNamesOffset = namesOffset; lastForwardNameWidth = forwardedNameWidth; + + reactionsLayoutInBubble.recordDrawingState(); } public void recordDrawingStatePreview() { @@ -14783,6 +15339,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate lastForwardedNamesOffset = namesOffset; lastForwardNameWidth = forwardedNameWidth; } + public boolean animateChange() { if (!wasDraw) { return false; @@ -14925,7 +15482,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate animateTimeLayout = lastTimeLayout; animateTimeWidth = lastTimeWidth; changed = true; - } else if (timeDrawablesIsChanged || timeX != lastTimeX) { + } else if (timeDrawablesIsChanged || Math.abs(timeX - lastTimeX) > 1) { shouldAnimateTimeX = true; animateTimeWidth = lastTimeWidth; animateFromTimeX = lastTimeX; @@ -14964,6 +15521,22 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate changed = true; } } + updateReactionLayoutPosition(); + if (reactionsLayoutInBubble.animateChange()) { + changed = true; + } + if (currentMessageObject.isRoundVideo()) { + float y1 = layoutHeight - AndroidUtilities.dp(28 - (drawPinnedBottom ? 2 : 0)); + if (!reactionsLayoutInBubble.isEmpty) { + y1 -= reactionsLayoutInBubble.totalHeight; + } + if (y1 != lastDrawRoundVideoDotY) { + animateRoundVideoDotY = true; + animateFromRoundVideoDotY = lastDrawRoundVideoDotY; + changed = true; + } + } + return changed; } @@ -14975,6 +15548,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate animateChange = false; animatePinned = false; animateBackgroundBoundsInner = false; + animateBackgroundWidth = false; deltaLeft = 0; deltaRight = 0; deltaBottom = 0; @@ -15024,6 +15598,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate animateForwardedLayout = false; animatingForwardedNameLayout[0] = null; animatingForwardedNameLayout[1] = null; + animateRoundVideoDotY = false; + reactionsLayoutInBubble.resetAnimation(); } public boolean supportChangeAnimation() { @@ -15079,8 +15655,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate Paint paint = resourcesProvider != null ? resourcesProvider.getPaint(paintKey) : null; return paint != null ? paint : Theme.getThemePaint(paintKey); } - + private boolean hasGradientService() { return resourcesProvider != null ? resourcesProvider.hasGradientService() : Theme.hasGradientService(); } + } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java index 9aecac10d..2ed16c261 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java @@ -21,6 +21,7 @@ import android.graphics.drawable.Drawable; import android.os.Build; import android.os.SystemClock; import android.text.Layout; +import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.StaticLayout; @@ -36,41 +37,47 @@ import android.view.animation.OvershootInterpolator; import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.ChatObject; import org.telegram.messenger.ChatThemeController; -import org.telegram.messenger.DownloadController; -import org.telegram.messenger.FileLoader; -import org.telegram.messenger.MediaDataController; +import org.telegram.messenger.ContactsController; import org.telegram.messenger.DialogObject; -import org.telegram.messenger.ImageLocation; -import org.telegram.messenger.LocaleController; -import org.telegram.messenger.MessageObject; -import org.telegram.messenger.MessagesStorage; -import org.telegram.messenger.SharedConfig; -import org.telegram.messenger.UserObject; +import org.telegram.messenger.DownloadController; +import org.telegram.messenger.Emoji; +import org.telegram.messenger.FileLoader; import org.telegram.messenger.FileLog; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.ImageReceiver; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MediaDataController; +import org.telegram.messenger.MessageObject; +import org.telegram.messenger.MessagesController; +import org.telegram.messenger.MessagesStorage; +import org.telegram.messenger.R; +import org.telegram.messenger.SharedConfig; +import org.telegram.messenger.UserConfig; +import org.telegram.messenger.UserObject; import org.telegram.tgnet.ConnectionsManager; import org.telegram.tgnet.TLRPC; -import org.telegram.messenger.ContactsController; -import org.telegram.messenger.Emoji; -import org.telegram.messenger.MessagesController; -import org.telegram.messenger.R; -import org.telegram.messenger.UserConfig; -import org.telegram.messenger.ImageReceiver; import org.telegram.ui.ActionBar.Theme; -import org.telegram.ui.Components.EmptyStubSpan; -import org.telegram.ui.Components.ForegroundColorSpanThemable; import org.telegram.ui.Adapters.DialogsAdapter; -import org.telegram.ui.Components.PullForegroundDrawable; import org.telegram.ui.Components.AvatarDrawable; import org.telegram.ui.Components.CheckBox2; import org.telegram.ui.Components.CubicBezierInterpolator; +import org.telegram.ui.Components.EmptyStubSpan; +import org.telegram.ui.Components.ForegroundColorSpanThemable; +import org.telegram.ui.Components.PullForegroundDrawable; import org.telegram.ui.Components.RLottieDrawable; import org.telegram.ui.Components.StaticLayoutEx; import org.telegram.ui.Components.StatusDrawable; +import org.telegram.ui.Components.SwipeGestureSettingsView; import org.telegram.ui.Components.TypefaceSpan; +import org.telegram.ui.Components.URLSpanNoUnderline; +import org.telegram.ui.Components.URLSpanNoUnderlineBold; +import org.telegram.ui.Components.spoilers.SpoilerEffect; import org.telegram.ui.DialogsActivity; import org.telegram.ui.Components.SwipeGestureSettingsView; import java.util.ArrayList; +import java.util.List; +import java.util.Stack; public class DialogCell extends BaseCell { @@ -231,6 +238,9 @@ public class DialogCell extends BaseCell { private int messageLeft; private StaticLayout messageLayout; + private Stack spoilersPool = new Stack<>(); + private List spoilers = new ArrayList<>(); + private int messageNameTop; private int messageNameLeft; private StaticLayout messageNameLayout; @@ -647,7 +657,16 @@ public class DialogCell extends BaseCell { } } - lastMessageString = message != null ? message.messageText : null; + CharSequence msgText = message != null ? message.messageText : null; + if (msgText instanceof Spannable) { + Spannable sp = new SpannableStringBuilder(msgText); + for (Object span : sp.getSpans(0, sp.length(), URLSpanNoUnderlineBold.class)) + sp.removeSpan(span); + for (Object span : sp.getSpans(0, sp.length(), URLSpanNoUnderline.class)) + sp.removeSpan(span); + msgText = sp; + } + lastMessageString = msgText; if (customDialog != null) { if (customDialog.type == 2) { @@ -935,7 +954,10 @@ public class DialogCell extends BaseCell { if (mess.length() > 150) { mess = mess.substring(0, 150); } - SpannableStringBuilder stringBuilder = SpannableStringBuilder.valueOf(String.format(messageFormat, mess.replace('\n', ' '), messageNameString)); + Spannable messSpan = new SpannableStringBuilder(mess); + MediaDataController.addTextStyleRuns(draftMessage, messSpan); + + SpannableStringBuilder stringBuilder = AndroidUtilities.formatSpannable(messageFormat, AndroidUtilities.replaceNewLines(messSpan), messageNameString); if (!useForceThreeLines && !SharedConfig.useThreeLinesLayout) { stringBuilder.setSpan(new ForegroundColorSpanThemable(Theme.key_chats_draft, resourcesProvider), 0, messageNameString.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } @@ -993,7 +1015,7 @@ public class DialogCell extends BaseCell { messageString = ""; showChecks = false; } else { - messageString = message.messageText; + messageString = msgText; } currentMessagePaint = Theme.dialogs_messagePrintingPaint[paintIndex]; } else { @@ -1048,9 +1070,9 @@ public class DialogCell extends BaseCell { if (!TextUtils.isEmpty(restrictionReason)) { stringBuilder = SpannableStringBuilder.valueOf(String.format(messageFormat, restrictionReason, messageNameString)); } else if (message.caption != null) { - String mess = message.caption.toString(); + CharSequence mess = message.caption.toString(); if (mess.length() > 150) { - mess = mess.substring(0, 150); + mess = mess.subSequence(0, 150); } String emoji; if (!needEmoji) { @@ -1066,7 +1088,9 @@ public class DialogCell extends BaseCell { } else { emoji = "\uD83D\uDCCE "; } - stringBuilder = SpannableStringBuilder.valueOf(String.format(messageFormat, emoji + mess.replace('\n', ' '), messageNameString)); + SpannableStringBuilder msgBuilder = new SpannableStringBuilder(mess); + MediaDataController.addTextStyleRuns(message.messageOwner.entities, message.caption, msgBuilder); + stringBuilder = AndroidUtilities.formatSpannable(messageFormat, new SpannableStringBuilder(emoji).append(AndroidUtilities.replaceNewLines(msgBuilder)), messageNameString); } else if (message.messageOwner.media != null && !message.isMediaEmpty()) { currentMessagePaint = Theme.dialogs_messagePrintingPaint[paintIndex]; String innerMessage; @@ -1092,17 +1116,17 @@ public class DialogCell extends BaseCell { innerMessage = String.format("\uD83C\uDFA7 %s - %s", message.getMusicAuthor(), message.getMusicTitle()); } } else { - innerMessage = message.messageText.toString(); + innerMessage = msgText.toString(); } innerMessage = innerMessage.replace('\n', ' '); - stringBuilder = SpannableStringBuilder.valueOf(String.format(messageFormat, innerMessage, messageNameString)); + stringBuilder = AndroidUtilities.formatSpannable(messageFormat, innerMessage, messageNameString); try { stringBuilder.setSpan(new ForegroundColorSpanThemable(Theme.key_chats_attachMessage, resourcesProvider), hasNameInMessage ? messageNameString.length() + 2 : 0, stringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } catch (Exception e) { FileLog.e(e); } } else if (message.messageOwner.message != null) { - String mess = message.messageOwner.message; + CharSequence mess = message.messageOwner.message; if (message.hasHighlightedWords()) { if (message.messageTrimmedToHighlight != null) { mess = message.messageTrimmedToHighlight; @@ -1119,11 +1143,13 @@ public class DialogCell extends BaseCell { } } else { if (mess.length() > 150) { - mess = mess.substring(0, 150); + mess = mess.subSequence(0, 150); } - mess = mess.replace('\n', ' ').trim(); + mess = AndroidUtilities.replaceNewLines(mess); } - stringBuilder = SpannableStringBuilder.valueOf(String.format(messageFormat, mess, messageNameString)); + mess = new SpannableStringBuilder(mess); + MediaDataController.addTextStyleRuns(message, (Spannable) mess); + stringBuilder = AndroidUtilities.formatSpannable(messageFormat, mess, messageNameString); } else { stringBuilder = SpannableStringBuilder.valueOf(""); } @@ -1191,7 +1217,9 @@ public class DialogCell extends BaseCell { } messageString = emoji + str; } else { - messageString = emoji + message.caption; + SpannableStringBuilder msgBuilder = new SpannableStringBuilder(message.caption); + MediaDataController.addTextStyleRuns(message.messageOwner.entities, message.caption, msgBuilder); + messageString = new SpannableStringBuilder(emoji).append(msgBuilder); } } else { if (message.messageOwner.media instanceof TLRPC.TL_messageMediaPoll) { @@ -1212,7 +1240,9 @@ public class DialogCell extends BaseCell { int w = getMeasuredWidth() - AndroidUtilities.dp(72 + 23 ); messageString = AndroidUtilities.ellipsizeCenterEnd(messageString, message.highlightedWords.get(0), w, currentMessagePaint, 130).toString(); } else { - messageString = message.messageText; + SpannableStringBuilder stringBuilder = new SpannableStringBuilder(msgText); + MediaDataController.addTextStyleRuns(message, stringBuilder); + messageString = stringBuilder; } AndroidUtilities.highlightText(messageString, message.highlightedWords, resourcesProvider); } @@ -1597,14 +1627,14 @@ public class DialogCell extends BaseCell { if (messageString == null) { messageString = ""; } - String mess = messageString.toString(); + CharSequence mess = messageString; if (mess.length() > 150) { - mess = mess.substring(0, 150); + mess = mess.subSequence(0, 150); } if (!useForceThreeLines && !SharedConfig.useThreeLinesLayout || messageNameString != null) { - mess = mess.replace('\n', ' '); + mess = AndroidUtilities.replaceNewLines(mess); } else { - mess = mess.replace("\n\n", "\n"); + mess = AndroidUtilities.replaceTwoNewLinesToOne(mess); } messageString = Emoji.replaceEmoji(mess, Theme.dialogs_messagePaint[paintIndex].getFontMetricsInt(), AndroidUtilities.dp(17), false); if (message != null) { @@ -1650,6 +1680,7 @@ public class DialogCell extends BaseCell { } else { messageStringFinal = messageString; } + if (useForceThreeLines || SharedConfig.useThreeLinesLayout) { if (hasMessageThumb && messageNameString != null) { messageWidth += AndroidUtilities.dp(6); @@ -1664,6 +1695,9 @@ public class DialogCell extends BaseCell { } messageLayout = new StaticLayout(messageStringFinal, currentMessagePaint, messageWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); } + spoilersPool.addAll(spoilers); + spoilers.clear(); + SpoilerEffect.addSpoilers(this, messageLayout, spoilersPool, spoilers); } catch (Exception e) { messageLayout = null; FileLog.e(e); @@ -2592,7 +2626,15 @@ public class DialogCell extends BaseCell { canvas.save(); canvas.translate(messageLeft, messageTop); try { + canvas.save(); + SpoilerEffect.clipOutCanvas(canvas, spoilers); messageLayout.draw(canvas); + canvas.restore(); + + for (SpoilerEffect eff : spoilers) { + eff.setColor(messageLayout.getPaint().getColor()); + eff.draw(canvas); + } } catch (Exception e) { FileLog.e(e); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java index b51bf4505..99f86c43c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java @@ -16,6 +16,7 @@ import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.util.TypedValue; import android.view.Gravity; +import android.view.accessibility.AccessibilityNodeInfo; import android.widget.FrameLayout; import android.widget.TextView; @@ -99,4 +100,11 @@ public class DrawerActionCell extends FrameLayout { FileLog.e(e); } } + + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + info.addAction(AccessibilityNodeInfo.ACTION_CLICK); + info.addAction(AccessibilityNodeInfo.ACTION_LONG_CLICK); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java index f73c420f3..096210cb6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java @@ -183,7 +183,7 @@ public class DrawerProfileCell extends FrameLayout { addView(darkThemeView, LayoutHelper.createFrame(48, 48, Gravity.RIGHT | Gravity.BOTTOM, 0, 0, 6, 90)); if (Theme.getEventType() == 0) { - snowflakesEffect = new SnowflakesEffect(); + snowflakesEffect = new SnowflakesEffect(0); snowflakesEffect.setColorKey(Theme.key_chats_menuName); } } @@ -364,4 +364,5 @@ public class DrawerProfileCell extends FrameLayout { } arrowView.setContentDescription(accountsShown ? LocaleController.getString("AccDescrHideAccounts", R.string.AccDescrHideAccounts) : LocaleController.getString("AccDescrShowAccounts", R.string.AccDescrShowAccounts)); } + } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerUserCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerUserCell.java index eae3ea219..eb1676fc2 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerUserCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerUserCell.java @@ -14,6 +14,7 @@ import android.graphics.RectF; import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; +import android.view.accessibility.AccessibilityNodeInfo; import android.widget.FrameLayout; import android.widget.TextView; @@ -120,4 +121,10 @@ public class DrawerUserCell extends FrameLayout { canvas.drawText(text, rect.left + (rect.width() - textWidth) / 2, countTop + AndroidUtilities.dp(16), Theme.dialogs_countTextPaint); } + + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + info.addAction(AccessibilityNodeInfo.ACTION_CLICK); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SettingsSearchCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SettingsSearchCell.java index 9303ee1db..0f46040b6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SettingsSearchCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SettingsSearchCell.java @@ -30,7 +30,7 @@ public class SettingsSearchCell extends FrameLayout { private boolean needDivider; private int left; - public class VerticalImageSpan extends ImageSpan { + public static class VerticalImageSpan extends ImageSpan { public VerticalImageSpan(Drawable drawable) { super(drawable); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedLinkCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedLinkCell.java index 1d19d756a..4b033948e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedLinkCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedLinkCell.java @@ -12,11 +12,18 @@ import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; +import android.graphics.Path; +import android.graphics.Rect; +import android.graphics.Region; import android.net.Uri; import android.text.Layout; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.SpannableStringBuilder; import android.text.StaticLayout; import android.text.TextPaint; import android.text.TextUtils; +import android.util.SparseArray; import android.view.Gravity; import android.view.HapticFeedbackConstants; import android.view.MotionEvent; @@ -29,6 +36,7 @@ import org.telegram.messenger.Emoji; import org.telegram.messenger.ImageLocation; import org.telegram.messenger.ImageReceiver; import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MediaDataController; import org.telegram.messenger.MessageObject; import org.telegram.messenger.FileLoader; import org.telegram.messenger.FileLog; @@ -38,12 +46,20 @@ import org.telegram.ui.Components.LayoutHelper; import org.telegram.ui.Components.LetterDrawable; import org.telegram.ui.Components.LinkPath; import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.Components.TextStyleSpan; +import org.telegram.ui.Components.spoilers.SpoilerEffect; import org.telegram.ui.FilteredSearchView; import java.util.ArrayList; +import java.util.List; import java.util.Locale; +import java.util.Stack; +import java.util.concurrent.atomic.AtomicReference; public class SharedLinkCell extends FrameLayout { + private final static int SPOILER_TYPE_LINK = 0, + SPOILER_TYPE_DESCRIPTION = 1, + SPOILER_TYPE_DESCRIPTION2 = 2; public interface SharedLinkCellDelegate { void needOpenWebView(TLRPC.WebPage webPage, MessageObject messageObject); @@ -74,7 +90,7 @@ public class SharedLinkCell extends FrameLayout { checkingForLongPress = false; performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); if (pressedLink >= 0) { - delegate.onLinkPress(links.get(pressedLink), true); + delegate.onLinkPress(links.get(pressedLink).toString(), true); } MotionEvent event = MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0, 0, 0); onTouchEvent(event); @@ -117,18 +133,27 @@ public class SharedLinkCell extends FrameLayout { private boolean needDivider; - ArrayList links = new ArrayList<>(); + ArrayList links = new ArrayList<>(); private int linkY; private ArrayList linkLayout = new ArrayList<>(); + private SparseArray> linkSpoilers = new SparseArray<>(); + private List descriptionLayoutSpoilers = new ArrayList<>(); + private List descriptionLayout2Spoilers = new ArrayList<>(); + private Stack spoilersPool = new Stack<>(); + private Path path = new Path(); + private SpoilerEffect spoilerPressed; + private int spoilerTypePressed = -1; private int titleY = AndroidUtilities.dp(10); private StaticLayout titleLayout; private int descriptionY = AndroidUtilities.dp(30); private StaticLayout descriptionLayout; + private AtomicReference patchedDescriptionLayout = new AtomicReference<>(); private int description2Y = AndroidUtilities.dp(30); private StaticLayout descriptionLayout2; + private AtomicReference patchedDescriptionLayout2 = new AtomicReference<>(); private int captionY = AndroidUtilities.dp(30); private StaticLayout captionLayout; @@ -205,8 +230,8 @@ public class SharedLinkCell extends FrameLayout { int maxWidth = MeasureSpec.getSize(widthMeasureSpec) - AndroidUtilities.dp(AndroidUtilities.leftBaseline) - AndroidUtilities.dp(8); String title = null; - String description = null; - String description2 = null; + CharSequence description = null; + CharSequence description2 = null; String webPageLink = null; boolean hasPhoto = false; @@ -234,14 +259,18 @@ public class SharedLinkCell extends FrameLayout { if (a == 0 && webPageLink != null && !(entity.offset == 0 && entity.length == message.messageOwner.message.length())) { if (message.messageOwner.entities.size() == 1) { if (description == null) { - description2 = message.messageOwner.message; + SpannableStringBuilder st = SpannableStringBuilder.valueOf(message.messageOwner.message); + MediaDataController.addTextStyleRuns(message, st); + description2 = st; } } else { - description2 = message.messageOwner.message; + SpannableStringBuilder st = SpannableStringBuilder.valueOf(message.messageOwner.message); + MediaDataController.addTextStyleRuns(message, st); + description2 = st; } } try { - String link = null; + CharSequence link = null; if (entity instanceof TLRPC.TL_messageEntityTextUrl || entity instanceof TLRPC.TL_messageEntityUrl) { if (entity instanceof TLRPC.TL_messageEntityUrl) { link = message.messageOwner.message.substring(entity.offset, entity.offset + entity.length); @@ -249,11 +278,11 @@ public class SharedLinkCell extends FrameLayout { link = entity.url; } if (title == null || title.length() == 0) { - title = link; + title = link.toString(); Uri uri = Uri.parse(title); title = uri.getHost(); if (title == null) { - title = link; + title = link.toString(); } int index; if (title != null && (index = title.lastIndexOf('.')) >= 0) { @@ -264,7 +293,9 @@ public class SharedLinkCell extends FrameLayout { title = title.substring(0, 1).toUpperCase() + title.substring(1); } if (entity.offset != 0 || entity.length != message.messageOwner.message.length()) { - description = message.messageOwner.message; + SpannableStringBuilder st = SpannableStringBuilder.valueOf(message.messageOwner.message); + MediaDataController.addTextStyleRuns(message, st); + description = st; } } } else if (entity instanceof TLRPC.TL_messageEntityEmail) { @@ -272,16 +303,33 @@ public class SharedLinkCell extends FrameLayout { link = "mailto:" + message.messageOwner.message.substring(entity.offset, entity.offset + entity.length); title = message.messageOwner.message.substring(entity.offset, entity.offset + entity.length); if (entity.offset != 0 || entity.length != message.messageOwner.message.length()) { - description = message.messageOwner.message; + SpannableStringBuilder st = SpannableStringBuilder.valueOf(message.messageOwner.message); + MediaDataController.addTextStyleRuns(message, st); + description = st; } } } if (link != null) { - if (!link.contains("://") && link.toLowerCase().indexOf("http") != 0 && link.toLowerCase().indexOf("mailto") != 0) { - links.add("http://" + link); + CharSequence lobj; + int offset = 0; + if (!AndroidUtilities.charSequenceContains(link, "://") && link.toString().toLowerCase().indexOf("http") != 0 && link.toString().toLowerCase().indexOf("mailto") != 0) { + String prefix = "http://"; + lobj = prefix + link; + offset += prefix.length(); } else { - links.add(link); + lobj = link; } + SpannableString sb = SpannableString.valueOf(lobj); + int start = entity.offset, end = entity.offset + entity.length; + for (TLRPC.MessageEntity e : message.messageOwner.entities) { + int ss = e.offset, se = e.offset + e.length; + if (e instanceof TLRPC.TL_messageEntitySpoiler && start <= se && end >= ss) { + TextStyleSpan.TextStyleRun run = new TextStyleSpan.TextStyleRun(); + run.flags |= TextStyleSpan.FLAG_STYLE_SPOILER; + sb.setSpan(new TextStyleSpan(run), Math.max(start, ss), Math.min(end, se) + offset, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } + links.add(sb); } } catch (Exception e) { FileLog.e(e); @@ -332,6 +380,10 @@ public class SharedLinkCell extends FrameLayout { if (descriptionLayout.getLineCount() > 0) { description2Y = descriptionY + descriptionLayout.getLineBottom(descriptionLayout.getLineCount() - 1) + AndroidUtilities.dp(5); } + spoilersPool.addAll(descriptionLayoutSpoilers); + descriptionLayoutSpoilers.clear(); + if (!message.isSpoilersRevealed) + SpoilerEffect.addSpoilers(this, descriptionLayout, spoilersPool, descriptionLayoutSpoilers); } catch (Exception e) { FileLog.e(e); } @@ -343,6 +395,10 @@ public class SharedLinkCell extends FrameLayout { if (descriptionLayout != null) { description2Y += AndroidUtilities.dp(10); } + spoilersPool.addAll(descriptionLayout2Spoilers); + descriptionLayout2Spoilers.clear(); + if (!message.isSpoilersRevealed) + SpoilerEffect.addSpoilers(this, descriptionLayout2, spoilersPool, descriptionLayout2Spoilers); } catch (Exception e) { FileLog.e(e); } @@ -364,16 +420,25 @@ public class SharedLinkCell extends FrameLayout { } if (!links.isEmpty()) { + for (int i = 0; i < linkSpoilers.size(); i++) + spoilersPool.addAll(linkSpoilers.get(i)); + linkSpoilers.clear(); for (int a = 0; a < links.size(); a++) { try { - String link = links.get(a); - int width = (int) Math.ceil(descriptionTextPaint.measureText(link)); - CharSequence linkFinal = TextUtils.ellipsize(link.replace('\n', ' '), descriptionTextPaint, Math.min(width, maxWidth), TextUtils.TruncateAt.MIDDLE); + CharSequence link = links.get(a); + int width = (int) Math.ceil(descriptionTextPaint.measureText(link, 0, link.length())); + CharSequence linkFinal = TextUtils.ellipsize(AndroidUtilities.replaceNewLines(SpannableStringBuilder.valueOf(link)), descriptionTextPaint, Math.min(width, maxWidth), TextUtils.TruncateAt.MIDDLE); StaticLayout layout = new StaticLayout(linkFinal, descriptionTextPaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); linkY = description2Y; if (descriptionLayout2 != null && descriptionLayout2.getLineCount() != 0) { linkY += descriptionLayout2.getLineBottom(descriptionLayout2.getLineCount() - 1) + AndroidUtilities.dp(5); } + if (!message.isSpoilersRevealed) { + List l = new ArrayList<>(); + if (linkFinal instanceof Spannable) + SpoilerEffect.addSpoilers(this, layout, (Spannable) linkFinal, spoilersPool, l); + linkSpoilers.put(a, l); + } linkLayout.add(layout); } catch (Exception e) { FileLog.e(e); @@ -480,7 +545,7 @@ public class SharedLinkCell extends FrameLayout { public boolean onTouchEvent(MotionEvent event) { boolean result = false; if (message != null && !linkLayout.isEmpty() && delegate != null && delegate.canPerformActions()) { - if (event.getAction() == MotionEvent.ACTION_DOWN || linkPreviewPressed && event.getAction() == MotionEvent.ACTION_UP) { + if (event.getAction() == MotionEvent.ACTION_DOWN || (linkPreviewPressed || spoilerPressed != null) && event.getAction() == MotionEvent.ACTION_UP) { int x = (int) event.getX(); int y = (int) event.getY(); int offset = 0; @@ -494,35 +559,84 @@ public class SharedLinkCell extends FrameLayout { ok = true; if (event.getAction() == MotionEvent.ACTION_DOWN) { resetPressedLink(); - pressedLink = a; - linkPreviewPressed = true; - startCheckLongPress(); - try { - urlPath.setCurrentLayout(layout, 0, 0); - layout.getSelectionPath(0, layout.getText().length(), urlPath); - } catch (Exception e) { - FileLog.e(e); + + spoilerPressed = null; + if (linkSpoilers.get(a, null) != null) { + for (SpoilerEffect eff : linkSpoilers.get(a)) { + if (eff.getBounds().contains(x - linkPosX, y - linkY - offset)) { + spoilerPressed = eff; + spoilerTypePressed = SPOILER_TYPE_LINK; + break; + } + } + } + + if (spoilerPressed != null) { + result = true; + } else { + pressedLink = a; + linkPreviewPressed = true; + startCheckLongPress(); + try { + urlPath.setCurrentLayout(layout, 0, 0); + layout.getSelectionPath(0, layout.getText().length(), urlPath); + } catch (Exception e) { + FileLog.e(e); + } + result = true; } - result = true; } else if (linkPreviewPressed) { try { TLRPC.WebPage webPage = pressedLink == 0 && message.messageOwner.media != null ? message.messageOwner.media.webpage : null; if (webPage != null && webPage.embed_url != null && webPage.embed_url.length() != 0) { delegate.needOpenWebView(webPage, message); } else { - delegate.onLinkPress(links.get(pressedLink), false); + delegate.onLinkPress(links.get(pressedLink).toString(), false); } } catch (Exception e) { FileLog.e(e); } resetPressedLink(); result = true; + } else if (spoilerPressed != null) { + startSpoilerRipples(x, y, offset); + result = true; } break; } offset += height; } } + if (event.getAction() == MotionEvent.ACTION_DOWN) { + int offX = AndroidUtilities.dp(LocaleController.isRTL ? 8 : AndroidUtilities.leftBaseline); + if (descriptionLayout != null && x >= offX && x <= offX + descriptionLayout.getWidth() && y >= descriptionY && y <= descriptionY + descriptionLayout.getHeight()) { + for (SpoilerEffect eff : descriptionLayoutSpoilers) { + if (eff.getBounds().contains(x - offX, y - descriptionY)) { + spoilerPressed = eff; + spoilerTypePressed = SPOILER_TYPE_DESCRIPTION; + ok = true; + result = true; + break; + } + } + } + if (descriptionLayout2 != null && x >= offX && x <= offX + descriptionLayout2.getWidth() && y >= description2Y && y <= description2Y + descriptionLayout2.getHeight()) { + for (SpoilerEffect eff : descriptionLayout2Spoilers) { + if (eff.getBounds().contains(x - offX, y - description2Y)) { + spoilerPressed = eff; + spoilerTypePressed = SPOILER_TYPE_DESCRIPTION2; + ok = true; + result = true; + break; + } + } + } + } else if (event.getAction() == MotionEvent.ACTION_UP && spoilerPressed != null) { + startSpoilerRipples(x, y, 0); + ok = true; + result = true; + } + if (!ok) { resetPressedLink(); } @@ -535,11 +649,85 @@ public class SharedLinkCell extends FrameLayout { return result || super.onTouchEvent(event); } + private void startSpoilerRipples(int x, int y, int offset) { + int linkPosX = AndroidUtilities.dp(LocaleController.isRTL ? 8 : AndroidUtilities.leftBaseline); + resetPressedLink(); + SpoilerEffect eff = spoilerPressed; + eff.setOnRippleEndCallback(() -> post(() -> { + message.isSpoilersRevealed = true; + linkSpoilers.clear(); + descriptionLayoutSpoilers.clear(); + descriptionLayout2Spoilers.clear(); + invalidate(); + })); + + int nx = x - linkPosX; + float rad = (float) Math.sqrt(Math.pow(getWidth(), 2) + Math.pow(getHeight(), 2)); + float offY = 0; + switch (spoilerTypePressed) { + case SPOILER_TYPE_LINK: + for (int i = 0; i < linkLayout.size(); i++) { + Layout lt = linkLayout.get(i); + offY += lt.getLineBottom(lt.getLineCount() - 1); + for (SpoilerEffect e : linkSpoilers.get(i)) { + e.startRipple(nx, y - getYOffsetForType(SPOILER_TYPE_LINK) - offset + offY, rad); + } + } + break; + case SPOILER_TYPE_DESCRIPTION: + for (SpoilerEffect sp : descriptionLayoutSpoilers) + sp.startRipple(nx, y - getYOffsetForType(SPOILER_TYPE_DESCRIPTION), rad); + break; + case SPOILER_TYPE_DESCRIPTION2: + for (SpoilerEffect sp : descriptionLayout2Spoilers) + sp.startRipple(nx, y - getYOffsetForType(SPOILER_TYPE_DESCRIPTION2), rad); + break; + } + for (int i = SPOILER_TYPE_LINK; i <= SPOILER_TYPE_DESCRIPTION2; i++) { + if (i != spoilerTypePressed) { + switch (i) { + case SPOILER_TYPE_LINK: + for (int j = 0; j < linkLayout.size(); j++) { + Layout lt = linkLayout.get(j); + offY += lt.getLineBottom(lt.getLineCount() - 1); + for (SpoilerEffect e : linkSpoilers.get(j)) { + e.startRipple(e.getBounds().centerX(), e.getBounds().centerY(), rad); + } + } + break; + case SPOILER_TYPE_DESCRIPTION: + for (SpoilerEffect sp : descriptionLayoutSpoilers) + sp.startRipple(sp.getBounds().centerX(), sp.getBounds().centerY(), rad); + break; + case SPOILER_TYPE_DESCRIPTION2: + for (SpoilerEffect sp : descriptionLayout2Spoilers) + sp.startRipple(sp.getBounds().centerX(), sp.getBounds().centerY(), rad); + break; + } + } + } + + spoilerTypePressed = -1; + spoilerPressed = null; + } + + private int getYOffsetForType(int type) { + switch (type) { + default: + case SPOILER_TYPE_LINK: + return linkY; + case SPOILER_TYPE_DESCRIPTION: + return descriptionY; + case SPOILER_TYPE_DESCRIPTION2: + return description2Y; + } + } + public String getLink(int num) { if (num < 0 || num >= links.size()) { return null; } - return links.get(num); + return links.get(num).toString(); } protected void resetPressedLink() { @@ -589,7 +777,7 @@ public class SharedLinkCell extends FrameLayout { descriptionTextPaint.setColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); canvas.save(); canvas.translate(AndroidUtilities.dp(LocaleController.isRTL ? 8 : AndroidUtilities.leftBaseline), descriptionY); - descriptionLayout.draw(canvas); + SpoilerEffect.renderWithRipple(this, false, descriptionTextPaint.getColor(), -AndroidUtilities.dp(2), patchedDescriptionLayout, descriptionLayout, descriptionLayoutSpoilers, canvas); canvas.restore(); } @@ -597,7 +785,7 @@ public class SharedLinkCell extends FrameLayout { descriptionTextPaint.setColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); canvas.save(); canvas.translate(AndroidUtilities.dp(LocaleController.isRTL ? 8 : AndroidUtilities.leftBaseline), description2Y); - descriptionLayout2.draw(canvas); + SpoilerEffect.renderWithRipple(this, false, descriptionTextPaint.getColor(), -AndroidUtilities.dp(2), patchedDescriptionLayout2, descriptionLayout2, descriptionLayout2Spoilers, canvas); canvas.restore(); } @@ -606,14 +794,39 @@ public class SharedLinkCell extends FrameLayout { int offset = 0; for (int a = 0; a < linkLayout.size(); a++) { StaticLayout layout = linkLayout.get(a); + List spoilers = linkSpoilers.get(a); if (layout.getLineCount() > 0) { canvas.save(); canvas.translate(AndroidUtilities.dp(LocaleController.isRTL ? 8 : AndroidUtilities.leftBaseline), linkY + offset); - if (pressedLink == a) { - canvas.drawPath(urlPath, Theme.linkSelectionPaint); + + path.rewind(); + if (spoilers != null) { + for (SpoilerEffect eff : spoilers) { + Rect b = eff.getBounds(); + path.addRect(b.left, b.top, b.right, b.bottom, Path.Direction.CW); + } } + canvas.save(); + canvas.clipPath(path, Region.Op.DIFFERENCE); + if (pressedLink == a) canvas.drawPath(urlPath, Theme.linkSelectionPaint); layout.draw(canvas); canvas.restore(); + + canvas.save(); + canvas.clipPath(path); + path.rewind(); + if (spoilers != null && !spoilers.isEmpty()) + spoilers.get(0).getRipplePath(path); + canvas.clipPath(path); + + if (pressedLink == a) canvas.drawPath(urlPath, Theme.linkSelectionPaint); + layout.draw(canvas); + canvas.restore(); + + if (spoilers != null) + for (SpoilerEffect eff : spoilers) eff.draw(canvas); + + canvas.restore(); offset += layout.getLineBottom(layout.getLineCount() - 1); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java index 45bad59d6..5caad397c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java @@ -250,6 +250,7 @@ public class TextCell extends FrameLayout { info.setText(text); } } + info.addAction(AccessibilityNodeInfo.ACTION_CLICK); } public void setNeedDivider(boolean needDivider) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckCell.java index f63aee662..55b58f238 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckCell.java @@ -15,6 +15,7 @@ import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Typeface; +import android.graphics.drawable.ColorDrawable; import android.text.TextUtils; import android.util.Property; import android.util.TypedValue; @@ -36,6 +37,7 @@ import org.telegram.ui.Components.Switch; import java.util.ArrayList; public class TextCheckCell extends FrameLayout { + private boolean isAnimatingToThumbInsteadOfTouch; private TextView textView; private TextView valueTextView; @@ -117,6 +119,11 @@ public class TextCheckCell extends FrameLayout { return super.onTouchEvent(event); } + public void setDivider(boolean divider) { + needDivider = divider; + setWillNotDraw(!divider); + } + public void setTextAndCheck(String text, boolean checked, boolean divider) { textView.setText(text); isMultiline = false; @@ -245,18 +252,50 @@ public class TextCheckCell extends FrameLayout { private void setAnimationProgress(float value) { animationProgress = value; - float rad = Math.max(lastTouchX, getMeasuredWidth() - lastTouchX) + AndroidUtilities.dp(40); - float cx = lastTouchX; + float tx = getLastTouchX(); + float rad = Math.max(tx, getMeasuredWidth() - tx) + AndroidUtilities.dp(40); + float cx = tx; int cy = getMeasuredHeight() / 2; float animatedRad = rad * animationProgress; checkBox.setOverrideColorProgress(cx, cy, animatedRad); } + public void setBackgroundColorAnimatedReverse(int color) { + if (animator != null) { + animator.cancel(); + animator = null; + } + + int from = animatedColorBackground != 0 ? animatedColorBackground : getBackground() instanceof ColorDrawable ? ((ColorDrawable) getBackground()).getColor() : 0; + if (animationPaint == null) animationPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + animationPaint.setColor(from); + + setBackgroundColor(color); + checkBox.setOverrideColor(1); + animatedColorBackground = color; + animator = ObjectAnimator.ofFloat(this, ANIMATION_PROGRESS, 1, 0).setDuration(240); + animator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + setBackgroundColor(color); + animatedColorBackground = 0; + invalidate(); + } + }); + animator.setInterpolator(CubicBezierInterpolator.EASE_OUT); + animator.start(); + } + + private float getLastTouchX() { + return isAnimatingToThumbInsteadOfTouch ? (LocaleController.isRTL ? AndroidUtilities.dp(22) : getMeasuredWidth() - AndroidUtilities.dp(42)) : lastTouchX; + } + @Override protected void onDraw(Canvas canvas) { if (animatedColorBackground != 0) { - float rad = Math.max(lastTouchX, getMeasuredWidth() - lastTouchX) + AndroidUtilities.dp(40); - float cx = lastTouchX; + float tx = getLastTouchX(); + float rad = Math.max(tx, getMeasuredWidth() - tx) + AndroidUtilities.dp(40); + float cx = tx; int cy = getMeasuredHeight() / 2; float animatedRad = rad * animationProgress; canvas.drawCircle(cx, cy, animatedRad, animationPaint); @@ -266,6 +305,10 @@ public class TextCheckCell extends FrameLayout { } } + public void setAnimatingToThumbInsteadOfTouch(boolean animatingToThumbInsteadOfTouch) { + isAnimatingToThumbInsteadOfTouch = animatingToThumbInsteadOfTouch; + } + @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); @@ -274,4 +317,4 @@ public class TextCheckCell extends FrameLayout { info.setChecked(checkBox.isChecked()); info.setContentDescription(checkBox.isChecked() ? LocaleController.getString("NotificationsOn", R.string.NotificationsOn) : LocaleController.getString("NotificationsOff", R.string.NotificationsOff)); } -} +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckbox2Cell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckbox2Cell.java new file mode 100644 index 000000000..7c0c5f9cc --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckbox2Cell.java @@ -0,0 +1,300 @@ +package org.telegram.ui.Cells; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ObjectAnimator; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.Typeface; +import android.text.TextUtils; +import android.util.Property; +import android.util.TypedValue; +import android.view.Gravity; +import android.view.MotionEvent; +import android.view.accessibility.AccessibilityNodeInfo; +import android.widget.FrameLayout; +import android.widget.TextView; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.R; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.Components.AnimationProperties; +import org.telegram.ui.Components.CheckBox2; +import org.telegram.ui.Components.CubicBezierInterpolator; +import org.telegram.ui.Components.LayoutHelper; +import org.telegram.ui.Components.Switch; + +import java.util.ArrayList; + +public class TextCheckbox2Cell extends FrameLayout { + + private TextView textView; + private TextView valueTextView; + public CheckBox2 checkbox; + private boolean needDivider; + private boolean isMultiline; + private int height = 50; + private int animatedColorBackground; + private float animationProgress; + private Paint animationPaint; + private float lastTouchX; + private ObjectAnimator animator; + private boolean drawCheckRipple; + + public static final Property ANIMATION_PROGRESS = new AnimationProperties.FloatProperty("animationProgress") { + @Override + public void setValue(TextCheckbox2Cell object, float value) { + object.setAnimationProgress(value); + object.invalidate(); + } + + @Override + public Float get(TextCheckbox2Cell object) { + return object.animationProgress; + } + }; + + + public TextCheckbox2Cell(Context context) { + this(context, 21); + } + + public TextCheckbox2Cell(Context context, int padding) { + this(context, padding, false); + } + + public TextCheckbox2Cell(Context context, int padding, boolean dialog) { + super(context); + + textView = new TextView(context); + textView.setTextColor(Theme.getColor(dialog ? Theme.key_dialogTextBlack : Theme.key_windowBackgroundWhiteBlackText)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + textView.setLines(1); + textView.setMaxLines(1); + textView.setSingleLine(true); + textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); + textView.setEllipsize(TextUtils.TruncateAt.END); + addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? padding : 64, 0, LocaleController.isRTL ? 64 : padding, 0)); + + valueTextView = new TextView(context); + valueTextView.setTextColor(Theme.getColor(dialog ? Theme.key_dialogIcon : Theme.key_windowBackgroundWhiteGrayText2)); + valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13); + valueTextView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT); + valueTextView.setLines(1); + valueTextView.setMaxLines(1); + valueTextView.setSingleLine(true); + valueTextView.setPadding(0, 0, 0, 0); + valueTextView.setEllipsize(TextUtils.TruncateAt.END); + addView(valueTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? padding : 64, 36, LocaleController.isRTL ? 64 : padding, 0)); + + checkbox = new CheckBox2(context, 21); + checkbox.setDrawUnchecked(true); + checkbox.setDrawBackgroundAsArc(10); + checkbox.setDuration(100); + checkbox.setColor(Theme.key_radioBackgroundChecked, Theme.key_checkboxDisabled, Theme.key_checkboxCheck); + addView(checkbox, LayoutHelper.createFrame(20, 20, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL, 22, 0, 22, 0)); + + setClipChildren(false); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + if (isMultiline) { + super.onMeasure(MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); + } else { + super.onMeasure(MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(valueTextView.getVisibility() == VISIBLE ? 64 : height) + (needDivider ? 1 : 0), MeasureSpec.EXACTLY)); + } + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + lastTouchX = event.getX(); + return super.onTouchEvent(event); + } + + public void setTextAndCheck(String text, boolean checked, boolean divider) { + textView.setText(text); + isMultiline = false; + checkbox.setChecked(checked, false); + needDivider = divider; + valueTextView.setVisibility(GONE); + LayoutParams layoutParams = (LayoutParams) textView.getLayoutParams(); + layoutParams.height = LayoutParams.MATCH_PARENT; + layoutParams.topMargin = 0; + textView.setLayoutParams(layoutParams); + setWillNotDraw(!divider); + } + + public void setColors(String key, String switchKey, String switchKeyChecked, String switchThumb, String switchThumbChecked) { + textView.setTextColor(Theme.getColor(key)); +// checkbox.setColors(switchKey, switchKeyChecked, switchThumb, switchThumbChecked); + textView.setTag(key); + } + + public void setTypeface(Typeface typeface) { + textView.setTypeface(typeface); + } + + public void setHeight(int value) { + height = value; + } + +// public void setDrawCheckRipple(boolean value) { +// drawCheckRipple = value; +// } + + @Override + public void setPressed(boolean pressed) { +// if (drawCheckRipple) { +// checkBox.setDrawRipple(pressed); +// } + super.setPressed(pressed); + } + + public void setTextAndValue(String text, String value, boolean multiline, boolean divider) { + textView.setText(text); + valueTextView.setText(value); +// checkbox.setChecked(checked, false); + needDivider = divider; + valueTextView.setVisibility(VISIBLE); + isMultiline = multiline; + if (multiline) { + valueTextView.setLines(0); + valueTextView.setMaxLines(0); + valueTextView.setSingleLine(false); + valueTextView.setEllipsize(null); + valueTextView.setPadding(0, 0, 0, AndroidUtilities.dp(11)); + } else { + valueTextView.setLines(1); + valueTextView.setMaxLines(1); + valueTextView.setSingleLine(true); + valueTextView.setEllipsize(TextUtils.TruncateAt.END); + valueTextView.setPadding(0, 0, 0, 0); + } + LayoutParams layoutParams = (LayoutParams) textView.getLayoutParams(); + layoutParams.height = LayoutParams.WRAP_CONTENT; + layoutParams.topMargin = AndroidUtilities.dp(10); + textView.setLayoutParams(layoutParams); + setWillNotDraw(!divider); + } + public void setTextAndValueAndCheck(String text, String value, boolean checked, boolean multiline, boolean divider) { + textView.setText(text); + valueTextView.setText(value); + checkbox.setChecked(checked, false); + needDivider = divider; + valueTextView.setVisibility(VISIBLE); + isMultiline = multiline; + if (multiline) { + valueTextView.setLines(0); + valueTextView.setMaxLines(0); + valueTextView.setSingleLine(false); + valueTextView.setEllipsize(null); + valueTextView.setPadding(0, 0, 0, AndroidUtilities.dp(11)); + } else { + valueTextView.setLines(1); + valueTextView.setMaxLines(1); + valueTextView.setSingleLine(true); + valueTextView.setEllipsize(TextUtils.TruncateAt.END); + valueTextView.setPadding(0, 0, 0, 0); + } + LayoutParams layoutParams = (LayoutParams) textView.getLayoutParams(); + layoutParams.height = LayoutParams.WRAP_CONTENT; + layoutParams.topMargin = AndroidUtilities.dp(10); + textView.setLayoutParams(layoutParams); + setWillNotDraw(!divider); + } + + public void setEnabled(boolean value, ArrayList animators) { + super.setEnabled(value); + if (animators != null) { + animators.add(ObjectAnimator.ofFloat(textView, "alpha", value ? 1.0f : 0.5f)); + animators.add(ObjectAnimator.ofFloat(checkbox, "alpha", value ? 1.0f : 0.5f)); + if (valueTextView.getVisibility() == VISIBLE) { + animators.add(ObjectAnimator.ofFloat(valueTextView, "alpha", value ? 1.0f : 0.5f)); + } + } else { + textView.setAlpha(value ? 1.0f : 0.5f); + checkbox.setAlpha(value ? 1.0f : 0.5f); + if (valueTextView.getVisibility() == VISIBLE) { + valueTextView.setAlpha(value ? 1.0f : 0.5f); + } + } + } + + public void setChecked(boolean checked) { + checkbox.setChecked(checked, true); + } + + public boolean isChecked() { + return checkbox.isChecked(); + } + + @Override + public void setBackgroundColor(int color) { + clearAnimation(); + animatedColorBackground = 0; + super.setBackgroundColor(color); + } + + public void setBackgroundColorAnimated(boolean checked, int color) { + if (animator != null) { + animator.cancel(); + animator = null; + } + if (animatedColorBackground != 0) { + setBackgroundColor(animatedColorBackground); + } + if (animationPaint == null) { + animationPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + } +// checkbox.setOverrideColor(checked ? 1 : 2); + animatedColorBackground = color; + animationPaint.setColor(animatedColorBackground); + animationProgress = 0.0f; + animator = ObjectAnimator.ofFloat(this, ANIMATION_PROGRESS, 0.0f, 1.0f); + animator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + setBackgroundColor(animatedColorBackground); + animatedColorBackground = 0; + invalidate(); + } + }); + animator.setInterpolator(CubicBezierInterpolator.EASE_OUT); + animator.setDuration(240).start(); + } + + private void setAnimationProgress(float value) { + animationProgress = value; + float rad = Math.max(lastTouchX, getMeasuredWidth() - lastTouchX) + AndroidUtilities.dp(40); + float cx = lastTouchX; + int cy = getMeasuredHeight() / 2; + float animatedRad = rad * animationProgress; +// checkbox.setOverrideColorProgress(cx, cy, animatedRad); + } + + @Override + protected void onDraw(Canvas canvas) { + if (animatedColorBackground != 0) { + float rad = Math.max(lastTouchX, getMeasuredWidth() - lastTouchX) + AndroidUtilities.dp(40); + float cx = lastTouchX; + int cy = getMeasuredHeight() / 2; + float animatedRad = rad * animationProgress; + canvas.drawCircle(cx, cy, animatedRad, animationPaint); + } + if (needDivider) { + canvas.drawLine(LocaleController.isRTL ? 0 : AndroidUtilities.dp(64), getMeasuredHeight() - 1, getMeasuredWidth() - (LocaleController.isRTL ? AndroidUtilities.dp(64) : 0), getMeasuredHeight() - 1, Theme.dividerPaint); + } + } + + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + info.setClassName("android.widget.checkbox"); + info.setCheckable(true); + info.setChecked(checkbox.isChecked()); + info.setContentDescription(checkbox.isChecked() ? LocaleController.getString("NotificationsOn", R.string.NotificationsOn) : LocaleController.getString("NotificationsOff", R.string.NotificationsOff)); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java index e73f64655..3854d37c8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java @@ -10,11 +10,15 @@ package org.telegram.ui.Cells; import android.content.Context; import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.drawable.Drawable; import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; +import android.view.View; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.FrameLayout; +import android.widget.ImageView; import android.widget.TextView; import org.telegram.messenger.AndroidUtilities; @@ -25,8 +29,9 @@ import org.telegram.ui.Components.LayoutHelper; public class TextDetailCell extends FrameLayout { - private TextView textView; - private TextView valueTextView; + private final TextView textView; + private final TextView valueTextView; + private final ImageView imageView; private boolean needDivider; private boolean contentDescriptionValueFirst; @@ -53,6 +58,10 @@ public class TextDetailCell extends FrameLayout { valueTextView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT); valueTextView.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); addView(valueTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT, 23, 33, 23, 0)); + + imageView = new ImageView(context); + imageView.setScaleType(ImageView.ScaleType.CENTER); + addView(imageView, LayoutHelper.createFrameRelatively(48, 48, Gravity.END | Gravity.CENTER_VERTICAL, 0, 0, 12, 0)); } @Override @@ -67,6 +76,19 @@ public class TextDetailCell extends FrameLayout { setWillNotDraw(!needDivider); } + public void setImage(Drawable drawable) { + imageView.setImageDrawable(drawable); + if (drawable == null) { + imageView.setBackground(null); + } else { + imageView.setBackground(Theme.createSimpleSelectorCircleDrawable(AndroidUtilities.dp(48), Color.TRANSPARENT, Theme.getColor(Theme.key_listSelector))); + } + } + + public void setImageClickListener(View.OnClickListener clickListener) { + imageView.setOnClickListener(clickListener); + } + public void setTextWithEmojiAndValue(String text, CharSequence value, boolean divider) { textView.setText(Emoji.replaceEmoji(text, textView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false)); valueTextView.setText(value); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextRadioCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextRadioCell.java new file mode 100644 index 000000000..1e0d4f668 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextRadioCell.java @@ -0,0 +1,272 @@ +package org.telegram.ui.Cells; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ObjectAnimator; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.Typeface; +import android.text.TextUtils; +import android.util.Property; +import android.util.TypedValue; +import android.view.Gravity; +import android.view.MotionEvent; +import android.view.accessibility.AccessibilityNodeInfo; +import android.widget.FrameLayout; +import android.widget.TextView; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.R; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.Components.AnimationProperties; +import org.telegram.ui.Components.CubicBezierInterpolator; +import org.telegram.ui.Components.LayoutHelper; +import org.telegram.ui.Components.RadioButton; +import org.telegram.ui.Components.Switch; + +import java.util.ArrayList; + +public class TextRadioCell extends FrameLayout { + + private TextView textView; + private TextView valueTextView; + private RadioButton radioButton; + private boolean needDivider; + private boolean isMultiline; + private int height = 50; + private int animatedColorBackground; + private float animationProgress; + private Paint animationPaint; + private float lastTouchX; + private ObjectAnimator animator; + private boolean drawCheckRipple; + + public static final Property ANIMATION_PROGRESS = new AnimationProperties.FloatProperty("animationProgress") { + @Override + public void setValue(TextRadioCell object, float value) { + object.setAnimationProgress(value); + object.invalidate(); + } + + @Override + public Float get(TextRadioCell object) { + return object.animationProgress; + } + }; + + public TextRadioCell(Context context) { + this(context, 21); + } + + public TextRadioCell(Context context, int padding) { + this(context, padding, false); + } + + public TextRadioCell(Context context, int padding, boolean dialog) { + super(context); + + textView = new TextView(context); + textView.setTextColor(Theme.getColor(dialog ? Theme.key_dialogTextBlack : Theme.key_windowBackgroundWhiteBlackText)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + textView.setLines(1); + textView.setMaxLines(1); + textView.setSingleLine(true); + textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); + textView.setEllipsize(TextUtils.TruncateAt.END); + addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? padding : 64, 0, LocaleController.isRTL ? 64 : padding, 0)); + + valueTextView = new TextView(context); + valueTextView.setTextColor(Theme.getColor(dialog ? Theme.key_dialogIcon : Theme.key_windowBackgroundWhiteGrayText2)); + valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13); + valueTextView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT); + valueTextView.setLines(1); + valueTextView.setMaxLines(1); + valueTextView.setSingleLine(true); + valueTextView.setPadding(0, 0, 0, 0); + valueTextView.setEllipsize(TextUtils.TruncateAt.END); + addView(valueTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? padding : 64, 36, LocaleController.isRTL ? 64 : padding, 0)); + + radioButton = new RadioButton(context); + radioButton.setSize(AndroidUtilities.dp(20)); +// radioButton.setColors(Theme.key_switchTrack, Theme.key_switchTrackChecked, Theme.key_windowBackgroundWhite, Theme.key_windowBackgroundWhite); + radioButton.setColor(Theme.getColor(Theme.key_radioBackground), Theme.getColor(Theme.key_radioBackgroundChecked)); + addView(radioButton, LayoutHelper.createFrame(20, 20, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL, 22, 0, 22, 0)); + + setClipChildren(false); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + if (isMultiline) { + super.onMeasure(MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); + } else { + super.onMeasure(MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(valueTextView.getVisibility() == VISIBLE ? 64 : height) + (needDivider ? 1 : 0), MeasureSpec.EXACTLY)); + } + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + lastTouchX = event.getX(); + return super.onTouchEvent(event); + } + + public void setTextAndCheck(String text, boolean checked, boolean divider) { + textView.setText(text); + isMultiline = false; + radioButton.setChecked(checked, false); + needDivider = divider; + valueTextView.setVisibility(GONE); + LayoutParams layoutParams = (LayoutParams) textView.getLayoutParams(); + layoutParams.height = LayoutParams.MATCH_PARENT; + layoutParams.topMargin = 0; + textView.setLayoutParams(layoutParams); + setWillNotDraw(!divider); + } + + public void setColors(String key, String switchKey, String switchKeyChecked, String switchThumb, String switchThumbChecked) { + textView.setTextColor(Theme.getColor(key)); +// radioButton.setColors(switchKey, switchKeyChecked, switchThumb, switchThumbChecked); + textView.setTag(key); + } + + public void setTypeface(Typeface typeface) { + textView.setTypeface(typeface); + } + + public void setHeight(int value) { + height = value; + } + +// public void setDrawCheckRipple(boolean value) { +// drawCheckRipple = value; +// } + + @Override + public void setPressed(boolean pressed) { +// if (drawCheckRipple) { +// checkBox.setDrawRipple(pressed); +// } + super.setPressed(pressed); + } + + public void setTextAndValueAndCheck(String text, String value, boolean checked, boolean multiline, boolean divider) { + textView.setText(text); + valueTextView.setText(value); + radioButton.setChecked(checked, false); + needDivider = divider; + valueTextView.setVisibility(VISIBLE); + isMultiline = multiline; + if (multiline) { + valueTextView.setLines(0); + valueTextView.setMaxLines(0); + valueTextView.setSingleLine(false); + valueTextView.setEllipsize(null); + valueTextView.setPadding(0, 0, 0, AndroidUtilities.dp(11)); + } else { + valueTextView.setLines(1); + valueTextView.setMaxLines(1); + valueTextView.setSingleLine(true); + valueTextView.setEllipsize(TextUtils.TruncateAt.END); + valueTextView.setPadding(0, 0, 0, 0); + } + LayoutParams layoutParams = (LayoutParams) textView.getLayoutParams(); + layoutParams.height = LayoutParams.WRAP_CONTENT; + layoutParams.topMargin = AndroidUtilities.dp(10); + textView.setLayoutParams(layoutParams); + setWillNotDraw(!divider); + } + + public void setEnabled(boolean value, ArrayList animators) { + super.setEnabled(value); + if (animators != null) { + animators.add(ObjectAnimator.ofFloat(textView, "alpha", value ? 1.0f : 0.5f)); + animators.add(ObjectAnimator.ofFloat(radioButton, "alpha", value ? 1.0f : 0.5f)); + if (valueTextView.getVisibility() == VISIBLE) { + animators.add(ObjectAnimator.ofFloat(valueTextView, "alpha", value ? 1.0f : 0.5f)); + } + } else { + textView.setAlpha(value ? 1.0f : 0.5f); + radioButton.setAlpha(value ? 1.0f : 0.5f); + if (valueTextView.getVisibility() == VISIBLE) { + valueTextView.setAlpha(value ? 1.0f : 0.5f); + } + } + } + + public void setChecked(boolean checked) { + radioButton.setChecked(checked, true); + } + + public boolean isChecked() { + return radioButton.isChecked(); + } + + @Override + public void setBackgroundColor(int color) { + clearAnimation(); + animatedColorBackground = 0; + super.setBackgroundColor(color); + } + + public void setBackgroundColorAnimated(boolean checked, int color) { + if (animator != null) { + animator.cancel(); + animator = null; + } + if (animatedColorBackground != 0) { + setBackgroundColor(animatedColorBackground); + } + if (animationPaint == null) { + animationPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + } +// radioButton.setOverrideColor(checked ? 1 : 2); + animatedColorBackground = color; + animationPaint.setColor(animatedColorBackground); + animationProgress = 0.0f; + animator = ObjectAnimator.ofFloat(this, ANIMATION_PROGRESS, 0.0f, 1.0f); + animator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + setBackgroundColor(animatedColorBackground); + animatedColorBackground = 0; + invalidate(); + } + }); + animator.setInterpolator(CubicBezierInterpolator.EASE_OUT); + animator.setDuration(240).start(); + } + + private void setAnimationProgress(float value) { + animationProgress = value; + float rad = Math.max(lastTouchX, getMeasuredWidth() - lastTouchX) + AndroidUtilities.dp(40); + float cx = lastTouchX; + int cy = getMeasuredHeight() / 2; + float animatedRad = rad * animationProgress; +// radioButton.setOverrideColorProgress(cx, cy, animatedRad); + } + + @Override + protected void onDraw(Canvas canvas) { + if (animatedColorBackground != 0) { + float rad = Math.max(lastTouchX, getMeasuredWidth() - lastTouchX) + AndroidUtilities.dp(40); + float cx = lastTouchX; + int cy = getMeasuredHeight() / 2; + float animatedRad = rad * animationProgress; + canvas.drawCircle(cx, cy, animatedRad, animationPaint); + } + if (needDivider) { + canvas.drawLine(LocaleController.isRTL ? 0 : AndroidUtilities.dp(64), getMeasuredHeight() - 1, getMeasuredWidth() - (LocaleController.isRTL ? AndroidUtilities.dp(64) : 0), getMeasuredHeight() - 1, Theme.dividerPaint); + } + } + + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + info.setClassName("android.widget.RadioButton"); + info.setCheckable(true); + info.setChecked(radioButton.isChecked()); + info.setContentDescription(radioButton.isChecked() ? LocaleController.getString("NotificationsOn", R.string.NotificationsOn) : LocaleController.getString("NotificationsOff", R.string.NotificationsOff)); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java index dcc5f6c16..3702337a9 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java @@ -12,7 +12,6 @@ import android.animation.Animator; import android.animation.ObjectAnimator; import android.content.Context; import android.graphics.Canvas; -import android.graphics.Color; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; @@ -28,6 +27,7 @@ import android.widget.TextView; import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.LocaleController; import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.Components.BackupImageView; import org.telegram.ui.Components.LayoutHelper; import java.util.ArrayList; @@ -36,6 +36,7 @@ public class TextSettingsCell extends FrameLayout { private TextView textView; private TextView valueTextView; + private BackupImageView valueBackupImageView; private ImageView valueImageView; private boolean needDivider; private boolean canDisable; @@ -95,6 +96,10 @@ public class TextSettingsCell extends FrameLayout { if (valueImageView.getVisibility() == VISIBLE) { valueImageView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY)); } + + if (valueBackupImageView != null) { + valueBackupImageView.measure(MeasureSpec.makeMeasureSpec(valueBackupImageView.getLayoutParams().height, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(valueBackupImageView.getLayoutParams().width, MeasureSpec.EXACTLY)); + } if (valueTextView.getVisibility() == VISIBLE) { valueTextView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY)); width = availableWidth - valueTextView.getMeasuredWidth() - AndroidUtilities.dp(8); @@ -273,4 +278,12 @@ public class TextSettingsCell extends FrameLayout { } invalidate(); } + + public BackupImageView getValueBackupImageView() { + if (valueBackupImageView == null) { + valueBackupImageView = new BackupImageView(getContext()); + addView(valueBackupImageView, LayoutHelper.createFrame(24, 24, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL, padding, 0, padding, 0)); + } + return valueBackupImageView; + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ThemePreviewMessagesCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ThemePreviewMessagesCell.java index 2f5519620..e3af3caf2 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ThemePreviewMessagesCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ThemePreviewMessagesCell.java @@ -1,5 +1,9 @@ package org.telegram.ui.Cells; +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ValueAnimator; +import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Canvas; import android.graphics.Shader; @@ -7,23 +11,32 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; +import android.view.GestureDetector; import android.view.MotionEvent; +import android.view.ViewTreeObserver; import android.widget.LinearLayout; +import androidx.core.content.ContextCompat; + import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MediaDataController; import org.telegram.messenger.MessageObject; import org.telegram.messenger.R; import org.telegram.messenger.UserConfig; import org.telegram.tgnet.TLRPC; import org.telegram.ui.ActionBar.ActionBarLayout; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.ActionBar.Theme; import org.telegram.ui.Components.BackgroundGradientDrawable; import org.telegram.ui.Components.LayoutHelper; import org.telegram.ui.Components.MotionBackgroundDrawable; +import org.telegram.ui.Components.Reactions.ReactionsEffectOverlay; public class ThemePreviewMessagesCell extends LinearLayout { + public final static int TYPE_REACTIONS_DOUBLE_TAP = 2; + private final Runnable invalidateRunnable = this::invalidate; private BackgroundGradientDrawable.Disposable backgroundGradientDisposable; @@ -34,10 +47,15 @@ public class ThemePreviewMessagesCell extends LinearLayout { private ChatMessageCell[] cells = new ChatMessageCell[2]; private Drawable shadowDrawable; private ActionBarLayout parentLayout; + private final int type; + public BaseFragment fragment; + + @SuppressLint("ClickableViewAccessibility") public ThemePreviewMessagesCell(Context context, ActionBarLayout layout, int type) { super(context); - + this.type = type; + int currentAccount = UserConfig.selectedAccount; parentLayout = layout; setWillNotDraw(false); @@ -47,92 +65,180 @@ public class ThemePreviewMessagesCell extends LinearLayout { shadowDrawable = Theme.getThemedDrawable(context, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow); int date = (int) (System.currentTimeMillis() / 1000) - 60 * 60; - TLRPC.Message message = new TLRPC.TL_message(); - if (type == 0) { - message.message = LocaleController.getString("FontSizePreviewReply", R.string.FontSizePreviewReply); - } else { - message.message = LocaleController.getString("NewThemePreviewReply", R.string.NewThemePreviewReply); - } - message.date = date + 60; - message.dialog_id = 1; - message.flags = 259; - message.from_id = new TLRPC.TL_peerUser(); - message.from_id.user_id = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId(); - message.id = 1; - message.media = new TLRPC.TL_messageMediaEmpty(); - message.out = true; - message.peer_id = new TLRPC.TL_peerUser(); - message.peer_id.user_id = 0; - MessageObject replyMessageObject = new MessageObject(UserConfig.selectedAccount, message, true, false); - message = new TLRPC.TL_message(); - if (type == 0) { - message.message = LocaleController.getString("FontSizePreviewLine2", R.string.FontSizePreviewLine2); + MessageObject message1 = null; + MessageObject message2 = null; + if (type == TYPE_REACTIONS_DOUBLE_TAP) { + TLRPC.Message message = new TLRPC.TL_message(); + message.message = LocaleController.getString("DoubleTapPreviewMessage", R.string.DoubleTapPreviewMessage); + message.date = date + 60; + message.dialog_id = 1; + message.flags = 259; + message.from_id = new TLRPC.TL_peerUser(); + message.from_id.user_id = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId(); + message.id = 1; + message.media = new TLRPC.TL_messageMediaEmpty(); + message.out = false; + message.peer_id = new TLRPC.TL_peerUser(); + message.peer_id.user_id = 0; + + message1 = new MessageObject(UserConfig.selectedAccount, message, true, false); + message1.resetLayout(); + message1.eventId = 1; + message1.customName = LocaleController.getString("DoubleTapPreviewSenderName", R.string.DoubleTapPreviewSenderName); + message1.customAvatarDrawable = ContextCompat.getDrawable(context, R.drawable.dino_pic); } else { - String text = LocaleController.getString("NewThemePreviewLine3", R.string.NewThemePreviewLine3); - StringBuilder builder = new StringBuilder(text); - int index1 = text.indexOf('*'); - int index2 = text.lastIndexOf('*'); - if (index1 != -1 && index2 != -1) { - builder.replace(index2, index2 + 1, ""); - builder.replace(index1, index1 + 1, ""); - TLRPC.TL_messageEntityTextUrl entityUrl = new TLRPC.TL_messageEntityTextUrl(); - entityUrl.offset = index1; - entityUrl.length = index2 - index1 - 1; - entityUrl.url = "https://telegram.org"; - message.entities.add(entityUrl); + TLRPC.Message message = new TLRPC.TL_message(); + if (type == 0) { + message.message = LocaleController.getString("FontSizePreviewReply", R.string.FontSizePreviewReply); + } else { + message.message = LocaleController.getString("NewThemePreviewReply", R.string.NewThemePreviewReply); } - message.message = builder.toString(); - } - message.date = date + 960; - message.dialog_id = 1; - message.flags = 259; - message.from_id = new TLRPC.TL_peerUser(); - message.from_id.user_id = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId(); - message.id = 1; - message.media = new TLRPC.TL_messageMediaEmpty(); - message.out = true; - message.peer_id = new TLRPC.TL_peerUser(); - message.peer_id.user_id = 0; - MessageObject message1 = new MessageObject(UserConfig.selectedAccount, message, true, false); - message1.resetLayout(); - message1.eventId = 1; + message.date = date + 60; + message.dialog_id = 1; + message.flags = 259; + message.from_id = new TLRPC.TL_peerUser(); + message.from_id.user_id = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId(); + message.id = 1; + message.media = new TLRPC.TL_messageMediaEmpty(); + message.out = true; + message.peer_id = new TLRPC.TL_peerUser(); + message.peer_id.user_id = 0; + MessageObject replyMessageObject = new MessageObject(UserConfig.selectedAccount, message, true, false); - message = new TLRPC.TL_message(); - if (type == 0) { - message.message = LocaleController.getString("FontSizePreviewLine1", R.string.FontSizePreviewLine1); - } else { - message.message = LocaleController.getString("NewThemePreviewLine1", R.string.NewThemePreviewLine1); + message = new TLRPC.TL_message(); + if (type == 0) { + message.message = LocaleController.getString("FontSizePreviewLine2", R.string.FontSizePreviewLine2); + } else { + String text = LocaleController.getString("NewThemePreviewLine3", R.string.NewThemePreviewLine3); + StringBuilder builder = new StringBuilder(text); + int index1 = text.indexOf('*'); + int index2 = text.lastIndexOf('*'); + if (index1 != -1 && index2 != -1) { + builder.replace(index2, index2 + 1, ""); + builder.replace(index1, index1 + 1, ""); + TLRPC.TL_messageEntityTextUrl entityUrl = new TLRPC.TL_messageEntityTextUrl(); + entityUrl.offset = index1; + entityUrl.length = index2 - index1 - 1; + entityUrl.url = "https://telegram.org"; + message.entities.add(entityUrl); + } + message.message = builder.toString(); + } + message.date = date + 960; + message.dialog_id = 1; + message.flags = 259; + message.from_id = new TLRPC.TL_peerUser(); + message.from_id.user_id = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId(); + message.id = 1; + message.media = new TLRPC.TL_messageMediaEmpty(); + message.out = true; + message.peer_id = new TLRPC.TL_peerUser(); + message.peer_id.user_id = 0; + message1 = new MessageObject(UserConfig.selectedAccount, message, true, false); + message1.resetLayout(); + message1.eventId = 1; + + message = new TLRPC.TL_message(); + if (type == 0) { + message.message = LocaleController.getString("FontSizePreviewLine1", R.string.FontSizePreviewLine1); + } else { + message.message = LocaleController.getString("NewThemePreviewLine1", R.string.NewThemePreviewLine1); + } + message.date = date + 60; + message.dialog_id = 1; + message.flags = 257 + 8; + message.from_id = new TLRPC.TL_peerUser(); + message.id = 1; + message.reply_to = new TLRPC.TL_messageReplyHeader(); + message.reply_to.reply_to_msg_id = 5; + message.media = new TLRPC.TL_messageMediaEmpty(); + message.out = false; + message.peer_id = new TLRPC.TL_peerUser(); + message.peer_id.user_id = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId(); + message2 = new MessageObject(UserConfig.selectedAccount, message, true, false); + if (type == 0) { + message2.customReplyName = LocaleController.getString("FontSizePreviewName", R.string.FontSizePreviewName); + } else { + message2.customReplyName = LocaleController.getString("NewThemePreviewName", R.string.NewThemePreviewName); + } + message2.eventId = 1; + message2.resetLayout(); + message2.replyMessageObject = replyMessageObject; } - message.date = date + 60; - message.dialog_id = 1; - message.flags = 257 + 8; - message.from_id = new TLRPC.TL_peerUser(); - message.id = 1; - message.reply_to = new TLRPC.TL_messageReplyHeader(); - message.reply_to.reply_to_msg_id = 5; - message.media = new TLRPC.TL_messageMediaEmpty(); - message.out = false; - message.peer_id = new TLRPC.TL_peerUser(); - message.peer_id.user_id = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId(); - MessageObject message2 = new MessageObject(UserConfig.selectedAccount, message, true, false); - if (type == 0) { - message2.customReplyName = LocaleController.getString("FontSizePreviewName", R.string.FontSizePreviewName); - } else { - message2.customReplyName = LocaleController.getString("NewThemePreviewName", R.string.NewThemePreviewName); - } - message2.eventId = 1; - message2.resetLayout(); - message2.replyMessageObject = replyMessageObject; for (int a = 0; a < cells.length; a++) { - cells[a] = new ChatMessageCell(context); + cells[a] = new ChatMessageCell(context) { + private GestureDetector gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() { + @Override + public boolean onDoubleTap(MotionEvent e) { + boolean added = getMessageObject().selectReaction(MediaDataController.getInstance(currentAccount).getDoubleTapReaction(), false); + setMessageObject(getMessageObject(), null, false, false); + requestLayout(); + ReactionsEffectOverlay.removeCurrent(false); + if (added) { + ReactionsEffectOverlay.show(fragment, null, cells[1], e.getX(), e.getY(), MediaDataController.getInstance(currentAccount).getDoubleTapReaction(), currentAccount); + ReactionsEffectOverlay.startAnimation(); + } + getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + getViewTreeObserver().removeOnPreDrawListener(this); + getTransitionParams().resetAnimation(); + getTransitionParams().animateChange(); + getTransitionParams().animateChange = true; + getTransitionParams().animateChangeProgress = 0f; + ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1f); + valueAnimator.addUpdateListener(valueAnimator1 -> { + getTransitionParams().animateChangeProgress = (float) valueAnimator1.getAnimatedValue(); + invalidate(); + }); + valueAnimator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + getTransitionParams().resetAnimation(); + getTransitionParams().animateChange = false; + getTransitionParams().animateChangeProgress = 1f; + } + }); + valueAnimator.start(); + return false; + } + }); + + return true; + } + }); + + @Override + public boolean onTouchEvent(MotionEvent event) { + gestureDetector.onTouchEvent(event); + return true; + } + + @Override + protected void dispatchDraw(Canvas canvas) { + if (getAvatarImage() != null && getAvatarImage().getImageHeight() != 0) { + getAvatarImage().setImageCoords(getAvatarImage().getImageX(), getMeasuredHeight() - getAvatarImage().getImageHeight() - AndroidUtilities.dp(4), getAvatarImage().getImageWidth(), getAvatarImage().getImageHeight()); + getAvatarImage().setRoundRadius((int) (getAvatarImage().getImageHeight() / 2f)); + getAvatarImage().draw(canvas); + } else if (type == TYPE_REACTIONS_DOUBLE_TAP) { + invalidate(); + } + super.dispatchDraw(canvas); + } + }; cells[a].setDelegate(new ChatMessageCell.ChatMessageCellDelegate() { }); - cells[a].isChat = false; + cells[a].isChat = type == TYPE_REACTIONS_DOUBLE_TAP; cells[a].setFullyDraw(true); - cells[a].setMessageObject(a == 0 ? message2 : message1, null, false, false); + MessageObject messageObject = a == 0 ? message2 : message1; + if (messageObject == null) { + continue; + } + cells[a].setMessageObject(messageObject, null, false, false); addView(cells[a], LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); } } @@ -232,11 +338,17 @@ public class ThemePreviewMessagesCell extends LinearLayout { @Override public boolean onInterceptTouchEvent(MotionEvent ev) { + if (type == TYPE_REACTIONS_DOUBLE_TAP) { + return super.onInterceptTouchEvent(ev); + } return false; } @Override public boolean dispatchTouchEvent(MotionEvent ev) { + if (type == TYPE_REACTIONS_DOUBLE_TAP) { + return super.dispatchTouchEvent(ev); + } return false; } @@ -247,6 +359,9 @@ public class ThemePreviewMessagesCell extends LinearLayout { @Override public boolean onTouchEvent(MotionEvent event) { + if (type == TYPE_REACTIONS_DOUBLE_TAP) { + return super.onTouchEvent(event); + } return false; } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ThemesHorizontalListCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ThemesHorizontalListCell.java index b6c9409ae..925f1c6b3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ThemesHorizontalListCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ThemesHorizontalListCell.java @@ -388,7 +388,7 @@ public class ThemesHorizontalListCell extends RecyclerListView implements Notifi backgroundDrawable = drawable; hsv = AndroidUtilities.rgbToHsv(Color.red(themeInfo.getPreviewBackgroundColor()), Color.green(themeInfo.getPreviewBackgroundColor()), Color.blue(themeInfo.getPreviewBackgroundColor())); } else if (themeInfo.previewWallpaperOffset > 0 || themeInfo.pathToWallpaper != null) { - Bitmap wallpaper = getScaledBitmap(AndroidUtilities.dp(76), AndroidUtilities.dp(97), themeInfo.pathToWallpaper, themeInfo.pathToFile, themeInfo.previewWallpaperOffset); + Bitmap wallpaper = AndroidUtilities.getScaledBitmap(AndroidUtilities.dp(76), AndroidUtilities.dp(97), themeInfo.pathToWallpaper, themeInfo.pathToFile, themeInfo.previewWallpaperOffset); if (wallpaper != null) { backgroundDrawable = new BitmapDrawable(wallpaper); bitmapShader = new BitmapShader(wallpaper, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); @@ -798,56 +798,6 @@ public class ThemesHorizontalListCell extends RecyclerListView implements Notifi } } - public static Bitmap getScaledBitmap(float w, float h, String path, String streamPath, int streamOffset) { - FileInputStream stream = null; - try { - BitmapFactory.Options options = new BitmapFactory.Options(); - options.inJustDecodeBounds = true; - - if (path != null) { - BitmapFactory.decodeFile(path, options); - } else { - stream = new FileInputStream(streamPath); - stream.getChannel().position(streamOffset); - BitmapFactory.decodeStream(stream, null, options); - } - if (options.outWidth > 0 && options.outHeight > 0) { - if (w > h && options.outWidth < options.outHeight) { - float temp = w; - w = h; - h = temp; - } - float scale = Math.min(options.outWidth / w, options.outHeight / h); - options.inSampleSize = 1; - if (scale > 1.0f) { - do { - options.inSampleSize *= 2; - } while (options.inSampleSize < scale); - } - options.inJustDecodeBounds = false; - Bitmap wallpaper; - if (path != null) { - wallpaper = BitmapFactory.decodeFile(path, options); - } else { - stream.getChannel().position(streamOffset); - wallpaper = BitmapFactory.decodeStream(stream, null, options); - } - return wallpaper; - } - } catch (Throwable e) { - FileLog.e(e); - } finally { - try { - if (stream != null) { - stream.close(); - } - } catch (Exception e2) { - FileLog.e(e2); - } - } - return null; - } - @Override public void setBackgroundColor(int color) { super.setBackgroundColor(color); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 63cddae57..0193576e8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -14,6 +14,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; +import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.Activity; import android.app.DatePickerDialog; @@ -60,7 +61,6 @@ import android.text.TextUtils; import android.text.style.CharacterStyle; import android.text.style.ForegroundColorSpan; import android.text.style.URLSpan; -import android.util.Log; import android.util.Property; import android.util.SparseArray; import android.util.SparseIntArray; @@ -81,6 +81,7 @@ import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.DecelerateInterpolator; import android.widget.EditText; import android.widget.FrameLayout; +import android.widget.HorizontalScrollView; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.Space; @@ -91,12 +92,16 @@ import androidx.collection.LongSparseArray; import androidx.core.content.ContextCompat; import androidx.core.content.FileProvider; import androidx.core.graphics.ColorUtils; +import androidx.dynamicanimation.animation.SpringAnimation; +import androidx.dynamicanimation.animation.SpringForce; import androidx.recyclerview.widget.ChatListItemAnimator; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManagerFixed; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearSmoothScrollerCustom; import androidx.recyclerview.widget.RecyclerView; +import androidx.viewpager.widget.PagerAdapter; +import androidx.viewpager.widget.ViewPager; import com.google.android.exoplayer2.ui.AspectRatioFrameLayout; @@ -117,6 +122,7 @@ import org.telegram.messenger.FileLog; import org.telegram.messenger.ForwardingMessagesParams; import org.telegram.messenger.ImageLocation; import org.telegram.messenger.ImageReceiver; +import org.telegram.messenger.LanguageDetector; import org.telegram.messenger.LocaleController; import org.telegram.messenger.MediaController; import org.telegram.messenger.MediaDataController; @@ -184,6 +190,7 @@ import org.telegram.ui.Components.ChatAttachAlertDocumentLayout; import org.telegram.ui.Components.ChatAvatarContainer; import org.telegram.ui.Components.ChatBigEmptyView; import org.telegram.ui.Components.ChatGreetingsView; +import org.telegram.ui.Components.ChatScrimPopupContainerLayout; import org.telegram.ui.Components.ChatThemeBottomSheet; import org.telegram.ui.Components.ChecksHintView; import org.telegram.ui.Components.ClearHistoryAlert; @@ -205,6 +212,7 @@ import org.telegram.ui.Components.HintView; import org.telegram.ui.Components.ImportingAlert; import org.telegram.ui.Components.InstantCameraView; import org.telegram.ui.Components.InviteMembersBottomSheet; +import org.telegram.ui.Components.JoinGroupAlert; import org.telegram.ui.Components.LayoutHelper; import org.telegram.ui.Components.MessageBackgroundDrawable; import org.telegram.ui.Components.MotionBackgroundDrawable; @@ -215,6 +223,12 @@ import org.telegram.ui.Components.PipRoundVideoView; import org.telegram.ui.Components.PollVotesAlert; import org.telegram.ui.Components.RLottieDrawable; import org.telegram.ui.Components.RadialProgressView; +import org.telegram.ui.Components.ReactedHeaderView; +import org.telegram.ui.Components.ReactedUsersListView; +import org.telegram.ui.Components.ReactionTabHolderView; +import org.telegram.ui.Components.Reactions.ReactionsEffectOverlay; +import org.telegram.ui.Components.Reactions.ReactionsLayoutInBubble; +import org.telegram.ui.Components.ReactionsContainerLayout; import org.telegram.ui.Components.RecyclerAnimationScrollHelper; import org.telegram.ui.Components.RecyclerListView; import org.telegram.ui.Components.ReportAlert; @@ -226,6 +240,7 @@ import org.telegram.ui.Components.SizeNotifierFrameLayout; import org.telegram.ui.Components.StickersAlert; import org.telegram.ui.Components.TextSelectionHint; import org.telegram.ui.Components.TextStyleSpan; +import org.telegram.ui.Components.TranslateAlert; import org.telegram.ui.Components.TrendingStickersAlert; import org.telegram.ui.Components.TypefaceSpan; import org.telegram.ui.Components.URLSpanBotCommand; @@ -251,6 +266,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -455,6 +472,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not private int scrollToOffsetOnRecreate = 0; private ArrayList pollsToCheck = new ArrayList<>(10); + private ArrayList reactionsToCheck = new ArrayList<>(10); private int editTextStart; private int editTextEnd; @@ -655,7 +673,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not private int popupAnimationIndex = -1; private AnimatorSet scrimAnimatorSet; private ActionBarPopupWindow scrimPopupWindow; - private ActionBarPopupWindow mesageSeenUsersPopupWindow; private int scrimPopupX, scrimPopupY; private ActionBarMenuSubItem[] scrimPopupWindowItems; private ActionBarMenuSubItem menuDeleteItem; @@ -759,6 +776,37 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not private TLRPC.TL_channels_sendAsPeers sendAsPeersObj; + private final static int OPTION_RETRY = 0; + private final static int OPTION_DELETE = 1; + private final static int OPTION_FORWARD = 2; + private final static int OPTION_COPY = 3; + private final static int OPTION_SAVE_TO_GALLERY = 4; + private final static int OPTION_APPLY_LOCALIZATION_OR_THEME = 5; + private final static int OPTION_SHARE = 6; + private final static int OPTION_SAVE_TO_GALLERY2 = 7; + private final static int OPTION_REPLY = 8; + private final static int OPTION_ADD_TO_STICKERS_OR_MASKS = 9; + private final static int OPTION_SAVE_TO_DOWNLOADS_OR_MUSIC = 10; + private final static int OPTION_ADD_TO_GIFS = 11; + private final static int OPTION_EDIT = 12; + private final static int OPTION_PIN = 13; + private final static int OPTION_UNPIN = 14; + private final static int OPTION_ADD_CONTACT = 15; + private final static int OPTION_COPY_PHONE_NUMBER = 16; + private final static int OPTION_CALL = 17; + private final static int OPTION_CALL_AGAIN = 18; + private final static int OPTION_RATE_CALL = 19; + private final static int OPTION_ADD_STICKER_TO_FAVORITES = 20; + private final static int OPTION_DELETE_STICKER_FROM_FAVORITES = 21; + private final static int OPTION_COPY_LINK = 22; + private final static int OPTION_REPORT_CHAT = 23; + private final static int OPTION_CANCEL_SENDING = 24; + private final static int OPTION_UNVOTE = 25; + private final static int OPTION_STOP_POLL_OR_QUIZ = 26; + private final static int OPTION_VIEW_REPLIES_OR_THREAD = 27; + private final static int OPTION_SEND_NOW = 100; + private final static int OPTION_EDIT_SCHEDULE_TIME = 102; + private final static int[] allowedNotificationsDuringChatListAnimations = new int[]{ NotificationCenter.messagesRead, NotificationCenter.threadMessagesRead, @@ -1182,6 +1230,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not private final static int text_regular = 54; private final static int text_strike = 55; private final static int text_underline = 56; + private final static int text_spoiler = 57; private final static int search = 40; @@ -1208,16 +1257,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } return true; } - - @Override - public void onLongClickRelease() { - - } - - @Override - public void onMove(float dx, float dy) { - - } }; private void startMultiselect(int position) { @@ -1348,6 +1387,54 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } createMenu(view, true, false, x, y); } + + @Override + public boolean hasDoubleTap(View view, int position) { + TLRPC.TL_availableReaction reaction = getMediaDataController().getReactionsMap().get(getMediaDataController().getDoubleTapReaction()); + if (reaction == null) { + return false; + } + boolean available = dialog_id >= 0; + if (!available && chatInfo != null) { + for (String s : chatInfo.available_reactions) { + if (s.equals(reaction.reaction)) { + available = true; + break; + } + } + } + if (!available) { + return false; + } + return (view instanceof ChatMessageCell) && ((ChatMessageCell)view).getMessageObject().type != 16 && !actionBar.isActionModeShowed() && !isSecretChat() && !isInScheduleMode(); + } + + @Override + public void onDoubleTap(View view, int position, float x, float y) { + if (!(view instanceof ChatMessageCell) || getParentActivity() == null || isSecretChat() || isInScheduleMode()) { + return; + } + ChatMessageCell cell = (ChatMessageCell) view; + MessageObject primaryMessage = cell.getPrimaryMessageObject(); + ReactionsEffectOverlay.removeCurrent(false); + TLRPC.TL_availableReaction reaction = getMediaDataController().getReactionsMap().get(getMediaDataController().getDoubleTapReaction()); + if (reaction == null) { + return; + } + boolean available = dialog_id >= 0; + if (!available && chatInfo != null) { + for (String s : chatInfo.available_reactions) { + if (s.equals(reaction.reaction)) { + available = true; + break; + } + } + } + if (!available) { + return; + } + selectReaction(primaryMessage, null, x, y, reaction, true); + } }; private final ChatScrollCallback chatScrollHelperCallback = new ChatScrollCallback(); @@ -1585,6 +1672,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not getNotificationCenter().addObserver(this, NotificationCenter.scheduledMessagesUpdated); getNotificationCenter().addObserver(this, NotificationCenter.diceStickersDidLoad); getNotificationCenter().addObserver(this, NotificationCenter.dialogDeleted); + getNotificationCenter().addObserver(this, NotificationCenter.chatAvailableReactionsUpdated); super.onFragmentCreate(); @@ -1786,13 +1874,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } - /** - * Gets same chats index difference - * [..., other_same, this, ...] => -1 - * [..., this, other_same, ...] => 1 - * [..., this, ...] => 0 - * @return Other same chats index difference - */ public int getOtherSameChatsDiff() { if (parentLayout == null || parentLayout.fragmentsStack == null) { return 0; @@ -1904,6 +1985,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not getNotificationCenter().removeObserver(this, NotificationCenter.scheduledMessagesUpdated); getNotificationCenter().removeObserver(this, NotificationCenter.diceStickersDidLoad); getNotificationCenter().removeObserver(this, NotificationCenter.dialogDeleted); + getNotificationCenter().removeObserver(this, NotificationCenter.chatAvailableReactionsUpdated); getNotificationCenter().removeObserver(this, NotificationCenter.didLoadSponsoredMessages); getNotificationCenter().removeObserver(this, NotificationCenter.didLoadSendAsPeers); if (currentEncryptedChat != null) { @@ -2153,7 +2235,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not showDialog(alert); return; } - final boolean isChat = DialogObject.isChatDialog(dialog_id); AlertsCreator.createClearOrDeleteDialogAlert(ChatActivity.this, id == clear_history, currentChat, currentUser, currentEncryptedChat != null, true, (param) -> { if (id == clear_history && ChatObject.isChannel(currentChat) && (!currentChat.megagroup || !TextUtils.isEmpty(currentChat.username))) { @@ -2248,6 +2329,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not chatActivityEnterView.getEditField().setSelectionOverride(editTextStart, editTextEnd); chatActivityEnterView.getEditField().makeSelectedItalic(); } + } else if (id == text_spoiler) { + if (chatActivityEnterView != null) { + chatActivityEnterView.getEditField().setSelectionOverride(editTextStart, editTextEnd); + chatActivityEnterView.getEditField().makeSelectedSpoiler(); + } } else if (id == text_mono) { if (chatActivityEnterView != null) { chatActivityEnterView.getEditField().setSelectionOverride(editTextStart, editTextEnd); @@ -2558,6 +2644,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not editTextItem.setTag(null); editTextItem.setVisibility(View.GONE); + editTextItem.addSubItem(text_spoiler, LocaleController.getString("Spoiler", R.string.Spoiler)); SpannableStringBuilder stringBuilder = new SpannableStringBuilder(LocaleController.getString("Bold", R.string.Bold)); stringBuilder.setSpan(new TypefaceSpan(AndroidUtilities.getTypeface("fonts/rmedium.ttf")), 0, stringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); editTextItem.addSubItem(text_bold, stringBuilder); @@ -2798,6 +2885,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not pullingDownDrawable = null; } emojiAnimationsOverlay.onDetachedFromWindow(); + ReactionsEffectOverlay.removeCurrent(true); } @Override @@ -2973,7 +3061,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } else if (type == 1) { cell.drawNamesLayout(canvas, alpha); } else { - cell.drawCaptionLayout(canvas, (cell.getCurrentPosition().flags & MessageObject.POSITION_FLAG_LEFT) == 0, alpha); + cell.drawCaptionLayout(canvas, cell.getCurrentPosition() != null && (cell.getCurrentPosition().flags & MessageObject.POSITION_FLAG_LEFT) == 0, alpha); } cell.setInvalidatesParent(false); canvas.restore(); @@ -3132,7 +3220,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } - if (position != null || cell != null && cell.getTransitionParams().animateBackgroundBoundsInner) { + if (position != null || (cell != null && cell.getTransitionParams().animateBackgroundBoundsInner)) { if (position == null || position.last || position.minX == 0 && position.minY == 0) { if (position == null || position.last) { drawTimeAfter.add(cell); @@ -3141,7 +3229,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not drawNamesAfter.add(cell); } } - if ((cell.hasCaptionLayout() || cell.hasCommentLayout()) && (position == null || (position.flags & MessageObject.POSITION_FLAG_BOTTOM) != 0)) { + if (position == null || (position.flags & MessageObject.POSITION_FLAG_BOTTOM) != 0) { drawCaptionAfter.add(cell); } } @@ -3165,7 +3253,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (size > 0) { for (int a = 0; a < size; a++) { ChatMessageCell cell = drawCaptionAfter.get(a); - if (cell.getCurrentPosition() == null) { + if (cell.getCurrentPosition() == null && !cell.getTransitionParams().animateBackgroundBoundsInner) { continue; } drawChildElement(canvas, listTop, cell, 2); @@ -4197,7 +4285,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } - @Override protected void dispatchDraw(Canvas canvas) { drawLaterRoundProgressCell = null; @@ -4620,7 +4707,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ); } canvas.translate(canvasOffsetX, canvasOffsetY); + cell.setInvalidatesParent(true); cell.drawCaptionLayout(canvas, selectionOnly, alpha); + cell.setInvalidatesParent(false); canvas.restore(); } drawCaptionAfter.clear(); @@ -4662,7 +4751,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } } - if (position != null || chatMessageCell.getTransitionParams().transformGroupToSingleMessage) { + if (position != null || chatMessageCell.getTransitionParams().transformGroupToSingleMessage || chatMessageCell.getTransitionParams().animateBackgroundBoundsInner) { if (num == count - 1) { float alpha = chatMessageCell.shouldDrawAlphaLayer() ? chatMessageCell.getAlpha() : 1f; float canvasOffsetX = chatMessageCell.getLeft() + chatMessageCell.getNonAnimationTranslationX(false); @@ -4688,7 +4777,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not canvas.translate(canvasOffsetX, canvasOffsetY); if (position == null || (position.flags & MessageObject.POSITION_FLAG_BOTTOM) != 0) { boolean selectionOnly = position != null && (position.flags & MessageObject.POSITION_FLAG_LEFT) == 0; + chatMessageCell.setInvalidatesParent(true); chatMessageCell.drawCaptionLayout(canvas, selectionOnly, alpha); + chatMessageCell.setInvalidatesParent(false); } canvas.restore(); } else { @@ -4947,6 +5038,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (currentEncryptedChat != null && Build.VERSION.SDK_INT >= 19) { chatListView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); } + chatListView.setAccessibilityEnabled(false); chatListView.setNestedScrollingEnabled(false); chatListView.setInstantClick(true); chatListView.setDisableHighlightState(true); @@ -5292,6 +5384,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (SharedConfig.getDevicePerformanceClass() == SharedConfig.PERFORMANCE_CLASS_LOW) { NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.startAllHeavyOperations, 512); } + NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.startSpoilers); chatListView.setOverScrollMode(RecyclerView.OVER_SCROLL_ALWAYS); textSelectionHelper.stopScrolling(); updateVisibleRows(); @@ -5310,6 +5403,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (SharedConfig.getDevicePerformanceClass() == SharedConfig.PERFORMANCE_CLASS_LOW) { NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.stopAllHeavyOperations, 512); } + NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.stopSpoilers); } } @@ -5398,6 +5492,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not invalidateMessagesVisiblePart(); textSelectionHelper.onParentScrolled(); emojiAnimationsOverlay.onScrolled(dy); + ReactionsEffectOverlay.onScrolled(dy); } }); @@ -10747,7 +10842,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not mess = mess.substring(0, 150); } mess = mess.replace('\n', ' '); - replyObjectTextView.setText(Emoji.replaceEmoji(mess, replyObjectTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false)); + Spannable cs = new SpannableStringBuilder(Emoji.replaceEmoji(mess, replyObjectTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false)); + MediaDataController.addTextStyleRuns(messageObjectToEdit, cs); + replyObjectTextView.setText(cs); } } } else if (messageObjectToReply != null) { @@ -10793,17 +10890,24 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not replyIconImageView.setContentDescription(LocaleController.getString("AccDescrReplying", R.string.AccDescrReplying)); replyCloseImageView.setContentDescription(LocaleController.getString("AccDescrCancelReply", R.string.AccDescrCancelReply)); + CharSequence replyObjectText = null; if (!TextUtils.isEmpty(restrictionReason)) { - replyObjectTextView.setText(restrictionReason); + replyObjectText = restrictionReason; } else if (messageObjectToReply.messageOwner.media instanceof TLRPC.TL_messageMediaGame) { - replyObjectTextView.setText(Emoji.replaceEmoji(messageObjectToReply.messageOwner.media.game.title, replyObjectTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false)); + replyObjectText = Emoji.replaceEmoji(messageObjectToReply.messageOwner.media.game.title, replyObjectTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false); } else if (messageObjectToReply.messageText != null || messageObjectToReply.caption != null) { String mess = messageObjectToReply.caption != null ? messageObjectToReply.caption.toString() : messageObjectToReply.messageText.toString(); if (mess.length() > 150) { mess = mess.substring(0, 150); } mess = mess.replace('\n', ' '); - replyObjectTextView.setText(Emoji.replaceEmoji(mess, replyObjectTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false)); + replyObjectText = Emoji.replaceEmoji(mess, replyObjectTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false); + } + if (replyObjectText != null) { + if (replyObjectText instanceof Spannable) + MediaDataController.addTextStyleRuns(messageObjectToReply.messageOwner.entities, messageObjectToReply.caption != null ? messageObjectToReply.caption : messageObjectToReply.messageText, (Spannable) replyObjectText); + + replyObjectTextView.setText(replyObjectText); } } else if (messageObjectsToForward != null) { if (messageObjectsToForward.isEmpty()) { @@ -10942,13 +11046,14 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } else { if ((type == -1 || type == 0 || type == 10 || type == 11) && (messageObjectsToForward.size() == 1 && messageObjectsToForward.get(0).messageText != null)) { MessageObject messageObject = messageObjectsToForward.get(0); - String mess = messageObject.messageText.toString(); + CharSequence mess = SpannableStringBuilder.valueOf(messageObject.messageText); + MediaDataController.addTextStyleRuns(messageObjectsToForward.get(0), (Spannable) mess); if (mess.length() > 150) { - mess = mess.substring(0, 150); + mess = mess.subSequence(0, 150); } - mess = mess.replace('\n', ' '); - String finalString = LocaleController.formatString("ForwardingFromNameAndMessage", R.string.ForwardingFromNameAndMessage, userNames, mess); - replyObjectTextView.setText(Emoji.replaceEmoji(finalString, replyObjectTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false)); + mess = AndroidUtilities.replaceNewLines(mess); + Spannable formatted = AndroidUtilities.formatSpannableSimple(LocaleController.getString("ForwardingFromNameAndMessage", R.string.ForwardingFromNameAndMessage), userNames, mess); + replyObjectTextView.setText(Emoji.replaceEmoji(formatted, replyObjectTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false)); } else { replyObjectTextView.setText(LocaleController.formatString("ForwardingFromNames", R.string.ForwardingFromNames, userNames)); } @@ -11413,6 +11518,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not int maxUnreadDate = Integer.MIN_VALUE; int recyclerChatViewHeight = (contentView.getHeightWithKeyboard() - (inPreviewMode ? 0 : AndroidUtilities.dp(48)) - chatListView.getTop()); pollsToCheck.clear(); + reactionsToCheck.clear(); float cilpTop = chatListViewPaddingTop; for (int a = 0; a < count; a++) { View view = chatListView.getChildAt(a); @@ -11496,6 +11602,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (messageObject.type == MessageObject.TYPE_POLL && messageObject.getId() > 0) { pollsToCheck.add(messageObject); } + if (messageObject.getId() > 0 && messageObject.messageOwner.action == null) { + reactionsToCheck.add(messageObject); + } } if (bottom <= cilpTop) { if (view instanceof ChatActionCell && messageObject.isDateObject) { @@ -11559,6 +11668,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } getMessagesController().addToPollsQueue(dialog_id, pollsToCheck); + getMessagesController().addToReactionsQueue(dialog_id, reactionsToCheck); if (videoPlayerContainer != null) { if (!foundTextureViewMessage) { MessageObject messageObject = MediaController.getInstance().getPlayingMessageObject(); @@ -15314,8 +15424,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not MessageObject messageObject = messagesDict[did == dialog_id ? 0 : 1].get(msgId); if (messageObject != null) { MessageObject.updateReactions(messageObject.messageOwner, (TLRPC.TL_messageReactions) args[2]); - messageObject.measureInlineBotButtons(); - chatAdapter.updateRowWithMessageObject(messageObject, true); + chatAdapter.notifyDataSetChanged(true); } } } else if (id == NotificationCenter.didVerifyMessagesStickers) { @@ -16045,6 +16154,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not themeDelegate.setCurrentTheme(themeDelegate.chatTheme, true, theme.isDark()); } } + } else if (id == NotificationCenter.chatAvailableReactionsUpdated) { + long chatId = (long) args[0]; + if (chatId == -dialog_id) { + chatInfo = getMessagesController().getChatFull(chatId); + } } } @@ -17769,29 +17883,32 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (Build.VERSION.SDK_INT >= 23) { menu.removeItem(android.R.id.shareText); } + int order = 6; + menu.add(R.id.menu_groupbolditalic, R.id.menu_spoiler, order++, LocaleController.getString("Spoiler", R.string.Spoiler)); + SpannableStringBuilder stringBuilder = new SpannableStringBuilder(LocaleController.getString("Bold", R.string.Bold)); stringBuilder.setSpan(new TypefaceSpan(AndroidUtilities.getTypeface("fonts/rmedium.ttf")), 0, stringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - menu.add(R.id.menu_groupbolditalic, R.id.menu_bold, 6, stringBuilder); + menu.add(R.id.menu_groupbolditalic, R.id.menu_bold, order++, stringBuilder); stringBuilder = new SpannableStringBuilder(LocaleController.getString("Italic", R.string.Italic)); stringBuilder.setSpan(new TypefaceSpan(AndroidUtilities.getTypeface("fonts/ritalic.ttf")), 0, stringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - menu.add(R.id.menu_groupbolditalic, R.id.menu_italic, 7, stringBuilder); + menu.add(R.id.menu_groupbolditalic, R.id.menu_italic, order++, stringBuilder); stringBuilder = new SpannableStringBuilder(LocaleController.getString("Mono", R.string.Mono)); stringBuilder.setSpan(new TypefaceSpan(Typeface.MONOSPACE), 0, stringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - menu.add(R.id.menu_groupbolditalic, R.id.menu_mono, 8, stringBuilder); + menu.add(R.id.menu_groupbolditalic, R.id.menu_mono, order++, stringBuilder); if (currentEncryptedChat == null || AndroidUtilities.getPeerLayerVersion(currentEncryptedChat.layer) >= 101) { stringBuilder = new SpannableStringBuilder(LocaleController.getString("Strike", R.string.Strike)); TextStyleSpan.TextStyleRun run = new TextStyleSpan.TextStyleRun(); run.flags |= TextStyleSpan.FLAG_STYLE_STRIKE; stringBuilder.setSpan(new TextStyleSpan(run), 0, stringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - menu.add(R.id.menu_groupbolditalic, R.id.menu_strike, 9, stringBuilder); + menu.add(R.id.menu_groupbolditalic, R.id.menu_strike, order++, stringBuilder); stringBuilder = new SpannableStringBuilder(LocaleController.getString("Underline", R.string.Underline)); run = new TextStyleSpan.TextStyleRun(); run.flags |= TextStyleSpan.FLAG_STYLE_UNDERLINE; stringBuilder.setSpan(new TextStyleSpan(run), 0, stringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - menu.add(R.id.menu_groupbolditalic, R.id.menu_underline, 10, stringBuilder); + menu.add(R.id.menu_groupbolditalic, R.id.menu_underline, order++, stringBuilder); } - menu.add(R.id.menu_groupbolditalic, R.id.menu_link, 11, LocaleController.getString("CreateLink", R.string.CreateLink)); - menu.add(R.id.menu_groupbolditalic, R.id.menu_regular, 12, LocaleController.getString("Regular", R.string.Regular)); + menu.add(R.id.menu_groupbolditalic, R.id.menu_link, order++, LocaleController.getString("CreateLink", R.string.CreateLink)); + menu.add(R.id.menu_groupbolditalic, R.id.menu_regular, order++, LocaleController.getString("Regular", R.string.Regular)); } private void updateScheduledInterface(boolean animated) { @@ -18444,8 +18561,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not pinnedCounterTextView.setNumber(Math.min(total - 1, Math.max(1, total - currentPinnedMessageIndex[0])), animated && pinnedCounterTextView.getTag() == null); } } + CharSequence pinnedText = null; if (pinnedMessageObject.type == 14) { - messageTextView.setText(String.format("%s - %s", pinnedMessageObject.getMusicAuthor(), pinnedMessageObject.getMusicTitle())); + pinnedText = String.format("%s - %s", pinnedMessageObject.getMusicAuthor(), pinnedMessageObject.getMusicTitle()); } else if (pinnedMessageObject.type == MessageObject.TYPE_POLL) { TLRPC.TL_messageMediaPoll poll = (TLRPC.TL_messageMediaPoll) pinnedMessageObject.messageOwner.media; String mess = poll.poll.question; @@ -18453,23 +18571,29 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not mess = mess.substring(0, 150); } mess = mess.replace('\n', ' '); - messageTextView.setText(mess); + pinnedText = mess; } else if (pinnedMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGame) { - messageTextView.setText(Emoji.replaceEmoji(pinnedMessageObject.messageOwner.media.game.title, messageTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false)); + pinnedText = Emoji.replaceEmoji(pinnedMessageObject.messageOwner.media.game.title, messageTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false); } else if (!TextUtils.isEmpty(pinnedMessageObject.caption)) { String mess = pinnedMessageObject.caption.toString(); if (mess.length() > 150) { mess = mess.substring(0, 150); } mess = mess.replace('\n', ' '); - messageTextView.setText(Emoji.replaceEmoji(mess, messageTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false)); + pinnedText = Emoji.replaceEmoji(mess, messageTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false); } else if (pinnedMessageObject.messageText != null) { String mess = pinnedMessageObject.messageText.toString(); if (mess.length() > 150) { mess = mess.substring(0, 150); } mess = mess.replace('\n', ' '); - messageTextView.setText(Emoji.replaceEmoji(mess, messageTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false)); + pinnedText = Emoji.replaceEmoji(mess, messageTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false); + } + if (pinnedText != null) { + if (pinnedText instanceof Spannable) + MediaDataController.addTextStyleRuns(pinnedMessageObject, (Spannable) pinnedText); + + messageTextView.setText(pinnedText); } if (animateToNext != 0) { pinnedNextAnimation[0] = new AnimatorSet(); @@ -19440,6 +19564,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not MediaDataController.addStyleToText(new TextStyleSpan(run), entity.offset, entity.offset + entity.length, stringBuilder, true); } else if (entity instanceof TLRPC.TL_messageEntityTextUrl) { stringBuilder.setSpan(new URLSpanReplacement(entity.url), entity.offset, entity.offset + entity.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } else if (entity instanceof TLRPC.TL_messageEntitySpoiler) { + TextStyleSpan.TextStyleRun run = new TextStyleSpan.TextStyleRun(); + run.flags |= TextStyleSpan.FLAG_STYLE_SPOILER; + MediaDataController.addStyleToText(new TextStyleSpan(run), entity.offset, entity.offset + entity.length, stringBuilder, true); } } message = stringBuilder; @@ -19742,17 +19870,34 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not return caption; } + private static boolean isEmoji(String message){ + return message.matches("(?:[\uD83C\uDF00-\uD83D\uDDFF]|[\uD83E\uDD00-\uD83E\uDDFF]|" + + "[\uD83D\uDE00-\uD83D\uDE4F]|[\uD83D\uDE80-\uD83D\uDEFF]|" + + "[\u2600-\u26FF]\uFE0F?|[\u2700-\u27BF]\uFE0F?|\u24C2\uFE0F?|" + + "[\uD83C\uDDE6-\uD83C\uDDFF]{1,2}|" + + "[\uD83C\uDD70\uD83C\uDD71\uD83C\uDD7E\uD83C\uDD7F\uD83C\uDD8E\uD83C\uDD91-\uD83C\uDD9A]\uFE0F?|" + + "[\u0023\u002A\u0030-\u0039]\uFE0F?\u20E3|[\u2194-\u2199\u21A9-\u21AA]\uFE0F?|[\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55]\uFE0F?|" + + "[\u2934\u2935]\uFE0F?|[\u3030\u303D]\uFE0F?|[\u3297\u3299]\uFE0F?|" + + "[\uD83C\uDE01\uD83C\uDE02\uD83C\uDE1A\uD83C\uDE2F\uD83C\uDE32-\uD83C\uDE3A\uD83C\uDE50\uD83C\uDE51]\uFE0F?|" + + "[\u203C\u2049]\uFE0F?|[\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE]\uFE0F?|" + + "[\u00A9\u00AE]\uFE0F?|[\u2122\u2139]\uFE0F?|\uD83C\uDC04\uFE0F?|\uD83C\uDCCF\uFE0F?|" + + "[\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA]\uFE0F?)+"); + } private void createMenu(View v, boolean single, boolean listView, float x, float y, boolean searchGroup) { if (actionBar.isActionModeShowed() || reportType >= 0) { return; } MessageObject message; + MessageObject primaryMessage; if (v instanceof ChatMessageCell) { message = ((ChatMessageCell) v).getMessageObject(); + primaryMessage = ((ChatMessageCell) v).getPrimaryMessageObject(); } else if (v instanceof ChatActionCell) { message = ((ChatActionCell) v).getMessageObject(); + primaryMessage = message; } else { + primaryMessage = null; message = null; } if (message == null) { @@ -19894,96 +20039,119 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ArrayList items = new ArrayList<>(); final ArrayList options = new ArrayList<>(); + CharSequence messageText = null; if (type >= 0 || type == -1 && single && (message.isSending() || message.isEditing()) && currentEncryptedChat == null) { selectedObject = message; selectedObjectGroup = groupedMessages; + messageText = getMessageCaption(selectedObject, selectedObjectGroup); // used only in translations + if (messageText == null && selectedObject.isPoll()) { + try { + TLRPC.Poll poll = ((TLRPC.TL_messageMediaPoll) selectedObject.messageOwner.media).poll; + StringBuilder pollText = new StringBuilder(); + pollText = new StringBuilder(poll.question).append("\n"); + for (TLRPC.TL_pollAnswer answer : poll.answers) + pollText.append("\n\uD83D\uDD18 ").append(answer.text); + messageText = pollText.toString(); + } catch (Exception e) {} + } + if (messageText == null) + messageText = getMessageContent(selectedObject, 0, false); + if (messageText != null) { + if (isEmoji(messageText.toString())) + messageText = null; // message fully consists of emojis, do not translate + } if (type == -1) { if ((selectedObject.type == 0 || selectedObject.isAnimatedEmoji() || getMessageCaption(selectedObject, selectedObjectGroup) != null) && !getMessagesController().isChatNoForwards(currentChat)) { items.add(LocaleController.getString("Copy", R.string.Copy)); - options.add(3); + options.add(OPTION_COPY); icons.add(R.drawable.msg_copy); } items.add(LocaleController.getString("CancelSending", R.string.CancelSending)); - options.add(24); + options.add(OPTION_CANCEL_SENDING); icons.add(R.drawable.msg_delete); } else if (type == 0) { items.add(LocaleController.getString("Retry", R.string.Retry)); - options.add(0); + options.add(OPTION_RETRY); icons.add(R.drawable.msg_retry); items.add(LocaleController.getString("Delete", R.string.Delete)); - options.add(1); + options.add(OPTION_DELETE); icons.add(selectedObject.messageOwner.ttl_period != 0 ? R.drawable.msg_delete_auto : R.drawable.msg_delete); } else if (type == 1) { if (currentChat != null) { if (allowChatActions) { items.add(LocaleController.getString("Reply", R.string.Reply)); - options.add(8); + options.add(OPTION_REPLY); icons.add(R.drawable.msg_reply); } if (!isThreadChat() && chatMode != MODE_SCHEDULED && message.hasReplies() && currentChat.megagroup && message.canViewThread()) { items.add(LocaleController.formatPluralString("ViewReplies", message.getRepliesCount())); - options.add(27); + options.add(OPTION_VIEW_REPLIES_OR_THREAD); icons.add(R.drawable.msg_viewreplies); } if (allowUnpin) { items.add(LocaleController.getString("UnpinMessage", R.string.UnpinMessage)); - options.add(14); + options.add(OPTION_UNPIN); icons.add(R.drawable.msg_unpin); } else if (allowPin) { items.add(LocaleController.getString("PinMessage", R.string.PinMessage)); - options.add(13); + options.add(OPTION_PIN); icons.add(R.drawable.msg_pin); } if (message.canEditMessage(currentChat)) { items.add(LocaleController.getString("Edit", R.string.Edit)); - options.add(12); + options.add(OPTION_EDIT); icons.add(R.drawable.msg_edit); } + if (!selectedObject.isOutOwner() && (messageText != null && messageText.length() > 0 && !selectedObject.isAnimatedEmoji() && !selectedObject.isDice()) && MessagesController.getGlobalMainSettings().getBoolean("translate_button", false)) { + items.add(LocaleController.getString("TranslateMessage", R.string.TranslateMessage)); + options.add(29); + icons.add(R.drawable.msg_translate); + } if (selectedObject.contentType == 0 && !selectedObject.isMediaEmptyWebpage() && selectedObject.getId() > 0 && !selectedObject.isOut() && (currentChat != null || currentUser != null && currentUser.bot)) { items.add(LocaleController.getString("ReportChat", R.string.ReportChat)); - options.add(23); + options.add(OPTION_REPORT_CHAT); icons.add(R.drawable.msg_report); } } else { if (selectedObject.getId() > 0 && allowChatActions) { items.add(LocaleController.getString("Reply", R.string.Reply)); - options.add(8); + options.add(OPTION_REPLY); icons.add(R.drawable.msg_reply); } } if (message.canDeleteMessage(chatMode == MODE_SCHEDULED, currentChat) && (threadMessageObjects == null || !threadMessageObjects.contains(message))) { items.add(LocaleController.getString("Delete", R.string.Delete)); - options.add(1); + options.add(OPTION_DELETE); icons.add(selectedObject.messageOwner.ttl_period != 0 ? R.drawable.msg_delete_auto : R.drawable.msg_delete); } } else if (type == 20) { items.add(LocaleController.getString("Retry", R.string.Retry)); - options.add(0); + options.add(OPTION_RETRY); icons.add(R.drawable.msg_retry); if (!getMessagesController().isChatNoForwards(currentChat)) { items.add(LocaleController.getString("Copy", R.string.Copy)); - options.add(3); + options.add(OPTION_COPY); icons.add(R.drawable.msg_copy); } items.add(LocaleController.getString("Delete", R.string.Delete)); - options.add(1); + options.add(OPTION_DELETE); icons.add(selectedObject.messageOwner.ttl_period != 0 ? R.drawable.msg_delete_auto : R.drawable.msg_delete); } else { if (currentEncryptedChat == null) { if (chatMode == MODE_SCHEDULED) { items.add(LocaleController.getString("MessageScheduleSend", R.string.MessageScheduleSend)); - options.add(100); + options.add(OPTION_SEND_NOW); icons.add(R.drawable.outline_send); } if (selectedObject.messageOwner.action instanceof TLRPC.TL_messageActionPhoneCall) { TLRPC.TL_messageActionPhoneCall call = (TLRPC.TL_messageActionPhoneCall) message.messageOwner.action; items.add((call.reason instanceof TLRPC.TL_phoneCallDiscardReasonMissed || call.reason instanceof TLRPC.TL_phoneCallDiscardReasonBusy) && !message.isOutOwner() ? LocaleController.getString("CallBack", R.string.CallBack) : LocaleController.getString("CallAgain", R.string.CallAgain)); - options.add(18); + options.add(OPTION_CALL_AGAIN); icons.add(R.drawable.msg_callback); if (VoIPHelper.canRateCall(call)) { items.add(LocaleController.getString("CallMessageReportProblem", R.string.CallMessageReportProblem)); - options.add(19); + options.add(OPTION_RATE_CALL); icons.add(R.drawable.msg_fave); } } @@ -20199,6 +20367,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not options.add(102); icons.add(R.drawable.msg_schedule); } + if (!selectedObject.isOutOwner() && (messageText != null && messageText.length() > 0 && !selectedObject.isAnimatedEmoji() && !selectedObject.isDice()) && MessagesController.getGlobalMainSettings().getBoolean("translate_button", false)) { + items.add(LocaleController.getString("TranslateMessage", R.string.TranslateMessage)); + options.add(29); + icons.add(R.drawable.msg_translate); + } if (chatMode != MODE_SCHEDULED && selectedObject.contentType == 0 && selectedObject.getId() > 0 && !selectedObject.isOut() && (currentChat != null || currentUser != null && currentUser.bot)) { if (UserObject.isReplyUser(currentUser)) { items.add(LocaleController.getString("BlockContact", R.string.BlockContact)); @@ -20302,6 +20475,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } } + if (options.isEmpty()) { return; } @@ -20316,13 +20490,332 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not Rect rect = new Rect(); - ActionBarPopupWindow.ActionBarPopupWindowLayout popupLayout = new ActionBarPopupWindow.ActionBarPopupWindowLayout(getParentActivity(), R.drawable.popup_fixed_alert, themeDelegate); + List availableReacts = getMediaDataController().getEnabledReactionsList(); + boolean isReactionsViewAvailable = !isSecretChat() && !isInScheduleMode() && currentUser == null && message.hasReactions() && (!ChatObject.isChannel(currentChat) || currentChat.megagroup) && !availableReacts.isEmpty() && message.messageOwner.reactions.can_see_list; + boolean isReactionsAvailable = !isSecretChat() && !isInScheduleMode() && message.isReactionsAvailable() && (chatInfo != null && !chatInfo.available_reactions.isEmpty() || (chatInfo == null && !ChatObject.isChannel(currentChat)) || currentUser != null) && !availableReacts.isEmpty(); + boolean showMessageSeen = !isReactionsViewAvailable && !isInScheduleMode() && currentChat != null && message.isOutOwner() && message.isSent() && !message.isEditing() && !message.isSending() && !message.isSendError() && !message.isContentUnread() && !message.isUnread() && (ConnectionsManager.getInstance(currentAccount).getCurrentTime() - message.messageOwner.date < getMessagesController().chatReadMarkExpirePeriod) && (ChatObject.isMegagroup(currentChat) || !ChatObject.isChannel(currentChat)) && chatInfo != null && chatInfo.participants_count < getMessagesController().chatReadMarkSizeThreshold && !(message.messageOwner.action instanceof TLRPC.TL_messageActionChatJoinedByRequest) && (v instanceof ChatMessageCell); + + int flags = 0; + if (isReactionsViewAvailable || showMessageSeen) { + flags |= ActionBarPopupWindow.ActionBarPopupWindowLayout.FLAG_USE_SWIPEBACK; + } + + final AtomicBoolean waitForLangDetection = new AtomicBoolean(false); + final AtomicReference onLangDetectionDone = new AtomicReference(null); + + ActionBarPopupWindow.ActionBarPopupWindowLayout popupLayout = new ActionBarPopupWindow.ActionBarPopupWindowLayout(getParentActivity(), R.drawable.popup_fixed_alert, themeDelegate, flags); popupLayout.setMinimumWidth(AndroidUtilities.dp(200)); Rect backgroundPaddings = new Rect(); Drawable shadowDrawable = getParentActivity().getResources().getDrawable(R.drawable.popup_fixed_alert).mutate(); shadowDrawable.getPadding(backgroundPaddings); popupLayout.setBackgroundColor(getThemedColor(Theme.key_actionBarDefaultSubmenuBackground)); + if (isReactionsViewAvailable) { + ReactedHeaderView reactedView = new ReactedHeaderView(contentView.getContext(), currentAccount, message, dialog_id); + + int count = 0; + if (message.messageOwner.reactions != null) { + for (TLRPC.TL_reactionCount r : message.messageOwner.reactions.results) { + count += r.count; + } + } + boolean hasHeader = count > 10; + LinearLayout linearLayout = new LinearLayout(contentView.getContext()) { + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + int size = MeasureSpec.getSize(widthMeasureSpec); + if (size < AndroidUtilities.dp(240)) { + size = AndroidUtilities.dp(240); + } + super.onMeasure(MeasureSpec.makeMeasureSpec(size, MeasureSpec.EXACTLY), heightMeasureSpec); + } + }; + linearLayout.setOrientation(LinearLayout.VERTICAL); + linearLayout.setLayoutParams(new FrameLayout.LayoutParams(AndroidUtilities.dp(200), AndroidUtilities.dp(6 * 48 + (hasHeader ? 44 * 2 + 8 : 44)) + (!hasHeader ? 1 : 0))); + ActionBarMenuSubItem backCell = new ActionBarMenuSubItem(getParentActivity(), true, true, themeDelegate); + backCell.setItemHeight(44); + backCell.setTextAndIcon(LocaleController.getString("Back", R.string.Back), R.drawable.msg_arrow_back); + backCell.getTextView().setPadding(LocaleController.isRTL ? 0 : AndroidUtilities.dp(40), 0, LocaleController.isRTL ? AndroidUtilities.dp(40) : 0, 0); + backCell.setOnClickListener(v1 -> popupLayout.getSwipeBack().closeForeground()); + linearLayout.addView(backCell, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); + + int[] foregroundIndex = new int[1]; + + if (hasHeader) { + List counters = message.messageOwner.reactions.results; + LinearLayout tabsView = new LinearLayout(contentView.getContext()); + tabsView.setOrientation(LinearLayout.HORIZONTAL); + ViewPager pager = new ViewPager(contentView.getContext()); + HorizontalScrollView tabsScrollView = new HorizontalScrollView(contentView.getContext()); + + AtomicBoolean suppressTabsScroll = new AtomicBoolean(); + int size = counters.size() + 1; + for (int i = 0; i < size; i++) { + ReactionTabHolderView hv = new ReactionTabHolderView(contentView.getContext()); + if (i == 0) { + hv.setCounter(count); + } else hv.setCounter(currentAccount, counters.get(i - 1)); + int finalI = i; + hv.setOnClickListener(v1 -> { + int from = pager.getCurrentItem(); + if (finalI == from) return; + + ReactionTabHolderView fv = (ReactionTabHolderView) tabsView.getChildAt(from); + suppressTabsScroll.set(true); + pager.setCurrentItem(finalI, true); + float fSX = tabsScrollView.getScrollX(), tSX = hv.getX() - (tabsScrollView.getWidth() - hv.getWidth()) / 2f; + ValueAnimator a = ValueAnimator.ofFloat(0, 1).setDuration(150); + a.setInterpolator(CubicBezierInterpolator.DEFAULT); + a.addUpdateListener(animation -> { + float f = (float) animation.getAnimatedValue(); + tabsScrollView.setScrollX((int) (fSX + (tSX - fSX) * f)); + fv.setOutlineProgress(1f - f); + hv.setOutlineProgress(f); + }); + a.start(); + }); + tabsView.addView(hv, LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, Gravity.CENTER_VERTICAL, i == 0 ? 6 : 0, 6, 6, 6)); + } + tabsScrollView.setHorizontalScrollBarEnabled(false); + tabsScrollView.addView(tabsView); + linearLayout.addView(tabsScrollView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 44)); + + View divider = new FrameLayout(contentView.getContext()); + divider.setBackgroundColor(Theme.getColor(Theme.key_graySection)); + linearLayout.addView(divider, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (int) Theme.dividerPaint.getStrokeWidth())); + + int head = AndroidUtilities.dp(44 * 2) + 1; + SparseArray cachedViews = new SparseArray<>(); + SparseIntArray cachedHeights = new SparseIntArray(); + for (int i = 0; i < counters.size() + 1; i++) + cachedHeights.put(i, head + AndroidUtilities.dp(ReactedUsersListView.ITEM_HEIGHT_DP * ReactedUsersListView.VISIBLE_ITEMS)); + pager.setAdapter(new PagerAdapter() { + @Override + public int getCount() { + return counters.size() + 1; + } + + @Override + public boolean isViewFromObject(View view, Object object) { + return view == object; + } + + @Override + public Object instantiateItem(ViewGroup container, int position) { + View cached = cachedViews.get(position); + if (cached != null) { + container.addView(cached); + return cached; + } + ReactedUsersListView v = new ReactedUsersListView(container.getContext(), themeDelegate, currentAccount, message, position == 0 ? null : counters.get(position - 1), true) + .setSeenUsers(reactedView.getSeenUsers()) + .setOnProfileSelectedListener((view, userId) -> { + Bundle args = new Bundle(); + args.putLong("user_id", userId); + ProfileActivity fragment = new ProfileActivity(args); + presentFragment(fragment); + if (scrimPopupWindow != null) { + scrimPopupWindow.dismiss(); + } + }).setOnHeightChangedListener((view, newHeight) -> { + cachedHeights.put(position, head + newHeight); + if (pager.getCurrentItem() == position) + popupLayout.getSwipeBack().setNewForegroundHeight(foregroundIndex[0], head + newHeight); + }); + if (position == 0) + reactedView.setSeenCallback(v::setSeenUsers); + + container.addView(v); + cachedViews.put(position, v); + return v; + } + + @Override + public void destroyItem(ViewGroup container, int position, Object object) { + container.removeView((View) object); + } + }); + pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { + if (!suppressTabsScroll.get()) { + float fX = -1, tX = -1; + for (int i = 0; i < tabsView.getChildCount(); i++) { + ReactionTabHolderView ch = (ReactionTabHolderView) tabsView.getChildAt(i); + ch.setOutlineProgress(i == position ? 1f - positionOffset : i == (position + 1) % size ? positionOffset : 0); + if (i == position) { + fX = ch.getX() - (tabsScrollView.getWidth() - ch.getWidth()) / 2f; + } + if (i == position + 1) { + tX = ch.getX() - (tabsScrollView.getWidth() - ch.getWidth()) / 2f; + } + } + + if (fX != -1 && tX != -1) + tabsScrollView.setScrollX((int) (fX + (tX - fX) * positionOffset)); + } + } + + @Override + public void onPageSelected(int position) { + int h = cachedHeights.get(position); + popupLayout.getSwipeBack().setNewForegroundHeight(foregroundIndex[0], h); + } + + @Override + public void onPageScrollStateChanged(int state) { + if (state == ViewPager.SCROLL_STATE_IDLE) { + suppressTabsScroll.set(false); + } + } + }); + linearLayout.addView(pager, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 0, 1f)); + } else { + View gap = new FrameLayout(contentView.getContext()); + gap.setBackgroundColor(Theme.getColor(Theme.key_graySection)); + linearLayout.addView(gap, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 8)); + + ReactedUsersListView lv = new ReactedUsersListView(contentView.getContext(), themeDelegate, currentAccount, message, null, true) + .setSeenUsers(reactedView.getSeenUsers()) + .setOnProfileSelectedListener((view, userId) -> { + Bundle args = new Bundle(); + args.putLong("user_id", userId); + ProfileActivity fragment = new ProfileActivity(args); + presentFragment(fragment); + if (scrimPopupWindow != null) { + scrimPopupWindow.dismiss(); + } + }).setOnHeightChangedListener((view, newHeight) -> popupLayout.getSwipeBack().setNewForegroundHeight(foregroundIndex[0], AndroidUtilities.dp(44 + 8) + newHeight)); + reactedView.setSeenCallback(lv::setSeenUsers); + linearLayout.addView(lv, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 0, 1f)); + } + + foregroundIndex[0] = popupLayout.addViewToSwipeBack(linearLayout); + + reactedView.setOnClickListener(v1 -> { + popupLayout.getSwipeBack().openForeground(foregroundIndex[0]); + }); + popupLayout.addView(reactedView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 48)); + + View gap = new FrameLayout(contentView.getContext()); + gap.setBackgroundColor(Theme.getColor(Theme.key_graySection)); + popupLayout.addView(gap, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 8)); + } + + MessageSeenView messageSeenView = null; + if (showMessageSeen) { + messageSeenView = new MessageSeenView(contentView.getContext(), currentAccount, message, currentChat); + FrameLayout messageSeenLayout = new FrameLayout(contentView.getContext()); + messageSeenLayout.addView(messageSeenView); + MessageSeenView finalMessageSeenView = messageSeenView; + + ActionBarMenuSubItem cell = new ActionBarMenuSubItem(getParentActivity(), true, true, themeDelegate); + cell.setItemHeight(44); + cell.setTextAndIcon(LocaleController.getString("Back", R.string.Back), R.drawable.msg_arrow_back); + cell.getTextView().setPadding(LocaleController.isRTL ? 0 : AndroidUtilities.dp(40), 0, LocaleController.isRTL ? AndroidUtilities.dp(40) : 0, 0); + + FrameLayout backContainer = new FrameLayout(contentView.getContext()); + + LinearLayout linearLayout = new LinearLayout(contentView.getContext()); + linearLayout.setBackgroundColor(getThemedColor(Theme.key_actionBarDefaultSubmenuBackground)); + linearLayout.setOrientation(LinearLayout.VERTICAL); + RecyclerListView listView2 = finalMessageSeenView.createListView(); + backContainer.addView(cell); + linearLayout.addView(backContainer); + backContainer.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + popupLayout.getSwipeBack().closeForeground(); + } + }); + + int[] foregroundIndex = new int[1]; + messageSeenView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (scrimPopupWindow == null || finalMessageSeenView.users.isEmpty()) { + return; + } + if (finalMessageSeenView.users.size() == 1) { + TLRPC.User user = finalMessageSeenView.users.get(0); + if (user == null) { + return; + } + Bundle args = new Bundle(); + args.putLong("user_id", user.id); + ProfileActivity fragment = new ProfileActivity(args); + presentFragment(fragment); + if (scrimPopupWindow != null) { + scrimPopupWindow.dismiss(); + } + return; + } + + int totalHeight = contentView.getHeightWithKeyboard(); + int availableHeight = totalHeight - scrimPopupY - AndroidUtilities.dp(46 + 16) - (isReactionsAvailable ? AndroidUtilities.dp(52) : 0); + + if (SharedConfig.messageSeenHintCount > 0 && contentView.getKeyboardHeight() < AndroidUtilities.dp(20)) { + availableHeight -= AndroidUtilities.dp(52); + Bulletin bulletin = BulletinFactory.of(ChatActivity.this).createErrorBulletin(AndroidUtilities.replaceTags(LocaleController.getString("MessageSeenTooltipMessage", R.string.MessageSeenTooltipMessage))); + bulletin.tag = 1; + bulletin.setDuration(4000); + bulletin.show(); + SharedConfig.updateMessageSeenHintCount(SharedConfig.messageSeenHintCount - 1); + } else if (contentView.getKeyboardHeight() > AndroidUtilities.dp(20)) { + availableHeight -=contentView.getKeyboardHeight() / 3f; + } + + int listViewTotalHeight = AndroidUtilities.dp(8) + AndroidUtilities.dp(44) * listView2.getAdapter().getItemCount(); + + if (listViewTotalHeight > availableHeight) { + if (availableHeight > AndroidUtilities.dp(620)) { + listView2.getLayoutParams().height = AndroidUtilities.dp(620); + } else { + listView2.getLayoutParams().height = availableHeight; + } + } else { + listView2.getLayoutParams().height = listViewTotalHeight; + } + linearLayout.getLayoutParams().height = AndroidUtilities.dp(44) + listView2.getLayoutParams().height; + listView2.requestLayout(); + linearLayout.requestLayout(); + listView2.getAdapter().notifyDataSetChanged(); + popupLayout.getSwipeBack().openForeground(foregroundIndex[0]); + } + }); + linearLayout.addView(listView2, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 320)); + + listView2.setOnItemClickListener((view1, position) -> { + TLRPC.User user = finalMessageSeenView.users.get(position); + if (user == null) { + return; + } + Bundle args = new Bundle(); + args.putLong("user_id", user.id); + ProfileActivity fragment = new ProfileActivity(args); + presentFragment(fragment); + }); + + foregroundIndex[0] = popupLayout.addViewToSwipeBack(linearLayout); + + popupLayout.addView(messageSeenLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 44)); + + View gap = new FrameLayout(contentView.getContext()); + gap.setBackgroundColor(Theme.getColor(Theme.key_graySection)); + popupLayout.addView(gap, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 8)); + } + + if (popupLayout.getSwipeBack() != null) { + popupLayout.getSwipeBack().setOnClickListener(v1 -> { + if (scrimPopupWindow != null) { + scrimPopupWindow.dismiss(); + scrimPopupWindow = null; + menuDeleteItem = null; + scrimPopupWindowItems = null; + } + }); + } + scrimPopupWindowItems = new ActionBarMenuSubItem[items.size() + (selectedObject.isSponsored() ? 1 : 0)]; for (int a = 0, N = items.size(); a < N; a++) { if (a == 0 && selectedObject.isSponsored()) { @@ -20379,9 +20872,73 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not scrimPopupWindow.dismiss(); } }); + if (option == 29) { + // "Translate" button + String toLang = LocaleController.getInstance().getCurrentLocale().getLanguage(); + final CharSequence finalMessageText = messageText; + if (LanguageDetector.hasSupport()) { + final String[] fromLang = { null }; + cell.setVisibility(View.GONE); + waitForLangDetection.set(true); + LanguageDetector.detectLanguage( + finalMessageText.toString(), + (String lang) -> { + fromLang[0] = lang; + if (fromLang[0] != null && (!fromLang[0].equals(toLang) || fromLang[0].equals("und")) && + !RestrictedLanguagesSelectActivity.getRestrictedLanguages().contains(fromLang[0])) { + cell.setVisibility(View.VISIBLE); + } + waitForLangDetection.set(false); + if (onLangDetectionDone.get() != null) { + onLangDetectionDone.get().run(); + onLangDetectionDone.set(null); + } + }, + (Exception e) -> { + FileLog.e(e); + waitForLangDetection.set(false); + if (onLangDetectionDone.get() != null) { + onLangDetectionDone.get().run(); + onLangDetectionDone.set(null); + } + } + ); + cell.setOnClickListener(e -> { + if (selectedObject == null || i >= options.size()) { + return; + } + TranslateAlert.showAlert(getParentActivity(), this, fromLang[0], toLang, finalMessageText, currentChat.noforwards); + scrimView = null; + contentView.invalidate(); + chatListView.invalidate(); + if (scrimPopupWindow != null) { + scrimPopupWindow.dismiss(); + } + }); + cell.postDelayed(() -> { + if (onLangDetectionDone.get() != null) { + onLangDetectionDone.get().run(); + onLangDetectionDone.set(null); + } + }, 250); + } else { + cell.setOnClickListener(e -> { + if (selectedObject == null || i >= options.size()) { + return; + } + TranslateAlert.showAlert(getParentActivity(), this, "und", toLang, finalMessageText, currentChat.noforwards); + scrimView = null; + contentView.invalidate(); + chatListView.invalidate(); + if (scrimPopupWindow != null) { + scrimPopupWindow.dismiss(); + } + }); + } + } } - LinearLayout scrimPopupContainerLayout = new LinearLayout(contentView.getContext()) { + ChatScrimPopupContainerLayout scrimPopupContainerLayout = new ChatScrimPopupContainerLayout(contentView.getContext()) { @Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0 && scrimPopupWindow != null && scrimPopupWindow.isShowing()) { @@ -20413,181 +20970,58 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not return false; } }); - scrimPopupContainerLayout.setOrientation(LinearLayout.VERTICAL); - boolean showMessageSeen = !isInScheduleMode() && currentChat != null && message.isOutOwner() && message.isSent() && !message.isEditing() && !message.isSending() && !message.isSendError() && !message.isContentUnread() && !message.isUnread() && (ConnectionsManager.getInstance(currentAccount).getCurrentTime() - message.messageOwner.date < 7 * 86400) && (ChatObject.isMegagroup(currentChat) || !ChatObject.isChannel(currentChat)) && chatInfo != null && chatInfo.participants_count < 50 && !(message.messageOwner.action instanceof TLRPC.TL_messageActionChatJoinedByRequest) && (v instanceof ChatMessageCell); - boolean showNoForwards = getMessagesController().isChatNoForwards(currentChat) && message.messageOwner.action == null && message.isSent() && !message.isEditing() && chatMode != MODE_SCHEDULED; - MessageSeenView messageSeenView = null; - if (showMessageSeen) { - messageSeenView = new MessageSeenView(contentView.getContext(), currentAccount, message, currentChat); - Drawable shadowDrawable2 = ContextCompat.getDrawable(contentView.getContext(), R.drawable.popup_fixed_alert).mutate(); - shadowDrawable2.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground), PorterDuff.Mode.MULTIPLY)); - FrameLayout messageSeenLayout = new FrameLayout(contentView.getContext()); - messageSeenLayout.addView(messageSeenView); - messageSeenLayout.setBackground(shadowDrawable2); - MessageSeenView finalMessageSeenView = messageSeenView; - messageSeenView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (scrimPopupWindow == null || finalMessageSeenView.users.isEmpty()) { - return; + + ReactionsContainerLayout reactionsLayout = new ReactionsContainerLayout(contentView.getContext(), getResourceProvider()); + if (isReactionsAvailable) { + int pad = 22; + int sPad = 24; + reactionsLayout.setPadding(AndroidUtilities.dp(4) + (LocaleController.isRTL ? 0 : sPad), AndroidUtilities.dp(4), AndroidUtilities.dp(4) + (LocaleController.isRTL ? sPad : 0), AndroidUtilities.dp(pad)); + List l; + if (chatInfo != null) { + l = new ArrayList<>(chatInfo.available_reactions.size()); + for (String s : chatInfo.available_reactions) { + for (TLRPC.TL_availableReaction a : getMediaDataController().getEnabledReactionsList()) { + if (a.reaction.equals(s)) { + l.add(a); + break; + } } - int totalHeight = contentView.getHeightWithKeyboard(); - int availableHeight = totalHeight - scrimPopupY - AndroidUtilities.dp(46 + 16); - - if (SharedConfig.messageSeenHintCount > 0 && contentView.getKeyboardHeight() < AndroidUtilities.dp(20)) { - availableHeight -= AndroidUtilities.dp(52); - Bulletin bulletin = BulletinFactory.of(ChatActivity.this).createErrorBulletin(AndroidUtilities.replaceTags(LocaleController.getString("MessageSeenTooltipMessage", R.string.MessageSeenTooltipMessage))); - bulletin.tag = 1; - bulletin.setDuration(4000); - bulletin.show(); - SharedConfig.updateMessageSeenHintCount(SharedConfig.messageSeenHintCount - 1); - } else if (contentView.getKeyboardHeight() > AndroidUtilities.dp(20)) { - availableHeight -=contentView.getKeyboardHeight() / 3f; - } - View previousPopupContentView = scrimPopupWindow.getContentView(); - - ActionBarMenuSubItem cell = new ActionBarMenuSubItem(getParentActivity(), true, true, themeDelegate); - cell.setItemHeight(44); - cell.setTextAndIcon(LocaleController.getString("Back", R.string.Back), R.drawable.msg_arrow_back); - cell.getTextView().setPadding(LocaleController.isRTL ? 0 : AndroidUtilities.dp(40), 0, LocaleController.isRTL ? AndroidUtilities.dp(40) : 0, 0); - - Drawable shadowDrawable2 = ContextCompat.getDrawable(contentView.getContext(), R.drawable.popup_fixed_alert).mutate(); - shadowDrawable2.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground), PorterDuff.Mode.MULTIPLY)); - FrameLayout backContainer = new FrameLayout(contentView.getContext()); - backContainer.setBackground(shadowDrawable2); - - LinearLayout linearLayout = new LinearLayout(contentView.getContext()) { - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(260), MeasureSpec.AT_MOST), heightMeasureSpec); - setPivotX(getMeasuredWidth() - AndroidUtilities.dp(8)); - setPivotY(AndroidUtilities.dp(8)); - } - - @Override - public boolean dispatchKeyEvent(KeyEvent event) { - if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0 && scrimPopupWindow != null && scrimPopupWindow.isShowing()) { - if (mesageSeenUsersPopupWindow != null) { - mesageSeenUsersPopupWindow.dismiss(); - } - } - return super.dispatchKeyEvent(event); - } - }; - linearLayout.setOnTouchListener(new View.OnTouchListener() { - - private int[] pos = new int[2]; - - @Override - public boolean onTouch(View v, MotionEvent event) { - if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { - if (mesageSeenUsersPopupWindow != null && mesageSeenUsersPopupWindow.isShowing()) { - View contentView = mesageSeenUsersPopupWindow.getContentView(); - contentView.getLocationInWindow(pos); - rect.set(pos[0], pos[1], pos[0] + contentView.getMeasuredWidth(), pos[1] + contentView.getMeasuredHeight()); - if (!rect.contains((int) event.getX(), (int) event.getY())) { - mesageSeenUsersPopupWindow.dismiss(); - } - } - } else if (event.getActionMasked() == MotionEvent.ACTION_OUTSIDE) { - if (mesageSeenUsersPopupWindow != null && mesageSeenUsersPopupWindow.isShowing()) { - mesageSeenUsersPopupWindow.dismiss(); - } - } - return false; - } - }); - linearLayout.setOrientation(LinearLayout.VERTICAL); - RecyclerListView listView = finalMessageSeenView.createListView(); - int listViewTotalHeight = AndroidUtilities.dp(8) + AndroidUtilities.dp(44) * listView.getAdapter().getItemCount() + AndroidUtilities.dp(16); - - backContainer.addView(cell); - linearLayout.addView(backContainer); - linearLayout.addView(listView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 320, 0, -8, 0, 0)); - - if (listViewTotalHeight > availableHeight) { - if (availableHeight > AndroidUtilities.dp(620)) { - listView.getLayoutParams().height = AndroidUtilities.dp(620); - } else { - listView.getLayoutParams().height = availableHeight; - } - } else { - listView.getLayoutParams().height = listViewTotalHeight; - } - - Drawable shadowDrawable3 = ContextCompat.getDrawable(contentView.getContext(), R.drawable.popup_fixed_alert).mutate(); - shadowDrawable3.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground), PorterDuff.Mode.MULTIPLY)); - listView.setBackground(shadowDrawable3); - boolean[] backButtonPressed = new boolean[1]; - - mesageSeenUsersPopupWindow = new ActionBarPopupWindow(linearLayout, LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT) { - @Override - public void dismiss(boolean animated) { - super.dismiss(animated); - if (backButtonPressed[0]) { - linearLayout.animate().alpha(0).scaleX(0).scaleY(0).setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT).setDuration(350); - previousPopupContentView.animate().alpha(1f).scaleX(1).scaleY(1).setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT).setDuration(350); - } else { - if (scrimPopupWindow != null) { - scrimPopupWindow.dismiss(); - - contentView.invalidate(); - chatListView.invalidate(); - } - } - if (Bulletin.getVisibleBulletin() != null && Bulletin.getVisibleBulletin().tag == 1) { - Bulletin.getVisibleBulletin().hide(); - } - mesageSeenUsersPopupWindow = null; - } - }; - mesageSeenUsersPopupWindow.setOutsideTouchable(true); - mesageSeenUsersPopupWindow.setClippingEnabled(true); - mesageSeenUsersPopupWindow.setFocusable(true); - mesageSeenUsersPopupWindow.setInputMethodMode(ActionBarPopupWindow.INPUT_METHOD_NOT_NEEDED); - mesageSeenUsersPopupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED); - mesageSeenUsersPopupWindow.getContentView().setFocusableInTouchMode(true); - - mesageSeenUsersPopupWindow.showAtLocation(chatListView, Gravity.LEFT | Gravity.TOP, scrimPopupX, scrimPopupY); - previousPopupContentView.setPivotX(AndroidUtilities.dp(8)); - previousPopupContentView.setPivotY(AndroidUtilities.dp(8)); - previousPopupContentView.animate().alpha(0).scaleX(0f).scaleY(0f).setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT).setDuration(350); - - linearLayout.setAlpha(0f); - linearLayout.setScaleX(0f); - linearLayout.setScaleY(0f); - linearLayout.animate().alpha(1f).scaleX(1f).scaleY(1f).setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT).setDuration(350); - - backContainer.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (mesageSeenUsersPopupWindow != null) { - mesageSeenUsersPopupWindow.setEmptyOutAnimation(250); - backButtonPressed[0] = true; - mesageSeenUsersPopupWindow.dismiss(true); - } - } - }); - - listView.setOnItemClickListener((view1, position) -> { - TLRPC.User user = finalMessageSeenView.users.get(position); - if (user == null) { - return; - } - Bundle args = new Bundle(); - args.putLong("user_id", user.id); - ProfileActivity fragment = new ProfileActivity(args); - presentFragment(fragment); - if (mesageSeenUsersPopupWindow != null) { - mesageSeenUsersPopupWindow.dismiss(); - } - }); } + } else { + l = getMediaDataController().getEnabledReactionsList(); + } + reactionsLayout.setReactionsList(l); + reactionsLayout.setDelegate((rView, reaction) -> { + selectReaction(primaryMessage, reactionsLayout, 0, 0, reaction, false); }); - scrimPopupContainerLayout.addView(messageSeenLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 60)); - } - scrimPopupContainerLayout.addView(popupLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 0, showMessageSeen ? -8 : 0, 0, showNoForwards ? -8 : 0)); + LinearLayout.LayoutParams params = LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 52 + pad, Gravity.RIGHT, 0, 0, 0, -20); + int size = params.height - reactionsLayout.getPaddingTop() - reactionsLayout.getPaddingBottom(); + if (size * l.size() < AndroidUtilities.dp(200)) + params.width = ViewGroup.LayoutParams.WRAP_CONTENT; + scrimPopupContainerLayout.addView(reactionsLayout, params); + scrimPopupContainerLayout.reactionsLayout = reactionsLayout; + + reactionsLayout.setTransitionProgress(0); + if (popupLayout.getSwipeBack() != null) { + popupLayout.getSwipeBack().setOnSwipeBackProgressListener((layout, toProgress, progress) -> { + if (toProgress == 0) { + reactionsLayout.setTransitionProgress(0); + reactionsLayout.setAlpha(1f); + new SpringAnimation(reactionsLayout, ReactionsContainerLayout.TRANSITION_PROGRESS_VALUE) + .setSpring(new SpringForce().setFinalPosition(100) + .setStiffness(240) + .setDampingRatio(0.7f)) + .start(); + } else if (toProgress == 1) + reactionsLayout.setAlpha(1f - progress); + }); + } + } + + boolean showNoForwards = getMessagesController().isChatNoForwards(currentChat) && message.messageOwner.action == null && message.isSent() && !message.isEditing() && chatMode != MODE_SCHEDULED; + scrimPopupContainerLayout.addView(popupLayout, LayoutHelper.createLinearRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START, isReactionsAvailable ? 16 : 0, 0, isReactionsAvailable ? 36 : 0, 0)); + scrimPopupContainerLayout.popupWindowLayout = popupLayout; if (showNoForwards) { popupLayout.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)); boolean isChannel = ChatObject.isChannel(currentChat) && !currentChat.megagroup; @@ -20649,9 +21083,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (chatActivityEnterView != null) { chatActivityEnterView.getEditField().setAllowDrawCursor(true); } - if (mesageSeenUsersPopupWindow != null) { - mesageSeenUsersPopupWindow.dismiss(); - } } }; scrimPopupWindow.setPauseNotifications(true); @@ -20667,7 +21098,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not popupLayout.setFitItems(true); if (messageSeenView != null) { - messageSeenView.getLayoutParams().width = scrimPopupContainerLayout.getMeasuredWidth() - AndroidUtilities.dp(16); + messageSeenView.getLayoutParams().width = scrimPopupContainerLayout.getMeasuredWidth() - (isReactionsAvailable ? AndroidUtilities.dp(56) : 0) - AndroidUtilities.dp(16); } int popupX = v.getLeft() + (int) x - scrimPopupContainerLayout.getMeasuredWidth() + backgroundPaddings.left - AndroidUtilities.dp(28); if (popupX < AndroidUtilities.dp(6)) { @@ -20701,6 +21132,22 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not popupY = inBubbleMode ? 0 : AndroidUtilities.statusBarHeight; } scrimPopupWindow.showAtLocation(chatListView, Gravity.LEFT | Gravity.TOP, scrimPopupX = popupX, scrimPopupY = popupY); + if (isReactionsAvailable) { + reactionsLayout.setTransitionProgress(0); + new SpringAnimation(reactionsLayout, ReactionsContainerLayout.TRANSITION_PROGRESS_VALUE) + .setSpring(new SpringForce().setFinalPosition(100) + .setStiffness(240) + .setDampingRatio(0.7f)) + .start(); + } + final int finalPopupX = scrimPopupX = popupX; + final int finalPopupY = scrimPopupY = popupY; + Runnable showMenu = () -> scrimPopupWindow.showAtLocation(chatListView, Gravity.LEFT | Gravity.TOP, finalPopupX, finalPopupY); + if (waitForLangDetection.get()) { + onLangDetectionDone.set(showMenu); + } else { + showMenu.run(); + } chatListView.stopScroll(); chatLayoutManager.setCanScrollVertically(false); scrimView = v; @@ -20801,6 +21248,91 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } + Runnable updateReactionRunnable; + private void selectReaction(MessageObject primaryMessage, ReactionsContainerLayout reactionsLayout, float x, float y, TLRPC.TL_availableReaction reaction, boolean fromDoubleTap) { + ReactionsEffectOverlay.removeCurrent(false); + boolean added = primaryMessage.selectReaction(reaction.reaction, fromDoubleTap); + int messageIdForCell = primaryMessage.getId(); + if (groupedMessagesMap.get(primaryMessage.getGroupId()) != null) { + MessageObject messageObject = groupedMessagesMap.get(primaryMessage.getGroupId()).findMessageWithFlags(MessageObject.POSITION_FLAG_BOTTOM | MessageObject.POSITION_FLAG_LEFT); + if (messageObject != null) { + messageIdForCell = messageObject.getId(); + } + } + + int finalMessageIdForCell = messageIdForCell; + + if (added && !fromDoubleTap) { + ChatMessageCell cell = findMessageCell(finalMessageIdForCell); + ReactionsEffectOverlay.show(ChatActivity.this, reactionsLayout, cell, x, y, reaction.reaction, currentAccount); + } + getSendMessagesHelper().sendReaction(primaryMessage, added ? reaction.reaction : null, ChatActivity.this, updateReactionRunnable = new Runnable() { + @Override + public void run() { + if (updateReactionRunnable != null) { + updateReactionRunnable = null; + if (fromDoubleTap) { + doOnIdle(() -> { + AndroidUtilities.runOnUIThread(() -> { + ChatMessageCell cell = findMessageCell(finalMessageIdForCell); + if (added) { + ReactionsEffectOverlay.show(ChatActivity.this, reactionsLayout, cell, x, y, reaction.reaction, currentAccount); + ReactionsEffectOverlay.startAnimation(); + } + }, 50); + }); + } else { + updateMessageAnimated(primaryMessage); + ReactionsEffectOverlay.startAnimation(); + } + + if (scrimPopupWindow != null) { + scrimPopupWindow.dismiss(); + } + } + } + }); + //updateReactionRunnable.run(); + + if (fromDoubleTap) { + updateMessageAnimated(primaryMessage); + updateReactionRunnable.run(); + } + AndroidUtilities.runOnUIThread(updateReactionRunnable, 50); + + + } + + @SuppressLint("NotifyDataSetChanged") + private void updateMessageAnimated(MessageObject message) { + if (chatAdapter == null) { + return; + } + getNotificationCenter().doOnIdle(() -> { + MessageObject.GroupedMessages group = groupedMessagesMap.get(message.getGroupId()); + if (group != null) { + if (chatListItemAnimator != null) { + chatListItemAnimator.groupWillChanged(group); + } + for (int i = 0; i < group.messages.size(); i++) { + group.messages.get(i).forceUpdate = true; + } + chatAdapter.notifyDataSetChanged(true); + } else { + chatAdapter.notifyItemChanged(chatAdapter.messagesStartRow + messages.indexOf(message)); + } + }); + } + + public ChatMessageCell findMessageCell(int id) { + for (int i = 0, n = chatListView.getChildCount(); i < n; i++) { + if (chatListView.getChildAt(i) instanceof ChatMessageCell && ((ChatMessageCell) chatListView.getChildAt(i)).getMessageObject().getId() == id) { + return (ChatMessageCell) chatListView.getChildAt(i); + } + } + return null; + } + private void startEditingMessageObject(MessageObject messageObject) { if (messageObject == null || getParentActivity() == null) { return; @@ -21841,9 +22373,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } else { cell.setHighlightedText(null); } + cell.setSpoilersSuppressed(chatListView.getScrollState() != RecyclerView.SCROLL_STATE_IDLE); } else if (view instanceof ChatActionCell) { ChatActionCell cell = (ChatActionCell) view; cell.setMessageObject(cell.getMessageObject()); + cell.setSpoilersSuppressed(chatListView.getScrollState() != RecyclerView.SCROLL_STATE_IDLE); } } if (lastVisibleItem != RecyclerView.NO_POSITION) { @@ -22154,6 +22688,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not originalMessage.messageOwner.replies.replies = chatActivity.threadMessageObject.messageOwner.replies.replies; } presentFragment(chatActivity); + if (isKeyboardVisible() && !chatActivity.hideKeyboardOnShow()) { + chatActivity.chatActivityEnterView.getEditField().requestFocus(); + } chatOpened = true; if (history != null) { int fnid = 0; @@ -22831,7 +23368,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not chatListView.setImportantForAccessibility(mentionContainer.getVisibility() == View.VISIBLE || (scrimPopupWindow != null && scrimPopupWindow.isShowing()) ? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : View.IMPORTANT_FOR_ACCESSIBILITY_AUTO); } } - + private void markSponsoredAsRead(MessageObject object) { if (!object.isSponsored() || object.viewsReloaded) { return; @@ -23301,15 +23838,197 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (getParentActivity() == null || bottomOverlayChat.getVisibility() == View.VISIBLE && !(button instanceof TLRPC.TL_keyboardButtonSwitchInline) && !(button instanceof TLRPC.TL_keyboardButtonCallback) && !(button instanceof TLRPC.TL_keyboardButtonGame) && !(button instanceof TLRPC.TL_keyboardButtonUrl) && - !(button instanceof TLRPC.TL_keyboardButtonBuy) && !(button instanceof TLRPC.TL_keyboardButtonUrlAuth)) { + !(button instanceof TLRPC.TL_keyboardButtonBuy) && !(button instanceof TLRPC.TL_keyboardButtonUrlAuth) && + !(button instanceof TLRPC.TL_keyboardButtonUserProfile)) { return; } chatActivityEnterView.didPressedBotButton(button, cell.getMessageObject(), cell.getMessageObject()); } @Override - public void didPressReaction(ChatMessageCell cell, TLRPC.TL_reactionCount reaction) { - getSendMessagesHelper().sendReaction(cell.getMessageObject(), reaction.reaction, ChatActivity.this); + public void didPressReaction(ChatMessageCell cell, TLRPC.TL_reactionCount reaction, boolean longpress) { + if (longpress) { + if (!ChatObject.isChannelAndNotMegaGroup(currentChat)) { + cell.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); + FrameLayout scrimPopupContainerLayout = new FrameLayout(getParentActivity()) { + @Override + public boolean dispatchKeyEvent(KeyEvent event) { + if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0 && scrimPopupWindow != null && scrimPopupWindow.isShowing()) { + scrimPopupWindow.dismiss(); + } + return super.dispatchKeyEvent(event); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + int h = Math.min(MeasureSpec.getSize(heightMeasureSpec), AndroidUtilities.dp(ReactedUsersListView.VISIBLE_ITEMS * ReactedUsersListView.ITEM_HEIGHT_DP)); + if (h == 0) { + h = AndroidUtilities.dp(ReactedUsersListView.VISIBLE_ITEMS * ReactedUsersListView.ITEM_HEIGHT_DP); + } + + super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(h, MeasureSpec.AT_MOST)); + } + }; + scrimPopupContainerLayout.setLayoutParams(LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT)); + + Rect backgroundPaddings = new Rect(); + Drawable shadowDrawable2 = ContextCompat.getDrawable(getParentActivity(), R.drawable.popup_fixed_alert).mutate(); + shadowDrawable2.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground), PorterDuff.Mode.MULTIPLY)); + shadowDrawable2.getPadding(backgroundPaddings); + scrimPopupContainerLayout.setBackground(shadowDrawable2); + + int totalHeight = contentView.getHeight(); + int height = scrimPopupContainerLayout.getMeasuredHeight(); + int keyboardHeight = contentView.measureKeyboardHeight(); + if (keyboardHeight > AndroidUtilities.dp(20)) { + totalHeight += keyboardHeight; + } + ReactionsLayoutInBubble.ReactionButton button = cell.getReactionButton(reaction.reaction); + if (button == null) { + return; + } + float bottom = cell.reactionsLayoutInBubble.y + button.y + AndroidUtilities.dp(28); + float left = cell.reactionsLayoutInBubble.x + button.x; + int[] loc = new int[2]; + cell.getLocationInWindow(loc); + int finalTotalHeight = totalHeight; + scrimPopupContainerLayout.addView(new ReactedUsersListView(getParentActivity(), themeDelegate, currentAccount, cell.getPrimaryMessageObject(), reaction, false) + .setOnProfileSelectedListener((view1, userId) -> { + Bundle args = new Bundle(); + args.putLong("user_id", userId); + ProfileActivity fragment = new ProfileActivity(args); + presentFragment(fragment); + if (scrimPopupWindow != null) { + scrimPopupWindow.dismiss(); + } + }).setOnHeightChangedListener((view1, newHeight) -> { +// float delta = Math.max(0, loc[1] + bottom - scrimPopupY + backgroundPaddings.top); +// int h = scrimPopupContainerLayout.getHeight(); +// ValueAnimator anim = ValueAnimator.ofFloat(0, 1).setDuration(240); +// anim.setInterpolator(CubicBezierInterpolator.DEFAULT); +// anim.addUpdateListener(animation -> { +// float val = (float) animation.getAnimatedValue(); +// float f = Math.min(delta * val, finalTotalHeight - newHeight); +// scrimPopupContainerLayout.setTranslationY(f); +// scrimPopupWindow.setHeight((int) (h + f)); +// }); +// anim.start(); + }), LayoutHelper.createFrame(200, LayoutHelper.WRAP_CONTENT)); + + scrimPopupWindow = new ActionBarPopupWindow(scrimPopupContainerLayout, LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT) { + @Override + public void dismiss() { + super.dismiss(); + if (scrimPopupWindow != this) { + return; + } + scrimPopupWindow = null; + menuDeleteItem = null; + scrimPopupWindowItems = null; + if (scrimAnimatorSet != null) { + scrimAnimatorSet.cancel(); + scrimAnimatorSet = null; + } + if (scrimView instanceof ChatMessageCell) { + ChatMessageCell cell = (ChatMessageCell) scrimView; + cell.setInvalidatesParent(false); + } + chatLayoutManager.setCanScrollVertically(true); + scrimAnimatorSet = new AnimatorSet(); + ArrayList animators = new ArrayList<>(); + animators.add(ObjectAnimator.ofInt(scrimPaint, AnimationProperties.PAINT_ALPHA, 0)); + if (pagedownButton.getTag() != null) { + animators.add(ObjectAnimator.ofFloat(pagedownButton, View.ALPHA, 1.0f)); + } + if (mentiondownButton.getTag() != null) { + animators.add(ObjectAnimator.ofFloat(mentiondownButton, View.ALPHA, 1.0f)); + } + scrimAnimatorSet.playTogether(animators); + scrimAnimatorSet.setDuration(220); + scrimAnimatorSet.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + scrimView = null; + contentView.invalidate(); + chatListView.invalidate(); + } + }); + scrimAnimatorSet.start(); + if (chatActivityEnterView != null) { + chatActivityEnterView.getEditField().setAllowDrawCursor(true); + } + } + }; + scrimPopupWindow.setPauseNotifications(true); + scrimPopupWindow.setDismissAnimationDuration(220); + scrimPopupWindow.setOutsideTouchable(true); + scrimPopupWindow.setClippingEnabled(true); + scrimPopupWindow.setAnimationStyle(R.style.PopupContextAnimation); + scrimPopupWindow.setFocusable(true); + scrimPopupContainerLayout.measure(View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(1000), View.MeasureSpec.AT_MOST), View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(1000), View.MeasureSpec.AT_MOST)); + scrimPopupWindow.setInputMethodMode(ActionBarPopupWindow.INPUT_METHOD_NOT_NEEDED); + scrimPopupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED); + scrimPopupWindow.getContentView().setFocusableInTouchMode(true); + + int popupX = (int) (left - AndroidUtilities.dp(28)); + popupX = Math.max(AndroidUtilities.dp(6), Math.min(chatListView.getMeasuredWidth() - AndroidUtilities.dp(6) - scrimPopupContainerLayout.getMeasuredWidth(), popupX)); + if (AndroidUtilities.isTablet()) { + int[] location = new int[2]; + fragmentView.getLocationInWindow(location); + popupX += location[0]; + } + int popupY; + if (height < totalHeight) { + popupY = (int) (chatListView.getY() + cell.getY() + cell.getHeight()); + if (height - backgroundPaddings.top - backgroundPaddings.bottom > AndroidUtilities.dp(240)) { + popupY += AndroidUtilities.dp(240) - height; + } + if (popupY < chatListView.getY() + AndroidUtilities.dp(24)) { + popupY = (int) (chatListView.getY() + AndroidUtilities.dp(24)); + } else if (popupY > totalHeight - height - AndroidUtilities.dp(8)) { + popupY = totalHeight - height - AndroidUtilities.dp(8); + } + } else { + popupY = inBubbleMode ? 0 : AndroidUtilities.statusBarHeight; + } + scrimPopupWindow.showAtLocation(chatListView, Gravity.LEFT | Gravity.TOP, scrimPopupX = popupX, scrimPopupY = popupY); + + chatListView.stopScroll(); + chatLayoutManager.setCanScrollVertically(false); + scrimView = cell; + cell.setInvalidatesParent(true); + restartSticker(cell); + contentView.invalidate(); + chatListView.invalidate(); + if (scrimAnimatorSet != null) { + scrimAnimatorSet.cancel(); + } + scrimAnimatorSet = new AnimatorSet(); + ArrayList animators = new ArrayList<>(); + animators.add(ObjectAnimator.ofInt(scrimPaint, AnimationProperties.PAINT_ALPHA, 0, 50)); + if (pagedownButton.getTag() != null) { + animators.add(ObjectAnimator.ofFloat(pagedownButton, View.ALPHA, 0)); + } + if (mentiondownButton.getTag() != null) { + animators.add(ObjectAnimator.ofFloat(mentiondownButton, View.ALPHA, 0)); + } + scrimAnimatorSet.playTogether(animators); + scrimAnimatorSet.setDuration(150); + scrimAnimatorSet.start(); + hideHints(false); + if (topUndoView != null) { + topUndoView.hide(true, 1); + } + if (undoView != null) { + undoView.hide(true, 1); + } + if (chatActivityEnterView != null) { + chatActivityEnterView.getEditField().setAllowDrawCursor(false); + } + } + } else { + selectReaction(cell.getPrimaryMessageObject(), null, 0, 0, getMediaDataController().getReactionsMap().get(reaction.reaction), false); + } } @Override @@ -23549,20 +24268,24 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } else { if (messageObject.isSponsored()) { Bundle args = new Bundle(); - long peerId = MessageObject.getPeerId(messageObject.messageOwner.from_id); - if (peerId < 0) { - args.putLong("chat_id", -peerId); + if (messageObject.sponsoredChatInvite != null) { + showDialog(new JoinGroupAlert(mContext, messageObject.sponsoredChatInvite, messageObject.sponsoredChatInviteHash, ChatActivity.this)); } else { - args.putLong("user_id", peerId); - } - if (messageObject.sponsoredChannelPost != 0) { - args.putInt("message_id", messageObject.sponsoredChannelPost); - } - if (messageObject.botStartParam != null) { - args.putString("inline_query", messageObject.botStartParam); - } - if (getMessagesController().checkCanOpenChat(args, ChatActivity.this)) { - presentFragment(new ChatActivity(args)); + long peerId = MessageObject.getPeerId(messageObject.messageOwner.from_id); + if (peerId < 0) { + args.putLong("chat_id", -peerId); + } else { + args.putLong("user_id", peerId); + } + if (messageObject.sponsoredChannelPost != 0) { + args.putInt("message_id", messageObject.sponsoredChannelPost); + } + if (messageObject.botStartParam != null) { + args.putString("inline_query", messageObject.botStartParam); + } + if (getMessagesController().checkCanOpenChat(args, ChatActivity.this)) { + presentFragment(new ChatActivity(args)); + } } } else if (messageObject.messageOwner.media != null && messageObject.messageOwner.media.webpage != null) { if (!openLinkInternally(messageObject.messageOwner.media.webpage.url, messageObject.getId())) { @@ -23708,7 +24431,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (getParentActivity() == null || bottomOverlayChat.getVisibility() == View.VISIBLE && !(button instanceof TLRPC.TL_keyboardButtonSwitchInline) && !(button instanceof TLRPC.TL_keyboardButtonCallback) && !(button instanceof TLRPC.TL_keyboardButtonGame) && !(button instanceof TLRPC.TL_keyboardButtonUrl) && - !(button instanceof TLRPC.TL_keyboardButtonBuy) && !(button instanceof TLRPC.TL_keyboardButtonUrlAuth)) { + !(button instanceof TLRPC.TL_keyboardButtonBuy) && !(button instanceof TLRPC.TL_keyboardButtonUrlAuth) && + !(button instanceof TLRPC.TL_keyboardButtonUserProfile)) { return; } chatActivityEnterView.didPressedBotButton(button, messageObject, messageObject); @@ -23811,7 +24535,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not int nextType = getItemViewType(nextPosition); int prevType = getItemViewType(prevPosition); - if (!message.hasReactions() && !(message.messageOwner.reply_markup instanceof TLRPC.TL_replyInlineMarkup) && nextType == holder.getItemViewType()) { + if (!(message.messageOwner.reply_markup instanceof TLRPC.TL_replyInlineMarkup) && nextType == holder.getItemViewType()) { MessageObject nextMessage = messages.get(nextPosition - messagesStartRow); pinnedBottom = nextMessage.isOutOwner() == message.isOutOwner() && Math.abs(nextMessage.messageOwner.date - message.messageOwner.date) <= 5 * 60; if (pinnedBottom) { @@ -23848,7 +24572,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } if (prevType == holder.getItemViewType()) { MessageObject prevMessage = messages.get(prevPosition - messagesStartRow); - pinnedTop = !prevMessage.hasReactions() && !(prevMessage.messageOwner.reply_markup instanceof TLRPC.TL_replyInlineMarkup) && prevMessage.isOutOwner() == message.isOutOwner() && Math.abs(prevMessage.messageOwner.date - message.messageOwner.date) <= 5 * 60; + pinnedTop = !(prevMessage.messageOwner.reply_markup instanceof TLRPC.TL_replyInlineMarkup) && prevMessage.isOutOwner() == message.isOutOwner() && Math.abs(prevMessage.messageOwner.date - message.messageOwner.date) <= 5 * 60; if (pinnedTop) { if (message.isImportedForward() || prevMessage.isImportedForward()) { if (message.isImportedForward() && prevMessage.isImportedForward()) { @@ -23891,6 +24615,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } messageCell.setMessageObject(message, groupedMessages, pinnedBottom, pinnedTop); + messageCell.setSpoilersSuppressed(chatListView.getScrollState() != RecyclerView.SCROLL_STATE_IDLE); messageCell.setHighlighted(highlightMessageId != Integer.MAX_VALUE && message.getId() == highlightMessageId); if (highlightMessageId != Integer.MAX_VALUE) { startMessageUnselect(); @@ -24119,6 +24844,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ChatActionCell actionCell = (ChatActionCell) view; actionCell.setMessageObject(message); actionCell.setAlpha(1.0f); + actionCell.setSpoilersSuppressed(chatListView.getScrollState() != RecyclerView.SCROLL_STATE_IDLE); } else if (view instanceof ChatUnreadCell) { ChatUnreadCell unreadCell = (ChatUnreadCell) view; unreadCell.setText(LocaleController.getString("UnreadMessages", R.string.UnreadMessages)); @@ -25315,6 +26041,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_voipgroup_overlayAlertMutedByAdmin)); themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_voipgroup_overlayAlertMutedByAdmin2)); themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_windowBackgroundGray)); + themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_chat_outReactionButtonBackground)); + themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_chat_inReactionButtonBackground)); + themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_chat_inReactionButtonText)); + themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_chat_outReactionButtonText)); if (chatActivityEnterView != null) { themeDescriptions.add(new ThemeDescription(chatActivityEnterView.botCommandsMenuContainer.listView, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{BotCommandsMenuView.BotCommandView.class}, new String[]{"description"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); @@ -26120,4 +26850,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not protected boolean allowPresentFragment() { return !inPreviewMode; } + + @Override + protected boolean hideKeyboardOnShow() { + if (threadMessageObject != null && threadMessageObject.getRepliesCount() == 0 && ChatObject.canSendMessages(currentChat)) { + return false; + } + return super.hideKeyboardOnShow(); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatEditActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatEditActivity.java index 91dc0d96a..46d91ffdb 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatEditActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatEditActivity.java @@ -62,10 +62,10 @@ import org.telegram.ui.Cells.TextInfoPrivacyCell; import org.telegram.ui.Cells.TextSettingsCell; import org.telegram.ui.Components.AlertsCreator; import org.telegram.ui.Components.AvatarDrawable; -import org.telegram.ui.Components.EditTextEmoji; -import org.telegram.ui.Components.ImageUpdater; import org.telegram.ui.Components.BackupImageView; import org.telegram.ui.Components.EditTextBoldCursor; +import org.telegram.ui.Components.EditTextEmoji; +import org.telegram.ui.Components.ImageUpdater; import org.telegram.ui.Components.LayoutHelper; import org.telegram.ui.Components.RLottieDrawable; import org.telegram.ui.Components.RadialProgressView; @@ -73,6 +73,8 @@ import org.telegram.ui.Components.SizeNotifierFrameLayout; import org.telegram.ui.Components.UndoView; import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import java.util.concurrent.CountDownLatch; public class ChatEditActivity extends BaseFragment implements ImageUpdater.ImageUpdaterDelegate, NotificationCenter.NotificationCenterDelegate { @@ -101,6 +103,7 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image private TextDetailCell typeCell; private TextDetailCell linkedCell; private TextDetailCell historyCell; + private TextCell reactionsCell; private ShadowSectionCell settingsSectionCell; private TextCheckCell signCell; @@ -132,6 +135,7 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image private boolean isChannel; private boolean historyHidden; + private List availableReactions = Collections.emptyList(); private boolean createAfterUpload; private boolean donePressed; @@ -214,6 +218,7 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image signMessages = currentChat.signatures; NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.chatInfoDidLoad); NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.updateInterfaces); + NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.chatAvailableReactionsUpdated); if (info != null) { loadLinksCount(); @@ -244,6 +249,7 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image } NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.chatInfoDidLoad); NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.updateInterfaces); + NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.chatAvailableReactionsUpdated); if (nameTextView != null) { nameTextView.onDestroy(); } @@ -791,7 +797,7 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image linearLayout1.addView(infoContainer, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); blockCell = new TextCell(context); - blockCell.setBackgroundDrawable(Theme.getSelectorDrawable(false)); + blockCell.setBackground(Theme.getSelectorDrawable(false)); blockCell.setVisibility(ChatObject.isChannel(currentChat) || currentChat.creator || ChatObject.hasAdminRights(currentChat) && ChatObject.canChangeChatInfo(currentChat) ? View.VISIBLE : View.GONE); blockCell.setOnClickListener(v -> { Bundle args = new Bundle(); @@ -803,15 +809,25 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image }); inviteLinksCell = new TextCell(context); - inviteLinksCell.setBackgroundDrawable(Theme.getSelectorDrawable(false)); + inviteLinksCell.setBackground(Theme.getSelectorDrawable(false)); inviteLinksCell.setOnClickListener(v -> { ManageLinksActivity fragment = new ManageLinksActivity(chatId, 0, 0); fragment.setInfo(info, info.exported_invite); presentFragment(fragment); }); + reactionsCell = new TextCell(context); + reactionsCell.setBackground(Theme.getSelectorDrawable(false)); + reactionsCell.setOnClickListener(v -> { + Bundle args = new Bundle(); + args.putLong(ChatReactionsEditActivity.KEY_CHAT_ID, chatId); + ChatReactionsEditActivity reactionsEditActivity = new ChatReactionsEditActivity(args); + reactionsEditActivity.setInfo(info); + presentFragment(reactionsEditActivity); + }); + adminCell = new TextCell(context); - adminCell.setBackgroundDrawable(Theme.getSelectorDrawable(false)); + adminCell.setBackground(Theme.getSelectorDrawable(false)); adminCell.setOnClickListener(v -> { Bundle args = new Bundle(); args.putLong("chat_id", chatId); @@ -848,6 +864,8 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image logCell.setOnClickListener(v -> presentFragment(new ChannelAdminLogActivity(currentChat))); } + infoContainer.addView(reactionsCell, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); + if (!isChannel && !currentChat.gigagroup) { infoContainer.addView(blockCell, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); } @@ -1014,6 +1032,15 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image if ((mask & MessagesController.UPDATE_MASK_AVATAR) != 0) { setAvatar(); } + } else if (id == NotificationCenter.chatAvailableReactionsUpdated) { + long chatId = (long) args[0]; + if (chatId == this.chatId) { + info = getMessagesController().getChatFull(chatId); + if (info != null) { + availableReactions = info.available_reactions; + } + updateReactionsCell(); + } } } @@ -1260,6 +1287,7 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image currentChat = getMessagesController().getChat(chatId); } historyHidden = !ChatObject.isChannel(currentChat) || info.hidden_prehistory; + availableReactions = info.available_reactions; } } @@ -1441,6 +1469,8 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image } adminCell.setTextAndIcon(LocaleController.getString("ChannelAdministrators", R.string.ChannelAdministrators), R.drawable.actions_addadmin, true); } + reactionsCell.setVisibility(ChatObject.canChangeChatInfo(currentChat) ? View.VISIBLE : View.GONE); + updateReactionsCell(); if (info == null || !ChatObject.canUserDoAdminAction(currentChat, ChatObject.ACTION_INVITE) || (!isPrivate && currentChat.creator)) { inviteLinksCell.setVisibility(View.GONE); } else { @@ -1461,6 +1491,19 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image } } + private void updateReactionsCell() { + int count = 0; + for (int i = 0; i < availableReactions.size(); i++) { + TLRPC.TL_availableReaction reaction = getMediaDataController().getReactionsMap().get(availableReactions.get(i)); + if (reaction != null && !reaction.inactive) { + count++; + } + } + int reacts = Math.min(getMediaDataController().getEnabledReactionsList().size(), count); + reactionsCell.setTextAndValueAndIcon(LocaleController.getString("Reactions", R.string.Reactions), reacts == 0 ? LocaleController.getString("ReactionsOff", R.string.ReactionsOff) : + LocaleController.formatString("ReactionsCount", R.string.ReactionsCount, reacts, getMediaDataController().getEnabledReactionsList().size()), R.drawable.actions_reactions, true); + } + @Override public ArrayList getThemeDescriptions() { ArrayList themeDescriptions = new ArrayList<>(); @@ -1562,6 +1605,10 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[]{UndoView.class}, new String[]{"progressPaint"}, null, null, null, Theme.key_undo_infoColor)); themeDescriptions.add(new ThemeDescription(undoView, ThemeDescription.FLAG_IMAGECOLOR, new Class[]{UndoView.class}, new String[]{"leftImageView"}, null, null, null, Theme.key_undo_infoColor)); + themeDescriptions.add(new ThemeDescription(reactionsCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector)); + themeDescriptions.add(new ThemeDescription(reactionsCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); + themeDescriptions.add(new ThemeDescription(reactionsCell, 0, new Class[]{TextCell.class}, new String[]{"imageView"}, null, null, null, Theme.key_windowBackgroundWhiteGrayIcon)); + return themeDescriptions; } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatPullingDownDrawable.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatPullingDownDrawable.java index f62d94909..8e1d4f2fc 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatPullingDownDrawable.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatPullingDownDrawable.java @@ -5,7 +5,6 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ValueAnimator; import android.graphics.Canvas; -import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.PorterDuff; @@ -80,7 +79,7 @@ public class ChatPullingDownDrawable implements NotificationCenter.NotificationC public long nextDialogId; View parentView; - CounterView.CounterDrawable counterDrawable = new CounterView.CounterDrawable(null, null); + CounterView.CounterDrawable counterDrawable = new CounterView.CounterDrawable(null, true, null); int params[] = new int[3]; private final int currentAccount; private final int folderId; @@ -156,10 +155,10 @@ public class ChatPullingDownDrawable implements NotificationCenter.NotificationC str2 = LocaleController.getString("ReleaseToGoNextArchive", R.string.ReleaseToGoNextArchive); } else if (drawFolderBackground) { str1 = LocaleController.getString("SwipeToGoNextFolder", R.string.SwipeToGoNextFolder); - str2 = LocaleController.getString("ReleaseToGoNextFolder", R.string.ReleaseToGoNextFolder); + str2 = LocaleController.getString("ReleaseToGoNextFolder", R.string.ReleaseToGoNextFolder); } else { str1 = LocaleController.getString("SwipeToGoNextChannel", R.string.SwipeToGoNextChannel); - str2 = LocaleController.getString("ReleaseToGoNextChannel", R.string.ReleaseToGoNextChannel); + str2 = LocaleController.getString("ReleaseToGoNextChannel", R.string.ReleaseToGoNextChannel); } layout1Width = (int) textPaint2.measureText(str1); layout1Width = Math.min(layout1Width, lastWidth - AndroidUtilities.dp(60)); @@ -489,7 +488,7 @@ public class ChatPullingDownDrawable implements NotificationCenter.NotificationC @Override public void didReceivedNotification(int id, int account, Object... args) { - if (nextDialogId !=0 ) { + if (nextDialogId != 0) { TLRPC.Dialog dialog = MessagesController.getInstance(currentAccount).dialogs_dict.get(nextDialogId); if (dialog != null) { counterDrawable.setCount(dialog.unread_count, true); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatReactionsEditActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatReactionsEditActivity.java new file mode 100644 index 000000000..127587bd3 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatReactionsEditActivity.java @@ -0,0 +1,267 @@ +package org.telegram.ui; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.os.Bundle; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.ChatObject; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MessagesStorage; +import org.telegram.messenger.NotificationCenter; +import org.telegram.messenger.R; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.ActionBar.ThemeDescription; +import org.telegram.ui.Cells.AvailableReactionCell; +import org.telegram.ui.Cells.HeaderCell; +import org.telegram.ui.Cells.TextCheckCell; +import org.telegram.ui.Cells.TextInfoPrivacyCell; +import org.telegram.ui.Components.LayoutHelper; +import org.telegram.ui.Components.RecyclerListView; +import org.telegram.ui.Components.SimpleThemeDescription; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CountDownLatch; + +public class ChatReactionsEditActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { + private final static int TYPE_INFO = 0, TYPE_HEADER = 1, TYPE_REACTION = 2; + + public final static String KEY_CHAT_ID = "chat_id"; + + private TLRPC.Chat currentChat; + private TLRPC.ChatFull info; + private long chatId; + + private List chatReactions = new ArrayList<>(); + + private LinearLayout contentView; + private RecyclerListView listView; + private RecyclerView.Adapter listAdapter; + + private TextCheckCell enableReactionsCell; + private ArrayList availableReactions = new ArrayList(); + + public ChatReactionsEditActivity(Bundle args) { + super(args); + + chatId = args.getLong(KEY_CHAT_ID, 0); + } + + @Override + public boolean onFragmentCreate() { + currentChat = getMessagesController().getChat(chatId); + if (currentChat == null) { + currentChat = MessagesStorage.getInstance(currentAccount).getChatSync(chatId); + if (currentChat != null) { + getMessagesController().putChat(currentChat, true); + } else { + return false; + } + if (info == null) { + info = MessagesStorage.getInstance(currentAccount).loadChatInfo(chatId, ChatObject.isChannel(currentChat), new CountDownLatch(1), false, false); + if (info == null) { + return false; + } + } + } + getNotificationCenter().addObserver(this, NotificationCenter.reactionsDidLoad); + return super.onFragmentCreate(); + } + + @Override + public View createView(Context context) { + actionBar.setTitle(LocaleController.getString("Reactions", R.string.Reactions)); + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + actionBar.setAllowOverlayTitle(true); + + actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { + @Override + public void onItemClick(int id) { + if (id == -1) { + finishFragment(); + } + } + }); + + LinearLayout ll = new LinearLayout(context); + ll.setOrientation(LinearLayout.VERTICAL); + + availableReactions.addAll(getMediaDataController().getEnabledReactionsList()); + + enableReactionsCell = new TextCheckCell(context); + enableReactionsCell.setHeight(56); + enableReactionsCell.setTextAndCheck(LocaleController.getString("EnableReactions", R.string.EnableReactions), !chatReactions.isEmpty(), false); + enableReactionsCell.setBackgroundColor(Theme.getColor(enableReactionsCell.isChecked() ? Theme.key_windowBackgroundChecked : Theme.key_windowBackgroundUnchecked)); + enableReactionsCell.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + enableReactionsCell.setAnimatingToThumbInsteadOfTouch(true); + enableReactionsCell.setOnClickListener(v -> { + boolean c = !enableReactionsCell.isChecked(); + enableReactionsCell.setChecked(c); + int clr = Theme.getColor(c ? Theme.key_windowBackgroundChecked : Theme.key_windowBackgroundUnchecked); + if (c) { + enableReactionsCell.setBackgroundColorAnimated(c, clr); + } else { + enableReactionsCell.setBackgroundColorAnimatedReverse(clr); + } + if (c) { + for (TLRPC.TL_availableReaction a : availableReactions) { + chatReactions.add(a.reaction); + } + listAdapter.notifyItemRangeInserted(1, 1 + availableReactions.size()); + } else { + chatReactions.clear(); + listAdapter.notifyItemRangeRemoved(1, 1 + availableReactions.size()); + } + }); + ll.addView(enableReactionsCell, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); + + listView = new RecyclerListView(context); + listView.setLayoutManager(new LinearLayoutManager(context)); + listView.setAdapter(listAdapter = new RecyclerView.Adapter() { + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + switch (viewType) { + default: + case TYPE_REACTION: { + return new RecyclerListView.Holder(new AvailableReactionCell(context, false)); + } + case TYPE_INFO: { + TextInfoPrivacyCell infoCell = new TextInfoPrivacyCell(context); + return new RecyclerListView.Holder(infoCell); + } + case TYPE_HEADER: { + return new RecyclerListView.Holder(new HeaderCell(context, 23)); + } + } + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + switch (getItemViewType(position)) { + case TYPE_INFO: + TextInfoPrivacyCell infoCell = (TextInfoPrivacyCell) holder.itemView; + infoCell.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText4)); + infoCell.setText(ChatObject.isChannelAndNotMegaGroup(currentChat) ? LocaleController.getString("EnableReactionsChannelInfo", R.string.EnableReactionsChannelInfo) : + LocaleController.getString("EnableReactionsGroupInfo", R.string.EnableReactionsGroupInfo)); + break; + case TYPE_HEADER: + HeaderCell headerCell = (HeaderCell) holder.itemView; + headerCell.setText(LocaleController.getString("AvailableReactions", R.string.AvailableReactions)); + headerCell.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); + break; + case TYPE_REACTION: + AvailableReactionCell reactionCell = (AvailableReactionCell) holder.itemView; + TLRPC.TL_availableReaction react = availableReactions.get(position - 2); + reactionCell.bind(react, chatReactions.contains(react.reaction)); + break; + } + } + + @Override + public int getItemCount() { + return 1 + (!chatReactions.isEmpty() ? 1 + availableReactions.size() : 0); + } + + @Override + public int getItemViewType(int position) { + return position == 0 ? TYPE_INFO : position == 1 ? TYPE_HEADER : TYPE_REACTION; + } + }); + listView.setOnItemClickListener((view, position) -> { + if (position <= 1) return; + + AvailableReactionCell cell = (AvailableReactionCell) view; + TLRPC.TL_availableReaction react = availableReactions.get(position - 2); + boolean nc = !chatReactions.contains(react.reaction); + if (nc) chatReactions.add(react.reaction); + else chatReactions.remove(react.reaction); + + cell.setChecked(nc, true); + }); + ll.addView(listView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 0, 1f)); + fragmentView = contentView = ll; + + updateColors(); + + return contentView; + } + + @Override + public void onFragmentDestroy() { + super.onFragmentDestroy(); + + boolean changed = true; + if (info != null) { + changed = !info.available_reactions.equals(chatReactions); + } + if (changed) { + getMessagesController().setChatReactions(chatId, chatReactions); + } + getNotificationCenter().removeObserver(this, NotificationCenter.reactionsDidLoad); + } + + + /** + * Sets chat full info + * @param info Info to use + */ + public void setInfo(TLRPC.ChatFull info) { + this.info = info; + if (info != null) { + if (currentChat == null) { + currentChat = getMessagesController().getChat(chatId); + } + + chatReactions = new ArrayList<>(info.available_reactions); + } + } + + @Override + public ArrayList getThemeDescriptions() { + return SimpleThemeDescription.createThemeDescriptions(this::updateColors, + Theme.key_windowBackgroundWhite, + Theme.key_windowBackgroundWhiteBlackText, + Theme.key_windowBackgroundWhiteGrayText2, + Theme.key_listSelector, + Theme.key_windowBackgroundGray, + Theme.key_windowBackgroundWhiteGrayText4, + Theme.key_windowBackgroundWhiteRedText4, + Theme.key_windowBackgroundChecked, + Theme.key_windowBackgroundCheckText, + Theme.key_switchTrackBlue, + Theme.key_switchTrackBlueChecked, + Theme.key_switchTrackBlueThumb, + Theme.key_switchTrackBlueThumbChecked + ); + } + + @SuppressLint("NotifyDataSetChanged") + private void updateColors() { + contentView.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundGray)); + enableReactionsCell.setColors(Theme.key_windowBackgroundCheckText, Theme.key_switchTrackBlue, Theme.key_switchTrackBlueChecked, Theme.key_switchTrackBlueThumb, Theme.key_switchTrackBlueThumbChecked); + listAdapter.notifyDataSetChanged(); + } + + @SuppressLint("NotifyDataSetChanged") + @Override + public void didReceivedNotification(int id, int account, Object... args) { + if (account != currentAccount) return; + if (id == NotificationCenter.reactionsDidLoad) { + availableReactions.clear(); + availableReactions.addAll(getMediaDataController().getEnabledReactionsList()); + listAdapter.notifyDataSetChanged(); + } + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/CodeNumberField.java b/TMessagesProj/src/main/java/org/telegram/ui/CodeNumberField.java index f7dabf979..a94dbc786 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/CodeNumberField.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/CodeNumberField.java @@ -148,7 +148,7 @@ public class CodeNumberField extends EditTextBoldCursor { if (event.getAction() == MotionEvent.ACTION_UP && pressed) { if (isFocused() && codeFieldContainer != null) { ClipboardManager clipboard = ContextCompat.getSystemService(getContext(), ClipboardManager.class); - if (clipboard == null) { + if (clipboard == null || clipboard.getPrimaryClipDescription() == null) { return false; } clipboard.getPrimaryClipDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/AudioPlayerAlert.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/AudioPlayerAlert.java index 1f3de449a..4332de0c4 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/AudioPlayerAlert.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/AudioPlayerAlert.java @@ -41,6 +41,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.view.ViewGroup; +import android.view.accessibility.AccessibilityNodeInfo; import android.widget.EditText; import android.widget.FrameLayout; import android.widget.ImageView; @@ -900,6 +901,12 @@ public class AudioPlayerAlert extends BottomSheet implements NotificationCenter. } return true; } + + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + info.addAction(AccessibilityNodeInfo.ACTION_CLICK); + } }; prevButton.setScaleType(ImageView.ScaleType.CENTER); prevButton.setAnimation(R.raw.player_prev, 20, 20); @@ -1017,6 +1024,12 @@ public class AudioPlayerAlert extends BottomSheet implements NotificationCenter. return true; } + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + info.addAction(AccessibilityNodeInfo.ACTION_CLICK); + } + }; nextButton.setScaleType(ImageView.ScaleType.CENTER); nextButton.setAnimation(R.raw.player_prev, 20, 20); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarsDarawable.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarsDarawable.java new file mode 100644 index 000000000..522d295e1 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarsDarawable.java @@ -0,0 +1,526 @@ +package org.telegram.ui.Components; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ValueAnimator; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.drawable.Drawable; +import android.os.SystemClock; +import android.view.View; + +import androidx.core.graphics.ColorUtils; + +import org.telegram.messenger.AccountInstance; +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.DialogObject; +import org.telegram.messenger.ImageReceiver; +import org.telegram.messenger.MessageObject; +import org.telegram.messenger.MessagesController; +import org.telegram.messenger.UserConfig; +import org.telegram.messenger.voip.VoIPService; +import org.telegram.tgnet.ConnectionsManager; +import org.telegram.tgnet.TLObject; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.Cells.GroupCallUserCell; + +import java.util.Random; + +public class AvatarsDarawable { + + public final static int STYLE_GROUP_CALL_TOOLTIP = 10; + public final static int STYLE_MESSAGE_SEEN = 11; + + DrawingState[] currentStates = new DrawingState[3]; + DrawingState[] animatingStates = new DrawingState[3]; + boolean wasDraw; + + float transitionProgress = 1f; + ValueAnimator transitionProgressAnimator; + boolean updateAfterTransition; + + private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); + private Paint xRefP = new Paint(Paint.ANTI_ALIAS_FLAG); + + Runnable updateDelegate; + int currentStyle; + boolean centered; + + private boolean isInCall; + public int count; + public int height; + public int width; + + View parent; + private int overrideSize; + private float overrideAlpha = 1f; + + public void commitTransition(boolean animated) { + if (!wasDraw || !animated) { + transitionProgress = 1f; + swapStates(); + return; + } + + DrawingState[] removedStates = new DrawingState[3]; + boolean changed = false; + for (int i = 0; i < 3; i++) { + removedStates[i] = currentStates[i]; + if (currentStates[i].id != animatingStates[i].id) { + changed = true; + } else { + currentStates[i].lastSpeakTime = animatingStates[i].lastSpeakTime; + } + } + if (!changed) { + transitionProgress = 1f; + return; + } + for (int i = 0; i < 3; i++) { + boolean found = false; + for (int j = 0; j < 3; j++) { + if (currentStates[j].id == animatingStates[i].id) { + found = true; + removedStates[j] = null; + if (i == j) { + animatingStates[i].animationType = DrawingState.ANIMATION_TYPE_NONE; + GroupCallUserCell.AvatarWavesDrawable wavesDrawable = animatingStates[i].wavesDrawable; + animatingStates[i].wavesDrawable = currentStates[i].wavesDrawable; + currentStates[i].wavesDrawable = wavesDrawable; + } else { + animatingStates[i].animationType = DrawingState.ANIMATION_TYPE_MOVE; + animatingStates[i].moveFromIndex = j; + } + break; + } + } + if (!found) { + animatingStates[i].animationType = DrawingState.ANIMATION_TYPE_IN; + } + } + + for (int i = 0; i < 3; i++) { + if (removedStates[i] != null) { + removedStates[i].animationType = DrawingState.ANIMATION_TYPE_OUT; + } + } + if (transitionProgressAnimator != null) { + transitionProgressAnimator.cancel(); + } + transitionProgress = 0; + transitionProgressAnimator = ValueAnimator.ofFloat(0, 1f); + transitionProgressAnimator.addUpdateListener(valueAnimator -> { + transitionProgress = (float) valueAnimator.getAnimatedValue(); + invalidate(); + }); + transitionProgressAnimator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + if (transitionProgressAnimator != null) { + transitionProgress = 1f; + swapStates(); + if (updateAfterTransition) { + updateAfterTransition = false; + if (updateDelegate != null) { + updateDelegate.run(); + } + } + invalidate(); + } + transitionProgressAnimator = null; + } + }); + transitionProgressAnimator.setDuration(220); + transitionProgressAnimator.setInterpolator(CubicBezierInterpolator.DEFAULT); + transitionProgressAnimator.start(); + invalidate(); + } + + private void swapStates() { + for (int i = 0; i < 3; i++) { + DrawingState state = currentStates[i]; + currentStates[i] = animatingStates[i]; + animatingStates[i] = state; + } + } + + public void updateAfterTransitionEnd() { + updateAfterTransition = true; + } + + public void setDelegate(Runnable delegate) { + updateDelegate = delegate; + } + + public void setStyle(int currentStyle) { + this.currentStyle = currentStyle; + invalidate(); + } + + private void invalidate() { + if (parent != null) { + parent.invalidate(); + } + } + + public void setSize(int size) { + overrideSize = size; + } + + public void animateFromState(AvatarsDarawable avatarsDarawable, int currentAccount) { + TLObject[] objects = new TLObject[3]; + for (int i = 0; i < 3; i++) { + objects[i] = currentStates[i].object; + setObject(i, currentAccount, avatarsDarawable.currentStates[i].object); + } + commitTransition(false); + for (int i = 0; i < 3; i++) { + setObject(i, currentAccount, objects[i]); + } + wasDraw = true; + commitTransition(true); + } + + public void setAlpha(float alpha) { + overrideAlpha = alpha; + } + + private static class DrawingState { + + public static final int ANIMATION_TYPE_NONE = -1; + public static final int ANIMATION_TYPE_IN = 0; + public static final int ANIMATION_TYPE_OUT = 1; + public static final int ANIMATION_TYPE_MOVE = 2; + + private AvatarDrawable avatarDrawable; + private GroupCallUserCell.AvatarWavesDrawable wavesDrawable; + private long lastUpdateTime; + private long lastSpeakTime; + private ImageReceiver imageReceiver; + TLRPC.TL_groupCallParticipant participant; + + private long id; + private TLObject object; + + private int animationType; + private int moveFromIndex; + } + + Random random = new Random(); + + public AvatarsDarawable(View parent, boolean inCall) { + this.parent = parent; + for (int a = 0; a < 3; a++) { + currentStates[a] = new DrawingState(); + currentStates[a].imageReceiver = new ImageReceiver(); + currentStates[a].imageReceiver.setRoundRadius(AndroidUtilities.dp(12)); + currentStates[a].avatarDrawable = new AvatarDrawable(); + currentStates[a].avatarDrawable.setTextSize(AndroidUtilities.dp(12)); + + animatingStates[a] = new DrawingState(); + animatingStates[a].imageReceiver = new ImageReceiver(); + animatingStates[a].imageReceiver.setRoundRadius(AndroidUtilities.dp(12)); + animatingStates[a].avatarDrawable = new AvatarDrawable(); + animatingStates[a].avatarDrawable.setTextSize(AndroidUtilities.dp(12)); + } + isInCall = inCall; + xRefP.setColor(0); + xRefP.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); + } + + public void setObject(int index, int account, TLObject object) { + animatingStates[index].id = 0; + animatingStates[index].participant = null; + if (object == null) { + animatingStates[index].imageReceiver.setImageBitmap((Drawable) null); + invalidate(); + return; + } + TLRPC.User currentUser = null; + TLRPC.Chat currentChat = null; + animatingStates[index].lastSpeakTime = -1; + animatingStates[index].object = object; + if (object instanceof TLRPC.TL_groupCallParticipant) { + TLRPC.TL_groupCallParticipant participant = (TLRPC.TL_groupCallParticipant) object; + animatingStates[index].participant = participant; + long id = MessageObject.getPeerId(participant.peer); + if (DialogObject.isUserDialog(id)) { + currentUser = MessagesController.getInstance(account).getUser(id); + animatingStates[index].avatarDrawable.setInfo(currentUser); + } else { + currentChat = MessagesController.getInstance(account).getChat(-id); + animatingStates[index].avatarDrawable.setInfo(currentChat); + } + if (currentStyle == 4) { + if (id == AccountInstance.getInstance(account).getUserConfig().getClientUserId()) { + animatingStates[index].lastSpeakTime = 0; + } else { + if (isInCall) { + animatingStates[index].lastSpeakTime = participant.lastActiveDate; + } else { + animatingStates[index].lastSpeakTime = participant.active_date; + } + } + } else { + animatingStates[index].lastSpeakTime = participant.active_date; + } + animatingStates[index].id = id; + } else if (object instanceof TLRPC.User) { + currentUser = (TLRPC.User) object; + animatingStates[index].avatarDrawable.setInfo(currentUser); + animatingStates[index].id = currentUser.id; + } else { + currentChat = (TLRPC.Chat) object; + animatingStates[index].avatarDrawable.setInfo(currentChat); + animatingStates[index].id = -currentChat.id; + } + if (currentUser != null) { + animatingStates[index].imageReceiver.setForUserOrChat(currentUser, animatingStates[index].avatarDrawable); + } else { + animatingStates[index].imageReceiver.setForUserOrChat(currentChat, animatingStates[index].avatarDrawable); + } + boolean bigAvatars = currentStyle == 4 || currentStyle == STYLE_GROUP_CALL_TOOLTIP; + animatingStates[index].imageReceiver.setRoundRadius(AndroidUtilities.dp(bigAvatars ? 16 : 12)); + int size = getSize(); + animatingStates[index].imageReceiver.setImageCoords(0, 0, size, size); + invalidate(); + } + + public void onDraw(Canvas canvas) { + wasDraw = true; + boolean bigAvatars = currentStyle == 4 || currentStyle == STYLE_GROUP_CALL_TOOLTIP; + int size = getSize(); + int toAdd; + if (currentStyle == STYLE_MESSAGE_SEEN) { + toAdd = AndroidUtilities.dp(12); + } else if (overrideSize != 0) { + toAdd = (int) (overrideSize * 0.8f); + } else { + toAdd = AndroidUtilities.dp(bigAvatars ? 24 : 20); + } + int drawCount = 0; + for (int i = 0; i < 3; i++) { + if (currentStates[i].id != 0) { + drawCount++; + } + } + int startPadding = (currentStyle == 0 || currentStyle == STYLE_GROUP_CALL_TOOLTIP || currentStyle == STYLE_MESSAGE_SEEN) ? 0 : AndroidUtilities.dp(10); + int ax = centered ? (width - drawCount * toAdd - AndroidUtilities.dp(bigAvatars ? 8 : 4)) / 2 : startPadding; + boolean isMuted = VoIPService.getSharedInstance() != null && VoIPService.getSharedInstance().isMicMute(); + if (currentStyle == 4) { + paint.setColor(Theme.getColor(Theme.key_inappPlayerBackground)); + } else if (currentStyle != 3) { + paint.setColor(Theme.getColor(isMuted ? Theme.key_returnToCallMutedBackground : Theme.key_returnToCallBackground)); + } + + int animateToDrawCount = 0; + for (int i = 0; i < 3; i++) { + if (animatingStates[i].id != 0) { + animateToDrawCount++; + } + } + boolean useAlphaLayer = currentStyle == 0 || currentStyle == 1 || currentStyle == 3 || currentStyle == 4 || currentStyle == 5 || currentStyle == STYLE_GROUP_CALL_TOOLTIP || currentStyle == STYLE_MESSAGE_SEEN; + if (useAlphaLayer) { + float padding = currentStyle == STYLE_GROUP_CALL_TOOLTIP ? AndroidUtilities.dp(16) : 0; + canvas.saveLayerAlpha(-padding, -padding, width + padding, height + padding, 255, Canvas.ALL_SAVE_FLAG); + } + for (int a = 2; a >= 0; a--) { + for (int k = 0; k < 2; k++) { + if (k == 0 && transitionProgress == 1f) { + continue; + } + DrawingState[] states = k == 0 ? animatingStates : currentStates; + + + if (k == 1 && transitionProgress != 1f && states[a].animationType != DrawingState.ANIMATION_TYPE_OUT) { + continue; + } + ImageReceiver imageReceiver = states[a].imageReceiver; + if (!imageReceiver.hasImageSet()) { + continue; + } + if (k == 0) { + int toAx = centered ? (width - animateToDrawCount * toAdd - AndroidUtilities.dp(bigAvatars ? 8 : 4)) / 2 : startPadding; + imageReceiver.setImageX(toAx + toAdd * a); + } else { + imageReceiver.setImageX(ax + toAdd * a); + } + + if (currentStyle == 0 || currentStyle == STYLE_GROUP_CALL_TOOLTIP || currentStyle == STYLE_MESSAGE_SEEN) { + imageReceiver.setImageY((height - size) / 2f); + } else { + imageReceiver.setImageY(AndroidUtilities.dp(currentStyle == 4 ? 8 : 6)); + } + + boolean needRestore = false; + float alpha = 1f; + if (transitionProgress != 1f) { + if (states[a].animationType == DrawingState.ANIMATION_TYPE_OUT) { + canvas.save(); + canvas.scale(1f - transitionProgress, 1f - transitionProgress, imageReceiver.getCenterX(), imageReceiver.getCenterY()); + needRestore = true; + alpha = 1f - transitionProgress; + } else if (states[a].animationType == DrawingState.ANIMATION_TYPE_IN) { + canvas.save(); + canvas.scale(transitionProgress, transitionProgress, imageReceiver.getCenterX(), imageReceiver.getCenterY()); + alpha = transitionProgress; + needRestore = true; + } else if (states[a].animationType == DrawingState.ANIMATION_TYPE_MOVE) { + int toAx = centered ? (width - animateToDrawCount * toAdd - AndroidUtilities.dp(bigAvatars ? 8 : 4)) / 2 : startPadding; + int toX = toAx + toAdd * a; + int fromX = ax + toAdd * states[a].moveFromIndex; + imageReceiver.setImageX((int) (toX * transitionProgress + fromX * (1f - transitionProgress))); + } else if (states[a].animationType == DrawingState.ANIMATION_TYPE_NONE && centered) { + int toAx = (width - animateToDrawCount * toAdd - AndroidUtilities.dp(bigAvatars ? 8 : 4)) / 2; + int toX = toAx + toAdd * a; + int fromX = ax + toAdd * a; + imageReceiver.setImageX((int) (toX * transitionProgress + fromX * (1f - transitionProgress))); + } + } + alpha *= overrideAlpha; + + float avatarScale = 1f; + if (a != states.length - 1) { + if (currentStyle == 1 || currentStyle == 3 || currentStyle == 5) { + canvas.drawCircle(imageReceiver.getCenterX(), imageReceiver.getCenterY(), AndroidUtilities.dp(13), xRefP); + if (states[a].wavesDrawable == null) { + if (currentStyle == 5) { + states[a].wavesDrawable = new GroupCallUserCell.AvatarWavesDrawable(AndroidUtilities.dp(14), AndroidUtilities.dp(16)); + } else { + states[a].wavesDrawable = new GroupCallUserCell.AvatarWavesDrawable(AndroidUtilities.dp(17), AndroidUtilities.dp(21)); + } + } + if (currentStyle == 5) { + states[a].wavesDrawable.setColor(ColorUtils.setAlphaComponent(Theme.getColor(Theme.key_voipgroup_speakingText), (int) (255 * 0.3f * alpha))); + } + if (states[a].participant != null && states[a].participant.amplitude > 0) { + states[a].wavesDrawable.setShowWaves(true, parent); + float amplitude = states[a].participant.amplitude * 15f; + states[a].wavesDrawable.setAmplitude(amplitude); + } else { + states[a].wavesDrawable.setShowWaves(false, parent); + } + if (currentStyle == 5 && (SystemClock.uptimeMillis() - states[a].participant.lastSpeakTime) > 500) { + updateDelegate.run(); + } + states[a].wavesDrawable.update(); + if (currentStyle == 5) { + states[a].wavesDrawable.draw(canvas, imageReceiver.getCenterX(), imageReceiver.getCenterY(), parent); + invalidate(); + } + avatarScale = states[a].wavesDrawable.getAvatarScale(); + } else if (currentStyle == 4 || currentStyle == STYLE_GROUP_CALL_TOOLTIP) { + canvas.drawCircle(imageReceiver.getCenterX(), imageReceiver.getCenterY(), AndroidUtilities.dp(17), xRefP); + if (states[a].wavesDrawable == null) { + states[a].wavesDrawable = new GroupCallUserCell.AvatarWavesDrawable(AndroidUtilities.dp(17), AndroidUtilities.dp(21)); + } + if (currentStyle == STYLE_GROUP_CALL_TOOLTIP) { + states[a].wavesDrawable.setColor(ColorUtils.setAlphaComponent(Theme.getColor(Theme.key_voipgroup_speakingText), (int) (255 * 0.3f * alpha))); + } else { + states[a].wavesDrawable.setColor(ColorUtils.setAlphaComponent(Theme.getColor(Theme.key_voipgroup_listeningText), (int) (255 * 0.3f * alpha))); + } + long currentTime = System.currentTimeMillis(); + if (currentTime - states[a].lastUpdateTime > 100) { + states[a].lastUpdateTime = currentTime; + if (currentStyle == STYLE_GROUP_CALL_TOOLTIP) { + if (states[a].participant != null && states[a].participant.amplitude > 0) { + states[a].wavesDrawable.setShowWaves(true, parent); + float amplitude = states[a].participant.amplitude * 15f; + states[a].wavesDrawable.setAmplitude(amplitude); + } else { + states[a].wavesDrawable.setShowWaves(false, parent); + } + } else { + if (ConnectionsManager.getInstance(UserConfig.selectedAccount).getCurrentTime() - states[a].lastSpeakTime <= 5) { + states[a].wavesDrawable.setShowWaves(true, parent); + states[a].wavesDrawable.setAmplitude(random.nextInt() % 100); + } else { + states[a].wavesDrawable.setShowWaves(false, parent); + states[a].wavesDrawable.setAmplitude(0); + } + } + } + states[a].wavesDrawable.update(); + states[a].wavesDrawable.draw(canvas, imageReceiver.getCenterX(), imageReceiver.getCenterY(), parent); + avatarScale = states[a].wavesDrawable.getAvatarScale(); + } else { + float rad = getSize() / 2f + AndroidUtilities.dp(2); + if (useAlphaLayer) { + canvas.drawCircle(imageReceiver.getCenterX(), imageReceiver.getCenterY(), rad, xRefP); + } else { + int paintAlpha = paint.getAlpha(); + if (alpha != 1f) { + paint.setAlpha((int) (paintAlpha * alpha)); + } + canvas.drawCircle(imageReceiver.getCenterX(), imageReceiver.getCenterY(), rad, paint); + if (alpha != 1f) { + paint.setAlpha(paintAlpha); + } + } + } + } + imageReceiver.setAlpha(alpha); + if (avatarScale != 1f) { + canvas.save(); + canvas.scale(avatarScale, avatarScale, imageReceiver.getCenterX(), imageReceiver.getCenterY()); + imageReceiver.draw(canvas); + canvas.restore(); + } else { + imageReceiver.draw(canvas); + } + if (needRestore) { + canvas.restore(); + } + } + } + if (useAlphaLayer) { + canvas.restore(); + } + } + + private int getSize() { + if (overrideSize != 0) { + return overrideSize; + } + boolean bigAvatars = currentStyle == 4 || currentStyle == STYLE_GROUP_CALL_TOOLTIP; + return AndroidUtilities.dp(bigAvatars ? 32 : 24); + } + + public void onDetachedFromWindow() { + wasDraw = false; + for (int a = 0; a < 3; a++) { + currentStates[a].imageReceiver.onDetachedFromWindow(); + animatingStates[a].imageReceiver.onDetachedFromWindow(); + } + if (currentStyle == 3) { + Theme.getFragmentContextViewWavesDrawable().setAmplitude(0); + } + } + + public void onAttachedToWindow() { + for (int a = 0; a < 3; a++) { + currentStates[a].imageReceiver.onAttachedToWindow(); + animatingStates[a].imageReceiver.onAttachedToWindow(); + } + } + + public void setCentered(boolean centered) { + this.centered = centered; + } + + public void setCount(int count) { + this.count = count; + if (parent != null) { + parent.requestLayout(); + } + } + + public void reset() { + for (int i = 0; i < animatingStates.length; ++i) { + setObject(0, 0, null); + } + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarsImageView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarsImageView.java index 12ececc40..f514f62eb 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarsImageView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarsImageView.java @@ -1,486 +1,77 @@ package org.telegram.ui.Components; -import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; -import android.animation.ValueAnimator; -import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.PorterDuff; -import android.graphics.PorterDuffXfermode; -import android.graphics.drawable.Drawable; -import android.os.SystemClock; -import android.widget.FrameLayout; +import android.view.View; -import androidx.core.graphics.ColorUtils; +import androidx.annotation.NonNull; -import org.telegram.messenger.AccountInstance; -import org.telegram.messenger.AndroidUtilities; -import org.telegram.messenger.DialogObject; -import org.telegram.messenger.ImageReceiver; -import org.telegram.messenger.MessageObject; -import org.telegram.messenger.MessagesController; -import org.telegram.messenger.UserConfig; -import org.telegram.messenger.voip.VoIPService; -import org.telegram.tgnet.ConnectionsManager; import org.telegram.tgnet.TLObject; -import org.telegram.tgnet.TLRPC; -import org.telegram.ui.ActionBar.Theme; -import org.telegram.ui.Cells.GroupCallUserCell; -import java.util.Random; +public class AvatarsImageView extends View { -public class AvatarsImageView extends FrameLayout { + public final AvatarsDarawable avatarsDarawable; - public final static int STYLE_GROUP_CALL_TOOLTIP = 10; - public final static int STYLE_MESSAGE_SEEN = 11; - - DrawingState[] currentStates = new DrawingState[3]; - DrawingState[] animatingStates = new DrawingState[3]; - boolean wasDraw; - - float transitionProgress = 1f; - ValueAnimator transitionProgressAnimator; - boolean updateAfterTransition; - - private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); - private Paint xRefP = new Paint(Paint.ANTI_ALIAS_FLAG); - - Runnable updateDelegate; - int currentStyle; - boolean centered; - - private boolean isInCall; - protected int count; - - public void commitTransition(boolean animated) { - if (!wasDraw || !animated) { - transitionProgress = 1f; - swapStates(); - return; - } - - DrawingState[] removedStates = new DrawingState[3]; - boolean changed = false; - for (int i = 0; i < 3; i++) { - removedStates[i] = currentStates[i]; - if (currentStates[i].id != animatingStates[i].id) { - changed = true; - } else { - currentStates[i].lastSpeakTime = animatingStates[i].lastSpeakTime; - } - } - if (!changed) { - transitionProgress = 1f; - return; - } - for (int i = 0; i < 3; i++) { - boolean found = false; - for (int j = 0; j < 3; j++) { - if (currentStates[j].id == animatingStates[i].id) { - found = true; - removedStates[j] = null; - if (i == j) { - animatingStates[i].animationType = DrawingState.ANIMATION_TYPE_NONE; - GroupCallUserCell.AvatarWavesDrawable wavesDrawable = animatingStates[i].wavesDrawable; - animatingStates[i].wavesDrawable = currentStates[i].wavesDrawable; - currentStates[i].wavesDrawable = wavesDrawable; - } else { - animatingStates[i].animationType = DrawingState.ANIMATION_TYPE_MOVE; - animatingStates[i].moveFromIndex = j; - } - break; - } - } - if (!found) { - animatingStates[i].animationType = DrawingState.ANIMATION_TYPE_IN; - } - } - - for (int i = 0; i < 3; i++) { - if (removedStates[i] != null) { - removedStates[i].animationType = DrawingState.ANIMATION_TYPE_OUT; - } - } - if (transitionProgressAnimator != null) { - transitionProgressAnimator.cancel(); - } - transitionProgress = 0; - transitionProgressAnimator = ValueAnimator.ofFloat(0, 1f); - transitionProgressAnimator.addUpdateListener(valueAnimator -> { - transitionProgress = (float) valueAnimator.getAnimatedValue(); - invalidate(); - }); - transitionProgressAnimator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { - if (transitionProgressAnimator != null) { - transitionProgress = 1f; - swapStates(); - if (updateAfterTransition) { - updateAfterTransition = false; - if (updateDelegate != null) { - updateDelegate.run(); - } - } - invalidate(); - } - transitionProgressAnimator = null; - } - }); - transitionProgressAnimator.setDuration(220); - transitionProgressAnimator.setInterpolator(CubicBezierInterpolator.DEFAULT); - transitionProgressAnimator.start(); - invalidate(); - } - - private void swapStates() { - for (int i = 0; i < 3; i++) { - DrawingState state = currentStates[i]; - currentStates[i] = animatingStates[i]; - animatingStates[i] = state; - } - } - - public void updateAfterTransitionEnd() { - updateAfterTransition = true; - } - - public void setDelegate(Runnable delegate) { - updateDelegate = delegate; - } - - public void setStyle(int currentStyle) { - this.currentStyle = currentStyle; - invalidate(); - } - - private static class DrawingState { - - public static final int ANIMATION_TYPE_NONE = -1; - public static final int ANIMATION_TYPE_IN = 0; - public static final int ANIMATION_TYPE_OUT = 1; - public static final int ANIMATION_TYPE_MOVE = 2; - - private AvatarDrawable avatarDrawable; - private GroupCallUserCell.AvatarWavesDrawable wavesDrawable; - private long lastUpdateTime; - private long lastSpeakTime; - private ImageReceiver imageReceiver; - TLRPC.TL_groupCallParticipant participant; - - private long id; - - private int animationType; - private int moveFromIndex; - } - - Random random = new Random(); - - public AvatarsImageView(Context context, boolean inCall) { + public AvatarsImageView(@NonNull Context context, boolean inCall) { super(context); - for (int a = 0; a < 3; a++) { - currentStates[a] = new DrawingState(); - currentStates[a].imageReceiver = new ImageReceiver(this); - currentStates[a].imageReceiver.setRoundRadius(AndroidUtilities.dp(12)); - currentStates[a].avatarDrawable = new AvatarDrawable(); - currentStates[a].avatarDrawable.setTextSize(AndroidUtilities.dp(12)); - - animatingStates[a] = new DrawingState(); - animatingStates[a].imageReceiver = new ImageReceiver(this); - animatingStates[a].imageReceiver.setRoundRadius(AndroidUtilities.dp(12)); - animatingStates[a].avatarDrawable = new AvatarDrawable(); - animatingStates[a].avatarDrawable.setTextSize(AndroidUtilities.dp(12)); - } - isInCall = inCall; - setWillNotDraw(false); - xRefP.setColor(0); - xRefP.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); - } - - public void setObject(int index, int account, TLObject object) { - animatingStates[index].id = 0; - animatingStates[index].participant = null; - if (object == null) { - animatingStates[index].imageReceiver.setImageBitmap((Drawable) null); - invalidate(); - return; - } - TLRPC.User currentUser = null; - TLRPC.Chat currentChat = null; - animatingStates[index].lastSpeakTime = -1; - if (object instanceof TLRPC.TL_groupCallParticipant) { - TLRPC.TL_groupCallParticipant participant = (TLRPC.TL_groupCallParticipant) object; - animatingStates[index].participant = participant; - long id = MessageObject.getPeerId(participant.peer); - if (DialogObject.isUserDialog(id)) { - currentUser = MessagesController.getInstance(account).getUser(id); - animatingStates[index].avatarDrawable.setInfo(currentUser); - } else { - currentChat = MessagesController.getInstance(account).getChat(-id); - animatingStates[index].avatarDrawable.setInfo(currentChat); - } - if (currentStyle == 4) { - if (id == AccountInstance.getInstance(account).getUserConfig().getClientUserId()) { - animatingStates[index].lastSpeakTime = 0; - } else { - if (isInCall) { - animatingStates[index].lastSpeakTime = participant.lastActiveDate; - } else { - animatingStates[index].lastSpeakTime = participant.active_date; - } - } - } else { - animatingStates[index].lastSpeakTime = participant.active_date; - } - animatingStates[index].id = id; - } else if (object instanceof TLRPC.User) { - currentUser = (TLRPC.User) object; - animatingStates[index].avatarDrawable.setInfo(currentUser); - animatingStates[index].id = currentUser.id; - } else { - currentChat = (TLRPC.Chat) object; - animatingStates[index].avatarDrawable.setInfo(currentChat); - animatingStates[index].id = -currentChat.id; - } - if (currentUser != null) { - animatingStates[index].imageReceiver.setForUserOrChat(currentUser, animatingStates[index].avatarDrawable); - } else { - animatingStates[index].imageReceiver.setForUserOrChat(currentChat, animatingStates[index].avatarDrawable); - } - boolean bigAvatars = currentStyle == 4 || currentStyle == STYLE_GROUP_CALL_TOOLTIP; - animatingStates[index].imageReceiver.setRoundRadius(AndroidUtilities.dp(bigAvatars ? 16 : 12)); - int size = AndroidUtilities.dp(bigAvatars ? 32 : 24); - animatingStates[index].imageReceiver.setImageCoords(0, 0, size, size); - invalidate(); - } - - @SuppressLint("DrawAllocation") - @Override - protected void onDraw(Canvas canvas) { - wasDraw = true; - - boolean bigAvatars = currentStyle == 4 || currentStyle == STYLE_GROUP_CALL_TOOLTIP; - int size = AndroidUtilities.dp(bigAvatars ? 32 : 24); - int toAdd; - if (currentStyle == STYLE_MESSAGE_SEEN) { - toAdd = AndroidUtilities.dp(12); - } else { - toAdd = AndroidUtilities.dp(bigAvatars ? 24 : 20); - } - int drawCount = 0; - for (int i = 0; i < 3; i++) { - if (currentStates[i].id != 0) { - drawCount++; - } - } - int startPadding = (currentStyle == 0 || currentStyle == STYLE_GROUP_CALL_TOOLTIP || currentStyle == STYLE_MESSAGE_SEEN) ? 0 : AndroidUtilities.dp(10); - int ax = centered ? (getMeasuredWidth() - drawCount * toAdd - AndroidUtilities.dp(bigAvatars ? 8 : 4)) / 2 : startPadding; - boolean isMuted = VoIPService.getSharedInstance() != null && VoIPService.getSharedInstance().isMicMute(); - if (currentStyle == 4) { - paint.setColor(Theme.getColor(Theme.key_inappPlayerBackground)); - } else if (currentStyle != 3) { - paint.setColor(Theme.getColor(isMuted ? Theme.key_returnToCallMutedBackground : Theme.key_returnToCallBackground)); - } - - int animateToDrawCount = 0; - for (int i = 0; i < 3; i++) { - if (animatingStates[i].id != 0) { - animateToDrawCount++; - } - } - boolean useAlphaLayer = currentStyle == 0 || currentStyle == 1 || currentStyle == 3 || currentStyle == 4 || currentStyle == 5 || currentStyle == STYLE_GROUP_CALL_TOOLTIP || currentStyle == STYLE_MESSAGE_SEEN; - if (useAlphaLayer) { - float padding = currentStyle == STYLE_GROUP_CALL_TOOLTIP ? AndroidUtilities.dp(16) : 0; - canvas.saveLayerAlpha(-padding, -padding, getMeasuredWidth() + padding, getMeasuredHeight() + padding, 255, Canvas.ALL_SAVE_FLAG); - } - for (int a = 2; a >= 0; a--) { - for (int k = 0; k < 2; k++) { - if (k == 0 && transitionProgress == 1f) { - continue; - } - DrawingState[] states = k == 0 ? animatingStates : currentStates; - - - if (k == 1 && transitionProgress != 1f && states[a].animationType != DrawingState.ANIMATION_TYPE_OUT) { - continue; - } - ImageReceiver imageReceiver = states[a].imageReceiver; - if (!imageReceiver.hasImageSet()) { - continue; - } - if (k == 0) { - int toAx = centered ? (getMeasuredWidth() - animateToDrawCount * toAdd - AndroidUtilities.dp(bigAvatars ? 8 : 4)) / 2 : startPadding; - imageReceiver.setImageX(toAx + toAdd * a); - } else { - imageReceiver.setImageX(ax + toAdd * a); - } - - if (currentStyle == 0 || currentStyle == STYLE_GROUP_CALL_TOOLTIP || currentStyle == STYLE_MESSAGE_SEEN) { - imageReceiver.setImageY((getMeasuredHeight() - size) / 2f); - } else { - imageReceiver.setImageY(AndroidUtilities.dp(currentStyle == 4 ? 8 : 6)); - } - - boolean needRestore = false; - float alpha = 1f; - if (transitionProgress != 1f) { - if (states[a].animationType == DrawingState.ANIMATION_TYPE_OUT) { - canvas.save(); - canvas.scale(1f - transitionProgress, 1f - transitionProgress, imageReceiver.getCenterX(), imageReceiver.getCenterY()); - needRestore = true; - alpha = 1f - transitionProgress; - } else if (states[a].animationType == DrawingState.ANIMATION_TYPE_IN) { - canvas.save(); - canvas.scale(transitionProgress, transitionProgress, imageReceiver.getCenterX(), imageReceiver.getCenterY()); - alpha = transitionProgress; - needRestore = true; - } else if (states[a].animationType == DrawingState.ANIMATION_TYPE_MOVE) { - int toAx = centered ? (getMeasuredWidth() - animateToDrawCount * toAdd - AndroidUtilities.dp(bigAvatars ? 8 : 4)) / 2 : startPadding; - int toX = toAx + toAdd * a; - int fromX = ax + toAdd * states[a].moveFromIndex; - imageReceiver.setImageX((int) (toX * transitionProgress + fromX * (1f - transitionProgress))); - } else if (states[a].animationType == DrawingState.ANIMATION_TYPE_NONE && centered) { - int toAx = (getMeasuredWidth() - animateToDrawCount * toAdd - AndroidUtilities.dp(bigAvatars ? 8 : 4)) / 2; - int toX = toAx + toAdd * a; - int fromX = ax + toAdd * a; - imageReceiver.setImageX((int) (toX * transitionProgress + fromX * (1f - transitionProgress))); - } - } - - float avatarScale = 1f; - if (a != states.length - 1) { - if (currentStyle == 1 || currentStyle == 3 || currentStyle == 5) { - canvas.drawCircle(imageReceiver.getCenterX(), imageReceiver.getCenterY(), AndroidUtilities.dp(13), xRefP); - if (states[a].wavesDrawable == null) { - if (currentStyle == 5) { - states[a].wavesDrawable = new GroupCallUserCell.AvatarWavesDrawable(AndroidUtilities.dp(14), AndroidUtilities.dp(16)); - } else { - states[a].wavesDrawable = new GroupCallUserCell.AvatarWavesDrawable(AndroidUtilities.dp(17), AndroidUtilities.dp(21)); - } - } - if (currentStyle == 5) { - states[a].wavesDrawable.setColor(ColorUtils.setAlphaComponent(Theme.getColor(Theme.key_voipgroup_speakingText), (int) (255 * 0.3f * alpha))); - } - if (states[a].participant != null && states[a].participant.amplitude > 0) { - states[a].wavesDrawable.setShowWaves(true, this); - float amplitude = states[a].participant.amplitude * 15f; - states[a].wavesDrawable.setAmplitude(amplitude); - } else { - states[a].wavesDrawable.setShowWaves(false, this); - } - if (currentStyle == 5 && (SystemClock.uptimeMillis() - states[a].participant.lastSpeakTime) > 500) { - updateDelegate.run(); - } - states[a].wavesDrawable.update(); - if (currentStyle == 5) { - states[a].wavesDrawable.draw(canvas, imageReceiver.getCenterX(), imageReceiver.getCenterY(), this); - invalidate(); - } - avatarScale = states[a].wavesDrawable.getAvatarScale(); - } else if (currentStyle == 4 || currentStyle == STYLE_GROUP_CALL_TOOLTIP) { - canvas.drawCircle(imageReceiver.getCenterX(), imageReceiver.getCenterY(), AndroidUtilities.dp(17), xRefP); - if (states[a].wavesDrawable == null) { - states[a].wavesDrawable = new GroupCallUserCell.AvatarWavesDrawable(AndroidUtilities.dp(17), AndroidUtilities.dp(21)); - } - if (currentStyle == STYLE_GROUP_CALL_TOOLTIP) { - states[a].wavesDrawable.setColor(ColorUtils.setAlphaComponent(Theme.getColor(Theme.key_voipgroup_speakingText), (int) (255 * 0.3f * alpha))); - } else { - states[a].wavesDrawable.setColor(ColorUtils.setAlphaComponent(Theme.getColor(Theme.key_voipgroup_listeningText), (int) (255 * 0.3f * alpha))); - } - long currentTime = System.currentTimeMillis(); - if (currentTime - states[a].lastUpdateTime > 100) { - states[a].lastUpdateTime = currentTime; - if (currentStyle == STYLE_GROUP_CALL_TOOLTIP) { - if (states[a].participant != null && states[a].participant.amplitude > 0) { - states[a].wavesDrawable.setShowWaves(true, this); - float amplitude = states[a].participant.amplitude * 15f; - states[a].wavesDrawable.setAmplitude(amplitude); - } else { - states[a].wavesDrawable.setShowWaves(false, this); - } - } else { - if (ConnectionsManager.getInstance(UserConfig.selectedAccount).getCurrentTime() - states[a].lastSpeakTime <= 5) { - states[a].wavesDrawable.setShowWaves(true, this); - states[a].wavesDrawable.setAmplitude(random.nextInt() % 100); - } else { - states[a].wavesDrawable.setShowWaves(false, this); - states[a].wavesDrawable.setAmplitude(0); - } - } - } - states[a].wavesDrawable.update(); - states[a].wavesDrawable.draw(canvas, imageReceiver.getCenterX(), imageReceiver.getCenterY(), this); - avatarScale = states[a].wavesDrawable.getAvatarScale(); - } else { - if (useAlphaLayer) { - canvas.drawCircle(imageReceiver.getCenterX(), imageReceiver.getCenterY(), AndroidUtilities.dp(bigAvatars ? 17 : 13), xRefP); - } else { - int paintAlpha = paint.getAlpha(); - if (alpha != 1f) { - paint.setAlpha((int) (paintAlpha * alpha)); - } - canvas.drawCircle(imageReceiver.getCenterX(), imageReceiver.getCenterY(), AndroidUtilities.dp(bigAvatars ? 17 : 13), paint); - if (alpha != 1f) { - paint.setAlpha(paintAlpha); - } - } - } - } - imageReceiver.setAlpha(alpha); - if (avatarScale != 1f) { - canvas.save(); - canvas.scale(avatarScale, avatarScale, imageReceiver.getCenterX(), imageReceiver.getCenterY()); - imageReceiver.draw(canvas); - canvas.restore(); - } else { - imageReceiver.draw(canvas); - } - if (needRestore) { - canvas.restore(); - } - } - } - if (useAlphaLayer) { - canvas.restore(); - } + avatarsDarawable = new AvatarsDarawable(this, inCall); } @Override - protected void onDetachedFromWindow() { - super.onDetachedFromWindow(); - wasDraw = false; - for (int a = 0; a < 3; a++) { - currentStates[a].imageReceiver.onDetachedFromWindow(); - animatingStates[a].imageReceiver.onDetachedFromWindow(); - } - if (currentStyle == 3) { - Theme.getFragmentContextViewWavesDrawable().setAmplitude(0); - } + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + avatarsDarawable.width = getMeasuredWidth(); + avatarsDarawable.height = getMeasuredHeight(); } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); - for (int a = 0; a < 3; a++) { - currentStates[a].imageReceiver.onAttachedToWindow(); - animatingStates[a].imageReceiver.onAttachedToWindow(); - } + avatarsDarawable.onAttachedToWindow(); } - public void setCentered(boolean centered) { - this.centered = centered; + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + avatarsDarawable.onDraw(canvas); } - public void setCount(int count) { - this.count = count; - requestLayout(); + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + avatarsDarawable.onDetachedFromWindow(); + } + + + public void setStyle(int style) { + avatarsDarawable.setStyle(style); + } + + public void setDelegate(Runnable delegate) { + avatarsDarawable.setDelegate(delegate); + } + + public void setObject(int a, int currentAccount, TLObject object) { + avatarsDarawable.setObject(a, currentAccount, object); } public void reset() { - for (int i = 0; i < animatingStates.length; ++i) { - setObject(0, 0, null); - } + avatarsDarawable.reset(); + } + + public void setCount(int usersCount) { + avatarsDarawable.setCount(usersCount); + } + + public void commitTransition(boolean animated) { + avatarsDarawable.commitTransition(animated); + } + + public void updateAfterTransitionEnd() { + avatarsDarawable.updateAfterTransitionEnd(); + } + + public void setCentered(boolean centered) { + avatarsDarawable.setCentered(centered); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java index b2d2b9c5d..feb17b1df 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java @@ -58,7 +58,6 @@ import android.text.style.ImageSpan; import android.util.Property; import android.util.TypedValue; import android.view.ActionMode; -import android.view.DisplayCutout; import android.view.Gravity; import android.view.HapticFeedbackConstants; import android.view.KeyEvent; @@ -136,6 +135,7 @@ import org.telegram.ui.DialogsActivity; import org.telegram.ui.GroupStickersActivity; import org.telegram.ui.LaunchActivity; import org.telegram.ui.PhotoViewer; +import org.telegram.ui.ProfileActivity; import org.telegram.ui.StickersActivity; import java.io.File; @@ -1839,6 +1839,9 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe @Override public InputConnection onCreateInputConnection(EditorInfo editorInfo) { final InputConnection ic = super.onCreateInputConnection(editorInfo); + if (ic == null) { + return null; + } try { EditorInfoCompat.setContentMimeTypes(editorInfo, new String[]{"image/gif", "image/*", "image/jpg", "image/png", "image/webp"}); @@ -1975,46 +1978,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe ArrayList entries = new ArrayList<>(); entries.add(photoEntry); AndroidUtilities.runOnUIThread(() -> { - PhotoViewer.getInstance().setParentActivity(parentActivity, resourcesProvider); - PhotoViewer.getInstance().openPhotoForSelect(entries, 0, 2, false, new PhotoViewer.EmptyPhotoViewerProvider() { - boolean sending; - @Override - public void sendButtonPressed(int index, VideoEditedInfo videoEditedInfo, boolean notify, int scheduleDate, boolean forceDocument) { - ArrayList photos = new ArrayList<>(); - SendMessagesHelper.SendingMediaInfo info = new SendMessagesHelper.SendingMediaInfo(); - if (!photoEntry.isVideo && photoEntry.imagePath != null) { - info.path = photoEntry.imagePath; - } else if (photoEntry.path != null) { - info.path = photoEntry.path; - } - info.thumbPath = photoEntry.thumbPath; - info.isVideo = photoEntry.isVideo; - info.caption = photoEntry.caption != null ? photoEntry.caption.toString() : null; - info.entities = photoEntry.entities; - info.masks = photoEntry.stickers; - info.ttl = photoEntry.ttl; - info.videoEditedInfo = videoEditedInfo; - info.canDeleteAfter = true; - photos.add(info); - photoEntry.reset(); - sending = true; - SendMessagesHelper.prepareSendingMedia(accountInstance, photos, dialog_id, replyingMessageObject, getThreadMessage(), null, false, false, editingMessageObject, notify, scheduleDate); - if (delegate != null) { - delegate.onMessageSend(null, true, scheduleDate); - } - } - - @Override - public void willHidePhotoViewer() { - if (!sending) { - try { - file.delete(); - } catch (Throwable ignore) { - - } - } - } - }, parentFragment); + openPhotoViewerForEdit(entries, file); }); } catch (Throwable e) { e.printStackTrace(); @@ -2022,12 +1986,73 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe }); } + private void openPhotoViewerForEdit(ArrayList entries, File sourceFile) { + MediaController.PhotoEntry photoEntry = (MediaController.PhotoEntry) entries.get(0); + if (keyboardVisible) { + AndroidUtilities.hideKeyboard(messageEditText); + AndroidUtilities.runOnUIThread(new Runnable() { + @Override + public void run() { + openPhotoViewerForEdit(entries, sourceFile); + } + }, 100); + return; + } + + PhotoViewer.getInstance().setParentActivity(parentActivity, resourcesProvider); + PhotoViewer.getInstance().openPhotoForSelect(entries, 0, 2, false, new PhotoViewer.EmptyPhotoViewerProvider() { + boolean sending; + @Override + public void sendButtonPressed(int index, VideoEditedInfo videoEditedInfo, boolean notify, int scheduleDate, boolean forceDocument) { + ArrayList photos = new ArrayList<>(); + SendMessagesHelper.SendingMediaInfo info = new SendMessagesHelper.SendingMediaInfo(); + if (!photoEntry.isVideo && photoEntry.imagePath != null) { + info.path = photoEntry.imagePath; + } else if (photoEntry.path != null) { + info.path = photoEntry.path; + } + info.thumbPath = photoEntry.thumbPath; + info.isVideo = photoEntry.isVideo; + info.caption = photoEntry.caption != null ? photoEntry.caption.toString() : null; + info.entities = photoEntry.entities; + info.masks = photoEntry.stickers; + info.ttl = photoEntry.ttl; + info.videoEditedInfo = videoEditedInfo; + info.canDeleteAfter = true; + photos.add(info); + photoEntry.reset(); + sending = true; + SendMessagesHelper.prepareSendingMedia(accountInstance, photos, dialog_id, replyingMessageObject, getThreadMessage(), null, false, false, editingMessageObject, notify, scheduleDate); + if (delegate != null) { + delegate.onMessageSend(null, true, scheduleDate); + } + } + + @Override + public void willHidePhotoViewer() { + if (!sending) { + try { + sourceFile.delete(); + } catch (Throwable ignore) { + + } + } + } + + @Override + public boolean canCaptureMorePhotos() { + return false; + } + }, parentFragment); + } + @Override protected Theme.ResourcesProvider getResourcesProvider() { return resourcesProvider; } }; messageEditText.setDelegate(() -> { + messageEditText.invalidateEffects(); if (delegate != null) { delegate.onTextSpansChanged(messageEditText.getText()); } @@ -4779,7 +4804,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe CharSequence[] message = new CharSequence[]{AndroidUtilities.getTrimmedString(messageEditText.getText())}; ArrayList entities = MediaDataController.getInstance(currentAccount).getEntities(message, supportsSendingNewEntities()); - if (!TextUtils.equals(message[0], editingMessageObject.messageText) || entities != null && !entities.isEmpty() || entities == null && !editingMessageObject.messageOwner.entities.isEmpty() || editingMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage) { + if (!TextUtils.equals(message[0], editingMessageObject.messageText) || entities != null && !entities.isEmpty() || (entities == null || entities.isEmpty()) && !editingMessageObject.messageOwner.entities.isEmpty() || editingMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage) { editingMessageObject.editingMessage = message[0]; editingMessageObject.editingMessageEntities = entities; editingMessageObject.editingMessageSearchWebPage = messageWebPageSearch; @@ -6392,6 +6417,10 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe MediaDataController.addStyleToText(new TextStyleSpan(run), entity.offset, entity.offset + entity.length, stringBuilder, true); } else if (entity instanceof TLRPC.TL_messageEntityTextUrl) { stringBuilder.setSpan(new URLSpanReplacement(entity.url), entity.offset, entity.offset + entity.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } else if (entity instanceof TLRPC.TL_messageEntitySpoiler) { + TextStyleSpan.TextStyleRun run = new TextStyleSpan.TextStyleRun(); + run.flags |= TextStyleSpan.FLAG_STYLE_SPOILER; + MediaDataController.addStyleToText(new TextStyleSpan(run), entity.offset, entity.offset + entity.length, stringBuilder, true); } } } catch (Exception e) { @@ -7124,6 +7153,13 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe }); parentFragment.presentFragment(fragment); } + } else if (button instanceof TLRPC.TL_keyboardButtonUserProfile) { + if (MessagesController.getInstance(currentAccount).getUser(button.user_id) != null) { + Bundle args = new Bundle(); + args.putLong("user_id", button.user_id); + ProfileActivity fragment = new ProfileActivity(args); + parentFragment.presentFragment(fragment); + } } return true; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlert.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlert.java index 174d78a2b..3d765135b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlert.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlert.java @@ -28,12 +28,14 @@ import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.os.Build; +import android.os.Bundle; import android.os.Vibrator; import android.text.Editable; import android.text.TextPaint; import android.text.TextUtils; import android.text.TextWatcher; import android.text.style.ImageSpan; +import android.text.util.Linkify; import android.util.Property; import android.util.TypedValue; import android.view.Gravity; @@ -44,6 +46,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewOutlineProvider; import android.view.WindowManager; +import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.DecelerateInterpolator; import android.view.animation.OvershootInterpolator; @@ -244,7 +247,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N } - void applyCaption(String text) { + void applyCaption(CharSequence text) { } @@ -417,6 +420,8 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N public AttachButton(Context context) { super(context); setWillNotDraw(false); + setFocusable(true); + setFocusableInTouchMode(true); imageView = new RLottieImageView(context) { @Override @@ -435,6 +440,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N textView.setTextColor(getThemedColor(Theme.key_dialogTextGray2)); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12); textView.setLineSpacing(-AndroidUtilities.dp(2), 1.0f); + textView.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 0, 62, 0, 0)); } @@ -1769,7 +1775,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N if (commentTextView.length() <= 0) { return; } - currentAttachLayout.applyCaption(commentTextView.getText().toString()); + currentAttachLayout.applyCaption(commentTextView.getText()); } private void sendPressed(boolean notify, int scheduleDate) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertDocumentLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertDocumentLayout.java index 2dcd18693..d38262d67 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertDocumentLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertDocumentLayout.java @@ -340,35 +340,7 @@ public class ChatAttachAlertDocumentLayout extends ChatAttachAlert.AttachAlertLa isExternalStorageManager = Environment.isExternalStorageManager(); } if (!BuildVars.NO_SCOPED_STORAGE && (item.icon == R.drawable.files_storage || item.icon == R.drawable.files_internal) && !isExternalStorageManager) { - if (SharedConfig.dontAskManageStorage) { - delegate.startDocumentSelectActivity(); - } else { - AlertDialog.Builder builder = new AlertDialog.Builder(context); - builder.setTopImage(R.drawable.doc_big, Theme.getColor(Theme.key_dialogTopBackground)); - builder.setMessage(AndroidUtilities.replaceTags(LocaleController.getString("ManageAllFilesRational", R.string.ManageAllFilesRational))); - - TextCheckBoxCell textCheckBoxCell = new TextCheckBoxCell(context, true, true); - textCheckBoxCell.setTextAndCheck(LocaleController.getString("DontAskAgain", R.string.DontAskAgain), false, false); - textCheckBoxCell.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - textCheckBoxCell.setChecked(!textCheckBoxCell.isChecked()); - } - }); - builder.setView(textCheckBoxCell); - - builder.setPositiveButton(LocaleController.getString("Allow", R.string.Allow), (i1, i2) -> { - Uri uri = Uri.parse("package:" + BuildConfig.APPLICATION_ID); - context.startActivity(new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, uri)); - }); - builder.setNegativeButton(LocaleController.getString("UseFileManger", R.string.UseFileManger), (i1, i2) -> { - if (textCheckBoxCell.isChecked()) { - SharedConfig.setDontAskManageStorage(true); - } - delegate.startDocumentSelectActivity(); - }); - builder.show(); - } + delegate.startDocumentSelectActivity(); } else if (file == null) { if (item.icon == R.drawable.files_gallery) { HashMap selectedPhotos = new HashMap<>(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertPhotoLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertPhotoLayout.java index 265594f77..5ba076f5e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertPhotoLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertPhotoLayout.java @@ -58,11 +58,13 @@ import org.telegram.messenger.FileLog; import org.telegram.messenger.ImageReceiver; import org.telegram.messenger.LocaleController; import org.telegram.messenger.MediaController; +import org.telegram.messenger.MediaDataController; import org.telegram.messenger.MessageObject; import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.SendMessagesHelper; import org.telegram.messenger.SharedConfig; +import org.telegram.messenger.UserConfig; import org.telegram.messenger.Utilities; import org.telegram.messenger.VideoEditedInfo; import org.telegram.messenger.camera.CameraController; @@ -2507,15 +2509,17 @@ public class ChatAttachAlertPhotoLayout extends ChatAttachAlert.AttachAlertLayou } @Override - void applyCaption(String text) { + void applyCaption(CharSequence text) { int imageId = (Integer) selectedPhotosOrder.get(0); Object entry = selectedPhotos.get(imageId); if (entry instanceof MediaController.PhotoEntry) { MediaController.PhotoEntry photoEntry = (MediaController.PhotoEntry) entry; photoEntry.caption = text; + photoEntry.entities = MediaDataController.getInstance(UserConfig.selectedAccount).getEntities(new CharSequence[] {text}, false); } else if (entry instanceof MediaController.SearchImage) { MediaController.SearchImage searchImage = (MediaController.SearchImage) entry; searchImage.caption = text; + searchImage.entities = MediaDataController.getInstance(UserConfig.selectedAccount).getEntities(new CharSequence[] {text}, false); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatScrimPopupContainerLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatScrimPopupContainerLayout.java new file mode 100644 index 000000000..63da64b40 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatScrimPopupContainerLayout.java @@ -0,0 +1,30 @@ +package org.telegram.ui.Components; + +import android.content.Context; +import android.view.View; +import android.widget.LinearLayout; + +import org.telegram.ui.ActionBar.ActionBarPopupWindow; + +public class ChatScrimPopupContainerLayout extends LinearLayout { + + public View reactionsLayout; + public ActionBarPopupWindow.ActionBarPopupWindowLayout popupWindowLayout; + + public ChatScrimPopupContainerLayout(Context context) { + super(context); + setOrientation(LinearLayout.VERTICAL); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + if (reactionsLayout != null && popupWindowLayout != null && popupWindowLayout.getSwipeBack() != null && reactionsLayout.getLayoutParams().width != LayoutHelper.WRAP_CONTENT) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + int widthDiff = popupWindowLayout.getSwipeBack().getMeasuredWidth() - popupWindowLayout.getSwipeBack().getChildAt(0).getMeasuredWidth(); + ((LayoutParams)reactionsLayout.getLayoutParams()).rightMargin = widthDiff; + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + } else { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + } + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatThemeBottomSheet.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatThemeBottomSheet.java index d46506faf..9fd913d9b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatThemeBottomSheet.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatThemeBottomSheet.java @@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.annotation.SuppressLint; import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.graphics.BitmapShader; import android.graphics.Canvas; import android.graphics.Color; @@ -883,6 +884,7 @@ public class ChatThemeBottomSheet extends BottomSheet implements NotificationCen public int themeIndex; public boolean isSelected; public float animationProgress = 1f; + public Bitmap icon; public ChatThemeItem(EmojiThemes chatTheme) { this.chatTheme = chatTheme; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/CheckBox2.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/CheckBox2.java index d2e824e95..bf86ff1ea 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/CheckBox2.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/CheckBox2.java @@ -69,6 +69,10 @@ public class CheckBox2 extends View { checkBoxBase.onAttachedToWindow(); } + public void setDuration(long duration) { + checkBoxBase.animationDuration = duration; + } + @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/CheckBoxBase.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/CheckBoxBase.java index fbc0dd657..483e7622e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/CheckBoxBase.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/CheckBoxBase.java @@ -176,6 +176,7 @@ public class CheckBoxBase { } } + public long animationDuration = 200; private void animateToCheckedState(boolean newCheckedState) { checkAnimator = ObjectAnimator.ofFloat(this, "progress", newCheckedState ? 1 : 0); checkAnimator.addListener(new AnimatorListenerAdapter() { @@ -190,7 +191,7 @@ public class CheckBoxBase { } }); checkAnimator.setInterpolator(CubicBezierInterpolator.EASE_OUT); - checkAnimator.setDuration(200); + checkAnimator.setDuration(animationDuration); checkAnimator.start(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/CounterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/CounterView.java index c82fcf826..ee17c9e73 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/CounterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/CounterView.java @@ -16,8 +16,6 @@ import android.view.Gravity; import android.view.View; import android.view.animation.OvershootInterpolator; -import com.google.android.exoplayer2.util.Log; - import org.telegram.messenger.AndroidUtilities; import org.telegram.ui.ActionBar.Theme; @@ -30,7 +28,7 @@ public class CounterView extends View { super(context); this.resourcesProvider = resourcesProvider; setVisibility(View.GONE); - counterDrawable = new CounterDrawable(this, resourcesProvider); + counterDrawable = new CounterDrawable(this, true, resourcesProvider); counterDrawable.updateVisibility = true; } @@ -77,7 +75,7 @@ public class CounterView extends View { int animationType = -1; - public Paint circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG); + public Paint circlePaint; public TextPaint textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); public RectF rectF = new RectF(); public boolean addServiceGradient; @@ -85,7 +83,7 @@ public class CounterView extends View { int currentCount; private boolean countAnimationIncrement; private ValueAnimator countAnimator; - private float countChangeProgress = 1f; + public float countChangeProgress = 1f; private StaticLayout countLayout; private StaticLayout countOldLayout; private StaticLayout countAnimationStableLayout; @@ -107,21 +105,27 @@ public class CounterView extends View { private boolean reverseAnimation; public float horizontalPadding; + private boolean drawBackground = true; - boolean updateVisibility; + public boolean updateVisibility; private View parent; public final static int TYPE_DEFAULT = 0; public final static int TYPE_CHAT_PULLING_DOWN = 1; + public final static int TYPE_CHAT_REACTIONS = 2; int type = TYPE_DEFAULT; private final Theme.ResourcesProvider resourcesProvider; - public CounterDrawable(View parent, Theme.ResourcesProvider resourcesProvider) { + public CounterDrawable(View parent, boolean drawBackground, Theme.ResourcesProvider resourcesProvider) { this.parent = parent; this.resourcesProvider = resourcesProvider; - circlePaint.setColor(Color.BLACK); + this.drawBackground = drawBackground; + if (drawBackground) { + circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG); + circlePaint.setColor(Color.BLACK); + } textPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); textPaint.setTextSize(AndroidUtilities.dp(13)); } @@ -141,9 +145,11 @@ public class CounterView extends View { float countTop = (lastH - AndroidUtilities.dp(23)) / 2f; updateX(countWidth); rectF.set(x, countTop, x + countWidth + AndroidUtilities.dp(11), countTop + AndroidUtilities.dp(23)); - canvas.drawRoundRect(rectF, 11.5f * AndroidUtilities.density, 11.5f * AndroidUtilities.density, circlePaint); - if (addServiceGradient && Theme.hasGradientService()) { - canvas.drawRoundRect(rectF, 11.5f * AndroidUtilities.density, 11.5f * AndroidUtilities.density, Theme.chat_actionBackgroundGradientDarkenPaint); + if (circlePaint != null && drawBackground) { + canvas.drawRoundRect(rectF, 11.5f * AndroidUtilities.density, 11.5f * AndroidUtilities.density, circlePaint); + if (addServiceGradient && Theme.hasGradientService()) { + canvas.drawRoundRect(rectF, 11.5f * AndroidUtilities.density, 11.5f * AndroidUtilities.density, Theme.chat_actionBackgroundGradientDarkenPaint); + } } if (countLayout != null) { canvas.save(); @@ -264,14 +270,14 @@ public class CounterView extends View { } public void draw(Canvas canvas) { - if (type != TYPE_CHAT_PULLING_DOWN) { + if (type != TYPE_CHAT_PULLING_DOWN && type != TYPE_CHAT_REACTIONS) { int textColor = getThemedColor(textColorKey); int circleColor = getThemedColor(circleColorKey); if (this.textColor != textColor) { this.textColor = textColor; textPaint.setColor(textColor); } - if (this.circleColor != circleColor) { + if (circlePaint != null && this.circleColor != circleColor) { this.circleColor = circleColor; circlePaint.setColor(circleColor); } @@ -313,9 +319,11 @@ public class CounterView extends View { rectF.set(x, countTop, x + countWidth + AndroidUtilities.dp(11), countTop + AndroidUtilities.dp(23)); canvas.save(); canvas.scale(scale, scale, rectF.centerX(), rectF.centerY()); - canvas.drawRoundRect(rectF, 11.5f * AndroidUtilities.density, 11.5f * AndroidUtilities.density, circlePaint); - if (addServiceGradient && Theme.hasGradientService()) { - canvas.drawRoundRect(rectF, 11.5f * AndroidUtilities.density, 11.5f * AndroidUtilities.density, Theme.chat_actionBackgroundGradientDarkenPaint); + if (drawBackground && circlePaint != null) { + canvas.drawRoundRect(rectF, 11.5f * AndroidUtilities.density, 11.5f * AndroidUtilities.density, circlePaint); + if (addServiceGradient && Theme.hasGradientService()) { + canvas.drawRoundRect(rectF, 11.5f * AndroidUtilities.density, 11.5f * AndroidUtilities.density, Theme.chat_actionBackgroundGradientDarkenPaint); + } } canvas.clipRect(rectF); @@ -386,19 +394,20 @@ public class CounterView extends View { } private void updateX(float countWidth) { + float padding = drawBackground ? AndroidUtilities.dp(5.5f) : 0f; if (gravity == Gravity.RIGHT) { - countLeft = width - AndroidUtilities.dp(5.5f); + countLeft = width - padding; if (horizontalPadding != 0) { countLeft -= Math.max(horizontalPadding + countWidth / 2f, countWidth); } else { countLeft -= countWidth; } } else if (gravity == Gravity.LEFT) { - countLeft = AndroidUtilities.dp(5.5f); + countLeft = padding; } else { countLeft = (int) ((width - countWidth) / 2f); } - x = countLeft - AndroidUtilities.dp(5.5f); + x = countLeft - padding; } public float getCenterX() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextBoldCursor.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextBoldCursor.java index 0262166b1..c4095deb6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextBoldCursor.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextBoldCursor.java @@ -54,7 +54,7 @@ import org.telegram.ui.ActionBar.Theme; import java.lang.reflect.Field; import java.lang.reflect.Method; -public class EditTextBoldCursor extends EditText { +public class EditTextBoldCursor extends EditTextEffects { private static Field mEditor; private static Field mShowCursorField; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextCaption.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextCaption.java index 48385ece8..eb9bd6bc8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextCaption.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextCaption.java @@ -126,6 +126,12 @@ public class EditTextCaption extends EditTextBoldCursor { applyTextStyleToSelection(new TextStyleSpan(run)); } + public void makeSelectedSpoiler() { + TextStyleSpan.TextStyleRun run = new TextStyleSpan.TextStyleRun(); + run.flags |= TextStyleSpan.FLAG_STYLE_SPOILER; + applyTextStyleToSelection(new TextStyleSpan(run)); + } + public void makeSelectedItalic() { TextStyleSpan.TextStyleRun run = new TextStyleSpan.TextStyleRun(); run.flags |= TextStyleSpan.FLAG_STYLE_ITALIC; @@ -360,6 +366,9 @@ public class EditTextCaption extends EditTextBoldCursor { } else if (itemId == R.id.menu_underline) { makeSelectedUnderline(); return true; + } else if (itemId == R.id.menu_spoiler) { + makeSelectedSpoiler(); + return true; } return false; } @@ -475,6 +484,7 @@ public class EditTextCaption extends EditTextBoldCursor { } } if (hasSelection()) { + infoCompat.addAction(new AccessibilityNodeInfoCompat.AccessibilityActionCompat(R.id.menu_spoiler, LocaleController.getString("Spoiler", R.string.Spoiler))); infoCompat.addAction(new AccessibilityNodeInfoCompat.AccessibilityActionCompat(R.id.menu_bold, LocaleController.getString("Bold", R.string.Bold))); infoCompat.addAction(new AccessibilityNodeInfoCompat.AccessibilityActionCompat(R.id.menu_italic, LocaleController.getString("Italic", R.string.Italic))); infoCompat.addAction(new AccessibilityNodeInfoCompat.AccessibilityActionCompat(R.id.menu_mono, LocaleController.getString("Mono", R.string.Mono))); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEffects.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEffects.java new file mode 100644 index 000000000..5a61d9152 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEffects.java @@ -0,0 +1,273 @@ +package org.telegram.ui.Components; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Path; +import android.graphics.Rect; +import android.graphics.Region; +import android.text.Editable; +import android.text.Layout; +import android.text.Spannable; +import android.view.MotionEvent; +import android.widget.EditText; + +import org.telegram.ui.Components.spoilers.SpoilerEffect; +import org.telegram.ui.Components.spoilers.SpoilersClickDetector; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + +public class EditTextEffects extends EditText { + private final static int SPOILER_TIMEOUT = 10000; + + private List spoilers = new ArrayList<>(); + private Stack spoilersPool = new Stack<>(); + private boolean isSpoilersRevealed; + private boolean shouldRevealSpoilersByTouch = true; + private SpoilersClickDetector clickDetector; + private boolean suppressOnTextChanged; + private Path path = new Path(); + private int selStart, selEnd; + private float lastRippleX, lastRippleY; + private boolean postedSpoilerTimeout; + private Runnable spoilerTimeout = () -> { + postedSpoilerTimeout = false; + isSpoilersRevealed = false; + invalidateSpoilers(); + if (spoilers.isEmpty()) + return; + + spoilers.get(0).setOnRippleEndCallback(() -> post(() -> setSpoilersRevealed(false, true))); + float rad = (float) Math.sqrt(Math.pow(getWidth(), 2) + Math.pow(getHeight(), 2)); + for (SpoilerEffect eff : spoilers) { + eff.startRipple(lastRippleX, lastRippleY, rad, true); + } + }; + private Rect rect = new Rect(); + + public EditTextEffects(Context context) { + super(context); + + clickDetector = new SpoilersClickDetector(this, spoilers, this::onSpoilerClicked); + } + + private void onSpoilerClicked(SpoilerEffect eff, float x, float y) { + if (isSpoilersRevealed) return; + + lastRippleX = x; + lastRippleY = y; + + postedSpoilerTimeout = false; + removeCallbacks(spoilerTimeout); + + setSpoilersRevealed(true, false); + eff.setOnRippleEndCallback(() -> post(() -> { + invalidateSpoilers(); + checkSpoilerTimeout(); + })); + + float rad = (float) Math.sqrt(Math.pow(getWidth(), 2) + Math.pow(getHeight(), 2)); + for (SpoilerEffect ef : spoilers) + ef.startRipple(x, y, rad); + } + + @Override + protected void onSelectionChanged(int selStart, int selEnd) { + super.onSelectionChanged(selStart, selEnd); + + if (suppressOnTextChanged) + return; + + this.selStart = selStart; + this.selEnd = selEnd; + + checkSpoilerTimeout(); + } + + /** + * Checks for spoiler timeout to be posted + */ + private void checkSpoilerTimeout() { + boolean onSpoiler = false; + CharSequence cs = getLayout() != null ? getLayout().getText() : null; + if (cs instanceof Spannable) { + Spannable e = (Spannable) cs; + TextStyleSpan[] spans = e.getSpans(0, e.length(), TextStyleSpan.class); + for (TextStyleSpan span : spans) { + int ss = e.getSpanStart(span), se = e.getSpanEnd(span); + if (span.isSpoiler()) { + if (ss > selStart && se < selEnd || selStart > ss && selStart < se || selEnd > ss && selEnd < se) { + onSpoiler = true; + removeCallbacks(spoilerTimeout); + postedSpoilerTimeout = false; + break; + } + } + } + } + + if (isSpoilersRevealed && !onSpoiler && !postedSpoilerTimeout) { + postedSpoilerTimeout = true; + postDelayed(spoilerTimeout, SPOILER_TIMEOUT); + } + } + + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + + removeCallbacks(spoilerTimeout); + } + + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + invalidateEffects(); + } + + @Override + protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) { + super.onTextChanged(text, start, lengthBefore, lengthAfter); + if (!suppressOnTextChanged) { + invalidateEffects(); + + Layout layout = getLayout(); + if (text instanceof Spannable && layout != null) { + int line = layout.getLineForOffset(start); + int x = (int) layout.getPrimaryHorizontal(start); + int y = (int) ((layout.getLineTop(line) + layout.getLineBottom(line)) / 2f); + + for (SpoilerEffect eff : spoilers) { + if (eff.getBounds().contains(x, y)) { + int selOffset = lengthAfter - lengthBefore; + selStart += selOffset; + selEnd += selOffset; + onSpoilerClicked(eff, x, y); + break; + } + } + } + } + } + + @Override + public void setText(CharSequence text, BufferType type) { + if (!suppressOnTextChanged) { + isSpoilersRevealed = false; + if (spoilersPool != null) // Constructor check + spoilersPool.clear(); + } + super.setText(text, type); + } + + /** + * Sets if spoilers should be revealed by touch or not + */ + public void setShouldRevealSpoilersByTouch(boolean shouldRevealSpoilersByTouch) { + this.shouldRevealSpoilersByTouch = shouldRevealSpoilersByTouch; + } + + @Override + public boolean dispatchTouchEvent(MotionEvent event) { + boolean detector = false; + if (shouldRevealSpoilersByTouch && clickDetector.onTouchEvent(event)) { + int act = event.getActionMasked(); + if (act == MotionEvent.ACTION_UP) { + MotionEvent c = MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0, 0, 0); + super.dispatchTouchEvent(c); + c.recycle(); + } + detector = true; + } + return super.dispatchTouchEvent(event) || detector; + } + + /** + * Sets if spoiler are already revealed or not + */ + public void setSpoilersRevealed(boolean spoilersRevealed, boolean notifyEffects) { + isSpoilersRevealed = spoilersRevealed; + Spannable text = getText(); + if (text != null) { + TextStyleSpan[] spans = text.getSpans(0, text.length(), TextStyleSpan.class); + for (TextStyleSpan span : spans) { + if (span.isSpoiler()) { + span.setSpoilerRevealed(spoilersRevealed); + } + } + } + suppressOnTextChanged = true; + setText(text, BufferType.EDITABLE); + setSelection(selStart, selEnd); + suppressOnTextChanged = false; + + if (notifyEffects) { + invalidateSpoilers(); + } + } + + @Override + protected void onDraw(Canvas canvas) { + canvas.save(); + path.rewind(); + for (SpoilerEffect eff : spoilers) { + Rect bounds = eff.getBounds(); + path.addRect(bounds.left, bounds.top, bounds.right, bounds.bottom, Path.Direction.CW); + } + canvas.clipPath(path, Region.Op.DIFFERENCE); + super.onDraw(canvas); + canvas.restore(); + + canvas.save(); + canvas.clipPath(path); + path.rewind(); + if (!spoilers.isEmpty()) + spoilers.get(0).getRipplePath(path); + canvas.clipPath(path); + canvas.translate(0, -getPaddingTop()); + super.onDraw(canvas); + canvas.restore(); + + rect.set(0, getScrollY(), getWidth(), getScrollY() + getHeight() - getPaddingBottom()); + canvas.save(); + canvas.clipRect(rect); + for (SpoilerEffect eff : spoilers) { + Rect b = eff.getBounds(); + if (rect.top <= b.bottom && rect.bottom >= b.top || b.top <= rect.bottom && b.bottom >= rect.top) { + eff.setColor(getPaint().getColor()); + eff.draw(canvas); + } + } + canvas.restore(); + } + + public void invalidateEffects() { + Editable text = getText(); + if (text != null) { + for (TextStyleSpan span : text.getSpans(0, text.length(), TextStyleSpan.class)) { + if (span.isSpoiler()) { + span.setSpoilerRevealed(isSpoilersRevealed); + } + } + } + invalidateSpoilers(); + } + + private void invalidateSpoilers() { + if (spoilers == null) return; // A null-check for super constructor, because it calls onTextChanged + spoilersPool.addAll(spoilers); + spoilers.clear(); + + if (isSpoilersRevealed) { + invalidate(); + return; + } + + Layout layout = getLayout(); + if (layout != null && layout.getText() instanceof Spannable) { + SpoilerEffect.addSpoilers(this, spoilersPool, spoilers); + } + invalidate(); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/FlickerLoadingView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/FlickerLoadingView.java index b739436ed..91e4410b2 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/FlickerLoadingView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/FlickerLoadingView.java @@ -34,6 +34,8 @@ public class FlickerLoadingView extends View { public final static int MESSAGE_SEEN_TYPE = 13; public final static int CHAT_THEMES_TYPE = 14; public final static int MEMBER_REQUESTS_TYPE = 15; + public final static int REACTED_TYPE = 16; + public final static int QR_TYPE = 17; private int gradientWidth; private LinearGradient gradient; @@ -125,7 +127,6 @@ public class FlickerLoadingView extends View { @Override protected void onDraw(Canvas canvas) { - Paint paint = this.paint; if (globalGradientView != null) { if (getParent() != null) { @@ -441,7 +442,7 @@ public class FlickerLoadingView extends View { canvas.drawCircle(getMeasuredWidth() - AndroidUtilities.dp(8 + 24 + 12 + 12) + AndroidUtilities.dp(13) + AndroidUtilities.dp(12) * i, cy, AndroidUtilities.dp(13f), backgroundPaint); canvas.drawCircle(getMeasuredWidth() - AndroidUtilities.dp(8 + 24 + 12 + 12) + AndroidUtilities.dp(13) + AndroidUtilities.dp(12) * i, cy, AndroidUtilities.dp(12f), paint); } - } else if (getViewType() == CHAT_THEMES_TYPE) { + } else if (getViewType() == CHAT_THEMES_TYPE || getViewType() == QR_TYPE) { int x = AndroidUtilities.dp(12); int itemWidth = AndroidUtilities.dp(77); int INNER_RECT_SPACE = AndroidUtilities.dp(4); @@ -455,17 +456,26 @@ public class FlickerLoadingView extends View { backgroundPaint.setColor(Theme.getColor(Theme.key_dialogBackground)); } - float bubbleTop = INNER_RECT_SPACE + AndroidUtilities.dp(8); - float bubbleLeft = INNER_RECT_SPACE + AndroidUtilities.dp(22); AndroidUtilities.rectTmp.set(x + AndroidUtilities.dp(4), AndroidUtilities.dp(4), x + itemWidth - AndroidUtilities.dp(4), getMeasuredHeight() - AndroidUtilities.dp(4)); canvas.drawRoundRect(AndroidUtilities.rectTmp, AndroidUtilities.dp(6), AndroidUtilities.dp(6), paint); - rectF.set(x + bubbleLeft, bubbleTop, x + bubbleLeft + BUBBLE_WIDTH, bubbleTop + BUBBLE_HEIGHT); - canvas.drawRoundRect(rectF, rectF.height() * 0.5f, rectF.height() * 0.5f, backgroundPaint); - bubbleLeft = INNER_RECT_SPACE + AndroidUtilities.dp(5); - bubbleTop += BUBBLE_HEIGHT + AndroidUtilities.dp(4); - rectF.set(x + bubbleLeft, bubbleTop, x + bubbleLeft + BUBBLE_WIDTH, bubbleTop + BUBBLE_HEIGHT); - canvas.drawRoundRect(rectF, rectF.height() * 0.5f, rectF.height() * 0.5f, backgroundPaint); + if (getViewType() == CHAT_THEMES_TYPE) { + float bubbleTop = INNER_RECT_SPACE + AndroidUtilities.dp(8); + float bubbleLeft = INNER_RECT_SPACE + AndroidUtilities.dp(22); + rectF.set(x + bubbleLeft, bubbleTop, x + bubbleLeft + BUBBLE_WIDTH, bubbleTop + BUBBLE_HEIGHT); + canvas.drawRoundRect(rectF, rectF.height() * 0.5f, rectF.height() * 0.5f, backgroundPaint); + bubbleLeft = INNER_RECT_SPACE + AndroidUtilities.dp(5); + bubbleTop += BUBBLE_HEIGHT + AndroidUtilities.dp(4); + rectF.set(x + bubbleLeft, bubbleTop, x + bubbleLeft + BUBBLE_WIDTH, bubbleTop + BUBBLE_HEIGHT); + canvas.drawRoundRect(rectF, rectF.height() * 0.5f, rectF.height() * 0.5f, backgroundPaint); + } else if (getViewType() == QR_TYPE) { + float radius = AndroidUtilities.dp(5); + float squareSize = AndroidUtilities.dp(32); + float left = x + (itemWidth - squareSize) / 2; + int top = AndroidUtilities.dp(21); + AndroidUtilities.rectTmp.set(left, top, left + squareSize, top + AndroidUtilities.dp(32)); + canvas.drawRoundRect(AndroidUtilities.rectTmp, radius, radius, backgroundPaint); + } canvas.drawCircle(x + itemWidth / 2, getMeasuredHeight() - AndroidUtilities.dp(20), AndroidUtilities.dp(8), backgroundPaint); @@ -492,6 +502,27 @@ public class FlickerLoadingView extends View { break; } } + } else if (getViewType() == REACTED_TYPE) { + int k = 0; + while (h <= getMeasuredHeight()) { + int r = AndroidUtilities.dp(16); + canvas.drawCircle(checkRtl(paddingLeft + AndroidUtilities.dp(13) + r), h + AndroidUtilities.dp(24), r, paint); + + rectF.set(paddingLeft + AndroidUtilities.dp(53), h + AndroidUtilities.dp(20), getWidth() - AndroidUtilities.dp(53), h + AndroidUtilities.dp(28)); + checkRtl(rectF); + canvas.drawRoundRect(rectF, AndroidUtilities.dp(8), AndroidUtilities.dp(8), paint); + + if (k < 4) { + r = AndroidUtilities.dp(12); + canvas.drawCircle(checkRtl(getWidth() - AndroidUtilities.dp(12) - r), h + AndroidUtilities.dp(24), r, paint); + } + + h += getCellHeight(getMeasuredWidth()); + k++; + if (isSingleCell && k >= itemsCount) { + break; + } + } } invalidate(); } @@ -518,7 +549,7 @@ public class FlickerLoadingView extends View { height = getMeasuredHeight(); } lastUpdateTime = newUpdateTime; - if (isSingleCell || viewType == MESSAGE_SEEN_TYPE || getViewType() == CHAT_THEMES_TYPE) { + if (isSingleCell || viewType == MESSAGE_SEEN_TYPE || getViewType() == CHAT_THEMES_TYPE || getViewType() == QR_TYPE) { totalTranslation += dt * width / 400.0f; if (totalTranslation >= width * 2) { totalTranslation = -gradientWidth * 2; @@ -546,7 +577,7 @@ public class FlickerLoadingView extends View { if (this.color1 != color1 || this.color0 != color0) { this.color0 = color0; this.color1 = color1; - if (isSingleCell || viewType == MESSAGE_SEEN_TYPE || viewType == CHAT_THEMES_TYPE) { + if (isSingleCell || viewType == MESSAGE_SEEN_TYPE || viewType == CHAT_THEMES_TYPE || viewType == QR_TYPE) { gradient = new LinearGradient(0, 0, gradientWidth = AndroidUtilities.dp(200), 0, new int[]{color1, color0, color0, color1}, new float[]{0.0f, 0.4f, 0.6f, 1f}, Shader.TileMode.CLAMP); } else { gradient = new LinearGradient(0, 0, 0, gradientWidth = AndroidUtilities.dp(600), new int[]{color1, color0, color0, color1}, new float[]{0.0f, 0.4f, 0.6f, 1f}, Shader.TileMode.CLAMP); @@ -597,6 +628,8 @@ public class FlickerLoadingView extends View { return AndroidUtilities.dp(103); } else if (getViewType() == MEMBER_REQUESTS_TYPE) { return AndroidUtilities.dp(107); + } else if (getViewType() == REACTED_TYPE) { + return AndroidUtilities.dp(48); } return 0; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ForwardingPreviewView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ForwardingPreviewView.java index f5ee2d2fd..de2c40e00 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ForwardingPreviewView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ForwardingPreviewView.java @@ -977,6 +977,7 @@ public class ForwardingPreviewView extends FrameLayout { @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { ChatMessageCell cell = (ChatMessageCell) holder.itemView; + cell.setInvalidateSpoilersParent(forwardingMessagesParams.hasSpoilers); cell.setParentViewSize(chatListView.getMeasuredWidth(), chatListView.getMeasuredHeight()); int id = cell.getMessageObject() != null ? cell.getMessageObject().getId() : 0; cell.setMessageObject(forwardingMessagesParams.previewMessages.get(position), forwardingMessagesParams.groupedMessagesMap.get(forwardingMessagesParams.previewMessages.get(position).getGroupId()), true, true); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/FragmentContextView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/FragmentContextView.java index a581b4240..c3647b51c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/FragmentContextView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/FragmentContextView.java @@ -1860,7 +1860,7 @@ public class FragmentContextView extends FrameLayout implements NotificationCent frameLayout.invalidate(); } - updateAvatars(avatars.wasDraw && updateAnimated); + updateAvatars(avatars.avatarsDarawable.wasDraw && updateAnimated); } else { if (voIPService != null && voIPService.groupCall != null) { updateAvatars(currentStyle == 3); @@ -1919,14 +1919,14 @@ public class FragmentContextView extends FrameLayout implements NotificationCent private void updateAvatars(boolean animated) { if (!animated) { - if (avatars.transitionProgressAnimator != null) { - avatars.transitionProgressAnimator.cancel(); - avatars.transitionProgressAnimator = null; + if (avatars.avatarsDarawable.transitionProgressAnimator != null) { + avatars.avatarsDarawable.transitionProgressAnimator.cancel(); + avatars.avatarsDarawable.transitionProgressAnimator = null; } } ChatObject.Call call; TLRPC.User userCall; - if (avatars.transitionProgressAnimator == null) { + if (avatars.avatarsDarawable.transitionProgressAnimator == null) { int currentAccount; if (currentStyle == 4) { if (fragment instanceof ChatActivity) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/GestureDetectorFixDoubleTap.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/GestureDetectorFixDoubleTap.java new file mode 100644 index 000000000..076f4e96d --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/GestureDetectorFixDoubleTap.java @@ -0,0 +1,530 @@ +package org.telegram.ui.Components; + +import android.content.Context; +import android.os.Handler; +import android.os.Message; +import android.view.GestureDetector; +import android.view.GestureDetector.OnDoubleTapListener; +import android.view.GestureDetector.OnGestureListener; +import android.view.MotionEvent; +import android.view.VelocityTracker; +import android.view.ViewConfiguration; + +public class GestureDetectorFixDoubleTap { + interface GestureDetectorCompatImpl { + boolean isLongpressEnabled(); + boolean onTouchEvent(MotionEvent ev); + void setIsLongpressEnabled(boolean enabled); + void setOnDoubleTapListener(OnDoubleTapListener listener); + } + + static class GestureDetectorCompatImplBase implements GestureDetectorCompatImpl { + private int mTouchSlopSquare; + private int mDoubleTapSlopSquare; + private int mMinimumFlingVelocity; + private int mMaximumFlingVelocity; + + private static final int TAP_TIMEOUT = ViewConfiguration.getTapTimeout(); + private static final int DOUBLE_TAP_TIMEOUT = 220; + + // constants for Message.what used by GestureHandler below + private static final int SHOW_PRESS = 1; + private static final int LONG_PRESS = 2; + private static final int TAP = 3; + + private final Handler mHandler; + final OnGestureListener mListener; + OnDoubleTapListener mDoubleTapListener; + + boolean mStillDown; + boolean mDeferConfirmSingleTap; + private boolean mInLongPress; + private boolean mAlwaysInTapRegion; + private boolean mAlwaysInBiggerTapRegion; + + MotionEvent mCurrentDownEvent; + private MotionEvent mPreviousUpEvent; + + /** + * True when the user is still touching for the second tap (down, move, and + * up events). Can only be true if there is a double tap listener attached. + */ + private boolean mIsDoubleTapping; + + private float mLastFocusX; + private float mLastFocusY; + private float mDownFocusX; + private float mDownFocusY; + + private boolean mIsLongpressEnabled; + + /** + * Determines speed during touch scrolling + */ + private VelocityTracker mVelocityTracker; + + private class GestureHandler extends Handler { + @SuppressWarnings("deprecation") + GestureHandler() { + super(); + } + + GestureHandler(Handler handler) { + super(handler.getLooper()); + } + + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + case SHOW_PRESS: + mListener.onShowPress(mCurrentDownEvent); + break; + + case LONG_PRESS: + dispatchLongPress(); + break; + + case TAP: + // If the user's finger is still down, do not count it as a tap + if (mDoubleTapListener != null) { + if (!mStillDown) { + mDoubleTapListener.onSingleTapConfirmed(mCurrentDownEvent); + } else { + mDeferConfirmSingleTap = true; + } + } + break; + + default: + throw new RuntimeException("Unknown message " + msg); //never + } + } + } + + /** + * Creates a GestureDetector with the supplied listener. + * You may only use this constructor from a UI thread (this is the usual situation). + * @see android.os.Handler#Handler() + * + * @param context the application's context + * @param listener the listener invoked for all the callbacks, this must + * not be null. + * @param handler the handler to use + * + * @throws NullPointerException if {@code listener} is null. + */ + GestureDetectorCompatImplBase(Context context, OnGestureListener listener, + Handler handler) { + if (handler != null) { + mHandler = new GestureHandler(handler); + } else { + mHandler = new GestureHandler(); + } + mListener = listener; + if (listener instanceof OnDoubleTapListener) { + setOnDoubleTapListener((OnDoubleTapListener) listener); + } + init(context); + } + + private void init(Context context) { + if (context == null) { + throw new IllegalArgumentException("Context must not be null"); + } + if (mListener == null) { + throw new IllegalArgumentException("OnGestureListener must not be null"); + } + mIsLongpressEnabled = true; + + final ViewConfiguration configuration = ViewConfiguration.get(context); + final int touchSlop = configuration.getScaledTouchSlop(); + final int doubleTapSlop = configuration.getScaledDoubleTapSlop(); + mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity(); + mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity(); + + mTouchSlopSquare = touchSlop * touchSlop; + mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop; + } + + /** + * Sets the listener which will be called for double-tap and related + * gestures. + * + * @param onDoubleTapListener the listener invoked for all the callbacks, or + * null to stop listening for double-tap gestures. + */ + @Override + public void setOnDoubleTapListener(OnDoubleTapListener onDoubleTapListener) { + mDoubleTapListener = onDoubleTapListener; + } + + /** + * Set whether longpress is enabled, if this is enabled when a user + * presses and holds down you get a longpress event and nothing further. + * If it's disabled the user can press and hold down and then later + * moved their finger and you will get scroll events. By default + * longpress is enabled. + * + * @param isLongpressEnabled whether longpress should be enabled. + */ + @Override + public void setIsLongpressEnabled(boolean isLongpressEnabled) { + mIsLongpressEnabled = isLongpressEnabled; + } + + /** + * @return true if longpress is enabled, else false. + */ + @Override + public boolean isLongpressEnabled() { + return mIsLongpressEnabled; + } + + /** + * Analyzes the given motion event and if applicable triggers the + * appropriate callbacks on the {@link OnGestureListener} supplied. + * + * @param ev The current motion event. + * @return true if the {@link OnGestureListener} consumed the event, + * else false. + */ + @Override + public boolean onTouchEvent(MotionEvent ev) { + final int action = ev.getAction(); + + if (mVelocityTracker == null) { + mVelocityTracker = VelocityTracker.obtain(); + } + mVelocityTracker.addMovement(ev); + + final boolean pointerUp = + (action & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_POINTER_UP; + final int skipIndex = pointerUp ? ev.getActionIndex() : -1; + + // Determine focal point + float sumX = 0, sumY = 0; + final int count = ev.getPointerCount(); + for (int i = 0; i < count; i++) { + if (skipIndex == i) continue; + sumX += ev.getX(i); + sumY += ev.getY(i); + } + final int div = pointerUp ? count - 1 : count; + final float focusX = sumX / div; + final float focusY = sumY / div; + + boolean handled = false; + + switch (action & MotionEvent.ACTION_MASK) { + case MotionEvent.ACTION_POINTER_DOWN: + mDownFocusX = mLastFocusX = focusX; + mDownFocusY = mLastFocusY = focusY; + // Cancel long press and taps + cancelTaps(); + break; + + case MotionEvent.ACTION_POINTER_UP: + mDownFocusX = mLastFocusX = focusX; + mDownFocusY = mLastFocusY = focusY; + + // Check the dot product of current velocities. + // If the pointer that left was opposing another velocity vector, clear. + mVelocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity); + final int upIndex = ev.getActionIndex(); + final int id1 = ev.getPointerId(upIndex); + final float x1 = mVelocityTracker.getXVelocity(id1); + final float y1 = mVelocityTracker.getYVelocity(id1); + for (int i = 0; i < count; i++) { + if (i == upIndex) continue; + + final int id2 = ev.getPointerId(i); + final float x = x1 * mVelocityTracker.getXVelocity(id2); + final float y = y1 * mVelocityTracker.getYVelocity(id2); + + final float dot = x + y; + if (dot < 0) { + mVelocityTracker.clear(); + break; + } + } + break; + + case MotionEvent.ACTION_DOWN: + if (mDoubleTapListener != null) { + boolean hadTapMessage = mHandler.hasMessages(TAP); + if (hadTapMessage) mHandler.removeMessages(TAP); + if ((mCurrentDownEvent != null) && (mPreviousUpEvent != null) + && hadTapMessage && isConsideredDoubleTap( + mCurrentDownEvent, mPreviousUpEvent, ev)) { + // This is a second tap + mIsDoubleTapping = true; + // Give a callback with the first tap of the double-tap + handled |= mDoubleTapListener.onDoubleTap(mCurrentDownEvent); + // Give a callback with down event of the double-tap + handled |= mDoubleTapListener.onDoubleTapEvent(ev); + } else { + // This is a first tap + mHandler.sendEmptyMessageDelayed(TAP, DOUBLE_TAP_TIMEOUT); + } + } + + mDownFocusX = mLastFocusX = focusX; + mDownFocusY = mLastFocusY = focusY; + if (mCurrentDownEvent != null) { + mCurrentDownEvent.recycle(); + } + mCurrentDownEvent = MotionEvent.obtain(ev); + mAlwaysInTapRegion = true; + mAlwaysInBiggerTapRegion = true; + mStillDown = true; + mInLongPress = false; + mDeferConfirmSingleTap = false; + + if (mIsLongpressEnabled) { + mHandler.removeMessages(LONG_PRESS); + mHandler.sendEmptyMessageAtTime(LONG_PRESS, mCurrentDownEvent.getDownTime() + + TAP_TIMEOUT + ViewConfiguration.getLongPressTimeout()); + } + mHandler.sendEmptyMessageAtTime(SHOW_PRESS, + mCurrentDownEvent.getDownTime() + TAP_TIMEOUT); + handled |= mListener.onDown(ev); + break; + + case MotionEvent.ACTION_MOVE: + if (mInLongPress) { + break; + } + final float scrollX = mLastFocusX - focusX; + final float scrollY = mLastFocusY - focusY; + if (mIsDoubleTapping) { + // Give the move events of the double-tap + handled |= mDoubleTapListener.onDoubleTapEvent(ev); + } else if (mAlwaysInTapRegion) { + final int deltaX = (int) (focusX - mDownFocusX); + final int deltaY = (int) (focusY - mDownFocusY); + int distance = (deltaX * deltaX) + (deltaY * deltaY); + if (distance > mTouchSlopSquare) { + handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY); + mLastFocusX = focusX; + mLastFocusY = focusY; + mAlwaysInTapRegion = false; + mHandler.removeMessages(TAP); + mHandler.removeMessages(SHOW_PRESS); + mHandler.removeMessages(LONG_PRESS); + } + if (distance > mTouchSlopSquare) { + mAlwaysInBiggerTapRegion = false; + } + } else if ((Math.abs(scrollX) >= 1) || (Math.abs(scrollY) >= 1)) { + handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY); + mLastFocusX = focusX; + mLastFocusY = focusY; + } + break; + + case MotionEvent.ACTION_UP: + mStillDown = false; + MotionEvent currentUpEvent = MotionEvent.obtain(ev); + if (mIsDoubleTapping) { + // Finally, give the up event of the double-tap + handled |= mDoubleTapListener.onDoubleTapEvent(ev); + } else if (mInLongPress) { + mHandler.removeMessages(TAP); + mInLongPress = false; + } else if (mAlwaysInTapRegion) { + handled = mListener.onSingleTapUp(ev); + if (mDeferConfirmSingleTap && mDoubleTapListener != null) { + mDoubleTapListener.onSingleTapConfirmed(ev); + } + } else { + // A fling must travel the minimum tap distance + final VelocityTracker velocityTracker = mVelocityTracker; + final int pointerId = ev.getPointerId(0); + velocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity); + final float velocityY = velocityTracker.getYVelocity(pointerId); + final float velocityX = velocityTracker.getXVelocity(pointerId); + + if ((Math.abs(velocityY) > mMinimumFlingVelocity) + || (Math.abs(velocityX) > mMinimumFlingVelocity)) { + handled = mListener.onFling( + mCurrentDownEvent, ev, velocityX, velocityY); + } + } + if (mPreviousUpEvent != null) { + mPreviousUpEvent.recycle(); + } + // Hold the event we obtained above - listeners may have changed the original. + mPreviousUpEvent = currentUpEvent; + if (mVelocityTracker != null) { + // This may have been cleared when we called out to the + // application above. + mVelocityTracker.recycle(); + mVelocityTracker = null; + } + mIsDoubleTapping = false; + mDeferConfirmSingleTap = false; + mHandler.removeMessages(SHOW_PRESS); + mHandler.removeMessages(LONG_PRESS); + break; + + case MotionEvent.ACTION_CANCEL: + cancel(); + break; + } + + return handled; + } + + private void cancel() { + mHandler.removeMessages(SHOW_PRESS); + mHandler.removeMessages(LONG_PRESS); + mHandler.removeMessages(TAP); + mVelocityTracker.recycle(); + mVelocityTracker = null; + mIsDoubleTapping = false; + mStillDown = false; + mAlwaysInTapRegion = false; + mAlwaysInBiggerTapRegion = false; + mDeferConfirmSingleTap = false; + if (mInLongPress) { + mInLongPress = false; + } + } + + private void cancelTaps() { + mHandler.removeMessages(SHOW_PRESS); + mHandler.removeMessages(LONG_PRESS); + mHandler.removeMessages(TAP); + mIsDoubleTapping = false; + mAlwaysInTapRegion = false; + mAlwaysInBiggerTapRegion = false; + mDeferConfirmSingleTap = false; + if (mInLongPress) { + mInLongPress = false; + } + } + + private boolean isConsideredDoubleTap(MotionEvent firstDown, MotionEvent firstUp, + MotionEvent secondDown) { + if (!mAlwaysInBiggerTapRegion) { + return false; + } + + if (secondDown.getEventTime() - firstUp.getEventTime() > DOUBLE_TAP_TIMEOUT) { + return false; + } + + int deltaX = (int) firstDown.getX() - (int) secondDown.getX(); + int deltaY = (int) firstDown.getY() - (int) secondDown.getY(); + return (deltaX * deltaX + deltaY * deltaY < mDoubleTapSlopSquare); + } + + void dispatchLongPress() { + mHandler.removeMessages(TAP); + mDeferConfirmSingleTap = false; + mInLongPress = true; + mListener.onLongPress(mCurrentDownEvent); + } + } + + static class GestureDetectorCompatImplJellybeanMr2 implements GestureDetectorCompatImpl { + private final GestureDetector mDetector; + + GestureDetectorCompatImplJellybeanMr2(Context context, OnGestureListener listener, + Handler handler) { + mDetector = new GestureDetector(context, listener, handler); + } + + @Override + public boolean isLongpressEnabled() { + return mDetector.isLongpressEnabled(); + } + + @Override + public boolean onTouchEvent(MotionEvent ev) { + return mDetector.onTouchEvent(ev); + } + + @Override + public void setIsLongpressEnabled(boolean enabled) { + mDetector.setIsLongpressEnabled(enabled); + } + + @Override + public void setOnDoubleTapListener(OnDoubleTapListener listener) { + mDetector.setOnDoubleTapListener(listener); + } + } + + private final GestureDetectorCompatImpl mImpl; + + /** + * Creates a GestureDetectorCompat with the supplied listener. + * As usual, you may only use this constructor from a UI thread. + * @see android.os.Handler#Handler() + * + * @param context the application's context + * @param listener the listener invoked for all the callbacks, this must + * not be null. + */ + public GestureDetectorFixDoubleTap(Context context, OnGestureListener listener) { + this(context, listener, null); + } + + /** + * Creates a GestureDetectorCompat with the supplied listener. + * As usual, you may only use this constructor from a UI thread. + * @see android.os.Handler#Handler() + * + * @param context the application's context + * @param listener the listener invoked for all the callbacks, this must + * not be null. + * @param handler the handler that will be used for posting deferred messages + */ + public GestureDetectorFixDoubleTap(Context context, OnGestureListener listener, Handler handler) { + mImpl = new GestureDetectorCompatImplBase(context, listener, handler); + } + + /** + * @return true if longpress is enabled, else false. + */ + public boolean isLongpressEnabled() { + return mImpl.isLongpressEnabled(); + } + + /** + * Analyzes the given motion event and if applicable triggers the + * appropriate callbacks on the {@link OnGestureListener} supplied. + * + * @param event The current motion event. + * @return true if the {@link OnGestureListener} consumed the event, + * else false. + */ + public boolean onTouchEvent(MotionEvent event) { + return mImpl.onTouchEvent(event); + } + + /** + * Set whether longpress is enabled, if this is enabled when a user + * presses and holds down you get a longpress event and nothing further. + * If it's disabled the user can press and hold down and then later + * moved their finger and you will get scroll events. By default + * longpress is enabled. + * + * @param enabled whether longpress should be enabled. + */ + public void setIsLongpressEnabled(boolean enabled) { + mImpl.setIsLongpressEnabled(enabled); + } + + /** + * Sets the listener which will be called for double-tap and related + * gestures. + * + * @param listener the listener invoked for all the callbacks, or + * null to stop listening for double-tap gestures. + */ + public void setOnDoubleTapListener(OnDoubleTapListener listener) { + mImpl.setOnDoubleTapListener(listener); + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/GroupCallPip.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/GroupCallPip.java index 7a0df8e92..9809cc792 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/GroupCallPip.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/GroupCallPip.java @@ -670,7 +670,7 @@ public class GroupCallPip implements NotificationCenter.NotificationCenterDelega } private void updateAvatars(boolean animated) { - if (avatarsImageView.transitionProgressAnimator == null) { + if (avatarsImageView.avatarsDarawable.transitionProgressAnimator == null) { ChatObject.Call call; VoIPService voIPService = VoIPService.getSharedInstance(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/LerpedLayoutParams.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/LerpedLayoutParams.java new file mode 100644 index 000000000..c1f669f4f --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/LerpedLayoutParams.java @@ -0,0 +1,56 @@ +package org.telegram.ui.Components; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.FrameLayout; + +public class LerpedLayoutParams extends ViewGroup.MarginLayoutParams { + + private ViewGroup.LayoutParams from; + private ViewGroup.LayoutParams to; + public LerpedLayoutParams( + ViewGroup.LayoutParams from, + ViewGroup.LayoutParams to + ) { + super(from == null ? to : from); + this.from = from; + this.to = to; + } + + public void apply(float t) { + t = Math.min(Math.max(t, 0), 1); + + this.width = lerpSz(from.width, to.width, t); + this.height = lerpSz(from.height, to.height, t); + if (from instanceof ViewGroup.MarginLayoutParams && to instanceof ViewGroup.MarginLayoutParams) { + ViewGroup.MarginLayoutParams marginFrom = (ViewGroup.MarginLayoutParams) from; + ViewGroup.MarginLayoutParams marginTo = (ViewGroup.MarginLayoutParams) to; + this.topMargin = lerp(marginFrom.topMargin, marginTo.topMargin, t); + this.leftMargin = lerp(marginFrom.leftMargin, marginTo.leftMargin, t); + this.rightMargin = lerp(marginFrom.rightMargin, marginTo.rightMargin, t); + this.bottomMargin = lerp(marginFrom.bottomMargin, marginTo.bottomMargin, t); + } else if (from instanceof ViewGroup.MarginLayoutParams) { + ViewGroup.MarginLayoutParams marginFrom = (ViewGroup.MarginLayoutParams) from; + this.topMargin = marginFrom.topMargin; + this.leftMargin = marginFrom.leftMargin; + this.rightMargin = marginFrom.rightMargin; + this.bottomMargin = marginFrom.bottomMargin; + } else if (to instanceof ViewGroup.MarginLayoutParams) { + ViewGroup.MarginLayoutParams marginTo = (ViewGroup.MarginLayoutParams) to; + this.topMargin = marginTo.topMargin; + this.leftMargin = marginTo.leftMargin; + this.rightMargin = marginTo.rightMargin; + this.bottomMargin = marginTo.bottomMargin; + } + } + + private int lerp(int from, int to, float t) { + return (int) (from + (to - from) * t); + } + private int lerpSz(int from, int to, float t) { + if (from < 0 || to < 0) // MATCH_PARENT or WRAP_CONTENT + return t < .5f ? from : to; + return lerp(from, to, t); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/MotionBackgroundDrawable.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/MotionBackgroundDrawable.java index ef3687770..5046120bb 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/MotionBackgroundDrawable.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/MotionBackgroundDrawable.java @@ -57,7 +57,7 @@ public class MotionBackgroundDrawable extends Drawable { private boolean isPreview; - private float posAnimationProgress = 1.0f; + public float posAnimationProgress = 1.0f; private int phase; private RectF rect = new RectF(); @@ -103,6 +103,9 @@ public class MotionBackgroundDrawable extends Drawable { private ColorFilter legacyBitmapColorFilter; private int legacyBitmapColor; + private boolean isIndeterminateAnimation; + private Paint overrideBitmapPaint; + public MotionBackgroundDrawable() { super(); init(); @@ -587,7 +590,7 @@ public class MotionBackgroundDrawable extends Drawable { gradientDrawable.draw(canvas); } else { rect.set(x, y, x + width, y + height); - canvas.drawBitmap(currentBitmap, null, rect, paint); + canvas.drawBitmap(currentBitmap, null, rect, overrideBitmapPaint != null ? overrideBitmapPaint : paint); } } @@ -611,7 +614,7 @@ public class MotionBackgroundDrawable extends Drawable { updateAnimation(); } - private void updateAnimation() { + public void updateAnimation() { long newTime = SystemClock.elapsedRealtime(); long dt = newTime - lastUpdateTime; if (dt > 20) { @@ -622,79 +625,94 @@ public class MotionBackgroundDrawable extends Drawable { return; } + if (isIndeterminateAnimation && posAnimationProgress == 1.0f) { + posAnimationProgress = 0f; + } if (posAnimationProgress < 1.0f) { float progress; - if (rotatingPreview) { - int stageBefore; - float progressBefore = interpolator.getInterpolation(posAnimationProgress); - if (progressBefore <= 0.25f) { - stageBefore = 0; - } else if (progressBefore <= 0.5f) { - stageBefore = 1; - } else if (progressBefore <= 0.75f) { - stageBefore = 2; - } else { - stageBefore = 3; - } - posAnimationProgress += dt / (rotationBack ? 1000.0f : 2000.0f); - if (posAnimationProgress > 1.0f) { - posAnimationProgress = 1.0f; - } - progress = interpolator.getInterpolation(posAnimationProgress); - if (stageBefore == 0 && progress > 0.25f || - stageBefore == 1 && progress > 0.5f || - stageBefore == 2 && progress > 0.75f) { - if (rotationBack) { - phase++; - if (phase > 7) { - phase = 0; - } - } else { - phase--; - if (phase < 0) { - phase = 7; - } - } - } - if (progress <= 0.25f) { - progress /= 0.25f; - } else if (progress <= 0.5f) { - progress = (progress - 0.25f) / 0.25f; - } else if (progress <= 0.75f) { - progress = (progress - 0.5f) / 0.25f; - } else { - progress = (progress - 0.75f) / 0.25f; - } - if (rotationBack) { - float prevProgress = progress; - progress = 1.0f - progress; - if (posAnimationProgress >= 1.0f) { - phase++; - if (phase > 7) { - phase = 0; - } - progress = 1.0f; - } + boolean isNeedGenerateGradient = postInvalidateParent || rotatingPreview; + if (isIndeterminateAnimation) { + posAnimationProgress += dt / 12000f; + if (posAnimationProgress >= 1.0f) { + posAnimationProgress = 0.0f; } + float progressPerPhase = 1f / 8f; + phase = (int) (posAnimationProgress / progressPerPhase); + progress = 1f - (posAnimationProgress - phase * progressPerPhase) / progressPerPhase; + isNeedGenerateGradient = true; } else { - posAnimationProgress += dt / (fastAnimation ? 300.0f : 500.0f); - if (posAnimationProgress > 1.0f) { - posAnimationProgress = 1.0f; - } - progress = interpolator.getInterpolation(posAnimationProgress); - if (rotationBack) { - progress = 1.0f - progress; - if (posAnimationProgress >= 1.0f) { - phase++; - if (phase > 7) { - phase = 0; + if (rotatingPreview) { + int stageBefore; + float progressBefore = interpolator.getInterpolation(posAnimationProgress); + if (progressBefore <= 0.25f) { + stageBefore = 0; + } else if (progressBefore <= 0.5f) { + stageBefore = 1; + } else if (progressBefore <= 0.75f) { + stageBefore = 2; + } else { + stageBefore = 3; + } + posAnimationProgress += dt / (rotationBack ? 1000.0f : 2000.0f); + if (posAnimationProgress > 1.0f) { + posAnimationProgress = 1.0f; + } + progress = interpolator.getInterpolation(posAnimationProgress); + if (stageBefore == 0 && progress > 0.25f || + stageBefore == 1 && progress > 0.5f || + stageBefore == 2 && progress > 0.75f) { + if (rotationBack) { + phase++; + if (phase > 7) { + phase = 0; + } + } else { + phase--; + if (phase < 0) { + phase = 7; + } + } + } + if (progress <= 0.25f) { + progress /= 0.25f; + } else if (progress <= 0.5f) { + progress = (progress - 0.25f) / 0.25f; + } else if (progress <= 0.75f) { + progress = (progress - 0.5f) / 0.25f; + } else { + progress = (progress - 0.75f) / 0.25f; + } + if (rotationBack) { + float prevProgress = progress; + progress = 1.0f - progress; + if (posAnimationProgress >= 1.0f) { + phase++; + if (phase > 7) { + phase = 0; + } + progress = 1.0f; + } + } + } else { + posAnimationProgress += dt / (fastAnimation ? 300.0f : 500.0f); + if (posAnimationProgress > 1.0f) { + posAnimationProgress = 1.0f; + } + progress = interpolator.getInterpolation(posAnimationProgress); + if (rotationBack) { + progress = 1.0f - progress; + if (posAnimationProgress >= 1.0f) { + phase++; + if (phase > 7) { + phase = 0; + } + progress = 1.0f; } - progress = 1.0f; } } } - if (postInvalidateParent || rotatingPreview) { + if (isNeedGenerateGradient) { Utilities.generateGradient(currentBitmap, true, phase, progress, currentBitmap.getWidth(), currentBitmap.getHeight(), currentBitmap.getRowBytes(), colors); invalidateLegacy = true; } else { @@ -741,4 +759,12 @@ public class MotionBackgroundDrawable extends Drawable { public boolean isOneColor() { return colors[0] == colors[1] && colors[0] == colors[2] && colors[0] == colors[3]; } + + public void setIndeterminateAnimation(boolean isIndeterminateAnimation) { + this.isIndeterminateAnimation = isIndeterminateAnimation; + } + + public void setOverrideBitmapPaint(Paint overrideBitmapPaint) { + this.overrideBitmapPaint = overrideBitmapPaint; + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoPaintView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoPaintView.java index ba6356050..511d65ed5 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoPaintView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoPaintView.java @@ -920,6 +920,9 @@ public class PhotoPaintView extends FrameLayout implements EntityView.EntityView int w = view.getMeasuredWidth(); int h = view.getMeasuredHeight(); + if (w == 0 || h == 0) { + return; + } int tr = currentCropState.transformRotation; int fw = w, rotatedW = w; int fh = h, rotatedH = h; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoViewerCaptionEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoViewerCaptionEnterView.java index f43ac13c8..97c8aa3d3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoViewerCaptionEnterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoViewerCaptionEnterView.java @@ -199,6 +199,7 @@ public class PhotoViewerCaptionEnterView extends FrameLayout implements Notifica }; + messageEditText.setDelegate(() -> messageEditText.invalidateEffects()); messageEditText.setWindowView(windowView); messageEditText.setHint(LocaleController.getString("AddCaption", R.string.AddCaption)); messageEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/PopupSwipeBackLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/PopupSwipeBackLayout.java new file mode 100644 index 000000000..ce3373b96 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/PopupSwipeBackLayout.java @@ -0,0 +1,440 @@ +package org.telegram.ui.Components; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ValueAnimator; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.Path; +import android.graphics.Rect; +import android.graphics.RectF; +import android.util.SparseIntArray; +import android.view.GestureDetector; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewConfiguration; +import android.view.ViewGroup; +import android.widget.FrameLayout; + +import androidx.annotation.NonNull; +import androidx.core.view.GestureDetectorCompat; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.NotificationCenter; +import org.telegram.messenger.UserConfig; +import org.telegram.ui.ActionBar.ActionBarPopupWindow; +import org.telegram.ui.ActionBar.Theme; + +public class PopupSwipeBackLayout extends FrameLayout { + private final static int DURATION = 300; + + SparseIntArray overrideHeightIndex = new SparseIntArray(); + private float transitionProgress; + private float toProgress = -1; + private GestureDetectorCompat detector; + private boolean isProcessingSwipe; + private boolean isAnimationInProgress; + private boolean isSwipeDisallowed; + private Paint overlayPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + private Paint foregroundPaint = new Paint(); + + private Path mPath = new Path(); + private RectF mRect = new RectF(); + + private OnSwipeBackProgressListener onSwipeBackProgressListener; + private boolean isSwipeBackDisallowed; + + private float overrideForegroundHeight; + private ValueAnimator foregroundAnimator; + + private int currentForegroundIndex = -1; + private int notificationIndex; + Theme.ResourcesProvider resourcesProvider; + + private Rect hitRect = new Rect(); + + public PopupSwipeBackLayout(@NonNull Context context, Theme.ResourcesProvider resourcesProvider) { + super(context); + this.resourcesProvider = resourcesProvider; + + int touchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); + detector = new GestureDetectorCompat(context, new GestureDetector.SimpleOnGestureListener() { + @Override + public boolean onDown(MotionEvent e) { + return true; + } + + @Override + public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { + if (!isProcessingSwipe && !isSwipeDisallowed) { + if (!isSwipeBackDisallowed && transitionProgress == 1 && distanceX <= -touchSlop && Math.abs(distanceX) >= Math.abs(distanceY * 1.5f) && !isDisallowedView(e2, getChildAt(transitionProgress > 0.5f ? 1 : 0))) { + isProcessingSwipe = true; + + MotionEvent c = MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0, 0, 0); + for (int i = 0; i < getChildCount(); i++) + getChildAt(i).dispatchTouchEvent(c); + c.recycle(); + } else isSwipeDisallowed = true; + } + + if (isProcessingSwipe) { + toProgress = -1; + transitionProgress = 1f - Math.max(0, Math.min(1, (e2.getX() - e1.getX()) / getWidth())); + invalidateTransforms(); + } + + return isProcessingSwipe; + } + + @Override + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { + if (isAnimationInProgress || isSwipeDisallowed) + return false; + + if (velocityX >= 600) { + clearFlags(); + animateToState(0, velocityX / 6000f); + } + return false; + } + }); + overlayPaint.setColor(Color.BLACK); + } + + /** + * Sets if swipeback action should be disallowed + * + * @param swipeBackDisallowed If swipe should be disallowed + */ + public void setSwipeBackDisallowed(boolean swipeBackDisallowed) { + isSwipeBackDisallowed = swipeBackDisallowed; + } + + /** + * Sets new swipeback listener + * + * @param onSwipeBackProgressListener New progress listener + */ + public void setOnSwipeBackProgressListener(OnSwipeBackProgressListener onSwipeBackProgressListener) { + this.onSwipeBackProgressListener = onSwipeBackProgressListener; + } + + @Override + protected boolean drawChild(Canvas canvas, View child, long drawingTime) { + int i = indexOfChild(child); + int s = canvas.save(); + if (i != 0) { + foregroundPaint.setColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground, resourcesProvider)); + canvas.drawRect(child.getX(), 0, child.getX() + child.getMeasuredWidth(), getMeasuredHeight(), foregroundPaint); + } + boolean b = super.drawChild(canvas, child, drawingTime); + if (i == 0) { + overlayPaint.setAlpha((int) (transitionProgress * 0x40)); + canvas.drawRect(0, 0, getWidth(), getHeight(), overlayPaint); + } + canvas.restoreToCount(s); + return b; + } + + /** + * Invalidates transformations + */ + private void invalidateTransforms() { + + if (onSwipeBackProgressListener != null) { + onSwipeBackProgressListener.onSwipeBackProgress(this, toProgress, transitionProgress); + } + + View bg = getChildAt(0); + View fg = null; + if (currentForegroundIndex >= 0 && currentForegroundIndex < getChildCount()) { + fg = getChildAt(currentForegroundIndex); + } + bg.setTranslationX(-transitionProgress * getWidth() * 0.5f); + float bSc = 0.95f + (1f - transitionProgress) * 0.05f; + bg.setScaleX(bSc); + bg.setScaleY(bSc); + if (fg != null) { + fg.setTranslationX((1f - transitionProgress) * getWidth()); + } + invalidateVisibility(); + + float fW = bg.getMeasuredWidth(), fH = bg.getMeasuredHeight(); + float tW = 0; + float tH = 0; + if (fg != null) { + tW = fg.getMeasuredWidth(); + tH = overrideForegroundHeight != 0 ? overrideForegroundHeight : fg.getMeasuredHeight(); + } + if (bg.getMeasuredWidth() == 0 || bg.getMeasuredHeight() == 0) { + return; + } + + ActionBarPopupWindow.ActionBarPopupWindowLayout p = (ActionBarPopupWindow.ActionBarPopupWindowLayout) getParent(); + float w = fW + (tW - fW) * transitionProgress; + float h = fH + (tH - fH) * transitionProgress; + w += p.getPaddingLeft() + p.getPaddingRight(); + h += p.getPaddingTop() + p.getPaddingBottom(); + p.setBackScaleX(w / p.getMeasuredWidth()); + p.setBackScaleY(h / p.getMeasuredHeight()); + + for (int i = 0; i < getChildCount(); i++) { + View ch = getChildAt(i); + ch.setPivotX(0); + ch.setPivotY(0); + } + + invalidate(); + } + + @Override + public boolean dispatchTouchEvent(MotionEvent ev) { + if (processTouchEvent(ev)) + return true; + + if (currentForegroundIndex < 0 || currentForegroundIndex >= getChildCount()) { + return super.dispatchTouchEvent(ev); + } + + View bv = getChildAt(0); + View fv = getChildAt(currentForegroundIndex); + int act = ev.getActionMasked(); + if (act == MotionEvent.ACTION_DOWN && (ev.getX() > (bv.getMeasuredWidth() + (fv.getMeasuredWidth() - bv.getMeasuredWidth()) * transitionProgress) || + ev.getY() > (bv.getMeasuredHeight() + ((overrideForegroundHeight != 0 ? overrideForegroundHeight : fv.getMeasuredHeight()) - bv.getMeasuredHeight()) * transitionProgress))) { + callOnClick(); + return true; + } + + boolean b = (transitionProgress > 0.5f ? fv : bv).dispatchTouchEvent(ev); + if (!b && act == MotionEvent.ACTION_DOWN) { + return true; + } + return b || onTouchEvent(ev); + } + + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + invalidateTransforms(); + } + + /** + * Processes touch event and return true if processed + * + * @param ev Event to process + * @return If event is processed + */ + private boolean processTouchEvent(MotionEvent ev) { + int act = ev.getAction() & MotionEvent.ACTION_MASK; + if (isAnimationInProgress) + return true; + + if (!detector.onTouchEvent(ev)) { + switch (act) { + case MotionEvent.ACTION_DOWN: + break; + case MotionEvent.ACTION_CANCEL: + case MotionEvent.ACTION_UP: + if (isProcessingSwipe) { + clearFlags(); + animateToState(transitionProgress >= 0.5f ? 1 : 0, 0); + } else if (isSwipeDisallowed) clearFlags(); + return false; + } + } + return isProcessingSwipe; + } + + /** + * Animates transition value + * + * @param f End value + * @param flingVal Fling value(If from fling, zero otherwise) + */ + private void animateToState(float f, float flingVal) { + ValueAnimator val = ValueAnimator.ofFloat(transitionProgress, f).setDuration((long) (DURATION * Math.max(0.5f, Math.abs(transitionProgress - f) - Math.min(0.2f, flingVal)))); + val.setInterpolator(CubicBezierInterpolator.DEFAULT); + int selectedAccount = UserConfig.selectedAccount; + notificationIndex = NotificationCenter.getInstance(selectedAccount).setAnimationInProgress(notificationIndex, null); + val.addUpdateListener(animation -> { + transitionProgress = (float) animation.getAnimatedValue(); + invalidateTransforms(); + }); + val.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationStart(Animator animation) { + isAnimationInProgress = true; + toProgress = f; + } + + @Override + public void onAnimationEnd(Animator animation) { + NotificationCenter.getInstance(selectedAccount).onAnimationFinish(notificationIndex); + transitionProgress = f; + invalidateTransforms(); + isAnimationInProgress = false; + } + }); + val.start(); + } + + /** + * Clears touch flags + */ + private void clearFlags() { + isProcessingSwipe = false; + isSwipeDisallowed = false; + } + + /** + * Opens up foreground + */ + public void openForeground(int viewIndex) { + if (isAnimationInProgress) { + return; + } + currentForegroundIndex = viewIndex; + overrideForegroundHeight = overrideHeightIndex.get(viewIndex); + animateToState(1, 0); + } + + /** + * Closes foreground view + */ + public void closeForeground() { + if (isAnimationInProgress) return; + animateToState(0, 0); + } + + @Override + protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + for (int i = 0; i < getChildCount(); i++) { + View ch = getChildAt(i); + ch.layout(0, 0, ch.getMeasuredWidth(), ch.getMeasuredHeight()); + } + } + + @Override + public void addView(View child, int index, ViewGroup.LayoutParams params) { + super.addView(child, index, params); + invalidateTransforms(); + } + + @Override + protected void dispatchDraw(Canvas canvas) { + if (getChildCount() == 0) { + return; + } + View backgroundView = getChildAt(0); + float fW = backgroundView.getMeasuredWidth(), fH = backgroundView.getMeasuredHeight(); + float w, h; + if (currentForegroundIndex == -1 || currentForegroundIndex >= getChildCount()) { + w = fW; + h = fH; + } else { + View foregroundView = getChildAt(currentForegroundIndex); + float tW = foregroundView.getMeasuredWidth(), tH = overrideForegroundHeight != 0 ? overrideForegroundHeight : foregroundView.getMeasuredHeight(); + if (backgroundView.getMeasuredWidth() == 0 || backgroundView.getMeasuredHeight() == 0 || foregroundView.getMeasuredWidth() == 0 || foregroundView.getMeasuredHeight() == 0) { + w = fW; + h = fH; + } else { + w = fW + (tW - fW) * transitionProgress; + h = fH + (tH - fH) * transitionProgress; + } + } + + + int s = canvas.save(); + mPath.rewind(); + int rad = AndroidUtilities.dp(6); + mRect.set(0, 0, w, h); + mPath.addRoundRect(mRect, rad, rad, Path.Direction.CW); + canvas.clipPath(mPath); + super.dispatchDraw(canvas); + canvas.restoreToCount(s); + } + + /** + * @param e Motion event to check + * @param v View to check + * @return If we should ignore view + */ + private boolean isDisallowedView(MotionEvent e, View v) { + v.getHitRect(hitRect); + if (hitRect.contains((int) e.getX(), (int) e.getY()) && v.canScrollHorizontally(-1)) + return true; + if (v instanceof ViewGroup) { + ViewGroup vg = (ViewGroup) v; + for (int i = 0; i < vg.getChildCount(); i++) + if (isDisallowedView(e, vg.getChildAt(i))) + return true; + } + + return false; + } + + /** + * Invalidates view transforms + */ + private void invalidateVisibility() { + for (int i = 0; i < getChildCount(); i++) { + View child = getChildAt(i); + + if (i == 0) { + if (transitionProgress == 1 && child.getVisibility() != INVISIBLE) + child.setVisibility(INVISIBLE); + if (transitionProgress != 1 && child.getVisibility() != VISIBLE) + child.setVisibility(VISIBLE); + } else if (i == currentForegroundIndex) { + if (transitionProgress == 0 && child.getVisibility() != INVISIBLE) + child.setVisibility(INVISIBLE); + if (transitionProgress != 0 && child.getVisibility() != VISIBLE) + child.setVisibility(VISIBLE); + } else { + child.setVisibility(INVISIBLE); + } + } + } + + public void setNewForegroundHeight(int index, int height) { + overrideHeightIndex.put(index, height); + if (index != currentForegroundIndex) { + return; + } + if (currentForegroundIndex < 0 || currentForegroundIndex >= getChildCount()) { + return; + } + if (foregroundAnimator != null) { + foregroundAnimator.cancel(); + } + View fg = getChildAt(currentForegroundIndex); + float fromH = overrideForegroundHeight != 0 ? overrideForegroundHeight : fg.getMeasuredHeight(); + float toH = height; + + ValueAnimator animator = ValueAnimator.ofFloat(fromH, toH).setDuration(240); + animator.setInterpolator(Easings.easeInOutQuad); + animator.addUpdateListener(animation -> { + overrideForegroundHeight = (float) animation.getAnimatedValue(); + invalidateTransforms(); + }); + animator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + isAnimationInProgress = false; + } + + @Override + public void onAnimationStart(Animator animation) { + isAnimationInProgress = true; + } + }); + animator.start(); + foregroundAnimator = animator; + } + + public interface OnSwipeBackProgressListener { + void onSwipeBackProgress(PopupSwipeBackLayout layout, float toProgress, float progress); + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/QRCodeBottomSheet.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/QRCodeBottomSheet.java index 523deddac..ccc89dc5b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/QRCodeBottomSheet.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/QRCodeBottomSheet.java @@ -52,7 +52,7 @@ public class QRCodeBottomSheet extends BottomSheet { private final TextView buttonTextView; int imageSize; RLottieImageView iconImage; - + public QRCodeBottomSheet(Context context, String link, String helpMessage) { super(context, false); @@ -122,7 +122,7 @@ public class QRCodeBottomSheet extends BottomSheet { buttonTextView.setText(LocaleController.getString("ShareQrCode", R.string.ShareQrCode)); buttonTextView.setOnClickListener(view -> { - Uri uri = getImageUri(qrCode); + Uri uri = AndroidUtilities.getBitmapShareUri(qrCode, "qr_tmp.png", Bitmap.CompressFormat.PNG); if (uri != null) { Intent i = new Intent(Intent.ACTION_SEND); @@ -144,37 +144,13 @@ public class QRCodeBottomSheet extends BottomSheet { setCustomView(scrollView); } - public Uri getImageUri(Bitmap inImage) { - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes); - - File cachePath = AndroidUtilities.getCacheDir(); - if (!cachePath.isDirectory()) { - try { - cachePath.mkdirs(); - } catch (Exception e) { - FileLog.e(e); - return null; - } - } - File file = new File(cachePath, "qr_tmp.png"); - try (FileOutputStream out = new FileOutputStream(file)) { - inImage.compress(Bitmap.CompressFormat.PNG, 100, out); - out.close(); - return FileProvider.getUriForFile(ApplicationLoader.applicationContext, BuildConfig.APPLICATION_ID + ".provider", file); - } catch (IOException e) { - FileLog.e(e); - } - return null; - } - public Bitmap createQR(Context context, String key, Bitmap oldBitmap) { try { HashMap hints = new HashMap<>(); hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); hints.put(EncodeHintType.MARGIN, 0); QRCodeWriter writer = new QRCodeWriter(); - Bitmap bitmap = writer.encode(key, BarcodeFormat.QR_CODE, 768, 768, hints, oldBitmap, context); + Bitmap bitmap = writer.encode(key, 768, 768, hints, oldBitmap); imageSize = writer.getImageSize(); return bitmap; } catch (Exception e) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedHeaderView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedHeaderView.java new file mode 100644 index 000000000..0a1b2cfa9 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedHeaderView.java @@ -0,0 +1,301 @@ +package org.telegram.ui.Components; + +import android.content.Context; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; +import android.graphics.drawable.Drawable; +import android.text.TextUtils; +import android.util.TypedValue; +import android.view.Gravity; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; +import androidx.core.util.Consumer; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.ChatObject; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MediaDataController; +import org.telegram.messenger.MessageObject; +import org.telegram.messenger.MessagesController; +import org.telegram.messenger.R; +import org.telegram.tgnet.ConnectionsManager; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.Theme; + +import java.util.ArrayList; +import java.util.List; + +public class ReactedHeaderView extends FrameLayout { + private FlickerLoadingView flickerLoadingView; + private TextView titleView; + private AvatarsImageView avatarsImageView; + private ImageView iconView; + private BackupImageView reactView; + + private int currentAccount; + private boolean ignoreLayout; + private List seenUsers = new ArrayList<>(); + private List users = new ArrayList<>(); + private long dialogId; + private MessageObject message; + + private boolean isLoaded; + + private Consumer> seenCallback; + + public ReactedHeaderView(@NonNull Context context, int currentAccount, MessageObject message, long dialogId) { + super(context); + this.currentAccount = currentAccount; + this.message = message; + this.dialogId = dialogId; + + flickerLoadingView = new FlickerLoadingView(context); + flickerLoadingView.setColors(Theme.key_actionBarDefaultSubmenuBackground, Theme.key_listSelector, null); + flickerLoadingView.setViewType(FlickerLoadingView.MESSAGE_SEEN_TYPE); + flickerLoadingView.setIsSingleCell(false); + addView(flickerLoadingView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT)); + + titleView = new TextView(context); + titleView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem)); + titleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + titleView.setLines(1); + titleView.setEllipsize(TextUtils.TruncateAt.END); + addView(titleView, LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START | Gravity.CENTER_VERTICAL, 40, 0, 62, 0)); + + avatarsImageView = new AvatarsImageView(context, false); + avatarsImageView.setStyle(AvatarsDarawable.STYLE_MESSAGE_SEEN); + addView(avatarsImageView, LayoutHelper.createFrameRelatively(24 + 12 + 12 + 8, LayoutHelper.MATCH_PARENT, Gravity.END | Gravity.CENTER_VERTICAL, 0, 0, 0, 0)); + + iconView = new ImageView(context); + addView(iconView, LayoutHelper.createFrameRelatively(24, 24, Gravity.START | Gravity.CENTER_VERTICAL, 11, 0, 0, 0)); + Drawable drawable = ContextCompat.getDrawable(context, R.drawable.msg_reactions).mutate(); + drawable.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_actionBarDefaultSubmenuItemIcon), PorterDuff.Mode.MULTIPLY)); + iconView.setImageDrawable(drawable); + iconView.setVisibility(View.GONE); + + reactView = new BackupImageView(context); + addView(reactView, LayoutHelper.createFrameRelatively(24, 24, Gravity.START | Gravity.CENTER_VERTICAL, 11, 0, 0, 0)); + + titleView.setAlpha(0); + avatarsImageView.setAlpha(0); + + setBackground(Theme.getSelectorDrawable(false)); + } + + public void setSeenCallback(Consumer> seenCallback) { + this.seenCallback = seenCallback; + } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + + if (!isLoaded) { + MessagesController ctrl = MessagesController.getInstance(currentAccount); + TLRPC.Chat chat = ctrl.getChat(message.getChatId()); + TLRPC.ChatFull chatInfo = ctrl.getChatFull(message.getChatId()); + boolean showSeen = chat != null && message.isOutOwner() && message.isSent() && !message.isEditing() && !message.isSending() && !message.isSendError() && !message.isContentUnread() && !message.isUnread() && (ConnectionsManager.getInstance(currentAccount).getCurrentTime() - message.messageOwner.date < 7 * 86400) && (ChatObject.isMegagroup(chat) || !ChatObject.isChannel(chat)) && chatInfo != null && chatInfo.participants_count < MessagesController.getInstance(currentAccount).chatReadMarkSizeThreshold && !(message.messageOwner.action instanceof TLRPC.TL_messageActionChatJoinedByRequest); + + if (showSeen) { + TLRPC.TL_messages_getMessageReadParticipants req = new TLRPC.TL_messages_getMessageReadParticipants(); + req.msg_id = message.getId(); + req.peer = MessagesController.getInstance(currentAccount).getInputPeer(message.getDialogId()); + long fromId = message.messageOwner.from_id != null ? message.messageOwner.from_id.user_id : 0; + ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> { + if (response instanceof TLRPC.Vector) { + List usersToRequest = new ArrayList<>(); + TLRPC.Vector v = (TLRPC.Vector) response; + for (Object obj : v.objects) { + if (obj instanceof Long) { + long l = (long) obj; + if (fromId != l) + usersToRequest.add(l); + } + } + usersToRequest.add(fromId); + + List usersRes = new ArrayList<>(); + Runnable callback = () -> { + seenUsers.addAll(usersRes); + for (TLRPC.User u : usersRes) { + boolean hasSame = false; + for (int i = 0; i < users.size(); i++) { + if (users.get(i).id == u.id) { + hasSame = true; + break; + } + } + if (!hasSame) { + users.add(u); + } + } + if (seenCallback != null) + seenCallback.accept(usersRes); + loadReactions(); + }; + if (ChatObject.isChannel(chat)) { + TLRPC.TL_channels_getParticipants usersReq = new TLRPC.TL_channels_getParticipants(); + usersReq.limit = MessagesController.getInstance(currentAccount).chatReadMarkSizeThreshold; + usersReq.offset = 0; + usersReq.filter = new TLRPC.TL_channelParticipantsRecent(); + usersReq.channel = MessagesController.getInstance(currentAccount).getInputChannel(chat.id); + ConnectionsManager.getInstance(currentAccount).sendRequest(usersReq, (response1, error1) -> AndroidUtilities.runOnUIThread(() -> { + if (response1 != null) { + TLRPC.TL_channels_channelParticipants users = (TLRPC.TL_channels_channelParticipants) response1; + for (int i = 0; i < users.users.size(); i++) { + TLRPC.User user = users.users.get(i); + MessagesController.getInstance(currentAccount).putUser(user, false); + if (!user.self && usersToRequest.contains(user.id)) + usersRes.add(user); + } + } + callback.run(); + })); + } else { + TLRPC.TL_messages_getFullChat usersReq = new TLRPC.TL_messages_getFullChat(); + usersReq.chat_id = chat.id; + ConnectionsManager.getInstance(currentAccount).sendRequest(usersReq, (response1, error1) -> AndroidUtilities.runOnUIThread(() -> { + if (response1 != null) { + TLRPC.TL_messages_chatFull chatFull = (TLRPC.TL_messages_chatFull) response1; + for (int i = 0; i < chatFull.users.size(); i++) { + TLRPC.User user = chatFull.users.get(i); + MessagesController.getInstance(currentAccount).putUser(user, false); + if (!user.self && usersToRequest.contains(user.id)) + usersRes.add(user); + } + } + callback.run(); + })); + } + } + }, ConnectionsManager.RequestFlagInvokeAfter); + } else loadReactions(); + } + } + + private void loadReactions() { + MessagesController ctrl = MessagesController.getInstance(currentAccount); + TLRPC.TL_messages_getMessageReactionsList getList = new TLRPC.TL_messages_getMessageReactionsList(); + getList.peer = ctrl.getInputPeer(dialogId); + getList.id = message.getId(); + getList.limit = 3; + ConnectionsManager.getInstance(currentAccount).sendRequest(getList, (response, error) -> { + if (response instanceof TLRPC.TL_messages_messageReactionsList) { + TLRPC.TL_messages_messageReactionsList list = (TLRPC.TL_messages_messageReactionsList) response; + int c = list.count; + post(() -> { + String str; + if (seenUsers.isEmpty() || seenUsers.size() < c) { + str = LocaleController.formatPluralString("ReactionsCount", c); + } else { + String countStr; + if (c == seenUsers.size()) { + countStr = String.valueOf(c); + } else { + countStr = c + "/" + seenUsers.size(); + } + str = String.format(LocaleController.getPluralString("Reacted", c), countStr); + } + titleView.setText(str); + boolean showIcon = true; + if (message.messageOwner.reactions != null && message.messageOwner.reactions.results.size() == 1 && !list.reactions.isEmpty()) { + for (TLRPC.TL_availableReaction r : MediaDataController.getInstance(currentAccount).getReactionsList()) { + if (r.reaction.equals(list.reactions.get(0).reaction)) { + reactView.setImage(ImageLocation.getForDocument(r.static_icon), "50_50", "webp", null, r); + reactView.setVisibility(VISIBLE); + reactView.setAlpha(0); + reactView.animate().alpha(1f).start(); + iconView.setVisibility(GONE); + showIcon = false; + break; + } + } + } + if (showIcon) { + iconView.setVisibility(VISIBLE); + iconView.setAlpha(0f); + iconView.animate().alpha(1f).start(); + } + for (TLRPC.User u : list.users) { + if (message.messageOwner.from_id != null && u.id != message.messageOwner.from_id.user_id) { + boolean hasSame = false; + for (int i = 0; i < users.size(); i++) { + if (users.get(i).id == u.id) { + hasSame = true; + break; + } + } + if (!hasSame) { + users.add(u); + } + } + } + + updateView(); + }); + } + }, ConnectionsManager.RequestFlagInvokeAfter); + } + + public List getSeenUsers() { + return seenUsers; + } + + private void updateView() { + setEnabled(users.size() > 0); + for (int i = 0; i < 3; i++) { + if (i < users.size()) { + avatarsImageView.setObject(i, currentAccount, users.get(i)); + } else { + avatarsImageView.setObject(i, currentAccount, null); + } + } + float tX; + switch (users.size()) { + case 1: + tX = AndroidUtilities.dp(24); + break; + case 2: + tX = AndroidUtilities.dp(12); + break; + default: + tX = 0; + } + avatarsImageView.setTranslationX(LocaleController.isRTL ? AndroidUtilities.dp(12) : tX); + + avatarsImageView.commitTransition(false); + titleView.animate().alpha(1f).setDuration(220).start(); + avatarsImageView.animate().alpha(1f).setDuration(220).start(); + flickerLoadingView.animate().alpha(0f).setDuration(220).setListener(new HideViewAfterAnimation(flickerLoadingView)).start(); + } + + @Override + public void requestLayout() { + if (ignoreLayout) { + return; + } + super.requestLayout(); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + if (flickerLoadingView.getVisibility() == View.VISIBLE) { + // Idk what is happening here, but this class is a clone of MessageSeenView, so this might help with something? + ignoreLayout = true; + flickerLoadingView.setVisibility(View.GONE); + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + flickerLoadingView.getLayoutParams().width = getMeasuredWidth(); + flickerLoadingView.setVisibility(View.VISIBLE); + ignoreLayout = false; + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + } else { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + } + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedUsersListView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedUsersListView.java new file mode 100644 index 000000000..260b8b3e6 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedUsersListView.java @@ -0,0 +1,298 @@ +package org.telegram.ui.Components; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ValueAnimator; +import android.annotation.SuppressLint; +import android.content.Context; +import android.text.TextUtils; +import android.util.LongSparseArray; +import android.util.TypedValue; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup; +import android.widget.FrameLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.DocumentObject; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.MediaDataController; +import org.telegram.messenger.MessageObject; +import org.telegram.messenger.MessagesController; +import org.telegram.messenger.SvgHelper; +import org.telegram.messenger.UserObject; +import org.telegram.tgnet.ConnectionsManager; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.Theme; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class ReactedUsersListView extends FrameLayout { + public final static int VISIBLE_ITEMS = 6; + public final static int ITEM_HEIGHT_DP = 48; + + private int currentAccount; + private MessageObject message; + private String filter; + + private RecyclerListView listView; + private RecyclerView.Adapter adapter; + + private FlickerLoadingView loadingView; + + private List userReactions = new ArrayList<>(); + private LongSparseArray users = new LongSparseArray<>(); + private String offset; + private boolean isLoading, isLoaded, canLoadMore = true; + private boolean onlySeenNow; + + private OnHeightChangedListener onHeightChangedListener; + private OnProfileSelectedListener onProfileSelectedListener; + + public ReactedUsersListView(Context context, Theme.ResourcesProvider resourcesProvider, int currentAccount, MessageObject message, TLRPC.TL_reactionCount reactionCount, boolean addPadding) { + super(context); + this.currentAccount = currentAccount; + this.message = message; + this.filter = reactionCount == null ? null : reactionCount.reaction; + + listView = new RecyclerListView(context, resourcesProvider) { + @Override + protected void onMeasure(int widthSpec, int heightSpec) { + super.onMeasure(widthSpec, heightSpec); + updateHeight(); + } + }; + LinearLayoutManager llm = new LinearLayoutManager(context); + listView.setLayoutManager(llm); + if (addPadding) { + listView.setPadding(0, 0, 0, AndroidUtilities.dp(8)); + listView.setClipToPadding(false); + } + listView.setAdapter(adapter = new RecyclerView.Adapter() { + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new RecyclerListView.Holder(new ReactedUserHolderView(context)); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + ReactedUserHolderView rhv = (ReactedUserHolderView) holder.itemView; + rhv.setUserReaction(userReactions.get(position)); + } + + @Override + public int getItemCount() { + return userReactions.size(); + } + }); + listView.setOnItemClickListener((view, position) -> { + if (onProfileSelectedListener != null) + onProfileSelectedListener.onProfileSelected(this, userReactions.get(position).user_id); + }); + listView.addOnScrollListener(new RecyclerView.OnScrollListener() { + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + if (isLoaded && canLoadMore && !isLoading && llm.findLastVisibleItemPosition() >= adapter.getItemCount() - 1 - getLoadCount()) { + load(); + } + } + }); + listView.setVerticalScrollBarEnabled(true); + listView.setAlpha(0); + addView(listView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + + loadingView = new FlickerLoadingView(context, resourcesProvider); + loadingView.setViewType(FlickerLoadingView.REACTED_TYPE); + loadingView.setIsSingleCell(true); + loadingView.setItemsCount(reactionCount == null ? VISIBLE_ITEMS : reactionCount.count); + addView(loadingView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + } + + @SuppressLint("NotifyDataSetChanged") + public ReactedUsersListView setSeenUsers(List users) { + List nr = new ArrayList<>(users.size()); + for (TLRPC.User u : users) { + if (this.users.get(u.id) != null) continue; + this.users.put(u.id, u); + TLRPC.TL_messageUserReaction r = new TLRPC.TL_messageUserReaction(); + r.reaction = null; + r.user_id = u.id; + nr.add(r); + } + if (userReactions.isEmpty()) + onlySeenNow = true; + userReactions.addAll(nr); + adapter.notifyDataSetChanged(); + updateHeight(); + return this; + } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + if (!isLoaded && !isLoading) { + load(); + } + } + + @SuppressLint("NotifyDataSetChanged") + private void load() { + isLoading = true; + + MessagesController ctrl = MessagesController.getInstance(currentAccount); + TLRPC.TL_messages_getMessageReactionsList getList = new TLRPC.TL_messages_getMessageReactionsList(); + getList.peer = ctrl.getInputPeer(message.getDialogId()); + getList.id = message.getId(); + getList.limit = getLoadCount(); + getList.reaction = filter; + getList.offset = offset; + if (filter != null) + getList.flags |= 1; + if (offset != null) + getList.flags |= 2; + ConnectionsManager.getInstance(currentAccount).sendRequest(getList, (response, error) -> { + if (response instanceof TLRPC.TL_messages_messageReactionsList) { + TLRPC.TL_messages_messageReactionsList l = (TLRPC.TL_messages_messageReactionsList) response; + + for (TLRPC.User u : l.users) { + users.put(u.id, u); + } + + // It's safer to create a new list to prevent inconsistency + int prev = userReactions.size(); + List newReactions = new ArrayList<>(userReactions.size() + l.reactions.size()); + newReactions.addAll(userReactions); + newReactions.addAll(l.reactions); + + if (onlySeenNow) + Collections.sort(newReactions, (o1, o2) -> Integer.compare(o1.reaction != null ? 1 : 0, o2.reaction != null ? 1 : 0)); + + AndroidUtilities.runOnUIThread(()->{ + userReactions = newReactions; + if (onlySeenNow) { + onlySeenNow = false; + adapter.notifyDataSetChanged(); + } else adapter.notifyItemRangeInserted(prev, l.reactions.size()); + + if (!isLoaded) { + ValueAnimator anim = ValueAnimator.ofFloat(0, 1).setDuration(150); + anim.setInterpolator(CubicBezierInterpolator.DEFAULT); + anim.addUpdateListener(animation -> { + float val = (float) animation.getAnimatedValue(); + listView.setAlpha(val); + loadingView.setAlpha(1f - val); + }); + anim.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + loadingView.setVisibility(GONE); + } + }); + anim.start(); + + updateHeight(); + + isLoaded = true; + } + offset = l.next_offset; + if (offset == null) + canLoadMore = false; + isLoading = false; + }); + } else isLoading = false; + }, ConnectionsManager.RequestFlagInvokeAfter); + } + + private void updateHeight() { + if (onHeightChangedListener != null) { + int h; + if (listView.getMeasuredHeight() != 0) { + h = Math.min(listView.getMeasuredHeight(), AndroidUtilities.dp(ITEM_HEIGHT_DP * Math.min(userReactions.size(), VISIBLE_ITEMS))); + } else { + h = AndroidUtilities.dp(ITEM_HEIGHT_DP * Math.min(userReactions.size(), VISIBLE_ITEMS)); + } + onHeightChangedListener.onHeightChanged(ReactedUsersListView.this, h); + } + } + + private int getLoadCount() { + return filter == null ? 100 : 50; + } + + private final class ReactedUserHolderView extends FrameLayout { + BackupImageView avatarView; + TextView titleView; + BackupImageView reactView; + AvatarDrawable avatarDrawable = new AvatarDrawable(); + View overlaySelectorView; + + ReactedUserHolderView(@NonNull Context context) { + super(context); + setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, AndroidUtilities.dp(48))); + + avatarView = new BackupImageView(context); + avatarView.setRoundRadius(AndroidUtilities.dp(32)); + addView(avatarView, LayoutHelper.createFrameRelatively(36, 36, Gravity.START | Gravity.CENTER_VERTICAL, 8, 0, 0, 0)); + + titleView = new TextView(context); + titleView.setLines(1); + titleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + titleView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem)); + titleView.setEllipsize(TextUtils.TruncateAt.END); + addView(titleView, LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START | Gravity.CENTER_VERTICAL, 65, 0, 44, 0)); + + reactView = new BackupImageView(context); + addView(reactView, LayoutHelper.createFrameRelatively(24, 24, Gravity.END | Gravity.CENTER_VERTICAL, 0, 0, 12, 0)); + + overlaySelectorView = new View(context); + overlaySelectorView.setBackground(Theme.getSelectorDrawable(false)); + addView(overlaySelectorView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + } + + void setUserReaction(TLRPC.TL_messageUserReaction reaction) { + TLRPC.User u = users.get(reaction.user_id); + avatarDrawable.setInfo(u); + titleView.setText(UserObject.getUserName(u)); + avatarView.setImage(ImageLocation.getForUser(u, ImageLocation.TYPE_SMALL), "50_50", avatarDrawable, u); + + if (reaction.reaction != null) { + TLRPC.TL_availableReaction r = MediaDataController.getInstance(currentAccount).getReactionsMap().get(reaction.reaction); + if (r != null) { + SvgHelper.SvgDrawable svgThumb = DocumentObject.getSvgThumb(r.static_icon.thumbs, Theme.key_windowBackgroundGray, 1.0f); + reactView.setImage(ImageLocation.getForDocument(r.static_icon), "50_50", "webp", svgThumb, r); + } + } + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(ITEM_HEIGHT_DP), MeasureSpec.EXACTLY)); + } + } + + public ReactedUsersListView setOnProfileSelectedListener(OnProfileSelectedListener onProfileSelectedListener) { + this.onProfileSelectedListener = onProfileSelectedListener; + return this; + } + + public ReactedUsersListView setOnHeightChangedListener(OnHeightChangedListener onHeightChangedListener) { + this.onHeightChangedListener = onHeightChangedListener; + return this; + } + + public interface OnHeightChangedListener { + void onHeightChanged(ReactedUsersListView view, int newHeight); + } + + public interface OnProfileSelectedListener { + void onProfileSelected(ReactedUsersListView view, long userId); + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionTabHolderView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionTabHolderView.java new file mode 100644 index 000000000..2e287bd52 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionTabHolderView.java @@ -0,0 +1,115 @@ +package org.telegram.ui.Components; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.Path; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; +import android.graphics.RectF; +import android.graphics.drawable.Drawable; +import android.view.Gravity; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.DocumentObject; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MediaDataController; +import org.telegram.messenger.R; +import org.telegram.messenger.SvgHelper; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.Theme; + +public class ReactionTabHolderView extends FrameLayout { + private Paint outlinePaint = new Paint(Paint.ANTI_ALIAS_FLAG); + private Paint bgPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + private Path path = new Path(); + private RectF rect = new RectF(); + private float radius = AndroidUtilities.dp(32); + + private BackupImageView reactView; + private ImageView iconView; + private TextView counterView; + + private float outlineProgress; + + public ReactionTabHolderView(@NonNull Context context) { + super(context); + + iconView = new ImageView(context); + Drawable drawable = ContextCompat.getDrawable(context, R.drawable.msg_reactions_filled).mutate(); + drawable.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_avatar_nameInMessageBlue), PorterDuff.Mode.MULTIPLY)); + iconView.setImageDrawable(drawable); + addView(iconView, LayoutHelper.createFrameRelatively(24, 24, Gravity.START | Gravity.CENTER_VERTICAL, 8, 0, 8, 0)); + + reactView = new BackupImageView(context); + addView(reactView, LayoutHelper.createFrameRelatively(24, 24, Gravity.START | Gravity.CENTER_VERTICAL, 8, 0, 8, 0)); + counterView = new TextView(context); + counterView.setTextColor(Theme.getColor(Theme.key_avatar_nameInMessageBlue)); + counterView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + addView(counterView, LayoutHelper.createFrameRelatively(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.START | Gravity.CENTER_VERTICAL, 40, 0, 8, 0)); + + outlinePaint.setStyle(Paint.Style.STROKE); + outlinePaint.setStrokeWidth(AndroidUtilities.dp(1)); + outlinePaint.setColor(Theme.getColor(Theme.key_avatar_nameInMessageBlue)); + + bgPaint.setColor(Theme.getColor(Theme.key_avatar_nameInMessageBlue)); + bgPaint.setAlpha(0x10); + + View overlaySelectorView = new View(context); + overlaySelectorView.setBackground(Theme.getSelectorDrawable(bgPaint.getColor(), false)); + addView(overlaySelectorView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + + setWillNotDraw(false); + } + + public void setOutlineProgress(float outlineProgress) { + this.outlineProgress = outlineProgress; + invalidate(); + } + + public void setCounter(int count) { + counterView.setText(String.format("%s", LocaleController.formatShortNumber(count, null))); + iconView.setVisibility(VISIBLE); + reactView.setVisibility(GONE); + } + + public void setCounter(int currentAccount, TLRPC.TL_reactionCount counter) { + counterView.setText(String.format("%s", LocaleController.formatShortNumber(counter.count, null))); + String e = counter.reaction; + for (TLRPC.TL_availableReaction r : MediaDataController.getInstance(currentAccount).getReactionsList()) { + if (r.reaction.equals(e)) { + SvgHelper.SvgDrawable svgThumb = DocumentObject.getSvgThumb(r.static_icon, Theme.key_windowBackgroundGray, 1.0f); + reactView.setImage(ImageLocation.getForDocument(r.static_icon), "50_50", "webp", svgThumb, r); + reactView.setVisibility(VISIBLE); + iconView.setVisibility(GONE); + break; + } + } + } + + @Override + protected void dispatchDraw(Canvas canvas) { + int s = canvas.save(); + path.rewind(); + rect.set(0, 0, getWidth(), getHeight()); + path.addRoundRect(rect, radius, radius, Path.Direction.CW); + canvas.clipPath(path); + + canvas.drawRoundRect(rect, radius, radius, bgPaint); + super.dispatchDraw(canvas); + + outlinePaint.setAlpha((int) (outlineProgress * 0xFF)); + float w = outlinePaint.getStrokeWidth(); + rect.set(w, w, getWidth() - w, getHeight() - w); + canvas.drawRoundRect(rect, radius, radius, outlinePaint); + canvas.restoreToCount(s); + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsEffectOverlay.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsEffectOverlay.java new file mode 100644 index 000000000..bb12d2072 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsEffectOverlay.java @@ -0,0 +1,376 @@ +package org.telegram.ui.Components.Reactions; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.PixelFormat; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.MediaDataController; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.Cells.ChatMessageCell; +import org.telegram.ui.ChatActivity; +import org.telegram.ui.Components.BackupImageView; +import org.telegram.ui.Components.CubicBezierInterpolator; +import org.telegram.ui.Components.ReactionsContainerLayout; + +public class ReactionsEffectOverlay { + + public static ReactionsEffectOverlay currentOverlay; + + private final AnimationView effectImageView; + private final AnimationView emojiImageView; + private final FrameLayout container; + boolean animateIn; + float animateInProgress; + float animateOutProgress; + + FrameLayout windowView; + BackupImageView backupImageView; + private static int unicPrefix; + + int[] loc = new int[2]; + private WindowManager windowManager; + private boolean dismissed; + private float dismissProgress; + private final int messageId; + private final long groupId; + private final String reaction; + private float lastDrawnToX; + private float lastDrawnToY; + private boolean started; + private ReactionsContainerLayout.ReactionHolderView holderView = null; + private boolean wasScrolled; + + + private ReactionsEffectOverlay(Context context, BaseFragment fragment, ReactionsContainerLayout reactionsLayout, ChatMessageCell cell, float x, float y, String reaction, int currentAccount) { + this.messageId = cell.getMessageObject().getId(); + this.groupId = cell.getMessageObject().getGroupId(); + this.reaction = reaction; + ReactionsLayoutInBubble.ReactionButton reactionButton = cell.getReactionButton(reaction); + float fromX, fromY, fromHeight, fromWidth; + if (reactionsLayout != null) { + for (int i = 0; i < reactionsLayout.recyclerListView.getChildCount(); i++) { + if (((ReactionsContainerLayout.ReactionHolderView) reactionsLayout.recyclerListView.getChildAt(i)).currentReaction.reaction.equals(reaction)) { + holderView = ((ReactionsContainerLayout.ReactionHolderView) reactionsLayout.recyclerListView.getChildAt(i)); + break; + } + } + } + boolean fromHolder = holderView != null || (x != 0 && y != 0); + if (holderView != null) { + reactionsLayout.getLocationOnScreen(loc); + fromX = loc[0] + holderView.getX() + holderView.backupImageView.getX() + AndroidUtilities.dp(16); + fromY = loc[1] + holderView.getY() + holderView.backupImageView.getY() + AndroidUtilities.dp(16); + fromHeight = holderView.backupImageView.getWidth(); + } else if (reactionButton != null) { + cell.getLocationInWindow(loc); + fromX = loc[0] + cell.reactionsLayoutInBubble.x + reactionButton.x + reactionButton.imageReceiver.getImageX(); + fromY = loc[1] + cell.reactionsLayoutInBubble.y + reactionButton.y + reactionButton.imageReceiver.getImageY(); + fromHeight = reactionButton.imageReceiver.getImageHeight(); + fromWidth = reactionButton.imageReceiver.getImageWidth(); + } else { + ((View) cell.getParent()).getLocationInWindow(loc); + fromX = loc[0] + x; + fromY = loc[1] + y; + fromHeight = 0; + fromWidth = 0; + } + + int size = Math.round(Math.min(AndroidUtilities.dp(350), Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y)) * 0.8f); + int sizeForFilter = (int) (2f * size / AndroidUtilities.density); + int emojiSize = size >> 1; + int emojiSizeForFilter = sizeForFilter >> 1; + + float fromScale = fromHeight / (float) emojiSize; + animateInProgress = 0f; + animateOutProgress = 0f; + + container = new FrameLayout(context); + windowView = new FrameLayout(context) { + + @Override + protected void dispatchDraw(Canvas canvas) { + if (dismissed) { + if (dismissProgress != 1f) { + dismissProgress += 16 / 150f; + if (dismissProgress > 1f) { + dismissProgress = 1f; + AndroidUtilities.runOnUIThread(() -> { + try { + windowManager.removeView(windowView); + } catch (Exception e) { + + } + }); + } + } + if (dismissProgress != 1f) { + setAlpha(1f - dismissProgress); + super.dispatchDraw(canvas); + } + invalidate(); + return; + } + if (!started) { + invalidate(); + return; + } else { + if (holderView != null) { + holderView.backupImageView.setAlpha(0); + } + } + ChatMessageCell drawingCell; + if (fragment instanceof ChatActivity) { + drawingCell = ((ChatActivity) fragment).findMessageCell(messageId); + } else { + drawingCell = cell; + } + float toX, toY; + if (drawingCell != null) { + cell.getLocationInWindow(loc); + + ReactionsLayoutInBubble.ReactionButton reactionButton = cell.getReactionButton(reaction); + toX = loc[0] + cell.reactionsLayoutInBubble.x; + toY = loc[1] + cell.reactionsLayoutInBubble.y; + if (reactionButton != null) { + toX += reactionButton.x + reactionButton.imageReceiver.getImageX(); + toY += reactionButton.y + reactionButton.imageReceiver.getImageY(); + } + + lastDrawnToX = toX; + lastDrawnToY = toY; + } else { + toX = lastDrawnToX; + toY = lastDrawnToY; + } + float previewX = toX - emojiSize / 2f; + float previewY = toY - emojiSize / 2f; + if (fragment.getParentActivity() != null && fragment.getFragmentView().getParent() != null && fragment.getFragmentView().getVisibility() == View.VISIBLE && fragment.getFragmentView() != null) { + fragment.getFragmentView().getLocationOnScreen(loc); + setAlpha(((View) fragment.getFragmentView().getParent()).getAlpha()); + } else { + return; + } + if (previewX < loc[0]) { + previewX = loc[0]; + } + if (previewX + emojiSize > loc[0] + getMeasuredWidth()) { + previewX = loc[0] + getMeasuredWidth() - emojiSize; + } + + float animateInProgressX, animateInProgressY; + if (fromHolder) { + animateInProgressX = CubicBezierInterpolator.EASE_OUT_QUINT.getInterpolation(animateInProgress); + animateInProgressY = CubicBezierInterpolator.DEFAULT.getInterpolation(animateInProgress); + } else { + animateInProgressX = animateInProgressY = animateInProgress; + } + + float scale = animateInProgressX + (1f - animateInProgressX) * fromScale; + + float toScale; + if (cell.getMessageObject().shouldDrawReactionsInLayout()) { + toScale = AndroidUtilities.dp(20) / (float) emojiSize; + } else { + toScale = AndroidUtilities.dp(14) / (float) emojiSize; + } + + + float x = fromX * (1f - animateInProgressX) + previewX * animateInProgressX; + float y = fromY * (1f - animateInProgressY) + previewY * animateInProgressY; + + effectImageView.setTranslationX(x); + effectImageView.setTranslationY(y); + effectImageView.setAlpha((1f - animateOutProgress)); + + if (animateOutProgress != 0) { + scale = scale * (1f - animateOutProgress) + toScale * animateOutProgress; + x = x * (1f - animateOutProgress) + toX * animateOutProgress; + y = y * (1f - animateOutProgress) + toY * animateOutProgress; + } + + container.setTranslationX(x); + container.setTranslationY(y); + + container.setScaleX(scale); + container.setScaleY(scale); + + super.dispatchDraw(canvas); + + if (emojiImageView.wasPlaying && animateInProgress != 1f) { + if (fromHolder) { + animateInProgress += 16f / 350f; + } else { + animateInProgress += 16f / 220f; + } + if (animateInProgress > 1f) { + animateInProgress = 1f; + } + } + + if (wasScrolled || (emojiImageView.wasPlaying && emojiImageView.getImageReceiver().getLottieAnimation() != null && !emojiImageView.getImageReceiver().getLottieAnimation().isRunning())) { + if (animateOutProgress != 1f) { + animateOutProgress += 16f / 220f; + if (animateOutProgress > 1f) { + animateOutProgress = 1f; + currentOverlay = null; + cell.invalidate(); + if (cell.getCurrentMessagesGroup() != null && cell.getParent() != null) { + ((View) cell.getParent()).invalidate(); + } + AndroidUtilities.runOnUIThread(() -> { + try { + windowManager.removeView(windowView); + } catch (Exception e) { + + } + }); + } + } + } + + invalidate(); + } + }; + effectImageView = new AnimationView(context); + emojiImageView = new AnimationView(context); + TLRPC.TL_availableReaction availableReaction = MediaDataController.getInstance(currentAccount).getReactionsMap().get(reaction); + if (availableReaction != null) { + TLRPC.Document document = availableReaction.effect_animation; + + effectImageView.getImageReceiver().setUniqKeyPrefix((unicPrefix++) + "_" + cell.getMessageObject().getId() + "_"); + effectImageView.setImage(ImageLocation.getForDocument(document), sizeForFilter + "_" + sizeForFilter + "_pcache", null, null, 0, null); + + effectImageView.getImageReceiver().setAutoRepeat(0); + effectImageView.getImageReceiver().setAllowStartAnimation(false); + + if (effectImageView.getImageReceiver().getLottieAnimation() != null) { + effectImageView.getImageReceiver().getLottieAnimation().setCurrentFrame(0, false); + effectImageView.getImageReceiver().getLottieAnimation().start(); + } + + document = availableReaction.activate_animation; + emojiImageView.getImageReceiver().setUniqKeyPrefix((unicPrefix++) + "_" + cell.getMessageObject().getId() + "_"); + emojiImageView.setImage(ImageLocation.getForDocument(document), emojiSizeForFilter + "_" + emojiSizeForFilter, null, null, 0, null); + + emojiImageView.getImageReceiver().setAutoRepeat(0); + emojiImageView.getImageReceiver().setAllowStartAnimation(false); + + if (emojiImageView.getImageReceiver().getLottieAnimation() != null) { + emojiImageView.getImageReceiver().getLottieAnimation().setCurrentFrame(0, false); + emojiImageView.getImageReceiver().getLottieAnimation().start(); + } + + int topOffset = (size - emojiSize) >> 1; + int leftOffset = size - emojiSize; + container.addView(emojiImageView); + emojiImageView.getLayoutParams().width = emojiSize; + emojiImageView.getLayoutParams().height = emojiSize; + ((FrameLayout.LayoutParams) emojiImageView.getLayoutParams()).topMargin = topOffset; + ((FrameLayout.LayoutParams) emojiImageView.getLayoutParams()).leftMargin = leftOffset; + + windowView.addView(container); + container.getLayoutParams().width = size; + container.getLayoutParams().height = size; + ((FrameLayout.LayoutParams) container.getLayoutParams()).topMargin = -topOffset; + ((FrameLayout.LayoutParams) container.getLayoutParams()).leftMargin = -leftOffset; + + windowView.addView(effectImageView); + effectImageView.getLayoutParams().width = size; + effectImageView.getLayoutParams().height = size; + + effectImageView.getLayoutParams().width = size; + effectImageView.getLayoutParams().height = size; + ((FrameLayout.LayoutParams) effectImageView.getLayoutParams()).topMargin = -topOffset; + ((FrameLayout.LayoutParams) effectImageView.getLayoutParams()).leftMargin = -leftOffset; + + container.setPivotX(leftOffset); + container.setPivotY(topOffset); + } + } + + public static void show(BaseFragment baseFragment, ReactionsContainerLayout reactionsLayout, ChatMessageCell cell, float x, float y, String reaction, int currentAccount) { + if (cell == null) { + return; + } + ReactionsEffectOverlay reactionsEffectOverlay = new ReactionsEffectOverlay(baseFragment.getParentActivity(), baseFragment, reactionsLayout, cell, x, y, reaction, currentAccount); + currentOverlay = reactionsEffectOverlay; + + WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); + lp.width = lp.height = WindowManager.LayoutParams.MATCH_PARENT; + lp.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL; + lp.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR; + lp.format = PixelFormat.TRANSLUCENT; + + reactionsEffectOverlay.windowManager = baseFragment.getParentActivity().getWindowManager(); + reactionsEffectOverlay.windowManager.addView(reactionsEffectOverlay.windowView, lp); + cell.invalidate(); + if (cell.getCurrentMessagesGroup() != null && cell.getParent() != null) { + ((View) cell.getParent()).invalidate(); + } + } + + public static void startAnimation() { + if (currentOverlay != null) { + currentOverlay.started = true; + } + } + + public static void removeCurrent(boolean instant) { + if (currentOverlay != null) { + if (instant) { + try { + currentOverlay.windowManager.removeView(currentOverlay.windowView); + } catch (Exception e) { + + } + } else { + currentOverlay.dismissed = true; + } + } + currentOverlay = null; + } + + public static boolean isPlaying(int messageId, long groupId, String reaction) { + if (currentOverlay != null) { + return ((currentOverlay.groupId != 0 && groupId == currentOverlay.groupId) || messageId == currentOverlay.messageId) && currentOverlay.reaction.equals(reaction); + } + return false; + } + + + private class AnimationView extends BackupImageView { + + public AnimationView(Context context) { + super(context); + } + + boolean wasPlaying; + + @Override + protected void onDraw(Canvas canvas) { + if (getImageReceiver().getLottieAnimation() != null && getImageReceiver().getLottieAnimation().isRunning()) { + wasPlaying = true; + } + if (!wasPlaying && getImageReceiver().getLottieAnimation() != null && !getImageReceiver().getLottieAnimation().isRunning()) { + getImageReceiver().getLottieAnimation().setCurrentFrame(0, false); + getImageReceiver().getLottieAnimation().start(); + } + super.onDraw(canvas); + } + } + + public static void onScrolled(int dy) { + if (currentOverlay != null) { + currentOverlay.lastDrawnToY -= dy; + if (dy != 0) { + currentOverlay.wasScrolled = true; + } + } + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsLayoutInBubble.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsLayoutInBubble.java new file mode 100644 index 000000000..2e36d3030 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsLayoutInBubble.java @@ -0,0 +1,624 @@ +package org.telegram.ui.Components.Reactions; + +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.text.TextPaint; +import android.view.Gravity; +import android.view.MotionEvent; +import android.view.ViewConfiguration; + +import androidx.core.graphics.ColorUtils; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.ApplicationLoader; +import org.telegram.messenger.DocumentObject; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.ImageReceiver; +import org.telegram.messenger.MediaDataController; +import org.telegram.messenger.MessageObject; +import org.telegram.messenger.MessagesController; +import org.telegram.messenger.SvgHelper; +import org.telegram.messenger.UserConfig; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.Cells.ChatMessageCell; +import org.telegram.ui.Components.AvatarsDarawable; +import org.telegram.ui.Components.CounterView; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; + +public class ReactionsLayoutInBubble { + + private final static int ANIMATION_TYPE_IN = 1; + private final static int ANIMATION_TYPE_OUT = 2; + private final static int ANIMATION_TYPE_MOVE = 3; + public boolean drawServiceShaderBackground; + + private static Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); + private static TextPaint textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); + public boolean isSmall; + + public int x; + public int y; + private float fromX; + private float fromY; + private float lastDrawnX; + private float lastDrawnY; + private boolean wasDrawn; + private boolean animateMove; + private boolean animateWidth; + public int positionOffsetY; + int currentAccount; + public int height; + public int totalHeight; + public int width; + public int fromWidth; + public boolean isEmpty; + private float touchSlop; + public int lastLineX; + ArrayList reactionButtons = new ArrayList<>(); + ArrayList outButtons = new ArrayList<>(); + HashMap lastDrawingReactionButtons = new HashMap<>(); + HashMap lastDrawingReactionButtonsTmp = new HashMap<>(); + ChatMessageCell parentView; + MessageObject messageObject; + Theme.ResourcesProvider resourcesProvider; + + int availableWidth; + private int lastDrawnWidth; + boolean attached; + + private final static ButtonsComparator comparator = new ButtonsComparator(); + + public ReactionsLayoutInBubble(ChatMessageCell parentView) { + this.parentView = parentView; + currentAccount = UserConfig.selectedAccount; + paint.setColor(Theme.getColor(Theme.key_chat_inLoader)); + textPaint.setColor(Theme.getColor(Theme.key_featuredStickers_buttonText)); + textPaint.setTextSize(AndroidUtilities.dp(12)); + textPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + touchSlop = ViewConfiguration.get(ApplicationLoader.applicationContext).getScaledTouchSlop(); + } + + public void setMessage(MessageObject messageObject, boolean isSmall, Theme.ResourcesProvider resourcesProvider) { + this.resourcesProvider = resourcesProvider; + this.isSmall = isSmall; + this.messageObject = messageObject; + for (int i = 0; i < reactionButtons.size(); i++) { + reactionButtons.get(i).detach(); + } + reactionButtons.clear(); + if (messageObject != null) { + if (messageObject.messageOwner.reactions != null && messageObject.messageOwner.reactions.results != null) { + int totalCount = 0; + for (int i = 0; i < messageObject.messageOwner.reactions.results.size(); i++) { + totalCount += messageObject.messageOwner.reactions.results.get(i).count; + } + for (int i = 0; i < messageObject.messageOwner.reactions.results.size(); i++) { + TLRPC.TL_reactionCount reactionCount = messageObject.messageOwner.reactions.results.get(i); + ReactionButton button = new ReactionButton(reactionCount); + reactionButtons.add(button); + if (!isSmall && messageObject.messageOwner.reactions.recent_reactons != null) { + ArrayList users = null; + if (reactionCount.count <= 3 && totalCount <= 3) { + for (int j = 0; j < messageObject.messageOwner.reactions.recent_reactons.size(); j++) { + TLRPC.TL_messageUserReaction reccent = messageObject.messageOwner.reactions.recent_reactons.get(j); + if (reccent.reaction.equals(reactionCount.reaction) && MessagesController.getInstance(currentAccount).getUser(reccent.user_id) != null) { + if (users == null) { + users = new ArrayList<>(); + } + users.add(MessagesController.getInstance(currentAccount).getUser(reccent.user_id)); + } + } + button.setUsers(users); + if (users != null && !users.isEmpty()) { + button.count = 0; + button.counterDrawable.setCount(0, false); + } + } + } + if (isSmall && reactionCount.count > 1 && reactionCount.chosen) { + reactionButtons.add(new ReactionButton(reactionCount)); + reactionButtons.get(0).isSelected = false; + reactionButtons.get(1).isSelected = true; + break; + } + if (isSmall && i == 2) { + break; + } + if (attached) { + button.attach(); + } + } + } + comparator.currentAccount = currentAccount; + Collections.sort(reactionButtons, comparator); + } + isEmpty = reactionButtons.isEmpty(); + } + + public void measure(int availableWidth) { + height = 0; + width = 0; + positionOffsetY = 0; + if (isEmpty) { + return; + } + this.availableWidth = availableWidth; + int maxWidth = 0; + int currentX = 0; + int currentY = 0; + for (int i = 0; i < reactionButtons.size(); i++) { + ReactionButton button = reactionButtons.get(i); + if (isSmall) { + button.width = AndroidUtilities.dp(14); + button.height = AndroidUtilities.dp(14); + } else { + button.width = (int) (AndroidUtilities.dp(8) + AndroidUtilities.dp(20) + AndroidUtilities.dp(4)); + if (button.avatarsDarawable != null && button.users.size() > 0) { + button.users.size(); + int c1 = 1; + int c2 = button.users.size() > 1 ? button.users.size() - 1 : 0; + button.width += AndroidUtilities.dp(2) + c1 * AndroidUtilities.dp(20) + c2 * AndroidUtilities.dp(20) * 0.8f + AndroidUtilities.dp(1); + button.avatarsDarawable.height = AndroidUtilities.dp(26); + } else { + button.width += button.counterDrawable.textPaint.measureText(button.countText) + AndroidUtilities.dp(8); + } + button.height = AndroidUtilities.dp(26); + } + + if (currentX + button.width > availableWidth) { + currentX = 0; + currentY += button.height + AndroidUtilities.dp(4); + } + button.x = currentX; + button.y = currentY; + currentX += button.width + AndroidUtilities.dp(4); + if (currentX > maxWidth) { + maxWidth = currentX; + } + + } + lastLineX = currentX; + width = maxWidth; + height = currentY + (reactionButtons.size() == 0 ? 0 : AndroidUtilities.dp(26)); + + drawServiceShaderBackground = false; + } + + public void draw(Canvas canvas, float animationProgress) { + if (isEmpty && outButtons.isEmpty()) { + return; + } + float totalX = this.x; + float totalY = this.y; + if (isEmpty) { + totalX = lastDrawnX; + totalY = lastDrawnY; + } else if (animateMove) { + totalX = totalX * (animationProgress) + fromX * (1f - animationProgress); + totalY = totalY * (animationProgress) + fromY * (1f - animationProgress); + } + canvas.save(); + canvas.translate(totalX, totalY); + for (int i = 0; i < reactionButtons.size(); i++) { + ReactionButton reactionButton = reactionButtons.get(i); + canvas.save(); + float x = reactionButton.x; + float y = reactionButton.y; + if (animationProgress != 1f && reactionButton.animationType == ANIMATION_TYPE_MOVE) { + x = reactionButton.x * animationProgress + reactionButton.animateFromX * (1f - animationProgress); + y = reactionButton.y * animationProgress + reactionButton.animateFromY * (1f - animationProgress); + } + canvas.translate(x, y); + float alpha = 1f; + if (animationProgress != 1f && reactionButton.animationType == ANIMATION_TYPE_IN) { + float s = 0.5f + 0.5f * animationProgress; + alpha = animationProgress; + canvas.scale(s, s, reactionButton.width / 2f, reactionButton.height / 2f); + } + reactionButton.draw(canvas, reactionButton.animationType == ANIMATION_TYPE_IN ? 1f : animationProgress, alpha); + canvas.restore(); + } + + for (int i = 0; i < outButtons.size(); i++) { + ReactionButton reactionButton = outButtons.get(i); + canvas.save(); + canvas.translate(reactionButton.x, reactionButton.y); + float s = 0.5f + 0.5f * (1f - animationProgress); + canvas.scale(s, s, reactionButton.width / 2f, reactionButton.height / 2f); + outButtons.get(i).draw(canvas, 1f, (1f - animationProgress)); + canvas.restore(); + } + canvas.restore(); + } + + public void recordDrawingState() { + lastDrawingReactionButtons.clear(); + for (int i = 0; i < reactionButtons.size(); i++) { + lastDrawingReactionButtons.put(reactionButtons.get(i).reaction, reactionButtons.get(i)); + } + wasDrawn = !isEmpty; + lastDrawnX = x; + lastDrawnY = y; + lastDrawnWidth = width; + } + + public boolean animateChange() { + boolean changed = false; + lastDrawingReactionButtonsTmp.clear(); + for (int i = 0; i < outButtons.size(); i++) { + outButtons.get(i).detach(); + } + outButtons.clear(); + lastDrawingReactionButtonsTmp.putAll(lastDrawingReactionButtons); + for (int i = 0; i < reactionButtons.size(); i++) { + ReactionButton button = reactionButtons.get(i); + ReactionButton lastButton = lastDrawingReactionButtonsTmp.remove(button.reaction); + if (lastButton != null) { + if (button.animateFromX != lastButton.x || button.animateFromY != lastButton.y || button.animateFromWidth != lastButton.width || button.count != lastButton.count || button.backgroundColor != lastButton.backgroundColor) { + button.animateFromX = lastButton.x; + button.animateFromY = lastButton.y; + button.animateFromWidth = lastButton.width; + button.fromTextColor = lastButton.lastDrawnTextColor; + button.fromBackgroundColor = lastButton.lastDrawnBackgroundColor; + button.animationType = ANIMATION_TYPE_MOVE; + + if (button.count != lastButton.count) { + button.counterDrawable.setCount(lastButton.count, false); + button.counterDrawable.setCount(button.count, true); + } + if (button.avatarsDarawable != null || lastButton.avatarsDarawable != null) { + if (button.avatarsDarawable == null) { + button.setUsers(new ArrayList<>()); + } + if (lastButton.avatarsDarawable == null) { + lastButton.setUsers(new ArrayList<>()); + } + button.avatarsDarawable.animateFromState(lastButton.avatarsDarawable, currentAccount); + } + changed = true; + } else { + button.animationType = 0; + } + } else { + changed = true; + button.animationType = ANIMATION_TYPE_IN; + } + } + if (!lastDrawingReactionButtonsTmp.isEmpty()) { + changed = true; + outButtons.addAll(lastDrawingReactionButtonsTmp.values()); + for (int i = 0; i < outButtons.size(); i++) { + outButtons.get(i).drawImage = outButtons.get(i).lastImageDrawn; + outButtons.get(i).attach(); + } + } + + if (wasDrawn && (lastDrawnX != x || lastDrawnY != y)) { + animateMove = true; + fromX = lastDrawnX; + fromY = lastDrawnY; + changed = true; + } + + if (lastDrawnWidth != width) { + animateWidth = true; + fromWidth = lastDrawnWidth; + changed = true; + } + + return changed; + } + + public void resetAnimation() { + for (int i = 0; i < outButtons.size(); i++) { + outButtons.get(i).detach(); + } + outButtons.clear(); + animateMove = false; + animateWidth = false; + for (int i = 0; i < reactionButtons.size(); i++) { + reactionButtons.get(i).animationType = 0; + } + } + + public ReactionButton getReactionButton(String reaction) { + return lastDrawingReactionButtons.get(reaction); + } + + public class ReactionButton { + + private final TLRPC.TL_reactionCount reactionCount; + public int animationType; + public int animateFromX; + public int animateFromY; + public int animateFromWidth; + public int fromBackgroundColor; + public int fromTextColor; + public int realCount; + public boolean drawImage = true; + public boolean lastImageDrawn; + + String countText; + String reaction; + int count; + public int x; + public int y; + int width; + int height; + ImageReceiver imageReceiver = new ImageReceiver(); + CounterView.CounterDrawable counterDrawable = new CounterView.CounterDrawable(parentView, false, null); + int backgroundColor; + int textColor; + int serviceBackgroundColor; + int serviceTextColor; + + int lastDrawnTextColor; + int lastDrawnBackgroundColor; + boolean isSelected; + AvatarsDarawable avatarsDarawable; + ArrayList users; + + public ReactionButton(TLRPC.TL_reactionCount reactionCount) { + this.reactionCount = reactionCount; + this.reaction = reactionCount.reaction; + this.count = reactionCount.count; + this.realCount = reactionCount.count; + countText = Integer.toString(reactionCount.count); + imageReceiver.setParentView(parentView); + isSelected = reactionCount.chosen; + counterDrawable.updateVisibility = false; + if (reactionCount.chosen) { + backgroundColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonBackground : Theme.key_chat_inReactionButtonBackground, resourcesProvider); + textColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonText : Theme.key_chat_inReactionButtonText, resourcesProvider); + serviceTextColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonBackground : Theme.key_chat_inReactionButtonBackground, resourcesProvider); + serviceBackgroundColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outBubble : Theme.key_chat_inBubble); + } else { + textColor = backgroundColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonBackground : Theme.key_chat_inReactionButtonBackground, resourcesProvider); + backgroundColor = ColorUtils.setAlphaComponent(backgroundColor, (int) (Color.alpha(backgroundColor) * 0.156f)); + serviceTextColor = Theme.getColor(Theme.key_chat_serviceText, resourcesProvider); + serviceBackgroundColor = Color.TRANSPARENT; + } + + + if (reaction != null) { + TLRPC.TL_availableReaction r = MediaDataController.getInstance(currentAccount).getReactionsMap().get(reaction); + if (r != null) { + SvgHelper.SvgDrawable svgThumb = DocumentObject.getSvgThumb(r.static_icon, Theme.key_windowBackgroundGray, 1.0f); + imageReceiver.setImage(ImageLocation.getForDocument(r.static_icon), "40_40", svgThumb, "webp", r, 1); + } + } + + counterDrawable.setSize(AndroidUtilities.dp(26), AndroidUtilities.dp(100)); + counterDrawable.textPaint = textPaint; + counterDrawable.setCount(count, false); + counterDrawable.setType(CounterView.CounterDrawable.TYPE_CHAT_REACTIONS); + counterDrawable.gravity = Gravity.LEFT; + } + + public void draw(Canvas canvas, float progress, float alpha) { + if (isSmall) { + imageReceiver.setAlpha(alpha); + imageReceiver.setImageCoords(0, 0, AndroidUtilities.dp(14), AndroidUtilities.dp(14)); + drawImage(canvas); + return; + } + if (drawServiceShaderBackground) { + textPaint.setColor(lastDrawnTextColor = ColorUtils.blendARGB(fromTextColor, serviceTextColor, progress)); + paint.setColor(lastDrawnBackgroundColor = ColorUtils.blendARGB(fromBackgroundColor, serviceBackgroundColor, progress)); + } else { + textPaint.setColor(lastDrawnTextColor = ColorUtils.blendARGB(fromTextColor, textColor, progress)); + paint.setColor(lastDrawnBackgroundColor = ColorUtils.blendARGB(fromBackgroundColor, backgroundColor, progress)); + } + + if (alpha != 1f) { + textPaint.setAlpha((int) (textPaint.getAlpha() * alpha)); + paint.setAlpha((int) (paint.getAlpha() * alpha)); + } + imageReceiver.setAlpha(alpha); + + int w = width; + if (progress != 1f && animationType == ANIMATION_TYPE_MOVE) { + w = (int) (width * progress + animateFromWidth * (1f - progress)); + } + AndroidUtilities.rectTmp.set(0, 0, w, height); + float rad = height / 2f; + if (drawServiceShaderBackground) { + Paint paint1 = getThemedPaint(Theme.key_paint_chatActionBackground); + Paint paint2 = Theme.chat_actionBackgroundGradientDarkenPaint; + int oldAlpha = paint1.getAlpha(); + int oldAlpha2 = paint2.getAlpha(); + paint1.setAlpha((int) (oldAlpha * alpha)); + paint2.setAlpha((int) (oldAlpha2 * alpha)); + canvas.drawRoundRect(AndroidUtilities.rectTmp, rad, rad, paint1); + if (hasGradientService()) { + canvas.drawRoundRect(AndroidUtilities.rectTmp, rad, rad, paint2); + } + paint1.setAlpha(oldAlpha); + paint2.setAlpha(oldAlpha2); + } + canvas.drawRoundRect(AndroidUtilities.rectTmp, rad, rad, paint); + + imageReceiver.setImageCoords(AndroidUtilities.dp(8), (height - AndroidUtilities.dp(20)) / 2f, AndroidUtilities.dp(20), AndroidUtilities.dp(20)); + drawImage(canvas); + + if (count != 0 || counterDrawable.countChangeProgress != 1f) { + canvas.save(); + canvas.translate(AndroidUtilities.dp(8) + AndroidUtilities.dp(20) + AndroidUtilities.dp(2), 0); + counterDrawable.draw(canvas); + canvas.restore(); + } + + if (avatarsDarawable != null) { + canvas.save(); + canvas.translate(AndroidUtilities.dp(10) + AndroidUtilities.dp(20) + AndroidUtilities.dp(2), 0); + avatarsDarawable.setAlpha(alpha); + avatarsDarawable.onDraw(canvas); + canvas.restore(); + } + } + + private void drawImage(Canvas canvas) { + if (drawImage && ((realCount > 1 || !ReactionsEffectOverlay.isPlaying(messageObject.getId(), messageObject.getGroupId(), reaction)) || !isSelected)) { + imageReceiver.draw(canvas); + lastImageDrawn = true; + } else { + imageReceiver.setAlpha(0); + imageReceiver.draw(canvas); + lastImageDrawn = false; + } + } + + public void setUsers(ArrayList users) { + this.users = users; + if (users != null) { + if (avatarsDarawable == null) { + avatarsDarawable = new AvatarsDarawable(parentView, false); + avatarsDarawable.setSize(AndroidUtilities.dp(20)); + avatarsDarawable.width = AndroidUtilities.dp(100); + avatarsDarawable.height = height; + if (attached) { + avatarsDarawable.onAttachedToWindow(); + } + } + for (int i = 0; i < users.size(); i++) { + if (i == 3) { + break; + } + avatarsDarawable.setObject(i, currentAccount, users.get(i)); + } + avatarsDarawable.commitTransition(false); + } + } + + + + public void attach() { + if (imageReceiver != null) { + imageReceiver.onAttachedToWindow(); + } + if (avatarsDarawable != null) { + avatarsDarawable.onAttachedToWindow(); + } + } + + public void detach() { + if (imageReceiver != null) { + imageReceiver.onDetachedFromWindow(); + } + if (avatarsDarawable != null) { + avatarsDarawable.onDetachedFromWindow(); + } + } + } + static int attachedCount; + + float lastX; + float lastY; + ReactionButton lastSelectedButton; + boolean pressed; + Runnable longPressRunnable; + + public boolean chekTouchEvent(MotionEvent event) { + if (isEmpty || messageObject == null || messageObject.messageOwner == null || messageObject.messageOwner.reactions == null) { + return false; + } + float x = event.getX() - this.x; + float y = event.getY() - this.y; + if (event.getAction() == MotionEvent.ACTION_DOWN) { + for (int i = 0, n = reactionButtons.size(); i < n; i++) { + if (x > reactionButtons.get(i).x && x < reactionButtons.get(i).x + reactionButtons.get(i).width && + y > reactionButtons.get(i).y && y < reactionButtons.get(i).y + reactionButtons.get(i).height) { + lastX = event.getX(); + lastY = event.getY(); + lastSelectedButton = reactionButtons.get(i); + if (longPressRunnable != null && messageObject.messageOwner.reactions.can_see_list) { + AndroidUtilities.cancelRunOnUIThread(longPressRunnable); + longPressRunnable = null; + } + + final ReactionButton selectedButtonFinal = lastSelectedButton; + AndroidUtilities.runOnUIThread(longPressRunnable = () -> { + parentView.getDelegate().didPressReaction(parentView, selectedButtonFinal.reactionCount, true); + longPressRunnable = null; + }, ViewConfiguration.getLongPressTimeout()); + pressed = true; + break; + } + } + } else if (event.getAction() == MotionEvent.ACTION_MOVE) { + if (pressed && Math.abs(event.getX() - lastX) > touchSlop || Math.abs(event.getY() - lastY) > touchSlop) { + pressed = false; + lastSelectedButton = null; + if (longPressRunnable != null) { + AndroidUtilities.cancelRunOnUIThread(longPressRunnable); + longPressRunnable = null; + } + } + } else if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL) { + if (longPressRunnable != null) { + AndroidUtilities.cancelRunOnUIThread(longPressRunnable); + longPressRunnable = null; + } + if (pressed && lastSelectedButton != null && event.getAction() == MotionEvent.ACTION_UP) { + if (parentView.getDelegate() != null) { + parentView.getDelegate().didPressReaction(parentView, lastSelectedButton.reactionCount, false); + } + } + pressed = false; + lastSelectedButton = null; + } + return pressed; + } + + private boolean hasGradientService() { + return resourcesProvider != null ? resourcesProvider.hasGradientService() : Theme.hasGradientService(); + } + + private Paint getThemedPaint(String paintKey) { + Paint paint = resourcesProvider != null ? resourcesProvider.getPaint(paintKey) : null; + return paint != null ? paint : Theme.getThemePaint(paintKey); + } + + public float getCurrentWidth(float transitionProgress) { + if (animateWidth) { + return fromWidth * (1f - transitionProgress) + width * transitionProgress; + } + return width; + } + + private static class ButtonsComparator implements Comparator { + + int currentAccount; + + @Override + public int compare(ReactionButton o1, ReactionButton o2) { + if (o1.realCount != o2.realCount) { + return o2.realCount - o1.realCount; + } + TLRPC.TL_availableReaction availableReaction1 = MediaDataController.getInstance(currentAccount).getReactionsMap().get(o1.reaction); + TLRPC.TL_availableReaction availableReaction2 = MediaDataController.getInstance(currentAccount).getReactionsMap().get(o2.reaction); + if (availableReaction1 != null && availableReaction2 != null) { + return availableReaction1.positionInList - availableReaction2.positionInList; + } + return 0; + } + } + + public void onAttachToWindow() { + for (int i = 0; i < reactionButtons.size(); i++) { + reactionButtons.get(i).attach(); + } + } + + public void onDetachFromWindow() { + for (int i = 0; i < reactionButtons.size(); i++) { + reactionButtons.get(i).detach(); + } + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionsContainerLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionsContainerLayout.java new file mode 100644 index 000000000..18f86ce65 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionsContainerLayout.java @@ -0,0 +1,431 @@ +package org.telegram.ui.Components; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ValueAnimator; +import android.annotation.SuppressLint; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.LinearGradient; +import android.graphics.Paint; +import android.graphics.Path; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; +import android.graphics.Rect; +import android.graphics.RectF; +import android.graphics.Region; +import android.graphics.Shader; +import android.graphics.drawable.Drawable; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup; +import android.widget.FrameLayout; + +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; +import androidx.core.util.Consumer; +import androidx.dynamicanimation.animation.FloatPropertyCompat; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.DocumentObject; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.R; +import org.telegram.messenger.SvgHelper; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.Theme; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Random; + +public class ReactionsContainerLayout extends FrameLayout { + public final static FloatPropertyCompat TRANSITION_PROGRESS_VALUE = new FloatPropertyCompat("transitionProgress") { + @Override + public float getValue(ReactionsContainerLayout object) { + return object.transitionProgress * 100f; + } + + @Override + public void setValue(ReactionsContainerLayout object, float value) { + object.setTransitionProgress(value / 100f); + } + }; + + private final static Random RANDOM = new Random(); + + private final static int ALPHA_DURATION = 150; + private final static float SIDE_SCALE = 0.6f; + private final static float SCALE_PROGRESS = 0.75f; + private final static float CLIP_PROGRESS = 0.25f; + public final RecyclerListView recyclerListView; + + private Paint bgPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + private Paint leftShadowPaint = new Paint(Paint.ANTI_ALIAS_FLAG), + rightShadowPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + private float leftAlpha, rightAlpha; + private float transitionProgress = 1f; + private RectF rect = new RectF(); + private Path mPath = new Path(); + private float radius = AndroidUtilities.dp(72); + private float bigCircleRadius = AndroidUtilities.dp(8); + private float smallCircleRadius = bigCircleRadius / 2; + private int bigCircleOffset = AndroidUtilities.dp(36); + + private List reactionsList = Collections.emptyList(); + + private LinearLayoutManager linearLayoutManager; + private RecyclerView.Adapter listAdapter; + + private int[] location = new int[2]; + + private ReactionsContainerDelegate delegate; + + private Rect shadowPad = new Rect(); + private Drawable shadow; + + private List triggeredReactions = new ArrayList<>(); + Theme.ResourcesProvider resourcesProvider; + + public ReactionsContainerLayout(@NonNull Context context, Theme.ResourcesProvider resourcesProvider) { + super(context); + this.resourcesProvider = resourcesProvider; + + shadow = ContextCompat.getDrawable(context, R.drawable.reactions_bubble_shadow).mutate(); + shadowPad.left = shadowPad.top = shadowPad.right = shadowPad.bottom = AndroidUtilities.dp(7); + shadow.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chat_messagePanelShadow), PorterDuff.Mode.MULTIPLY)); + + recyclerListView = new RecyclerListView(context); + linearLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false); + recyclerListView.addItemDecoration(new RecyclerView.ItemDecoration() { + @Override + public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { + super.getItemOffsets(outRect, view, parent, state); + int position = parent.getChildAdapterPosition(view); + if (position == 0) { + outRect.left = AndroidUtilities.dp(6); + } + outRect.right = AndroidUtilities.dp(4); + if (position == listAdapter.getItemCount() - 1) { + outRect.right = AndroidUtilities.dp(6); + } + } + }); + recyclerListView.setLayoutManager(linearLayoutManager); + recyclerListView.setOverScrollMode(View.OVER_SCROLL_NEVER); + recyclerListView.setAdapter(listAdapter = new RecyclerView.Adapter() { + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + ReactionHolderView hv = new ReactionHolderView(context); + int size = getLayoutParams().height - getPaddingTop() - getPaddingBottom(); + hv.setLayoutParams(new RecyclerView.LayoutParams(size - AndroidUtilities.dp(12), size)); + return new RecyclerListView.Holder(hv); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + ReactionHolderView h = (ReactionHolderView) holder.itemView; + h.setScaleX(1); + h.setScaleY(1); + h.setReaction(reactionsList.get(position)); + } + + @Override + public int getItemCount() { + return reactionsList.size(); + } + }); + recyclerListView.setOnItemClickListener((view, position) -> { + ReactionHolderView h = (ReactionHolderView) view; + if (delegate != null) + delegate.onReactionClicked(h, h.currentReaction); + }); + recyclerListView.addOnScrollListener(new LeftRightShadowsListener()); + recyclerListView.addOnScrollListener(new RecyclerView.OnScrollListener() { + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + if (recyclerView.getChildCount() > 2) { + float sideDiff = 1f - SIDE_SCALE; + + recyclerView.getLocationInWindow(location); + int rX = location[0]; + + View ch1 = recyclerView.getChildAt(0); + ch1.getLocationInWindow(location); + int ch1X = location[0]; + + int dX1 = ch1X - rX; + float s1 = SIDE_SCALE + (1f - Math.min(1, -Math.min(dX1, 0f) / ch1.getWidth())) * sideDiff; + if (Float.isNaN(s1)) s1 = 1f; + ch1.setScaleX(s1); + ch1.setScaleY(s1); + + View ch2 = recyclerView.getChildAt(recyclerView.getChildCount() - 1); + ch2.getLocationInWindow(location); + int ch2X = location[0]; + + int dX2 = rX + recyclerView.getWidth() - (ch2X + ch2.getWidth()); + float s2 = SIDE_SCALE + (1f - Math.min(1, -Math.min(dX2, 0f) / ch2.getWidth())) * sideDiff; + if (Float.isNaN(s2)) s2 = 1f; + ch2.setScaleX(s2); + ch2.setScaleY(s2); + } + for (int i = 1; i < recyclerListView.getChildCount() - 1; i++) { + View ch = recyclerListView.getChildAt(i); + float sc = 1f; + ch.setScaleX(sc); + ch.setScaleY(sc); + } + invalidate(); + } + }); + recyclerListView.addItemDecoration(new RecyclerView.ItemDecoration() { + @Override + public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { + int i = parent.getChildAdapterPosition(view); + if (i == 0) + outRect.left = AndroidUtilities.dp(8); + if (i == listAdapter.getItemCount() - 1) + outRect.right = AndroidUtilities.dp(8); + } + }); + addView(recyclerListView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + invalidateShaders(); + + bgPaint.setColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground, resourcesProvider)); + } + + public void setDelegate(ReactionsContainerDelegate delegate) { + this.delegate = delegate; + } + + @SuppressLint("NotifyDataSetChanged") + public void setReactionsList(List reactionsList) { + this.reactionsList = reactionsList; + listAdapter.notifyDataSetChanged(); + } + + HashSet lastVisibleViews = new HashSet<>(); + HashSet lastVisibleViewsTmp = new HashSet<>(); + + @Override + protected void dispatchDraw(Canvas canvas) { + lastVisibleViewsTmp.clear(); + lastVisibleViewsTmp.addAll(lastVisibleViews); + lastVisibleViews.clear(); + if (transitionProgress != 0) { + int delay = 0; + for (int i = 0; i < recyclerListView.getChildCount(); i++) { + View view = recyclerListView.getChildAt(i); + if (view.getX() + view.getMeasuredWidth() > 0 && view.getX() < getWidth()) { + if (!lastVisibleViewsTmp.contains(view)) { + ((ReactionHolderView) view).play(delay); + delay += 50; + } + lastVisibleViews.add(view); + } + } + } + + float cPr = (Math.max(CLIP_PROGRESS, Math.min(transitionProgress, 1f)) - CLIP_PROGRESS) / (1f - CLIP_PROGRESS); + float br = bigCircleRadius * cPr, sr = smallCircleRadius * cPr; + + float cx = LocaleController.isRTL ? bigCircleOffset : getWidth() - bigCircleOffset, cy = getHeight() - getPaddingBottom(); + int sPad = AndroidUtilities.dp(3); + shadow.setBounds((int) (cx - br - sPad * cPr), (int) (cy - br - sPad * cPr), (int) (cx + br + sPad * cPr), (int) (cy + br + sPad * cPr)); + shadow.draw(canvas); + canvas.drawCircle(cx, cy, br, bgPaint); + + cx = LocaleController.isRTL ? bigCircleOffset - bigCircleRadius : getWidth() - bigCircleOffset + bigCircleRadius; + cy = getHeight() - smallCircleRadius - sPad; + sPad = -AndroidUtilities.dp(1); + shadow.setBounds((int) (cx - br - sPad * cPr), (int) (cy - br - sPad * cPr), (int) (cx + br + sPad * cPr), (int) (cy + br + sPad * cPr)); + shadow.draw(canvas); + canvas.drawCircle(cx, cy, sr, bgPaint); + + int s = canvas.save(); + mPath.rewind(); + mPath.addCircle(LocaleController.isRTL ? bigCircleOffset : getWidth() - bigCircleOffset, getHeight() - getPaddingBottom(), br, Path.Direction.CW); + canvas.clipPath(mPath, Region.Op.DIFFERENCE); + + float pivotX = LocaleController.isRTL ? getWidth() * 0.125f : getWidth() * 0.875f; + + if (transitionProgress <= SCALE_PROGRESS) { + float sc = transitionProgress / SCALE_PROGRESS; + canvas.scale(sc, sc, pivotX, getHeight() / 2f); + } + + float lt = 0, rt = 1; + if (LocaleController.isRTL) { + rt = Math.max(CLIP_PROGRESS, transitionProgress); + } else { + lt = (1f - Math.max(CLIP_PROGRESS, transitionProgress)); + } + rect.set(getPaddingLeft() + (getWidth() - getPaddingRight()) * lt, getPaddingTop(), (getWidth() - getPaddingRight()) * rt, getHeight() - getPaddingBottom()); + shadow.setBounds((int) (getPaddingLeft() + (getWidth() - getPaddingRight() + shadowPad.right) * lt - shadowPad.left), getPaddingTop() - shadowPad.top, (int) ((getWidth() - getPaddingRight() + shadowPad.right) * rt), getHeight() - getPaddingBottom() + shadowPad.bottom); + shadow.draw(canvas); + canvas.restoreToCount(s); + + s = canvas.save(); + if (transitionProgress <= SCALE_PROGRESS) { + float sc = transitionProgress / SCALE_PROGRESS; + canvas.scale(sc, sc, pivotX, getHeight() / 2f); + } + canvas.drawRoundRect(rect, radius, radius, bgPaint); + canvas.restoreToCount(s); + + mPath.rewind(); + mPath.addRoundRect(rect, radius, radius, Path.Direction.CW); + + s = canvas.save(); + if (transitionProgress <= SCALE_PROGRESS) { + float sc = transitionProgress / SCALE_PROGRESS; + canvas.scale(sc, sc, pivotX, getHeight() / 2f); + } + canvas.clipPath(mPath); + canvas.translate((LocaleController.isRTL ? -1 : 1) * getWidth() * (1f - transitionProgress), 0); + super.dispatchDraw(canvas); + + canvas.restoreToCount(s); + s = canvas.save(); + if (LocaleController.isRTL) rt = Math.max(CLIP_PROGRESS, Math.min(1, transitionProgress)); + else lt = 1f - Math.max(CLIP_PROGRESS, Math.min(1f, transitionProgress)); + rect.set(getPaddingLeft() + (getWidth() - getPaddingRight()) * lt, getPaddingTop(), (getWidth() - getPaddingRight()) * rt, getHeight() - getPaddingBottom()); + mPath.rewind(); + mPath.addRoundRect(rect, radius, radius, Path.Direction.CW); + canvas.clipPath(mPath); + if (leftShadowPaint != null) { + leftShadowPaint.setAlpha((int) (leftAlpha * transitionProgress * 0xFF)); + canvas.drawRect(rect, leftShadowPaint); + } + if (rightShadowPaint != null) { + rightShadowPaint.setAlpha((int) (rightAlpha * transitionProgress * 0xFF)); + canvas.drawRect(rect, rightShadowPaint); + } + canvas.restoreToCount(s); + + } + + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + invalidateShaders(); + } + + /** + * Invalidates shaders + */ + private void invalidateShaders() { + int dp = AndroidUtilities.dp(24); + float cy = getHeight() / 2f; + int clr = Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground); + leftShadowPaint.setShader(new LinearGradient(0, cy, dp, cy, clr, Color.TRANSPARENT, Shader.TileMode.CLAMP)); + rightShadowPaint.setShader(new LinearGradient(getWidth(), cy, getWidth() - dp, cy, clr, Color.TRANSPARENT, Shader.TileMode.CLAMP)); + invalidate(); + } + + public void setTransitionProgress(float transitionProgress) { + this.transitionProgress = transitionProgress; + invalidate(); + } + + private final class LeftRightShadowsListener extends RecyclerView.OnScrollListener { + private boolean leftVisible, rightVisible; + private ValueAnimator leftAnimator, rightAnimator; + + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + boolean l = linearLayoutManager.findFirstVisibleItemPosition() != 0; + if (l != leftVisible) { + if (leftAnimator != null) + leftAnimator.cancel(); + leftAnimator = startAnimator(leftAlpha, l ? 1 : 0, aFloat -> { + leftShadowPaint.setAlpha((int) ((leftAlpha = aFloat) * 0xFF)); + invalidate(); + }, () -> leftAnimator = null); + + leftVisible = l; + } + + boolean r = linearLayoutManager.findLastVisibleItemPosition() != listAdapter.getItemCount() - 1; + if (r != rightVisible) { + if (rightAnimator != null) + rightAnimator.cancel(); + rightAnimator = startAnimator(rightAlpha, r ? 1 : 0, aFloat -> { + rightShadowPaint.setAlpha((int) ((rightAlpha = aFloat) * 0xFF)); + invalidate(); + }, () -> rightAnimator = null); + + rightVisible = r; + } + } + + private ValueAnimator startAnimator(float fromAlpha, float toAlpha, Consumer callback, Runnable onEnd) { + ValueAnimator a = ValueAnimator.ofFloat(fromAlpha, toAlpha).setDuration((long) (Math.abs(toAlpha - fromAlpha) * ALPHA_DURATION)); + a.addUpdateListener(animation -> callback.accept((Float) animation.getAnimatedValue())); + a.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + onEnd.run(); + } + }); + a.start(); + return a; + } + } + + public final class ReactionHolderView extends FrameLayout { + public BackupImageView backupImageView; + public TLRPC.TL_availableReaction currentReaction; + + Runnable playRunnable = new Runnable() { + @Override + public void run() { + if (backupImageView.getImageReceiver().getLottieAnimation() != null) { + backupImageView.getImageReceiver().getLottieAnimation().start(); + } + } + }; + + + ReactionHolderView(Context context) { + super(context); + backupImageView = new BackupImageView(context); + backupImageView.getImageReceiver().setAutoRepeat(0); + addView(backupImageView, LayoutHelper.createFrame(34, 34, Gravity.CENTER)); + } + + private void setReaction(TLRPC.TL_availableReaction react) { + currentReaction = react; + SvgHelper.SvgDrawable svgThumb = DocumentObject.getSvgThumb(currentReaction.appear_animation, Theme.key_windowBackgroundGray, 1.0f); + backupImageView.getImageReceiver().setImage(ImageLocation.getForDocument(currentReaction.appear_animation), "80_80_nolimit", null, null, svgThumb, 0, "tgs", react, 0); + } + + public void play(int delay) { + AndroidUtilities.cancelRunOnUIThread(playRunnable); + if (backupImageView.getImageReceiver().getLottieAnimation() != null) { + backupImageView.getImageReceiver().getLottieAnimation().setCurrentFrame(0); + if (delay == 0) { + playRunnable.run(); + } else { + backupImageView.getImageReceiver().getLottieAnimation().stop(); + AndroidUtilities.runOnUIThread(playRunnable, delay); + } + + } + + + } + + } + + public interface ReactionsContainerDelegate { + void onReactionClicked(View v, TLRPC.TL_availableReaction reaction); + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/RecyclerListView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/RecyclerListView.java index 276a3ce14..ab64808c2 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/RecyclerListView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/RecyclerListView.java @@ -25,6 +25,7 @@ import android.graphics.drawable.TransitionDrawable; import android.os.Build; import android.os.SystemClock; import android.text.Layout; +import android.text.SpannableStringBuilder; import android.text.StaticLayout; import android.text.TextPaint; import android.util.SparseIntArray; @@ -39,11 +40,17 @@ import android.view.ViewGroup; import android.view.ViewParent; import android.view.ViewPropertyAnimator; import android.view.accessibility.AccessibilityEvent; +import android.view.accessibility.AccessibilityNodeInfo; import android.widget.FrameLayout; +import androidx.core.content.ContextCompat; +import androidx.core.graphics.ColorUtils; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import org.telegram.messenger.AndroidUtilities; -import org.telegram.messenger.LocaleController; import org.telegram.messenger.FileLog; +import org.telegram.messenger.LocaleController; import org.telegram.messenger.R; import org.telegram.ui.ActionBar.Theme; @@ -52,11 +59,6 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashSet; -import androidx.core.content.ContextCompat; -import androidx.core.graphics.ColorUtils; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - public class RecyclerListView extends RecyclerView { private OnItemClickListener onItemClickListener; @@ -106,7 +108,7 @@ public class RecyclerListView extends RecyclerView { public boolean scrollingByUser; - private GestureDetector gestureDetector; + private GestureDetectorFixDoubleTap gestureDetector; private View currentChildView; private int currentChildPosition; private boolean interceptedByChild; @@ -148,6 +150,18 @@ public class RecyclerListView extends RecyclerView { protected final Theme.ResourcesProvider resourcesProvider; + private boolean accessibilityEnabled = true; + + private AccessibilityDelegate accessibilityDelegate = new AccessibilityDelegate() { + @Override + public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(host, info); + if (host.isEnabled()) { + info.addAction(AccessibilityNodeInfo.ACTION_CLICK); + } + } + }; + public FastScroll getFastScroll() { return fastScroll; } @@ -157,6 +171,14 @@ public class RecyclerListView extends RecyclerView { } public interface OnItemClickListenerExtended { + + default boolean hasDoubleTap(View view, int position) { + return false; + } + + default void onDoubleTap(View view, int position, float x, float y) { + } + void onItemClick(View view, int position, float x, float y); } @@ -166,8 +188,12 @@ public class RecyclerListView extends RecyclerView { public interface OnItemLongClickListenerExtended { boolean onItemClick(View view, int position, float x, float y); - void onMove(float dx, float dy); - void onLongClickRelease(); + + default void onMove(float dx, float dy) { + } + + default void onLongClickRelease() { + } } public interface OnInterceptTouchListener { @@ -184,10 +210,13 @@ public class RecyclerListView extends RecyclerView { public abstract static class FastScrollAdapter extends SelectionAdapter { public abstract String getLetter(int position); + public abstract void getPositionForScrollProgress(RecyclerListView listView, float progress, int[] position); + public void onStartFastScroll() { } + public void onFinishFastScroll(RecyclerListView listView) { } @@ -203,6 +232,7 @@ public class RecyclerListView extends RecyclerView { public boolean fastScrollIsVisible(RecyclerListView listView) { return true; } + public void onFastScrollSingleTap() { } @@ -336,11 +366,17 @@ public class RecyclerListView extends RecyclerView { } public abstract int getSectionCount(); + public abstract int getCountForSection(int section); + public abstract boolean isEnabled(ViewHolder holder, int section, int row); + public abstract int getItemViewType(int section, int position); + public abstract Object getItem(int section, int position); + public abstract void onBindViewHolder(int section, int position, ViewHolder holder); + public abstract View getSectionHeaderView(int section, View view); } @@ -365,6 +401,13 @@ public class RecyclerListView extends RecyclerView { private boolean pressed; private StaticLayout letterLayout; private StaticLayout oldLetterLayout; + private StaticLayout outLetterLayout; + private StaticLayout inLetterLayout; + private StaticLayout stableLetterLayout; + private float replaceLayoutProgress = 1f; + private boolean fromTop; + private float lastLetterY; + private float fromWidth; private TextPaint letterPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); private String currentLetter; private Path path = new Path(); @@ -545,11 +588,41 @@ public class RecyclerListView extends RecyclerView { } letterLayout = null; } else if (!newLetter.equals(currentLetter)) { + currentLetter = newLetter; if (type == LETTER_TYPE) { letterLayout = new StaticLayout(newLetter, letterPaint, 1000, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); } else { + outLetterLayout = letterLayout; int w = ((int) letterPaint.measureText(newLetter)) + 1; letterLayout = new StaticLayout(newLetter, letterPaint, w, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); + if (outLetterLayout != null) { + String[] newSplits = newLetter.split(" "); + String[] oldSplits = outLetterLayout.getText().toString().split(" "); + if (newSplits != null && oldSplits != null && newSplits.length == 2 && oldSplits.length == 2 && newSplits[1].equals(oldSplits[1])) { + String oldText = outLetterLayout.getText().toString(); + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(oldText); + spannableStringBuilder.setSpan(new EmptyStubSpan(), oldSplits[0].length(), oldText.length(), 0); + int oldW = ((int) letterPaint.measureText(oldText)) + 1; + outLetterLayout = new StaticLayout(spannableStringBuilder, letterPaint, oldW, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); + + spannableStringBuilder = new SpannableStringBuilder(newLetter); + spannableStringBuilder.setSpan(new EmptyStubSpan(), newSplits[0].length(), newLetter.length(), 0); + inLetterLayout = new StaticLayout(spannableStringBuilder, letterPaint, w, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); + + spannableStringBuilder = new SpannableStringBuilder(newLetter); + spannableStringBuilder.setSpan(new EmptyStubSpan(), 0, newSplits[0].length(), 0); + stableLetterLayout = new StaticLayout(spannableStringBuilder, letterPaint, w, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); + } else { + inLetterLayout = letterLayout; + stableLetterLayout = null; + } + + fromWidth = outLetterLayout.getWidth(); + replaceLayoutProgress = 0f; + fromTop = getProgress() > lastLetterY; + } + + lastLetterY = getProgress(); } oldLetterLayout = null; if (letterLayout.getLineCount() > 0) { @@ -660,19 +733,61 @@ public class RecyclerListView extends RecyclerView { float cy = rect.centerY(); float x = rect.left - AndroidUtilities.dp(30) * bubbleProgress - AndroidUtilities.dp(8); float r = letterLayout.getHeight() / 2f + AndroidUtilities.dp(6); - rect.set(x - letterLayout.getWidth() - AndroidUtilities.dp(36), cy - letterLayout.getHeight() / 2f - AndroidUtilities.dp(8), x - AndroidUtilities.dp(12), cy + letterLayout.getHeight() / 2f + AndroidUtilities.dp(8)); + float width = replaceLayoutProgress * letterLayout.getWidth() + fromWidth * (1f - replaceLayoutProgress); + rect.set(x - width - AndroidUtilities.dp(36), cy - letterLayout.getHeight() / 2f - AndroidUtilities.dp(8), x - AndroidUtilities.dp(12), cy + letterLayout.getHeight() / 2f + AndroidUtilities.dp(8)); int oldAlpha1 = paint2.getAlpha(); int oldAlpha2 = letterPaint.getAlpha(); paint2.setAlpha((int) (oldAlpha1 * floatingDateProgress)); - letterPaint.setAlpha((int) (oldAlpha2 * floatingDateProgress)); + fastScrollBackgroundDrawable.setBounds((int) rect.left, (int) rect.top, (int) rect.right, (int) rect.bottom); fastScrollBackgroundDrawable.setAlpha((int) (255 * floatingDateProgress)); fastScrollBackgroundDrawable.draw(canvas); - canvas.save(); - canvas.translate(x - letterLayout.getWidth() - AndroidUtilities.dp(24), cy - letterLayout.getHeight() / 2f); - letterLayout.draw(canvas); - canvas.restore(); + + if (replaceLayoutProgress != 1f) { + replaceLayoutProgress += 16f / 150f; + if (replaceLayoutProgress > 1f) { + replaceLayoutProgress = 1f; + } else { + invalidate(); + } + } + + if (replaceLayoutProgress != 1f) { + canvas.save(); + rect.inset(AndroidUtilities.dp(4), AndroidUtilities.dp(2)); + canvas.clipRect(rect); + if (outLetterLayout != null) { + letterPaint.setAlpha((int) (oldAlpha2 * floatingDateProgress * (1f - replaceLayoutProgress))); + canvas.save(); + canvas.translate(x - outLetterLayout.getWidth() - AndroidUtilities.dp(24), cy - outLetterLayout.getHeight() / 2f + (fromTop ? -1 : 1) * AndroidUtilities.dp(15) * replaceLayoutProgress); + outLetterLayout.draw(canvas); + canvas.restore(); + } + + if (inLetterLayout != null) { + letterPaint.setAlpha((int) (oldAlpha2 * floatingDateProgress * replaceLayoutProgress)); + canvas.save(); + canvas.translate(x - inLetterLayout.getWidth() - AndroidUtilities.dp(24), cy - inLetterLayout.getHeight() / 2f + (fromTop ? 1 : -1) * AndroidUtilities.dp(15) * (1f - replaceLayoutProgress)); + inLetterLayout.draw(canvas); + canvas.restore(); + } + + if (stableLetterLayout != null) { + letterPaint.setAlpha((int) (oldAlpha2 * floatingDateProgress)); + canvas.save(); + canvas.translate(x - stableLetterLayout.getWidth() - AndroidUtilities.dp(24), cy - stableLetterLayout.getHeight() / 2f); + stableLetterLayout.draw(canvas); + canvas.restore(); + } + canvas.restore(); + } else { + letterPaint.setAlpha((int) (oldAlpha2 * floatingDateProgress)); + canvas.save(); + canvas.translate(x - letterLayout.getWidth() - AndroidUtilities.dp(24), cy - letterLayout.getHeight() / 2f + AndroidUtilities.dp(15) * (1f - replaceLayoutProgress)); + letterLayout.draw(canvas); + canvas.restore(); + } paint2.setAlpha(oldAlpha1); letterPaint.setAlpha(oldAlpha2); @@ -788,14 +903,50 @@ public class RecyclerListView extends RecyclerView { private class RecyclerListViewItemClickListener implements OnItemTouchListener { public RecyclerListViewItemClickListener(Context context) { - gestureDetector = new GestureDetector(context, new GestureDetector.OnGestureListener() { + gestureDetector = new GestureDetectorFixDoubleTap(context, new GestureDetector.SimpleOnGestureListener() { + private View doubleTapView; + @Override public boolean onSingleTapUp(MotionEvent e) { - if (currentChildView != null && (onItemClickListener != null || onItemClickListenerExtended != null)) { + if (currentChildView != null) { + if (onItemClickListenerExtended != null && onItemClickListenerExtended.hasDoubleTap(currentChildView, currentChildPosition)) { + doubleTapView = currentChildView; + } else { + onPressItem(currentChildView, e); + return true; + } + } + return false; + } + + @Override + public boolean onSingleTapConfirmed(MotionEvent e) { + if (doubleTapView != null && onItemClickListenerExtended != null) { + if (onItemClickListenerExtended.hasDoubleTap(doubleTapView, currentChildPosition)) { + onPressItem(doubleTapView, e); + doubleTapView = null; + return true; + } + } + return false; + } + + @Override + public boolean onDoubleTap(MotionEvent e) { + if (doubleTapView != null && onItemClickListenerExtended != null && onItemClickListenerExtended.hasDoubleTap(doubleTapView, currentChildPosition)) { + onItemClickListenerExtended.onDoubleTap(doubleTapView, currentChildPosition, e.getX(), e.getY()); + doubleTapView = null; + return true; + } + return false; + } + + private void onPressItem(View cv, MotionEvent e) { + if (cv != null && (onItemClickListener != null || onItemClickListenerExtended != null)) { final float x = e.getX(); final float y = e.getY(); - onChildPressed(currentChildView, x, y, true); - final View view = currentChildView; + onChildPressed(cv, x, y, true); + final View view = cv; final int position = currentChildPosition; if (instantClick && position != -1) { view.playSoundEffect(SoundEffectConstants.CLICK); @@ -830,15 +981,13 @@ public class RecyclerListView extends RecyclerView { }, ViewConfiguration.getPressedStateDuration()); if (selectChildRunnable != null) { - View pressedChild = currentChildView; AndroidUtilities.cancelRunOnUIThread(selectChildRunnable); selectChildRunnable = null; currentChildView = null; interceptedByChild = false; - removeSelection(pressedChild, e); + removeSelection(cv, e); } } - return true; } @Override @@ -865,21 +1014,6 @@ public class RecyclerListView extends RecyclerView { public boolean onDown(MotionEvent e) { return false; } - - @Override - public void onShowPress(MotionEvent e) { - - } - - @Override - public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { - return false; - } - - @Override - public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { - return false; - } }); gestureDetector.setIsLongpressEnabled(false); } @@ -1877,9 +2011,13 @@ public class RecyclerListView extends RecyclerView { ViewHolder holder = findContainingViewHolder(child); if (holder != null) { child.setEnabled(((SelectionAdapter) getAdapter()).isEnabled(holder)); + if (accessibilityEnabled) { + child.setAccessibilityDelegate(accessibilityDelegate); + } } } else { child.setEnabled(false); + child.setAccessibilityDelegate(null); } super.onChildAttachedToWindow(child); } @@ -2171,11 +2309,12 @@ public class RecyclerListView extends RecyclerView { y = event.getY(); onFocus = true; parent.requestDisallowInterceptTouchEvent(true); - } if (event.getAction() == MotionEvent.ACTION_MOVE) { + } + if (event.getAction() == MotionEvent.ACTION_MOVE) { float dx = (x - event.getX()); float dy = (y - event.getY()); float touchSlop = ViewConfiguration.get(v.getContext()).getScaledTouchSlop(); - if (onFocus && Math.sqrt(dx * dx + dy * dy) >touchSlop) { + if (onFocus && Math.sqrt(dx * dx + dy * dy) > touchSlop) { onFocus = false; parent.requestDisallowInterceptTouchEvent(false); } @@ -2215,7 +2354,7 @@ public class RecyclerListView extends RecyclerView { if (fastScroll != null && fastScroll.pressed) { return false; } - if (multiSelectionGesture && e.getAction() != MotionEvent.ACTION_DOWN &&e.getAction() != MotionEvent.ACTION_UP && e.getAction() != MotionEvent.ACTION_CANCEL) { + if (multiSelectionGesture && e.getAction() != MotionEvent.ACTION_DOWN && e.getAction() != MotionEvent.ACTION_UP && e.getAction() != MotionEvent.ACTION_CANCEL) { if (lastX == Float.MAX_VALUE && lastY == Float.MAX_VALUE) { lastX = e.getX(); lastY = e.getY(); @@ -2385,4 +2524,8 @@ public class RecyclerListView extends RecyclerView { public void setItemsEnterAnimator(RecyclerItemsEnterAnimator itemsEnterAnimator) { this.itemsEnterAnimator = itemsEnterAnimator; } -} + + public void setAccessibilityEnabled(boolean accessibilityEnabled) { + this.accessibilityEnabled = accessibilityEnabled; + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/SeekBarWaveform.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/SeekBarWaveform.java index 93ed4a8ca..fc3069e93 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/SeekBarWaveform.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/SeekBarWaveform.java @@ -54,7 +54,6 @@ public class SeekBarWaveform { paintOuter.setStrokeWidth(AndroidUtilities.dpf2(2)); paintInner.setStrokeCap(Paint.Cap.ROUND); paintOuter.setStrokeCap(Paint.Cap.ROUND); - } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/SimpleThemeDescription.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/SimpleThemeDescription.java new file mode 100644 index 000000000..fe675b154 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/SimpleThemeDescription.java @@ -0,0 +1,17 @@ +package org.telegram.ui.Components; + +import org.telegram.ui.ActionBar.ThemeDescription; + +import java.util.ArrayList; + +public class SimpleThemeDescription { + private SimpleThemeDescription() {} + + public static ArrayList createThemeDescriptions(ThemeDescription.ThemeDescriptionDelegate del, String... keys) { + ArrayList l = new ArrayList<>(keys.length); + for (String k : keys) { + l.add(new ThemeDescription(null, 0, null, null, null, del, k)); + } + return l; + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/SizeNotifierFrameLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/SizeNotifierFrameLayout.java index e9cc08861..48b1a6ff1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/SizeNotifierFrameLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/SizeNotifierFrameLayout.java @@ -18,15 +18,10 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.view.View; -import android.view.WindowInsets; import android.widget.FrameLayout; -import androidx.core.view.ViewCompat; -import androidx.core.view.WindowInsetsCompat; - -import com.google.android.exoplayer2.util.Log; - import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.SharedConfig; import org.telegram.ui.ActionBar.ActionBar; import org.telegram.ui.ActionBar.ActionBarLayout; import org.telegram.ui.ActionBar.AdjustPanLayoutHelper; @@ -54,6 +49,7 @@ public class SizeNotifierFrameLayout extends FrameLayout { private float emojiOffset; private boolean animationInProgress; private boolean skipBackgroundDrawing; + SnowflakesEffect snowflakesEffect; public interface SizeNotifierFrameLayoutDelegate { void onSizeChanged(int keyboardHeight, boolean isWidthGreater); @@ -263,6 +259,7 @@ public class SizeNotifierFrameLayout extends FrameLayout { canvas.clipRect(0, actionBarHeight, width, getMeasuredHeight() - bottomClip); drawable.setBounds(x, y, x + width, y + height); drawable.draw(canvas); + checkSnowflake(canvas); canvas.restore(); } else { if (bottomClip != 0) { @@ -289,6 +286,7 @@ public class SizeNotifierFrameLayout extends FrameLayout { } drawable.setBounds(0, 0, getMeasuredWidth(), getRootView().getMeasuredHeight()); drawable.draw(canvas); + checkSnowflake(canvas); if (bottomClip != 0) { canvas.restore(); } @@ -299,6 +297,7 @@ public class SizeNotifierFrameLayout extends FrameLayout { } drawable.setBounds(0, backgroundTranslationY, getMeasuredWidth(), backgroundTranslationY + getRootView().getMeasuredHeight()); drawable.draw(canvas); + checkSnowflake(canvas); if (bottomClip != 0) { canvas.restore(); } @@ -310,6 +309,7 @@ public class SizeNotifierFrameLayout extends FrameLayout { canvas.scale(scale, scale); drawable.setBounds(0, 0, (int) Math.ceil(getMeasuredWidth() / scale), (int) Math.ceil(getRootView().getMeasuredHeight() / scale)); drawable.draw(canvas); + checkSnowflake(canvas); canvas.restore(); } else { int actionBarHeight = (isActionBarVisible() ? ActionBar.getCurrentActionBarHeight() : 0) + (Build.VERSION.SDK_INT >= 21 && occupyStatusBar ? AndroidUtilities.statusBarHeight : 0); @@ -325,6 +325,7 @@ public class SizeNotifierFrameLayout extends FrameLayout { canvas.clipRect(0, actionBarHeight, width, getMeasuredHeight() - bottomClip); drawable.setBounds(x, y, x + width, y + height); drawable.draw(canvas); + checkSnowflake(canvas); canvas.restore(); } } @@ -335,6 +336,15 @@ public class SizeNotifierFrameLayout extends FrameLayout { } } + private void checkSnowflake(Canvas canvas) { + if (SharedConfig.drawSnowInChat || Theme.canStartHolidayAnimation()) { + if (snowflakesEffect == null) { + snowflakesEffect = new SnowflakesEffect(1); + } + snowflakesEffect.onDraw(this, canvas); + } + } + protected boolean isActionBarVisible() { return true; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/SnowflakesEffect.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/SnowflakesEffect.java index aa5ea5597..0885a446c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/SnowflakesEffect.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/SnowflakesEffect.java @@ -8,6 +8,7 @@ package org.telegram.ui.Components; +import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.os.Build; @@ -23,7 +24,11 @@ public class SnowflakesEffect { private Paint particlePaint; private Paint particleThinPaint; + private Paint bitmapPaint = new Paint(); private String colorKey = Theme.key_actionBarDefaultTitle; + private int viewType; + + Bitmap particleBitmap; private long lastAnimationTime; @@ -50,31 +55,41 @@ public class SnowflakesEffect { } case 1: default: { - particleThinPaint.setAlpha((int) (255 * alpha)); - float angle = (float) -Math.PI / 2; - float px = AndroidUtilities.dpf2(2.0f) * 2 * scale; - float px1 = -AndroidUtilities.dpf2(0.57f) * 2 * scale; - float py1 = AndroidUtilities.dpf2(1.55f) * 2 * scale; - for (int a = 0; a < 6; a++) { - float x1 = (float) Math.cos(angle) * px; - float y1 = (float) Math.sin(angle) * px; - float cx = x1 * 0.66f; - float cy = y1 * 0.66f; - canvas.drawLine(x, y, x + x1, y + y1, particleThinPaint); + if (particleBitmap == null) { + particleThinPaint.setAlpha(255); + particleBitmap = Bitmap.createBitmap(AndroidUtilities.dp(16), AndroidUtilities.dp(16), Bitmap.Config.ARGB_8888); + Canvas bitmapCanvas = new Canvas(particleBitmap); + float px = AndroidUtilities.dpf2(2.0f) * 2; + float px1 = -AndroidUtilities.dpf2(0.57f) * 2; + float py1 = AndroidUtilities.dpf2(1.55f) * 2; + for (int a = 0; a < 6; a++) { + float x = AndroidUtilities.dp(8); + float y = AndroidUtilities.dp(8); + float x1 = (float) Math.cos(angle) * px; + float y1 = (float) Math.sin(angle) * px; + float cx = x1 * 0.66f; + float cy = y1 * 0.66f; + bitmapCanvas.drawLine(x, y, x + x1, y + y1, particleThinPaint); - float angle2 = (float) (angle - Math.PI / 2); - x1 = (float) (Math.cos(angle2) * px1 - Math.sin(angle2) * py1); - y1 = (float) (Math.sin(angle2) * px1 + Math.cos(angle2) * py1); - canvas.drawLine(x + cx, y + cy, x + x1, y + y1, particleThinPaint); + float angle2 = (float) (angle - Math.PI / 2); + x1 = (float) (Math.cos(angle2) * px1 - Math.sin(angle2) * py1); + y1 = (float) (Math.sin(angle2) * px1 + Math.cos(angle2) * py1); + bitmapCanvas.drawLine(x + cx, y + cy, x + x1, y + y1, particleThinPaint); - x1 = (float) (-Math.cos(angle2) * px1 - Math.sin(angle2) * py1); - y1 = (float) (-Math.sin(angle2) * px1 + Math.cos(angle2) * py1); - canvas.drawLine(x + cx, y + cy, x + x1, y + y1, particleThinPaint); + x1 = (float) (-Math.cos(angle2) * px1 - Math.sin(angle2) * py1); + y1 = (float) (-Math.sin(angle2) * px1 + Math.cos(angle2) * py1); + bitmapCanvas.drawLine(x + cx, y + cy, x + x1, y + y1, particleThinPaint); - angle += angleDiff; + angle += angleDiff; + } } + bitmapPaint.setAlpha((int) (255 * alpha)); + canvas.save(); + canvas.scale(scale, scale, x, y); + canvas.drawBitmap(particleBitmap, x, y, bitmapPaint); + canvas.restore(); break; } } @@ -87,7 +102,8 @@ public class SnowflakesEffect { private int color; - public SnowflakesEffect() { + public SnowflakesEffect(int viewType) { + this.viewType = viewType; particlePaint = new Paint(Paint.ANTI_ALIAS_FLAG); particlePaint.setStrokeWidth(AndroidUtilities.dp(1.5f)); particlePaint.setStrokeCap(Paint.Cap.ROUND); @@ -132,10 +148,18 @@ public class SnowflakesEffect { count--; continue; } - if (particle.currentTime < 200.0f) { - particle.alpha = AndroidUtilities.accelerateInterpolator.getInterpolation(particle.currentTime / 200.0f); + if (viewType == 0) { + if (particle.currentTime < 200.0f) { + particle.alpha = AndroidUtilities.accelerateInterpolator.getInterpolation(particle.currentTime / 200.0f); + } else { + particle.alpha = 1.0f - AndroidUtilities.decelerateInterpolator.getInterpolation((particle.currentTime - 200.0f) / (particle.lifeTime - 200.0f)); + } } else { - particle.alpha = 1.0f - AndroidUtilities.decelerateInterpolator.getInterpolation((particle.currentTime - 200.0f) / (particle.lifeTime - 200.0f)); + if (particle.currentTime < 200.0f) { + particle.alpha = AndroidUtilities.accelerateInterpolator.getInterpolation(particle.currentTime / 200.0f); + } else if (particle.lifeTime - particle.currentTime < 2000) { + particle.alpha = AndroidUtilities.decelerateInterpolator.getInterpolation((particle.lifeTime - particle.currentTime) / 2000); + } } particle.x += particle.vx * particle.velocity * dt / 500.0f; particle.y += particle.vy * particle.velocity * dt / 500.0f; @@ -153,38 +177,47 @@ public class SnowflakesEffect { Particle particle = particles.get(a); particle.draw(canvas); } + int maxCount = viewType == 0 ? 100 : 300; + int createPerFrame = viewType == 0 ? 1 : 10; + if (particles.size() < maxCount) { + for (int i = 0; i < createPerFrame; i++) { + if (particles.size() < maxCount && Utilities.random.nextFloat() > 0.7f) { + int statusBarHeight = (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0); + float cx = Utilities.random.nextFloat() * parent.getMeasuredWidth(); + float cy = statusBarHeight + Utilities.random.nextFloat() * (parent.getMeasuredHeight() - AndroidUtilities.dp(20) - statusBarHeight); - if (Utilities.random.nextFloat() > 0.7f && particles.size() < 100) { - int statusBarHeight = (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0); - float cx = Utilities.random.nextFloat() * parent.getMeasuredWidth(); - float cy = statusBarHeight + Utilities.random.nextFloat() * (parent.getMeasuredHeight() - AndroidUtilities.dp(20) - statusBarHeight); + int angle = Utilities.random.nextInt(40) - 20 + 90; + float vx = (float) Math.cos(Math.PI / 180.0 * angle); + float vy = (float) Math.sin(Math.PI / 180.0 * angle); - int angle = Utilities.random.nextInt(40) - 20 + 90; - float vx = (float) Math.cos(Math.PI / 180.0 * angle); - float vy = (float) Math.sin(Math.PI / 180.0 * angle); + Particle newParticle; + if (!freeParticles.isEmpty()) { + newParticle = freeParticles.get(0); + freeParticles.remove(0); + } else { + newParticle = new Particle(); + } + newParticle.x = cx; + newParticle.y = cy; - Particle newParticle; - if (!freeParticles.isEmpty()) { - newParticle = freeParticles.get(0); - freeParticles.remove(0); - } else { - newParticle = new Particle(); + newParticle.vx = vx; + newParticle.vy = vy; + + newParticle.alpha = 0.0f; + newParticle.currentTime = 0; + + newParticle.scale = Utilities.random.nextFloat() * 1.2f; + newParticle.type = Utilities.random.nextInt(2); + + if (viewType == 0) { + newParticle.lifeTime = 2000 + Utilities.random.nextInt(100); + } else { + newParticle.lifeTime = 3000 + Utilities.random.nextInt(2000); + } + newParticle.velocity = 20.0f + Utilities.random.nextFloat() * 4.0f; + particles.add(newParticle); + } } - newParticle.x = cx; - newParticle.y = cy; - - newParticle.vx = vx; - newParticle.vy = vy; - - newParticle.alpha = 0.0f; - newParticle.currentTime = 0; - - newParticle.scale = Utilities.random.nextFloat() * 1.2f; - newParticle.type = Utilities.random.nextInt(2); - - newParticle.lifeTime = 2000 + Utilities.random.nextInt(100); - newParticle.velocity = 20.0f + Utilities.random.nextFloat() * 4.0f; - particles.add(newParticle); } long newTime = System.currentTimeMillis(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/StaticLayoutEx.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/StaticLayoutEx.java index bb0a5e8f4..544851294 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/StaticLayoutEx.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/StaticLayoutEx.java @@ -172,7 +172,6 @@ public class StaticLayoutEx { .setAlignment(align) .setLineSpacing(spacingAdd, spacingMult) .setIncludePad(includePad) - .setEllipsize(TextUtils.TruncateAt.END) .setEllipsizedWidth(ellipsisWidth) .setMaxLines(maxLines) .setBreakStrategy(canContainUrl ? StaticLayout.BREAK_STRATEGY_HIGH_QUALITY : StaticLayout.BREAK_STRATEGY_SIMPLE) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/TextStyleSpan.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/TextStyleSpan.java index aeee06202..748f98181 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/TextStyleSpan.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/TextStyleSpan.java @@ -15,6 +15,7 @@ import android.text.style.MetricAffectingSpan; import org.telegram.messenger.AndroidUtilities; import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.Theme; public class TextStyleSpan extends MetricAffectingSpan { @@ -67,6 +68,10 @@ public class TextStyleSpan extends MetricAffectingSpan { } else { p.setFlags(p.getFlags() &~ Paint.STRIKE_THRU_TEXT_FLAG); } + + if ((flags & FLAG_STYLE_SPOILER_REVEALED) != 0) { + p.bgColor = Theme.getColor(Theme.key_chats_archivePullDownBackground); + } } public Typeface getTypeface() { @@ -92,6 +97,8 @@ public class TextStyleSpan extends MetricAffectingSpan { public final static int FLAG_STYLE_QUOTE = 32; public final static int FLAG_STYLE_MENTION = 64; public final static int FLAG_STYLE_URL = 128; + public final static int FLAG_STYLE_SPOILER = 256; + public final static int FLAG_STYLE_SPOILER_REVEALED = 512; public TextStyleSpan(TextStyleRun run) { this(run, 0, 0); @@ -125,6 +132,16 @@ public class TextStyleSpan extends MetricAffectingSpan { color = value; } + public boolean isSpoiler() { + return (style.flags & FLAG_STYLE_SPOILER) > 0; + } + + public void setSpoilerRevealed(boolean b) { + if (b) + style.flags |= FLAG_STYLE_SPOILER_REVEALED; + else style.flags &= ~FLAG_STYLE_SPOILER_REVEALED; + } + public boolean isMono() { return style.getTypeface() == Typeface.MONOSPACE; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ThemeSmallPreviewView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ThemeSmallPreviewView.java index 7c29d026f..70e7d9c52 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ThemeSmallPreviewView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ThemeSmallPreviewView.java @@ -5,7 +5,6 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Bitmap; -import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.LinearGradient; @@ -29,7 +28,6 @@ import org.telegram.messenger.ChatThemeController; import org.telegram.messenger.DocumentObject; import org.telegram.messenger.Emoji; import org.telegram.messenger.FileLoader; -import org.telegram.messenger.FileLog; import org.telegram.messenger.ImageLoader; import org.telegram.messenger.ImageLocation; import org.telegram.messenger.ImageReceiver; @@ -42,13 +40,13 @@ import org.telegram.tgnet.TLRPC; import org.telegram.ui.ActionBar.EmojiThemes; import org.telegram.ui.ActionBar.Theme; -import java.io.FileInputStream; import java.util.List; public class ThemeSmallPreviewView extends FrameLayout implements NotificationCenter.NotificationCenterDelegate { public final static int TYPE_DEFAULT = 0; public final static int TYPE_GRID = 1; + public final static int TYPE_QR = 2; private final float STROKE_RADIUS = AndroidUtilities.dp(8); private final float INNER_RADIUS = AndroidUtilities.dp(6); @@ -89,7 +87,7 @@ public class ThemeSmallPreviewView extends FrameLayout implements NotificationCe backupImageView.getImageReceiver().setCrossfadeWithOldImage(true); backupImageView.getImageReceiver().setAllowStartLottieAnimation(false); backupImageView.getImageReceiver().setAutoRepeat(0); - if (currentType == TYPE_DEFAULT) { + if (currentType == TYPE_DEFAULT || currentType == TYPE_QR) { addView(backupImageView, LayoutHelper.createFrame(28, 28, Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 0, 0, 0, 12)); } else { addView(backupImageView, LayoutHelper.createFrame(36, 36, Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 0, 0, 0, 12)); @@ -107,8 +105,11 @@ public class ThemeSmallPreviewView extends FrameLayout implements NotificationCe int height = (int) (width * 1.2f); super.onMeasure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)); } else { - int height = MeasureSpec.getSize(heightMeasureSpec); int width = AndroidUtilities.dp(77); + int height = MeasureSpec.getSize(heightMeasureSpec); + if (height == 0) { + height = (int) (width * 1.35f); + } super.onMeasure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)); } @@ -433,7 +434,7 @@ public class ThemeSmallPreviewView extends FrameLayout implements NotificationCe } else if (color1 != 0) { drawable = new ColorDrawable(color1); } else if (item.themeInfo != null && (item.themeInfo.previewWallpaperOffset > 0 || item.themeInfo.pathToWallpaper != null)) { - Bitmap wallpaper = getScaledBitmap(AndroidUtilities.dp(76), AndroidUtilities.dp(97), item.themeInfo.pathToWallpaper, item.themeInfo.pathToFile, item.themeInfo.previewWallpaperOffset); + Bitmap wallpaper = AndroidUtilities.getScaledBitmap(AndroidUtilities.dp(76), AndroidUtilities.dp(97), item.themeInfo.pathToWallpaper, item.themeInfo.pathToFile, item.themeInfo.previewWallpaperOffset); if (wallpaper != null) { drawable = new BitmapDrawable(wallpaper); } @@ -494,56 +495,6 @@ public class ThemeSmallPreviewView extends FrameLayout implements NotificationCe } } - public static Bitmap getScaledBitmap(float w, float h, String path, String streamPath, int streamOffset) { - FileInputStream stream = null; - try { - BitmapFactory.Options options = new BitmapFactory.Options(); - options.inJustDecodeBounds = true; - - if (path != null) { - BitmapFactory.decodeFile(path, options); - } else { - stream = new FileInputStream(streamPath); - stream.getChannel().position(streamOffset); - BitmapFactory.decodeStream(stream, null, options); - } - if (options.outWidth > 0 && options.outHeight > 0) { - if (w > h && options.outWidth < options.outHeight) { - float temp = w; - w = h; - h = temp; - } - float scale = Math.min(options.outWidth / w, options.outHeight / h); - options.inSampleSize = 1; - if (scale > 1.0f) { - do { - options.inSampleSize *= 2; - } while (options.inSampleSize < scale); - } - options.inJustDecodeBounds = false; - Bitmap wallpaper; - if (path != null) { - wallpaper = BitmapFactory.decodeFile(path, options); - } else { - stream.getChannel().position(streamOffset); - wallpaper = BitmapFactory.decodeStream(stream, null, options); - } - return wallpaper; - } - } catch (Throwable e) { - FileLog.e(e); - } finally { - try { - if (stream != null) { - stream.close(); - } - } catch (Exception e2) { - FileLog.e(e2); - } - } - return null; - } - private class ThemeDrawable { private final Paint strokePaint = new Paint(Paint.ANTI_ALIAS_FLAG); @@ -590,7 +541,7 @@ public class ThemeSmallPreviewView extends FrameLayout implements NotificationCe } public void draw(Canvas canvas, float alpha) { - if (chatThemeItem.isSelected || strokeAlphaAnimator != null) { + if (isSelected || strokeAlphaAnimator != null) { EmojiThemes.ThemeItem themeItem = chatThemeItem.chatTheme.getThemeItem(chatThemeItem.themeIndex); int strokeColor = chatThemeItem.chatTheme.showAsDefaultStub ? getThemedColor(Theme.key_featuredStickers_addButton) @@ -613,45 +564,52 @@ public class ThemeSmallPreviewView extends FrameLayout implements NotificationCe textLayout.draw(canvas); canvas.restore(); } else { - float bubbleTop = INNER_RECT_SPACE + AndroidUtilities.dp(8); - float bubbleLeft = INNER_RECT_SPACE + AndroidUtilities.dp(22); - if (currentType == TYPE_DEFAULT) { - rectF.set(bubbleLeft, bubbleTop, bubbleLeft + BUBBLE_WIDTH, bubbleTop + BUBBLE_HEIGHT); + if (currentType == TYPE_QR) { + if (chatThemeItem.icon != null) { + float left = (getWidth() - chatThemeItem.icon.getWidth()) * 0.5f; + canvas.drawBitmap(chatThemeItem.icon, left, AndroidUtilities.dp(21), null); + } } else { - bubbleTop = getMeasuredHeight() * 0.12f; - bubbleLeft = getMeasuredWidth() - getMeasuredWidth() * 0.65f; - float bubbleRight = getMeasuredWidth() - getMeasuredWidth() * 0.1f; - float bubbleBottom = getMeasuredHeight() * 0.32f; - rectF.set(bubbleLeft, bubbleTop, bubbleRight, bubbleBottom); - } + float bubbleTop = INNER_RECT_SPACE + AndroidUtilities.dp(8); + float bubbleLeft = INNER_RECT_SPACE + AndroidUtilities.dp(22); + if (currentType == TYPE_DEFAULT) { + rectF.set(bubbleLeft, bubbleTop, bubbleLeft + BUBBLE_WIDTH, bubbleTop + BUBBLE_HEIGHT); + } else { + bubbleTop = getMeasuredHeight() * 0.12f; + bubbleLeft = getMeasuredWidth() - getMeasuredWidth() * 0.65f; + float bubbleRight = getMeasuredWidth() - getMeasuredWidth() * 0.1f; + float bubbleBottom = getMeasuredHeight() * 0.32f; + rectF.set(bubbleLeft, bubbleTop, bubbleRight, bubbleBottom); + } - Paint paint = outBubblePaintSecond; - if (currentType == TYPE_DEFAULT) { - canvas.drawRoundRect(rectF, rectF.height() * 0.5f, rectF.height() * 0.5f, paint); - } else { - messageDrawableOut.setBounds((int) rectF.left, (int) rectF.top - AndroidUtilities.dp(2), (int) rectF.right + AndroidUtilities.dp(4), (int) rectF.bottom + AndroidUtilities.dp(2)); - messageDrawableOut.setRoundRadius((int) (rectF.height() * 0.5f)); - messageDrawableOut.draw(canvas, paint); - } + Paint paint = outBubblePaintSecond; + if (currentType == TYPE_DEFAULT) { + canvas.drawRoundRect(rectF, rectF.height() * 0.5f, rectF.height() * 0.5f, paint); + } else { + messageDrawableOut.setBounds((int) rectF.left, (int) rectF.top - AndroidUtilities.dp(2), (int) rectF.right + AndroidUtilities.dp(4), (int) rectF.bottom + AndroidUtilities.dp(2)); + messageDrawableOut.setRoundRadius((int) (rectF.height() * 0.5f)); + messageDrawableOut.draw(canvas, paint); + } - if (currentType == TYPE_DEFAULT) { - bubbleLeft = INNER_RECT_SPACE + AndroidUtilities.dp(5); - bubbleTop += BUBBLE_HEIGHT + AndroidUtilities.dp(4); - rectF.set(bubbleLeft, bubbleTop, bubbleLeft + BUBBLE_WIDTH, bubbleTop + BUBBLE_HEIGHT); - } else { - bubbleTop = getMeasuredHeight() * 0.35f; - bubbleLeft = getMeasuredWidth() * 0.1f; - float bubbleRight = getMeasuredWidth() * 0.65f; - float bubbleBottom = getMeasuredHeight() * 0.55f; - rectF.set(bubbleLeft, bubbleTop, bubbleRight, bubbleBottom); - } + if (currentType == TYPE_DEFAULT) { + bubbleLeft = INNER_RECT_SPACE + AndroidUtilities.dp(5); + bubbleTop += BUBBLE_HEIGHT + AndroidUtilities.dp(4); + rectF.set(bubbleLeft, bubbleTop, bubbleLeft + BUBBLE_WIDTH, bubbleTop + BUBBLE_HEIGHT); + } else { + bubbleTop = getMeasuredHeight() * 0.35f; + bubbleLeft = getMeasuredWidth() * 0.1f; + float bubbleRight = getMeasuredWidth() * 0.65f; + float bubbleBottom = getMeasuredHeight() * 0.55f; + rectF.set(bubbleLeft, bubbleTop, bubbleRight, bubbleBottom); + } - if (currentType == TYPE_DEFAULT) { - canvas.drawRoundRect(rectF, rectF.height() * 0.5f, rectF.height() * 0.5f, inBubblePaint); - } else { - messageDrawableIn.setBounds((int) rectF.left - AndroidUtilities.dp(4), (int) rectF.top - AndroidUtilities.dp(2), (int) rectF.right, (int) rectF.bottom + AndroidUtilities.dp(2)); - messageDrawableIn.setRoundRadius((int) (rectF.height() * 0.5f)); - messageDrawableIn.draw(canvas, inBubblePaint); + if (currentType == TYPE_DEFAULT) { + canvas.drawRoundRect(rectF, rectF.height() * 0.5f, rectF.height() * 0.5f, inBubblePaint); + } else { + messageDrawableIn.setBounds((int) rectF.left - AndroidUtilities.dp(4), (int) rectF.top - AndroidUtilities.dp(2), (int) rectF.right, (int) rectF.bottom + AndroidUtilities.dp(2)); + messageDrawableIn.setRoundRadius((int) (rectF.height() * 0.5f)); + messageDrawableIn.draw(canvas, inBubblePaint); + } } } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/TranslateAlert.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/TranslateAlert.java new file mode 100644 index 000000000..0ecb5c733 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/TranslateAlert.java @@ -0,0 +1,1588 @@ +package org.telegram.ui.Components; + +import static org.telegram.messenger.AndroidUtilities.dp; +import static org.telegram.messenger.AndroidUtilities.lerp; + +import android.animation.Animator; +import android.animation.ValueAnimator; +import android.app.Dialog; +import android.content.Context; +import android.content.res.Resources; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Insets; +import android.graphics.LinearGradient; +import android.graphics.Paint; +import android.graphics.Path; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; +import android.graphics.RectF; +import android.graphics.Rect; +import android.graphics.Region; +import android.graphics.Shader; +import android.graphics.drawable.ColorDrawable; +import android.graphics.drawable.Drawable; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.SystemClock; +import android.text.Layout; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.StaticLayout; +import android.text.TextPaint; +import android.text.TextUtils; +import android.text.method.LinkMovementMethod; +import android.text.style.CharacterStyle; +import android.text.style.ClickableSpan; +import android.text.style.ForegroundColorSpan; +import android.text.style.URLSpan; +import android.text.util.Linkify; +import android.util.Log; +import android.util.TypedValue; +import android.view.ActionMode; +import android.view.Gravity; +import android.view.Menu; +import android.view.MenuItem; +import android.view.MotionEvent; +import android.view.VelocityTracker; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowInsets; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.core.graphics.ColorUtils; +import androidx.core.widget.NestedScrollView; + +import com.google.android.gms.vision.Frame; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.json.JSONTokener; +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.Emoji; +import org.telegram.messenger.FileLog; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MessageObject; +import org.telegram.messenger.R; +import org.telegram.messenger.browser.Browser; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.BackDrawable; +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BottomSheet; +import org.telegram.ui.ActionBar.Theme; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.Reader; +import java.lang.reflect.Field; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URL; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; + +public class TranslateAlert extends Dialog { + private FrameLayout statusBar; + private FrameLayout contentView; + private FrameLayout container; + private TextView titleView; + private LinearLayout subtitleView; + private LoadingTextView subtitleFromView; + private ImageView subtitleArrowView; + private TextView subtitleToView; + private ImageView backButton; + private FrameLayout header; + private FrameLayout headerShadowView; + private boolean scrollViewScrollable = false; + private NestedScrollView scrollView; + private LinearLayout textsView; + private TextView translateMoreView; + private TextView buttonTextView; + private FrameLayout buttonView; + private FrameLayout buttonShadowView; + private TextView allTextsView; + private FrameLayout textsContainerView; + private FrameLayout allTextsContainer; + + private FrameLayout.LayoutParams titleLayout; + private FrameLayout.LayoutParams subtitleLayout; + private FrameLayout.LayoutParams backLayout; + private FrameLayout.LayoutParams headerLayout; + private FrameLayout.LayoutParams scrollViewLayout; + + private int blockIndex = 0; + private ArrayList textBlocks; + + private float containerOpenAnimationT = 0f; + private float openAnimationT = 0f; + private void openAnimation(float t) { + t = Math.min(Math.max(t, 0), 1); + containerOpenAnimationT = t; + container.forceLayout(); + + titleView.setScaleX(lerp(1f, 0.9473f, t)); + titleView.setScaleY(lerp(1f, 0.9473f, t)); + titleLayout.topMargin = dp(lerp(22, 8, t)); + titleLayout.leftMargin = dp(lerp(22, 72, t)); + titleView.setLayoutParams(titleLayout); +// +// statusBar.setAlpha(Math.max(0, (t - .8f) / .2f)); +// statusBar.setTranslationY(Math.max(0, (1f - (t - .9f) / .1f) * dp(48))); +// statusBar.setScaleY(Math.max(0, (t - .8f) / .2f)); + + subtitleLayout.topMargin = dp(lerp(47, 30, t)) - LoadingTextView.padVert; + subtitleLayout.leftMargin = dp(lerp(22, 72, t)) - LoadingTextView.padHorz; + subtitleView.setLayoutParams(subtitleLayout); + + backButton.setAlpha(t); + backButton.setScaleX(.75f + .25f * t); + backButton.setScaleY(.75f + .25f * t); + backButton.setClickable(t > .5f); + headerShadowView.setAlpha(scrollView.getScrollY() > 0 ? 1f : t); + + headerLayout.height = (int) lerp(dp(70), dp(56), t); + header.setLayoutParams(headerLayout); + + scrollViewLayout.topMargin = (int) lerp(dp(70), dp(56), t); + scrollView.setLayoutParams(scrollViewLayout); +// allTextsView.setTextIsSelectable(t >= 1f); +// for (int i = 0; i < textsView.getChildCount(); ++i) { +// View child = textsView.getChildAt(i); +// if (child instanceof LoadingTextView) +// ((LoadingTextView) child).setTextIsSelectable(t >= 1f); +// } + } + private boolean openAnimationToAnimatorPriority = false; + private ValueAnimator openAnimationToAnimator = null; + private void openAnimationTo(float to, boolean priority) { + if (openAnimationToAnimatorPriority && !priority) + return; + openAnimationToAnimatorPriority = priority; + to = Math.min(Math.max(to, 0), 1); + if (openAnimationToAnimator != null) + openAnimationToAnimator.cancel(); + openAnimationToAnimator = ValueAnimator.ofFloat(containerOpenAnimationT, to); + openAnimationToAnimator.addUpdateListener(a -> openAnimation((float) a.getAnimatedValue())); + openAnimationToAnimator.addListener(new Animator.AnimatorListener() { + @Override public void onAnimationStart(Animator animator) { } + @Override public void onAnimationRepeat(Animator animator) { } + + @Override + public void onAnimationEnd(Animator animator) { + openAnimationToAnimatorPriority = false; + } + + @Override + public void onAnimationCancel(Animator animator) { + openAnimationToAnimatorPriority = false; + } + }); + openAnimationToAnimator.setInterpolator(CubicBezierInterpolator.EASE_OUT); + openAnimationToAnimator.setDuration(220); + openAnimationToAnimator.start(); + if (to >= .5 && blockIndex <= 1) + fetchNext(); + } + + private int textsViewMinHeight = 0; + private int minHeight() { + return (textsView == null ? 0 : textsView.getMeasuredHeight()) + dp( + 66 + // header + 1 + // button separator + 16 + // button top padding + 48 + // button + 16 // button bottom padding + ); + } + private boolean canExpand() { + return ( + textsView.getChildCount() < textBlocks.size() || + minHeight() >= Math.min(dp(550), AndroidUtilities.displayMetrics.heightPixels / 2) //|| +// (scrollView.canScrollVertically(1) || scrollView.canScrollVertically(-1)) + ); + } + private void updateCanExpand() { + boolean canExpand = canExpand(); + if (containerOpenAnimationT > 0f && !canExpand) + openAnimationTo(0f, false); + + buttonShadowView.animate().alpha(canExpand ? 1f : 0f).setDuration((long) (Math.abs(buttonShadowView.getAlpha() - (canExpand ? 1f : 0f)) * 220)).start(); + } + + private int scrollShouldBe = -1; + private boolean allowScroll = true; + private ValueAnimator scrollerToBottom = null; + private String fromLanguage, toLanguage; + private CharSequence text; + private BaseFragment fragment; + private boolean noforwards; + public TranslateAlert(BaseFragment fragment, Context context, String fromLanguage, String toLanguage, CharSequence text, boolean noforwards) { + super(context, R.style.TransparentDialog); + + this.noforwards = noforwards; + this.fragment = fragment; + this.fromLanguage = fromLanguage != null && fromLanguage.equals("und") ? "auto" : fromLanguage; + this.toLanguage = toLanguage; + this.text = text; + this.textBlocks = cutInBlocks(text, 1024); + + if (Build.VERSION.SDK_INT >= 30) { + getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + } else if (Build.VERSION.SDK_INT >= 21) { + getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + } + + contentView = new FrameLayout(context); + contentView.setBackground(backDrawable); + contentView.setClipChildren(false); + contentView.setClipToPadding(false); + if (Build.VERSION.SDK_INT >= 21) { + contentView.setFitsSystemWindows(true); + if (Build.VERSION.SDK_INT >= 30) { + contentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); + } else { + contentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + } + } + +// statusBar = new FrameLayout(context) { +// @Override +// protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { +// int fullWidth = MeasureSpec.getSize(widthMeasureSpec); +// super.onMeasure( +// MeasureSpec.makeMeasureSpec( +// (int) Math.max(fullWidth * 0.8f, Math.min(dp(480), fullWidth)), +// MeasureSpec.getMode(widthMeasureSpec) +// ), +// heightMeasureSpec +// ); +// } +// }; +// statusBar.setBackgroundColor(Theme.getColor(Theme.key_chat_attachEmptyImage)); +// statusBar.setPivotY(AndroidUtilities.statusBarHeight); +// contentView.addView(statusBar, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, AndroidUtilities.statusBarHeight / AndroidUtilities.density, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, -AndroidUtilities.statusBarHeight / AndroidUtilities.density, 0, 0)); + + Paint containerPaint = new Paint(); + containerPaint.setColor(Theme.getColor(Theme.key_dialogBackground)); + containerPaint.setShadowLayer(dp(2), 0, dp(-0.66f), 0x1e000000); + container = new FrameLayout(context) { + private int contentHeight = Integer.MAX_VALUE; + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + int fullWidth = MeasureSpec.getSize(widthMeasureSpec); + int fullHeight = MeasureSpec.getSize(widthMeasureSpec); + boolean isPortrait = fullHeight > fullWidth; + int minHeight = (int) Math.min(dp(550), AndroidUtilities.displayMetrics.heightPixels * (isPortrait ? .5f : .85f)); + int fromHeight = Math.min(minHeight, minHeight()); + int height = (int) (fromHeight + (AndroidUtilities.displayMetrics.heightPixels - fromHeight) * containerOpenAnimationT); + updateCanExpand(); + super.onMeasure( + MeasureSpec.makeMeasureSpec( + (int) Math.max(fullWidth * 0.8f, Math.min(dp(480), fullWidth)), + MeasureSpec.getMode(widthMeasureSpec) + ), + MeasureSpec.makeMeasureSpec( + height, + MeasureSpec.EXACTLY + ) + ); + } + + @Override + protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + super.onLayout(changed, left, top, right, bottom); + contentHeight = Math.min(contentHeight, bottom - top); + } + + private Path containerPath = new Path(); + private RectF containerRect = new RectF(); + private RectF rectF = new RectF(); + @Override + protected void onDraw(Canvas canvas) { + int w = getWidth(), h = getHeight(), r = dp(12 * (1f - containerOpenAnimationT)); + canvas.clipRect(0, 0, w, h); + + containerRect.set(0, 0, w, h + r); + canvas.translate(0, (1f - openingT) * h); + +// containerPath.reset(); +// containerPath.moveTo(0, h); +// rectF.set(0, 0, r + r, r + r); +// containerPath.arcTo(rectF, 180, 90); +// rectF.set(w - r - r, 0, w, r + r); +// containerPath.arcTo(rectF, 270, 90); +// containerPath.lineTo(w, h); +// containerPath.close(); +// canvas.drawPath(containerPath, containerPaint); + + canvas.drawRoundRect(containerRect, r, r, containerPaint); + super.onDraw(canvas); + } + }; + container.setWillNotDraw(false); + + header = new FrameLayout(context); + + titleView = new TextView(context); + titleView.setPivotX(LocaleController.isRTL ? titleView.getWidth() : 0); + titleView.setPivotY(0); + titleView.setLines(1); + titleView.setText(LocaleController.getString("AutomaticTranslation", R.string.AutomaticTranslation)); + titleView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT); + titleView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + titleView.setTextColor(Theme.getColor(Theme.key_dialogTextBlack)); + titleView.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp(19)); + header.addView(titleView, titleLayout = LayoutHelper.createFrame( + LayoutHelper.MATCH_PARENT, + LayoutHelper.WRAP_CONTENT, + Gravity.FILL_HORIZONTAL | Gravity.TOP, + 22, 22,22, 0 + )); + titleView.post(() -> { + titleView.setPivotX(LocaleController.isRTL ? titleView.getWidth() : 0); + }); + +// String from = languageName(fromLanguage); +// String to = languageName(toLanguage); +// String subtitleText = LocaleController.formatString("FromLanguageToLanguage", R.string.FromLanguageToLanguage, (from != null ? from : ""), (to != null ? to : "")); + subtitleView = new LinearLayout(context); + subtitleView.setOrientation(LinearLayout.HORIZONTAL); + if (Build.VERSION.SDK_INT >= 17) + subtitleView.setLayoutDirection(LocaleController.isRTL ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR); + subtitleView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT); + subtitleView.setPadding(0, 0, LoadingTextView.padHorz, 0); + + String fromLanguageName = languageName(fromLanguage); + subtitleFromView = new LoadingTextView(context, fromLanguageName == null ? languageName(toLanguage) : fromLanguageName, false, true); + subtitleFromView.showLoadingText(false); + subtitleFromView.setLines(1); + subtitleFromView.setTextColor(Theme.getColor(Theme.key_player_actionBarSubtitle)); + subtitleFromView.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp(14)); + if (fromLanguageName != null) + subtitleFromView.setText(fromLanguageName); + subtitleView.addView(subtitleFromView, LayoutHelper.createLinear(0, LayoutHelper.WRAP_CONTENT, Gravity.CENTER_VERTICAL)); + subtitleFromView.updateHeight(); + + subtitleArrowView = new ImageView(context); + subtitleArrowView.setImageResource(R.drawable.search_arrow); + subtitleArrowView.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_player_actionBarSubtitle), PorterDuff.Mode.MULTIPLY)); + if (LocaleController.isRTL) + subtitleArrowView.setScaleX(-1f); + subtitleView.addView(subtitleArrowView, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER_VERTICAL, (int) (2 - LoadingTextView.padHorz / AndroidUtilities.density), 1, 3, 0)); + + subtitleToView = new TextView(context); + subtitleToView.setLines(1); + subtitleToView.setTextColor(Theme.getColor(Theme.key_player_actionBarSubtitle)); + subtitleToView.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp(14)); + subtitleToView.setText(languageName(toLanguage)); + subtitleView.addView(subtitleToView, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER_VERTICAL)); + + header.addView(subtitleView, subtitleLayout = LayoutHelper.createFrame( + LayoutHelper.MATCH_PARENT, + LayoutHelper.WRAP_CONTENT, + Gravity.TOP | (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT), + 22 - LoadingTextView.padHorz / AndroidUtilities.density, + 47 - LoadingTextView.padVert / AndroidUtilities.density, + 22 - LoadingTextView.padHorz / AndroidUtilities.density, + 0 + )); + + backButton = new ImageView(context); + backButton.setImageResource(R.drawable.ic_ab_back); + backButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_dialogTextBlack), PorterDuff.Mode.MULTIPLY)); + backButton.setScaleType(ImageView.ScaleType.FIT_CENTER); + backButton.setPadding(AndroidUtilities.dp(16), 0, AndroidUtilities.dp(16), 0); + backButton.setBackground(Theme.createSelectorDrawable(Theme.getColor(Theme.key_dialogButtonSelector))); + backButton.setClickable(false); + backButton.setAlpha(0f); + backButton.setOnClickListener(e -> dismiss()); + header.addView(backButton, backLayout = LayoutHelper.createFrame(56, 56, Gravity.LEFT | Gravity.CENTER_HORIZONTAL)); + + headerShadowView = new FrameLayout(context); + headerShadowView.setBackgroundColor(Theme.getColor(Theme.key_dialogShadowLine)); + headerShadowView.setAlpha(0); + header.addView(headerShadowView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 1, Gravity.BOTTOM | Gravity.FILL_HORIZONTAL)); + + header.setClipChildren(false); + container.addView(header, headerLayout = LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 70, Gravity.FILL_HORIZONTAL | Gravity.TOP)); + + scrollView = new NestedScrollView(context) { + @Override + public boolean onInterceptTouchEvent(MotionEvent ev) { + return allowScroll && containerOpenAnimationT >= 1f && canExpand() && super.onInterceptTouchEvent(ev); + } + + @Override + public void onNestedScroll(@NonNull View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) { + super.onNestedScroll(target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed); + } + }; +// scrollView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// return allowScroll && containerOpenAnimationT >= 1f; +// } +// }); + scrollView.setClipChildren(true); + + textsView = new LinearLayout(context) { + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(9999999, MeasureSpec.AT_MOST)); + } + }; + textsView.setOrientation(LinearLayout.VERTICAL); + textsView.setPadding(dp(22) - LoadingTextView.padHorz, dp(12) - LoadingTextView.padVert, dp(22) - LoadingTextView.padHorz, dp(12) - LoadingTextView.padVert); + + translateMoreView = new TextView(context); + translateMoreView.setTextColor(Theme.getColor(Theme.key_dialogTextBlue)); + translateMoreView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + translateMoreView.setText(LocaleController.getString("TranslateMore", R.string.TranslateMore)); + translateMoreView.setVisibility(textBlocks.size() > 1 ? View.INVISIBLE : View.GONE); + translateMoreView.getPaint().setAntiAlias(true); + translateMoreView.getPaint().setFlags(Paint.ANTI_ALIAS_FLAG); + translateMoreView.setBackgroundDrawable(Theme.createRadSelectorDrawable(Theme.getColor(Theme.key_dialogLinkSelection), dp(1), dp(1))); + translateMoreView.setOnClickListener(e -> { + boolean atBottom = (scrollView.getScrollY() >= scrollView.computeVerticalScrollRange() - scrollView.computeVerticalScrollExtent()); + + + openAnimationTo(1f, true); + fetchNext(); + + if (containerOpenAnimationT >= 1f && canExpand()/* && atBottom*/) { + if (scrollerToBottom != null) { + scrollerToBottom.cancel(); + scrollerToBottom = null; + } + allowScroll = false; + scrollView.stopNestedScroll(); + scrollerToBottom = ValueAnimator.ofFloat(0f, 1f); + int fromScroll = scrollView.getScrollY(); + scrollerToBottom.addUpdateListener(a -> { + scrollView.setScrollY((int) (fromScroll + dp(150) * (float) a.getAnimatedValue())); + }); + scrollerToBottom.addListener(new Animator.AnimatorListener() { + @Override public void onAnimationRepeat(Animator animator) {} + @Override public void onAnimationStart(Animator animator) {} + @Override public void onAnimationEnd(Animator animator) { + allowScroll = true; + } + @Override public void onAnimationCancel(Animator animator) { + allowScroll = true; + } + }); + scrollerToBottom.setDuration(220); + scrollerToBottom.start(); + } + }); + translateMoreView.setPadding(LoadingTextView.padHorz, LoadingTextView.padVert, LoadingTextView.padHorz, LoadingTextView.padVert); + textsView.addView(translateMoreView, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT,0, 0, 0, 0)); + + Paint selectionPaint = new Paint(); + selectionPaint.setColor(Theme.getColor(Theme.key_chat_inTextSelectionHighlight)); + allTextsContainer = new FrameLayout(context) { + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(textsContainerView.getMeasuredHeight(), MeasureSpec.AT_MOST)); + } + }; + allTextsContainer.setClipChildren(false); + allTextsContainer.setClipToPadding(false); + allTextsContainer.setPadding(dp(22), dp(12), dp(22), dp(12)); + + allTextsView = new TextView(context) { + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(999999, MeasureSpec.AT_MOST)); + } + private Paint pressedLinkPaint = null; + private Path pressedLinkPath = new Path() { + private RectF rectF = new RectF(); + @Override + public void addRect(float left, float top, float right, float bottom, @NonNull Direction dir) { +// super.addRect(left, top, right, bottom, dir); + rectF.set(left - LoadingTextView.padHorz / 2, top - LoadingTextView.padVert, right + LoadingTextView.padHorz / 2, bottom + LoadingTextView.padVert); + addRoundRect(rectF, dp(4), dp(4), Direction.CW); + } + }; + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + if (pressedLink != null) { + try { + Layout layout = getLayout(); + int start = allTexts.getSpanStart(pressedLink); + int end = allTexts.getSpanEnd(pressedLink); + layout.getSelectionPath(start, end, pressedLinkPath); + + if (pressedLinkPaint == null) { + pressedLinkPaint = new Paint(); + pressedLinkPaint.setColor(Theme.getColor(Theme.key_chat_linkSelectBackground)); + } + canvas.drawPath(pressedLinkPath, pressedLinkPaint); + } catch (Exception e) { } + } + } + }; + allTextsView.setTextColor(0x00000000); + allTextsView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + allTextsView.setTextIsSelectable(!noforwards); + allTextsView.setHighlightColor(Theme.getColor(Theme.key_chat_inTextSelectionHighlight)); + int handleColor = Theme.getColor(Theme.key_chat_TextSelectionCursor); + try { + if (Build.VERSION.SDK_INT >= 29) { + Drawable left = allTextsView.getTextSelectHandleLeft(); + left.setColorFilter(handleColor, PorterDuff.Mode.SRC_IN); + allTextsView.setTextSelectHandleLeft(left); + + Drawable right = allTextsView.getTextSelectHandleRight(); + right.setColorFilter(handleColor, PorterDuff.Mode.SRC_IN); + allTextsView.setTextSelectHandleRight(right); + } + } catch (Exception e) {} + allTextsView.setMovementMethod(new LinkMovementMethod()); + allTextsContainer.addView(allTextsView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + + textsContainerView = new FrameLayout(context); + textsContainerView.addView(allTextsContainer, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + textsContainerView.addView(textsView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + + scrollView.addView(textsContainerView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 1f)); + + container.addView(scrollView, scrollViewLayout = LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.FILL, 0, 70, 0, 81)); + + translateMoreView.bringToFront(); + fetchNext(); + + buttonShadowView = new FrameLayout(context); + buttonShadowView.setBackgroundColor(Theme.getColor(Theme.key_dialogShadowLine)); + container.addView(buttonShadowView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 1, Gravity.BOTTOM | Gravity.FILL_HORIZONTAL, 0, 0, 0, 80)); + + buttonTextView = new TextView(context); + buttonTextView.setLines(1); + buttonTextView.setSingleLine(true); + buttonTextView.setGravity(Gravity.CENTER_HORIZONTAL); + buttonTextView.setEllipsize(TextUtils.TruncateAt.END); + buttonTextView.setGravity(Gravity.CENTER); + buttonTextView.setTextColor(Theme.getColor(Theme.key_featuredStickers_buttonText)); + buttonTextView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + buttonTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); + buttonTextView.setText(LocaleController.getString("CloseTranslation", R.string.CloseTranslation)); + + buttonView = new FrameLayout(context); + buttonView.setBackground(Theme.createSimpleSelectorRoundRectDrawable(AndroidUtilities.dp(4), Theme.getColor(Theme.key_featuredStickers_addButton), Theme.getColor(Theme.key_featuredStickers_addButtonPressed))); + buttonView.addView(buttonTextView); + buttonView.setOnClickListener(e -> dismiss()); + + container.addView(buttonView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 48, Gravity.BOTTOM, 16, 16, 16, 16)); + contentView.addView(container, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL)); + +// setUseLightStatusBar(true); + } + + + private void setScrollY(float t) { + openAnimation(t); + openingT = Math.max(Math.min(1f + t, 1), 0); + backDrawable.setAlpha((int) (openingT * 51)); + container.invalidate(); + } + private void scrollYTo(float t) { + openAnimationTo(t, false); + openTo(1f + t, false); + } + private float fromScrollY = 0; + private float getScrollY() { + return Math.max(Math.min(containerOpenAnimationT - (1 - openingT), 1), 0); + } + + private boolean hasSelection() { + return allTextsView.hasSelection(); + } + + private Rect containerRect = new Rect(); + private Rect textRect = new Rect(); + private Rect translateMoreRect = new Rect(); + private Rect buttonRect = new Rect(); + private Rect backRect = new Rect(); + private Rect scrollRect = new Rect(); + private float fromY = 0; + private boolean pressedOutside = false; + private boolean maybeScrolling = false; + private boolean scrolling = false; + private boolean fromScrollRect = false; + private boolean fromTranslateMoreView = false; + private float fromScrollViewY = 0; + private Spannable allTexts; + private ClickableSpan pressedLink; + @Override + public boolean dispatchTouchEvent(@NonNull MotionEvent event) { + try { + float x = event.getX(); + float y = event.getY(); + container.invalidate(); + + container.getGlobalVisibleRect(containerRect); + if (!containerRect.contains((int) x, (int) y)) { + if (event.getAction() == MotionEvent.ACTION_DOWN) { + pressedOutside = true; + return true; + } else if (event.getAction() == MotionEvent.ACTION_UP) { + if (pressedOutside) { + pressedOutside = false; + dismiss(); + return true; + } + } + } + + allTextsContainer.getGlobalVisibleRect(textRect); + if (textRect.contains((int) x, (int) y) && !scrolling) { + Layout allTextsLayout = allTextsView.getLayout(); + int tx = (int) (x - allTextsView.getLeft() - container.getLeft()), + ty = (int) (y - allTextsView.getTop() - container.getTop() - scrollView.getTop() + scrollView.getScrollY()); + final int line = allTextsLayout.getLineForVertical(ty); + final int off = allTextsLayout.getOffsetForHorizontal(line, tx); + + final float left = allTextsLayout.getLineLeft(line); + if (allTexts != null && allTexts instanceof Spannable && left <= tx && left + allTextsLayout.getLineWidth(line) >= tx) { + ClickableSpan[] links = allTexts.getSpans(off, off, ClickableSpan.class); + if (links != null && links.length >= 1) { + if (event.getAction() == MotionEvent.ACTION_UP && pressedLink == links[0]) { + pressedLink.onClick(allTextsView); + pressedLink = null; + allTextsView.setTextIsSelectable(!noforwards); + } else if (event.getAction() == MotionEvent.ACTION_DOWN) { + pressedLink = links[0]; + } + allTextsView.invalidate(); + // return super.dispatchTouchEvent(event) || true; + return true; + } else if (pressedLink != null) { + allTextsView.invalidate(); + pressedLink = null; + } + } else if (pressedLink != null) { + allTextsView.invalidate(); + pressedLink = null; + } + } else if (pressedLink != null) { + allTextsView.invalidate(); + pressedLink = null; + } + + scrollView.getGlobalVisibleRect(scrollRect); + backButton.getGlobalVisibleRect(backRect); + buttonView.getGlobalVisibleRect(buttonRect); + translateMoreView.getGlobalVisibleRect(translateMoreRect); + fromTranslateMoreView = translateMoreRect.contains((int) x, (int) y); + if (pressedLink == null && /*!(scrollRect.contains((int) x, (int) y) && !canExpand() && containerOpenAnimationT < .5f && !scrolling) &&*/ !fromTranslateMoreView && !hasSelection()) { + if ( + !backRect.contains((int) x, (int) y) && + !buttonRect.contains((int) x, (int) y) && + event.getAction() == MotionEvent.ACTION_DOWN + ) { + fromScrollRect = scrollRect.contains((int) x, (int) y) && (containerOpenAnimationT > 0 || !canExpand()); + maybeScrolling = true; + scrolling = false; + fromY = y; + fromScrollY = getScrollY(); + fromScrollViewY = scrollView.getScrollY(); + return super.dispatchTouchEvent(event) || true; + } else if (maybeScrolling && (event.getAction() == MotionEvent.ACTION_MOVE || event.getAction() == MotionEvent.ACTION_UP)) { + float dy = fromY - y; + if (fromScrollRect) { + dy = -Math.max(0, -(fromScrollViewY + dp(48)) - dy); + if (dy < 0) { + scrolling = true; + allTextsView.setTextIsSelectable(false); + } + } else if (Math.abs(dy) > dp(4) && !fromScrollRect) { + scrolling = true; + allTextsView.setTextIsSelectable(false); + scrollView.stopNestedScroll(); + allowScroll = false; + } + float fullHeight = AndroidUtilities.displayMetrics.heightPixels, + minHeight = Math.min(fullHeight, Math.min(dp(550), fullHeight * .5f)); + float scrollYPx = minHeight * (1f - -Math.min(Math.max(fromScrollY, -1), 0)) + + (fullHeight - minHeight) * Math.min(1, Math.max(fromScrollY, 0)) + dy; + float scrollY = scrollYPx > minHeight ? (scrollYPx - minHeight) / (fullHeight - minHeight) : -(1f - scrollYPx / minHeight); + if (!canExpand()) + scrollY = Math.min(scrollY, 0); + updateCanExpand(); + + if (scrolling) { + setScrollY(scrollY); + if (event.getAction() == MotionEvent.ACTION_UP) { + scrolling = false; + allTextsView.setTextIsSelectable(!noforwards); + maybeScrolling = false; + allowScroll = true; + scrollYTo( + Math.abs(dy) > dp(16) ? + /*fromScrollRect && Math.ceil(fromScrollY) >= 1f ? -1f :*/ Math.round(fromScrollY) + (scrollY > fromScrollY ? 1f : -1f) * (float) Math.ceil(Math.abs(fromScrollY - scrollY)) : + Math.round(fromScrollY) + ); + } + // if (fromScrollRect) + // return super.dispatchTouchEvent(event) || true; + return true; + } + } + } + if (hasSelection() && maybeScrolling) { + scrolling = false; + allTextsView.setTextIsSelectable(!noforwards); + maybeScrolling = false; + allowScroll = true; + scrollYTo(Math.round(fromScrollY)); + } + return super.dispatchTouchEvent(event); + } catch (Exception e) { + return super.dispatchTouchEvent(event); + } + } + + private LoadingTextView addBlock(CharSequence startText, boolean scaleFromZero) { + LoadingTextView textView = new LoadingTextView(getContext(), startText, scaleFromZero, false) { + @Override + protected void onLoadEnd() { + scrollView.postDelayed(() -> { + allTextsView.setText(allTexts); + }, textBlocks.size() > 1 ? 700 : 0); + } + }; + textView.setLines(0); + textView.setMaxLines(0); + textView.setSingleLine(false); + textView.setEllipsizeNull(); + textView.setTextColor(Theme.getColor(Theme.key_dialogTextBlack)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + textView.setTextIsSelectable(false); + textView.setTranslationY((textsView.getChildCount() - 1) * (LoadingTextView.padVert * -4f + dp(.48f))); + textsView.addView(textView, textsView.getChildCount() - 1, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, 0, 0, 0, 0, 0)); + return textView; + } + + private float openingT = 0f; + private ValueAnimator openingAnimator; + +// protected boolean useLightStatusBar = true; +// protected boolean useLightNavBar; +// public void setUseLightStatusBar(boolean value) { +// useLightStatusBar = value; +// if (Build.VERSION.SDK_INT >= 23) { +// int color = Theme.getColor(Theme.key_actionBarDefault, null, true); +// int flags = contentView.getSystemUiVisibility(); +// if (useLightStatusBar && color == 0xffffffff) { +// flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; +// } else { +// flags &=~ View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; +// } +// contentView.setSystemUiVisibility(flags); +// } +// } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); +// +// if (useLightStatusBar && Build.VERSION.SDK_INT >= 23) { +// int color = Theme.getColor(Theme.key_actionBarDefault, null, true); +// if (color == 0xffffffff) { +// int flags = contentView.getSystemUiVisibility(); +// flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; +// contentView.setSystemUiVisibility(flags); +// } +// } +// if (useLightNavBar && Build.VERSION.SDK_INT >= 26) { +// AndroidUtilities.setLightNavigationBar(getWindow(), false); +// } + + contentView.setPadding(0, 0, 0, 0); + setContentView(contentView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); +// int flags = contentView.getSystemUiVisibility(); +// flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; +// contentView.setSystemUiVisibility(flags); + + Window window = getWindow(); + + window.setWindowAnimations(R.style.DialogNoAnimation); + WindowManager.LayoutParams params = window.getAttributes(); + params.width = ViewGroup.LayoutParams.MATCH_PARENT; + params.gravity = Gravity.TOP | Gravity.LEFT; + params.dimAmount = 0; + params.flags &= ~WindowManager.LayoutParams.FLAG_DIM_BEHIND; + params.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; + if (Build.VERSION.SDK_INT >= 21) { + params.flags |= WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | + WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | + WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; + } + params.flags |= WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN; + params.height = ViewGroup.LayoutParams.MATCH_PARENT; +// if (Build.VERSION.SDK_INT >= 28) { +// params.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; +// } + window.setAttributes(params); + + + container.forceLayout(); + } + + protected ColorDrawable backDrawable = new ColorDrawable(0xff000000) { + @Override + public void setAlpha(int alpha) { + super.setAlpha(alpha); + container.invalidate(); + } + }; + @Override + public void show() { + super.show(); + + openAnimation(0); + openTo(1, true, true); + } + + private boolean dismissed = false; + @Override + public void dismiss() { + if (dismissed) + return; + dismissed = true; + + openTo(0, true); + } + private void openTo(float t, boolean priority) { + openTo(t, priority, false); + } + private void openTo(float t) { + openTo(t, false); + } + private boolean openingAnimatorPriority = false; + private void openTo(float t, boolean priority, boolean setAfter) { + final float T = Math.min(Math.max(t, 0), 1); + if (openingAnimatorPriority && !priority) + return; + openingAnimatorPriority = priority; + if (openingAnimator != null) + openingAnimator.cancel(); + openingAnimator = ValueAnimator.ofFloat(openingT, T); + backDrawable.setAlpha((int) (openingT * 51)); + openingAnimator.addUpdateListener(a -> { + openingT = (float) a.getAnimatedValue(); + container.invalidate(); + backDrawable.setAlpha((int) (openingT * 51)); + }); + openingAnimator.addListener(new Animator.AnimatorListener() { + @Override public void onAnimationCancel(Animator animator) { + if (T <= 0f) + dismissInternal(); + else if (setAfter) { + allTextsView.setTextIsSelectable(!noforwards); + allTextsView.invalidate(); + scrollView.stopNestedScroll(); + openAnimation(T - 1f); + } + openingAnimatorPriority = false; + } + @Override public void onAnimationEnd(Animator animator) { + if (T <= 0f) + dismissInternal(); + else if (setAfter) { + allTextsView.setTextIsSelectable(!noforwards); + allTextsView.invalidate(); + scrollView.stopNestedScroll(); + openAnimation(T - 1f); + } + openingAnimatorPriority = false; + } + @Override public void onAnimationRepeat(Animator animator) { } + @Override public void onAnimationStart(Animator animator) { } + }); + openingAnimator.setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT); + openingAnimator.setDuration((long) (Math.abs(openingT - T) * (setAfter ? 380 : 200))); + openingAnimator.setStartDelay(setAfter ? 60 : 0); + openingAnimator.start(); + } + public void dismissInternal() { + try { + super.dismiss(); + } catch (Exception e) { + FileLog.e(e); + } + } + + public String languageName(String locale) { + if (locale == null || locale.equals("und") || locale.equals("auto")) + return null; +// if (locale != null && !locale.equals("und") && !locale.equals("auto")) { +// String passportLang = LocaleController.getString("PassportLanguage_" + locale.toUpperCase()); +// if (passportLang != null && passportLang.length() > 0) +// return passportLang; +// } + LocaleController.LocaleInfo localeInfo = LocaleController.getInstance().getLanguageByPlural(locale); + boolean isCurrentLanguageEnglish = false; + try { + isCurrentLanguageEnglish = LocaleController.getInstance().getCurrentLocaleInfo().pluralLangCode.equals("en"); + } catch (Exception e) {} + if (localeInfo != null && ((isCurrentLanguageEnglish && localeInfo.nameEnglish != null) || (!isCurrentLanguageEnglish && localeInfo.name != null))) + return isCurrentLanguageEnglish ? localeInfo.nameEnglish : localeInfo.name; + return null; + } + + public void updateSourceLanguage() { + if (languageName(fromLanguage) != null) { + subtitleView.setAlpha(1); + subtitleFromView.setText(languageName(fromLanguage)); + } else if (loaded) { + subtitleView.animate().alpha(0).setDuration(150).start(); + } + } + + private ArrayList cutInBlocks(CharSequence full, int maxBlockSize) { + ArrayList blocks = new ArrayList<>(); + if (full == null) + return blocks; + while (full.length() > maxBlockSize) { + String maxBlockStr = full.subSequence(0, maxBlockSize).toString(); + int n = -1; + if (n == -1) n = maxBlockStr.lastIndexOf("\n\n"); + if (n == -1) n = maxBlockStr.lastIndexOf("\n"); + if (n == -1) n = maxBlockStr.lastIndexOf(". "); + blocks.add(full.subSequence(0, n + 1)); + full = full.subSequence(n + 1, full.length()); + } + if (full.length() > 0) + blocks.add(full); + return blocks; + } + + + public void showTranslateMoreView(boolean show) { + translateMoreView.setClickable(show); + translateMoreView.setVisibility(textBlocks.size() > 1 ? View.VISIBLE : View.GONE); + translateMoreView + .animate() +// .translationX(show ? 0f : dp(4)) + .alpha(show ? 1f : 0f) + .withEndAction(() -> { + if (!show) + translateMoreView.setVisibility(textBlocks.size() > 1 ? View.INVISIBLE : View.GONE); + }) + .setInterpolator(CubicBezierInterpolator.EASE_OUT) + .setDuration((long) (Math.abs(translateMoreView.getAlpha() - (show ? 1f : 0f)) * 85)) + .start(); + } + + private boolean loading = false; + private boolean loaded = false; + private void fetchNext() { + if (loading) + return; + loading = true; + + showTranslateMoreView(false); + if (blockIndex >= textBlocks.size()) + return; + + CharSequence blockText = textBlocks.get(blockIndex); + LoadingTextView blockView = addBlock(blockText, blockIndex != 0); + + fetchTranslation( + blockText, + (String translatedText, String sourceLanguage) -> { + loaded = true; + Spannable spannable = new SpannableStringBuilder(translatedText); + try { + AndroidUtilities.addLinks(spannable, Linkify.WEB_URLS); + MessageObject.addUrlsByPattern(false, spannable, false, 0, 0, true); + URLSpan[] urlSpans = spannable.getSpans(0, spannable.length(), URLSpan.class); + for (int i = 0; i < urlSpans.length; ++i) { + URLSpan urlSpan = urlSpans[i]; + int start = spannable.getSpanStart(urlSpan), + end = spannable.getSpanEnd(urlSpan); + spannable.removeSpan(urlSpan); + spannable.setSpan( + new ClickableSpan() { + @Override + public void onClick(@NonNull View view) { + AlertsCreator.showOpenUrlAlert(fragment, urlSpan.getURL(), false, false); + } + + @Override + public void updateDrawState(@NonNull TextPaint ds) { + int alpha = Math.min(ds.getAlpha(), ds.getColor() >> 24 & 0xff); + ds.setUnderlineText(true); + ds.setColor(Theme.getColor(Theme.key_dialogTextLink)); + ds.setAlpha(alpha); + } + }, + start, end, + Spanned.SPAN_EXCLUSIVE_EXCLUSIVE + ); + } + } catch (Exception e) { + e.printStackTrace(); + } + blockView.setText(spannable); + allTexts = new SpannableStringBuilder(allTextsView.getText()).append(blockIndex == 0 ? "" : "\n").append(spannable); + + fromLanguage = sourceLanguage; + updateSourceLanguage(); + + blockIndex++; + showTranslateMoreView(blockIndex < textBlocks.size()); + loading = false; + + }, + (boolean rateLimit) -> { + if (rateLimit) + Toast.makeText(getContext(), LocaleController.getString("TranslationFailedAlert1", R.string.TranslationFailedAlert1), Toast.LENGTH_SHORT).show(); + else + Toast.makeText(getContext(), LocaleController.getString("TranslationFailedAlert2", R.string.TranslationFailedAlert2), Toast.LENGTH_SHORT).show(); + if (blockIndex == 0) + dismiss(); + } + ); + } + + private String[] userAgents = new String[] { + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36", // 13.5% + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36", // 6.6% + "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0", // 6.4% + "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0", // 6.2% + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36", // 5.2% + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36" // 4.8% + }; + public interface OnTranslationSuccess { + public void run(String translated, String sourceLanguage); + } + public interface OnTranslationFail { + public void run(boolean rateLimit); + } + private long minFetchingDuration = 1000; + private void fetchTranslation(CharSequence text, OnTranslationSuccess onSuccess, OnTranslationFail onFail) { + new Thread() { + @Override + public void run() { + String uri = ""; + HttpURLConnection connection = null; + long start = SystemClock.elapsedRealtime(); + try { + uri = "https://translate.goo"; + uri += "gleapis.com/transl"; + uri += "ate_a"; + uri += "/singl"; + uri += "e?client=gtx&sl=" + Uri.encode(fromLanguage) + "&tl=" + Uri.encode(toLanguage) + "&dt=t" + "&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&q="; + uri += Uri.encode(text.toString()); + connection = (HttpURLConnection) new URI(uri).toURL().openConnection(); + connection.setRequestMethod("GET"); + connection.setRequestProperty("User-Agent", userAgents[(int) Math.round(Math.random() * (userAgents.length - 1))]); + connection.setRequestProperty("Content-Type", "application/json"); + + StringBuilder textBuilder = new StringBuilder(); + try (Reader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), Charset.forName("UTF-8")))) { + int c = 0; + while ((c = reader.read()) != -1) { + textBuilder.append((char) c); + } + } + String jsonString = textBuilder.toString(); + + JSONTokener tokener = new JSONTokener(jsonString); + JSONArray array = new JSONArray(tokener); + JSONArray array1 = array.getJSONArray(0); + String sourceLanguage = null; + try { + sourceLanguage = array.getString(2); + } catch (Exception e2) {} + if (sourceLanguage != null && sourceLanguage.contains("-")) { + sourceLanguage = sourceLanguage.substring(0, sourceLanguage.indexOf("-")); + } + String result = ""; + for (int i = 0; i < array1.length(); ++i) { + String blockText = array1.getJSONArray(i).getString(0); + if (blockText != null && !blockText.equals("null")) + result += /*(i > 0 ? "\n" : "") +*/ blockText; + } + if (text.length() > 0 && text.charAt(0) == '\n') + result = "\n" + result; + final String finalResult = result; + final String finalSourceLanguage = sourceLanguage; + long elapsed = SystemClock.elapsedRealtime() - start; + if (elapsed < minFetchingDuration) + sleep(minFetchingDuration - elapsed); + AndroidUtilities.runOnUIThread(() -> { + if (onSuccess != null) + onSuccess.run(finalResult, finalSourceLanguage); + }); + } catch (Exception e) { + try { + Log.e("translate", "failed to translate a text " + (connection != null ? connection.getResponseCode() : null) + " " + (connection != null ? connection.getResponseMessage() : null)); + } catch (IOException ioException) { + ioException.printStackTrace(); + } + e.printStackTrace(); + + if (onFail != null && !dismissed) { + try { + final boolean rateLimit = connection != null && connection.getResponseCode() == 429; + AndroidUtilities.runOnUIThread(() -> { + onFail.run(rateLimit); + }); + } catch (Exception e2) { + AndroidUtilities.runOnUIThread(() -> { + onFail.run(false); + }); + } + } + } + } + }.start(); + } + + public static void showAlert(Context context, BaseFragment fragment, String fromLanguage, String toLanguage, CharSequence text, boolean noforwards) { + TranslateAlert alert = new TranslateAlert(fragment, context, fromLanguage, toLanguage, text, noforwards); + if (fragment != null) { + if (fragment.getParentActivity() != null) { + fragment.showDialog(alert); + } + } else { + alert.show(); + } + } + + private static class LoadingTextView extends FrameLayout { + private TextView loadingTextView; + public TextView textView; + + private CharSequence loadingString; + // private StaticLayout loadingLayout; +// private StaticLayout textLayout; + private Paint loadingPaint = new Paint(); + private Path loadingPath = new Path(); + private RectF fetchedPathRect = new RectF(); + public static int padHorz = dp(6), padVert = dp(1.5f); + private Path fetchPath = new Path() { + private boolean got = false; + + @Override + public void reset() { + super.reset(); + got = false; + } + + @Override + public void addRect(float left, float top, float right, float bottom, @NonNull Direction dir) { + if (!got) { + fetchedPathRect.set( + left - padHorz, + top - padVert, + right + padHorz, + bottom + padVert + ); + got = true; + } + } + }; + + public void resize() { + textView.forceLayout(); + loadingTextView.forceLayout(); + updateLoadingLayout(); + updateTextLayout(); + updateHeight(); + } + + @Override + protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + super.onLayout(changed, left, top, right, bottom); + LoadingTextView.this.resize(); + } + + private boolean animateWidth = false; + private boolean scaleFromZero = false; + private long scaleFromZeroStart = 0; + private final long scaleFromZeroDuration = 220l; + public LoadingTextView(Context context, CharSequence loadingString, boolean scaleFromZero, boolean animateWidth) { + super(context); + + this.animateWidth = animateWidth; + this.scaleFromZero = scaleFromZero; + this.scaleFromZeroStart = SystemClock.elapsedRealtime(); + + setPadding(padHorz, padVert, padHorz, padVert); + + loadingT = 0f; + loadingTextView = new TextView(context) { + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure( + animateWidth ? + MeasureSpec.makeMeasureSpec( + 999999, + MeasureSpec.AT_MOST + ) : widthMeasureSpec, + MeasureSpec.makeMeasureSpec( + MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.AT_MOST ? 999999 : MeasureSpec.getSize(heightMeasureSpec), + MeasureSpec.getMode(heightMeasureSpec) + ) + ); + } + }; + loadingString = Emoji.replaceEmoji(loadingString, loadingTextView.getPaint().getFontMetricsInt(), dp(14), false); + loadingTextView.setText(this.loadingString = loadingString); + loadingTextView.setVisibility(INVISIBLE); + loadingTextView.measure(MeasureSpec.makeMeasureSpec(animateWidth ? 999999 : getWidth(), MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(9999999, MeasureSpec.AT_MOST)); + addView(loadingTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP)); + + textView = new TextView(context) { + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure( + animateWidth ? + MeasureSpec.makeMeasureSpec( + 999999, + MeasureSpec.AT_MOST + ) : widthMeasureSpec, + MeasureSpec.makeMeasureSpec( + MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.AT_MOST ? 999999 : MeasureSpec.getSize(heightMeasureSpec), + MeasureSpec.getMode(heightMeasureSpec) + ) + ); + } + }; + addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); + + int c1 = Theme.getColor(Theme.key_dialogBackground), + c2 = Theme.getColor(Theme.key_dialogBackgroundGray); + LinearGradient gradient = new LinearGradient(0, 0, gradientWidth, 0, new int[]{ c1, c2, c1 }, new float[] { 0, 0.67f, 1f }, Shader.TileMode.REPEAT); + loadingPaint.setShader(gradient); + + setWillNotDraw(false); + setClipChildren(false); + + updateLoadingLayout(); + } + + protected void scrollToBottom() {} + protected void onLoadEnd() {} + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + +// updateLoadingLayout(); +// updateTextLayout(); + updateHeight(); + } + + private void updateHeight() { +// int loadingHeight = loadingLayout != null ? loadingLayout.getHeight() : loadingTextView.getMeasuredHeight(); + int loadingHeight = loadingTextView.getMeasuredHeight(); + float scaleFromZeroT = scaleFromZero ? Math.max(Math.min((float) (SystemClock.elapsedRealtime() - scaleFromZeroStart) / (float) scaleFromZeroDuration, 1f), 0f) : 1f; + int height = ( + (int) ( + ( + padVert * 2 + + loadingHeight + ( + textView.getMeasuredHeight() - + loadingHeight + ) * loadingT + ) * scaleFromZeroT + ) + ); + ViewGroup.LayoutParams params = (ViewGroup.LayoutParams) getLayoutParams(); + boolean newHeight = false; + if (params == null) { + newHeight = true; + params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, height); + } else + newHeight = params.height != height; +// if (height > 0 || scaleFromZero) + params.height = height; + + if (animateWidth) { + int loadingWidth = loadingTextView.getMeasuredWidth() + padHorz * 2; + int textWidth = (textView.getMeasuredWidth() <= 0 ? loadingTextView.getMeasuredWidth() : textView.getMeasuredWidth()) + padHorz * 2; + params.width = (int) ((loadingWidth + (textWidth - loadingWidth) * loadingT) * scaleFromZeroT); + } + + this.setLayoutParams(params); + } + + // private TextPaint textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); +// private TextPaint loadingTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); + private float gradientWidth = dp(350f); + private void updateLoadingLayout() { + float textWidth = loadingTextView.getMeasuredWidth(); + if (textWidth > 0) { +// loadingTextPaint.setAntiAlias(true); +// loadingLayout = new StaticLayout( +// loadingString, +// loadingTextPaint, +// (int) textWidth, +// Layout.Alignment.ALIGN_NORMAL, +// 1f, 0f, false +// ); +// loadingPath.reset(); + Layout loadingLayout = loadingTextView.getLayout(); + for (int i = 0; i < loadingLayout.getLineCount(); ++i) { + int start = loadingLayout.getLineStart(i), end = loadingLayout.getLineEnd(i); + if (start + 1 == end) + continue; + loadingLayout.getSelectionPath(start, end, fetchPath); + loadingPath.addRoundRect(fetchedPathRect, dp(4), dp(4), Path.Direction.CW); + } + + updateHeight(); + } + + if (!loaded && loadingAnimator == null) { + loadingAnimator = ValueAnimator.ofFloat(0f, 1f); + loadingAnimator.addUpdateListener(a -> { + loadingT = 0f; + if (scaleFromZero && SystemClock.elapsedRealtime() < scaleFromZeroStart + scaleFromZeroDuration + 25) + updateHeight(); + invalidate(); + }); + loadingAnimator.setDuration(Long.MAX_VALUE); + loadingAnimator.start(); + } + } + private void updateTextLayout() { +// float textWidth = textView.getMeasuredWidth(); +// textPaint.setAntiAlias(true); +// if (textWidth > 0) { +// textLayout = new StaticLayout( +// textView.getText(), +// textPaint, +// (int) textWidth, +// Layout.Alignment.ALIGN_NORMAL, +// 1f, 0f, false +// ); +// } + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { +// float measureHeight = MeasureSpec.getSize(heightMeasureSpec); +// float loadingHeight = loadingLayout == null ? measureHeight : loadingLayout.getHeight(); +// float height = measureHeight + (loadingHeight - measureHeight) * (1f - loadingT); + super.onMeasure(widthMeasureSpec, heightMeasureSpec); +// updateLoadingLayout(); +// updateTextLayout(); + this.resize(); + } + + public boolean loaded = false; + private float loadingT = 0f; + private ValueAnimator loadingAnimator = null; + + public void setEllipsizeNull() { + loadingTextView.setEllipsize(null); + textView.setEllipsize(null); + } + public void setSingleLine(boolean singleLine) { + loadingTextView.setSingleLine(singleLine); + textView.setSingleLine(singleLine); + } + public void setLines(int lines) { + loadingTextView.setLines(lines); + textView.setLines(lines); + } + public void setGravity(int gravity) { + loadingTextView.setGravity(gravity); + textView.setGravity(gravity); + } + public void setMaxLines(int maxLines) { + loadingTextView.setMaxLines(maxLines); + textView.setMaxLines(maxLines); + } + public void setTextIsSelectable(boolean selectable) { + textView.setTextIsSelectable(selectable); + } + private boolean showLoadingTextValue = true; + public void showLoadingText(boolean show) { + showLoadingTextValue = show; + } + public void setTextColor(int textColor) { +// loadingTextPaint.setColor(multAlpha(textColor, showLoadingTextValue ? 0.08f : 0f)); +// loadingTextView.setTextColor(multAlpha(textColor, showLoadingTextValue ? 0.08f : 0f)); +// textPaint.setColor(textColor); + loadingTextView.setTextColor(textColor); + textView.setTextColor(textColor); + } + private float sz(int unit, float size) { + Context c = getContext(); + return TypedValue.applyDimension( + unit, size, (c == null ? Resources.getSystem() : c.getResources()).getDisplayMetrics() + ); + } + public void setTextSize(int size) { + loadingTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, size); + textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, size); +// loadingTextPaint.setTextSize(size); +// textPaint.setTextSize(size); + loadingTextView.setText(loadingString = Emoji.replaceEmoji(loadingString, loadingTextView.getPaint().getFontMetricsInt(), dp(14), false)); + loadingTextView.measure(MeasureSpec.makeMeasureSpec(animateWidth ? 999999 : getWidth(), MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(9999999, MeasureSpec.AT_MOST)); + textView.setText(Emoji.replaceEmoji(textView.getText(), textView.getPaint().getFontMetricsInt(), dp(14), false)); + updateLoadingLayout(); + } + public void setTextSize(int unit, float size) { + loadingTextView.setTextSize(unit, size); + textView.setTextSize(unit, size); +// loadingTextPaint.setTextSize(sz(unit, size)); +// textPaint.setTextSize(sz(unit, size)); + loadingTextView.setText(loadingString = Emoji.replaceEmoji(loadingString, loadingTextView.getPaint().getFontMetricsInt(), dp(14), false)); + loadingTextView.measure(MeasureSpec.makeMeasureSpec(animateWidth ? 999999 : getWidth(), MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(9999999, MeasureSpec.AT_MOST)); + textView.setText(Emoji.replaceEmoji(textView.getText(), textView.getPaint().getFontMetricsInt(), dp(14), false)); + updateLoadingLayout(); + } + public int multAlpha(int color, float mult) { + return (color & 0x00ffffff) | ((int) ((color >> 24 & 0xff) * mult) << 24); + } + boolean scrolled = false; + private ValueAnimator animator = null; + public void setText(CharSequence text) { + text = Emoji.replaceEmoji(text, textView.getPaint().getFontMetricsInt(), dp(14), false); + textView.setText(text); + textView.measure(MeasureSpec.makeMeasureSpec(animateWidth ? 999999 : getWidth(), MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(9999999, MeasureSpec.AT_MOST)); + updateTextLayout(); + + if (!loaded) { + loaded = true; + loadingT = 0f; + if (loadingAnimator != null) { + loadingAnimator.cancel(); + loadingAnimator = null; + } + if (animator != null) + animator.cancel(); + animator = ValueAnimator.ofFloat(0f, 1f); + animator.addUpdateListener(a -> { + loadingT = (float) a.getAnimatedValue(); + updateHeight(); + invalidate(); + }); + animator.addListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animator) { + + } + + @Override + public void onAnimationEnd(Animator animator) { + onLoadEnd(); + } + + @Override + public void onAnimationCancel(Animator animator) { + onLoadEnd(); + } + + @Override + public void onAnimationRepeat(Animator animator) { + + } + }); + animator.setInterpolator(CubicBezierInterpolator.EASE_IN); + animator.setDuration(220); + animator.start(); + } else + updateHeight(); + } + + private long start = SystemClock.elapsedRealtime(); + private Path shadePath = new Path(); + private Path tempPath = new Path(); + private Path inPath = new Path(); + private RectF rect = new RectF(); + @Override + protected void onDraw(Canvas canvas) { + float w = getWidth(), h = getHeight(); + + float cx = LocaleController.isRTL ? Math.max(w / 2f, w - 8f) : Math.min(w / 2f, 8f), + cy = Math.min(h / 2f, 8f), + R = (float) Math.sqrt(Math.max( + Math.max(cx*cx + cy*cy, (w-cx)*(w-cx) + cy*cy), + Math.max(cx*cx + (h-cy)*(h-cy), (w-cx)*(w-cx) + (h-cy)*(h-cy)) + )), + r = loadingT * R; + inPath.reset(); + inPath.addCircle(cx, cy, r, Path.Direction.CW); + + canvas.save(); + canvas.clipPath(inPath, Region.Op.DIFFERENCE); + + loadingPaint.setAlpha((int) ((1f - loadingT) * 255)); + float dx = gradientWidth - (((SystemClock.elapsedRealtime() - start) / 1000f * gradientWidth) % gradientWidth); + shadePath.reset(); + shadePath.addRect(0, 0, w, h, Path.Direction.CW); + + canvas.translate(padHorz, padVert); + canvas.clipPath(loadingPath); + canvas.translate(-padHorz, -padVert); + canvas.translate(-dx, 0); + shadePath.offset(dx, 0f, tempPath); + canvas.drawPath(tempPath, loadingPaint); + canvas.translate(dx, 0); + canvas.restore(); + + canvas.save(); + rect.set(0, 0, w, h); + canvas.clipPath(inPath, Region.Op.DIFFERENCE); + canvas.translate(padHorz, padVert); + canvas.clipPath(loadingPath); +// if (loadingLayout != null) +// loadingLayout.draw(canvas); + canvas.saveLayerAlpha(rect, (int) (255 * (showLoadingTextValue ? 0.08f : 0f)), Canvas.ALL_SAVE_FLAG); +// loadingTextView.setAlpha(showLoadingTextValue ? 0.08f : 0f); + loadingTextView.draw(canvas); + canvas.restore(); + canvas.restore(); + +// canvas.save(); +// canvas.clipPath(inPath); +// canvas.translate(padHorz, padVert); +// textLayout.draw(canvas); +// canvas.restore(); + } + private Paint RED = new Paint(); + + @Override + protected boolean drawChild(Canvas canvas, View child, long drawingTime) { + if (child == textView) { + canvas.save(); + canvas.clipPath(inPath); + if (loadingT < 1f) { + rect.set(0, 0, getWidth(), getHeight()); + canvas.saveLayerAlpha(rect, (int) (255 * loadingT), Canvas.ALL_SAVE_FLAG); + } + boolean r = super.drawChild(canvas, child, drawingTime); + if (loadingT < 1f) + canvas.restore(); + canvas.restore(); + return r; + } + return false; + } + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/UpdateAppAlertDialog.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/UpdateAppAlertDialog.java index c677e30a5..e4725bf4f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/UpdateAppAlertDialog.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/UpdateAppAlertDialog.java @@ -239,9 +239,9 @@ public class UpdateAppAlertDialog extends BottomSheet { ImageLocation imageLocation = ImageLocation.getForDocument(thumb, appUpdate.sticker); if (svgThumb != null) { - imageView.setImage(ImageLocation.getForDocument(appUpdate.sticker), "50_50", svgThumb, 0, "update"); + imageView.setImage(ImageLocation.getForDocument(appUpdate.sticker), "160_160", svgThumb, 0, "update"); } else { - imageView.setImage(ImageLocation.getForDocument(appUpdate.sticker), "50_50", imageLocation, null, 0, "update"); + imageView.setImage(ImageLocation.getForDocument(appUpdate.sticker), "160_160", imageLocation, null, 0, "update"); } linearLayout.addView(imageView, LayoutHelper.createLinear(160, 160, Gravity.CENTER_HORIZONTAL | Gravity.TOP, 17, 8, 17, 0)); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilerEffect.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilerEffect.java new file mode 100644 index 000000000..3ed6e1f95 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilerEffect.java @@ -0,0 +1,824 @@ +package org.telegram.ui.Components.spoilers; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.TimeInterpolator; +import android.animation.ValueAnimator; +import android.annotation.SuppressLint; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.ColorFilter; +import android.graphics.Paint; +import android.graphics.Path; +import android.graphics.PixelFormat; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; +import android.graphics.PorterDuffXfermode; +import android.graphics.Rect; +import android.graphics.RectF; +import android.graphics.Region; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.text.Layout; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.StaticLayout; +import android.text.TextPaint; +import android.text.style.ForegroundColorSpan; +import android.text.style.ReplacementSpan; +import android.text.style.URLSpan; +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.MainThread; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.graphics.ColorUtils; +import androidx.core.math.MathUtils; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.Emoji; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.SharedConfig; +import org.telegram.messenger.Utilities; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.Components.Easings; +import org.telegram.ui.Components.TextStyleSpan; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Stack; +import java.util.concurrent.atomic.AtomicReference; + +public class SpoilerEffect extends Drawable { + public final static int MAX_PARTICLES_PER_ENTITY = measureMaxParticlesCount(); + public final static int PARTICLES_PER_CHARACTER = measureParticlesPerCharacter(); + private final static float VERTICAL_PADDING_DP = 2.5f; + private final static int RAND_REPEAT = 14; + private final static float KEYPOINT_DELTA = 5f; + private final static int FPS = 30; + private final static int renderDelayMs = 1000 / FPS + 1; + public final static float[] ALPHAS = { + 0.3f, 0.6f, 1.0f + }; + private Paint[] particlePaints = new Paint[ALPHAS.length]; + + private Stack particlesPool = new Stack<>(); + private int maxParticles; + float[][] particlePoints = new float[ALPHAS.length][MAX_PARTICLES_PER_ENTITY * 2]; + private float[] particleRands = new float[RAND_REPEAT]; + private int[] renderCount = new int[ALPHAS.length]; + + private static Path tempPath = new Path(); + + private RectF visibleRect; + + private ArrayList particles = new ArrayList<>(); + private View mParent; + + private long lastDrawTime; + + private float rippleX, rippleY; + private float rippleMaxRadius; + private float rippleProgress = -1; + private boolean reverseAnimator; + private boolean shouldInvalidateColor; + private Runnable onRippleEndCallback; + private ValueAnimator rippleAnimator; + + private List spaces = new ArrayList<>(); + private List keyPoints; + private int mAlpha = 0xFF; + + private TimeInterpolator rippleInterpolator = input -> input; + + private boolean invalidateParent; + private boolean suppressUpdates; + private boolean isLowDevice; + private boolean enableAlpha; + + private int lastColor; + public boolean drawPoints; + private static Paint xRefPaint; + + private static int measureParticlesPerCharacter() { + switch (SharedConfig.getDevicePerformanceClass()) { + default: + case SharedConfig.PERFORMANCE_CLASS_LOW: + case SharedConfig.PERFORMANCE_CLASS_AVERAGE: + return 10; + case SharedConfig.PERFORMANCE_CLASS_HIGH: + return 30; + } + } + + private static int measureMaxParticlesCount() { + switch (SharedConfig.getDevicePerformanceClass()) { + default: + case SharedConfig.PERFORMANCE_CLASS_LOW: + case SharedConfig.PERFORMANCE_CLASS_AVERAGE: + return 100; + case SharedConfig.PERFORMANCE_CLASS_HIGH: + return 150; + } + } + + public SpoilerEffect() { + for (int i = 0; i < ALPHAS.length; i++) { + particlePaints[i] = new Paint(); + if (i == 0) { + particlePaints[i].setStrokeWidth(AndroidUtilities.dp(1.4f)); + particlePaints[i].setStyle(Paint.Style.STROKE); + particlePaints[i].setStrokeCap(Paint.Cap.ROUND); + } else { + particlePaints[i].setStrokeWidth(AndroidUtilities.dp(1.2f)); + particlePaints[i].setStyle(Paint.Style.STROKE); + particlePaints[i].setStrokeCap(Paint.Cap.ROUND); + } + } + + isLowDevice = SharedConfig.getDevicePerformanceClass() == SharedConfig.PERFORMANCE_CLASS_LOW; + enableAlpha = true; + setColor(Color.TRANSPARENT); + } + + /** + * Sets if we should suppress updates or not + */ + public void setSuppressUpdates(boolean suppressUpdates) { + this.suppressUpdates = suppressUpdates; + invalidateSelf(); + } + + /** + * Sets if we should invalidate parent instead + */ + public void setInvalidateParent(boolean invalidateParent) { + this.invalidateParent = invalidateParent; + } + + /** + * Updates max particles count + */ + public void updateMaxParticles() { + setMaxParticlesCount(MathUtils.clamp((getBounds().width() / AndroidUtilities.dp(6)) * PARTICLES_PER_CHARACTER, PARTICLES_PER_CHARACTER, MAX_PARTICLES_PER_ENTITY)); + } + + /** + * Sets callback to be run after ripple animation ends + */ + public void setOnRippleEndCallback(@Nullable Runnable onRippleEndCallback) { + this.onRippleEndCallback = onRippleEndCallback; + } + + /** + * Starts ripple + * + * @param rX Ripple center x + * @param rY Ripple center y + * @param radMax Max ripple radius + */ + public void startRipple(float rX, float rY, float radMax) { + startRipple(rX, rY, radMax, false); + } + + /** + * Starts ripple + * + * @param rX Ripple center x + * @param rY Ripple center y + * @param radMax Max ripple radius + * @param reverse If we should start reverse ripple + */ + public void startRipple(float rX, float rY, float radMax, boolean reverse) { + rippleX = rX; + rippleY = rY; + rippleMaxRadius = radMax; + rippleProgress = reverse ? 1 : 0; + reverseAnimator = reverse; + + if (rippleAnimator != null) + rippleAnimator.cancel(); + int startAlpha = reverseAnimator ? 0xFF : particlePaints[ALPHAS.length - 1].getAlpha(); + rippleAnimator = ValueAnimator.ofFloat(rippleProgress, reverse ? 0 : 1).setDuration((long) MathUtils.clamp(rippleMaxRadius * 0.3f, 250, 550)); + rippleAnimator.setInterpolator(rippleInterpolator); + rippleAnimator.addUpdateListener(animation -> { + rippleProgress = (float) animation.getAnimatedValue(); + setAlpha((int) (startAlpha * (1f - rippleProgress))); + shouldInvalidateColor = true; + invalidateSelf(); + }); + rippleAnimator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + Iterator it = particles.iterator(); + while (it.hasNext()) { + Particle p = it.next(); + if (particlesPool.size() < maxParticles) { + particlesPool.push(p); + } + it.remove(); + } + + if (onRippleEndCallback != null) { + onRippleEndCallback.run(); + onRippleEndCallback = null; + } + + rippleAnimator = null; + invalidateSelf(); + } + }); + rippleAnimator.start(); + + invalidateSelf(); + } + + /** + * Sets new ripple interpolator + * + * @param rippleInterpolator New interpolator + */ + public void setRippleInterpolator(@NonNull TimeInterpolator rippleInterpolator) { + this.rippleInterpolator = rippleInterpolator; + } + + /** + * Sets new keypoints + * + * @param keyPoints New keypoints + */ + public void setKeyPoints(List keyPoints) { + this.keyPoints = keyPoints; + invalidateSelf(); + } + + /** + * Gets ripple path + */ + public void getRipplePath(Path path) { + path.addCircle(rippleX, rippleY, rippleMaxRadius * MathUtils.clamp(rippleProgress, 0, 1), Path.Direction.CW); + } + + /** + * @return Current ripple progress + */ + public float getRippleProgress() { + return rippleProgress; + } + + /** + * @return If we should invalidate color + */ + public boolean shouldInvalidateColor() { + boolean b = shouldInvalidateColor; + shouldInvalidateColor = false; + return b; + } + + /** + * Sets new ripple progress + */ + public void setRippleProgress(float rippleProgress) { + this.rippleProgress = rippleProgress; + if (rippleProgress == -1 && rippleAnimator != null) { + rippleAnimator.cancel(); + } + shouldInvalidateColor = true; + } + + @Override + public void setBounds(int left, int top, int right, int bottom) { + super.setBounds(left, top, right, bottom); + Iterator it = particles.iterator(); + while (it.hasNext()) { + Particle p = it.next(); + if (!getBounds().contains((int) p.x, (int) p.y)) { + it.remove(); + } + if (particlesPool.size() < maxParticles) { + particlesPool.push(p); + } + } + } + + @Override + public void draw(@NonNull Canvas canvas) { + if (drawPoints) { + long curTime = System.currentTimeMillis(); + int dt = (int) Math.min(curTime - lastDrawTime, renderDelayMs); + boolean hasAnimator = false; + + + lastDrawTime = curTime; + + int left = getBounds().left, top = getBounds().top, right = getBounds().right, bottom = getBounds().bottom; + for (int i = 0; i < ALPHAS.length; i++) { + renderCount[i] = 0; + } + for (int i = 0; i < particles.size(); i++) { + Particle particle = particles.get(i); + + particle.currentTime = Math.min(particle.currentTime + dt, particle.lifeTime); + if (particle.currentTime >= particle.lifeTime || isOutOfBounds(left, top, right, bottom, particle.x, particle.y)) { + if (particlesPool.size() < maxParticles) { + particlesPool.push(particle); + } + particles.remove(i); + i--; + continue; + } + + float hdt = particle.velocity * dt / 500f; + particle.x += particle.vecX * hdt; + particle.y += particle.vecY * hdt; + + int alphaIndex = particle.alpha; + particlePoints[alphaIndex][renderCount[alphaIndex] * 2] = particle.x; + particlePoints[alphaIndex][renderCount[alphaIndex] * 2 + 1] = particle.y; + renderCount[alphaIndex]++; + } + + if (particles.size() < maxParticles) { + int np = maxParticles - particles.size(); + Arrays.fill(particleRands, -1); + for (int i = 0; i < np; i++) { + float rf = particleRands[i % RAND_REPEAT]; + if (rf == -1) { + particleRands[i % RAND_REPEAT] = rf = Utilities.fastRandom.nextFloat(); + } + + Particle newParticle = !particlesPool.isEmpty() ? particlesPool.pop() : new Particle(); + int attempts = 0; + do { + generateRandomLocation(newParticle, i); + attempts++; + } while (isOutOfBounds(left, top, right, bottom, newParticle.x, newParticle.y) && attempts < 4); + + + double angleRad = rf * Math.PI * 2 - Math.PI; + float vx = (float) Math.cos(angleRad); + float vy = (float) Math.sin(angleRad); + + newParticle.vecX = vx; + newParticle.vecY = vy; + + newParticle.currentTime = 0; + + newParticle.lifeTime = 1000 + Math.abs(Utilities.fastRandom.nextInt(2000)); // [1000;3000] + newParticle.velocity = 4 + rf * 6; + newParticle.alpha = Utilities.fastRandom.nextInt(ALPHAS.length); + particles.add(newParticle); + + int alphaIndex = newParticle.alpha; + particlePoints[alphaIndex][renderCount[alphaIndex] * 2] = newParticle.x; + particlePoints[alphaIndex][renderCount[alphaIndex] * 2 + 1] = newParticle.y; + renderCount[alphaIndex]++; + } + } + + for (int a = enableAlpha ? 0 : ALPHAS.length - 1; a < ALPHAS.length; a++) { + int renderCount = 0; + int off = 0; + for (int i = 0; i < particles.size(); i++) { + Particle p = particles.get(i); + + if (visibleRect != null && !visibleRect.contains(p.x, p.y) || p.alpha != a && enableAlpha) { + off++; + continue; + } + + particlePoints[a][(i - off) * 2] = p.x; + particlePoints[a][(i - off) * 2 + 1] = p.y; + renderCount += 2; + } + canvas.drawPoints(particlePoints[a], 0, renderCount, particlePaints[a]); + } + } else { + Paint shaderPaint = SpoilerEffectBitmapFactory.getInstance().getPaint(); + shaderPaint.setColorFilter(new PorterDuffColorFilter(lastColor, PorterDuff.Mode.SRC_IN)); + canvas.drawRect(getBounds().left, getBounds().top, getBounds().right, getBounds().bottom, SpoilerEffectBitmapFactory.getInstance().getPaint()); + invalidateSelf(); + + SpoilerEffectBitmapFactory.getInstance().checkUpdate(); + } + } + + /** + * Updates visible bounds to update particles + */ + public void setVisibleBounds(float left, float top, float right, float bottom) { + if (visibleRect == null) + visibleRect = new RectF(); + visibleRect.left = left; + visibleRect.top = top; + visibleRect.right = right; + visibleRect.bottom = bottom; + invalidateSelf(); + } + + private boolean isOutOfBounds(int left, int top, int right, int bottom, float x, float y) { + if (x < left || x > right || y < top + AndroidUtilities.dp(VERTICAL_PADDING_DP) || + y > bottom - AndroidUtilities.dp(VERTICAL_PADDING_DP)) + return true; + + for (int i = 0; i < spaces.size(); i++) { + if (spaces.get(i).contains(x, y)) { + return true; + } + } + return false; + } + + private void generateRandomLocation(Particle newParticle, int i) { + if (keyPoints != null && !keyPoints.isEmpty()) { + float rf = particleRands[i % RAND_REPEAT]; + long kp = keyPoints.get(Utilities.fastRandom.nextInt(keyPoints.size())); + newParticle.x = getBounds().left + (kp >> 16) + rf * AndroidUtilities.dp(KEYPOINT_DELTA) - AndroidUtilities.dp(KEYPOINT_DELTA / 2f); + newParticle.y = getBounds().top + (kp & 0xFFFF) + rf * AndroidUtilities.dp(KEYPOINT_DELTA) - AndroidUtilities.dp(KEYPOINT_DELTA / 2f); + } else { + newParticle.x = getBounds().left + Utilities.fastRandom.nextFloat() * getBounds().width(); + newParticle.y = getBounds().top + Utilities.fastRandom.nextFloat() * getBounds().height(); + } + } + + @Override + public void invalidateSelf() { + super.invalidateSelf(); + + if (mParent != null) { + View v = mParent; + if (v.getParent() != null && invalidateParent) { + ((View) v.getParent()).invalidate(); + } else { + v.invalidate(); + } + } + } + + /** + * Attaches to the parent view + * + * @param parentView Parent view + */ + public void setParentView(View parentView) { + this.mParent = parentView; + } + + /** + * @return Currently used parent view + */ + public View getParentView() { + return mParent; + } + + @Override + public void setAlpha(int alpha) { + mAlpha = alpha; + for (int i = 0; i < ALPHAS.length; i++) { + particlePaints[i].setAlpha((int) (ALPHAS[i] * alpha)); + } + } + + @Override + public void setColorFilter(@Nullable ColorFilter colorFilter) { + for (Paint p : particlePaints) { + p.setColorFilter(colorFilter); + } + } + + /** + * Sets particles color + * + * @param color New color + */ + public void setColor(int color) { + if (lastColor != color) { + for (int i = 0; i < ALPHAS.length; i++) { + particlePaints[i].setColor(ColorUtils.setAlphaComponent(color, (int) (mAlpha * ALPHAS[i]))); + } + lastColor = color; + } + } + + /** + * @return If effect has color + */ + public boolean hasColor() { + return lastColor != Color.TRANSPARENT; + } + + @Override + public int getOpacity() { + return PixelFormat.TRANSPARENT; + } + + /** + * @param textLayout Text layout to measure + * @return Measured key points + */ + public static synchronized List measureKeyPoints(Layout textLayout) { + int w = textLayout.getWidth(); + int h = textLayout.getHeight(); + + if (w == 0 || h == 0) + return Collections.emptyList(); + + Bitmap measureBitmap = Bitmap.createBitmap(Math.round(w), Math.round(h), Bitmap.Config.ARGB_4444); // We can use 4444 as we don't need accuracy here + Canvas measureCanvas = new Canvas(measureBitmap); + textLayout.draw(measureCanvas); + + int[] pixels = new int[measureBitmap.getWidth() * measureBitmap.getHeight()]; + measureBitmap.getPixels(pixels, 0, measureBitmap.getWidth(), 0, 0, w, h); + + int sX = -1; + ArrayList keyPoints = new ArrayList<>(pixels.length); + for (int x = 0; x < w; x++) { + for (int y = 0; y < h; y++) { + int clr = pixels[y * measureBitmap.getWidth() + x]; + if (Color.alpha(clr) >= 0x80) { + if (sX == -1) { + sX = x; + } + keyPoints.add(((long) (x - sX) << 16) + y); + } + } + } + keyPoints.trimToSize(); + measureBitmap.recycle(); + return keyPoints; + } + + /** + * @return Max particles count + */ + public int getMaxParticlesCount() { + return maxParticles; + } + + /** + * Sets new max particles count + */ + public void setMaxParticlesCount(int maxParticles) { + this.maxParticles = maxParticles; + while (particlesPool.size() + particles.size() < maxParticles) { + particlesPool.push(new Particle()); + } + } + + /** + * Alias for it's big bro + * + * @param tv Text view to use as a parent view + * @param spoilersPool Cached spoilers pool + * @param spoilers Spoilers list to populate + */ + public static void addSpoilers(TextView tv, @Nullable Stack spoilersPool, List spoilers) { + addSpoilers(tv, tv.getLayout(), (Spannable) tv.getText(), spoilersPool, spoilers); + } + + /** + * Alias for it's big bro + * + * @param v View to use as a parent view + * @param textLayout Text layout to measure + * @param spoilersPool Cached spoilers pool, could be null, but highly recommended + * @param spoilers Spoilers list to populate + */ + public static void addSpoilers(@Nullable View v, Layout textLayout, @Nullable Stack spoilersPool, List spoilers) { + if (textLayout.getText() instanceof Spannable){ + addSpoilers(v, textLayout, (Spannable) textLayout.getText(), spoilersPool, spoilers); + } + } + + /** + * Parses spoilers from spannable + * + * @param v View to use as a parent view + * @param textLayout Text layout to measure + * @param spannable Text to parse + * @param spoilersPool Cached spoilers pool, could be null, but highly recommended + * @param spoilers Spoilers list to populate + */ + public static void addSpoilers(@Nullable View v, Layout textLayout, Spannable spannable, @Nullable Stack spoilersPool, List spoilers) { + for (int line = 0; line < textLayout.getLineCount(); line++) { + float l = textLayout.getLineLeft(line), t = textLayout.getLineTop(line), r = textLayout.getLineRight(line), b = textLayout.getLineBottom(line); + int start = textLayout.getLineStart(line), end = textLayout.getLineEnd(line); + + for (TextStyleSpan span : spannable.getSpans(start, end, TextStyleSpan.class)) { + if (span.isSpoiler()) { + int ss = spannable.getSpanStart(span), se = spannable.getSpanEnd(span); + int realStart = Math.max(start, ss), realEnd = Math.min(end, se); + + int len = realEnd - realStart; + if (len == 0) continue; + addSpoilersInternal(v, spannable, textLayout, start, end, l, t, r, b, realStart, realEnd, spoilersPool, spoilers); + } + } + } + if (v instanceof TextView && spoilersPool != null) { + spoilersPool.clear(); + } + } + + @SuppressLint("WrongConstant") + private static void addSpoilersInternal(View v, Spannable spannable, Layout textLayout, int lineStart, + int lineEnd, float lineLeft, float lineTop, float lineRight, + float lineBottom, int realStart, int realEnd, Stack spoilersPool, + List spoilers) { + SpannableStringBuilder vSpan = SpannableStringBuilder.valueOf(AndroidUtilities.replaceNewLines(new SpannableStringBuilder(spannable, realStart, realEnd))); + for (TextStyleSpan styleSpan : vSpan.getSpans(0, vSpan.length(), TextStyleSpan.class)) + vSpan.removeSpan(styleSpan); + for (URLSpan urlSpan : vSpan.getSpans(0, vSpan.length(), URLSpan.class)) + vSpan.removeSpan(urlSpan); + int tLen = vSpan.toString().trim().length(); + if (tLen == 0) return; + int width = textLayout.getEllipsizedWidth() > 0 ? textLayout.getEllipsizedWidth() : textLayout.getWidth(); + TextPaint measurePaint = new TextPaint(textLayout.getPaint()); + measurePaint.setColor(Color.BLACK); + StaticLayout newLayout; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + newLayout = StaticLayout.Builder.obtain(vSpan, 0, vSpan.length(), measurePaint, width) + .setBreakStrategy(StaticLayout.BREAK_STRATEGY_HIGH_QUALITY) + .setHyphenationFrequency(StaticLayout.HYPHENATION_FREQUENCY_NONE) + .setAlignment(Layout.Alignment.ALIGN_NORMAL) + .setLineSpacing(textLayout.getSpacingAdd(), textLayout.getSpacingMultiplier()) + .build(); + } else + newLayout = new StaticLayout(vSpan, measurePaint, width, Layout.Alignment.ALIGN_NORMAL, textLayout.getSpacingMultiplier(), textLayout.getSpacingAdd(), false); + boolean rtlInNonRTL = (LocaleController.isRTLCharacter(vSpan.charAt(0)) || LocaleController.isRTLCharacter(vSpan.charAt(vSpan.length() - 1))) && !LocaleController.isRTL; + SpoilerEffect spoilerEffect = spoilersPool == null || spoilersPool.isEmpty() ? new SpoilerEffect() : spoilersPool.remove(0); + spoilerEffect.setRippleProgress(-1); + float ps = realStart == lineStart ? lineLeft : textLayout.getPrimaryHorizontal(realStart), + pe = realEnd == lineEnd || rtlInNonRTL && realEnd == lineEnd - 1 && spannable.charAt(lineEnd - 1) == '\u2026' ? lineRight : textLayout.getPrimaryHorizontal(realEnd); + spoilerEffect.setBounds((int) Math.min(ps, pe), (int) lineTop, (int) Math.max(ps, pe), (int) lineBottom); + spoilerEffect.setColor(textLayout.getPaint().getColor()); + spoilerEffect.setRippleInterpolator(Easings.easeInQuad); + if (!spoilerEffect.isLowDevice) + spoilerEffect.setKeyPoints(SpoilerEffect.measureKeyPoints(newLayout)); + spoilerEffect.updateMaxParticles(); + if (v != null) { + spoilerEffect.setParentView(v); + } + spoilerEffect.spaces.clear(); + for (int i = 0; i < vSpan.length(); i++) { + if (vSpan.charAt(i) == ' ') { + RectF r = new RectF(); + int off = realStart + i; + int line = textLayout.getLineForOffset(off); + r.top = textLayout.getLineTop(line); + r.bottom = textLayout.getLineBottom(line); + float lh = textLayout.getPrimaryHorizontal(off), rh = textLayout.getPrimaryHorizontal(off + 1); + r.left = (int) Math.min(lh, rh); // RTL + r.right = (int) Math.max(lh, rh); + if (Math.abs(lh - rh) <= AndroidUtilities.dp(20)) { + spoilerEffect.spaces.add(r); + } + } + } + spoilers.add(spoilerEffect); + } + + /** + * Clips out spoilers from canvas + */ + public static void clipOutCanvas(Canvas canvas, List spoilers) { + tempPath.rewind(); + for (SpoilerEffect eff : spoilers) { + Rect b = eff.getBounds(); + tempPath.addRect(b.left, b.top, b.right, b.bottom, Path.Direction.CW); + } + canvas.clipPath(tempPath, Region.Op.DIFFERENCE); + } + + /** + * Optimized version of text layout double-render + * + * @param v View to use as a parent view + * @param invalidateSpoilersParent Set to invalidate parent or not + * @param spoilersColor Spoilers' color + * @param verticalOffset Additional vertical offset + * @param patchedLayoutRef Patched layout reference + * @param textLayout Layout to render + * @param spoilers Spoilers list to render + * @param canvas Canvas to render + */ + @SuppressLint("WrongConstant") + @MainThread + public static void renderWithRipple(View v, boolean invalidateSpoilersParent, int spoilersColor, int verticalOffset, AtomicReference patchedLayoutRef, Layout textLayout, List spoilers, Canvas canvas) { + if (spoilers.isEmpty()) { + textLayout.draw(canvas); + } + Layout pl = patchedLayoutRef.get(); + + if (pl == null || !textLayout.getText().toString().equals(pl.getText().toString()) || textLayout.getWidth() != pl.getWidth() || textLayout.getHeight() != pl.getHeight()) { + SpannableStringBuilder sb = new SpannableStringBuilder(textLayout.getText()); + Spannable sp = (Spannable) textLayout.getText(); + for (TextStyleSpan ss : sp.getSpans(0, sp.length(), TextStyleSpan.class)) { + if (ss.isSpoiler()) { + int start = sp.getSpanStart(ss), end = sp.getSpanEnd(ss); + for (Emoji.EmojiSpan e : sp.getSpans(start, end, Emoji.EmojiSpan.class)) { + sb.setSpan(new ReplacementSpan() { + @Override + public int getSize(@NonNull Paint paint, CharSequence text, int start, int end, @Nullable Paint.FontMetricsInt fm) { + return e.getSize(paint, text, start, end, fm); + } + + @Override + public void draw(@NonNull Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, @NonNull Paint paint) { + } + }, start, end, sp.getSpanFlags(ss)); + sb.removeSpan(e); + } + + sb.setSpan(new ForegroundColorSpan(Color.TRANSPARENT), sp.getSpanStart(ss), sp.getSpanEnd(ss), sp.getSpanFlags(ss)); + sb.removeSpan(ss); + } + } + + Layout layout; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + layout = StaticLayout.Builder.obtain(sb, 0, sb.length(), textLayout.getPaint(), textLayout.getWidth()) + .setBreakStrategy(StaticLayout.BREAK_STRATEGY_HIGH_QUALITY) + .setHyphenationFrequency(StaticLayout.HYPHENATION_FREQUENCY_NONE) + .setAlignment(Layout.Alignment.ALIGN_NORMAL) + .setLineSpacing(textLayout.getSpacingAdd(), textLayout.getSpacingMultiplier()) + .build(); + } else + layout = new StaticLayout(sb, textLayout.getPaint(), textLayout.getWidth(), textLayout.getAlignment(), textLayout.getSpacingMultiplier(), textLayout.getSpacingAdd(), false); + patchedLayoutRef.set(pl = layout); + } + + if (!spoilers.isEmpty()) { + canvas.save(); + canvas.translate(0, verticalOffset); + pl.draw(canvas); + canvas.restore(); + } else { + textLayout.draw(canvas); + } + + if (!spoilers.isEmpty()) { + tempPath.rewind(); + for (SpoilerEffect eff : spoilers) { + Rect b = eff.getBounds(); + tempPath.addRect(b.left, b.top, b.right, b.bottom, Path.Direction.CW); + } + if (!spoilers.isEmpty() && spoilers.get(0).rippleProgress != -1) { + canvas.save(); + canvas.clipPath(tempPath); + tempPath.rewind(); + if (!spoilers.isEmpty()) { + spoilers.get(0).getRipplePath(tempPath); + } + canvas.clipPath(tempPath); + canvas.translate(0, -v.getPaddingTop()); + textLayout.draw(canvas); + canvas.restore(); + } + + + boolean useAlphaLayer = spoilers.get(0).rippleProgress != -1; + if (useAlphaLayer) { + canvas.saveLayer(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight(), null, canvas.ALL_SAVE_FLAG); + } else { + canvas.save(); + } + canvas.translate(0, -v.getPaddingTop()); + for (SpoilerEffect eff : spoilers) { + eff.setInvalidateParent(invalidateSpoilersParent); + if (eff.getParentView() != v) eff.setParentView(v); + if (eff.shouldInvalidateColor()) { + eff.setColor(ColorUtils.blendARGB(spoilersColor, Theme.chat_msgTextPaint.getColor(), Math.max(0, eff.getRippleProgress()))); + } else { + eff.setColor(spoilersColor); + } + eff.draw(canvas); + } + + if (useAlphaLayer) { + tempPath.rewind(); + spoilers.get(0).getRipplePath(tempPath); + if (xRefPaint == null) { + xRefPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + xRefPaint.setColor(0xff000000); + xRefPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); + } + canvas.drawPath(tempPath, xRefPaint); + } + canvas.restore(); + } + } + + private static class Particle { + private float x, y; + private float vecX, vecY; + private float velocity; + private float lifeTime, currentTime; + private int alpha; + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilerEffectBitmapFactory.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilerEffectBitmapFactory.java new file mode 100644 index 000000000..6a5ae2f15 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilerEffectBitmapFactory.java @@ -0,0 +1,120 @@ +package org.telegram.ui.Components.spoilers; + +import android.graphics.Bitmap; +import android.graphics.BitmapShader; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.Shader; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.DispatchQueue; +import org.telegram.messenger.SharedConfig; + +import java.util.ArrayList; + +public class SpoilerEffectBitmapFactory { + + private static SpoilerEffectBitmapFactory factory; + + public static SpoilerEffectBitmapFactory getInstance() { + if (factory == null) { + factory = new SpoilerEffectBitmapFactory(); + } + return factory; + } + + final DispatchQueue dispatchQueue = new DispatchQueue("SpoilerEffectBitmapFactory"); + private Bitmap shaderBitmap; + Bitmap bufferBitmap; + Bitmap backgroundBitmap; + Canvas shaderCanvas; + Paint shaderPaint; + long lastUpdateTime; + ArrayList shaderSpoilerEffects; + boolean isRunning; + Matrix localMatrix = new Matrix(); + int size; + + private SpoilerEffectBitmapFactory() { + int maxSize = SharedConfig.getDevicePerformanceClass() == SharedConfig.PERFORMANCE_CLASS_HIGH ? AndroidUtilities.dp(200) : AndroidUtilities.dp(150); + size = (int) Math.min(Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) * 0.5f, maxSize); + if (size < AndroidUtilities.dp(100)) { + size = AndroidUtilities.dp(100); + } + } + + + Paint getPaint() { + if (shaderBitmap == null) { + shaderBitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); + shaderCanvas = new Canvas(shaderBitmap); + shaderPaint = new Paint(); + shaderSpoilerEffects = new ArrayList<>(10 * 10); + shaderPaint.setShader(new BitmapShader(shaderBitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT)); + int step = (int) (size / 10f); + int particleCount = (int) (60 * (size / (float) AndroidUtilities.dp(200))); + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + SpoilerEffect shaderSpoilerEffect = new SpoilerEffect(); + shaderSpoilerEffect.setBounds(step * i, step * j - AndroidUtilities.dp(5), step * i + step + AndroidUtilities.dp(3), step * j + step + AndroidUtilities.dp(5)); + shaderSpoilerEffect.drawPoints = true; + shaderSpoilerEffect.particlePoints = new float[SpoilerEffect.ALPHAS.length][particleCount * 2]; + shaderSpoilerEffect.setMaxParticlesCount(particleCount); + shaderSpoilerEffect.setColor(Color.WHITE); + shaderSpoilerEffects.add(shaderSpoilerEffect); + } + } + + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + shaderSpoilerEffects.get(j + i * 10).draw(shaderCanvas); + } + } + shaderPaint.setShader(new BitmapShader(shaderBitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT)); + lastUpdateTime = System.currentTimeMillis(); + } + + return shaderPaint; + } + + public void checkUpdate() { + long time = System.currentTimeMillis(); + if (time - lastUpdateTime > 32 && !isRunning) { + lastUpdateTime = System.currentTimeMillis(); + isRunning = true; + Bitmap bufferBitmapFinall = bufferBitmap; + dispatchQueue.postRunnable(() -> { + Bitmap bitmap = bufferBitmapFinall; + if (bitmap == null) { + bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); + } + if (backgroundBitmap == null) { + backgroundBitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); + } else { + backgroundBitmap.eraseColor(Color.TRANSPARENT); + } + Canvas shaderCanvas = new Canvas(bitmap); + Canvas backgroundCanvas = new Canvas(backgroundBitmap); + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + shaderSpoilerEffects.get(j + i * 10).draw(backgroundCanvas); + } + } + bitmap.eraseColor(Color.TRANSPARENT); + shaderCanvas.drawBitmap(backgroundBitmap, 0, 0, null); + Bitmap finalBitmap = bitmap; + AndroidUtilities.runOnUIThread(() -> { + bufferBitmap = shaderBitmap; + shaderBitmap = finalBitmap; + shaderPaint.setShader(new BitmapShader(shaderBitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT)); + isRunning = false; + }); + }); + } + + } + + +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersClickDetector.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersClickDetector.java new file mode 100644 index 000000000..9d9919bf4 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersClickDetector.java @@ -0,0 +1,70 @@ +package org.telegram.ui.Components.spoilers; + +import android.view.GestureDetector; +import android.view.MotionEvent; +import android.view.SoundEffectConstants; +import android.view.View; + +import androidx.core.view.GestureDetectorCompat; + +import java.util.List; + +public class SpoilersClickDetector { + private GestureDetectorCompat gestureDetector; + private boolean trackingTap; + + public SpoilersClickDetector(View v, List spoilers, OnSpoilerClickedListener clickedListener) { + this(v, spoilers, true, clickedListener); + } + + public SpoilersClickDetector(View v, List spoilers, boolean offsetPadding, OnSpoilerClickedListener clickedListener) { + gestureDetector = new GestureDetectorCompat(v.getContext(), new GestureDetector.SimpleOnGestureListener() { + @Override + public boolean onDown(MotionEvent e) { + int x = (int) e.getX(), y = (int) e.getY(); + y += v.getScrollY(); + if (offsetPadding) { + x -= v.getPaddingLeft(); + y -= v.getPaddingTop(); + } + for (SpoilerEffect eff : spoilers) { + if (eff.getBounds().contains(x, y)) { + trackingTap = true; + return true; + } + } + return false; + } + + @Override + public boolean onSingleTapUp(MotionEvent e) { + if (trackingTap) { + v.playSoundEffect(SoundEffectConstants.CLICK); + + trackingTap = false; + int x = (int) e.getX(), y = (int) e.getY(); + y += v.getScrollY(); + if (offsetPadding) { + x -= v.getPaddingLeft(); + y -= v.getPaddingTop(); + } + for (SpoilerEffect eff : spoilers) { + if (eff.getBounds().contains(x, y)) { + clickedListener.onSpoilerClicked(eff, x, y); + return true; + } + } + } + return false; + } + }); + } + + public boolean onTouchEvent(MotionEvent ev) { + return gestureDetector.onTouchEvent(ev); + } + + public interface OnSpoilerClickedListener { + void onSpoilerClicked(SpoilerEffect spoiler, float x, float y); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersTextView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersTextView.java new file mode 100644 index 000000000..7e4d4328f --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersTextView.java @@ -0,0 +1,116 @@ +package org.telegram.ui.Components.spoilers; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Path; +import android.graphics.Rect; +import android.graphics.Region; +import android.text.Layout; +import android.text.Spannable; +import android.view.MotionEvent; +import android.widget.TextView; + +import org.telegram.messenger.AndroidUtilities; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + +public class SpoilersTextView extends TextView { + private SpoilersClickDetector clickDetector; + private List spoilers = new ArrayList<>(); + private Stack spoilersPool = new Stack<>(); + private boolean isSpoilersRevealed; + private Path path = new Path(); + + public SpoilersTextView(Context context) { + super(context); + + clickDetector = new SpoilersClickDetector(this, spoilers, (eff, x, y) -> { + if (isSpoilersRevealed) return; + + eff.setOnRippleEndCallback(()->post(()->{ + isSpoilersRevealed = true; + invalidateSpoilers(); + })); + + float rad = (float) Math.sqrt(Math.pow(getWidth(), 2) + Math.pow(getHeight(), 2)); + for (SpoilerEffect ef : spoilers) + ef.startRipple(x, y, rad); + }); + } + + @Override + public boolean dispatchTouchEvent(MotionEvent event) { + if (clickDetector.onTouchEvent(event)) + return true; + return super.dispatchTouchEvent(event); + } + + @Override + public void setText(CharSequence text, BufferType type) { + isSpoilersRevealed = false; + super.setText(text, type); + } + + @Override + protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) { + super.onTextChanged(text, start, lengthBefore, lengthAfter); + invalidateSpoilers(); + } + + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + invalidateSpoilers(); + } + + @Override + protected void onDraw(Canvas canvas) { + int pl = getPaddingLeft(), pt = getPaddingTop(); + + canvas.save(); + path.rewind(); + for (SpoilerEffect eff : spoilers) { + Rect bounds = eff.getBounds(); + path.addRect(bounds.left + pl, bounds.top + pt, bounds.right + pl, bounds.bottom + pt, Path.Direction.CW); + } + canvas.clipPath(path, Region.Op.DIFFERENCE); + super.onDraw(canvas); + canvas.restore(); + + canvas.save(); + canvas.clipPath(path); + path.rewind(); + if (!spoilers.isEmpty()) + spoilers.get(0).getRipplePath(path); + canvas.clipPath(path); + super.onDraw(canvas); + canvas.restore(); + + canvas.save(); + canvas.translate(getPaddingLeft(), getPaddingTop() + AndroidUtilities.dp(2)); + for (SpoilerEffect eff : spoilers) { + eff.setColor(getPaint().getColor()); + eff.draw(canvas); + } + canvas.restore(); + } + + private void invalidateSpoilers() { + if (spoilers == null) return; // Check for a super constructor + spoilersPool.addAll(spoilers); + spoilers.clear(); + + if (isSpoilersRevealed) { + invalidate(); + return; + } + + Layout layout = getLayout(); + if (layout != null && getText() instanceof Spannable) { + SpoilerEffect.addSpoilers(this, spoilersPool, spoilers); + } + invalidate(); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/voip/GroupCallRenderersContainer.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/voip/GroupCallRenderersContainer.java index fd88eead9..c3c275665 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/voip/GroupCallRenderersContainer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/voip/GroupCallRenderersContainer.java @@ -1,5 +1,8 @@ package org.telegram.ui.Components.voip; +import static org.telegram.ui.GroupCallActivity.TRANSITION_DURATION; +import static org.telegram.ui.GroupCallActivity.isLandscapeMode; + import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; @@ -42,6 +45,7 @@ import org.telegram.tgnet.TLRPC; import org.telegram.ui.ActionBar.ActionBar; import org.telegram.ui.ActionBar.BackDrawable; import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.Components.AvatarsDarawable; import org.telegram.ui.Components.AvatarsImageView; import org.telegram.ui.Components.CrossOutDrawable; import org.telegram.ui.Components.CubicBezierInterpolator; @@ -53,9 +57,6 @@ import org.telegram.ui.GroupCallActivity; import java.util.ArrayList; -import static org.telegram.ui.GroupCallActivity.TRANSITION_DURATION; -import static org.telegram.ui.GroupCallActivity.isLandscapeMode; - @SuppressLint("ViewConstructor") public class GroupCallRenderersContainer extends FrameLayout { @@ -287,7 +288,7 @@ public class GroupCallRenderersContainer extends FrameLayout { }; speakingMembersAvatars = new AvatarsImageView(context, true); - speakingMembersAvatars.setStyle(AvatarsImageView.STYLE_GROUP_CALL_TOOLTIP); + speakingMembersAvatars.setStyle(AvatarsDarawable.STYLE_GROUP_CALL_TOOLTIP); speakingMembersToast.setClipChildren(false); speakingMembersToast.setClipToPadding(false); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DefaultThemesPreviewCell.java b/TMessagesProj/src/main/java/org/telegram/ui/DefaultThemesPreviewCell.java index aa21d8c18..ca6c22aea 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DefaultThemesPreviewCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DefaultThemesPreviewCell.java @@ -112,7 +112,7 @@ public class DefaultThemesPreviewCell extends LinearLayout { } } - NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, info, true, null, accentId); + NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, info, false, null, accentId); selectedPosition = position; for (int i = 0; i < adapter.items.size(); i++) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Delegates/ChatActivityMemberRequestsDelegate.java b/TMessagesProj/src/main/java/org/telegram/ui/Delegates/ChatActivityMemberRequestsDelegate.java index 50ab37044..ff5ee7d8a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Delegates/ChatActivityMemberRequestsDelegate.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Delegates/ChatActivityMemberRequestsDelegate.java @@ -78,7 +78,7 @@ public class ChatActivityMemberRequestsDelegate { avatarsView = new AvatarsImageView(fragment.getParentActivity(), false) { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - int width = count == 0 ? 0 : (20 * (count - 1) + 24); + int width = avatarsDarawable.count == 0 ? 0 : (20 * (avatarsDarawable.count - 1) + 24); super.onMeasure(MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(width), MeasureSpec.EXACTLY), heightMeasureSpec); } }; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java index 46b75aef3..4016c33ee 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java @@ -77,8 +77,6 @@ import androidx.recyclerview.widget.LinearSmoothScrollerCustom; import androidx.recyclerview.widget.RecyclerView; import androidx.viewpager.widget.ViewPager; -import com.google.android.exoplayer2.util.Log; - import org.telegram.messenger.AccountInstance; import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.ApplicationLoader; @@ -166,6 +164,7 @@ import org.telegram.ui.Components.RLottieDrawable; import org.telegram.ui.Components.RLottieImageView; import org.telegram.ui.Components.RadialProgress2; import org.telegram.ui.Components.RecyclerAnimationScrollHelper; +import org.telegram.ui.Components.RecyclerItemsEnterAnimator; import org.telegram.ui.Components.RecyclerListView; import org.telegram.ui.Components.SearchViewPager; import org.telegram.ui.Components.SizeNotifierFrameLayout; @@ -173,7 +172,6 @@ import org.telegram.ui.Components.StickersAlert; import org.telegram.ui.Components.SwipeGestureSettingsView; import org.telegram.ui.Components.UndoView; import org.telegram.ui.Components.ViewPagerFixed; -import org.telegram.ui.Components.RecyclerItemsEnterAnimator; import java.io.File; import java.util.ArrayList; @@ -1856,6 +1854,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter. accountInstance.getMediaDataController().loadRecents(MediaDataController.TYPE_FAVE, false, true, false); accountInstance.getMediaDataController().loadRecents(MediaDataController.TYPE_GREETINGS, false, true, false); accountInstance.getMediaDataController().checkFeaturedStickers(); + accountInstance.getMediaDataController().checkReactions(); for (String emoji : messagesController.diceEmojies) { accountInstance.getMediaDataController().loadStickersByEmojiOrName(emoji, true, true); } @@ -2524,6 +2523,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter. viewPage.addView(viewPage.progressView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); viewPage.listView = new DialogsRecyclerView(context, viewPage); + viewPage.listView.setAccessibilityEnabled(false); viewPage.listView.setAnimateEmptyView(true, 0); viewPage.listView.setClipToPadding(false); viewPage.listView.setPivotY(0); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/EmojiAnimationsOverlay.java b/TMessagesProj/src/main/java/org/telegram/ui/EmojiAnimationsOverlay.java index af4e55505..c70b3c8a1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/EmojiAnimationsOverlay.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/EmojiAnimationsOverlay.java @@ -1,7 +1,6 @@ package org.telegram.ui; import android.graphics.Canvas; -import android.util.Log; import android.view.HapticFeedbackConstants; import android.view.View; import android.widget.FrameLayout; @@ -10,7 +9,6 @@ import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.telegram.messenger.AndroidUtilities; -import org.telegram.messenger.Emoji; import org.telegram.messenger.EmojiData; import org.telegram.messenger.FileLog; import org.telegram.messenger.ImageLocation; @@ -26,7 +24,6 @@ import org.telegram.tgnet.ConnectionsManager; import org.telegram.tgnet.TLRPC; import org.telegram.ui.Cells.ChatMessageCell; import org.telegram.ui.Components.Bulletin; -import org.telegram.ui.Components.BulletinFactory; import org.telegram.ui.Components.RecyclerListView; import org.telegram.ui.Components.StickerSetBulletinLayout; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java index 404237bcb..747e0238a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java @@ -8,29 +8,44 @@ package org.telegram.ui; +import android.animation.ValueAnimator; import android.content.Context; import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.Configuration; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.FrameLayout; +import android.widget.LinearLayout; import android.widget.TextView; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.FileLog; +import org.telegram.messenger.LanguageDetector; import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MessagesController; import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.Utilities; -import org.telegram.ui.ActionBar.AlertDialog; -import org.telegram.ui.ActionBar.Theme; -import org.telegram.ui.ActionBar.ThemeDescription; -import org.telegram.ui.Cells.LanguageCell; import org.telegram.ui.ActionBar.ActionBar; import org.telegram.ui.ActionBar.ActionBarMenu; import org.telegram.ui.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.AlertDialog; import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.ActionBar.ThemeDescription; +import org.telegram.ui.Cells.HeaderCell; +import org.telegram.ui.Cells.LanguageCell; import org.telegram.ui.Cells.ShadowSectionCell; +import org.telegram.ui.Cells.TextCheckCell; +import org.telegram.ui.Cells.TextInfoPrivacyCell; +import org.telegram.ui.Cells.TextRadioCell; +import org.telegram.ui.Cells.TextSettingsCell; +import org.telegram.ui.Components.CubicBezierInterpolator; import org.telegram.ui.Components.EmptyTextProgressView; import org.telegram.ui.Components.LayoutHelper; import org.telegram.ui.Components.RecyclerListView; @@ -38,11 +53,8 @@ import org.telegram.ui.Components.RecyclerListView; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.HashSet; import java.util.Timer; -import java.util.TimerTask; - -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; public class LanguageSelectActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { @@ -118,6 +130,13 @@ public class LanguageSelectActivity extends BaseFragment implements Notification if (listView != null) { listView.setAdapter(searchListViewAdapter); } + } else { + searching = false; + searchWas = false; + if (listView != null) { + emptyView.setVisibility(View.GONE); + listView.setAdapter(listAdapter); + } } } }); @@ -144,51 +163,98 @@ public class LanguageSelectActivity extends BaseFragment implements Notification frameLayout.addView(listView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); listView.setOnItemClickListener((view, position) -> { - if (getParentActivity() == null || parentLayout == null || !(view instanceof LanguageCell)) { - return; + try { + if (getParentActivity() == null || parentLayout == null || !(view instanceof TextRadioCell)) { + return; + } + boolean search = listView.getAdapter() == searchListViewAdapter; + if (!search) + position -= 2; + LocaleController.LocaleInfo localeInfo; + if (search) { + localeInfo = searchResult.get(position); + } else if (!unofficialLanguages.isEmpty() && position >= 0 && position < unofficialLanguages.size()) { + localeInfo = unofficialLanguages.get(position); + } else { + if (!unofficialLanguages.isEmpty()) { + position -= unofficialLanguages.size() + 1; + } + localeInfo = sortedLanguages.get(position); + } + if (localeInfo != null) { + LocaleController.LocaleInfo prevLocale = LocaleController.getInstance().getCurrentLocaleInfo(); + LocaleController.getInstance().applyLanguage(localeInfo, true, false, false, true, currentAccount); + parentLayout.rebuildAllFragmentViews(false, false); + + String langCode = localeInfo.pluralLangCode, + prevLangCode = prevLocale.pluralLangCode; + SharedPreferences preferences = MessagesController.getGlobalMainSettings(); + HashSet selectedLanguages = RestrictedLanguagesSelectActivity.getRestrictedLanguages(); + HashSet newSelectedLanguages = new HashSet(selectedLanguages); + + if (selectedLanguages.contains(langCode)) { + newSelectedLanguages.removeIf(s -> s != null && s.equals(langCode)); + if (!selectedLanguages.contains(prevLangCode)) + newSelectedLanguages.add(prevLangCode); + } + preferences.edit().putStringSet("translate_button_restricted_languages", newSelectedLanguages).apply(); + + finishFragment(); + } + } catch (Exception e) { + FileLog.e(e); } - LanguageCell cell = (LanguageCell) view; - LocaleController.LocaleInfo localeInfo = cell.getCurrentLocale(); - if (localeInfo != null) { - LocaleController.getInstance().applyLanguage(localeInfo, true, false, false, true, currentAccount); - parentLayout.rebuildAllFragmentViews(false, false); - } - finishFragment(); }); listView.setOnItemLongClickListener((view, position) -> { - if (getParentActivity() == null || parentLayout == null || !(view instanceof LanguageCell)) { - return false; - } - LanguageCell cell = (LanguageCell) view; - LocaleController.LocaleInfo localeInfo = cell.getCurrentLocale(); - if (localeInfo == null || localeInfo.pathToFile == null || localeInfo.isRemote() && localeInfo.serverIndex != Integer.MAX_VALUE) { - return false; - } - final LocaleController.LocaleInfo finalLocaleInfo = localeInfo; - AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); - builder.setTitle(LocaleController.getString("DeleteLocalizationTitle", R.string.DeleteLocalizationTitle)); - builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("DeleteLocalizationText", R.string.DeleteLocalizationText, localeInfo.name))); - builder.setPositiveButton(LocaleController.getString("Delete", R.string.Delete), (dialogInterface, i) -> { - if (LocaleController.getInstance().deleteLanguage(finalLocaleInfo, currentAccount)) { - fillLanguages(); - if (searchResult != null) { - searchResult.remove(finalLocaleInfo); - } - if (listAdapter != null) { - listAdapter.notifyDataSetChanged(); - } - if (searchListViewAdapter != null) { - searchListViewAdapter.notifyDataSetChanged(); - } + try { + if (getParentActivity() == null || parentLayout == null || !(view instanceof TextRadioCell)) { + return false; } - }); - builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); - AlertDialog alertDialog = builder.create(); - showDialog(alertDialog); - TextView button = (TextView) alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); - if (button != null) { - button.setTextColor(Theme.getColor(Theme.key_dialogTextRed2)); + boolean search = listView.getAdapter() == searchListViewAdapter; + if (!search) + position--; + LocaleController.LocaleInfo localeInfo; + if (search) { + localeInfo = searchResult.get(position); + } else if (!unofficialLanguages.isEmpty() && position >= 0 && position < unofficialLanguages.size()) { + localeInfo = unofficialLanguages.get(position); + } else { + if (!unofficialLanguages.isEmpty()) { + position -= unofficialLanguages.size() + 1; + } + localeInfo = sortedLanguages.get(position); + } + if (localeInfo == null || localeInfo.pathToFile == null || localeInfo.isRemote() && localeInfo.serverIndex != Integer.MAX_VALUE) { + return false; + } + final LocaleController.LocaleInfo finalLocaleInfo = localeInfo; + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + builder.setTitle(LocaleController.getString("DeleteLocalizationTitle", R.string.DeleteLocalizationTitle)); + builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("DeleteLocalizationText", R.string.DeleteLocalizationText, localeInfo.name))); + builder.setPositiveButton(LocaleController.getString("Delete", R.string.Delete), (dialogInterface, i) -> { + if (LocaleController.getInstance().deleteLanguage(finalLocaleInfo, currentAccount)) { + fillLanguages(); + if (searchResult != null) { + searchResult.remove(finalLocaleInfo); + } + if (listAdapter != null) { + listAdapter.notifyDataSetChanged(); + } + if (searchListViewAdapter != null) { + searchListViewAdapter.notifyDataSetChanged(); + } + } + }); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); + AlertDialog alertDialog = builder.create(); + showDialog(alertDialog); + TextView button = (TextView) alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (button != null) { + button.setTextColor(Theme.getColor(Theme.key_dialogTextRed2)); + } + } catch (Exception e) { + FileLog.e(e); } return true; }); @@ -210,7 +276,7 @@ public class LanguageSelectActivity extends BaseFragment implements Notification if (id == NotificationCenter.suggestedLangpack) { if (listAdapter != null) { fillLanguages(); - listAdapter.notifyDataSetChanged(); + AndroidUtilities.runOnUIThread(() -> { listAdapter.notifyDataSetChanged(); }); } } } @@ -259,28 +325,33 @@ public class LanguageSelectActivity extends BaseFragment implements Notification public void search(final String query) { if (query == null) { + searching = false; searchResult = null; - } else { - try { - if (searchTimer != null) { - searchTimer.cancel(); - } - } catch (Exception e) { - FileLog.e(e); + if (listView != null) { + emptyView.setVisibility(View.GONE); + listView.setAdapter(listAdapter); } - searchTimer = new Timer(); - searchTimer.schedule(new TimerTask() { - @Override - public void run() { - try { - searchTimer.cancel(); - searchTimer = null; - } catch (Exception e) { - FileLog.e(e); - } - processSearch(query); - } - }, 100, 300); + } else { +// try { +// if (searchTimer != null) { +// searchTimer.cancel(); +// } +// } catch (Exception e) { +// FileLog.e(e); +// } +// searchTimer = new Timer(); +// searchTimer.schedule(new TimerTask() { +// @Override +// public void run() { +// try { +// searchTimer.cancel(); +// searchTimer = null; +// } catch (Exception e) { +// FileLog.e(e); +// } + processSearch(query); +// } +// }, 100, 300); } } @@ -320,6 +391,194 @@ public class LanguageSelectActivity extends BaseFragment implements Notification }); } + private class TranslateSettings extends LinearLayout { + private SharedPreferences preferences; + + private HeaderCell header; + private TextCheckCell showButtonCheck; + private TextSettingsCell doNotTranslateCell; + private TextInfoPrivacyCell info; + private TextInfoPrivacyCell info2; + private ValueAnimator doNotTranslateCellAnimation = null; +// private HeaderCell header2; + + private SharedPreferences.OnSharedPreferenceChangeListener listener; + +// private float HEIGHT_OPEN = 243; +// private float HEIGHT_CLOSED = HEIGHT_OPEN - 50; + + public TranslateSettings(Context context) { + super(context); + + setOrientation(VERTICAL); + + preferences = MessagesController.getGlobalMainSettings(); + + header = new HeaderCell(context); + header.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); + header.setText(LocaleController.getString("TranslateMessages", R.string.TranslateMessages)); + addView(header, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); + + boolean value = getValue(); + showButtonCheck = new TextCheckCell(context); + showButtonCheck.setBackground(Theme.createSelectorWithBackgroundDrawable(Theme.getColor(Theme.key_windowBackgroundWhite), Theme.getColor(Theme.key_listSelector))); + showButtonCheck.setTextAndCheck( + LocaleController.getString("ShowTranslateButton", R.string.ShowTranslateButton), + value, + value + ); + showButtonCheck.setOnClickListener(e -> { + preferences.edit().putBoolean("translate_button", !getValue()).apply(); + }); + addView(showButtonCheck, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); + + doNotTranslateCell = new TextSettingsCell(context); + doNotTranslateCell.setBackground(Theme.createSelectorWithBackgroundDrawable(Theme.getColor(Theme.key_windowBackgroundWhite), Theme.getColor(Theme.key_listSelector))); + doNotTranslateCell.setOnClickListener(e -> { + presentFragment(new RestrictedLanguagesSelectActivity()); + update(); + }); + doNotTranslateCell.setClickable(value && LanguageDetector.hasSupport()); + doNotTranslateCell.setAlpha(value && LanguageDetector.hasSupport() ? 1f : 0f); + addView(doNotTranslateCell, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); + + info = new TextInfoPrivacyCell(context); + info.setTopPadding(11); + info.setBottomPadding(16); + info.setText(LocaleController.getString("TranslateMessagesInfo1", R.string.TranslateMessagesInfo1)); + addView(info, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); + + info2 = new TextInfoPrivacyCell(context); + info2.setTopPadding(0); + info2.setBottomPadding(16); + info2.setText(LocaleController.getString("TranslateMessagesInfo2", R.string.TranslateMessagesInfo2)); + info2.setAlpha(value ? 0f : 1f); + addView(info2, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); + +// header2 = new HeaderCell(context); +// header2.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); +// header2.setText(LocaleController.getString("Language", R.string.Language)); +// header2.setTranslationY(-Math.max(doNotTranslateCell.getHeight(), info2.getHeight())); +// addView(header2, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.BOTTOM)); + +// setLayoutParams(new RecyclerView.LayoutParams(LayoutHelper.MATCH_PARENT, height())); + updateHeight(); + update(); + } + + private boolean getValue() { + return preferences.getBoolean("translate_button", false); + } + private ArrayList getRestrictedLanguages() { + String currentLang = LocaleController.getInstance().getCurrentLocaleInfo().pluralLangCode; + ArrayList langCodes = new ArrayList<>(RestrictedLanguagesSelectActivity.getRestrictedLanguages()); + if (!langCodes.contains(currentLang)) + langCodes.add(currentLang); + return langCodes; + } + + public void update() { + boolean value = getValue() && LanguageDetector.hasSupport(); + + showButtonCheck.setChecked(getValue()); + + if (doNotTranslateCellAnimation != null) { + doNotTranslateCellAnimation.cancel(); + } + + showButtonCheck.setDivider(value); + ArrayList langCodes = getRestrictedLanguages(); + String doNotTranslateCellValue = null; + if (langCodes.size() == 1) { + try { + doNotTranslateCellValue = LocaleController.getInstance().getLanguageFromDict(langCodes.get(0)).name; + } catch (Exception e) {} + } + if (doNotTranslateCellValue == null) + doNotTranslateCellValue = String.format(LocaleController.getPluralString("Languages", getRestrictedLanguages().size()), getRestrictedLanguages().size()); + doNotTranslateCell.setTextAndValue(LocaleController.getString("DoNotTranslate", R.string.DoNotTranslate), doNotTranslateCellValue, false); + doNotTranslateCell.setClickable(value); + doNotTranslateCellAnimation = ValueAnimator.ofFloat(doNotTranslateCell.getAlpha(), value ? 1f : 0f); + doNotTranslateCellAnimation.setInterpolator(CubicBezierInterpolator.DEFAULT); + doNotTranslateCellAnimation.addUpdateListener(a -> { + float t = (float) a.getAnimatedValue(); + doNotTranslateCell.setAlpha(t); + doNotTranslateCell.setTranslationY(-AndroidUtilities.dp(8) * (1f - t)); + info.setTranslationY(-doNotTranslateCell.getHeight() * (1f - t)); + info2.setAlpha(1f - t); + info2.setTranslationY(-doNotTranslateCell.getHeight() * (1f - t)); +// header2.setTranslationY(-Math.max(doNotTranslateCell.getHeight(), info2.getHeight())); + +// updateHeight(); +// header2.setTranslationY(-doNotTranslateCell.getHeight()); +// header2.setTranslationY(-doNotTranslateCell.getHeight() * (1f - t)); + +// ViewGroup.LayoutParams layoutParams = getLayoutParams(); +// layoutParams.height = AndroidUtilities.dp(HEIGHT_CLOSED + (HEIGHT_OPEN - HEIGHT_CLOSED) * t); +// setLayoutParams(layoutParams); + }); + doNotTranslateCellAnimation.setDuration((long) (Math.abs(doNotTranslateCell.getAlpha() - (value ? 1f : 0f)) * 200)); + doNotTranslateCellAnimation.start(); + +// updateHeight(); + } + + @Override + protected void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + updateHeight(); + } + + @Override + protected void onLayout(boolean changed, int l, int t, int r, int b) { + updateHeight(); + super.onLayout(changed, l, t, r, b); + } + + void updateHeight() { + int newHeight = searching ? 0 : height(); + if (getLayoutParams() == null) + setLayoutParams(new RecyclerView.LayoutParams(LayoutHelper.MATCH_PARENT, newHeight)); + else if (getLayoutParams().height != newHeight) { + RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) getLayoutParams(); + lp.height = newHeight; + setLayoutParams(lp); + } + } + int height() { + return Math.max(AndroidUtilities.dp(40), header.getMeasuredHeight()) + + Math.max(AndroidUtilities.dp(50), showButtonCheck.getMeasuredHeight()) + + Math.max(Math.max(AndroidUtilities.dp(50), doNotTranslateCell.getMeasuredHeight()), (info2.getMeasuredHeight() <= 0 ? AndroidUtilities.dp(51) : info2.getMeasuredHeight())) + + (info.getMeasuredHeight() <= 0 ? AndroidUtilities.dp(62) : info.getMeasuredHeight());/* + header2.getHeight()*/ + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + updateHeight(); + } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + update(); + preferences.registerOnSharedPreferenceChangeListener(listener = new SharedPreferences.OnSharedPreferenceChangeListener() { + @Override + public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) { + preferences = sharedPreferences; + update(); + } + }); + updateHeight(); + } + + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + preferences.unregisterOnSharedPreferenceChangeListener(listener); + } + } + private class ListAdapter extends RecyclerListView.SelectionAdapter { private Context mContext; @@ -350,7 +609,7 @@ public class LanguageSelectActivity extends BaseFragment implements Notification if (!unofficialLanguages.isEmpty()) { count += unofficialLanguages.size() + 1; } - return count; + return 2 + count; } } @@ -359,10 +618,21 @@ public class LanguageSelectActivity extends BaseFragment implements Notification View view; switch (viewType) { case 0: { - view = new LanguageCell(mContext, false); +// view = new LanguageCell(mContext, false); + view = new TextRadioCell(mContext); view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); break; } + case 2: + TranslateSettings translateSettings = new TranslateSettings(mContext); + view = translateSettings; + break; + case 3: + HeaderCell header = new HeaderCell(mContext); + header.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); + header.setText(LocaleController.getString("Language", R.string.Language)); + view = header; + break; case 1: default: { view = new ShadowSectionCell(mContext); @@ -376,7 +646,10 @@ public class LanguageSelectActivity extends BaseFragment implements Notification public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { switch (holder.getItemViewType()) { case 0: { - LanguageCell textSettingsCell = (LanguageCell) holder.itemView; + if (!search) + position -= 2; +// LanguageCell textSettingsCell = (LanguageCell) holder.itemView; + TextRadioCell textSettingsCell = (TextRadioCell) holder.itemView; LocaleController.LocaleInfo localeInfo; boolean last; if (search) { @@ -393,14 +666,16 @@ public class LanguageSelectActivity extends BaseFragment implements Notification last = position == sortedLanguages.size() - 1; } if (localeInfo.isLocal()) { - textSettingsCell.setLanguage(localeInfo, String.format("%1$s (%2$s)", localeInfo.name, LocaleController.getString("LanguageCustom", R.string.LanguageCustom)), !last); + textSettingsCell.setTextAndValueAndCheck(String.format("%1$s (%2$s)", localeInfo.name, LocaleController.getString("LanguageCustom", R.string.LanguageCustom)), localeInfo.nameEnglish, false, false, !last); } else { - textSettingsCell.setLanguage(localeInfo, null, !last); + textSettingsCell.setTextAndValueAndCheck(localeInfo.name, localeInfo.nameEnglish, false, false, !last); } - textSettingsCell.setLanguageSelected(localeInfo == LocaleController.getInstance().getCurrentLocaleInfo()); + textSettingsCell.setChecked(localeInfo == LocaleController.getInstance().getCurrentLocaleInfo()); break; } case 1: { + if (!search) + position--; ShadowSectionCell sectionCell = (ShadowSectionCell) holder.itemView; if (!unofficialLanguages.isEmpty() && position == unofficialLanguages.size()) { sectionCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow)); @@ -409,11 +684,22 @@ public class LanguageSelectActivity extends BaseFragment implements Notification } break; } + case 2: { + TranslateSettings translateSettings = (TranslateSettings) holder.itemView; + translateSettings.setVisibility(searching ? View.GONE : View.VISIBLE); + translateSettings.updateHeight(); + } } } @Override public int getItemViewType(int i) { + if (!search) + i -= 2; + if (i == -2) + return 2; + if (i == -1) + return 3; if (search) { return 0; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java index 563b5ceb8..1e66c91b8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java @@ -1740,7 +1740,7 @@ public class LocationActivity extends BaseFragment implements NotificationCenter try { googleMap.setMyLocationEnabled(true); } catch (Exception e) { - FileLog.e(e); + FileLog.e(e, false); } googleMap.getUiSettings().setMyLocationButtonEnabled(false); googleMap.getUiSettings().setZoomControlsEnabled(false); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java index 324244074..db2471992 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java @@ -701,6 +701,9 @@ public class LoginActivity extends BaseFragment { return; } if (showDoneAnimation[currentDoneType] != null) { + if (animated) { + showDoneAnimation[currentDoneType].removeAllListeners(); + } showDoneAnimation[currentDoneType].cancel(); } doneButtonVisible[currentDoneType] = show; @@ -708,7 +711,10 @@ public class LoginActivity extends BaseFragment { showDoneAnimation[currentDoneType] = new AnimatorSet(); if (show) { if (floating) { - floatingButtonContainer.setVisibility(View.VISIBLE); + if (floatingButtonContainer.getVisibility() != View.VISIBLE) { + floatingButtonContainer.setTranslationY(AndroidUtilities.dpf2(70f)); + floatingButtonContainer.setVisibility(View.VISIBLE); + } showDoneAnimation[currentDoneType].play(ObjectAnimator.ofFloat(floatingButtonContainer, View.TRANSLATION_Y, 0f)); } else { doneItem.setVisibility(View.VISIBLE); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MediaCalendarActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MediaCalendarActivity.java new file mode 100644 index 000000000..4b6d57f30 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/MediaCalendarActivity.java @@ -0,0 +1,642 @@ +package org.telegram.ui; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.text.TextPaint; +import android.util.Log; +import android.util.SparseArray; +import android.view.Gravity; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.widget.FrameLayout; + +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; +import androidx.core.graphics.ColorUtils; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.DownloadController; +import org.telegram.messenger.FileLoader; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.ImageReceiver; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MessageObject; +import org.telegram.messenger.MessagesController; +import org.telegram.messenger.R; +import org.telegram.messenger.SharedConfig; +import org.telegram.tgnet.ConnectionsManager; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.SimpleTextView; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.ActionBar.ThemeDescription; +import org.telegram.ui.Components.FlickerLoadingView; +import org.telegram.ui.Components.LayoutHelper; +import org.telegram.ui.Components.RecyclerListView; +import org.telegram.ui.Components.SharedMediaLayout; + +import java.time.DayOfWeek; +import java.time.YearMonth; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Random; + +public class MediaCalendarActivity extends BaseFragment { + + FrameLayout contentView; + + RecyclerListView listView; + LinearLayoutManager layoutManager; + TextPaint textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); + TextPaint activeTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); + TextPaint textPaint2 = new TextPaint(Paint.ANTI_ALIAS_FLAG); + + Paint blackoutPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + + private long dialogId; + private boolean loading; + private boolean checkEnterItems; + + + int startFromYear; + int startFromMonth; + int monthCount; + + CalendarAdapter adapter; + Callback callback; + + + SparseArray> messagesByYearMounth = new SparseArray<>(); + boolean endReached; + int startOffset = 0; + int lastId; + int minMontYear; + private int photosVideosTypeFilter; + private boolean isOpened; + int selectedYear; + int selectedMonth; + + public MediaCalendarActivity(Bundle args, int photosVideosTypeFilter, int selectedDate) { + super(args); + this.photosVideosTypeFilter = photosVideosTypeFilter; + + if (selectedDate != 0) { + Calendar calendar = Calendar.getInstance(); + calendar.setTimeInMillis(selectedDate * 1000L); + selectedYear = calendar.get(Calendar.YEAR); + selectedMonth = calendar.get(Calendar.MONTH); + } + } + + @Override + public boolean onFragmentCreate() { + dialogId = getArguments().getLong("dialog_id"); + return super.onFragmentCreate(); + } + + @Override + public View createView(Context context) { + textPaint.setTextSize(AndroidUtilities.dp(16)); + textPaint.setTextAlign(Paint.Align.CENTER); + + textPaint2.setTextSize(AndroidUtilities.dp(11)); + textPaint2.setTextAlign(Paint.Align.CENTER); + textPaint2.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + + activeTextPaint.setTextSize(AndroidUtilities.dp(16)); + activeTextPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + activeTextPaint.setTextAlign(Paint.Align.CENTER); + + contentView = new FrameLayout(context); + createActionBar(context); + contentView.addView(actionBar); + actionBar.setTitle(LocaleController.getString("Calendar", R.string.Calendar)); + actionBar.setCastShadows(false); + + listView = new RecyclerListView(context) { + @Override + protected void dispatchDraw(Canvas canvas) { + super.dispatchDraw(canvas); + checkEnterItems = false; + } + }; + listView.setLayoutManager(layoutManager = new LinearLayoutManager(context)); + layoutManager.setReverseLayout(true); + listView.setAdapter(adapter = new CalendarAdapter()); + listView.addOnScrollListener(new RecyclerView.OnScrollListener() { + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + super.onScrolled(recyclerView, dx, dy); + checkLoadNext(); + } + }); + + contentView.addView(listView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, 0, 0, 36, 0, 0)); + + final String[] daysOfWeek = new String[]{ + LocaleController.getString("CalendarWeekNameShortMonday", R.string.CalendarWeekNameShortMonday), + LocaleController.getString("CalendarWeekNameShortTuesday", R.string.CalendarWeekNameShortTuesday), + LocaleController.getString("CalendarWeekNameShortWednesday", R.string.CalendarWeekNameShortWednesday), + LocaleController.getString("CalendarWeekNameShortThursday", R.string.CalendarWeekNameShortThursday), + LocaleController.getString("CalendarWeekNameShortFriday", R.string.CalendarWeekNameShortFriday), + LocaleController.getString("CalendarWeekNameShortSaturday", R.string.CalendarWeekNameShortSaturday), + LocaleController.getString("CalendarWeekNameShortSunday", R.string.CalendarWeekNameShortSunday), + }; + + Drawable headerShadowDrawable = ContextCompat.getDrawable(context, R.drawable.header_shadow).mutate(); + + View calendarSignatureView = new View(context) { + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + float xStep = getMeasuredWidth() / 7f; + for (int i = 0; i < 7; i++) { + float cx = xStep * i + xStep / 2f; + float cy = (getMeasuredHeight() - AndroidUtilities.dp(2)) / 2f; + canvas.drawText(daysOfWeek[i], cx, cy + AndroidUtilities.dp(5), textPaint2); + } + headerShadowDrawable.setBounds(0, getMeasuredHeight() - AndroidUtilities.dp(3), getMeasuredWidth(), getMeasuredHeight()); + headerShadowDrawable.draw(canvas); + } + }; + + contentView.addView(calendarSignatureView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 38, 0, 0, 0, 0, 0)); + actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { + @Override + public void onItemClick(int id) { + if (id == -1) { + finishFragment(); + } + } + }); + + fragmentView = contentView; + + Calendar calendar = Calendar.getInstance(); + startFromYear = calendar.get(Calendar.YEAR); + startFromMonth = calendar.get(Calendar.MONTH); + + if (selectedYear != 0) { + monthCount = (startFromYear - selectedYear) * 12 + startFromMonth - selectedMonth + 1; + layoutManager.scrollToPositionWithOffset(monthCount - 1, AndroidUtilities.dp(120)); + } + if (monthCount < 3) { + monthCount = 3; + } + + + loadNext(); + updateColors(); + activeTextPaint.setColor(Color.WHITE); + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + return fragmentView; + } + + private void updateColors() { + actionBar.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); + activeTextPaint.setColor(Color.WHITE); + textPaint.setColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); + textPaint2.setColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); + actionBar.setTitleColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + actionBar.setItemsColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText), false); + actionBar.setItemsBackgroundColor(Theme.getColor(Theme.key_listSelector), false); + } + + private void loadNext() { + if (loading || endReached) { + return; + } + loading = true; + TLRPC.TL_messages_getSearchResultsCalendar req = new TLRPC.TL_messages_getSearchResultsCalendar(); + if (photosVideosTypeFilter == SharedMediaLayout.FILTER_PHOTOS_ONLY) { + req.filter = new TLRPC.TL_inputMessagesFilterPhotos(); + } else if (photosVideosTypeFilter == SharedMediaLayout.FILTER_VIDEOS_ONLY) { + req.filter = new TLRPC.TL_inputMessagesFilterVideo(); + } else { + req.filter = new TLRPC.TL_inputMessagesFilterPhotoVideo(); + } + + req.peer = MessagesController.getInstance(currentAccount).getInputPeer(dialogId); + req.offset_id = lastId; + + Calendar calendar = Calendar.getInstance(); + listView.setItemAnimator(null); + getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> { + if (error == null) { + TLRPC.TL_messages_searchResultsCalendar res = (TLRPC.TL_messages_searchResultsCalendar) response; + + for (int i = 0; i < res.periods.size(); i++) { + TLRPC.TL_searchResultsCalendarPeriod period = res.periods.get(i); + calendar.setTimeInMillis(period.date * 1000L); + int month = calendar.get(Calendar.YEAR) * 100 + calendar.get(Calendar.MONTH); + SparseArray messagesByDays = messagesByYearMounth.get(month); + if (messagesByDays == null) { + messagesByDays = new SparseArray<>(); + messagesByYearMounth.put(month, messagesByDays); + } + PeriodDay periodDay = new PeriodDay(); + MessageObject messageObject = new MessageObject(currentAccount, res.messages.get(i), false, false); + periodDay.messageObject = messageObject; + startOffset += res.periods.get(i).count; + periodDay.startOffset = startOffset; + int index = calendar.get(Calendar.DAY_OF_MONTH) - 1; + if (messagesByDays.get(index, null) == null) { + messagesByDays.put(index, periodDay); + } + if (month < minMontYear || minMontYear == 0) { + minMontYear = month; + } + + } + + loading = false; + if (!res.messages.isEmpty()) { + lastId = res.messages.get(res.messages.size() - 1).id; + endReached = false; + checkLoadNext(); + } else { + endReached = true; + } + if (isOpened) { + checkEnterItems = true; + } + listView.invalidate(); + int newMonthCount = (int) (((calendar.getTimeInMillis() / 1000) - res.min_date) / 2629800) + 1; + adapter.notifyItemRangeChanged(0, monthCount); + if (newMonthCount > monthCount) { + adapter.notifyItemRangeInserted(monthCount + 1, newMonthCount); + monthCount = newMonthCount; + } + if (endReached) { + resumeDelayedFragmentAnimation(); + } + } + })); + } + + private void checkLoadNext() { + if (loading || endReached) { + return; + } + int listMinMonth = Integer.MAX_VALUE; + for (int i = 0; i < listView.getChildCount(); i++) { + View child = listView.getChildAt(i); + if (child instanceof MonthView) { + int currentMonth = ((MonthView) child).currentYear * 100 + ((MonthView) child).currentMonthInYear; + if (currentMonth < listMinMonth) { + listMinMonth = currentMonth; + } + } + }; + int min1 = (minMontYear / 100 * 12) + minMontYear % 100; + int min2 = (listMinMonth / 100 * 12) + listMinMonth % 100; + if (min1 + 3 >= min2) { + loadNext(); + } + } + + private class CalendarAdapter extends RecyclerView.Adapter { + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new RecyclerListView.Holder(new MonthView(parent.getContext())); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + MonthView monthView = (MonthView) holder.itemView; + + int year = startFromYear - position / 12; + int month = startFromMonth - position % 12; + if (month < 0) { + month += 12; + year--; + } + boolean animated = monthView.currentYear == year && monthView.currentMonthInYear == month; + monthView.setDate(year, month, messagesByYearMounth.get(year * 100 + month), animated); + } + + @Override + public long getItemId(int position) { + int year = startFromYear - position / 12; + int month = startFromMonth - position % 12; + return year * 100L + month; + } + + @Override + public int getItemCount() { + return monthCount; + } + } + + private class MonthView extends FrameLayout { + + SimpleTextView titleView; + int currentYear; + int currentMonthInYear; + int daysInMonth; + int startDayOfWeek; + int cellCount; + int startMonthTime; + + SparseArray messagesByDays = new SparseArray<>(); + SparseArray imagesByDays = new SparseArray<>(); + + SparseArray animatedFromMessagesByDays = new SparseArray<>(); + SparseArray animatedFromImagesByDays = new SparseArray<>(); + + boolean attached; + float animationProgress = 1f; + + public MonthView(Context context) { + super(context); + setWillNotDraw(false); + titleView = new SimpleTextView(context); + titleView.setTextSize(15); + titleView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + titleView.setGravity(Gravity.CENTER); + titleView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); + addView(titleView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 28, 0, 0, 12, 0, 4)); + } + + public void setDate(int year, int monthInYear, SparseArray messagesByDays, boolean animated) { + boolean dateChanged = year != currentYear && monthInYear != currentMonthInYear; + currentYear = year; + currentMonthInYear = monthInYear; + this.messagesByDays = messagesByDays; + + if (dateChanged) { + if (imagesByDays != null) { + for (int i = 0; i < imagesByDays.size(); i++) { + imagesByDays.valueAt(i).onDetachedFromWindow(); + imagesByDays.valueAt(i).setParentView(null); + } + imagesByDays = null; + } + } + if (messagesByDays != null) { + if (imagesByDays == null) { + imagesByDays = new SparseArray<>(); + } + + for (int i = 0; i < messagesByDays.size(); i++) { + int key = messagesByDays.keyAt(i); + if (imagesByDays.get(key, null) != null) { + continue; + } + ImageReceiver receiver = new ImageReceiver(); + receiver.setParentView(this); + PeriodDay periodDay = messagesByDays.get(key); + MessageObject messageObject = periodDay.messageObject; + if (messageObject != null) { + if (messageObject.isVideo()) { + TLRPC.Document document = messageObject.getDocument(); + TLRPC.PhotoSize thumb = FileLoader.getClosestPhotoSizeWithSize(document.thumbs, 50); + TLRPC.PhotoSize qualityThumb = FileLoader.getClosestPhotoSizeWithSize(document.thumbs, 320); + if (thumb == qualityThumb) { + qualityThumb = null; + } + if (thumb != null) { + if (messageObject.strippedThumb != null) { + receiver.setImage(ImageLocation.getForDocument(qualityThumb, document), "44_44", messageObject.strippedThumb, null, messageObject, 0); + } else { + receiver.setImage(ImageLocation.getForDocument(qualityThumb, document), "44_44", ImageLocation.getForDocument(thumb, document), "b", (String) null, messageObject, 0); + } + } + } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaPhoto && messageObject.messageOwner.media.photo != null && !messageObject.photoThumbs.isEmpty()) { + TLRPC.PhotoSize currentPhotoObjectThumb = FileLoader.getClosestPhotoSizeWithSize(messageObject.photoThumbs, 50); + TLRPC.PhotoSize currentPhotoObject = FileLoader.getClosestPhotoSizeWithSize(messageObject.photoThumbs, 320, false, currentPhotoObjectThumb, false); + if (messageObject.mediaExists || DownloadController.getInstance(currentAccount).canDownloadMedia(messageObject)) { + if (currentPhotoObject == currentPhotoObjectThumb) { + currentPhotoObjectThumb = null; + } + if (messageObject.strippedThumb != null) { + receiver.setImage(ImageLocation.getForObject(currentPhotoObject, messageObject.photoThumbsObject), "44_44", null, null, messageObject.strippedThumb, currentPhotoObject != null ? currentPhotoObject.size : 0, null, messageObject, messageObject.shouldEncryptPhotoOrVideo() ? 2 : 1); + } else { + receiver.setImage(ImageLocation.getForObject(currentPhotoObject, messageObject.photoThumbsObject), "44_44", ImageLocation.getForObject(currentPhotoObjectThumb, messageObject.photoThumbsObject), "b", currentPhotoObject != null ? currentPhotoObject.size : 0, null, messageObject, messageObject.shouldEncryptPhotoOrVideo() ? 2 : 1); + } + } else { + if (messageObject.strippedThumb != null) { + receiver.setImage(null, null, messageObject.strippedThumb, null, messageObject, 0); + } else { + receiver.setImage(null, null, ImageLocation.getForObject(currentPhotoObjectThumb, messageObject.photoThumbsObject), "b", (String) null, messageObject, 0); + } + } + } + receiver.setRoundRadius(AndroidUtilities.dp(22)); + imagesByDays.put(key, receiver); + } + } + } + + YearMonth yearMonthObject = YearMonth.of(year, monthInYear + 1); + daysInMonth = yearMonthObject.lengthOfMonth(); + + Calendar calendar = Calendar.getInstance(); + calendar.set(year, monthInYear, 0); + startDayOfWeek = (calendar.get(Calendar.DAY_OF_WEEK) + 6) % 7; + startMonthTime= (int) (calendar.getTimeInMillis() / 1000L); + + int totalColumns = daysInMonth + startDayOfWeek; + cellCount = (int) (totalColumns / 7f) + (totalColumns % 7 == 0 ? 0 : 1); + calendar.set(year, monthInYear + 1, 0); + titleView.setText(LocaleController.formatYearMont(calendar.getTimeInMillis() / 1000, true)); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(cellCount * (44 + 8) + 44), MeasureSpec.EXACTLY)); + } + + boolean pressed; + float pressedX; + float pressedY; + + @Override + public boolean onTouchEvent(MotionEvent event) { + if (event.getAction() == MotionEvent.ACTION_DOWN) { + pressed = true; + pressedX = event.getX(); + pressedY = event.getY(); + } else if (event.getAction() == MotionEvent.ACTION_UP) { + if (pressed) { + for (int i = 0; i < imagesByDays.size(); i++) { + if (imagesByDays.valueAt(i).getDrawRegion().contains(pressedX, pressedY)) { + if (callback != null) { + PeriodDay periodDay = messagesByDays.valueAt(i); + callback.onDateSelected(periodDay.messageObject.getId(), periodDay.startOffset); + finishFragment(); + break; + } + } + } + } + pressed = false; + } else if (event.getAction() == MotionEvent.ACTION_CANCEL) { + pressed = false; + } + return pressed; + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + + int currentCell = 0; + int currentColumn = startDayOfWeek; + + float xStep = getMeasuredWidth() / 7f; + float yStep = AndroidUtilities.dp(44 + 8); + for (int i = 0; i < daysInMonth; i++) { + float cx = xStep * currentColumn + xStep / 2f; + float cy = yStep * currentCell + yStep / 2f + AndroidUtilities.dp(44); + int nowTime = (int) (System.currentTimeMillis() / 1000L); + if (nowTime < startMonthTime + (i + 1) * 86400) { + int oldAlpha = textPaint.getAlpha(); + textPaint.setAlpha((int) (oldAlpha * 0.3f)); + canvas.drawText(Integer.toString(i + 1), cx, cy + AndroidUtilities.dp(5), textPaint); + textPaint.setAlpha(oldAlpha); + } else if (messagesByDays != null && messagesByDays.get(i, null) != null) { + float alpha = 1f; + if (imagesByDays.get(i) != null) { + if (checkEnterItems && !messagesByDays.get(i).wasDrawn) { + messagesByDays.get(i).enterAlpha = 0f; + messagesByDays.get(i).startEnterDelay = (cy + getY()) / listView.getMeasuredHeight() * 150; + } + if (messagesByDays.get(i).startEnterDelay > 0) { + messagesByDays.get(i).startEnterDelay -= 16; + if (messagesByDays.get(i).startEnterDelay < 0) { + messagesByDays.get(i).startEnterDelay = 0; + } else { + invalidate(); + } + } + if (messagesByDays.get(i).startEnterDelay == 0 && messagesByDays.get(i).enterAlpha != 1f) { + messagesByDays.get(i).enterAlpha += 16 / 220f; + if (messagesByDays.get(i).enterAlpha > 1f) { + messagesByDays.get(i).enterAlpha = 1f; + } else { + invalidate(); + } + } + alpha = messagesByDays.get(i).enterAlpha; + if (alpha != 1f) { + canvas.save(); + float s = 0.8f + 0.2f * alpha; + canvas.scale(s, s,cx, cy); + } + imagesByDays.get(i).setAlpha(messagesByDays.get(i).enterAlpha); + imagesByDays.get(i).setImageCoords(cx - AndroidUtilities.dp(44) / 2f, cy - AndroidUtilities.dp(44) / 2f, AndroidUtilities.dp(44), AndroidUtilities.dp(44)); + imagesByDays.get(i).draw(canvas); + blackoutPaint.setColor(ColorUtils.setAlphaComponent(Color.BLACK, (int) (messagesByDays.get(i).enterAlpha * 80))); + canvas.drawCircle(cx, cy, AndroidUtilities.dp(44) / 2f, blackoutPaint); + messagesByDays.get(i).wasDrawn = true; + if (alpha != 1f) { + canvas.restore(); + } + } + if (alpha != 1f) { + int oldAlpha = textPaint.getAlpha(); + textPaint.setAlpha((int) (oldAlpha * (1f - alpha))); + canvas.drawText(Integer.toString(i + 1), cx, cy + AndroidUtilities.dp(5), textPaint); + textPaint.setAlpha(oldAlpha); + + oldAlpha = textPaint.getAlpha(); + activeTextPaint.setAlpha((int) (oldAlpha * alpha)); + canvas.drawText(Integer.toString(i + 1), cx, cy + AndroidUtilities.dp(5), activeTextPaint); + activeTextPaint.setAlpha(oldAlpha); + } else { + canvas.drawText(Integer.toString(i + 1), cx, cy + AndroidUtilities.dp(5), activeTextPaint); + } + + } else { + canvas.drawText(Integer.toString(i + 1), cx, cy + AndroidUtilities.dp(5), textPaint); + } + + currentColumn++; + if (currentColumn >= 7) { + currentColumn = 0; + currentCell++; + } + } + } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + attached = true; + if (imagesByDays != null) { + for (int i = 0; i < imagesByDays.size(); i++) { + imagesByDays.valueAt(i).onAttachedToWindow(); + } + } + } + + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + attached = false; + if (imagesByDays != null) { + for (int i = 0; i < imagesByDays.size(); i++) { + imagesByDays.valueAt(i).onDetachedFromWindow(); + } + } + } + } + + public void setCallback(Callback callback) { + this.callback = callback; + } + + public interface Callback { + void onDateSelected(int messageId, int startOffset); + } + + private class PeriodDay { + MessageObject messageObject; + int startOffset; + float enterAlpha = 1f; + float startEnterDelay = 1f; + boolean wasDrawn; + } + + @Override + public ArrayList getThemeDescriptions() { + + ThemeDescription.ThemeDescriptionDelegate descriptionDelegate = new ThemeDescription.ThemeDescriptionDelegate() { + @Override + public void didSetColor() { + updateColors(); + } + }; + ArrayList themeDescriptions = new ArrayList<>(); + new ThemeDescription(null, 0, null, null, null, descriptionDelegate, Theme.key_windowBackgroundWhite); + new ThemeDescription(null, 0, null, null, null, descriptionDelegate, Theme.key_windowBackgroundWhiteBlackText); + new ThemeDescription(null, 0, null, null, null, descriptionDelegate, Theme.key_listSelector); + + + return super.getThemeDescriptions(); + } + + @Override + public boolean needDelayOpenAnimation() { + return true; + } + + @Override + protected void onTransitionAnimationStart(boolean isOpen, boolean backward) { + super.onTransitionAnimationStart(isOpen, backward); + isOpened = true; + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessageSeenView.java b/TMessagesProj/src/main/java/org/telegram/ui/MessageSeenView.java index 9b9b41e56..1ea79f546 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MessageSeenView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MessageSeenView.java @@ -1,8 +1,6 @@ package org.telegram.ui; import android.content.Context; -import android.graphics.Canvas; -import android.graphics.ColorFilter; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.Rect; @@ -21,23 +19,19 @@ import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.google.android.exoplayer2.util.Log; - import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.ChatObject; import org.telegram.messenger.ContactsController; -import org.telegram.messenger.FileLog; import org.telegram.messenger.ImageLocation; import org.telegram.messenger.LocaleController; import org.telegram.messenger.MessageObject; import org.telegram.messenger.MessagesController; import org.telegram.messenger.R; import org.telegram.tgnet.ConnectionsManager; -import org.telegram.tgnet.RequestDelegate; -import org.telegram.tgnet.TLObject; import org.telegram.tgnet.TLRPC; import org.telegram.ui.ActionBar.Theme; import org.telegram.ui.Components.AvatarDrawable; +import org.telegram.ui.Components.AvatarsDarawable; import org.telegram.ui.Components.AvatarsImageView; import org.telegram.ui.Components.BackupImageView; import org.telegram.ui.Components.FlickerLoadingView; @@ -47,7 +41,6 @@ import org.telegram.ui.Components.RecyclerListView; import java.util.ArrayList; import java.util.HashMap; -import java.util.Vector; public class MessageSeenView extends FrameLayout { @@ -79,7 +72,7 @@ public class MessageSeenView extends FrameLayout { addView(titleView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.CENTER_VERTICAL, 40, 0, 62, 0)); avatarsImageView = new AvatarsImageView(context, false); - avatarsImageView.setStyle(AvatarsImageView.STYLE_MESSAGE_SEEN); + avatarsImageView.setStyle(AvatarsDarawable.STYLE_MESSAGE_SEEN); addView(avatarsImageView, LayoutHelper.createFrame(24 + 12 + 12 + 8, LayoutHelper.MATCH_PARENT, Gravity.RIGHT | Gravity.CENTER_VERTICAL, 0, 0, 0, 0)); titleView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem)); @@ -102,7 +95,6 @@ public class MessageSeenView extends FrameLayout { } long finalFromId = fromId; ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> { - FileLog.e("MessageSeenView request completed"); if (error == null) { TLRPC.Vector vector = (TLRPC.Vector) response; ArrayList unknownUsers = new ArrayList<>(); @@ -227,7 +219,11 @@ public class MessageSeenView extends FrameLayout { if (peerIds.size() == 1 && users.get(0) != null) { titleView.setText(ContactsController.formatName(users.get(0).first_name, users.get(0).last_name)); } else { - titleView.setText(LocaleController.formatPluralString(isVoice ? "MessagePlayed" : "MessageSeen", peerIds.size())); + if (peerIds.size() == 0) { + titleView.setText(LocaleController.getString(LocaleController.getString("NobodyViewed", R.string.NobodyViewed))); + } else { + titleView.setText(LocaleController.formatPluralString(isVoice ? "MessagePlayed" : "MessageSeen", peerIds.size())); + } } titleView.animate().alpha(1f).setDuration(220).start(); avatarsImageView.animate().alpha(1f).setDuration(220).start(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java index dbe89a353..cbcfcda2f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java @@ -231,6 +231,7 @@ import org.telegram.ui.Components.VideoPlayerSeekBar; import org.telegram.ui.Components.VideoSeekPreviewImage; import org.telegram.ui.Components.VideoTimelinePlayView; import org.telegram.ui.Components.ViewHelper; +import org.telegram.ui.Components.spoilers.SpoilersTextView; import java.io.ByteArrayInputStream; import java.io.File; @@ -6113,7 +6114,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } private TextView createCaptionTextView(LinkMovementMethod linkMovementMethod) { - TextView textView = new TextView(activityContext) { + TextView textView = new SpoilersTextView(activityContext) { private boolean handleClicks; @@ -9893,6 +9894,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat cameraItem.setVisibility(View.VISIBLE); cameraItem.setTag(1); } + menuItem.setVisibility(View.GONE); imagesArrLocals.addAll(photos); Object obj = imagesArrLocals.get(index); boolean allowCaption; @@ -10068,6 +10070,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } else { menuItem.hideSubItem(gallery_menu_delete); } + menuItem.checkHideMenuItem(); boolean noforwards = MessagesController.getInstance(UserConfig.selectedAccount).isChatNoForwards(newMessageObject.getChatId()); if (isEmbedVideo) { menuItem.showSubItem(gallery_menu_openin); @@ -10094,9 +10097,11 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } else { menuItem.hideSubItem(gallery_menu_masks2); } + menuItem.checkHideMenuItem(); } else { speedGap.setVisibility(View.GONE); menuItem.hideSubItem(gallery_menu_openin); + menuItem.checkHideMenuItem(); final boolean pipItemVisible = pipItem.getVisibility() == View.VISIBLE; final boolean shouldMasksItemBeVisible = newMessageObject.hasAttachedStickers() && !DialogObject.isEncryptedDialog(newMessageObject.getDialogId()); if (pipItemVisible) { @@ -10303,9 +10308,11 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat actionBar.setTitle(LocaleController.formatString("Of", R.string.Of, switchingToIndex + 1, imagesArrLocations.size())); } boolean noforwards = avatarsDialogId != 0 && MessagesController.getInstance(currentAccount).isChatNoForwards(-avatarsDialogId); - if (noforwards) + if (noforwards) { menuItem.hideSubItem(gallery_menu_save); - else menuItem.showSubItem(gallery_menu_save); + } else { + menuItem.showSubItem(gallery_menu_save); + } allowShare = !noforwards; shareButton.setVisibility(allowShare ? View.VISIBLE : View.GONE); @@ -10315,6 +10322,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } else { menuItem.showSubItem(gallery_menu_share); } + menuItem.checkHideMenuItem(); groupedPhotosListView.fillList(); } else if (!imagesArrLocals.isEmpty()) { if (index < 0 || index >= imagesArrLocals.size()) { @@ -10522,7 +10530,10 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat if (isVideo) { if (!MessagesController.getInstance(UserConfig.selectedAccount).isChatNoForwards(-currentDialogId)) menuItem.showSubItem(gallery_menu_openin); - else menuItem.hideSubItem(gallery_menu_openin); + else { + menuItem.hideSubItem(gallery_menu_openin); + } + menuItem.checkHideMenuItem(); if (!pipAvailable) { pipItem.setEnabled(false); @@ -10549,6 +10560,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } else { menuItem.hideSubItem(gallery_menu_savegif); } + menuItem.checkHideMenuItem(); actionBar.setTitle(LocaleController.getString("AttachGif", R.string.AttachGif)); } else { if (size == 1) { @@ -10562,6 +10574,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } menuItem.showSubItem(gallery_menu_save); menuItem.hideSubItem(gallery_menu_savegif); + menuItem.checkHideMenuItem(); } groupedPhotosListView.fillList(); pageBlocksAdapter.updateSlideshowCell(pageBlock); @@ -11121,7 +11134,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat Theme.createChatResources(null, true); CharSequence str; if (messageObject != null && !messageObject.messageOwner.entities.isEmpty()) { - Spannable spannableString = SpannableString.valueOf(caption.toString()); + Spannable spannableString = SpannableString.valueOf(caption); messageObject.addEntitiesToText(spannableString, true, false); if (messageObject.isVideo()) { MessageObject.addUrlsByPattern(messageObject.isOutOwner(), spannableString, false, 3, messageObject.getDuration(), false); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index ed8767e32..687060a04 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -81,8 +81,6 @@ import androidx.recyclerview.widget.RecyclerView; import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.ViewPager; -import com.google.android.exoplayer2.util.Log; - import org.telegram.PhoneFormat.PhoneFormat; import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.ApplicationLoader; @@ -194,6 +192,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. private AudioPlayerAlert.ClippingTextViewSwitcher mediaCounterTextView; private RLottieImageView writeButton; private AnimatorSet writeButtonAnimation; + private AnimatorSet qrItemAnimation; private Drawable lockIconDrawable; private Drawable verifiedDrawable; private Drawable verifiedCheckDrawable; @@ -245,6 +244,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. private ActionBarMenuItem editItem; private ActionBarMenuItem otherItem; private ActionBarMenuItem searchItem; + private ActionBarMenuItem qrItem; protected float headerShadowAlpha = 1.0f; private TopView topView; private long userId; @@ -348,6 +348,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. private final static int edit_avatar = 34; private final static int delete_avatar = 35; private final static int add_photo = 36; + private final static int qr_button = 37; private Rect rect = new Rect(); @@ -425,6 +426,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. private boolean firstLayout = true; private boolean invalidateScroll = true; + private boolean isQrItemVisible; PinchToZoomHelper pinchToZoomHelper; @@ -1264,7 +1266,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } overlaysView.invalidate(); final float textWidth = textPaint.measureText(getCurrentTitle()); - indicatorRect.right = getMeasuredWidth() - AndroidUtilities.dp(54f); + indicatorRect.right = getMeasuredWidth() - AndroidUtilities.dp(54f) - (qrItem != null ? AndroidUtilities.dp(48) : 0); indicatorRect.left = indicatorRect.right - (textWidth + AndroidUtilities.dpf2(16f)); indicatorRect.top = (actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0) + AndroidUtilities.dp(15f); indicatorRect.bottom = indicatorRect.top + AndroidUtilities.dp(26); @@ -1419,15 +1421,6 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. return true; } - @Override - protected void setParentLayout(ActionBarLayout layout) { - super.setParentLayout(layout); - Activity activity = getParentActivity(); - if (activity != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - navigationBarAnimationColorFrom = activity.getWindow().getNavigationBarColor(); - } - } - @Override public void onFragmentDestroy() { super.onFragmentDestroy(); @@ -1873,6 +1866,11 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } } else if (id == add_photo) { onWriteButtonClick(); + } else if (id == qr_button) { + Bundle args = new Bundle(); + args.putLong("chat_id", chatId); + args.putLong("user_id", userId); + presentFragment(new QrActivity(args)); } } }); @@ -1914,6 +1912,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. videoCallItem.setVisibility(expanded || !videoCallItemVisible ? GONE : INVISIBLE); editItem.setVisibility(expanded || !editItemVisible ? GONE : INVISIBLE); otherItem.setVisibility(expanded ? GONE : INVISIBLE); + if (qrItem != null) { + qrItem.setVisibility(expanded ? GONE : INVISIBLE); + } } @Override @@ -1925,6 +1926,10 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. ActionBarMenu menu = actionBar.createMenu(); + if (userId == getUserConfig().clientUserId && !TextUtils.isEmpty(getUserConfig().getCurrentUser().username)) { + qrItem = menu.addItem(qr_button, R.drawable.msg_qr_mini, getResourceProvider()); + qrItem.setContentDescription(LocaleController.getString("AuthAnotherClientScan", R.string.AuthAnotherClientScan)); + } if (imageUpdater != null) { searchItem = menu.addItem(search_button, R.drawable.ic_ab_search).setIsSearchField(true).setActionBarMenuItemSearchListener(new ActionBarMenuItem.ActionBarMenuItemSearchListener() { @@ -2072,6 +2077,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. if (searchItem != null) { searchItem.setAlpha(0.0f); searchItem.setEnabled(false); + searchItem.setVisibility(GONE); } nameTextView[1].setTextColor(Color.WHITE); onlineTextView[1].setTextColor(Color.argb(179, 255, 255, 255)); @@ -2722,6 +2728,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. Build.VERSION.SDK_INT >= 21 ? (SharedConfig.noStatusBar ? "Show status bar background" : "Hide status bar background") : null, BuildVars.DEBUG_PRIVATE_VERSION ? "Clean app update" : null, BuildVars.DEBUG_PRIVATE_VERSION ? "Reset suggestions" : null, + SharedConfig.drawSnowInChat ? "Hide snow in chat" : "Show snow in chat" }; builder.setItems(items, (dialog, which) -> { if (which == 0) { @@ -2792,6 +2799,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. suggestions.add("VALIDATE_PHONE_NUMBER"); suggestions.add("VALIDATE_PASSWORD"); getNotificationCenter().postNotificationName(NotificationCenter.newSuggestionsAvailable); + } else if (which == 17) { + SharedConfig.toggleDrawSnowInChat(); } }); builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); @@ -3222,6 +3231,12 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. avatarImage.setRoundRadius((int) AndroidUtilities.lerp(AndroidUtilities.dpf2(21f), 0f, value)); if (searchItem != null) { searchItem.setAlpha(1.0f - value); + searchItem.setVisibility(searchItem.getAlpha() == 0f ? View.GONE : View.VISIBLE); + if (qrItem != null && searchItem.getVisibility() == View.VISIBLE) { + float translation = AndroidUtilities.dp(48) * value; + qrItem.setTranslationX(translation); + avatarsViewPagerIndicatorView.setTranslationX(translation - AndroidUtilities.dp(48)); + } } if (extraHeight > AndroidUtilities.dp(88f) && expandProgress < 0.33f) { @@ -4267,6 +4282,47 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. writeButton.setAlpha(setVisible ? 1.0f : 0.0f); } } + + if (qrItem != null) { + boolean setQrVisible = diff > 0.5f; + if (setQrVisible != isQrItemVisible) { + isQrItemVisible = setQrVisible; + if (qrItemAnimation != null) { + qrItemAnimation.cancel(); + qrItemAnimation = null; + } + if (animated) { + qrItemAnimation = new AnimatorSet(); + if (setQrVisible) { + qrItemAnimation.setInterpolator(new DecelerateInterpolator()); + qrItemAnimation.playTogether( + ObjectAnimator.ofFloat(qrItem, View.ALPHA, 1.0f), + ObjectAnimator.ofFloat(qrItem, View.TRANSLATION_X, 0), + ObjectAnimator.ofFloat(avatarsViewPagerIndicatorView, View.TRANSLATION_X, -AndroidUtilities.dp(48)) + ); + } else { + qrItemAnimation.setInterpolator(new AccelerateInterpolator()); + qrItemAnimation.playTogether( + ObjectAnimator.ofFloat(qrItem, View.ALPHA, 0.0f), + ObjectAnimator.ofFloat(qrItem, View.TRANSLATION_X, AndroidUtilities.dp(48)), + ObjectAnimator.ofFloat(avatarsViewPagerIndicatorView, View.TRANSLATION_X, 0) + ); + } + qrItemAnimation.setDuration(150); + qrItemAnimation.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + qrItemAnimation = null; + } + }); + qrItemAnimation.start(); + } else { + qrItem.setAlpha(setQrVisible ? 1.0f : 0.0f); + qrItem.setTranslationX(setQrVisible ? 0f : AndroidUtilities.dp(48f)); + avatarsViewPagerIndicatorView.setTranslationX(setQrVisible ? 0f : -AndroidUtilities.dp(48f)); + } + } + } } } @@ -4980,6 +5036,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } else { transitionIndex = getNotificationCenter().setAnimationInProgress(transitionIndex, new int[]{NotificationCenter.dialogsNeedReload, NotificationCenter.closeChats, NotificationCenter.mediaCountDidLoad, NotificationCenter.mediaCountsDidLoad}); } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && !backward && getParentActivity() != null) { + navigationBarAnimationColorFrom = getParentActivity().getWindow().getNavigationBarColor(); + } } transitionAnimationInProress = true; } @@ -6344,10 +6403,14 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. onlineTextView[1].setVisibility(View.VISIBLE); actionBar.onSearchFieldVisibilityChanged(searchTransitionProgress > 0.5f); + int itemVisibility = searchTransitionProgress > 0.5f ? View.VISIBLE : View.GONE; if (otherItem != null) { - otherItem.setVisibility(searchTransitionProgress > 0.5f ? View.VISIBLE : View.GONE); + otherItem.setVisibility(itemVisibility); } - searchItem.setVisibility(searchTransitionProgress > 0.5f ? View.VISIBLE : View.GONE); + if (qrItem != null) { + qrItem.setVisibility(itemVisibility); + } + searchItem.setVisibility(itemVisibility); searchItem.getSearchContainer().setVisibility(searchTransitionProgress > 0.5f ? View.GONE : View.VISIBLE); searchListView.setEmptyView(emptyView); @@ -6391,10 +6454,16 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } searchItem.getSearchContainer().setVisibility(searchTransitionProgress < 0.5f ? View.VISIBLE : View.GONE); + int visibility = searchTransitionProgress > 0.5f ? View.VISIBLE : View.GONE; if (otherItem != null) { - otherItem.setVisibility(searchTransitionProgress > 0.5f ? View.VISIBLE : View.GONE); + otherItem.setVisibility(visibility); + otherItem.setAlpha(progressHalf); } - searchItem.setVisibility(searchTransitionProgress > 0.5f ? View.VISIBLE : View.GONE); + if (qrItem != null) { + qrItem.setAlpha(progressHalf); + qrItem.setVisibility(visibility); + } + searchItem.setVisibility(visibility); actionBar.onSearchFieldVisibilityChanged(searchTransitionProgress < 0.5f); @@ -6456,6 +6525,10 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. otherItem.setAlpha(1f); otherItem.setVisibility(hide); } + if (qrItem != null) { + qrItem.setAlpha(1f); + qrItem.setVisibility(hide); + } searchItem.setVisibility(hide); avatarContainer.setAlpha(1f); @@ -6768,6 +6841,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. case 2: { final TextDetailCell textDetailCell = new TextDetailCell(mContext); textDetailCell.setContentDescriptionValueFirst(true); + textDetailCell.setImageClickListener(ProfileActivity.this::onTextDetailCellImageClicked); view = textDetailCell; break; } @@ -6982,6 +7056,13 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. break; case 2: TextDetailCell detailCell = (TextDetailCell) holder.itemView; + if (position == usernameRow) { + Drawable drawable = ContextCompat.getDrawable(detailCell.getContext(), R.drawable.msg_qr_mini); + drawable.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_switch2TrackChecked), PorterDuff.Mode.SRC_IN)); + detailCell.setImage(drawable); + } else { + detailCell.setImage(null); + } if (position == phoneRow) { String text; final TLRPC.User user = getMessagesController().getUser(userId); @@ -7043,6 +7124,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. currentBio = null; } } + detailCell.setTag(position); break; case 3: AboutLinkCell aboutLinkCell = (AboutLinkCell) holder.itemView; @@ -8144,6 +8226,16 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. layoutManager.scrollToPositionWithOffset(sharedMediaRow, -listView.getPaddingTop()); } + private void onTextDetailCellImageClicked(View view) { + View parent = (View) view.getParent(); + if (parent.getTag() != null && ((int) parent.getTag()) == usernameRow) { + Bundle args = new Bundle(); + args.putLong("chat_id", chatId); + args.putLong("user_id", userId); + presentFragment(new QrActivity(args)); + } + } + private class DiffCallback extends DiffUtil.Callback { int oldRowCount; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/QrActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/QrActivity.java new file mode 100644 index 000000000..a5ef70f7f --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/QrActivity.java @@ -0,0 +1,1292 @@ +package org.telegram.ui; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ValueAnimator; +import android.annotation.SuppressLint; +import android.content.ActivityNotFoundException; +import android.content.Context; +import android.content.Intent; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.BitmapShader; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; +import android.graphics.PorterDuffXfermode; +import android.graphics.Rect; +import android.graphics.RectF; +import android.graphics.Shader; +import android.graphics.drawable.Drawable; +import android.net.Uri; +import android.os.Bundle; +import android.text.Layout; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.StaticLayout; +import android.text.TextPaint; +import android.text.TextUtils; +import android.util.TypedValue; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.collection.ArrayMap; +import androidx.core.content.ContextCompat; +import androidx.core.graphics.ColorUtils; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.LinearSmoothScroller; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.zxing.EncodeHintType; +import com.google.zxing.qrcode.QRCodeWriter; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.ApplicationLoader; +import org.telegram.messenger.ChatThemeController; +import org.telegram.messenger.ImageLocation; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MessagesController; +import org.telegram.messenger.NotificationCenter; +import org.telegram.messenger.R; +import org.telegram.messenger.SvgHelper; +import org.telegram.tgnet.ResultCallback; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.ActionBarLayout; +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.EmojiThemes; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.ActionBar.ThemeDescription; +import org.telegram.ui.Cells.SettingsSearchCell; +import org.telegram.ui.Components.AvatarDrawable; +import org.telegram.ui.Components.BackupImageView; +import org.telegram.ui.Components.ChatThemeBottomSheet; +import org.telegram.ui.Components.Easings; +import org.telegram.ui.Components.FlickerLoadingView; +import org.telegram.ui.Components.HideViewAfterAnimation; +import org.telegram.ui.Components.LayoutHelper; +import org.telegram.ui.Components.MotionBackgroundDrawable; +import org.telegram.ui.Components.RLottieDrawable; +import org.telegram.ui.Components.RLottieImageView; +import org.telegram.ui.Components.RecyclerListView; +import org.telegram.ui.Components.StaticLayoutEx; +import org.telegram.ui.Components.ThemeSmallPreviewView; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +public class QrActivity extends BaseFragment { + + private static final ArrayMap qrColorsMap = new ArrayMap<>(); + private static List cachedThemes; + + static { + qrColorsMap.put("\uD83C\uDFE0d", new int[]{ 0xFF71B654, 0xFF2C9077, 0xFF9ABB3E, 0xFF68B55E }); + qrColorsMap.put("\uD83D\uDC25d", new int[]{ 0xFF43A371, 0xFF8ABD4C, 0xFF9DB139, 0xFF85B950 }); + qrColorsMap.put("⛄d", new int[]{ 0xFF66A1FF, 0xFF59B5EE, 0xFF41BAD2, 0xFF8A97FF }); + qrColorsMap.put("\uD83D\uDC8Ed", new int[]{ 0xFF5198F5, 0xFF4BB7D2, 0xFFAD79FB, 0xFFDF86C7 }); + qrColorsMap.put("\uD83D\uDC68\u200D\uD83C\uDFEBd", new int[]{ 0xFF9AB955, 0xFF48A896, 0xFF369ADD, 0xFF5DC67B }); + qrColorsMap.put("\uD83C\uDF37d", new int[]{ 0xFFEE8044, 0xFFE19B23, 0xFFE55D93, 0xFFCB75D7 }); + qrColorsMap.put("\uD83D\uDC9Cd", new int[]{ 0xFFEE597E, 0xFFE35FB2, 0xFFAD69F2, 0xFFFF9257 }); + qrColorsMap.put("\uD83C\uDF84d", new int[]{ 0xFFEC7046, 0xFFF79626, 0xFFE3761C, 0xFFF4AA2A }); + qrColorsMap.put("\uD83C\uDFAEd", new int[]{ 0xFF19B3D2, 0xFFDC62F4, 0xFFE64C73, 0xFFECA222 }); + qrColorsMap.put("\uD83C\uDFE0n", new int[]{ 0xFF157FD1, 0xFF4A6CF2, 0xFF1876CD, 0xFF2CA6CE }); + qrColorsMap.put("\uD83D\uDC25n", new int[]{ 0xFF57A518, 0xFF1E7650, 0xFF6D9B17, 0xFF3FAB55 }); + qrColorsMap.put("⛄n", new int[]{ 0xFF2B6EDA, 0xFF2F7CB6, 0xFF1DA6C9, 0xFF6B7CFF }); + qrColorsMap.put("\uD83D\uDC8En", new int[]{ 0xFFB256B8, 0xFF6F52FF, 0xFF249AC2, 0xFF347AD5 }); + qrColorsMap.put("\uD83D\uDC68\u200D\uD83C\uDFEBn", new int[]{ 0xFF238B68, 0xFF73A163, 0xFF15AC7F, 0xFF0E8C95 }); + qrColorsMap.put("\uD83C\uDF37n", new int[]{ 0xFFD95454, 0xFFD2770F, 0xFFCE4661, 0xFFAC5FC8 }); + qrColorsMap.put("\uD83D\uDC9Cn", new int[]{ 0xFFD058AA, 0xFFE0743E, 0xFFD85568, 0xFFA369D3 }); + qrColorsMap.put("\uD83C\uDF84n", new int[]{ 0xFFD6681F, 0xFFCE8625, 0xFFCE6D30, 0xFFC98A1D }); + qrColorsMap.put("\uD83C\uDFAEn", new int[]{ 0xFFC74343, 0xFFEC7F36, 0xFF06B0F9, 0xFFA347FF }); + } + + private final ThemeResourcesProvider resourcesProvider = new ThemeResourcesProvider(); + private final EmojiThemes homeTheme = EmojiThemes.createHome(); + private final Rect logoRect = new Rect(); + private final ArrayMap emojiThemeDarkIcons = new ArrayMap<>(); + private final int[] prevQrColors = new int[4]; + + private ThemeListViewController themesViewController; + private MotionBackgroundDrawable currMotionDrawable = new MotionBackgroundDrawable(); + private MotionBackgroundDrawable prevMotionDrawable; + private MotionBackgroundDrawable tempMotionDrawable; + private ValueAnimator patternAlphaAnimator; + private ValueAnimator patternIntensityAnimator; + + private FrameLayout themeLayout; + private BackupImageView avatarImageView; + private QrView qrView; + private RLottieImageView logoImageView; + private ImageView closeImageView; + + private Bitmap emojiThemeIcon; + private EmojiThemes currentTheme = homeTheme; + private boolean isCurrentThemeDark; + private long userId; + private long chatId; + private int prevSystemUiVisibility; + private int selectedPosition = -1; + + public QrActivity(Bundle args) { + super(args); + homeTheme.loadPreviewColors(currentAccount); + } + + @Override + public boolean onFragmentCreate() { + userId = arguments.getLong("user_id"); + chatId = arguments.getLong("chat_id"); + return super.onFragmentCreate(); + } + + @SuppressLint("SourceLockedOrientationActivity") + @Override + public View createView(Context context) { + isCurrentThemeDark = Theme.getActiveTheme().isDark(); + actionBar.setAddToContainer(false); + actionBar.setBackground(null); + actionBar.setItemsColor(0xffffffff, false); + + FrameLayout rootLayout = new FrameLayout(context) { + private boolean prevIsPortrait; + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + int width = MeasureSpec.getSize(widthMeasureSpec); + int height = MeasureSpec.getSize(heightMeasureSpec); + boolean isPortrait = width < height; + avatarImageView.setVisibility(isPortrait ? View.VISIBLE : View.GONE); + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + if (isPortrait) { + themeLayout.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST)); + qrView.measure(MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(260), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(330), MeasureSpec.EXACTLY)); + } else { + themeLayout.measure(MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(256), MeasureSpec.EXACTLY), heightMeasureSpec); + qrView.measure(MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(260), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(310), MeasureSpec.EXACTLY)); + } + if (prevIsPortrait != isPortrait) { + qrView.onSizeChanged(qrView.getMeasuredWidth(), qrView.getMeasuredHeight(), 0, 0); + } + prevIsPortrait = isPortrait; + } + @Override + protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + boolean isPortrait = getWidth() < getHeight(); + + int themeLayoutHeight = 0; + if (themeLayout.getVisibility() == View.VISIBLE) { + themeLayoutHeight = themeLayout.getMeasuredHeight(); + } + + int qrLeft = isPortrait + ? (getWidth() - qrView.getMeasuredWidth()) / 2 + : (getWidth() - themeLayout.getMeasuredWidth() - qrView.getMeasuredWidth()) / 2; + int qrTop = isPortrait + ? (getHeight() - themeLayoutHeight - qrView.getMeasuredHeight() - AndroidUtilities.dp(48)) / 2 + AndroidUtilities.dp(48 + 4) + : (getHeight() - qrView.getMeasuredHeight()) / 2; + qrView.layout(qrLeft, qrTop, qrLeft + qrView.getMeasuredWidth(), qrTop + qrView.getMeasuredHeight()); + + if (isPortrait) { + int avatarLeft = (getWidth() - avatarImageView.getMeasuredWidth()) / 2; + int avatarTop = qrTop - AndroidUtilities.dp(48); + avatarImageView.layout(avatarLeft, avatarTop, avatarLeft + avatarImageView.getMeasuredWidth(), avatarTop + avatarImageView.getMeasuredHeight()); + } + + if (themeLayout.getVisibility() == View.VISIBLE) { + if (isPortrait) { + int themeLayoutLeft = (getWidth() - themeLayout.getMeasuredWidth()) / 2; + themeLayout.layout(themeLayoutLeft, bottom - themeLayoutHeight, themeLayoutLeft + themeLayout.getMeasuredWidth(), bottom); + } else { + int themeLayoutTop = (getHeight() - themeLayout.getMeasuredHeight()) / 2; + themeLayout.layout(right - themeLayout.getMeasuredWidth(), themeLayoutTop, right, themeLayoutTop + themeLayout.getMeasuredHeight()); + } + } + + logoImageView.layout(qrLeft + logoRect.left, qrTop + logoRect.top, qrLeft + logoRect.right, qrTop + logoRect.bottom); + + int closeLeft = isPortrait ? AndroidUtilities.dp(14) : AndroidUtilities.dp(17); + int closeTop = AndroidUtilities.statusBarHeight + (isPortrait ? AndroidUtilities.dp(10) : AndroidUtilities.dp(5)); + closeImageView.layout(closeLeft, closeTop, closeLeft + closeImageView.getMeasuredWidth(), closeTop + closeImageView.getMeasuredHeight()); + } + @Override + protected void dispatchDraw(Canvas canvas) { + if (prevMotionDrawable != null) { + prevMotionDrawable.setBounds(0, 0, getWidth(), getHeight()); + prevMotionDrawable.draw(canvas); + } + currMotionDrawable.setBounds(0, 0, getWidth(), getHeight()); + currMotionDrawable.draw(canvas); + super.dispatchDraw(canvas); + } + @Override + protected boolean verifyDrawable(@NonNull Drawable who) { + return super.verifyDrawable(who) || who == currMotionDrawable || who == prevMotionDrawable; + } + }; + + AvatarDrawable avatarDrawable = null; + String username = null; + ImageLocation imageLocationSmall = null; + ImageLocation imageLocation = null; + if (userId != 0) { + TLRPC.User user = getMessagesController().getUser(userId); + if (user != null) { + username = user.username; + avatarDrawable = new AvatarDrawable(user); + imageLocationSmall = ImageLocation.getForUser(user, ImageLocation.TYPE_SMALL); + imageLocation = ImageLocation.getForUser(user, ImageLocation.TYPE_BIG); + } + } else if (chatId != 0) { + TLRPC.Chat chat = getMessagesController().getChat(chatId); + if (chat != null) { + username = chat.username; + avatarDrawable = new AvatarDrawable(chat); + imageLocationSmall = ImageLocation.getForChat(chat, ImageLocation.TYPE_SMALL); + imageLocation = ImageLocation.getForChat(chat, ImageLocation.TYPE_BIG); + } + } + + String link = "https://" + MessagesController.getInstance(currentAccount).linkPrefix + "/" + username; + qrView = new QrView(context); + qrView.setColors(0xFF71B654, 0xFF2C9077, 0xFF9ABB3E, 0xFF68B55E); + qrView.setData(link, username); + qrView.setCenterChangedListener((left, top, right, bottom) -> { + logoRect.set(left, top, right, bottom); + qrView.requestLayout(); + }); + rootLayout.addView(qrView); + + logoImageView = new RLottieImageView(context); + logoImageView.setAutoRepeat(true); + logoImageView.setAnimation(R.raw.qr_code_logo_2, 60, 60); + logoImageView.playAnimation(); + rootLayout.addView(logoImageView); + + avatarImageView = new BackupImageView(context); + avatarImageView.setRoundRadius(AndroidUtilities.dp(42)); + avatarImageView.setSize(AndroidUtilities.dp(84), AndroidUtilities.dp(84)); + rootLayout.addView(avatarImageView, LayoutHelper.createFrame(84, 84, Gravity.LEFT | Gravity.TOP)); + avatarImageView.setImage(imageLocation, "84_84", imageLocationSmall, "50_50", avatarDrawable, null, null, 0, null); + + closeImageView = new ImageView(context); + closeImageView.setBackground(Theme.createSimpleSelectorCircleDrawable(AndroidUtilities.dp(34), 0x28000000, 0x28ffffff)); + closeImageView.setImageResource(R.drawable.ic_ab_back); + closeImageView.setScaleType(ImageView.ScaleType.CENTER); + closeImageView.setOnClickListener(v -> finishFragment()); + rootLayout.addView(closeImageView, LayoutHelper.createFrame(34, 34)); + + emojiThemeIcon = Bitmap.createBitmap(AndroidUtilities.dp(32), AndroidUtilities.dp(32), Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(emojiThemeIcon); + AndroidUtilities.rectTmp.set(0f, 0f, emojiThemeIcon.getWidth(), emojiThemeIcon.getHeight()); + Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); + paint.setColor(Color.WHITE); + canvas.drawRoundRect(AndroidUtilities.rectTmp, AndroidUtilities.dp(5), AndroidUtilities.dp(5), paint); + paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT)); + Bitmap bitmap = BitmapFactory.decodeResource(ApplicationLoader.applicationContext.getResources(), R.drawable.msg_qr_mini); + canvas.drawBitmap(bitmap, (emojiThemeIcon.getWidth() - bitmap.getWidth()) * 0.5f, (emojiThemeIcon.getHeight() - bitmap.getHeight()) * 0.5f, paint); + canvas.setBitmap(null); + + themesViewController = new ThemeListViewController(this, getParentActivity().getWindow()) { + @Override + protected void setDarkTheme(boolean isDark) { + super.setDarkTheme(isDark); + isCurrentThemeDark = isDark; + onItemSelected(currentTheme, selectedPosition, false); + } + }; + themeLayout = themesViewController.rootLayout; + + themesViewController.onCreate(); + themesViewController.setItemSelectedListener((theme, position) -> QrActivity.this.onItemSelected(theme, position, true)); + themesViewController.titleView.setText(LocaleController.getString("QrCode", R.string.QrCode)); + themesViewController.progressView.setViewType(FlickerLoadingView.QR_TYPE); + themesViewController.shareButton.setOnClickListener(v -> { + themesViewController.shareButton.setClickable(false); + performShare(); + }); + rootLayout.addView(themeLayout, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.BOTTOM)); + + currMotionDrawable.setIndeterminateAnimation(true); + + fragmentView = rootLayout; + onItemSelected(currentTheme, 0, false); + + if (cachedThemes == null || cachedThemes.isEmpty()) { + ChatThemeController.requestAllChatThemes(new ResultCallback>() { + @Override + public void onComplete(List result) { + onDataLoaded(result); + cachedThemes = result; + } + @Override + public void onError(TLRPC.TL_error error) { + Toast.makeText(getParentActivity(), error.text, Toast.LENGTH_SHORT).show(); + } + }, true); + } else { + onDataLoaded(cachedThemes); + } + + prevSystemUiVisibility = getParentActivity().getWindow().getDecorView().getSystemUiVisibility(); + applyScreenSettings(); + return fragmentView; + } + + @SuppressLint("SourceLockedOrientationActivity") + @Override + public void onResume() { + super.onResume(); + applyScreenSettings(); + } + + @Override + public void onPause() { + restoreScreenSettings(); + super.onPause(); + } + + @Override + public void onFragmentDestroy() { + themesViewController.onDestroy(); + themesViewController = null; + emojiThemeIcon.recycle(); + emojiThemeIcon = null; + for (int i = 0; i < emojiThemeDarkIcons.size(); ++i) { + Bitmap bitmap = emojiThemeDarkIcons.valueAt(i); + if (bitmap != null) { + bitmap.recycle(); + } + } + emojiThemeDarkIcons.clear(); + restoreScreenSettings(); + super.onFragmentDestroy(); + } + + private void applyScreenSettings() { + if (getParentActivity() != null) { + getParentActivity().getWindow().getDecorView().setSystemUiVisibility(prevSystemUiVisibility | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_FULLSCREEN); + } + } + + private void restoreScreenSettings() { + if (getParentActivity() != null) { + getParentActivity().getWindow().getDecorView().setSystemUiVisibility(prevSystemUiVisibility); + } + } + + @Override + public int getNavigationBarColor() { + return getThemedColor(Theme.key_windowBackgroundGray); + } + + @Override + public Theme.ResourcesProvider getResourceProvider() { + return resourcesProvider; + } + + private void onDataLoaded(List result) { + if (result == null || result.isEmpty() || themesViewController == null) { + return; + } + result.set(0, homeTheme); + List items = new ArrayList<>(result.size()); + for (int i = 0; i < result.size(); ++i) { + EmojiThemes chatTheme = result.get(i); + chatTheme.loadPreviewColors(currentAccount); + ChatThemeBottomSheet.ChatThemeItem item = new ChatThemeBottomSheet.ChatThemeItem(chatTheme); + item.themeIndex = isCurrentThemeDark ? 1 : 0; + item.icon = getEmojiThemeIcon(chatTheme, isCurrentThemeDark); + items.add(item); + } + themesViewController.adapter.setItems(items); + + int selectedPosition = -1; + for (int i = 0; i != items.size(); ++i) { + if (items.get(i).chatTheme.getEmoticon().equals(currentTheme.getEmoticon())) { + themesViewController.selectedItem = items.get(i); + selectedPosition = i; + break; + } + } + if (selectedPosition != -1) { + themesViewController.setSelectedPosition(selectedPosition); + } + + themesViewController.onDataLoaded(); + } + + private Bitmap getEmojiThemeIcon(EmojiThemes theme, boolean isDark) { + if (isDark) { + Bitmap bitmap = emojiThemeDarkIcons.get(theme.emoji); + if (bitmap == null) { + bitmap = Bitmap.createBitmap(emojiThemeIcon.getWidth(), emojiThemeIcon.getHeight(), Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + int[] colors = qrColorsMap.get(theme.emoji + "n"); + if (colors != null) { + if (tempMotionDrawable == null) { + tempMotionDrawable = new MotionBackgroundDrawable(0, 0, 0, 0, true); + } + tempMotionDrawable.setColors(colors[0], colors[1], colors[2], colors[3]); + tempMotionDrawable.setBounds(AndroidUtilities.dp(6), AndroidUtilities.dp(6), canvas.getWidth() - AndroidUtilities.dp(6), canvas.getHeight() - AndroidUtilities.dp(6)); + tempMotionDrawable.draw(canvas); + } + canvas.drawBitmap(emojiThemeIcon, 0, 0, null); + canvas.setBitmap(null); + emojiThemeDarkIcons.put(theme.emoji, bitmap); + } + return bitmap; + } else { + return emojiThemeIcon; + } + } + + private void onPatternLoaded(Bitmap bitmap, int intensity, boolean withAnimation) { + if (bitmap != null) { + currMotionDrawable.setPatternBitmap(intensity, bitmap); + if (patternIntensityAnimator != null) { + patternIntensityAnimator.cancel(); + } + if (withAnimation) { + patternIntensityAnimator = ValueAnimator.ofFloat(0, 1f); + patternIntensityAnimator.addUpdateListener(animator -> currMotionDrawable.setPatternAlpha((float) animator.getAnimatedValue())); + patternIntensityAnimator.setDuration(250); + patternIntensityAnimator.start(); + } else { + currMotionDrawable.setPatternAlpha(1f); + } + } + } + + private void onItemSelected(EmojiThemes newTheme, int position, boolean withAnimation) { + selectedPosition = position; + final EmojiThemes prevTheme = currentTheme; + final boolean isDarkTheme = isCurrentThemeDark; + currentTheme = newTheme; + EmojiThemes.ThemeItem themeItem = currentTheme.getThemeItem(isDarkTheme ? 1 : 0); + + prevMotionDrawable = currMotionDrawable; + prevMotionDrawable.setIndeterminateAnimation(false); + + currMotionDrawable = new MotionBackgroundDrawable(); + currMotionDrawable.setCallback(fragmentView); + currMotionDrawable.setColors(themeItem.patternBgColor, themeItem.patternBgGradientColor1, themeItem.patternBgGradientColor2, themeItem.patternBgGradientColor3); + currMotionDrawable.setParentView(fragmentView); + currMotionDrawable.setPatternAlpha(1f); + currMotionDrawable.setIndeterminateAnimation(true); + currMotionDrawable.posAnimationProgress = prevMotionDrawable.posAnimationProgress; + qrView.setPosAnimationProgress(currMotionDrawable.posAnimationProgress); + + TLRPC.WallPaper wallPaper = currentTheme.getWallpaper(isDarkTheme ? 1 : 0); + if (wallPaper != null) { + currMotionDrawable.setPatternBitmap(wallPaper.settings.intensity); + currentTheme.loadWallpaper(isDarkTheme ? 1 : 0, pair -> { + if (pair != null && currentTheme.getTlTheme(isDarkTheme ? 1 : 0) != null) { + final long themeId = pair.first; + final Bitmap bitmap = pair.second; + if (themeId == currentTheme.getTlTheme(isDarkTheme ? 1 : 0).id && bitmap != null) { + onPatternLoaded(bitmap, currMotionDrawable.getIntensity(), withAnimation); + } + } + }); + } else { + currMotionDrawable.setPatternBitmap(34, SvgHelper.getBitmap(R.raw.default_pattern, fragmentView.getWidth(), fragmentView.getHeight(), Color.BLACK)); + } + currMotionDrawable.setPatternColorFilter(currMotionDrawable.getPatternColor()); + + float from = 0; + if (patternAlphaAnimator != null) { + from = (float) patternAlphaAnimator.getAnimatedValue(); + patternAlphaAnimator.cancel(); + } + + int[] newQrColors = qrColorsMap.get(newTheme.emoji + (isDarkTheme ? "n" : "d")); + if (withAnimation) { + currMotionDrawable.setAlpha(0); + patternAlphaAnimator = ValueAnimator.ofFloat(from, 1f); + patternAlphaAnimator.addUpdateListener(animation -> { + float progress = (float) animation.getAnimatedValue(); + if (prevMotionDrawable != null) { + prevMotionDrawable.setPatternAlpha(1f - progress); + } + currMotionDrawable.setAlpha((int) (255f * progress)); + if (newQrColors != null) { + int color1 = ColorUtils.blendARGB(prevQrColors[0], newQrColors[0], progress); + int color2 = ColorUtils.blendARGB(prevQrColors[1], newQrColors[1], progress); + int color3 = ColorUtils.blendARGB(prevQrColors[2], newQrColors[2], progress); + int color4 = ColorUtils.blendARGB(prevQrColors[3], newQrColors[3], progress); + qrView.setColors(color1, color2, color3, color4); + } + fragmentView.invalidate(); + }); + patternAlphaAnimator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + if (newQrColors != null) { + System.arraycopy(newQrColors, 0, prevQrColors, 0, 4); + } + prevMotionDrawable = null; + patternAlphaAnimator = null; + } + }); + patternAlphaAnimator.setDuration(250); + patternAlphaAnimator.start(); + } else { + if (newQrColors != null) { + qrView.setColors(newQrColors[0], newQrColors[1], newQrColors[2], newQrColors[3]); + System.arraycopy(newQrColors, 0, prevQrColors, 0, 4); + } + prevMotionDrawable = null; + fragmentView.invalidate(); + } + + Theme.ThemeInfo currentThemeInfo = isCurrentThemeDark ? Theme.getCurrentNightTheme() : Theme.getCurrentTheme(); + ActionBarLayout.ThemeAnimationSettings animationSettings = new ActionBarLayout.ThemeAnimationSettings(null, currentThemeInfo.currentAccentId, isCurrentThemeDark, !withAnimation); + animationSettings.applyTheme = false; + animationSettings.onlyTopFragment = true; + animationSettings.resourcesProvider = getResourceProvider(); + animationSettings.duration = 250; + if (withAnimation) { + resourcesProvider.initColors(prevTheme, isCurrentThemeDark); + } else { + resourcesProvider.initColors(currentTheme, isCurrentThemeDark); + } + animationSettings.afterStartDescriptionsAddedRunnable = () -> { + resourcesProvider.initColors(currentTheme, isCurrentThemeDark); + }; + parentLayout.animateThemedValues(animationSettings); + } + + private void performShare() { + int width = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y); + int height = Math.max(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y); + if (height * 1f / width > 1.92f) { + height = (int)(width * 1.92f); + } + Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + + themeLayout.setVisibility(View.GONE); + closeImageView.setVisibility(View.GONE); + logoImageView.stopAnimation(); + RLottieDrawable drawable = logoImageView.getAnimatedDrawable(); + int currentFrame = drawable.getCurrentFrame(); + drawable.setCurrentFrame(33, false); + + fragmentView.measure(View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY)); + fragmentView.layout(0, 0, width, height); + fragmentView.draw(canvas); + canvas.setBitmap(null); + + themeLayout.setVisibility(View.VISIBLE); + closeImageView.setVisibility(View.VISIBLE); + drawable.setCurrentFrame(currentFrame, false); + logoImageView.playAnimation(); + + fragmentView.layout(fragmentView.getLeft() - 1, fragmentView.getTop(), fragmentView.getRight(), fragmentView.getBottom()); + fragmentView.layout(fragmentView.getLeft() + 1, fragmentView.getTop(), fragmentView.getRight(), fragmentView.getBottom()); + + Uri uri = AndroidUtilities.getBitmapShareUri(bitmap, "qr_tmp.jpg", Bitmap.CompressFormat.JPEG); + if (uri != null) { + Intent intent = new Intent(Intent.ACTION_SEND) + .setType("image/*") + .putExtra(Intent.EXTRA_STREAM, uri); + try { + Intent chooserIntent = Intent.createChooser(intent, LocaleController.getString("InviteByQRCode", R.string.InviteByQRCode)); + getParentActivity().startActivityForResult(chooserIntent, 500); + } catch (ActivityNotFoundException ex) { + ex.printStackTrace(); + } + } + AndroidUtilities.runOnUIThread(() -> themesViewController.shareButton.setClickable(true), 500); + } + + @Override + public ArrayList getThemeDescriptions() { + ArrayList themeDescriptions = super.getThemeDescriptions(); + themeDescriptions.addAll(themesViewController.getThemeDescriptions()); + ThemeDescription.ThemeDescriptionDelegate delegate = () -> setNavigationBarColor(getThemedColor(Theme.key_windowBackgroundGray)); + themeDescriptions.add(new ThemeDescription(themesViewController.shareButton, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, delegate, Theme.key_featuredStickers_addButton)); + themeDescriptions.add(new ThemeDescription(themesViewController.shareButton, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_featuredStickers_addButtonPressed)); + for (ThemeDescription description : themeDescriptions) { + description.resourcesProvider = getResourceProvider(); + } + return themeDescriptions; + } + + + private class ThemeResourcesProvider implements Theme.ResourcesProvider { + + private HashMap colors; + + void initColors(EmojiThemes theme, boolean isDark) { + colors = theme.createColors(currentAccount, isDark ? 1 : 0); + } + + @Override + public Integer getColor(String key) { + return colors != null ? colors.get(key) : null; + } + } + + + private static class QrView extends View { + + private static final float SHADOW_SIZE = AndroidUtilities.dp(2); + private static final float RADIUS = AndroidUtilities.dp(20); + + private final MotionBackgroundDrawable gradientDrawable = new MotionBackgroundDrawable(); + private final Paint bitmapGradientPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + private final BitmapShader gradientShader; + private QrCenterChangedListener centerChangedListener; + private Bitmap backgroundBitmap; + private Bitmap contentBitmap; + private String username; + private String link; + + QrView(Context context) { + super(context); + gradientDrawable.setIndeterminateAnimation(true); + gradientDrawable.setParentView(this); + gradientShader = new BitmapShader(gradientDrawable.getBitmap(), Shader.TileMode.MIRROR, Shader.TileMode.MIRROR); + bitmapGradientPaint.setShader(gradientShader); + } + + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + if (w != oldw || h != oldh) { + if (backgroundBitmap != null) { + backgroundBitmap.recycle(); + backgroundBitmap = null; + } + Paint backgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + backgroundPaint.setColor(Color.WHITE); + backgroundPaint.setShadowLayer(AndroidUtilities.dp(4), 0f, SHADOW_SIZE, 0x0F000000); + backgroundBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(backgroundBitmap); + RectF rect = new RectF(SHADOW_SIZE, SHADOW_SIZE, w - SHADOW_SIZE, getHeight() - SHADOW_SIZE); + canvas.drawRoundRect(rect, RADIUS, RADIUS, backgroundPaint); + prepareContent(w, h); + + float xScale = getWidth() * 1f / gradientDrawable.getBitmap().getWidth(); + float yScale = getHeight() * 1f / gradientDrawable.getBitmap().getHeight(); + float maxScale = Math.max(xScale, yScale); + Matrix matrix = new Matrix(); + matrix.setScale(maxScale, maxScale); + gradientShader.setLocalMatrix(matrix); + } + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + if (backgroundBitmap != null) { + canvas.drawBitmap(backgroundBitmap, 0f, 0f, null); + } + if (contentBitmap != null) { + canvas.drawBitmap(contentBitmap, 0f, 0f, bitmapGradientPaint); + gradientDrawable.updateAnimation(); + } + } + + void setCenterChangedListener(QrCenterChangedListener centerChangedListener) { + this.centerChangedListener = centerChangedListener; + } + + void setData(String link, String username) { + this.username = username; + this.link = link; + prepareContent(getWidth(), getHeight()); + invalidate(); + } + + void setColors(int c1, int c2, int c3, int c4) { + gradientDrawable.setColors(c1, c2, c3, c4); + invalidate(); + } + + void setPosAnimationProgress(float progress) { + gradientDrawable.posAnimationProgress = progress; + } + + private void prepareContent(int w, int h) { + if (TextUtils.isEmpty(username) || TextUtils.isEmpty(link) || w == 0 || h == 0) { + return; + } + + if (contentBitmap != null) { + contentBitmap.recycle(); + } + contentBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); + + int qrColor = 0xff000000; + int backgroundColor = 0x00ffffff; + TextPaint textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG | Paint.LINEAR_TEXT_FLAG); + textPaint.setColor(qrColor); + textPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rcondensedbold.ttf")); + StaticLayout staticLayout = null; + Drawable drawable; + int attemptsCount = 2; + final int textMaxWidth = contentBitmap.getWidth() - AndroidUtilities.dp(20) * 2; + for (int i = 0; i <= attemptsCount; ++i) { + if (i == 0) { + drawable = ContextCompat.getDrawable(getContext(), R.drawable.qr_at_large); + textPaint.setTextSize(AndroidUtilities.dp(30)); + } else if (i == 1) { + drawable = ContextCompat.getDrawable(getContext(), R.drawable.qr_at_medium); + textPaint.setTextSize(AndroidUtilities.dp(25)); + } else { + drawable = ContextCompat.getDrawable(getContext(), R.drawable.qr_at_small); + textPaint.setTextSize(AndroidUtilities.dp(19)); + } + if (drawable != null) { + drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); + drawable.setColorFilter(new PorterDuffColorFilter(qrColor, PorterDuff.Mode.SRC_IN)); + } + + SpannableStringBuilder string = new SpannableStringBuilder(" " + username.toUpperCase()); + string.setSpan(new SettingsSearchCell.VerticalImageSpan(drawable), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + float textWidth = textPaint.measureText(string, 1, string.length()) + drawable.getBounds().width(); + if (i <= 1 && textWidth > textMaxWidth) { + continue; + } + int linesCount = textWidth > textMaxWidth ? 2 : 1; + int layoutWidth = textMaxWidth; + if (linesCount > 1) { + layoutWidth = (int)(textWidth + drawable.getBounds().width()) / 2 + AndroidUtilities.dp(1); + } + if (layoutWidth > textMaxWidth) { + linesCount = 3; + layoutWidth = (int)(textWidth + drawable.getBounds().width()) / 3 + AndroidUtilities.dp(2); + } + staticLayout = StaticLayoutEx.createStaticLayout(string, textPaint, layoutWidth, Layout.Alignment.ALIGN_CENTER, 1f, 0f, false, null, contentBitmap.getWidth(), linesCount); + + break; + } + float lineHeight = textPaint.descent() - textPaint.ascent(); + float textHeight = lineHeight * staticLayout.getLineCount(); + + Bitmap qrBitmap = null; + int imageSize = 0; + int qrBitmapSize = w - AndroidUtilities.dp(30) * 2; + HashMap hints = new HashMap<>(); + hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); + hints.put(EncodeHintType.MARGIN, 0); + QRCodeWriter writer = new QRCodeWriter(); + int version; + for (version = 3; version < 5; ++version) { + try { + hints.put(EncodeHintType.QR_VERSION, version); + qrBitmap = writer.encode(link, qrBitmapSize, qrBitmapSize, hints, null, 0.75f, backgroundColor, qrColor); + imageSize = writer.getImageSize(); + } catch (Exception e) { + // ignore + } + if (qrBitmap != null) { + break; + } + } + if (qrBitmap == null) { + return; + } + + Canvas canvas = new Canvas(contentBitmap); + canvas.drawColor(backgroundColor); + + float left = (w - qrBitmap.getWidth()) / 2f; + float qrTop = h * 0.15f; + if (staticLayout.getLineCount() == 3) { + qrTop = h * 0.13f; + } + boolean isPortrait = ((ViewGroup) getParent()).getMeasuredWidth() < ((ViewGroup) getParent()).getMeasuredHeight(); + if (!isPortrait) { + qrTop = h * 0.09f; + } + canvas.drawBitmap(qrBitmap, left, qrTop, new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG)); + + Paint circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG); + circlePaint.setColor(qrColor); + float xCenter = left + qrBitmap.getWidth() * 0.5f; + float yCenter = qrTop + qrBitmap.getWidth() * 0.5f; + canvas.drawCircle(xCenter, yCenter, imageSize * 0.5f, circlePaint); + if (centerChangedListener != null) { + centerChangedListener.onCenterChanged((int) (xCenter - imageSize * 0.5f), (int) (yCenter - imageSize * 0.5f), (int) (xCenter + imageSize * 0.5f), (int) (yCenter + imageSize * 0.5f)); + } + + float xTranslate = (canvas.getWidth() - staticLayout.getWidth()) * 0.5f; + float yTranslate = qrTop + qrBitmap.getHeight() + (canvas.getHeight() - (qrTop + qrBitmap.getHeight()) - textHeight) * 0.5f - AndroidUtilities.dp(4); + canvas.save(); + canvas.translate(xTranslate, yTranslate); + staticLayout.draw(canvas); + canvas.restore(); + qrBitmap.recycle(); + + Bitmap oldBitmap = contentBitmap; + contentBitmap = contentBitmap.extractAlpha(); + oldBitmap.recycle(); + } + + public interface QrCenterChangedListener { + + void onCenterChanged(int left, int top, int right, int bottom); + } + } + + + private class ThemeListViewController implements NotificationCenter.NotificationCenterDelegate { + + private final Paint backgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + public final ChatThemeBottomSheet.Adapter adapter; + private final LinearSmoothScroller scroller; + private final BaseFragment fragment; + private final Window window; + private final Drawable backgroundDrawable; + + public final FrameLayout rootLayout; + public final TextView titleView; + public final FlickerLoadingView progressView; + public final TextView shareButton; + private final RecyclerListView recyclerView; + private final RLottieDrawable darkThemeDrawable; + private final RLottieImageView darkThemeView; + private LinearLayoutManager layoutManager; + private final View topShadow; + private final View bottomShadow; + + private OnItemSelectedListener itemSelectedListener; + public ChatThemeBottomSheet.ChatThemeItem selectedItem; + public int prevSelectedPosition = -1; + private boolean forceDark; + private ValueAnimator changeDayNightViewAnimator; + private View changeDayNightView; + private float changeDayNightViewProgress; + protected boolean isLightDarkChangeAnimation; + private boolean prevIsPortrait; + + public ThemeListViewController(BaseFragment fragment, Window window) { + this.fragment = fragment; + this.window = window; + + Context context = fragment.getParentActivity(); + scroller = new LinearSmoothScroller(context) { + @Override + protected int calculateTimeForScrolling(int dx) { + return super.calculateTimeForScrolling(dx) * 6; + } + }; + + backgroundDrawable = context.getResources().getDrawable(R.drawable.sheet_shadow_round).mutate(); + backgroundDrawable.setColorFilter(new PorterDuffColorFilter(fragment.getThemedColor(Theme.key_dialogBackground), PorterDuff.Mode.MULTIPLY)); + rootLayout = new FrameLayout(context) { + + private final Rect backgroundPadding = new Rect(); + + { + backgroundPaint.setColor(fragment.getThemedColor(Theme.key_windowBackgroundWhite)); + backgroundDrawable.setCallback(this); + backgroundDrawable.getPadding(backgroundPadding); + setPadding(0, backgroundPadding.top + AndroidUtilities.dp(8), 0, backgroundPadding.bottom); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + boolean isPortrait = AndroidUtilities.displaySize.x < AndroidUtilities.displaySize.y; + int recyclerPadding = AndroidUtilities.dp(12); + if (isPortrait) { + recyclerView.setLayoutParams(LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 104, Gravity.START, 0, 44, 0, 0)); + recyclerView.setPadding(recyclerPadding, 0, recyclerPadding, 0); + shareButton.setLayoutParams(LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 48, Gravity.START, 16, 162, 16, 16)); + } else { + recyclerView.setLayoutParams(LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.START, 0, 44, 0, 80)); + recyclerView.setPadding(recyclerPadding, recyclerPadding / 2, recyclerPadding, recyclerPadding); + shareButton.setLayoutParams(LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 48, Gravity.BOTTOM, 16, 0, 16, 16)); + } + if (isPortrait) { + bottomShadow.setVisibility(View.GONE); + topShadow.setVisibility(View.GONE); + } else { + bottomShadow.setVisibility(View.VISIBLE); + bottomShadow.setLayoutParams(LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, AndroidUtilities.dp(2), Gravity.BOTTOM, 0, 0, 0, 80)); + topShadow.setVisibility(View.VISIBLE); + topShadow.setLayoutParams(LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, AndroidUtilities.dp(2), Gravity.TOP, 0, 44, 0, 0)); + } + if (prevIsPortrait != isPortrait) { + recyclerView.setLayoutManager(layoutManager = getLayoutManager(isPortrait)); + recyclerView.requestLayout(); + if (prevSelectedPosition != -1) { + setSelectedPosition(prevSelectedPosition); + } + prevIsPortrait = isPortrait; + } + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + } + + @Override + protected void dispatchDraw(Canvas canvas) { + if (prevIsPortrait) { + backgroundDrawable.setBounds(-backgroundPadding.left, 0, getWidth() + backgroundPadding.right, getHeight()); + backgroundDrawable.draw(canvas); + } else { + AndroidUtilities.rectTmp.set(0, 0, getWidth() + AndroidUtilities.dp(14), getHeight()); + canvas.drawRoundRect(AndroidUtilities.rectTmp, AndroidUtilities.dp(14), AndroidUtilities.dp(14), backgroundPaint); + } + super.dispatchDraw(canvas); + } + + @Override + protected boolean verifyDrawable(@NonNull Drawable who) { + return who == backgroundDrawable || super.verifyDrawable(who); + } + }; + + titleView = new TextView(context); + titleView.setEllipsize(TextUtils.TruncateAt.MIDDLE); + titleView.setLines(1); + titleView.setSingleLine(true); + titleView.setTextColor(fragment.getThemedColor(Theme.key_dialogTextBlack)); + titleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20); + titleView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + titleView.setPadding(AndroidUtilities.dp(21), AndroidUtilities.dp(6), AndroidUtilities.dp(21), AndroidUtilities.dp(8)); + rootLayout.addView(titleView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.START, 0, 0, 62, 0)); + + int drawableColor = fragment.getThemedColor(Theme.key_featuredStickers_addButton); + int drawableSize = AndroidUtilities.dp(28); + darkThemeDrawable = new RLottieDrawable(R.raw.sun_outline, "" + R.raw.sun_outline, drawableSize, drawableSize, true, null); + darkThemeDrawable.setPlayInDirectionOfCustomEndFrame(true); + darkThemeDrawable.beginApplyLayerColors(); + setDarkButtonColor(drawableColor); + darkThemeDrawable.commitApplyLayerColors(); + + darkThemeView = new RLottieImageView(context); + darkThemeView.setAnimation(darkThemeDrawable); + darkThemeView.setScaleType(ImageView.ScaleType.CENTER); + darkThemeView.setOnClickListener(view -> { + if (changeDayNightViewAnimator != null) { + return; + } + setupLightDarkTheme(!forceDark); + }); + darkThemeView.setVisibility(View.INVISIBLE); + rootLayout.addView(darkThemeView, LayoutHelper.createFrame(44, 44, Gravity.TOP | Gravity.END, 0, 0, 7, 0)); + forceDark = !Theme.getActiveTheme().isDark(); + setForceDark(Theme.getActiveTheme().isDark(), false); + + progressView = new FlickerLoadingView(context, fragment.getResourceProvider()); + progressView.setVisibility(View.VISIBLE); + rootLayout.addView(progressView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 104, Gravity.START, 0, 44, 0, 0)); + + prevIsPortrait = AndroidUtilities.displaySize.x < AndroidUtilities.displaySize.y; + recyclerView = new RecyclerListView(context); + recyclerView.setAdapter(adapter = new ChatThemeBottomSheet.Adapter(currentAccount, resourcesProvider, ThemeSmallPreviewView.TYPE_QR)); + recyclerView.setClipChildren(false); + recyclerView.setClipToPadding(false); + recyclerView.setItemAnimator(null); + recyclerView.setNestedScrollingEnabled(false); + recyclerView.setLayoutManager(layoutManager = getLayoutManager(prevIsPortrait)); + recyclerView.setOnItemClickListener(this::onItemClicked); + recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() { + private int yScroll = 0; + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + super.onScrolled(recyclerView, dx, dy); + yScroll += dy; + topShadow.setAlpha(yScroll * 1f / AndroidUtilities.dp(6)); + } + }); + rootLayout.addView(recyclerView); + + topShadow = new View(context); + topShadow.setAlpha(0f); + topShadow.setBackground(ContextCompat.getDrawable(context, R.drawable.shadowdown)); + topShadow.setRotation(180); + rootLayout.addView(topShadow); + + bottomShadow = new View(context); + bottomShadow.setBackground(ContextCompat.getDrawable(context, R.drawable.shadowdown)); + rootLayout.addView(bottomShadow); + + shareButton = new TextView(context); + shareButton.setBackground(Theme.createSimpleSelectorRoundRectDrawable(AndroidUtilities.dp(6), fragment.getThemedColor(Theme.key_featuredStickers_addButton), fragment.getThemedColor(Theme.key_featuredStickers_addButtonPressed))); + shareButton.setEllipsize(TextUtils.TruncateAt.END); + shareButton.setGravity(Gravity.CENTER); + shareButton.setLines(1); + shareButton.setSingleLine(true); + shareButton.setText(LocaleController.getString("ShareQrCode", R.string.ShareQrCode)); + shareButton.setTextColor(fragment.getThemedColor(Theme.key_featuredStickers_buttonText)); + shareButton.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15); + shareButton.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + rootLayout.addView(shareButton); + } + + public void onCreate() { + ChatThemeController.preloadAllWallpaperThumbs(true); + ChatThemeController.preloadAllWallpaperThumbs(false); + ChatThemeController.preloadAllWallpaperImages(true); + ChatThemeController.preloadAllWallpaperImages(false); + NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.emojiLoaded); + } + + @SuppressLint("NotifyDataSetChanged") + @Override + public void didReceivedNotification(int id, int account, Object... args) { + if (id == NotificationCenter.emojiLoaded) { + adapter.notifyDataSetChanged(); + } + } + + public void onDestroy() { + NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.emojiLoaded); + } + + public void setItemSelectedListener(OnItemSelectedListener itemSelectedListener) { + this.itemSelectedListener = itemSelectedListener; + } + + public void onDataLoaded() { + darkThemeView.setVisibility(View.VISIBLE); + progressView.animate().alpha(0f).setListener(new HideViewAfterAnimation(progressView)).setDuration(150).start(); + recyclerView.setAlpha(0f); + recyclerView.animate().alpha(1f).setDuration(150).start(); + } + + public void setSelectedPosition(int selectedPosition) { + prevSelectedPosition = selectedPosition; + adapter.setSelectedItem(selectedPosition); + if (selectedPosition > 0 && selectedPosition < adapter.items.size() / 2) { + selectedPosition -= 1; + } + int finalSelectedPosition = Math.min(selectedPosition, adapter.items.size() - 1); + layoutManager.scrollToPositionWithOffset(finalSelectedPosition, 0); + } + + protected void onItemClicked(View view, int position) { + if (adapter.items.get(position) == selectedItem || changeDayNightView != null) { + return; + } + isLightDarkChangeAnimation = false; + selectedItem = adapter.items.get(position); + adapter.setSelectedItem(position); + rootLayout.postDelayed(() -> { + RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager(); + if (layoutManager != null) { + final int targetPosition = position > prevSelectedPosition + ? Math.min(position + 1, adapter.items.size() - 1) + : Math.max(position - 1, 0); + scroller.setTargetPosition(targetPosition); + layoutManager.startSmoothScroll(scroller); + } + prevSelectedPosition = position; + }, 100); + for (int i = 0; i < recyclerView.getChildCount(); i++) { + ThemeSmallPreviewView child = (ThemeSmallPreviewView) recyclerView.getChildAt(i); + if (child != view) { + child.cancelAnimation(); + } + } + if (!adapter.items.get(position).chatTheme.showAsDefaultStub) { + ((ThemeSmallPreviewView) view).playEmojiAnimation(); + } + if (itemSelectedListener != null) { + itemSelectedListener.onItemSelected(selectedItem.chatTheme, position); + } + } + + @SuppressLint("NotifyDataSetChanged") + private void setupLightDarkTheme(boolean isDark) { + if (changeDayNightViewAnimator != null) { + changeDayNightViewAnimator.cancel(); + } + FrameLayout decorView1 = (FrameLayout) fragment.getParentActivity().getWindow().getDecorView(); + FrameLayout decorView2 = (FrameLayout) window.getDecorView(); + Bitmap bitmap = Bitmap.createBitmap(decorView2.getWidth(), decorView2.getHeight(), Bitmap.Config.ARGB_8888); + Canvas bitmapCanvas = new Canvas(bitmap); + darkThemeView.setAlpha(0f); + decorView1.draw(bitmapCanvas); + decorView2.draw(bitmapCanvas); + darkThemeView.setAlpha(1f); + + Paint xRefPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + xRefPaint.setColor(0xff000000); + xRefPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); + + Paint bitmapPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + bitmapPaint.setFilterBitmap(true); + int[] position = new int[2]; + darkThemeView.getLocationInWindow(position); + float x = position[0]; + float y = position[1]; + float cx = x + darkThemeView.getMeasuredWidth() / 2f; + float cy = y + darkThemeView.getMeasuredHeight() / 2f; + + float r = Math.max(bitmap.getHeight(), bitmap.getWidth()) * 0.9f; + + Shader bitmapShader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); + bitmapPaint.setShader(bitmapShader); + changeDayNightView = new View(fragment.getParentActivity()) { + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + if (isDark) { + if (changeDayNightViewProgress > 0f) { + bitmapCanvas.drawCircle(cx, cy, r * changeDayNightViewProgress, xRefPaint); + } + canvas.drawBitmap(bitmap, 0, 0, bitmapPaint); + } else { + canvas.drawCircle(cx, cy, r * (1f - changeDayNightViewProgress), bitmapPaint); + } + canvas.save(); + canvas.translate(x, y); + darkThemeView.draw(canvas); + canvas.restore(); + } + }; + changeDayNightViewProgress = 0f; + changeDayNightViewAnimator = ValueAnimator.ofFloat(0, 1f); + changeDayNightViewAnimator.addUpdateListener(valueAnimator -> { + changeDayNightViewProgress = (float) valueAnimator.getAnimatedValue(); + changeDayNightView.invalidate(); + }); + changeDayNightViewAnimator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + if (changeDayNightView != null) { + if (changeDayNightView.getParent() != null) { + ((ViewGroup) changeDayNightView.getParent()).removeView(changeDayNightView); + } + changeDayNightView = null; + } + changeDayNightViewAnimator = null; + super.onAnimationEnd(animation); + } + }); + changeDayNightViewAnimator.setDuration(400); + changeDayNightViewAnimator.setInterpolator(Easings.easeInOutQuad); + changeDayNightViewAnimator.start(); + + decorView2.addView(changeDayNightView, new ViewGroup.LayoutParams(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + + AndroidUtilities.runOnUIThread(() -> { + if (adapter == null || adapter.items == null) { + return; + } + setForceDark(isDark, true); + if (selectedItem != null) { + isLightDarkChangeAnimation = true; + setDarkTheme(isDark); + } + if (adapter.items != null) { + for (int i = 0; i < adapter.items.size(); i++) { + adapter.items.get(i).themeIndex = isDark ? 1 : 0; + adapter.items.get(i).icon = getEmojiThemeIcon(adapter.items.get(i).chatTheme, isDark); + } + tempMotionDrawable = null; + adapter.notifyDataSetChanged(); + } + }); + } + + protected void setDarkTheme(boolean isDark) { } + + public void setForceDark(boolean isDark, boolean playAnimation) { + if (forceDark == isDark) { + return; + } + forceDark = isDark; + if (playAnimation) { + darkThemeDrawable.setCustomEndFrame(isDark ? darkThemeDrawable.getFramesCount() : 0); + darkThemeView.playAnimation(); + } else { + darkThemeDrawable.setCurrentFrame(isDark ? darkThemeDrawable.getFramesCount() - 1 : 0, false, true); + darkThemeView.invalidate(); + } + } + + public void setDarkButtonColor(int color) { + darkThemeDrawable.setLayerColor("Sunny.**", color); + darkThemeDrawable.setLayerColor("Path.**", color); + darkThemeDrawable.setLayerColor("Path 10.**", color); + darkThemeDrawable.setLayerColor("Path 11.**", color); + } + + private LinearLayoutManager getLayoutManager(boolean isPortrait) { + return isPortrait + ? new LinearLayoutManager(fragment.getParentActivity(), LinearLayoutManager.HORIZONTAL, false) + : new GridLayoutManager(fragment.getParentActivity(), 3, LinearLayoutManager.VERTICAL, false); + } + + private void onAnimationStart() { + if (adapter != null && adapter.items != null) { + for (ChatThemeBottomSheet.ChatThemeItem item : adapter.items) { + item.themeIndex = forceDark ? 1 : 0; + } + } + if (!isLightDarkChangeAnimation) { + setItemsAnimationProgress(1.0f); + } + } + + private void setItemsAnimationProgress(float progress) { + for (int i = 0; i < adapter.getItemCount(); ++i) { + adapter.items.get(i).animationProgress = progress; + } + } + + private void onAnimationEnd() { + isLightDarkChangeAnimation = false; + } + + public ArrayList getThemeDescriptions() { + ThemeDescription.ThemeDescriptionDelegate descriptionDelegate = new ThemeDescription.ThemeDescriptionDelegate() { + + private boolean isAnimationStarted = false; + + @Override + public void onAnimationProgress(float progress) { + if (progress == 0f && !isAnimationStarted) { + onAnimationStart(); + isAnimationStarted = true; + } + setDarkButtonColor(fragment.getThemedColor(Theme.key_featuredStickers_addButton)); + if (isLightDarkChangeAnimation) { + setItemsAnimationProgress(progress); + } + if (progress == 1f && isAnimationStarted) { + isLightDarkChangeAnimation = false; + onAnimationEnd(); + isAnimationStarted = false; + } + } + + @Override + public void didSetColor() {} + }; + ArrayList themeDescriptions = new ArrayList<>(); + themeDescriptions.add(new ThemeDescription(null, ThemeDescription.FLAG_BACKGROUND, null, backgroundPaint, null, null, Theme.key_dialogBackground)); + themeDescriptions.add(new ThemeDescription(null, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, new Drawable[]{ backgroundDrawable }, descriptionDelegate, Theme.key_dialogBackground)); + themeDescriptions.add(new ThemeDescription(titleView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_dialogTextBlack)); + themeDescriptions.add(new ThemeDescription(recyclerView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[]{ThemeSmallPreviewView.class}, null, null, null, Theme.key_dialogBackgroundGray)); + for (ThemeDescription description : themeDescriptions) { + description.resourcesProvider = fragment.getResourceProvider(); + } + return themeDescriptions; + } + } + + interface OnItemSelectedListener { + + void onItemSelected(EmojiThemes theme, int position); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ReactionsDoubleTapManageActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ReactionsDoubleTapManageActivity.java new file mode 100644 index 000000000..78441943e --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/ReactionsDoubleTapManageActivity.java @@ -0,0 +1,198 @@ +package org.telegram.ui; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.os.Build; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MediaDataController; +import org.telegram.messenger.NotificationCenter; +import org.telegram.messenger.R; +import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.ActionBar.ThemeDescription; +import org.telegram.ui.Cells.AvailableReactionCell; +import org.telegram.ui.Cells.TextInfoPrivacyCell; +import org.telegram.ui.Cells.ThemePreviewMessagesCell; +import org.telegram.ui.Components.LayoutHelper; +import org.telegram.ui.Components.RecyclerListView; +import org.telegram.ui.Components.SimpleThemeDescription; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class ReactionsDoubleTapManageActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { + + private List chatReactions = Collections.emptyList(); + + private LinearLayout contentView; + private RecyclerListView listView; + private RecyclerView.Adapter listAdapter; + + int previewRow; + int infoRow; + int reactionsStartRow; + int rowCount; + + public ReactionsDoubleTapManageActivity() { + super(); + } + + @Override + public boolean onFragmentCreate() { + getNotificationCenter().addObserver(this, NotificationCenter.reactionsDidLoad); + return super.onFragmentCreate(); + } + + @Override + public View createView(Context context) { + actionBar.setTitle(LocaleController.getString("Reactions", R.string.Reactions)); + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + actionBar.setAllowOverlayTitle(true); + + actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { + @Override + public void onItemClick(int id) { + if (id == -1) { + finishFragment(); + } + } + }); + + LinearLayout linaerLayout = new LinearLayout(context); + linaerLayout.setOrientation(LinearLayout.VERTICAL); + + listView = new RecyclerListView(context); + listView.setLayoutManager(new LinearLayoutManager(context)); + listView.setAdapter(listAdapter = new RecyclerView.Adapter() { + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view; + switch (viewType) { + case 0: + ThemePreviewMessagesCell messagesCell = new ThemePreviewMessagesCell(context, parentLayout, ThemePreviewMessagesCell.TYPE_REACTIONS_DOUBLE_TAP); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + messagesCell.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); + } + messagesCell.fragment = ReactionsDoubleTapManageActivity.this; + view = messagesCell; + break; + case 2: + TextInfoPrivacyCell cell = new TextInfoPrivacyCell(context); + cell.setText(LocaleController.getString("DoubleTapPreviewRational", R.string.DoubleTapPreviewRational)); + view = cell; + break; + default: + case 1: { + view = new AvailableReactionCell(context, true); + } + break; + } + return new RecyclerListView.Holder(view); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + switch (getItemViewType(position)) { + case 1: + AvailableReactionCell reactionCell = (AvailableReactionCell) holder.itemView; + TLRPC.TL_availableReaction react = getAvailableReactions().get(position - reactionsStartRow); + reactionCell.bind(react, react.reaction.contains(MediaDataController.getInstance(currentAccount).getDoubleTapReaction())); + break; + } + } + + @Override + public int getItemCount() { + return getAvailableReactions().size(); + } + + @Override + public int getItemViewType(int position) { + if (position == previewRow) { + return 0; + } + if (position == infoRow) { + return 2; + } + return 1; + } + }); + listView.setOnItemClickListener((view, position) -> { + if (view instanceof AvailableReactionCell) { + MediaDataController.getInstance(currentAccount).setDoubleTapReaction(((AvailableReactionCell) view).react.reaction); + AndroidUtilities.updateVisibleRows(listView); + } + }); + linaerLayout.addView(listView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + fragmentView = contentView = linaerLayout; + + updateColors(); + updateRows(); + + return contentView; + } + + private void updateRows() { + rowCount = 0; + previewRow = rowCount++; + infoRow = rowCount++; + reactionsStartRow = rowCount++; + } + + @Override + public void onFragmentDestroy() { + super.onFragmentDestroy(); + getNotificationCenter().removeObserver(this, NotificationCenter.reactionsDidLoad); + } + + private List getAvailableReactions() { + return getMediaDataController().getReactionsList(); + } + + @Override + public ArrayList getThemeDescriptions() { + return SimpleThemeDescription.createThemeDescriptions(this::updateColors, + Theme.key_windowBackgroundWhite, + Theme.key_windowBackgroundWhiteBlackText, + Theme.key_windowBackgroundWhiteGrayText2, + Theme.key_listSelector, + Theme.key_windowBackgroundGray, + Theme.key_windowBackgroundWhiteGrayText4, + Theme.key_windowBackgroundWhiteRedText4, + Theme.key_windowBackgroundChecked, + Theme.key_windowBackgroundCheckText, + Theme.key_switchTrackBlue, + Theme.key_switchTrackBlueChecked, + Theme.key_switchTrackBlueThumb, + Theme.key_switchTrackBlueThumbChecked + ); + } + + @SuppressLint("NotifyDataSetChanged") + private void updateColors() { + contentView.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundGray)); + listAdapter.notifyDataSetChanged(); + } + + @SuppressLint("NotifyDataSetChanged") + @Override + public void didReceivedNotification(int id, int account, Object... args) { + if (account != currentAccount) return; + if (id == NotificationCenter.reactionsDidLoad) { + listAdapter.notifyDataSetChanged(); + } + } +} \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/RestrictedLanguagesSelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/RestrictedLanguagesSelectActivity.java new file mode 100644 index 000000000..15b832c42 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/RestrictedLanguagesSelectActivity.java @@ -0,0 +1,561 @@ +/* + * This is the source code of Telegram for Android v. 1.3.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2018. + */ + +package org.telegram.ui; + +import android.animation.ValueAnimator; +import android.content.Context; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.view.View; +import android.view.ViewGroup; +import android.widget.EditText; +import android.widget.FrameLayout; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.FileLog; +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MessagesController; +import org.telegram.messenger.NotificationCenter; +import org.telegram.messenger.R; +import org.telegram.messenger.Utilities; +import org.telegram.ui.ActionBar.AlertDialog; +import org.telegram.ui.ActionBar.Theme; +import org.telegram.ui.ActionBar.ThemeDescription; +import org.telegram.ui.Cells.CheckBoxCell; +import org.telegram.ui.Cells.HeaderCell; +import org.telegram.ui.Cells.LanguageCell; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.Cells.ShadowSectionCell; +import org.telegram.ui.Cells.TextCheckbox2Cell; +import org.telegram.ui.Cells.TextCheckCell; +import org.telegram.ui.Cells.TextInfoPrivacyCell; +import org.telegram.ui.Cells.TextRadioCell; +import org.telegram.ui.Cells.TextSettingsCell; +import org.telegram.ui.Components.CubicBezierInterpolator; +import org.telegram.ui.Components.EmptyTextProgressView; +import org.telegram.ui.Components.LayoutHelper; +import org.telegram.ui.Components.RecyclerListView; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.Set; +import java.util.Timer; +import java.util.TimerTask; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +public class RestrictedLanguagesSelectActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { + + private ListAdapter listAdapter; + private RecyclerListView listView; + private ListAdapter searchListViewAdapter; + private EmptyTextProgressView emptyView; + + private boolean searchWas; + private boolean searching; + + private Timer searchTimer; + private ArrayList searchResult; + private ArrayList sortedLanguages; +// private ArrayList unofficialLanguages; + + private SharedPreferences preferences; + private SharedPreferences.OnSharedPreferenceChangeListener listener; + private HashSet selectedLanguages = null; + + public static HashSet getRestrictedLanguages() { +// String currentLangCode = LocaleController.getInstance().getCurrentLocaleInfo().pluralLangCode; +// String[] onlyCurrentLang = new String[] { currentLangCode }; + return new HashSet<>(MessagesController.getGlobalMainSettings().getStringSet("translate_button_restricted_languages", new HashSet(/*Arrays.asList(onlyCurrentLang)*/))); + } + + @Override + public boolean onFragmentCreate() { + preferences = MessagesController.getGlobalMainSettings(); + selectedLanguages = getRestrictedLanguages(); + preferences.registerOnSharedPreferenceChangeListener(listener = new SharedPreferences.OnSharedPreferenceChangeListener() { + public int langPos(String lng) { + if (lng == null) + return -1; + ArrayList arr = (searching ? searchResult : sortedLanguages); + if (arr == null) + return -1; + for (int i = 0; i < arr.size(); ++i) + if (lng.equals(arr.get(i).pluralLangCode)) + return i; + return -1; + } + + @Override + public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) { + preferences = sharedPreferences; + HashSet newSelectedLanguages = getRestrictedLanguages(); + if (listView != null && listView.getAdapter() != null) { + RecyclerView.Adapter adapter = listView.getAdapter(); + int offset = !searching ? 1 : 0; + for (String lng : selectedLanguages) + if (!newSelectedLanguages.contains(lng)) + adapter.notifyItemChanged(langPos(lng) + offset); + for (String lng : newSelectedLanguages) + if (!selectedLanguages.contains(lng)) + adapter.notifyItemChanged(langPos(lng) + offset); + } + selectedLanguages = newSelectedLanguages; + } + }); + + fillLanguages(); + LocaleController.getInstance().loadRemoteLanguages(currentAccount); + NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.suggestedLangpack); + return super.onFragmentCreate(); + } + + @Override + public void onFragmentDestroy() { + super.onFragmentDestroy(); + preferences.unregisterOnSharedPreferenceChangeListener(listener); + NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.suggestedLangpack); + } + + @Override + public View createView(Context context) { + searching = false; + searchWas = false; + + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + actionBar.setAllowOverlayTitle(true); + actionBar.setTitle(LocaleController.getString("DoNotTranslate", R.string.DoNotTranslate)); + + actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { + @Override + public void onItemClick(int id) { + if (id == -1) { + finishFragment(); + } + } + }); + + ActionBarMenu menu = actionBar.createMenu(); + ActionBarMenuItem item = menu.addItem(0, R.drawable.ic_ab_search).setIsSearchField(true).setActionBarMenuItemSearchListener(new ActionBarMenuItem.ActionBarMenuItemSearchListener() { + @Override + public void onSearchExpand() { + searching = true; + } + + @Override + public void onSearchCollapse() { + search(null); + searching = false; + searchWas = false; + if (listView != null) { + emptyView.setVisibility(View.GONE); + listView.setAdapter(listAdapter); + } + } + + @Override + public void onTextChanged(EditText editText) { + String text = editText.getText().toString(); + search(text); + if (text.length() != 0) { + searchWas = true; + if (listView != null) { + listView.setAdapter(searchListViewAdapter); + } + } else { + searching = false; + searchWas = false; + if (listView != null) { + emptyView.setVisibility(View.GONE); + listView.setAdapter(listAdapter); + } + } + } + }); + item.setSearchFieldHint(LocaleController.getString("Search", R.string.Search)); + + listAdapter = new ListAdapter(context, false); + searchListViewAdapter = new ListAdapter(context, true); + + fragmentView = new FrameLayout(context); + fragmentView.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundGray)); + FrameLayout frameLayout = (FrameLayout) fragmentView; + + emptyView = new EmptyTextProgressView(context); + emptyView.setText(LocaleController.getString("NoResult", R.string.NoResult)); + emptyView.showTextView(); + emptyView.setShowAtCenter(true); + frameLayout.addView(emptyView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + + listView = new RecyclerListView(context); + listView.setEmptyView(emptyView); + listView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)); + listView.setVerticalScrollBarEnabled(false); + listView.setAdapter(listAdapter); + frameLayout.addView(listView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); + + listView.setOnItemClickListener((view, position) -> { + if (getParentActivity() == null || parentLayout == null || !(view instanceof TextCheckbox2Cell)) { + return; + } + boolean search = listView.getAdapter() == searchListViewAdapter; + if (!search) + position--; + LocaleController.LocaleInfo localeInfo; + if (search) { + localeInfo = searchResult.get(position); + } else { + localeInfo = sortedLanguages.get(position); + } + if (localeInfo != null) { + LocaleController.LocaleInfo currentLocaleInfo = LocaleController.getInstance().getCurrentLocaleInfo(); + String langCode = localeInfo.pluralLangCode; + if (langCode != null && langCode.equals(currentLocaleInfo.pluralLangCode)) { + AndroidUtilities.shakeView(((TextCheckbox2Cell) view).checkbox, 2, 0); + return; + } + boolean value = selectedLanguages.contains(langCode); + HashSet newSelectedLanguages = new HashSet(selectedLanguages); + if (value) + newSelectedLanguages.removeIf(s -> s != null && s.equals(langCode)); + else + newSelectedLanguages.add(langCode); + if (newSelectedLanguages.size() == 1 && newSelectedLanguages.contains(currentLocaleInfo.pluralLangCode)) + preferences.edit().remove("translate_button_restricted_languages").apply(); + else + preferences.edit().putStringSet("translate_button_restricted_languages", newSelectedLanguages).apply(); + } + }); + + listView.setOnItemLongClickListener((view, position) -> { + if (getParentActivity() == null || parentLayout == null || !(view instanceof TextCheckbox2Cell)) { + return false; + } + boolean search = listView.getAdapter() == searchListViewAdapter; + if (!search) + position--; + LocaleController.LocaleInfo localeInfo; + if (search) { + localeInfo = searchResult.get(position); + } else { + localeInfo = sortedLanguages.get(position); + } + if (localeInfo == null || localeInfo.pathToFile == null || localeInfo.isRemote() && localeInfo.serverIndex != Integer.MAX_VALUE) { + return false; + } + final LocaleController.LocaleInfo finalLocaleInfo = localeInfo; + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + builder.setTitle(LocaleController.getString("DeleteLocalizationTitle", R.string.DeleteLocalizationTitle)); + builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("DeleteLocalizationText", R.string.DeleteLocalizationText, localeInfo.name))); + builder.setPositiveButton(LocaleController.getString("Delete", R.string.Delete), (dialogInterface, i) -> { + if (LocaleController.getInstance().deleteLanguage(finalLocaleInfo, currentAccount)) { + fillLanguages(); + if (searchResult != null) { + searchResult.remove(finalLocaleInfo); + } + if (listAdapter != null) { + listAdapter.notifyDataSetChanged(); + } + if (searchListViewAdapter != null) { + searchListViewAdapter.notifyDataSetChanged(); + } + } + }); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); + AlertDialog alertDialog = builder.create(); + showDialog(alertDialog); + TextView button = (TextView) alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (button != null) { + button.setTextColor(Theme.getColor(Theme.key_dialogTextRed2)); + } + return true; + }); + + listView.setOnScrollListener(new RecyclerView.OnScrollListener() { + @Override + public void onScrollStateChanged(RecyclerView recyclerView, int newState) { + if (newState == RecyclerView.SCROLL_STATE_DRAGGING) { + AndroidUtilities.hideKeyboard(getParentActivity().getCurrentFocus()); + } + } + }); + + return fragmentView; + } + + @Override + public void didReceivedNotification(int id, int account, Object... args) { + if (id == NotificationCenter.suggestedLangpack) { + if (listAdapter != null) { + fillLanguages(); + listAdapter.notifyDataSetChanged(); + } + } + } + + private void fillLanguages() { + final LocaleController.LocaleInfo currentLocale = LocaleController.getInstance().getCurrentLocaleInfo(); + Comparator comparator = (o, o2) -> { + if (o == currentLocale) { + return -1; + } else if (o2 == currentLocale) { + return 1; + } else if (o.serverIndex == o2.serverIndex) { + return o.name.compareTo(o2.name); + } + if (o.serverIndex > o2.serverIndex) { + return 1; + } else if (o.serverIndex < o2.serverIndex) { + return -1; + } + return 0; + }; + + sortedLanguages = new ArrayList<>(); + + ArrayList arrayList = LocaleController.getInstance().languages; + for (int a = 0, size = arrayList.size(); a < size; a++) { + LocaleController.LocaleInfo info = arrayList.get(a); + if (info != null && info.serverIndex != Integer.MAX_VALUE/* && (info.pluralLangCode == null || !info.pluralLangCode.equals(currentLocale.pluralLangCode))*/) { + sortedLanguages.add(info); + } + } + Collections.sort(sortedLanguages, comparator); + } + + @Override + public void onResume() { + super.onResume(); + if (listAdapter != null) { + listAdapter.notifyDataSetChanged(); + } + } + + public void search(final String query) { + if (query == null) { + searchResult = null; + } else { + try { + if (searchTimer != null) { + searchTimer.cancel(); + } + } catch (Exception e) { + FileLog.e(e); + } +// searchTimer = new Timer(); +// searchTimer.schedule(new TimerTask() { +// @Override +// public void run() { +// try { +// searchTimer.cancel(); +// searchTimer = null; +// } catch (Exception e) { +// FileLog.e(e); +// } + processSearch(query); +// } +// }, 100, 300); + } + } + + private void processSearch(final String query) { +// Utilities.searchQueue.postRunnable(() -> { + + String q = query.trim().toLowerCase(); + if (q.length() == 0) { + updateSearchResults(new ArrayList<>()); + return; + } + long time = System.currentTimeMillis(); + ArrayList resultArray = new ArrayList<>(); + +// for (int a = 0, N = unofficialLanguages.size(); a < N; a++) { +// LocaleController.LocaleInfo c = unofficialLanguages.get(a); +// if (c.name.toLowerCase().startsWith(query) || c.nameEnglish.toLowerCase().startsWith(query)) { +// resultArray.add(c); +// } +// } + + for (int a = 0, N = sortedLanguages.size(); a < N; a++) { + LocaleController.LocaleInfo c = sortedLanguages.get(a); + if (c.name.toLowerCase().startsWith(query) || c.nameEnglish.toLowerCase().startsWith(query)) { + resultArray.add(c); + } + } + + updateSearchResults(resultArray); +// }); + } + + private void updateSearchResults(final ArrayList arrCounties) { + AndroidUtilities.runOnUIThread(() -> { + searchResult = arrCounties; + searchListViewAdapter.notifyDataSetChanged(); + }); + } + + private class ListAdapter extends RecyclerListView.SelectionAdapter { + + private Context mContext; + private boolean search; + + public ListAdapter(Context context, boolean isSearch) { + mContext = context; + search = isSearch; + } + + @Override + public boolean isEnabled(RecyclerView.ViewHolder holder) { + return holder.getItemViewType() == 0; + } + + @Override + public int getItemCount() { + if (search) { + if (searchResult == null) { + return 0; + } + return searchResult.size(); + } else { + int count = sortedLanguages.size(); + return 1 + count; + } + } + + @Override + public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + View view; + switch (viewType) { + case 0: { + view = new TextCheckbox2Cell(mContext); + view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); + break; + } + case 2: + HeaderCell header = new HeaderCell(mContext); + header.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); + header.setText(LocaleController.getString("ChooseLanguages", R.string.ChooseLanguages)); + view = header; + break; + case 1: + default: { + view = new ShadowSectionCell(mContext); + break; + } + } + return new RecyclerListView.Holder(view); + } + + @Override + public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { + switch (holder.getItemViewType()) { + case 0: { + if (!search) + position--; +// LanguageCell textSettingsCell = (LanguageCell) holder.itemView; + TextCheckbox2Cell textSettingsCell = (TextCheckbox2Cell) holder.itemView; + LocaleController.LocaleInfo localeInfo; + boolean last; + if (search) { + localeInfo = searchResult.get(position); + last = position == searchResult.size() - 1; + } /*else if (!unofficialLanguages.isEmpty() && position >= 0 && position < unofficialLanguages.size()) { + localeInfo = unofficialLanguages.get(position); + last = position == unofficialLanguages.size() - 1; + } */else { +// if (!unofficialLanguages.isEmpty()) { +// position -= unofficialLanguages.size() + 1; +// } + localeInfo = sortedLanguages.get(position); + last = position == sortedLanguages.size() - 1; + } + String langCode = localeInfo.pluralLangCode; + boolean value = selectedLanguages.contains(langCode); + if (localeInfo.isLocal()) { + textSettingsCell.setTextAndValue(String.format("%1$s (%2$s)", localeInfo.name, LocaleController.getString("LanguageCustom", R.string.LanguageCustom)), localeInfo.nameEnglish, false, !last); + } else { + textSettingsCell.setTextAndValue(localeInfo.name, localeInfo.nameEnglish, false, !last); + } + + boolean isCurrent = langCode != null && langCode.equals(LocaleController.getInstance().getCurrentLocaleInfo().pluralLangCode); + textSettingsCell.setChecked(value || isCurrent); + break; + } + case 1: { + if (!search) + position--; + ShadowSectionCell sectionCell = (ShadowSectionCell) holder.itemView; +// if (!unofficialLanguages.isEmpty() && position == unofficialLanguages.size()) { +// sectionCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow)); +// } else { + sectionCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow)); +// } + break; + } + case 2: { + + } + } + } + + @Override + public int getItemViewType(int i) { + if (!search) + i--; + if (i == -1) + return 2; + if (search) { + return 0; + } +// if (!unofficialLanguages.isEmpty() && (i == unofficialLanguages.size() || i == unofficialLanguages.size() + sortedLanguages.size() + 1) || unofficialLanguages.isEmpty() && i == sortedLanguages.size()) { +// return 1; +// } + return 0; + } + } + + @Override + public ArrayList getThemeDescriptions() { + ArrayList themeDescriptions = new ArrayList<>(); + + themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[]{LanguageCell.class}, null, null, null, Theme.key_windowBackgroundWhite)); + themeDescriptions.add(new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundGray)); + + themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_actionBarDefault)); + themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_LISTGLOWCOLOR, null, null, null, null, Theme.key_actionBarDefault)); + themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_actionBarDefaultIcon)); + themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_actionBarDefaultTitle)); + themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_actionBarDefaultSelector)); + themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SEARCH, null, null, null, null, Theme.key_actionBarDefaultSearch)); + themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SEARCHPLACEHOLDER, null, null, null, null, Theme.key_actionBarDefaultSearchPlaceholder)); + + themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector)); + + themeDescriptions.add(new ThemeDescription(emptyView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_emptyListPlaceholder)); + + themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{View.class}, Theme.dividerPaint, null, null, Theme.key_divider)); + + themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{ShadowSectionCell.class}, null, null, null, Theme.key_windowBackgroundGrayShadow)); + + themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{LanguageCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); + themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{LanguageCell.class}, new String[]{"textView2"}, null, null, null, Theme.key_windowBackgroundWhiteGrayText3)); + themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{LanguageCell.class}, new String[]{"checkImage"}, null, null, null, Theme.key_featuredStickers_addedIcon)); + + return themeDescriptions; + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SessionBottomSheet.java b/TMessagesProj/src/main/java/org/telegram/ui/SessionBottomSheet.java index 5b0a6936f..a510d2fc6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SessionBottomSheet.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SessionBottomSheet.java @@ -384,13 +384,13 @@ public class SessionBottomSheet extends BottomSheet { valueText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); valueText.setGravity(Gravity.LEFT); valueText.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); - linearLayout.addView(valueText, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 0, 0, 0, 0)); + linearLayout.addView(valueText, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 0, 0, needSwitch ? 46 : 0, 0)); descriptionText = new TextView(context); descriptionText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13); descriptionText.setGravity(Gravity.LEFT); descriptionText.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText)); - linearLayout.addView(descriptionText, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 0, 4, 0, 0)); + linearLayout.addView(descriptionText, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 0, 4, needSwitch ? 46 : 0, 0)); setPadding(0, AndroidUtilities.dp(4), 0, AndroidUtilities.dp(4)); if (needSwitch) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/TextMessageEnterTransition.java b/TMessagesProj/src/main/java/org/telegram/ui/TextMessageEnterTransition.java index 202551db2..9d95a7cec 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/TextMessageEnterTransition.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/TextMessageEnterTransition.java @@ -41,9 +41,9 @@ import org.telegram.ui.Components.ChatActivityEnterView; import org.telegram.ui.Components.CubicBezierInterpolator; import org.telegram.ui.Components.EmptyStubSpan; import org.telegram.ui.Components.RecyclerListView; +import org.telegram.ui.Components.spoilers.SpoilerEffect; public class TextMessageEnterTransition implements MessageEnterTransitionContainer.Transition { - float fromRadius; float progress; @@ -561,8 +561,18 @@ public class TextMessageEnterTransition implements MessageEnterTransitionContain if (messageView.replyTextLayout != null) { canvas.save(); canvas.translate(replyMessageX, replyY + AndroidUtilities.dp(19)); + + canvas.save(); + SpoilerEffect.clipOutCanvas(canvas, messageView.replySpoilers); messageView.replyTextLayout.draw(canvas); canvas.restore(); + + for (SpoilerEffect eff : messageView.replySpoilers) { + if (eff.shouldInvalidateColor()) eff.setColor(messageView.replyTextLayout.getPaint().getColor()); + eff.draw(canvas); + } + + canvas.restore(); } canvas.restore(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemeActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemeActivity.java index 6a3bc9e4c..72cd6025c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemeActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemeActivity.java @@ -28,13 +28,6 @@ import android.location.LocationManager; import android.net.Uri; import android.os.Build; import android.os.Bundle; - -import androidx.annotation.Keep; -import androidx.core.content.FileProvider; -import androidx.recyclerview.widget.DefaultItemAnimator; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - import android.text.TextPaint; import android.text.TextUtils; import android.view.Gravity; @@ -46,19 +39,29 @@ import android.widget.Button; import android.widget.FrameLayout; import android.widget.TextView; +import androidx.annotation.Keep; +import androidx.core.content.FileProvider; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.BuildConfig; -import org.telegram.messenger.MediaDataController; +import org.telegram.messenger.DocumentObject; import org.telegram.messenger.FileLoader; import org.telegram.messenger.FileLog; +import org.telegram.messenger.ImageLocation; import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MediaDataController; import org.telegram.messenger.MessagesController; import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.SharedConfig; +import org.telegram.messenger.SvgHelper; import org.telegram.messenger.Utilities; import org.telegram.messenger.time.SunDate; +import org.telegram.tgnet.TLRPC; import org.telegram.ui.ActionBar.ActionBar; import org.telegram.ui.ActionBar.ActionBarMenu; import org.telegram.ui.ActionBar.ActionBarMenuItem; @@ -91,7 +94,6 @@ import org.telegram.ui.Components.ThemeEditorView; import java.io.File; import java.io.FileOutputStream; -import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; @@ -171,6 +173,7 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No private int themeListRow2; private int themeAccentListRow; private int themeInfoRow; + private int reactionsDoubleTapRow; private int swipeGestureHeaderRow; private int swipeGestureRow; @@ -492,6 +495,7 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No chatListHeaderRow = -1; chatListRow = -1; chatListInfoRow = -1; + reactionsDoubleTapRow = -1; textSizeRow = -1; backgroundRow = -1; @@ -599,6 +603,7 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No sendByEnterRow = rowCount++; saveToGalleryRow = rowCount++; distanceRow = rowCount++; + reactionsDoubleTapRow = rowCount++; settings2Row = rowCount++; stickersRow = rowCount++; stickersSection2Row = rowCount++; @@ -1048,6 +1053,8 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No showDialog(builder.create()); } else if (position == stickersRow) { presentFragment(new StickersActivity(MediaDataController.TYPE_IMAGE)); + } else if (position == reactionsDoubleTapRow) { + presentFragment(new ReactionsDoubleTapManageActivity()); } else if (position == emojiRow) { SharedConfig.toggleBigEmoji(); if (view instanceof TextCheckCell) { @@ -1620,7 +1627,7 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No @Override public boolean isEnabled(RecyclerView.ViewHolder holder) { int type = holder.getItemViewType(); - return type == 0 || type == 1 || type == 4 || type == 7 || type == 10 || type == 11 || type == 12 || type == 14; + return type == 0 || type == 1 || type == 4 || type == 7 || type == 10 || type == 11 || type == 12 || type == 14 || type == 18; } private void showOptionsForTheme(Theme.ThemeInfo themeInfo) { @@ -1998,6 +2005,9 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No cell.setFocusable(false); view.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); break; + case 18: + view = new TextSettingsCell(mContext); + break; } return new RecyclerListView.Holder(view); } @@ -2048,7 +2058,7 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No } else { value = LocaleController.getString("DistanceUnitsMiles", R.string.DistanceUnitsMiles); } - cell.setTextAndValue(LocaleController.getString("DistanceUnits", R.string.DistanceUnits), value, false); + cell.setTextAndValue(LocaleController.getString("DistanceUnits", R.string.DistanceUnits), value, true); } break; } @@ -2196,6 +2206,19 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No cell.updateDayNightMode(); break; } + case 18:{ + TextSettingsCell settingsCell = (TextSettingsCell) holder.itemView; + settingsCell.setText(LocaleController.getString("DoubleTapSetting", R.string.DoubleTapSetting), false); + String reaction = MediaDataController.getInstance(currentAccount).getDoubleTapReaction(); + if (reaction != null) { + TLRPC.TL_availableReaction availableReaction = MediaDataController.getInstance(currentAccount).getReactionsMap().get(reaction); + if (availableReaction != null) { + SvgHelper.SvgDrawable svgThumb = DocumentObject.getSvgThumb(availableReaction.static_icon.thumbs, Theme.key_windowBackgroundGray, 1.0f); + settingsCell.getValueBackupImageView().getImageReceiver().setImage(ImageLocation.getForDocument(availableReaction.static_icon), "100_100", svgThumb, "webp", availableReaction, 1); + } + } + break; + } } } @@ -2254,6 +2277,8 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No return 16; } else if (position == themeListRow2) { return 17; + } else if (position == reactionsDoubleTapRow) { + return 18; } return 1; } diff --git a/TMessagesProj/src/main/res/drawable-hdpi/actions_reactions.png b/TMessagesProj/src/main/res/drawable-hdpi/actions_reactions.png new file mode 100644 index 0000000000000000000000000000000000000000..e7c01332fdcaee4fc7f5b5a64d76b9ca6f01afd8 GIT binary patch literal 1442 zcmV;T1zq}yP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91Dxd=Z1ONa40RR91DgXcg0Mr_#3jhEG3`s;mR9Fe^m|KWdWfaHfXi66| zo6^c+64b0HvLs2mP)Ui2Phk(mpbSoB(p&WqLH3|sEYQ*vi;{$bLg*zbbnNobKtUvw znb}M?#ja*KmDkhnzh|w(I{WOi_nb481+(Bk|8@V?*=O(X+h0z%S=7Z_#cU!IoPlkfW0U!3o*n7Y_4Nd^> zf+$@Wt+5Gq-mo)>`yk$DU#k9D3+O`)Qw&}L9s?s{Zl+Gsefa+oZDwH59(yUX)3nWV9nD5@-K{$4qe??C#><_$ZQ{2x__%<_fN^&I>vC$dg{ zablIrzrgjkE(L+#Td#UkYoZU)3nW>?uI&#cfA2`uUV>M{cBcHBtY(|7ai`g$$uYM^ zCm}BQCibbGgg($=cYBR9wHJVk+!kX$2qfAaP6N7CT-sx9jZW4|&otfxkM>0LIILpn z+u$aA*L!{*lc#;xWiHBbpwAp@>eiAl&yqwsW&BwD3jKI5MAxui0!huVo>#=w>iE_E zDp{s{_$?Vo)yY@Yi{N`nO1bi+rTa5@pl5fNH;9hEw;X*HgI~d@6T*V!XqJRMNGnf12|~$%`r9@oqn^d zr|4Ssf_u!jF|#*8o%5esl4xa2#MZ;+H~+jCYgVV;ePYf?{o!PM;Hj%YDkhSZa<#aODB6sVAr>J`Vd-P14`wV4VrTr9*8oI^6-c zI*N$UT8kiMEB=1 zi5k}5NmaNSRQA%`;({Q3?o~sRyFDFyi}~~{Brnw-%VmaPHLSR}f| zlDB#|p8v~p2g?f5K*Rdigj!w$ni`fm?JVB{iQXxuYE4*gQ10K4J}zsPLLY@1Htw@) zu^Sqed>y;7$6_0DIR4jw%fiBe@)GEBCWs5Yf;}d$#$)8^xcvyYR8Bt}&$ttQ*=q*H zG}5sCUZDPZ4ZJF^DRKR$uWBD9Rh49ZUo# zfzem9V zjSiU3XMssTTh`B@p1e-rO0PwKDI|V?KHg*XxS^-EUK9CQY$S9kxESb-{|M*--Taex w4_py)bzI&9Hh~w2AFc$4l%Xr|KfMBf0X*%E?_3-_tpET307*qoM6N<$f^vhTEdT%j literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/msg_qr_mini.png b/TMessagesProj/src/main/res/drawable-hdpi/msg_qr_mini.png new file mode 100644 index 0000000000000000000000000000000000000000..4ca349fe9f3083e6ec6a0ed30c60ca460180b2a0 GIT binary patch literal 799 zcmV+)1K|9LP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91B%lKT1ONa40RR91Bme*a04fgS`~Uy~iAh93R9Fe^m%VOOF%X3}2rc3# zf(E4I0qE!m9cB0tqM@aVKq=DGM%$4R3Hn4RPe2L;C|yDW&k>|hK!HG^$nu@YW6kxo zy}Q|khC9;8<1=T*zGHhf>GeA4Dlp>;42Q!$x`7^`B{{;ek1nOl3kyDRN}}9aqo2mN z=7CsBl;Yn27A%QuRM@z(VX?)LOts477FxArI9GFo3U*+zHl8uVjq!`Y?#?9wHjjRA z{KbO33w|*Pp98z+_~|0#Oa?A?ll+=joU}(^Gtd zjDF%(wVUX<2sRCM=pEv}G~sSGx&kvjGLGszORk{T&_i^SWBJ7xCET0)0eFl5Q*`DG z1)!(8)Wof!Ue?kza2`5>Hr#qtB&C96FAox^*T)S ziqc>9OJGmY%Yh`my|(m=)44*vqP7v)4asfDy0nOoIODX__NdA+zGoqmf7+V?i+2dF zTE}%%cS-l<0UGZRc3s^04ogfp1IHUwc#H7--_|cnT*GsB$b7RHRT*FL8>5o`?F}`a zJex`9t^MWhP>VDLpgZ#lRb{l9=jdeO?uN`eX*Ae8x+`apfpM6thgqM|xMV&X!M4!j zpj(C)M~Kt>8?;Wmm-TcZoZ5_uUTZ^gcj$G4QJ;Lry;G-5>1FGE^i=;!6F2)KoAP_Q d@c*v@e*gyPs2)?oM7sb0002ovPDHLkV1fbsV`TsU literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/msg_reactions.png b/TMessagesProj/src/main/res/drawable-hdpi/msg_reactions.png new file mode 100644 index 0000000000000000000000000000000000000000..4d057421e0e3de00b49e732fb82506fd746f8953 GIT binary patch literal 1099 zcmV-R1ho5!P)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91B%lKT1ONa40RR91Bme*a04fgS`~Uz0wMj%lR9Fe^mRpETVHC&5r8I?H zW>A>&U=$f6lad%mvPJGVG#2mZ^&ijIy7FUyvVpTN|F+3YN8~0kQbLh zE(tS@xIHhPeXNf)5sch#uubVGjbzH-Xcj+H;-K zG$;iwjTpP#LDzXx>}lW~kURp#pulWYiqv{t&YCtWt(A_dml~iqS?nXa*qdTc0k19R zM=SR&I10|mLB4=tUYE6|Xf}8TB;UYPFUIzvv@6k}CgHyXQQ4q60=>XvORTflbo?V= zsP|6P5QYQ)wO_F%pFx=yV5b|ZgxquBvNclEV8K(0VV^huxN{OUq;*Erb{Bz-=4U(9 zSok_N$q`=!dsP?-f`^J>uQ9*PIf)w5P9t7-0{&WyWjoXu_&TEINRKk>A*EB85b;Mi zuY-oP#E9R~bDe;lX((Nkg%Q3k(1wWL8~;6!RD!6#$ax(!MEyFw4H7-j%bbLrZm1e^ zFTgnGCTa4Qf#iVl=qsTY1pAZtBIstmVI)`DsflwI5T5hOq$Lc|f8Q$Op6JAnM;YMh^!n57R-QT`3R&oo=YrbC_(oW>uIs|&85IX75=dKzeHEMxg9C{pO#+DEd8(B(!gnu*?^?Hz9CfY#D zE$}$wKvtknRF`^;P7Ot!{_(F_qwpTG{ueEFCaZz0sLqO{^nCTqy4Z-+>`<}E4D0Ln zlEU+I>Pf*~YbK>PBkQ5yE(N;VB)e>wBJ5XTgujrShH)~*(a+dM{Cv-)({L()Zf40< zpg&bzkoSN@_fqa(k-i|s{&}KidSgmF7uV#ffIe9yt)M>`1a1R~{(8#ebvgSq(cR%k zpan01RiG4%2bI7dR?KjKf#{jwfdYu?7UaBmx&oTb0p1)ltu&G82bM(`+L?-Uy*nMJ zX&+Dpv_r3fi$2zx!5nXnU2Vx0bo=+Y=etC+&|sivB=HSYzDpMFZu&3mzz?0wU70Sw R+7$o*002ovPDHLkV1iPx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91B%lKT1ONa40RR91Bme*a04fgS`~Uy~^GQTOR9Fe^mQ9FGVHC&TcZ`{c zl8pHXcZ>FCy@2SMor4N7(RmR;e!LeZWu3BGEBEj2-xLx6Ex$Q^Yg`MN7?!_OmXuT36)9<|zSvE#1q*-?dr1d7%` zzbhV1)N7Y3cRw6+u`4EMyNh*(`7(_ZZh$PJZj$%IO%z;h_F(T#(1H-Ku`a8aN(w4q zI8o;ljk8?NAxXzZuS;H^6jYWBkUWprTX+LsVG|61O!scXJ{uV_TT`)EjL3fADwa4u zc2k0g>XlFh)o>LgYBP9I_qqQ2>cG!p@smd4BbS_d{|zNb8}OAC>HLtWKJcQ{r~>lX zLQ8(`it3#oyD32|YcF?J!OJ+KPza*FaDCKbV;LH)$P4cU?M9Tw9{<^7qgG#+~BseSkje%Xz?HfA6AHg)jAeXFs$ zEt-|$CTpO-E9KdhxJ(LbL8tXtt&hS66Li6v9C1_RcWF`s&#YPAq1nW&rcisS8)oEJ zk*J`_On3@;?68T^L-GN7Ap2jBgoe~5&8pxrWU(_O>2)z3o`7B(sna<%N!|cWC&39A z$xd=pfAFTkLuiG$dFRTN&jib%1+*t*1E9(E{)-KN9cb?id&Gp?aT}RTKZ_1LomC|( ftw3o7{0jU5yoF=z<)+sF00000NkvXXu0mjfw*!i% literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/msg_translate.png b/TMessagesProj/src/main/res/drawable-hdpi/msg_translate.png new file mode 100644 index 0000000000000000000000000000000000000000..38251c33eecdc33f6c87f052f9a44adf45173ec2 GIT binary patch literal 916 zcmV;F18e+=P)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91B%lKT1ONa40RR91Bme*a04fgS`~Uy~{z*hZR9Fe^m(OoZQ545J+WOf_ z2$CVuNaI(8bR!ZQJAzmc=|*&;R_tmeCBn)Am0)8*f?y$$`VmU}*oYMW0E>zUk@!_I zsVaRwXL`=$=JmcGGxH`9dXn!u_nz}T-*e~9o%`O@)lJyHeg}deXa^s`p1XE;LpM&J`dw43hR$ ztX6Ci@oq2*x}u2W76RETV&|iHnZ#*uvDhXEe&S`1jWgoMlp}7{I6{^I8nl7m(h0j8 z)+V+X*e|m$oUh58hG&4;R%=2a2Oerd7QM!DHT5)_4dhWF_72RIhWJhisGY3oBEsS{ z?Xb@H+aM3VXzVp!PWVV8zX==yiy}$oCJ?g?&M+8|i`vFGEja6ph#vrQ-c@f1HG@~c zwX;deknLe?b?r$tsq-jaGF7~6 zy|za2eV{&^kDJ4neOCZ!tT(JxdSeVH zDxI^6ZPZ@V`tSH*kJe0LlY!*(yipcBoNPiYs84UrXME{b=c*HTe}TK*T&80hwE{b9 zdZNVPxM$RhC|=cZ8XW~@%i{zg9WWw(bsV?i9Kw&Z$>Ssuc=N%C^7kh3E6O9j9$W=W q(g?uY2`+$2{(7ZpF~Ru{@4z2=?jc!4!*~b)0000Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91Dxd=Z1ONa40RR91DgXcg0Mr_#3jhEFrb$FWR9Fe^m|cifRTRhXoft!N zM$^hM5Wy)0(e$AQ8)8f>91`+j&>$*Q2%?9CUi^6QDI$X+f_kwJ8GI3P9-15jMF>Hp z@FN>X3LnIe8Yaw-%KYs5`(N%kci(l^z2_e9o$18|f6iKK|JT~d-;kw1%O!p`I0QV|X!%ubq9+6I#rX~YlB$6j8ptyNdu&DtSCp7HT;vnuTEfZndN8%=)|$|twYU0dK#R!|2w^?4%hWM64POMEhA2~d^v@5&|dchlDC-@Io`4h+Fun6onU{5mlCDgCl z4Xn&J38z4~YDw7ItRD`!((!eJOTdaZ06$q0_Dq{oNwt7O(FtOY#g{@tN!Lgwii|p- z?R6*SK-3;R;e6rno{ieWw@??}P%g5U-3cA&i;XSwOL&(Yf6+x-AIcx5y^EskTYcVe zWOhWpT7~L{ZY4Ptx!f^Ja_pnV_aL^Nh0BH`b4KI~3$?eGwulrwuLgRgPK%Tp&*@H^ z&41nD#BpJvb_Az0Jr!$|L?cczf4?gc$uSjmp%Z7PKAz@)8`l>rG}=9L0={`ckkkQV z%Y21mx*dPy`UFK&ZN=tZWC_?e5;&&6z z*}%J2z8vN(>JVQARt7B*f_FAYaib{TfggcBP0~c0{1CY85Or8QY5Uhcs?GeG3D8A3 zUeHkxzRwJAEX>3pMg6N-Z>rvp2_*&IMDTUS>NILQ>WsMpZ-MPMwrO1IB+@NuR!j;M z{QAz-~kG8()RAKZ*#Rx`w%*wD>!~7H|rL>+*N(0nh^~ zwj%8LK$jM+X^9H|1$+t~^D8r6h@HT$Ra}M7K}ClqRHKy#j{@zTbqQSEoTk)8wj=^K z0Z;mI+B<;_A3vL7T7dq+@I+Je;`mjQ(i6q#pN_p=r6r%%?K)u3?3B#+)||HHG|js~ zPmT1qY18q01n8=!E1&KS-si54#BaFzd6yfS8W2WIFNoHx{ZznpPclr@*v$gTyMT_n zX2?5P$1c1*)r@7j4nbH5R)Z5Y$?1*mo}3<*k-?B^IXnk+Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91B%lKT1ONa40RR91Bme*a04fgS`~Uz0s!2paR9Fe^mrF=hQ51%?hha%3 zl!i5_khF(k5EKO&VUJQYlvfAKr^LLu338oD7_`9R_+$Q`qa=qwG6!*>|1bkeX4Mm!^-7ome3 zcno7D4Rn+ldWbXPR!qY}a__=?*GA@7xCSqv9p1n!SO5!Q6_h|4cxl41nYGp7195GN z(a5|7FYP#XK}OuhkpMYaupd5wmlhnu_A%HMiCQzUrs+0*jlzgTZQurYsY$9MT4@1$ zIff(d^bXgt+QLcSDRybXwj}7&?s5%p#cD)O9#q3q&{y;kn&BMe`!@Jg)K#$Z4r7|n z4QztiXRNeggr*653Y>*Lh$p`Z91J>+DEKse+MBGD`Mg1!jCAmu-cFlLd@9sKvT}*U z$*zw*u5p`<2Rcb5E>Y7kBS=8O))b9YDqJ6#bkO5ES!QzvbrPyv(nXs@Y%%n^oS)by zU=wVBO7Lq?Ys*i&zE~?mrdMy@Xfx2uT|wtvT*a)hInwbJz&DqB#O4t@?BaFN_@t=9 zuTE_%+JUXCwFY`MyKSTMrQmysuhRLqI=k7~!D(O%(iOsrjsq+HQ@(G5POo=%p0htY zJ11%#^Bd+#;yFDwh^&H@SnZD zCKa{{IPqGQ3IGy81W#C0`! z0LhBZ!r?^E%(l-7bOL?^I`DC{U(VkB$`^~=p_$@B4OhT=IWpTuMo@yoncn4 z`#jks@xzgU-d+BV!*(k`|_yDw{K*I+bY8Xz&$b zUxCo{O;}-iFgybE+zdZI;66thU3c8SwR`w?9-^T1&X8j?ZA-{}c5$pzkPYUJ6F*Kz~ zN!&G*s5Qg1ocIPx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR919-spN1ONa40RR919smFU0Lno(1poj84M{{nR7efwmP<%fVHC$_d=%OP z!ph2xMw?0@q;^6`U{K(yg`3D#t*o$p1cjR-s9o)%mldsqUZA^HV${&02Qe5$nfB1= zq2WxwbMsvO_cC`HXOR?Y=wHLgDH3pqi`*q zPG`}T3mfi)dr*qxD0&EOW$#RL4P1b7WR9lOP?hun3LZ5LYiPI&ow3Fl{0Hy`#$gq- zz&6+o@%3&IJIL|>K^GS`wI>|`mG?MDU}aJ_xh-HPGy^Jkl6oR>IxcD#_AsoE6cur( zZG;S{^c87IrKsGc)!4RawKn0`Ll^YJG3bEE5#u+&6L9&B(X8u4Y?AlA5^cvDc~X4a zXcFS`mO!sAhQAiROW`HWhc*SRQe@`gFo}VGC6+Jb4#axSNzp8JQqJR)E- z+r{R(i_Y#19!%O;2Zc_Z9F0aHnU`R**b`zmxUCycdJt`6(B-uoX!|wVFMeQhlpPq2 z64%q)C~@8IUzp}0`7Z3}0wJ~xzDdshk-8*r17uwCW@e!sZ2Ue2mk-_-YBDE1i=Kz@ zsj-hr&P^L6AKgjN@#}Uw+|UggTOcP3oR?gh_;tx8na`3E#O>bi@HHcvg#C!S*brH# z1^6~(^iF%N#rmz*H2m+&V=_`?FrQT7V78EjCz zfMIHWp#!1DKCsm^!7CUcKaEZnn(WO%Weg|02FaZjX4s?(26bob88{1@DqKEnj~ul} z*}#ta1|0C%f}TT5_*Xi=YpMeLeg277ZX zMeIthUeqSVidoFwrFy}>e|xG=p!Xg(7(Aznt+RA-pP)%jF5k%o@ZI3;>o{{gfHQx1o`~Uy8b(F;vlaEzsG}#i_6cLdhHUf0 zxVKCj(+za=bX|sa|p?Db;6khUY(02#KXSiksjeF!7sLc#+ zoZ`VVI2jbb^zT96?}&3Vcp0#pg~iQ|z{y-gFof|A`awsWOL!Hq%w0SK&v@0KxIwB1 zCj(PK(Z&DJ^nO4-pYSqh6|f8z&q`gz;HFN2!t#fasn%I1YwDe!A1ocKZ2%G*{0O9D$9%I@MLL zGWgO85ZyBh$H54S1Np^Hzuf6p1JYbQOK^fFU`t`St1b?TFFOa&C>((ikYDfgo1K0; zAkEdY0_VU+U|l^ZzJ!40;*IXf;Pk)<$nSQVOphJ;JUuILJzyCux{9Ex`1AX6tva~4 zQ~^?ft=yxUlfkLLOl^PhpLY8FPG5GUIeJEGOsxi%!BWktT*ap1)j@ILP!AB}Epv}z zErUZa1oG8Re^?+rLvRF^!BPxnuIk0#2&h#C7j-~_Q~^@FsrJx4inR=mz{nAT^2eS2 z1pPS?=jd5MbGOC&rgjWVF-TXbRw@2^p!~jgmuG|GVuUmb$m5OfQLJTf91LOn#q`&X zd>-Ku7-1;}=_UL$vq5p843Hr805RU=9@U(w_2D=aUH;#ozbE1xf)lVFEY&Qz zDvQ4glpu|OI%#kb0-}rN04d(+p2zldA%atZ$zc3rfiid%Fu{s_#r`r^DgJt(=%!Uc z@!_=r(LL@Q!EwhB%0CnRD-q{}2#pSl_q(&`s;dFT2MLLFC^q!2EeDjjhpr(Qf(ZS) zBhGbr4$R$ExoT?TpyEE_UY6FU;lT%cfa0%Z1dzv@YES&NdbGK7Dlmi~{U;IUWZ)c_ zJIf<5_NiJG`&aypfLhu}3=KY1#he2Qd%th{HhT_`;*IX9;LO2Tsti~K%RwprdZ6O` zaSw4HaW4*PH1=i(AE;d9b;tp!&Gv{RAjMnd9>U=zhyHtlxP}9BSOgXO^!Rg79(~@P zJE*EYodk)KD?n8p5};^Py$1CFW$vlq@Y2r_*LGNRRS%TcDF2RP>@BTN<>15$5@Rkl z^sznJUEe|8BxHb=xQ7?KrYcaGt1?hi+k?_~l-DQ5-dT`1sRASyG3LAu=|gpD`z}s3 zr~>rbaHtAa1xn3CoNsFT58hsVI@?X0kU^@txrcUGhtw!!fEaPt07x1E<7y18D=T{9rbK~=Grb$cUj$|8@To<|STsVz#gN!A#9zaQw*M|tN5@)pD=v~o+?3U(xF3Eu%{35R zNQ^o`%A$_nMN>PhMed@l1ClaO?k3hIeK+anqAKzT$w57j4ANZGv0->@c}I5(E|M}x zauYkfxQ|`~kwxAxq^ur!SEs1+kJqYUsA>@pza{l*Q`JB)@Z*DaR*jdis|#z#rbeQUhu)$HDT}7Nu!Y$_rl0~XvcM__r3Hy2&q?(;w6L>`KzwZA<;#*1c`1Uq_~f) zE7+{@IC>r&if+-C-fb?JGW3+XM@BZ-iz zx-_*Hgj98QY#OF^hcpK%YaT{By#J4{cmI(=>iyDCeZ)pCJ0um@TZI&INO68aQuEM* z)a&pTL+Z8Pf>d>ODzrT4mZdYvP3-XIAdR%)cSvXI4rv2=RY)=Jke2HXX#=`SNcZmU zPy+NS-Cc|d()~NBmb>W1zmsBQkUneoUmSW`0_nwmaaaQBQ@j6m7w2_IaUXFnQ(GC5 zKxL3VZ}(rpC7p$k)HK9B2-51mg1ejIA#WaH(dbCxC4}_Y?*E=dNNO4~NO6yGpWZaY zeY=Z>AY~n1uMK}ob%`#j>QUTF)-;T?-zlW5E>#^~R+nN^BXw!(psJ{2J*t|9xWCcP zZU|CUmwNwWYl=guwn<45dBJxU=76d`%!#Y^TQFaDYodAH)G43J!; zsFRC&Q5W~;QI|n-9?zo(sTXuwrxQPwb2U7bf=^?kGmQq|>E4aC$AYZE)Yt%0flv7@V8#D-z6s~dtOQ1MVm zkWO(EJ3TfL*A6O+IW-GeM|X;g)YWBCcK|5{A<<22ASyTUN7uR7yH-#Ype*L%oN?Z% zJ)M8VMOni@NJoPN32DSl>h%1lA~g}c*t<4RJwP6F-Ymp<d@4VW6r;e zMqD%mDF!E1pyVcjioceybryS5JM8v)pe_Ncg3|+(b#qzF#k~m7l8&wf6oV5hNODsZ zd*1D_J~=2xU(Z!*!{XX>PZeW+E=4a+Sj(usL{~Lohu!u^$H%`<(+6 z=Vr_a&}uHy;Dd9Zvig*P@@C>wdpfwspS#LoRlw%J5l9Bc;m|#bH}B%S2F(FlT8CDJ zL{MIzmV)y5i%W4=xwA50E`o3vE(hbzareYNJl>W9>eZnhq{V{^tPRTJuX0sfn#Z66 zb7&*-=iD`VN9CT_pW^K$0i6UX1{Wcyc)38SKJ`GUJ&*4Reelv%f+c5Vz#Lizk1!lc z1xC(M?Q!?$Lsj2FagI4a-YBdZa~xc#0_F9o0`;LCen(}lnpz*0fH^b=m&xbpS*_KB zlex#ggW^0rKy*dTa50Cp1k@L856a_Du2QYaU=f%@BRm)9=vfDo!BOpzdpzF! zJ7_7O3eqZri#n*RJ~^m&?dc%z+tb0a_>-$LSdVQF%pE3ZqtY{iA~3Q3)Q;iMJsxjy zjyO-8E6&#gH0Pq#1{WRy6>?DV*A@q3{K-`rEY&OrCTIj#$$fiZ#NadlYYR zjyR74(wUb43avW0xKx3ns{|@@RR$|!rUE8t(ql(HPtRsx6l;W&xkrHLo{Iv~;7cTJ zMzCU|z4&uisa83xh!@qY449w^+?+I5&k~Gkj$%!4y!K@7VY~^D-v{sNMFDB>W#@pB zs|1VA60G>^c83X?z|Bc>^{gBt*AR}JBRKA!s|TdPmsX&9@izyH?s8}ZHzx<;Q0SVa zaH@E_I3NwaJcH$++*PBn2u#ojZcYwFPzYuePUfDG`t$05G`NWj6k*X-87u;GhY6a4 z8%9n9Max;aoi+AKW;_gJ-Y^%%NrQD)AYvnYres;c)OEnRpp~QG}L(TOzK-cX2P= zYo?nSJXj`PPz5amHzKZ)L3xvKIC#*WcyV*!=EOCYLXqCg;K4`4i#Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR919H0XL1ONa40RR918~^|S0A#)Nq5uE_`bk7VR7ef&mfdTPVI0S|6=pfu z8e(hGlxQd39Z`8l?rIG7 zHxPe;pP)5|hiM;bMveH%;Off?iZXBooVW`qJRlo;Iin`@K+|E!pj@a$)fm+bI@&rTjO9nj*RiQnXSkXri zud0by(cX9x;?>ZRXkVx8?^p_+@>}s($}`{{(-c|cAij{O+j}5YoM@Q^ms?_4rEYgF&b_5kC*S zlZR4;1sdekfp!FzhiHw?5oKs*K9f8Q`Qp>G;-U8=B1gFJu3%iv-39-m32 z(oqAxEnLO&AmD24>rW+*qCt%(c_7T=-R{dPqjMp=g`{W$?cI6F86DJ|g~1?rir6bR zHm{7%1rUp_$V(VS2lZYDUv>9`U7(OO*Vn@B-YWYVgGRCh9FJ77vi*Rft6!b#TngC zxb58UFqLl6m#q=VC@A2sio7~YAf&qUfoYrAE1jE+PsGkxRKA z)*#*@=6MY{JULB;8+yZ%xAZRKnlN{3{-_xeywiZbzTY0~cpLo?eK4E2yQrH^%K>raef&!d6`m!opwt0bw(F&3dRYW!( zS)z+3%wBMd!znCd^%XHqN7kqnotocf)cv=9&T~%oxb}{2yB{C-{(Ej{{M<+9+x>5! z*If=Ew=Ul|aSv8@n~yYG%JbX`H}wEkWep0qKGTeA^O) zHa!&k!*VnFgx5}nMKTfX?Lv=tKM#GiEh&A6^nh`8Ke~*Xp)~*8% z{^dQp-f+E`eWH)8L}cC}aS4XEcl0i$eL8iZVF}CG^b56?%$uaNEi;;A{xm(dn4Wn~ z=>Fm3C#*ljpNw7HU9>)PPMhY9CLsyd^D~}kop`sp>H6YVcdkpHT*o)p?>5_ub1y<{ zw=)a*AMmTz6bsnX>92f!ePV0PO|IaImqv=R_Z(#o9b00n@S3xHvG$8n{%1=Ld_SDE zWLBE_iC;>tx20a_sa;ujyXkyW|A(B}Dl$qJtf$&CsIU2;^@S^u^-KRLhFGh}$SV^2 z`&Jk$e(j5Yk?yvhp~R+iPpSA9mQ8;3lR_9Dg2;R3F_=6}1o16ax(ze!vQ zIxGFccmc~Y#hYpxGVP8Rf05OiSkPIo&VY2 Z>hs_Hu(0}(s4*z9dAj?Qq8o`;4{*kIHgS{W}3V>d%LX2)28|ZzSjP0|5y}=@cErP_2|KM z$Gj<%eT7hK1Tku#mx;}DG7wf(cjfroZ9|_7z9MYBfurT)ST$!v(CCOc< zHgIv?Okp~HNparAUb`O0q~P2FU+cbKXMESpl+~+x;a=F!dt+mB>YN39?H!6No&QQM z9ZHEjzx3D2DO(wpgH*cp6kG22o|9bd%HTVppvZvTa>lF7TMJGd>wF}sqOh^yYl!yW z9daSo=Do%S%h~*m!_Vzv<`Uca;)undQAf5}&8k_?YNU5)R0O+j>I~m{_R?e>kBd{aa!l_yh<*(c32gn<8DgG4 z>HOs`TbGZYJ2u^G%t_c7q34n36403RXi_C7mvn)Hb)Hpc@QKq^t&u0HC+!zl>A%%i z{5tmxh5fh0MY#0ER~Itxx7+^W%o4p9@#1IKL@Z8sXV7-lpA~)LiPVq6c8R7LZGUc8 i8O*X?e&xTt{{!h)SKE(nO?dp+dg)$(@{~1{1I3tg>I#ouv=CGwWKa4q6e5ACFJJ~EoaHG(UX6_T^#gV^FZm>o6i$1=6wf}a+ zIpwob4+Vu5Ox=FSc#eb4^JD8KxCJXjHz`*%mTh;lGt^C!yme@&{BsVQ8|>Me1DPgm zduF0F|J(6L%tjnSjUN9hcQBrv-SO2~=!?|uL#CO}Mf{t6-v8zL66m{==~=PD>>mp*O%t01Z&J3vL6<;KTxS8>}{1kc9kRxtqZ}xM+Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR919H0XL1ONa40RR918~^|S0A#)Nq5uE_>`6pHR7efYl}&6-Q51#WYqh9G zD5BCtLbNo|0WqlvO+?ZuiI@>1Mbij6H0h)hk|Kr%2Fx2%l}Lzz2m@(oq9_SbHStsR z)8|{)-N$|>_rA1Gh?T7DpSAZn_nvd_IfcSMMscq5l}e>nYInm8umLWD6YvqdT`U&g zVE+tEQU`nBQ&yMz1tYd;zv+b&_8SPr!KDC&;yA^@JP+T1M@ML4#}w1r;3XYT#*W zOzkafZDt#SJ`lfWnyhRui0fe|JO~fKHSu8Nj>1`J=#OiX7*$`RLCaY7X2crkwH2iH z2lfWkJ_ZmErn<}|ToOccNRCTQao+N>;AdCcXIf$rTAe6&lNI0} zi!_CA;m0Viw{LWP7o9$0d7IEL=ctJ^XwUpIJ|pgwj@3tU7=D3<0oU7YN$d>#y{rUh zop{|f?QnUy$z-O>k~`yS9+*b1&E@58mR6G%=xj9Tr#7^igPr6@zUyLhht0vZGqC*z zFNjM{TP@!v)In@mVGefM`3($a^)6iq`$lphTrQD^o5A@0ByR(}R8fj`=3wtTUwd%K z#pdc5^ho|)9!_uMS8g^GA?}BU4>;ke@$Z>{)d!+I>ww$gRT$$AiG6S=61MpXn-Tqy z)@vg9t?+BqJl|0Nxb5w)p-JdIGmPPcn*@I^)SKtwA;P&F@jLl$dx2m{c0~;*gNTEs z!{HLtQ6*@gQFsa_*ArIft0tGGe^1N1%a2p$BkJ<>=qW2m0}AxT>Wj<-S{Dk71iFNETijiUC`oF3&vZ&8OfyN3BdpRTHX- z=33aF4v3i(u2nsuH8M>j?1LjvUtT2~vA#ST{@GpPzokN& z>s-GX25WduTBNVoWn^pnzHop0+plu(O9gZ*-bGcf-Fp3Adi~v5v+8v`m;TC}b!~Dn z3tz*Vvj*JjA4E=4`TXK5ckAtkVmb~J|0ozR?!IQqB&&Boe?{0c&o}F{1cdUZgv?!5 z%i4EP?nO(S1iR=qoy3@!VgVtO;_iJ33|!wkZP~p6Y0VM1cIR~0UkP(Os@3PT z2yfV{QpPs_`zzzJV43qdb8ZEkZV)aoIb3@|D55UuPHT^IfP*Q2(XebEtF%>*d$66ziA z^1O{Iao=#CMR%(23D%Ooy3tJ&Z#BmCAZJI_+9{GRGdiD6i@dEvY{o79PJ*dx7hGW_IM2z@y)ro=R=3HQDvX z!T+h5qinEk%%uDUl3ABa*zY+`JmT*q`!^^N|||JdrZR-8)g@J}cR58%1PTo-O|eM+_Hsj2+In>gJL z{0=fXb^Vj*w7sjRtuUFns!Ei<@t=Ij-%{ttb=xDCE&uVa{|{@{k-X|lzh8q=FoUP7 KpUXO@geCyW z{Pp)%&-YpGnJcm5)%Cx3uK%6$d(QL6wapLuMVEa&owk|viq%5yRSN}-3K*;tCH4u{ ztIz6nV7pY}nE2p$o{v`3T9@hW$Er7Q-Y#JATsz^(QnO_*&fb&IcewifWQFer#&u8M z7cZLgs^e_HX2tnOcF0sMknR%xr?PYP{o4F62i4@OtTTI@C0esTi{>Sql26;CCoFsT zIpgG#ldiWmXUsfOD7j4h(Ps4{oYk4kkHbIT{^R;xc*pA}u1?MYdXaxpD^ zX>@w>t49KNqSgd_Y5O;gOw-bgnG^kg%`m*rzmw%2!qv@ws=zlLcaK{qc~n z`WW}3`BY21_qtT`-P46N*EKC!`nv1Kyk}>8jqUQyjWZUUk7N4pH20O{iwk-O{VV2Y zZ*l!+eKEq@veD$F_|pHUWomyON}0+YlHDq|g8i=X{Pp%XL_ht%Zq3b>XcC<-21-{9 Mp00i_>zopr05fq3@c;k- literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/reactions_bubble_shadow.9.png b/TMessagesProj/src/main/res/drawable-mdpi/reactions_bubble_shadow.9.png new file mode 100644 index 0000000000000000000000000000000000000000..531c44598f53d01172b3738d945b0548500fcf57 GIT binary patch literal 1722 zcmV;r21WUaP)3Z8X6hzs5U+i?>LO1EYx9|UKDW}4bCu4x56jNeN-S3+p5kcbOXzm3hD_wWKcviHj zcxk3yo=}c&Y4wo_yK>ReD-+7`Q?OPSnP3fuFZk8aYoWZ}f|c{F22du{f{_4TH@(r2 zk4a#2A)P!jff^8p;Sk;|daLN|hPcjnhn0|40VpSRC^aC!0Kz*(?+$uzLK?$(U^%1~ zpv-S^I5}CZWB`&d0P+5y4+ecW=*o0mxxOpnwFRbkIrQ^ob z)jbYM&rCpGV(FgD|6Ty)18Xj!Y-IBU;xGX4)u68jeKY8BL%OCh8VfLolz=pMtGsG( zUMTWm2_;>kUXVcau4`d{=m*^l`nKpv(bFRS&2^2{J%G})^vndLxzjz1z{!WyprlLG z3uN~MA_r)J0Qhdu_eDQ6#C44Yn4Y0$B_PeIxzj!O4kvG(f}*B~OJsKkf-8XW_p9Dt+T=E9j32?a1TT8EcuFcS$brMdj{sI5H-Iy-PiQS+mG9LjyUq$PI`a40L~q}-IFa;4vRNzHOi zg264`a7Elp=%(9km)aS;r`+?MSUK%uP8o5+)jOcBUvo<)dur8Oqg<6UC*nEf zw2uUn2Rh2A?{)_$--*`X7UZt+9g0IA<)k(Ffo~E_tG{rdYn9O&pdjVaDklznkGk!SKOSIV*P#dKWO=!eBOEN|)w40_L(^TU-u!l>?q4!CXEPl(>9|ye*?qFs%l> z>8~AHeP**?R894n&3?5xr<^wZWq7Te=DOw_a2(29w~Uoh6^xe?yHm?GH{FK*;C85M zWK#}&e6TzfoP@#$MnBLUZC>)HtCVS1M{;01Qb4?!jyrlZ>f&UCdk*@I_DobiJ zKO9m_xrUO`0Z9|8b~zEZ;G}yT&|D=DJ+lR6k)N6=rr^kqz}d`?6BP-@ONw2Jesk5` zh0}Mp2SD88fE*HH@eTn2!-3!u4sd;U7m9MDudoZXN@x}sMZ&=~-fw_ISv~k4Kr8&F zDL9ms64DOvpno#2$eX9&sPkWUx22_b&;jY))uPlSfh5TRHE~^Ib&op)Aew{H(cH>m zQ7A+{qy~rGO4}iQ2lphP2l3x>h6Bp}&c%~1>c-~UH0MLy8s07!|XdlHcB z?vV7ZOIk3%03dPQVdxnNBwgZLatq46fFbh1ny}^`dQSpUQ`Cag3mlZB-NeP~fY3d< zSIo*r*eEtmpE1Y3xrCpbhfNp Q*Z=?k07*qoM6N<$f;&kryZ`_I literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-nodpi/dino_pic.jpg b/TMessagesProj/src/main/res/drawable-nodpi/dino_pic.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5bfe7c8c9131b7312068b7c3e92e0d41166b39f7 GIT binary patch literal 4709 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 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/msg_reactions.png b/TMessagesProj/src/main/res/drawable-xhdpi/msg_reactions.png new file mode 100644 index 0000000000000000000000000000000000000000..5905cc14e8f889817f30da4c23f7f13675f7823b GIT binary patch literal 1526 zcmVPx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91FrWhf1ONa40RR91FaQ7m0NXcg3;+NHU`a$lRA>e5nQMp@Wf;d@w{)p2 zP?1ciOz5sA3Hrs_Bp2$N`7Oi>BJD%bhX{)ZB9?AsbW@^?>|&V~Sr%o`8dyYPX%Q&d zWy#9Y$fD?Kr{DiH&)NUZnR8}#XOBUg2mbq9-skc@Gw;0b%-K<++SI-R?JLl}0{`U| z=qOXXQmGt6{7i5h*wN9^@pYMehb@+gcY+(iZ@_6I%H+c~ks^hd(AnTAunT+w)`3l+ z5$$JSR*~E-_hBMS!S9V`n%K9)UjcuZ-w()hvnGgrG?)!~Bycqfn@T~?C`UQTW zeBixd%;0}vo8!4k%Ouo#4>~gvVps;EiM_}ZV@w?Vbnq1j`W4|C5HYf=$=8AVZS_2* zWD+j~e}bS>Jt0PKVh?({iD}sSBRIvkpm!-B{AA#DrbQj>6Tm5<7v==r4AOKE!z53F zp4Y@l_?%TLWMcK@a_&gUdSuqtUciCZsus7*{EW_LByz@K$K z3CuSP3{@V`82SZf`x3d>fs5na7WgW17q|+PY2tX|KL$bXq#E$aZc7>%gY&)!fY0!l zhBA(CSkQuS#8$S6N#yu2$-Ou7ienoG;sR;ORL=$Y^C0MQk7+35y*47?OWhGYuZgSi ziHT%A*b^Dw0Souv;9 zI(^Ysf}mRx-}zyH?@Z^))N#~9=PziwrQPm~UbG24^kY1>k&NG^AZWAvP>u$wFVbDp z8*g*MNe^zChSP*j?WxVH4UFP@q7~IE$Y_nix0(H-frtzVM;%^4I@;d^v8J<{(0fgc z*KM&GC7PPZ^$iG`E@zZ`!vOEiOK@M>8QqslUK6{U7RVW-){9pEO1YyiGTU2CQ{ec5 zIWG)nY(<+WyyhdfbL#l6^N_}{=?n?d$vkNH@_0Gl7M}18K8T*z#E{m!=MI?~7hC-; zX8+vmjX#udIu~f|2UU-COXO?5ZaIbDa5+U!i^A|PA`kL&X0I--7^~wr-eJxXwLjP1 zLy*0R{<;Ju4CEdQVpGtCtS%S$au9TX(-L^;b8l^UC;VY}RuiSxeAYy$;~zuS7e{QD zB=Zn^IV*0E4JS46q`ZwDLG~s}ulYemQOMs3v@}J!6LAM-RW1Mi`6wNispH!L)>xp# z$3XRf$qXuKB=-UpNoY@`L)SZ0(1Eb$aw61(Chhb%N=up`ub%^V#ssm?vAmNy2t&Rr2H;PGeMp=@J;+W^ql`!se4WsVn#{H0Gd^yxP?C#-HbBhRhj#Mm<6 zv^>T}gp+xNXGh)%Y7btsBKYabr{h;g3}Z`x9^{}+2qVAqk<@>|P%-@icP(gmHy9fa zHUcL-OVtU&F9SaLchU7fh}ICvuLJ%9h+5eXR)NJ}9+(UC$*7&ocNEmhdY}h+GS~o| zK0q1YnweWxiu8cbymCSLcKo!Q&H(#TFw5A^J;VEm=pU|VQkf%X;n c|6hTB0MQ|lMeU678~^|S07*qoM6N<$g8xsv)Bpeg literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/msg_reactions_filled.png b/TMessagesProj/src/main/res/drawable-xhdpi/msg_reactions_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..401e13df28e52a22ba6814b66ee7d8499a8d4578 GIT binary patch literal 1195 zcmV;c1XTNpP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91FrWhf1ONa40RR91FaQ7m0NXcg3;+NG6-h)vRA>e5m|3WeQ547Txvt?F z9}pf)8DC5#l)6f;3=iVXo4G{sDi4xZc@w3Sh;TFIO7}q*ArCi^2lJGYjG5=__dk8> zw(Pz$ednA@`Bwc~Ywfkyw7>m*d!JKNlTx|@=?bJPkghJX?6*7_vep(gq2VhuayXVGD)Klpa*#{$Q^+i{#0pvbl9H_Igs&SG`03l_YU~n>c z6&leGgKTl|{-6!Kh?-i2{0@kY`NGj>1I7LYws>1vGQkdjkgSO*7~+~Z&Um+|=zhqT zKt0$Cj8y0dD-KyNywL}Q-eyb02`~sKc^x% zY;n9cZqUXErbqY;JO?YmQqTlEjYMe$ufQDe8hBcOqE)TWWHKMYPxL2#0`fGczjU%h zZwpL$R3!vIfT#5+NuR_ye0wP+ywL|mZnIL5HwU(6vz5dNqJ!vp5KL-0O`OMH+i0u; zIr@%l%`J1|65oKlJ0)jhIL-xMKuFd^Q)ocp*D%m%(E26?kg&N+8GXiccO zlYy;Vb(9MbK7pssR=mjG)5+PYO&HL#K(BH>zW3t6j; zMZ6k64}TC_5a|MGbe%fhnc{iD1~eJxPq2lc?CVfpi7Z6-c%MzX2Yos~Tle*xCR9002ov JPDHLkV1kQs3UdGe literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/msg_translate.png b/TMessagesProj/src/main/res/drawable-xhdpi/msg_translate.png new file mode 100644 index 0000000000000000000000000000000000000000..6e1b2ed0971f038be270c26fac3e521d773b29a6 GIT binary patch literal 1219 zcmV;!1U&nRP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91FrWhf1ONa40RR91FaQ7m0NXcg3;+NGElET{RA>e5m|KWVVHC&bFc>6+ znGua4@gPN+l5$C6lo{j_c~WGakdoVE7Mnfg8SYwd6E@7v$r1qFG^&p_{(fn+k7_#d70$+ReqPXSHj zX=R+BX}+At)ATW*bT!uvWPAr`c#vt@@LyWD6`0+*#V%rmm zL~D>!XgkH%gI^$*v@djn9**614!XXB&ukCBI91Kug)vbJxNG1-)I=G?ozEb)pxYgg zMBIfkhEbU$HL;cO2aUWL{+^NBnEeJL_b!&ncw`pSbNC(;ma~p2egNDC)4~+RZyvC; zAxvB>K6J6jbn+2?WKbb|u9=t*@I^r}vDqnJVVV*4WU6A=CxZ@g?4-S^{BvTXkqg=l z<8M&mR~TEp@%;v$txdtNWU!tl%D`9C*aP?;ixS;h<0I_x;Osf_pqW~yxsA3owh^Gk z_`HK3YJL7IPcs9+E7M>*{3LA({*_^dw zpv|NBb#y&;C%;1Yp7qG_($7DudJ3O+ip%?9N!TLzjs)MG94f~9eNB}uTFDu|AkPYO z5%_I4vGV4YwWE~LF*{{_D%1dbRB&feUU;ihCBZH`PXkc81#?&h#vh<0RgOqDlI}1? zgq7xH3zXBUOZ!oHt_SoB9OsqD>L-XEz(Gm5^Dn|(4T>{&5(B#DYTNCJa8=E{b<=Py4U+~u0qyH=;Nik?N z$%K{L?R%6qjmU-Hl>kUCc%s-C`+!EEbVFlw#89V3M)}P%R&DNB=qen!3c1|qp2Ao0 zA^z6rJXw6?D{KzNxuC(sEJ7{^O3nCfRl$rM@bdik1vQ`+q(>y44D@Y#1-{2(OfTc# zJMe@&>5{Cepvm@bg+O_XLVd`4XXw(BXAH30Bw}b<-j%6~3%n|BeGBe_Y|sXh=(d=I z{{ZAs@uOl4+T$kp%YKfr>zU`YcNb!In)@T~mkF^q>Q{i`)utI?1NV1)Ls4kJa!0lRqjgsnrI`-g8$*x0Q3(S)2{mE`2zYV;!Dw~;B#jaN7GG8+;SjqWLe1T(v8oGKZWHJRNlgoh}aomW~AVJ hP<{sTGthfy;1Avojov@tK%@Ww002ovPDHLkV1g41HLCys literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/qr_at_large.png b/TMessagesProj/src/main/res/drawable-xhdpi/qr_at_large.png new file mode 100644 index 0000000000000000000000000000000000000000..39d79e4143d8ab296215add64f8b20943f689a17 GIT binary patch literal 1795 zcmV+e2mJVnP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91IG_Un1ONa40RR91H~;_u01a1YQvd)4ZAnByRA>e5nSHF5V;skyqf*jw zv=J4GQYP!oOIhNNSR=+iSj#_TiOHBh6w5!@@{%Fr4==UY3`>NaO>Ax6mWqZ+CDuuq zw^jG*t~p8G!6eLvUldam<4=Q$_VZ~N}PuHXCbey;m^dkTdk^xu914fRaFwY9Yy z{`-TI!AU^z4uCyiD`;tGXxPiMZq%U#Qc!m?y#!1F=Yz4JH?XJ`!Fup1SPqs_u!=vt zh{A@0XTa~E7TS*S(_r*rQ6Y((4VHm}prdIe4##y#p#<&&o&x(pJ?S5uF9405Rw%*F z0AGU6q%8!~cU@m1$RtqfcUJ9-(XTnPy%k2!qBy@3=Z^tR{gr4x3Lk=1;0v$~>;PI4 znm}JL42%I6fO9}B&0(gU7poklr{W@C`&#s-0~HWW=nn<=g0DafJsj=4k|NPGEDuzO zx&issAbLbtaZ7%_sSr=%S(cAzK29{DguXc~508UmqMb%4;;$Q+1@;1q_8`zkqB_D@ zOF?M1RPd?Qd5^Qg|Ak;1uxKNK>Xr};wa!_j;wHtVS(_Gd27=92BJf`dMeu$z7>&Sa zEzsUFPuf3DVZTW{TLi)D4vU-&kb2Q z8;8q)Mf1xovK$PDfkhx@r?VQpYqK88d+1yVELvJ_VQ}!EjkC44T#wA0P>?l%2Y?pk z_L5%eiAGvQHu5(Nr^&1oC<4p;$pf=c9lp%`hjY%+`&`f^Np7=2_I zzLzTH8t5-JY!dcz8be$&`aQtyU^lSnI|N6$c1at)HBV?$;9dGO%(OlF6Zq(%#JT%K zaRAuoGbr&ibo~Kwglq_CDe3wi*SPVLHj2}I$|YXrWa7Rdec09oku||g#->LSIQM*? z{(~&QTHL*aY!ia%Ug068HEXX9*bH`MZh^Ymvq)EbJ{s*~mUuHm#U*y==r+xo;;rrA zhQ!|U%+%o)sC!F`b{GO{as9gV>lkKb?6=A|hZutxc1P!B`2HK7wtPOy)ZrFrek*vf z?kaovBEZ{h@GW*ozn@`by>#;z)Qz)6O@`nPgWt#CTkMd2qha)y!Ov{>++Wc8mE_0T zA?!4QjA3Y5laJ3t_c9h)BP&ygW9-&ca68sSBHN*k1Gl-(?Ko{6Yi@D+W|J48(J{kR zC=|**18nrdj}6$QBDcU6xYm?DCbh^mKFD@6y?G>(S>Q9$w$76@2ex&~TI0$%g~9|6 zFJbAd=_eBU7WinD&jLklo3!JwNQ?MohHVqFg_fbi|CP3`7*nGEsw2-g?@JZ)4K!cO zYnS>uZ=IUgS0Db(hKD2)zy*FC8_^R^k%LUtO^B~mq{Gh*@dz;kvx9cXBd$Rrc$p!``N zK=2

@>`u0M^|}-n9yxo4D7NC_v6U<%vR5m-l@dZt;MZ<2ll#L^}db+vaB7zND# zGiuAKvUR)OG>P7UOKpeB?nx?#D&C>!nnAY!2Lt*#vNeO*+`a4#=+#F=kz>I|P;XjN zp9&(pQkj;Jm+M_2{>Mk86I7{c7r@Zj1#ZCed0-i^ZUTbABZOx~=+s|@H?0l2mWl(Q zqi8>lVy-;uUtkh}g!+Q(!6NVzsDhKBpQ ld;*Jk9-$*|;Q#&x{ssRP%FD%sSUdm#002ovPDHLkV1n1jLkR!? literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/qr_at_medium.png b/TMessagesProj/src/main/res/drawable-xhdpi/qr_at_medium.png new file mode 100644 index 0000000000000000000000000000000000000000..34f0977faf4b38ddba99a379ac7937e06866e855 GIT binary patch literal 1595 zcmV-B2E_S^P)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91FrWhf1ONa40RR91FaQ7m0NXcg3;+NHrAb6VRA>e5m|KWdRT#(TbTb<= zGgFJmnvzf}O@`?H5(SB-(Mu1~Ob=cPDng2UDCni2GDDIctj8`BJ@k-0Rx}!<77h|I zS;m;YjF)E2(j4{l`)|+QXRUR#!##U7v#mr z)8RWEybb;VmYjmrKi0h9sJ9dw^ZU`=-F#HrgIL|*cVLP7y2AF1usCR`jIB0X(G|XK z6LTim2`u?Ml4^%JiHWcdhgS`!18}!7xegk-gu+*IK|8WA9h?MzfgRu*d=FEag6~We z-+|eN!6W#7X7D~m5bdzmCZ#cdmv3Edp_>if1+nprD$%`1d0o}huc5o8Vn^Z0_r7JM zh0DvHTeYz^;-cNT2gK$}HA1y^l#g$W&rDZjV55tTu2?!%>z1)=Z#+_E}NTDKb5o}1-n5^K0$Gf z>yy^av5E0h80h#L%07th%5fmnC2f557cT=kZs>TR@vN2XC!nLbzSz|We#+%Run=?s z9TtBETkzRM*|;beu$ENl@^+AI<&8(3U`vvm4`So`H*_~oa7xX0N0JYNF<^-{8Esgx zQ*84cw!?!2SAe{YXc+x^knEuC$RRJLIf+9Dl3N4!4$!CeJQ+f%gPv|ux{Qnfom^u_ zb!|ukOw!|&?G+y4KA;b+May0S)?eR?csx4NeRNCFPe8mci^#8`7<8s3b~*R~6eTAK z6rRf(%BLkGI$a9B1$mPkbzSLiDUnv4NpBYD1${sllV(J#*!=P4(9kN>Y;Y3N^-$mX t_4PpIg}@T6Lj9~l!mW;!tnqA002ovPDHLkV1geL;~M|~ literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/qr_at_small.png b/TMessagesProj/src/main/res/drawable-xhdpi/qr_at_small.png new file mode 100644 index 0000000000000000000000000000000000000000..9436d20be45ca14ff7ea564f7a8b325febf557db GIT binary patch literal 1543 zcmV+i2Kf1jP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91F`xqg1ONa40RR91F#rGn0AcZt{{R35aY;l$RA>e5nO%rhMHt6@HEpFL z%QVgC!&36XQmG6hB2ek$A}FEurf$S6tyYT&vzwskq6;BN$|5BSg|334kDDSWtP3kG ztt~_}TeFXa%}QN+`~Ba2-|@_xXU>_kzU%JAKJe$A`Op7(X6BqTbDlZxm@%U^dIj2c z1!`@JM4)=TekniKfvdrEa3N41{ooMz7VHvgwc25RM}{%*+2DEb1E^v<5qE*f!!{E- zp9waDesC&w6z8pA)@hpzolOC+fa9Q@_7B08+89G=1_JN_aZwNlO%0!YEHi0_{ z{2G{;(7{nO2S6`44kiID^7BB7$?tX+|K};{*LsZ4pvtRXo!h1 z9y|iHur2!;@&d!PoWfDNP;3#4zrH+5x`KGug8jg`3O;$8GO<;->78KA; z1RY>(fy_0bn*k00%c|XVBIreCy$AFN72W~bZv}b@eh;#ytNbRo&5hb9(5{W44}^9I zB4uYBh>BQ)uxyplZ-YX7BlyB{GPoUZ^9o|EGJHgJ#e6&-p>iQBm3ZG1W-91cfMcMF z>8{?N3FC_J$Ae}O*%E(*eok8_KcusL(KHZfy&3E&&Lctq&^A>>Q@oh z8xOJS@VWlsl-4`*oM6McggOs|rpL=#T)RVIq;BcPp*`QwTa%cU)rEt$20SV2&@A^E zoTw`zd`RcE)TY2nEB*_ese5AzC-JM{kbA_q%_q=V+MB{h!iXoT${FFJNDN1ZlgKSD zlv5d)cl(;&@3<%@3v(zwda{}?5o;Oj;(SYk@$L}Xi($_-wAK?dAj9bvVA&mEAViBT zA)L14m7!jBc)f@I05SW72A3OAUKdqJAtmgWjf?* z7t$iuTG1o41eDo+1lxc_68XxjSj3`wrW4!Ea6eu(RD&~Hy+AIx$xu&(YNc)cHT2LC|B2RdrXes%a+A64WV zzJfX@Hvo%3xHa$JU>>sc;%Hq2G|?2>g=kSL7UiPEuodr93NuN{Qbd3{_ zafIKP{X&D%i0+u6tvnOaN9OlHyG`F;Q~!WD^*Pa54Ll6=ZM2=Xe6XXla;L&r-1a(n z5z*yfEhx@o3Zr?Adi;jRxD_4XUa$r9fWg>qoGQH#v$IWJ*jcAonSm&t(vtZ=>2eF! t>5S%vX<kN%8af#JLY{{z-db@XjhbCUo7002ovPDHLkV1nun!zKU# literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/reactions_bubble_shadow.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/reactions_bubble_shadow.9.png new file mode 100644 index 0000000000000000000000000000000000000000..69c5ad8277dc1abb944a221a4cc5e462718dd6bb GIT binary patch literal 4560 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 Q)u8FVdQ&MBb@0A79X!vFvP literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/msg_reactions.png b/TMessagesProj/src/main/res/drawable-xxhdpi/msg_reactions.png new file mode 100644 index 0000000000000000000000000000000000000000..88424cb0d326d66e88ccd4ce9d47c99d371b8cde GIT binary patch literal 2361 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 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/msg_translate.png b/TMessagesProj/src/main/res/drawable-xxhdpi/msg_translate.png new file mode 100644 index 0000000000000000000000000000000000000000..05d0f18671a71e56c01e0193e9d96891bbe57b6b GIT binary patch literal 1817 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 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/qr_at_medium.png b/TMessagesProj/src/main/res/drawable-xxhdpi/qr_at_medium.png new file mode 100644 index 0000000000000000000000000000000000000000..fa8518dcf0c1d70f7eb3c26d042fbaefea85d551 GIT binary patch literal 2232 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 R;OiAaj&?4%YMX%M{{gobB_sd< literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/raw/qr_code_logo_2.tgs b/TMessagesProj/src/main/res/raw/qr_code_logo_2.tgs new file mode 100644 index 000000000..71c1521c8 --- /dev/null +++ b/TMessagesProj/src/main/res/raw/qr_code_logo_2.tgs @@ -0,0 +1 @@ +{"layers":[{"ddd":0,"ty":3,"nm":"Null 2","sr":1,"ks":{"p":{"a":1,"k":[{"t":20,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[253.375,252.125,0],"ti":[0,0,0],"to":[0,0,0]},{"t":24,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[260.5,258.625,0],"ti":[0,0,0],"to":[0,0,0]},{"t":28,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[253.375,252.125,0],"ti":[0,0,0],"to":[0,0,0]},{"t":33,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[260.5,258.625,0],"ti":[0,0,0],"to":[0,0,0]},{"t":38,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[253.375,252.125,0],"ti":[0,0,0],"to":[0,0,0]},{"t":42,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[260.5,258.625,0],"ti":[0,0,0],"to":[0,0,0]},{"t":47,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[253.375,252.125,0],"ti":[0,0,0],"to":[0,0,0]},{"t":51,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[260.5,258.625,0],"ti":[0,0,0],"to":[0,0,0]},{"t":55,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[253.375,252.125,0],"ti":[0,0,0],"to":[0,0,0]},{"t":60,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[260.5,258.625,0],"ti":[0,0,0],"to":[0,0,0]},{"t":64,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[253.375,252.125,0],"ti":[0,0,0],"to":[0,0,0]},{"t":69,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[260.5,258.625,0],"ti":[0,0,0],"to":[0,0,0]},{"t":73,"s":[253.375,252.125,0]}]},"o":{"k":0,"a":0}},"ao":0,"ip":0,"op":180,"st":0,"bm":0,"ind":1},{"ddd":0,"ty":3,"nm":"Null 1","parent":1,"sr":1,"ks":{"p":{"a":1,"k":[{"t":20,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[-1,-22.5,0],"ti":[8.25,-6.75,0],"to":[11,-5.75,0]},{"t":42.084,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[19,1.25,0],"ti":[5,7,0],"to":[-8.25,6.75,0]},{"t":52.684,"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[0,0,0],"ti":[-11,5.75,0],"to":[-5,-7,0]},{"t":73,"s":[-1,-22.5,0]}]},"o":{"k":0,"a":0}},"ao":0,"ip":0,"op":180,"st":0,"bm":0,"ind":2},{"ddd":0,"ty":4,"nm":"Plane","parent":2,"sr":1,"ks":{"a":{"k":[12.637,41.19,0],"a":0},"p":{"a":1,"k":[{"t":20,"i":{"x":[0.69],"y":[0.452]},"o":{"x":[0.31],"y":[0]},"s":[13.035,0.078,0],"ti":[0,0,0],"to":[0,0,0]},{"t":42,"i":{"x":[0.69],"y":[1]},"o":{"x":[0.31],"y":[0.253]},"s":[15.045,-3.387,0],"ti":[0,0,0],"to":[0,0,0]},{"t":68,"i":{"x":[0.69],"y":[1]},"o":{"x":[0.31],"y":[0]},"s":[10.025,5.541,0],"ti":[0,0,0],"to":[0,0,0]},{"t":73,"s":[13.035,0.078,0]}]},"r":{"k":[{"t":22,"i":{"x":[0.69],"y":[1]},"o":{"x":[0.31],"y":[0]},"s":[-52]},{"t":47,"i":{"x":[0.69],"y":[1]},"o":{"x":[0.31],"y":[0]},"s":[-46]},{"t":73,"s":[-52]}],"a":1}},"ao":0,"ip":0,"op":180,"st":0,"bm":0,"ind":3,"shapes":[{"hd":false,"nm":"Group 1","ty":"gr","bm":0,"it":[{"hd":false,"nm":"Path 1","ty":"sh","ks":{"k":[{"t":20,"i":{"x":[0.5],"y":[1]},"o":{"x":[0.5],"y":[0]},"s":[{"c":true,"i":[[-9.785,-2.748],[0,0],[10.073,-3.525],[0,0],[2.014,8.701],[0,0],[-10.841,-0.565],[0,0],[4.226,0.677],[0,0],[4.908,4.225],[5.646,8.06]],"o":[[0,0],[10.58,2.999],[0,0],[-12.974,4.687],[0,0],[-0.722,-6.213],[0,0],[4.378,0.17],[0,0],[-8.58,-1.284],[-8.728,-7.514],[-4.055,-5.788]],"v":[[-86.852,-21.107],[121.04,37.828],[121.043,49.217],[-1.939,95.039],[-35.635,89.169],[-66.913,39.948],[-49.277,27.303],[43.295,34.291],[44.526,30.201],[-61.21,11.74],[-83.062,5.284],[-99.928,-14.021]]}]},{"t":44.732,"i":{"x":[0.5],"y":[1]},"o":{"x":[0.5],"y":[0]},"s":[{"c":true,"i":[[-9.785,-5.623],[0,0],[10.073,-7.212],[0,0],[2.014,17.803],[0,0],[-10.841,-1.157],[0,0],[4.225,1.386],[0,0],[4.908,8.645],[4.363,17.802]],"o":[[0,0],[10.58,6.137],[0,0],[-12.974,9.59],[0,0],[1.88,-12.095],[0,0],[4.378,0.348],[0,0],[-8.58,-2.628],[-8.728,-15.375],[-2.98,-12.157]],"v":[[-80.291,-79.452],[116.546,26.896],[117.812,56.207],[-25.252,167.906],[-57.833,157.377],[-63.507,81.884],[-38.439,58.15],[33.696,48.095],[32.959,37.461],[-54.013,17.63],[-75.012,0.191],[-96.665,-61.799]]}]},{"t":73,"s":[{"c":true,"i":[[-9.785,-2.748],[0,0],[10.073,-3.525],[0,0],[2.014,8.701],[0,0],[-10.841,-0.565],[0,0],[4.226,0.677],[0,0],[4.908,4.225],[5.646,8.06]],"o":[[0,0],[10.58,2.999],[0,0],[-12.974,4.687],[0,0],[-0.722,-6.213],[0,0],[4.378,0.17],[0,0],[-8.58,-1.284],[-8.728,-7.514],[-4.055,-5.788]],"v":[[-86.852,-21.107],[121.04,37.828],[121.043,49.217],[-1.939,95.039],[-35.635,89.169],[-66.913,39.948],[-49.277,27.303],[43.295,34.291],[44.526,30.201],[-61.21,11.74],[-83.062,5.284],[-99.928,-14.021]]}]}],"a":1},"ind":0},{"hd":false,"nm":"Fill 1","ty":"fl","bm":0,"o":{"k":100,"a":0},"c":{"k":[0.996,1,0.992,1],"a":0},"r":1},{"nm":"Transform","ty":"tr","a":{"k":[0,0],"a":0},"p":{"k":[0,0],"a":0},"s":{"k":[100,100],"a":0},"r":{"k":0,"a":0},"o":{"k":100,"a":0},"sk":{"k":0,"a":0},"sa":{"k":0,"a":0}}]}]}],"v":"5.5.2","fr":60,"ip":20,"op":74,"w":512,"h":512,"nm":"4","ddd":0,"assets":[]} \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values/ids.xml b/TMessagesProj/src/main/res/values/ids.xml index 5794a3f50..3a204cd49 100644 --- a/TMessagesProj/src/main/res/values/ids.xml +++ b/TMessagesProj/src/main/res/values/ids.xml @@ -1,4 +1,5 @@ + diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml index 6cdb64478..d91ed0b44 100644 --- a/TMessagesProj/src/main/res/values/strings.xml +++ b/TMessagesProj/src/main/res/values/strings.xml @@ -233,6 +233,7 @@ Mark all as read Hide above the list Pin in the list + Spoiler Bold Italic Mono @@ -1019,6 +1020,12 @@ Do you want to unpin this message? Ban user Report spam + Translate + Automatic Translation + Translate more... + Close Translation + Translation failed. Try again later. + Translation failed. Delete all from %1$s Clear recent emoji? Smileys and people @@ -1903,6 +1910,18 @@ Events Contact joined Telegram Pinned Messages + Translate Messages + Show Translate Button + Do Not Translate + %1$d Languages + %1$d Language + %1$d Languages + %1$d Languages + %1$d Languages + %1$d Languages + Choose languages + The ‘Translate’ button will appear when you make a single tap on a text message. + Google may have access to the messages you translate. Language Custom Change language? @@ -4894,4 +4913,66 @@ Migrate Files to Scoped Storage Due to a change made by **Google**, we need to move the files you downloaded using **Telegram** to a new folder.\n\nThis may take a few moments. You can continue using the app while the files are moved. Migrating files + + %1$d reactions + %1$d reactions + %1$d reaction + %1$d reactions + %1$d reactions + %1$d reactions + %1$s Reacted + %1$s Reacted + %1$s Reacted + %1$s Reacted + %1$s Reacted + %1$s Reacted + + Reactions + Off + %1$s/%2$s + Enable Reactions + Allow subscribers to react to channel posts. + Allow participants to react to group messages. + Available reactions + I hope you\'re enjoying your day as much as I am. + Dino + Quick Reactions + Double tap this message for a quck reaction. + Snow in chat + un1 changed chat reactions \nfrom: %1$s \nto: %2$s + Nobody viewed + QR Code + + %1$s: %2$s to your "%3$s" + %1$s: %2$s to your message + %1$s: %2$s to your photo + %1$s: %2$s to your video + %1$s: %2$s to your video message + %1$s: %2$s to your file + %1$s: %2$s to your %3$s sticker + %1$s: %2$s to your voice message + %1$s: %2$s to your contact %3$s + %1$s: %2$s to your map + %1$s: %2$s to your live location + %1$s: %2$s to your poll %3$s + %1$s: %2$s to your quiz %3$s + %1$s: %2$s to your game + %1$s: %2$s to your invoice + %1$s: %2$s to your GIF + %1$s: %3$s in %2$s to your "%4$s" + %1$s: %3$s to your message in %2$s + %1$s: %3$s to your photo in %2$s + %1$s: %3$s to your video in %2$s + %1$s: %3$s to your video message in %2$s + %1$s: %3$s to your file in %2$s + %1$s: %3$s to your %4$s sticker in %2$s + %1$s: %3$s to your voice message in %2$s + %1$s: %3$s to your contact %4$s in %2$s + %1$s: %3$s to your map in %2$s + %1$s: %3$s to your live location in %2$s + %1$s: %3$s to your poll %4$s in %2$s + %1$s: %3$s to your quiz %4$s in %2$s + %1$s: %3$s to your game in %2$s + %1$s: %3$s to your invoice in %2$s + %1$s: %3$s to your GIF in %2$s From c1c2ebaf4690fd91c116d80db653289c9447ef7a Mon Sep 17 00:00:00 2001 From: xaxtix Date: Thu, 30 Dec 2021 21:54:06 +0300 Subject: [PATCH 4/4] Update to 8.4.2 --- .../org/telegram/messenger/BuildVars.java | 4 +- .../messenger/NotificationsController.java | 12 ++--- .../telegram/ui/ActionBar/EmojiThemes.java | 14 ++---- .../java/org/telegram/ui/ActionBar/Theme.java | 12 +++-- .../telegram/ui/Cells/ChatMessageCell.java | 11 ++-- .../org/telegram/ui/Cells/TextDetailCell.java | 7 +++ .../java/org/telegram/ui/ChatActivity.java | 15 ++++-- .../Reactions/ReactionsLayoutInBubble.java | 5 +- .../Components/ReactionsContainerLayout.java | 5 +- .../ui/Components/UpdateAppAlertDialog.java | 8 +-- .../Components/spoilers/SpoilersTextView.java | 37 +++++++++++--- .../telegram/ui/EmojiAnimationsOverlay.java | 22 +++++++- .../java/org/telegram/ui/ProfileActivity.java | 22 +++++--- .../main/java/org/telegram/ui/QrActivity.java | 50 ++++++++++++------- .../ui/ReactionsDoubleTapManageActivity.java | 5 +- 15 files changed, 157 insertions(+), 72 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java index a7a648a4f..dd625246b 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java @@ -20,8 +20,8 @@ public class BuildVars { public static boolean USE_CLOUD_STRINGS = true; public static boolean CHECK_UPDATES = true; public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29; - public static int BUILD_VERSION = 2522; - public static String BUILD_VERSION_STRING = "8.4.1"; + public static int BUILD_VERSION = 2526; + public static String BUILD_VERSION_STRING = "8.4.2"; public static int APP_ID = 4; public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103"; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java b/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java index 86c714745..568d4b7b1 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java @@ -1766,13 +1766,13 @@ public class NotificationsController extends BaseController { } else { if (messageObject.isMediaEmpty()) { if (!TextUtils.isEmpty(messageObject.messageOwner.message)) { - return messageObject.messageOwner.message; + return replaceSpoilers(messageObject); } else { return LocaleController.getString("Message", R.string.Message); } } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaPhoto) { if (Build.VERSION.SDK_INT >= 19 && !TextUtils.isEmpty(messageObject.messageOwner.message)) { - return "\uD83D\uDDBC " + messageObject.messageOwner.message; + return "\uD83D\uDDBC " + replaceSpoilers(messageObject); } else if (messageObject.messageOwner.media.ttl_seconds != 0) { return LocaleController.getString("AttachDestructingPhoto", R.string.AttachDestructingPhoto); } else { @@ -1780,7 +1780,7 @@ public class NotificationsController extends BaseController { } } else if (messageObject.isVideo()) { if (Build.VERSION.SDK_INT >= 19 && !TextUtils.isEmpty(messageObject.messageOwner.message)) { - return "\uD83D\uDCF9 " + messageObject.messageOwner.message; + return "\uD83D\uDCF9 " + replaceSpoilers(messageObject); } else if (messageObject.messageOwner.media.ttl_seconds != 0) { return LocaleController.getString("AttachDestructingVideo", R.string.AttachDestructingVideo); } else { @@ -1816,19 +1816,19 @@ public class NotificationsController extends BaseController { } } else if (messageObject.isGif()) { if (Build.VERSION.SDK_INT >= 19 && !TextUtils.isEmpty(messageObject.messageOwner.message)) { - return "\uD83C\uDFAC " + messageObject.messageOwner.message; + return "\uD83C\uDFAC " + replaceSpoilers(messageObject); } else { return LocaleController.getString("AttachGif", R.string.AttachGif); } } else { if (Build.VERSION.SDK_INT >= 19 && !TextUtils.isEmpty(messageObject.messageOwner.message)) { - return "\uD83D\uDCCE " + messageObject.messageOwner.message; + return "\uD83D\uDCCE " + replaceSpoilers(messageObject); } else { return LocaleController.getString("AttachDocument", R.string.AttachDocument); } } } else if (!TextUtils.isEmpty(messageObject.messageText)) { - return messageObject.messageText.toString(); + return replaceSpoilers(messageObject); } else { return LocaleController.getString("Message", R.string.Message); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/EmojiThemes.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/EmojiThemes.java index 330fa4ed8..884710841 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/EmojiThemes.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/EmojiThemes.java @@ -186,22 +186,18 @@ public class EmojiThemes { return themeItem; } - public static EmojiThemes createHome() { + public static EmojiThemes createHomeQrTheme() { EmojiThemes themeItem = new EmojiThemes(); themeItem.emoji = "\uD83C\uDFE0"; ThemeItem blue = new ThemeItem(); - blue.themeInfo = getDefaultThemeInfo(false); - if (blue.themeInfo.getKey().equals("Blue")) { - blue.accentId = 99; - } + blue.themeInfo = Theme.getTheme("Blue"); + blue.accentId = 99; themeItem.items.add(blue); ThemeItem nightBlue = new ThemeItem(); - nightBlue.themeInfo = getDefaultThemeInfo(true); - if (nightBlue.themeInfo.getKey().equals("Night")) { - nightBlue.accentId = 0; - } + nightBlue.themeInfo = Theme.getTheme("Dark Blue"); + nightBlue.accentId = 0; themeItem.items.add(nightBlue); return themeItem; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java index 86c6a4157..4ab153f05 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java @@ -3679,6 +3679,8 @@ public class Theme { public static final String key_chat_inReactionButtonBackground = "chat_inReactionButtonBackground"; public static final String key_chat_outReactionButtonText = "chat_outReactionButtonText"; public static final String key_chat_inReactionButtonText = "chat_inReactionButtonText"; + public static final String key_chat_inReactionButtonTextSelected = "chat_inReactionButtonTextSelected"; + public static final String key_chat_outReactionButtonTextSelected = "chat_outReactionButtonTextSelected"; public static final String key_drawable_botInline = "drawableBotInline"; @@ -4537,8 +4539,10 @@ public class Theme { defaultColors.put(key_chat_outReactionButtonBackground, 0xff78c272); defaultColors.put(key_chat_inReactionButtonBackground, 0xff72b5e8); - defaultColors.put(key_chat_inReactionButtonText, 0xffffffff); - defaultColors.put(key_chat_outReactionButtonText, 0xffffffff); + defaultColors.put(key_chat_inReactionButtonText, 0xff3a8ccf); + defaultColors.put(key_chat_outReactionButtonText, 0xff55ab4f); + defaultColors.put(key_chat_inReactionButtonTextSelected, 0xffffffff); + defaultColors.put(key_chat_outReactionButtonTextSelected, 0xffffffff); fallbackKeys.put(key_chat_inAdminText, key_chat_inTimeText); @@ -4680,6 +4684,8 @@ public class Theme { fallbackKeys.put(key_chat_outReactionButtonBackground, key_chat_outLoader); fallbackKeys.put(key_chat_inReactionButtonText, key_chat_inPreviewInstantText); fallbackKeys.put(key_chat_outReactionButtonText, key_chat_outPreviewInstantText); + fallbackKeys.put(key_chat_inReactionButtonTextSelected, key_windowBackgroundWhite); + fallbackKeys.put(key_chat_outReactionButtonTextSelected, key_windowBackgroundWhite); themeAccentExclusionKeys.addAll(Arrays.asList(keys_avatar_background)); themeAccentExclusionKeys.addAll(Arrays.asList(keys_avatar_nameInMessage)); @@ -5495,7 +5501,7 @@ public class Theme { int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH); int minutes = calendar.get(Calendar.MINUTE); int hour = calendar.get(Calendar.HOUR_OF_DAY); - if (monthOfYear == 0 && dayOfMonth == 1 && minutes <= 10 && hour == 0) { + if (monthOfYear == 0 && dayOfMonth == 1 && hour <= 23) { canStartHolidayAnimation = true; } else { canStartHolidayAnimation = false; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java index 7de23e267..68d207363 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java @@ -5285,10 +5285,11 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } } if (!reactionsLayoutInBubble.isSmall && !reactionsLayoutInBubble.isEmpty) { - reactionsLayoutInBubble.positionOffsetY += AndroidUtilities.dp(12); + // reactionsLayoutInBubble.positionOffsetY += AndroidUtilities.dp(12); reactionsLayoutInBubble.totalHeight = reactionsLayoutInBubble.height + AndroidUtilities.dp(8); measureTime(messageObject); int timeLeft = backgroundWidth - reactionsLayoutInBubble.lastLineX - AndroidUtilities.dp(24); + if (timeLeft < timeWidth) { reactionsLayoutInBubble.totalHeight += AndroidUtilities.dp(12); reactionsLayoutInBubble.positionOffsetY -= AndroidUtilities.dp(12); @@ -8377,6 +8378,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate if (captionLayout != null) { reactionsLayoutInBubble.y -= AndroidUtilities.dp(14); } + if (!botButtons.isEmpty() && currentMessageObject.type == 9) { + reactionsLayoutInBubble.y += AndroidUtilities.dp(10); + } reactionsLayoutInBubble.y = reactionsLayoutInBubble.y + reactionsLayoutInBubble.positionOffsetY; } if (reactionsLayoutInBubble.isSmall && !reactionsLayoutInBubble.isEmpty) { @@ -10482,7 +10486,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate mess = mess.replace('\n', ' '); stringFinalText = Emoji.replaceEmoji(mess, Theme.chat_replyTextPaint.getFontMetricsInt(), AndroidUtilities.dp(14), false); stringFinalText = TextUtils.ellipsize(stringFinalText, Theme.chat_replyTextPaint, maxWidth, TextUtils.TruncateAt.END); - MediaDataController.addTextStyleRuns(messageObject.replyMessageObject.messageOwner.entities, messageObject.replyMessageObject.caption, (Spannable) stringFinalText); + if (stringFinalText instanceof Spannable) { + MediaDataController.addTextStyleRuns(messageObject.replyMessageObject.messageOwner.entities, messageObject.replyMessageObject.caption, (Spannable) stringFinalText); + } } else if (messageObject.replyMessageObject.messageText != null && messageObject.replyMessageObject.messageText.length() > 0) { String mess = messageObject.replyMessageObject.messageText.toString(); if (mess.length() > 150) { @@ -12498,7 +12504,6 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate } if (reactionsLayoutInBubble.isSmall) { - Log.d("kek", transitionParams.shouldAnimateTimeX + " " + transitionParams.animateBackgroundBoundsInner + " " + transitionParams.animateFromTimeX + " " + this.timeX); if (transitionParams.animateBackgroundBoundsInner && transitionParams.deltaRight != 0) { timeTitleTimeX += reactionsLayoutInBubble.getCurrentWidth(1f); } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java index 3854d37c8..33ff7e244 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java @@ -83,6 +83,13 @@ public class TextDetailCell extends FrameLayout { } else { imageView.setBackground(Theme.createSimpleSelectorCircleDrawable(AndroidUtilities.dp(48), Color.TRANSPARENT, Theme.getColor(Theme.key_listSelector))); } + int margin = AndroidUtilities.dp(23) + (drawable == null ? 0 : AndroidUtilities.dp(48)); + if (LocaleController.isRTL) { + ((MarginLayoutParams) textView.getLayoutParams()).leftMargin = margin; + } else { + ((MarginLayoutParams) textView.getLayoutParams()).rightMargin = margin; + } + textView.requestLayout(); } public void setImageClickListener(View.OnClickListener clickListener) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 0193576e8..540be0bbe 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -20904,10 +20904,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } ); cell.setOnClickListener(e -> { - if (selectedObject == null || i >= options.size()) { + if (selectedObject == null || i >= options.size() || getParentActivity() == null) { return; } - TranslateAlert.showAlert(getParentActivity(), this, fromLang[0], toLang, finalMessageText, currentChat.noforwards); + boolean noForwards = currentChat != null && currentChat.noforwards; + TranslateAlert.showAlert(getParentActivity(), this, fromLang[0], toLang, finalMessageText, noForwards); scrimView = null; contentView.invalidate(); chatListView.invalidate(); @@ -20923,10 +20924,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not }, 250); } else { cell.setOnClickListener(e -> { - if (selectedObject == null || i >= options.size()) { + if (selectedObject == null || i >= options.size() || getParentActivity() == null) { return; } - TranslateAlert.showAlert(getParentActivity(), this, "und", toLang, finalMessageText, currentChat.noforwards); + boolean noForwards = currentChat != null && currentChat.noforwards; + TranslateAlert.showAlert(getParentActivity(), this, "und", toLang, finalMessageText, noForwards); scrimView = null; contentView.invalidate(); chatListView.invalidate(); @@ -23847,6 +23849,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not @Override public void didPressReaction(ChatMessageCell cell, TLRPC.TL_reactionCount reaction, boolean longpress) { + if (getParentActivity() == null) { + return; + } if (longpress) { if (!ChatObject.isChannelAndNotMegaGroup(currentChat)) { cell.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); @@ -26045,6 +26050,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_chat_inReactionButtonBackground)); themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_chat_inReactionButtonText)); themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_chat_outReactionButtonText)); + themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_chat_inReactionButtonTextSelected)); + themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_chat_inReactionButtonTextSelected)); if (chatActivityEnterView != null) { themeDescriptions.add(new ThemeDescription(chatActivityEnterView.botCommandsMenuContainer.listView, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{BotCommandsMenuView.BotCommandView.class}, new String[]{"description"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsLayoutInBubble.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsLayoutInBubble.java index 2e36d3030..cd6282cb4 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsLayoutInBubble.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/Reactions/ReactionsLayoutInBubble.java @@ -375,11 +375,12 @@ public class ReactionsLayoutInBubble { counterDrawable.updateVisibility = false; if (reactionCount.chosen) { backgroundColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonBackground : Theme.key_chat_inReactionButtonBackground, resourcesProvider); - textColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonText : Theme.key_chat_inReactionButtonText, resourcesProvider); + textColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonTextSelected : Theme.key_chat_inReactionButtonTextSelected, resourcesProvider); serviceTextColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonBackground : Theme.key_chat_inReactionButtonBackground, resourcesProvider); serviceBackgroundColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outBubble : Theme.key_chat_inBubble); } else { - textColor = backgroundColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonBackground : Theme.key_chat_inReactionButtonBackground, resourcesProvider); + textColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonText : Theme.key_chat_inReactionButtonText, resourcesProvider); + backgroundColor = Theme.getColor(messageObject.isOutOwner() ? Theme.key_chat_outReactionButtonBackground : Theme.key_chat_inReactionButtonBackground, resourcesProvider); backgroundColor = ColorUtils.setAlphaComponent(backgroundColor, (int) (Color.alpha(backgroundColor) * 0.156f)); serviceTextColor = Theme.getColor(Theme.key_chat_serviceText, resourcesProvider); serviceBackgroundColor = Color.TRANSPARENT; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionsContainerLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionsContainerLayout.java index 18f86ce65..d8b1a5706 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionsContainerLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ReactionsContainerLayout.java @@ -387,7 +387,7 @@ public class ReactionsContainerLayout extends FrameLayout { Runnable playRunnable = new Runnable() { @Override public void run() { - if (backupImageView.getImageReceiver().getLottieAnimation() != null) { + if (backupImageView.getImageReceiver().getLottieAnimation() != null && !backupImageView.getImageReceiver().getLottieAnimation().isRunning()) { backupImageView.getImageReceiver().getLottieAnimation().start(); } } @@ -410,11 +410,12 @@ public class ReactionsContainerLayout extends FrameLayout { public void play(int delay) { AndroidUtilities.cancelRunOnUIThread(playRunnable); if (backupImageView.getImageReceiver().getLottieAnimation() != null) { - backupImageView.getImageReceiver().getLottieAnimation().setCurrentFrame(0); + backupImageView.getImageReceiver().getLottieAnimation().setCurrentFrame(0, false); if (delay == 0) { playRunnable.run(); } else { backupImageView.getImageReceiver().getLottieAnimation().stop(); + backupImageView.getImageReceiver().getLottieAnimation().setCurrentFrame(0, false); AndroidUtilities.runOnUIThread(playRunnable, delay); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/UpdateAppAlertDialog.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/UpdateAppAlertDialog.java index e4725bf4f..b1c2630ac 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/UpdateAppAlertDialog.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/UpdateAppAlertDialog.java @@ -19,6 +19,8 @@ import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TextView; +import androidx.core.widget.NestedScrollView; + import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.DocumentObject; import org.telegram.messenger.FileLoader; @@ -31,8 +33,6 @@ import org.telegram.tgnet.TLRPC; import org.telegram.ui.ActionBar.BottomSheet; import org.telegram.ui.ActionBar.Theme; -import androidx.core.widget.NestedScrollView; - public class UpdateAppAlertDialog extends BottomSheet { private TLRPC.TL_help_appUpdate appUpdate; @@ -239,9 +239,9 @@ public class UpdateAppAlertDialog extends BottomSheet { ImageLocation imageLocation = ImageLocation.getForDocument(thumb, appUpdate.sticker); if (svgThumb != null) { - imageView.setImage(ImageLocation.getForDocument(appUpdate.sticker), "160_160", svgThumb, 0, "update"); + imageView.setImage(ImageLocation.getForDocument(appUpdate.sticker), "250_250", svgThumb, 0, "update"); } else { - imageView.setImage(ImageLocation.getForDocument(appUpdate.sticker), "160_160", imageLocation, null, 0, "update"); + imageView.setImage(ImageLocation.getForDocument(appUpdate.sticker), "250_250", imageLocation, null, 0, "update"); } linearLayout.addView(imageView, LayoutHelper.createLinear(160, 160, Gravity.CENTER_HORIZONTAL | Gravity.TOP, 17, 8, 17, 0)); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersTextView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersTextView.java index 7e4d4328f..d51d4bff1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersTextView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersTextView.java @@ -2,7 +2,10 @@ package org.telegram.ui.Components.spoilers; import android.content.Context; import android.graphics.Canvas; +import android.graphics.Paint; import android.graphics.Path; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.Region; import android.text.Layout; @@ -22,6 +25,7 @@ public class SpoilersTextView extends TextView { private Stack spoilersPool = new Stack<>(); private boolean isSpoilersRevealed; private Path path = new Path(); + private Paint xRefPaint; public SpoilersTextView(Context context) { super(context); @@ -82,19 +86,38 @@ public class SpoilersTextView extends TextView { canvas.save(); canvas.clipPath(path); path.rewind(); - if (!spoilers.isEmpty()) + if (!spoilers.isEmpty()) { spoilers.get(0).getRipplePath(path); + } canvas.clipPath(path); super.onDraw(canvas); canvas.restore(); - canvas.save(); - canvas.translate(getPaddingLeft(), getPaddingTop() + AndroidUtilities.dp(2)); - for (SpoilerEffect eff : spoilers) { - eff.setColor(getPaint().getColor()); - eff.draw(canvas); + if (!spoilers.isEmpty()) { + boolean useAlphaLayer = spoilers.get(0).getRippleProgress() != -1; + if (useAlphaLayer) { + canvas.saveLayer(0, 0, getMeasuredWidth(), getMeasuredHeight(), null, canvas.ALL_SAVE_FLAG); + } else { + canvas.save(); + } + canvas.translate(getPaddingLeft(), getPaddingTop() + AndroidUtilities.dp(2)); + for (SpoilerEffect eff : spoilers) { + eff.setColor(getPaint().getColor()); + eff.draw(canvas); + } + + if (useAlphaLayer) { + path.rewind(); + spoilers.get(0).getRipplePath(path); + if (xRefPaint == null) { + xRefPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + xRefPaint.setColor(0xff000000); + xRefPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); + } + canvas.drawPath(path, xRefPaint); + } + canvas.restore(); } - canvas.restore(); } private void invalidateSpoilers() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/EmojiAnimationsOverlay.java b/TMessagesProj/src/main/java/org/telegram/ui/EmojiAnimationsOverlay.java index c70b3c8a1..42d52a15d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/EmojiAnimationsOverlay.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/EmojiAnimationsOverlay.java @@ -1,6 +1,7 @@ package org.telegram.ui; import android.graphics.Canvas; +import android.text.TextUtils; import android.view.HapticFeedbackConstants; import android.view.View; import android.widget.FrameLayout; @@ -319,8 +320,10 @@ public class EmojiAnimationsOverlay implements NotificationCenter.NotificationCe return false; } + emoji = unwrapEmoji(emoji); + if (supportedEmoji.contains(emoji)) { - ArrayList arrayList = emojiInteractionsStickersMap.get(view.getMessageObject().getStickerEmoji()); + ArrayList arrayList = emojiInteractionsStickersMap.get(emoji); if (arrayList != null && !arrayList.isEmpty()) { int sameAnimationsCount = 0; for (int i = 0; i < drawingObjects.size(); i++) { @@ -404,6 +407,23 @@ public class EmojiAnimationsOverlay implements NotificationCenter.NotificationCe return false; } + private String unwrapEmoji(String emoji) { + CharSequence fixedEmoji = emoji; + int length = emoji.length(); + for (int a = 0; a < length; a++) { + if (a < length - 1 && (fixedEmoji.charAt(a) == 0xD83C && fixedEmoji.charAt(a + 1) >= 0xDFFB && fixedEmoji.charAt(a + 1) <= 0xDFFF || fixedEmoji.charAt(a) == 0x200D && (fixedEmoji.charAt(a + 1) == 0x2640 || fixedEmoji.charAt(a + 1) == 0x2642))) { + fixedEmoji = TextUtils.concat(fixedEmoji.subSequence(0, a), fixedEmoji.subSequence(a + 2, fixedEmoji.length())); + length -= 2; + a--; + } else if (fixedEmoji.charAt(a) == 0xfe0f) { + fixedEmoji = TextUtils.concat(fixedEmoji.subSequence(0, a), fixedEmoji.subSequence(a + 1, fixedEmoji.length())); + length--; + a--; + } + } + return fixedEmoji.toString(); + } + private void sendCurrentTaps() { if (lastTappedMsgId == 0) { return; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index 687060a04..eab4ef5bf 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -1926,8 +1926,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. ActionBarMenu menu = actionBar.createMenu(); - if (userId == getUserConfig().clientUserId && !TextUtils.isEmpty(getUserConfig().getCurrentUser().username)) { + if (userId == getUserConfig().clientUserId) { qrItem = menu.addItem(qr_button, R.drawable.msg_qr_mini, getResourceProvider()); + qrItem.setVisibility(isQrNeedVisible() ? View.VISIBLE : View.GONE); qrItem.setContentDescription(LocaleController.getString("AuthAnotherClientScan", R.string.AuthAnotherClientScan)); } if (imageUpdater != null) { @@ -3231,6 +3232,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. avatarImage.setRoundRadius((int) AndroidUtilities.lerp(AndroidUtilities.dpf2(21f), 0f, value)); if (searchItem != null) { searchItem.setAlpha(1.0f - value); + searchItem.setScaleY(1.0f - value); searchItem.setVisibility(searchItem.getAlpha() == 0f ? View.GONE : View.VISIBLE); if (qrItem != null && searchItem.getVisibility() == View.VISIBLE) { float translation = AndroidUtilities.dp(48) * value; @@ -4297,14 +4299,14 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. qrItemAnimation.setInterpolator(new DecelerateInterpolator()); qrItemAnimation.playTogether( ObjectAnimator.ofFloat(qrItem, View.ALPHA, 1.0f), - ObjectAnimator.ofFloat(qrItem, View.TRANSLATION_X, 0), + ObjectAnimator.ofFloat(qrItem, View.SCALE_Y, 1f), ObjectAnimator.ofFloat(avatarsViewPagerIndicatorView, View.TRANSLATION_X, -AndroidUtilities.dp(48)) ); } else { qrItemAnimation.setInterpolator(new AccelerateInterpolator()); qrItemAnimation.playTogether( ObjectAnimator.ofFloat(qrItem, View.ALPHA, 0.0f), - ObjectAnimator.ofFloat(qrItem, View.TRANSLATION_X, AndroidUtilities.dp(48)), + ObjectAnimator.ofFloat(qrItem, View.SCALE_Y, 0f), ObjectAnimator.ofFloat(avatarsViewPagerIndicatorView, View.TRANSLATION_X, 0) ); } @@ -6085,6 +6087,10 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } avatarImage.getImageReceiver().setVisible(!PhotoViewer.isShowingImage(photoBig), false); } + + if (qrItem != null) { + qrItem.setVisibility(isQrNeedVisible() ? View.VISIBLE : View.GONE); + } } private void createActionBarMenu(boolean animated) { @@ -6408,7 +6414,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. otherItem.setVisibility(itemVisibility); } if (qrItem != null) { - qrItem.setVisibility(itemVisibility); + qrItem.setVisibility(isQrNeedVisible() && searchTransitionProgress > 0.5f ? View.VISIBLE : View.GONE); } searchItem.setVisibility(itemVisibility); @@ -6461,7 +6467,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } if (qrItem != null) { qrItem.setAlpha(progressHalf); - qrItem.setVisibility(visibility); + qrItem.setVisibility(searchTransitionProgress > 0.5f && isQrNeedVisible() ? View.VISIBLE : View.GONE); } searchItem.setVisibility(visibility); @@ -6527,7 +6533,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } if (qrItem != null) { qrItem.setAlpha(1f); - qrItem.setVisibility(hide); + qrItem.setVisibility(enter || !isQrNeedVisible() ? View.GONE : View.VISIBLE); } searchItem.setVisibility(hide); @@ -8236,6 +8242,10 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } } + private boolean isQrNeedVisible() { + return !TextUtils.isEmpty(getUserConfig().getCurrentUser().username); + } + private class DiffCallback extends DiffUtil.Callback { int oldRowCount; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/QrActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/QrActivity.java index a5ef70f7f..bce485e9e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/QrActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/QrActivity.java @@ -31,6 +31,7 @@ import android.text.TextPaint; import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; +import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.Window; @@ -114,7 +115,7 @@ public class QrActivity extends BaseFragment { } private final ThemeResourcesProvider resourcesProvider = new ThemeResourcesProvider(); - private final EmojiThemes homeTheme = EmojiThemes.createHome(); + private final EmojiThemes homeTheme = EmojiThemes.createHomeQrTheme(); private final Rect logoRect = new Rect(); private final ArrayMap emojiThemeDarkIcons = new ArrayMap<>(); private final int[] prevQrColors = new int[4]; @@ -126,6 +127,7 @@ public class QrActivity extends BaseFragment { private ValueAnimator patternAlphaAnimator; private ValueAnimator patternIntensityAnimator; + private View backgroundView; private FrameLayout themeLayout; private BackupImageView avatarImageView; private QrView qrView; @@ -142,7 +144,6 @@ public class QrActivity extends BaseFragment { public QrActivity(Bundle args) { super(args); - homeTheme.loadPreviewColors(currentAccount); } @Override @@ -152,16 +153,24 @@ public class QrActivity extends BaseFragment { return super.onFragmentCreate(); } - @SuppressLint("SourceLockedOrientationActivity") @Override public View createView(Context context) { + homeTheme.loadPreviewColors(currentAccount); isCurrentThemeDark = Theme.getActiveTheme().isDark(); actionBar.setAddToContainer(false); actionBar.setBackground(null); actionBar.setItemsColor(0xffffffff, false); FrameLayout rootLayout = new FrameLayout(context) { + private boolean prevIsPortrait; + + @Override + public boolean dispatchTouchEvent(MotionEvent ev) { + super.dispatchTouchEvent(ev); + return true; + } + @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int width = MeasureSpec.getSize(widthMeasureSpec); @@ -181,10 +190,13 @@ public class QrActivity extends BaseFragment { } prevIsPortrait = isPortrait; } + @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { boolean isPortrait = getWidth() < getHeight(); + backgroundView.layout(0, 0, getWidth(), getHeight()); + int themeLayoutHeight = 0; if (themeLayout.getVisibility() == View.VISIBLE) { themeLayoutHeight = themeLayout.getMeasuredHeight(); @@ -220,21 +232,21 @@ public class QrActivity extends BaseFragment { int closeTop = AndroidUtilities.statusBarHeight + (isPortrait ? AndroidUtilities.dp(10) : AndroidUtilities.dp(5)); closeImageView.layout(closeLeft, closeTop, closeLeft + closeImageView.getMeasuredWidth(), closeTop + closeImageView.getMeasuredHeight()); } + }; + + backgroundView = new View(context) { @Override - protected void dispatchDraw(Canvas canvas) { + protected void onDraw(Canvas canvas) { if (prevMotionDrawable != null) { prevMotionDrawable.setBounds(0, 0, getWidth(), getHeight()); prevMotionDrawable.draw(canvas); } currMotionDrawable.setBounds(0, 0, getWidth(), getHeight()); currMotionDrawable.draw(canvas); - super.dispatchDraw(canvas); - } - @Override - protected boolean verifyDrawable(@NonNull Drawable who) { - return super.verifyDrawable(who) || who == currMotionDrawable || who == prevMotionDrawable; + super.onDraw(canvas); } }; + rootLayout.addView(backgroundView); AvatarDrawable avatarDrawable = null; String username = null; @@ -480,9 +492,9 @@ public class QrActivity extends BaseFragment { prevMotionDrawable.setIndeterminateAnimation(false); currMotionDrawable = new MotionBackgroundDrawable(); - currMotionDrawable.setCallback(fragmentView); + currMotionDrawable.setCallback(backgroundView); currMotionDrawable.setColors(themeItem.patternBgColor, themeItem.patternBgGradientColor1, themeItem.patternBgGradientColor2, themeItem.patternBgGradientColor3); - currMotionDrawable.setParentView(fragmentView); + currMotionDrawable.setParentView(backgroundView); currMotionDrawable.setPatternAlpha(1f); currMotionDrawable.setIndeterminateAnimation(true); currMotionDrawable.posAnimationProgress = prevMotionDrawable.posAnimationProgress; @@ -501,7 +513,7 @@ public class QrActivity extends BaseFragment { } }); } else { - currMotionDrawable.setPatternBitmap(34, SvgHelper.getBitmap(R.raw.default_pattern, fragmentView.getWidth(), fragmentView.getHeight(), Color.BLACK)); + currMotionDrawable.setPatternBitmap(34, SvgHelper.getBitmap(R.raw.default_pattern, backgroundView.getWidth(), backgroundView.getHeight(), Color.BLACK)); } currMotionDrawable.setPatternColorFilter(currMotionDrawable.getPatternColor()); @@ -528,7 +540,7 @@ public class QrActivity extends BaseFragment { int color4 = ColorUtils.blendARGB(prevQrColors[3], newQrColors[3], progress); qrView.setColors(color1, color2, color3, color4); } - fragmentView.invalidate(); + backgroundView.invalidate(); }); patternAlphaAnimator.addListener(new AnimatorListenerAdapter() { @Override @@ -549,7 +561,7 @@ public class QrActivity extends BaseFragment { System.arraycopy(newQrColors, 0, prevQrColors, 0, 4); } prevMotionDrawable = null; - fragmentView.invalidate(); + backgroundView.invalidate(); } Theme.ThemeInfo currentThemeInfo = isCurrentThemeDark ? Theme.getCurrentNightTheme() : Theme.getCurrentTheme(); @@ -595,8 +607,8 @@ public class QrActivity extends BaseFragment { drawable.setCurrentFrame(currentFrame, false); logoImageView.playAnimation(); - fragmentView.layout(fragmentView.getLeft() - 1, fragmentView.getTop(), fragmentView.getRight(), fragmentView.getBottom()); - fragmentView.layout(fragmentView.getLeft() + 1, fragmentView.getTop(), fragmentView.getRight(), fragmentView.getBottom()); + ViewGroup parent = (ViewGroup) fragmentView.getParent(); + fragmentView.layout(0, 0, parent.getWidth(), parent.getHeight()); Uri uri = AndroidUtilities.getBitmapShareUri(bitmap, "qr_tmp.jpg", Bitmap.CompressFormat.JPEG); if (uri != null) { @@ -766,13 +778,13 @@ public class QrActivity extends BaseFragment { int linesCount = textWidth > textMaxWidth ? 2 : 1; int layoutWidth = textMaxWidth; if (linesCount > 1) { - layoutWidth = (int)(textWidth + drawable.getBounds().width()) / 2 + AndroidUtilities.dp(1); + layoutWidth = (int)(textWidth + drawable.getBounds().width()) / 2 + AndroidUtilities.dp(2); } if (layoutWidth > textMaxWidth) { linesCount = 3; - layoutWidth = (int)(textWidth + drawable.getBounds().width()) / 3 + AndroidUtilities.dp(2); + layoutWidth = (int)(textWidth + drawable.getBounds().width()) / 3 + AndroidUtilities.dp(4); } - staticLayout = StaticLayoutEx.createStaticLayout(string, textPaint, layoutWidth, Layout.Alignment.ALIGN_CENTER, 1f, 0f, false, null, contentBitmap.getWidth(), linesCount); + staticLayout = StaticLayoutEx.createStaticLayout(string, textPaint, layoutWidth, Layout.Alignment.ALIGN_CENTER, 1f, 0f, false, null, Math.min(layoutWidth + AndroidUtilities.dp(10), contentBitmap.getWidth()), linesCount); break; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ReactionsDoubleTapManageActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ReactionsDoubleTapManageActivity.java index 78441943e..a782dceb9 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ReactionsDoubleTapManageActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ReactionsDoubleTapManageActivity.java @@ -29,13 +29,10 @@ import org.telegram.ui.Components.RecyclerListView; import org.telegram.ui.Components.SimpleThemeDescription; import java.util.ArrayList; -import java.util.Collections; import java.util.List; public class ReactionsDoubleTapManageActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { - private List chatReactions = Collections.emptyList(); - private LinearLayout contentView; private RecyclerListView listView; private RecyclerView.Adapter listAdapter; @@ -159,7 +156,7 @@ public class ReactionsDoubleTapManageActivity extends BaseFragment implements No } private List getAvailableReactions() { - return getMediaDataController().getReactionsList(); + return getMediaDataController().getEnabledReactionsList(); } @Override