diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle
index 3b892e53..f2af8c94 100644
--- a/TMessagesProj/build.gradle
+++ b/TMessagesProj/build.gradle
@@ -13,11 +13,10 @@ repositories {
}
dependencies {
- compile 'com.android.support:support-v4:22.0.+'
+ compile 'com.android.support:support-v4:22.1.+'
compile 'com.google.android.gms:play-services:3.2.+'
compile 'net.hockeyapp.android:HockeySDK:3.5.+'
compile 'com.googlecode.mp4parser:isoparser:1.0.+'
- compile 'com.android.support:recyclerview-v7:+'
}
android {
@@ -89,7 +88,7 @@ android {
applicationId "org.telegram.plus"
minSdkVersion 8
targetSdkVersion 22
- versionCode 492
- versionName "2.7.0.1"
+ versionCode 524
+ versionName "2.8.1.4"
}
}
diff --git a/TMessagesProj/config/debug/AndroidManifest.xml b/TMessagesProj/config/debug/AndroidManifest.xml
index 7c386826..8c5a54fe 100644
--- a/TMessagesProj/config/debug/AndroidManifest.xml
+++ b/TMessagesProj/config/debug/AndroidManifest.xml
@@ -15,13 +15,11 @@
-
-
+
+
+
+
diff --git a/TMessagesProj/config/release/AndroidManifest.xml b/TMessagesProj/config/release/AndroidManifest.xml
index bce6ffd5..e4f770bb 100644
--- a/TMessagesProj/config/release/AndroidManifest.xml
+++ b/TMessagesProj/config/release/AndroidManifest.xml
@@ -14,11 +14,11 @@
-
+
+
+
+
diff --git a/TMessagesProj/jni/Android.mk b/TMessagesProj/jni/Android.mk
index f9b84ba9..19183707 100755
--- a/TMessagesProj/jni/Android.mk
+++ b/TMessagesProj/jni/Android.mk
@@ -104,7 +104,7 @@ include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false
LOCAL_STATIC_LIBRARIES := webp sqlite
-LOCAL_MODULE := tmessages.7
+LOCAL_MODULE := tmessages.8
LOCAL_CFLAGS := -w -std=gnu99 -O2 -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
LOCAL_CFLAGS += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -fno-math-errno
LOCAL_CFLAGS += -DANDROID_NDK -DDISABLE_IMPORTGL -fno-strict-aliasing -fprefetch-loop-arrays -DAVOID_TABLES -DANDROID_TILE_BASED_DECODE -DANDROID_ARMV6_IDCT -ffast-math
diff --git a/TMessagesProj/jni/image.c b/TMessagesProj/jni/image.c
index 85a85900..a3a0fb86 100644
--- a/TMessagesProj/jni/image.c
+++ b/TMessagesProj/jni/image.c
@@ -288,7 +288,7 @@ METHODDEF(void) my_error_exit(j_common_ptr cinfo) {
longjmp(myerr->setjmp_buffer, 1);
}
-JNIEXPORT void Java_org_telegram_messenger_Utilities_blurBitmap(JNIEnv *env, jclass class, jobject bitmap, int radius) {
+JNIEXPORT void Java_org_telegram_messenger_Utilities_blurBitmap(JNIEnv *env, jclass class, jobject bitmap, int radius, int unpin) {
if (!bitmap) {
return;
}
@@ -312,7 +312,9 @@ JNIEXPORT void Java_org_telegram_messenger_Utilities_blurBitmap(JNIEnv *env, jcl
} else {
fastBlurMore(info.width, info.height, info.stride, pixels, radius);
}
- AndroidBitmap_unlockPixels(env, bitmap);
+ if (unpin) {
+ AndroidBitmap_unlockPixels(env, bitmap);
+ }
}
JNIEXPORT void Java_org_telegram_messenger_Utilities_calcCDT(JNIEnv *env, jclass class, jobject hsvBuffer, int width, int height, jobject buffer) {
diff --git a/TMessagesProj/src/main/assets/emoji/emoji2.0x_0.jpg b/TMessagesProj/src/main/assets/emoji/emoji2.0x_0.jpg
deleted file mode 100644
index 1cf58511..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji2.0x_0.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji2.0x_1.jpg b/TMessagesProj/src/main/assets/emoji/emoji2.0x_1.jpg
deleted file mode 100644
index f5a3bd8a..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji2.0x_1.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji2.0x_2.jpg b/TMessagesProj/src/main/assets/emoji/emoji2.0x_2.jpg
deleted file mode 100644
index d0db3e17..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji2.0x_2.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji2.0x_3.jpg b/TMessagesProj/src/main/assets/emoji/emoji2.0x_3.jpg
deleted file mode 100644
index 225f2b8c..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji2.0x_3.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji2.0x_4.jpg b/TMessagesProj/src/main/assets/emoji/emoji2.0x_4.jpg
deleted file mode 100644
index 453875c0..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji2.0x_4.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_0.jpg b/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_0.jpg
deleted file mode 100644
index 53416f24..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_0.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_1.jpg b/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_1.jpg
deleted file mode 100644
index 8b7a562e..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_1.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_2.jpg b/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_2.jpg
deleted file mode 100644
index 48424203..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_2.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_3.jpg b/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_3.jpg
deleted file mode 100644
index 98cef882..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_3.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_4.jpg b/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_4.jpg
deleted file mode 100644
index 0f8980a8..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji2.0x_a_4.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji3.0x_0.jpg b/TMessagesProj/src/main/assets/emoji/emoji3.0x_0.jpg
deleted file mode 100644
index e09c30c5..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji3.0x_0.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji3.0x_1.jpg b/TMessagesProj/src/main/assets/emoji/emoji3.0x_1.jpg
deleted file mode 100644
index e0b0752e..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji3.0x_1.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji3.0x_2.jpg b/TMessagesProj/src/main/assets/emoji/emoji3.0x_2.jpg
deleted file mode 100644
index ffd3c848..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji3.0x_2.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji3.0x_3.jpg b/TMessagesProj/src/main/assets/emoji/emoji3.0x_3.jpg
deleted file mode 100644
index dd229d2a..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji3.0x_3.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji3.0x_4.jpg b/TMessagesProj/src/main/assets/emoji/emoji3.0x_4.jpg
deleted file mode 100644
index 9127912f..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji3.0x_4.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_0.jpg b/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_0.jpg
deleted file mode 100644
index e0e9339e..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_0.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_1.jpg b/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_1.jpg
deleted file mode 100644
index f5e831ae..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_1.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_2.jpg b/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_2.jpg
deleted file mode 100644
index d04659d6..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_2.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_3.jpg b/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_3.jpg
deleted file mode 100644
index 1a337239..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_3.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_4.jpg b/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_4.jpg
deleted file mode 100644
index 7ce611f7..00000000
Binary files a/TMessagesProj/src/main/assets/emoji/emoji3.0x_a_4.jpg and /dev/null differ
diff --git a/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java b/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java
index e250ae56..50721491 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java
@@ -42,16 +42,16 @@ import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
+import org.telegram.android.AnimationCompat.AnimatorListenerAdapterProxy;
+import org.telegram.android.AnimationCompat.AnimatorSetProxy;
+import org.telegram.android.AnimationCompat.ObjectAnimatorProxy;
+import org.telegram.android.AnimationCompat.ViewProxy;
import org.telegram.messenger.ApplicationLoader;
import org.telegram.messenger.ConnectionsManager;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.R;
import org.telegram.messenger.TLRPC;
import org.telegram.messenger.UserConfig;
-import org.telegram.ui.AnimationCompat.AnimatorListenerAdapterProxy;
-import org.telegram.ui.AnimationCompat.AnimatorSetProxy;
-import org.telegram.ui.AnimationCompat.ObjectAnimatorProxy;
-import org.telegram.ui.AnimationCompat.ViewProxy;
import org.telegram.ui.Components.ForegroundDetector;
import org.telegram.ui.Components.NumberPicker;
import org.telegram.ui.Components.TypefaceSpan;
@@ -75,10 +75,11 @@ public class AndroidUtilities {
public static Integer photoSize = null;
public static DisplayMetrics displayMetrics = new DisplayMetrics();
public static int leftBaseline;
+ public static boolean usingHardwareInput;
private static Boolean isTablet = null;
public static final String THEME_PREFS = "theme";
- public static final int THEME_PREFS_MODE = Activity.MODE_WORLD_READABLE;
+ public static final int THEME_PREFS_MODE = Activity.MODE_PRIVATE;
public static final int defColor = 0xff009688;//0xff58BCD5;//0xff43C3DB;//0xff2f8cc9;58BCD5//0xff55abd2
public static int themeColor = getIntColor("themeColor");
@@ -238,21 +239,38 @@ public class AndroidUtilities {
}
public static int dp(float value) {
+ if (value == 0) {
+ return 0;
+ }
return (int)Math.ceil(density * value);
}
+ public static int compare(int lhs, int rhs) {
+ if (lhs == rhs) {
+ return 0;
+ } else if (lhs > rhs) {
+ return 1;
+ }
+ return -1;
+ }
+
public static float dpf2(float value) {
+ if (value == 0) {
+ return 0;
+ }
return density * value;
}
public static void checkDisplaySize() {
try {
- WindowManager manager = (WindowManager)ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE);
+ Configuration configuration = ApplicationLoader.applicationContext.getResources().getConfiguration();
+ usingHardwareInput = configuration.keyboard != Configuration.KEYBOARD_NOKEYS && configuration.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO;
+ WindowManager manager = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE);
if (manager != null) {
Display display = manager.getDefaultDisplay();
if (display != null) {
display.getMetrics(displayMetrics);
- if(android.os.Build.VERSION.SDK_INT < 13) {
+ if (android.os.Build.VERSION.SDK_INT < 13) {
displaySize.set(display.getWidth(), display.getHeight());
} else {
display.getSize(displaySize);
@@ -263,6 +281,38 @@ public class AndroidUtilities {
} catch (Exception e) {
FileLog.e("tmessages", e);
}
+
+ /*
+ keyboardHidden
+ public static final int KEYBOARDHIDDEN_NO = 1
+ Constant for keyboardHidden, value corresponding to the keysexposed resource qualifier.
+
+ public static final int KEYBOARDHIDDEN_UNDEFINED = 0
+ Constant for keyboardHidden: a value indicating that no value has been set.
+
+ public static final int KEYBOARDHIDDEN_YES = 2
+ Constant for keyboardHidden, value corresponding to the keyshidden resource qualifier.
+
+ hardKeyboardHidden
+ public static final int HARDKEYBOARDHIDDEN_NO = 1
+ Constant for hardKeyboardHidden, value corresponding to the physical keyboard being exposed.
+
+ public static final int HARDKEYBOARDHIDDEN_UNDEFINED = 0
+ Constant for hardKeyboardHidden: a value indicating that no value has been set.
+
+ public static final int HARDKEYBOARDHIDDEN_YES = 2
+ Constant for hardKeyboardHidden, value corresponding to the physical keyboard being hidden.
+
+ keyboard
+ public static final int KEYBOARD_12KEY = 3
+ Constant for keyboard, value corresponding to the 12key resource qualifier.
+
+ public static final int KEYBOARD_NOKEYS = 1
+ Constant for keyboard, value corresponding to the nokeys resource qualifier.
+
+ public static final int KEYBOARD_QWERTY = 2
+ Constant for keyboard, value corresponding to the qwerty resource qualifier.
+ */
}
public static float getPixelsInCM(float cm, boolean isX) {
@@ -573,6 +623,9 @@ public class AndroidUtilities {
if (start != -1) {
stringBuilder.replace(start, start + 3, "");
end = stringBuilder.indexOf("");
+ if (end == -1) {
+ end = stringBuilder.indexOf("");
+ }
stringBuilder.replace(end, end + 4, "");
bolds.add(start);
bolds.add(end);
diff --git a/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java b/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java
index 4c116e37..cf701444 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java
@@ -14,6 +14,7 @@ import android.app.Activity;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.content.ContentResolver;
+import android.content.ContentValues;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.net.Uri;
@@ -37,7 +38,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
-import java.util.Locale;
import java.util.concurrent.ConcurrentHashMap;
public class ContactsController {
@@ -168,7 +168,7 @@ public class ContactsController {
if (!updatingInviteText && (inviteText == null || time + 86400 < (int)(System.currentTimeMillis() / 1000))) {
updatingInviteText = true;
TLRPC.TL_help_getInviteText req = new TLRPC.TL_help_getInviteText();
- req.lang_code = LocaleController.getLocaleString(Locale.getDefault());
+ req.lang_code = LocaleController.getLocaleString(LocaleController.getInstance().getSystemDefaultLocale());
if (req.lang_code == null || req.lang_code.length() == 0) {
req.lang_code = "en";
}
@@ -203,7 +203,19 @@ public class ContactsController {
public void checkAppAccount() {
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
- Account[] accounts = am.getAccountsByType("org.telegram.account");
+ Account[] accounts;
+ try {
+ accounts = am.getAccountsByType("org.telegram.account");
+ if (accounts != null && accounts.length > 0) {
+ for (Account c : accounts) {
+ am.removeAccount(c, null, null);
+ }
+ }
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+
+ accounts = am.getAccountsByType("org.telegram.messenger");
boolean recreateAccount = false;
if (UserConfig.isClientActivated()) {
if (accounts.length == 1) {
@@ -228,7 +240,7 @@ public class ContactsController {
}
if (UserConfig.isClientActivated()) {
try {
- currentAccount = new Account(UserConfig.getCurrentUser().phone, "org.telegram.account");
+ currentAccount = new Account(UserConfig.getCurrentUser().phone, "org.telegram.messenger");
am.addAccountExplicitly(currentAccount, "", null);
} catch (Exception e) {
FileLog.e("tmessages", e);
@@ -240,7 +252,7 @@ public class ContactsController {
public void deleteAllAppAccounts() {
try {
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
- Account[] accounts = am.getAccountsByType("org.telegram.account");
+ Account[] accounts = am.getAccountsByType("org.telegram.messenger");
for (Account c : accounts) {
am.removeAccount(c, null, null);
}
@@ -1247,7 +1259,7 @@ public class ContactsController {
private void performWriteContactsToPhoneBook() {
final ArrayList contactsArray = new ArrayList<>();
contactsArray.addAll(contacts);
- Utilities.photoBookQueue.postRunnable(new Runnable() {
+ Utilities.phoneBookQueue.postRunnable(new Runnable() {
@Override
public void run() {
performWriteContactsToPhoneBookInternal(contactsArray);
@@ -1304,7 +1316,7 @@ public class ContactsController {
}
for (final Integer uid : contactsTD) {
- Utilities.photoBookQueue.postRunnable(new Runnable() {
+ Utilities.phoneBookQueue.postRunnable(new Runnable() {
@Override
public void run() {
deleteContactFromPhoneBook(uid);
@@ -1464,7 +1476,7 @@ public class ContactsController {
builder = ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI);
builder.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0);
builder.withValue(ContactsContract.Data.MIMETYPE, "vnd.android.cursor.item/vnd.org.telegram.messenger.android.profile");
- builder.withValue(ContactsContract.Data.DATA1, "+" + user.phone);
+ builder.withValue(ContactsContract.Data.DATA1, user.id);
builder.withValue(ContactsContract.Data.DATA2, "Telegram Profile");
builder.withValue(ContactsContract.Data.DATA3, "+" + user.phone);
builder.withValue(ContactsContract.Data.DATA4, user.id);
@@ -1497,6 +1509,22 @@ public class ContactsController {
}
}
+ protected void markAsContacted(final String contactId) {
+ if (contactId == null) {
+ return;
+ }
+ Utilities.phoneBookQueue.postRunnable(new Runnable() {
+ @Override
+ public void run() {
+ Uri uri = Uri.parse(contactId);
+ ContentValues values = new ContentValues();
+ values.put(ContactsContract.Contacts.LAST_TIME_CONTACTED, System.currentTimeMillis());
+ ContentResolver cr = ApplicationLoader.applicationContext.getContentResolver();
+ cr.update(uri, values, null, null);
+ }
+ });
+ }
+
public void addContact(TLRPC.User user) {
if (user == null || user.phone == null) {
return;
@@ -1534,7 +1562,7 @@ public class ContactsController {
// }
for (final TLRPC.User u : res.users) {
- Utilities.photoBookQueue.postRunnable(new Runnable() {
+ Utilities.phoneBookQueue.postRunnable(new Runnable() {
@Override
public void run() {
addContactToPhoneBook(u, true);
@@ -1547,7 +1575,7 @@ public class ContactsController {
MessagesStorage.getInstance().putContacts(arrayList, false);
if (u.phone != null && u.phone.length() > 0) {
- String name = formatName(u.first_name, u.last_name);
+ CharSequence name = formatName(u.first_name, u.last_name);
MessagesStorage.getInstance().applyPhoneBookUpdates(u.phone, "");
Contact contact = contactsBookSPhones.get(u.phone);
if (contact != null) {
@@ -1600,7 +1628,7 @@ public class ContactsController {
return;
}
MessagesStorage.getInstance().deleteContacts(uids);
- Utilities.photoBookQueue.postRunnable(new Runnable() {
+ Utilities.phoneBookQueue.postRunnable(new Runnable() {
@Override
public void run() {
for (TLRPC.User user : users) {
@@ -1611,7 +1639,7 @@ public class ContactsController {
for (TLRPC.User user : users) {
if (user.phone != null && user.phone.length() > 0) {
- String name = ContactsController.formatName(user.first_name, user.last_name);
+ CharSequence name = ContactsController.formatName(user.first_name, user.last_name);
MessagesStorage.getInstance().applyPhoneBookUpdates(user.phone, "");
Contact contact = contactsBookSPhones.get(user.phone);
if (contact != null) {
@@ -1773,22 +1801,37 @@ public class ContactsController {
}
public static String formatName(String firstName, String lastName) {
- String result = "";
+ /*if ((firstName == null || firstName.length() == 0) && (lastName == null || lastName.length() == 0)) {
+ return LocaleController.getString("HiddenName", R.string.HiddenName);
+ }*/
+ if (firstName != null) {
+ firstName = firstName.trim();
+ }
+ if (lastName != null) {
+ lastName = lastName.trim();
+ }
+ StringBuilder result = new StringBuilder((firstName != null ? firstName.length() : 0) + (lastName != null ? lastName.length() : 0) + 1);
if (LocaleController.nameDisplayOrder == 1) {
- result = firstName;
- if (result == null || result.length() == 0) {
- result = lastName;
- } else if (result.length() != 0 && lastName != null && lastName.length() != 0) {
- result += " " + lastName;
+ if (firstName != null && firstName.length() > 0) {
+ result.append(firstName);
+ if (lastName != null && lastName.length() > 0) {
+ result.append(" ");
+ result.append(lastName);
+ }
+ } else if (lastName != null && lastName.length() > 0) {
+ result.append(lastName);
}
} else {
- result = lastName;
- if (result == null || result.length() == 0) {
- result = firstName;
- } else if (result.length() != 0 && firstName != null && firstName.length() != 0) {
- result += " " + firstName;
+ if (lastName != null && lastName.length() > 0) {
+ result.append(lastName);
+ if (firstName != null && firstName.length() > 0) {
+ result.append(" ");
+ result.append(firstName);
+ }
+ } else if (firstName != null && firstName.length() > 0) {
+ result.append(firstName);
}
}
- return result.trim();
+ return result.toString();
}
}
diff --git a/TMessagesProj/src/main/java/org/telegram/android/Emoji.java b/TMessagesProj/src/main/java/org/telegram/android/Emoji.java
index 1549263d..2e29e24a 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/Emoji.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/Emoji.java
@@ -33,7 +33,8 @@ import java.util.Locale;
public class Emoji {
private static HashMap rects = new HashMap<>();
- private static int drawImgSize, bigImgSize;
+ private static int drawImgSize;
+ private static int bigImgSize;
private static boolean inited = false;
private static Paint placeholderPaint;
private static Bitmap emojiBmp[] = new Bitmap[5];
@@ -193,19 +194,19 @@ public class Emoji {
static {
int emojiFullSize;
if (AndroidUtilities.density <= 1.0f) {
- emojiFullSize = 30;
+ emojiFullSize = 32;
} else if (AndroidUtilities.density <= 1.5f) {
- emojiFullSize = 45;
+ emojiFullSize = 48;
} else if (AndroidUtilities.density <= 2.0f) {
- emojiFullSize = 60;
+ emojiFullSize = 64;
} else {
- emojiFullSize = 90;
+ emojiFullSize = 96;
}
drawImgSize = AndroidUtilities.dp(20);
if (AndroidUtilities.isTablet()) {
bigImgSize = AndroidUtilities.dp(40);
} else {
- bigImgSize = AndroidUtilities.dp(30);
+ bigImgSize = AndroidUtilities.dp(32);
}
for (int j = 1; j < data.length; j++) {
@@ -234,8 +235,26 @@ public class Emoji {
scale = 3.0f;
}
- String imageName = String.format(Locale.US, "emoji%.01fx_%d.jpg", scale, page);
- File imageFile = ApplicationLoader.applicationContext.getFileStreamPath(imageName);
+ String imageName;
+ File imageFile;
+
+ try {
+ imageName = String.format(Locale.US, "emoji%.01fx_%d.jpg", scale, page);
+ imageFile = ApplicationLoader.applicationContext.getFileStreamPath(imageName);
+ if (imageFile.exists()) {
+ imageFile.delete();
+ }
+ imageName = String.format(Locale.US, "emoji%.01fx_a_%d.jpg", scale, page);
+ imageFile = ApplicationLoader.applicationContext.getFileStreamPath(imageName);
+ if (imageFile.exists()) {
+ imageFile.delete();
+ }
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+
+ imageName = String.format(Locale.US, "v4_emoji%.01fx_%d.jpg", scale, page);
+ imageFile = ApplicationLoader.applicationContext.getFileStreamPath(imageName);
if (!imageFile.exists()) {
InputStream is = ApplicationLoader.applicationContext.getAssets().open("emoji/" + imageName);
Utilities.copyFile(is, imageFile);
@@ -253,7 +272,7 @@ public class Emoji {
final Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Utilities.loadBitmap(imageFile.getAbsolutePath(), bitmap, imageResize, width, height, stride);
- imageName = String.format(Locale.US, "emoji%.01fx_a_%d.jpg", scale, page);
+ imageName = String.format(Locale.US, "v4_emoji%.01fx_a_%d.jpg", scale, page);
imageFile = ApplicationLoader.applicationContext.getFileStreamPath(imageName);
if (!imageFile.exists()) {
InputStream is = ApplicationLoader.applicationContext.getAssets().open("emoji/" + imageName);
@@ -401,7 +420,6 @@ public class Emoji {
if (cs == null || cs.length() == 0) {
return cs;
}
-
Spannable s;
if (cs instanceof Spannable) {
s = (Spannable)cs;
diff --git a/TMessagesProj/src/main/java/org/telegram/android/ImageLoader.java b/TMessagesProj/src/main/java/org/telegram/android/ImageLoader.java
index 37c0267a..0ff5997b 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/ImageLoader.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/ImageLoader.java
@@ -70,6 +70,8 @@ public class ImageLoader {
private DispatchQueue recycleQueue = new DispatchQueue("recycleQueue");
private ConcurrentHashMap fileProgresses = new ConcurrentHashMap<>();
private HashMap thumbGenerateTasks = new HashMap<>();
+ private static byte[] bytes;
+ private static byte[] bytesThumb;
private int currentHttpTasksCount = 0;
private LinkedList httpFileLoadTasks = new LinkedList<>();
@@ -507,6 +509,7 @@ public class ImageLoader {
}
Long mediaId = null;
+ boolean mediaIsVideo = false;
Bitmap image = null;
File cacheFileFinal = cacheImage.finalFilePath;
boolean canDeleteFile = true;
@@ -537,18 +540,35 @@ public class ImageLoader {
}
}
- if (image == null) {
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inSampleSize = 1;
+
+ if (!isWebp && Build.VERSION.SDK_INT > 10 && Build.VERSION.SDK_INT < 21) {
+ opts.inPurgeable = true;
+ }
+
if (isWebp) {
RandomAccessFile file = new RandomAccessFile(cacheFileFinal, "r");
ByteBuffer buffer = file.getChannel().map(FileChannel.MapMode.READ_ONLY, 0, cacheFileFinal.length());
image = Utilities.loadWebpImage(buffer, buffer.limit(), null);
file.close();
+ } else {
+ if (opts.inPurgeable) {
+ RandomAccessFile f = new RandomAccessFile(cacheFileFinal, "r");
+ int len = (int) f.length();
+ byte[] data = bytesThumb != null && bytesThumb.length >= len ? bytesThumb : null;
+ if (data == null) {
+ bytesThumb = data = new byte[len];
+ }
+ f.readFully(data, 0, len);
+ image = BitmapFactory.decodeByteArray(data, 0, len, opts);
} else {
FileInputStream is = new FileInputStream(cacheFileFinal);
- image = BitmapFactory.decodeStream(is, null, null);
+ image = BitmapFactory.decodeStream(is, null, opts);
is.close();
}
}
+
if (image == null) {
if (canDeleteFile && (cacheFileFinal.length() == 0 || cacheImage.filter == null)) {
cacheFileFinal.delete();
@@ -556,15 +576,18 @@ public class ImageLoader {
} else {
if (image != null) {
if (blurType == 1) {
- Utilities.blurBitmap(image, 3);
+ Utilities.blurBitmap(image, 3, opts.inPurgeable ? 0 : 1);
} else if (blurType == 2) {
- Utilities.blurBitmap(image, 1);
+ Utilities.blurBitmap(image, 1, opts.inPurgeable ? 0 : 1);
} else if (blurType == 3) {
- Utilities.blurBitmap(image, 7);
- Utilities.blurBitmap(image, 7);
- Utilities.blurBitmap(image, 7);
+ Utilities.blurBitmap(image, 7, opts.inPurgeable ? 0 : 1);
+ Utilities.blurBitmap(image, 7, opts.inPurgeable ? 0 : 1);
+ Utilities.blurBitmap(image, 7, opts.inPurgeable ? 0 : 1);
}
}
+ if (blurType == 0 && opts.inPurgeable) {
+ Utilities.pinBitmap(image);
+ }
if (runtimeHack != null) {
runtimeHack.trackFree(image.getRowBytes() * image.getHeight());
}
@@ -579,6 +602,14 @@ public class ImageLoader {
int idx = cacheImage.httpUrl.indexOf(":", 8);
if (idx >= 0) {
mediaId = Long.parseLong(cacheImage.httpUrl.substring(8, idx));
+ mediaIsVideo = false;
+ }
+ canDeleteFile = false;
+ } else if (cacheImage.httpUrl.startsWith("vthumb://")) {
+ int idx = cacheImage.httpUrl.indexOf(":", 9);
+ if (idx >= 0) {
+ mediaId = Long.parseLong(cacheImage.httpUrl.substring(9, idx));
+ mediaIsVideo = true;
}
canDeleteFile = false;
} else if (!cacheImage.httpUrl.startsWith("http")) {
@@ -604,21 +635,29 @@ public class ImageLoader {
}
BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inSampleSize = 1;
float w_filter = 0;
float h_filter = 0;
boolean blur = false;
if (cacheImage.filter != null) {
String args[] = cacheImage.filter.split("_");
+ if (args.length >= 2) {
w_filter = Float.parseFloat(args[0]) * AndroidUtilities.density;
h_filter = Float.parseFloat(args[1]) * AndroidUtilities.density;
- if (args.length > 2) {
+ }
+ if (cacheImage.filter.contains("b")) {
blur = true;
}
+ if (w_filter != 0 && h_filter != 0) {
opts.inJustDecodeBounds = true;
if (mediaId != null) {
+ if (mediaIsVideo) {
+ MediaStore.Video.Thumbnails.getThumbnail(ApplicationLoader.applicationContext.getContentResolver(), mediaId, MediaStore.Video.Thumbnails.MINI_KIND, opts);
+ } else {
MediaStore.Images.Thumbnails.getThumbnail(ApplicationLoader.applicationContext.getContentResolver(), mediaId, MediaStore.Images.Thumbnails.MINI_KIND, opts);
+ }
} else {
FileInputStream is = new FileInputStream(cacheFileFinal);
image = BitmapFactory.decodeStream(is, null, opts);
@@ -632,7 +671,8 @@ public class ImageLoader {
scaleFactor = 1;
}
opts.inJustDecodeBounds = false;
- opts.inSampleSize = (int)scaleFactor;
+ opts.inSampleSize = (int) scaleFactor;
+ }
}
synchronized (sync) {
if (isCancelled) {
@@ -645,14 +685,18 @@ public class ImageLoader {
} else {
opts.inPreferredConfig = Bitmap.Config.RGB_565;
}
- //if (Build.VERSION.SDK_INT < 21) {
- // opts.inPurgeable = true;
- //}
+ if (!isWebp && Build.VERSION.SDK_INT > 10 && Build.VERSION.SDK_INT < 21) {
+ opts.inPurgeable = true;
+ }
opts.inDither = false;
if (mediaId != null) {
+ if (mediaIsVideo) {
+ image = MediaStore.Video.Thumbnails.getThumbnail(ApplicationLoader.applicationContext.getContentResolver(), mediaId, MediaStore.Video.Thumbnails.MINI_KIND, opts);
+ } else {
image = MediaStore.Images.Thumbnails.getThumbnail(ApplicationLoader.applicationContext.getContentResolver(), mediaId, MediaStore.Images.Thumbnails.MINI_KIND, opts);
}
+ }
if (image == null) {
if (isWebp) {
RandomAccessFile file = new RandomAccessFile(cacheFileFinal, "r");
@@ -660,9 +704,20 @@ public class ImageLoader {
image = Utilities.loadWebpImage(buffer, buffer.limit(), null);
file.close();
} else {
- FileInputStream is = new FileInputStream(cacheFileFinal);
- image = BitmapFactory.decodeStream(is, null, opts);
- is.close();
+ if (opts.inPurgeable) {
+ RandomAccessFile f = new RandomAccessFile(cacheFileFinal, "r");
+ int len = (int) f.length();
+ byte[] data = bytes != null && bytes.length >= len ? bytes : null;
+ if (data == null) {
+ bytes = data = new byte[len];
+ }
+ f.readFully(data, 0, len);
+ image = BitmapFactory.decodeByteArray(data, 0, len, opts);
+ } else {
+ FileInputStream is = new FileInputStream(cacheFileFinal);
+ image = BitmapFactory.decodeStream(is, null, opts);
+ is.close();
+ }
}
}
if (image == null) {
@@ -670,12 +725,13 @@ public class ImageLoader {
cacheFileFinal.delete();
}
} else {
+ boolean blured = false;
if (cacheImage.filter != null) {
float bitmapW = image.getWidth();
float bitmapH = image.getHeight();
- if (bitmapW != w_filter && bitmapW > w_filter) {
+ if (!opts.inPurgeable && w_filter != 0 && bitmapW != w_filter && bitmapW > w_filter + 20) {
float scaleFactor = bitmapW / w_filter;
- Bitmap scaledBitmap = Bitmap.createScaledBitmap(image, (int)w_filter, (int)(bitmapH / scaleFactor), true);
+ Bitmap scaledBitmap = Bitmap.createScaledBitmap(image, (int) w_filter, (int) (bitmapH / scaleFactor), true);
if (image != scaledBitmap) {
image.recycle();
callGC();
@@ -683,9 +739,13 @@ public class ImageLoader {
}
}
if (image != null && blur && bitmapH < 100 && bitmapW < 100) {
- Utilities.blurBitmap(image, 3);
+ Utilities.blurBitmap(image, 3, opts.inPurgeable ? 0 : 1);
+ blured = true;
}
}
+ if (!blured && opts.inPurgeable) {
+ Utilities.pinBitmap(image);
+ }
if (runtimeHack != null) {
runtimeHack.trackFree(image.getRowBytes() * image.getHeight());
}
@@ -753,7 +813,7 @@ public class ImageLoader {
}
try {
Object res = trackAllocation.invoke(runtime, size);
- return (res instanceof Boolean) ? (Boolean)res : true;
+ return (res instanceof Boolean) ? (Boolean) res : true;
} catch (Exception e) {
return false;
}
@@ -765,7 +825,7 @@ public class ImageLoader {
}
try {
Object res = trackFree.invoke(runtime, size);
- return (res instanceof Boolean) ? (Boolean)res : true;
+ return (res instanceof Boolean) ? (Boolean) res : true;
} catch (Exception e) {
return false;
}
@@ -778,8 +838,8 @@ public class ImageLoader {
Method getRt = cl.getMethod("getRuntime", new Class[0]);
Object[] objects = new Object[0];
runtime = getRt.invoke(null, objects);
- trackAllocation = cl.getMethod("trackExternalAllocation", new Class[] {long.class});
- trackFree = cl.getMethod("trackExternalFree", new Class[] {long.class});
+ trackAllocation = cl.getMethod("trackExternalAllocation", new Class[]{long.class});
+ trackFree = cl.getMethod("trackExternalFree", new Class[]{long.class});
} catch (Exception e) {
FileLog.e("tmessages", e);
runtime = null;
@@ -872,7 +932,7 @@ public class ImageLoader {
@Override
public void run() {
for (ImageReceiver imgView : finalImageReceiverArray) {
- imgView.setImageBitmapByKey(image, key, thumb);
+ imgView.setImageBitmapByKey(image, key, thumb, false);
}
}
});
@@ -891,6 +951,7 @@ public class ImageLoader {
}
private static volatile ImageLoader Instance = null;
+
public static ImageLoader getInstance() {
ImageLoader localInstance = Instance;
if (localInstance == null) {
@@ -915,12 +976,13 @@ public class ImageLoader {
@Override
protected int sizeOf(String key, BitmapDrawable bitmap) {
Bitmap b = bitmap.getBitmap();
- if(Build.VERSION.SDK_INT < 12) {
+ if (Build.VERSION.SDK_INT < 12) {
return b.getRowBytes() * b.getHeight();
} else {
return b.getByteCount();
}
}
+
@Override
protected void entryRemoved(boolean evicted, String key, final BitmapDrawable oldBitmap, BitmapDrawable newBitmap) {
if (ignoreRemoval != null && key != null && ignoreRemoval.equals(key)) {
@@ -1206,7 +1268,7 @@ public class ImageLoader {
recycleQueue.postRunnable(new Runnable() {
@Override
public void run() {
- System.gc();
+ //System.gc();
}
});
}
@@ -1309,17 +1371,21 @@ public class ImageLoader {
return memCache.get(key);
}
- public void replaceImageInCache(final String oldKey, final String newKey) {
+ public void replaceImageInCache(final String oldKey, final String newKey, final TLRPC.FileLocation newLocation) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
ArrayList arr = memCache.getFilterKeys(oldKey);
if (arr != null) {
for (String filter : arr) {
- performReplace(oldKey + "@" + filter, newKey + "@" + filter);
+ String oldK = oldKey + "@" + filter;
+ String newK = newKey + "@" + filter;
+ performReplace(oldK, newK);
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.didReplacedPhotoInMemCache, oldK, newK, newLocation);
}
} else {
performReplace(oldKey, newKey);
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.didReplacedPhotoInMemCache, oldKey, newKey, newLocation);
}
}
});
@@ -1397,6 +1463,11 @@ public class ImageLoader {
if (idx >= 0) {
cacheFile = new File(httpLocation.substring(idx + 1));
}
+ } else if (httpLocation.startsWith("vthumb://")) {
+ int idx = httpLocation.indexOf(":", 9);
+ if (idx >= 0) {
+ cacheFile = new File(httpLocation.substring(idx + 1));
+ }
} else {
cacheFile = new File(httpLocation);
}
@@ -1500,7 +1571,7 @@ public class ImageLoader {
if (bitmapDrawable != null) {
cancelLoadingForImageReceiver(imageReceiver, 0);
if (!imageReceiver.isForcePreview()) {
- imageReceiver.setImageBitmapByKey(bitmapDrawable, key, false);
+ imageReceiver.setImageBitmapByKey(bitmapDrawable, key, false, true);
return;
}
}
@@ -1510,7 +1581,7 @@ public class ImageLoader {
if (thumbKey != null) {
BitmapDrawable bitmapDrawable = memCache.get(thumbKey);
if (bitmapDrawable != null) {
- imageReceiver.setImageBitmapByKey(bitmapDrawable, thumbKey, true);
+ imageReceiver.setImageBitmapByKey(bitmapDrawable, thumbKey, true, true);
cancelLoadingForImageReceiver(imageReceiver, 1);
thumbSet = true;
}
@@ -1797,7 +1868,7 @@ public class ImageLoader {
scaleFactor = 1;
}
bmOptions.inJustDecodeBounds = false;
- bmOptions.inSampleSize = (int)scaleFactor;
+ bmOptions.inSampleSize = (int) scaleFactor;
String exifPath = null;
if (path != null) {
@@ -1913,7 +1984,7 @@ public class ImageLoader {
size.size = size.bytes.length;
stream2.close();
} else {
- size.size = (int)stream.getChannel().size();
+ size.size = (int) stream.getChannel().size();
}
stream.close();
if (scaledBitmap != bitmap) {
@@ -1939,11 +2010,17 @@ public class ImageLoader {
boolean scaleAnyway = false;
float scaleFactor = Math.max(photoW / maxWidth, photoH / maxHeight);
if (minWidth != 0 && minHeight != 0 && (photoW < minWidth || photoH < minHeight)) {
+ if (photoW < minWidth && photoH > minHeight) {
+ scaleFactor = photoW / minWidth;
+ } else if (photoW > minWidth && photoH < minHeight) {
+ scaleFactor = photoH / minHeight;
+ } else {
scaleFactor = Math.max(photoW / minWidth, photoH / minHeight);
+ }
scaleAnyway = true;
}
- int w = (int)(photoW / scaleFactor);
- int h = (int)(photoH / scaleFactor);
+ int w = (int) (photoW / scaleFactor);
+ int h = (int) (photoH / scaleFactor);
if (h == 0 || w == 0) {
return null;
}
diff --git a/TMessagesProj/src/main/java/org/telegram/android/ImageReceiver.java b/TMessagesProj/src/main/java/org/telegram/android/ImageReceiver.java
index 1f75dd4b..eb9b2d2c 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/ImageReceiver.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/ImageReceiver.java
@@ -11,6 +11,7 @@ package org.telegram.android;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
+import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PorterDuff;
@@ -33,12 +34,25 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
void didSetImage(ImageReceiver imageReceiver, boolean set, boolean thumb);
}
+ private class SetImageBackup {
+ public TLObject fileLocation;
+ public String httpUrl;
+ public String filter;
+ public Drawable thumb;
+ public TLRPC.FileLocation thumbLocation;
+ public String thumbFilter;
+ public int size;
+ public boolean cacheOnly;
+ }
+
private View parentView;
private Integer tag;
private Integer thumbTag;
private MessageObject parentMessageObject;
private boolean canceledLoading;
+ private SetImageBackup setImageBackup;
+
private TLObject currentImageLocation;
private String currentKey;
private String currentThumbKey;
@@ -66,12 +80,16 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
private RectF roundRect;
private RectF bitmapRect;
private Matrix shaderMatrix;
- private int alpha = 255;
+ private float overrideAlpha = 1.0f;
private boolean isPressed;
- private boolean disableRecycle;
private int orientation;
private boolean centerRotation;
private ImageReceiverDelegate delegate;
+ private float currentAlpha;
+ private long lastUpdateAlphaTime;
+ private byte crossfadeAlpha = 1;
+ private boolean crossfadeWithThumb;
+ private ColorFilter colorFilter;
public ImageReceiver() {
@@ -107,6 +125,13 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
}
public void setImage(TLObject fileLocation, String httpUrl, String filter, Drawable thumb, TLRPC.FileLocation thumbLocation, String thumbFilter, int size, boolean cacheOnly) {
+ if (setImageBackup != null) {
+ setImageBackup.fileLocation = null;
+ setImageBackup.httpUrl = null;
+ setImageBackup.thumbLocation = null;
+ setImageBackup.thumb = null;
+ }
+
if ((fileLocation == null && httpUrl == null && thumbLocation == null)
|| (fileLocation != null && !(fileLocation instanceof TLRPC.TL_fileLocation)
&& !(fileLocation instanceof TLRPC.TL_fileEncryptedLocation)
@@ -121,13 +146,14 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
currentFilter = null;
currentCacheOnly = false;
staticThumb = thumb;
+ currentAlpha = 1;
currentThumbLocation = null;
currentSize = 0;
currentImage = null;
bitmapShader = null;
ImageLoader.getInstance().cancelLoadingForImageReceiver(this, 0);
if (parentView != null) {
- parentView.invalidate();
+ parentView.invalidate(imageX, imageY, imageX + imageW, imageY + imageH);
}
if (delegate != null) {
delegate.didSetImage(this, currentImage != null || currentThumb != null || staticThumb != null, currentImage == null);
@@ -135,6 +161,8 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
return;
}
+
+
if (!(thumbLocation instanceof TLRPC.TL_fileLocation)) {
thumbLocation = null;
}
@@ -188,6 +216,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
currentThumbLocation = thumbLocation;
staticThumb = thumb;
bitmapShader = null;
+ currentAlpha = 1.0f;
if (delegate != null) {
delegate.didSetImage(this, currentImage != null || currentThumb != null || staticThumb != null, currentImage == null);
@@ -195,10 +224,14 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
ImageLoader.getInstance().loadImageForImageReceiver(this);
if (parentView != null) {
- parentView.invalidate();
+ parentView.invalidate(imageX, imageY, imageX + imageW, imageY + imageH);
}
}
+ public void setColorFilter(ColorFilter filter) {
+ colorFilter = filter;
+ }
+
public void setDelegate(ImageReceiverDelegate delegate) {
this.delegate = delegate;
}
@@ -240,11 +273,18 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
currentSize = 0;
currentCacheOnly = false;
bitmapShader = null;
+ if (setImageBackup != null) {
+ setImageBackup.fileLocation = null;
+ setImageBackup.httpUrl = null;
+ setImageBackup.thumbLocation = null;
+ setImageBackup.thumb = null;
+ }
+ currentAlpha = 1;
if (delegate != null) {
delegate.didSetImage(this, currentImage != null || currentThumb != null || staticThumb != null, currentImage == null);
}
if (parentView != null) {
- parentView.invalidate();
+ parentView.invalidate(imageX, imageY, imageX + imageW, imageY + imageH);
}
}
@@ -257,17 +297,37 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
}
}
- public boolean draw(Canvas canvas) {
- try {
- BitmapDrawable bitmapDrawable = null;
- if (!forcePreview && currentImage != null) {
- bitmapDrawable = currentImage;
- } else if (staticThumb instanceof BitmapDrawable) {
- bitmapDrawable = (BitmapDrawable) staticThumb;
- } else if (currentThumb != null) {
- bitmapDrawable = currentThumb;
+ public void onDetachedFromWindow() {
+ if (currentImageLocation != null || currentHttpUrl != null || currentThumbLocation != null || staticThumb != null) {
+ if (setImageBackup == null) {
+ setImageBackup = new SetImageBackup();
}
- if (bitmapDrawable != null) {
+ setImageBackup.fileLocation = currentImageLocation;
+ setImageBackup.httpUrl = currentHttpUrl;
+ setImageBackup.filter = currentFilter;
+ setImageBackup.thumb = staticThumb;
+ setImageBackup.thumbLocation = currentThumbLocation;
+ setImageBackup.thumbFilter = currentThumbFilter;
+ setImageBackup.size = currentSize;
+ setImageBackup.cacheOnly = currentCacheOnly;
+ }
+ NotificationCenter.getInstance().removeObserver(this, NotificationCenter.didReplacedPhotoInMemCache);
+ clearImage();
+ }
+
+ public boolean onAttachedToWindow() {
+ NotificationCenter.getInstance().addObserver(this, NotificationCenter.didReplacedPhotoInMemCache);
+ if (setImageBackup != null && (setImageBackup.fileLocation != null || setImageBackup.httpUrl != null || setImageBackup.thumbLocation != null || setImageBackup.thumb != null)) {
+ setImage(setImageBackup.fileLocation, setImageBackup.httpUrl, setImageBackup.filter, setImageBackup.thumb, setImageBackup.thumbLocation, setImageBackup.thumbFilter, setImageBackup.size, setImageBackup.cacheOnly);
+ return true;
+ }
+ return false;
+ }
+
+ private void drawDrawable(Canvas canvas, Drawable drawable, int alpha) {
+ if (drawable instanceof BitmapDrawable) {
+ BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
+
Paint paint = bitmapDrawable.getPaint();
boolean hasFilter = paint != null && paint.getColorFilter() != null;
if (hasFilter && !isPressed) {
@@ -277,6 +337,9 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
bitmapDrawable.setColorFilter(new PorterDuffColorFilter(0xffdddddd, PorterDuff.Mode.MULTIPLY));
hasFilter = true;
}
+ if (colorFilter != null) {
+ bitmapDrawable.setColorFilter(colorFilter);
+ }
if (bitmapShader != null) {
drawRegion.set(imageX, imageY, imageX + imageW, imageY + imageH);
if (isVisible) {
@@ -284,6 +347,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
shaderMatrix.reset();
shaderMatrix.setRectToRect(bitmapRect, roundRect, Matrix.ScaleToFit.FILL);
bitmapShader.setLocalMatrix(shaderMatrix);
+ roundPaint.setAlpha(alpha);
canvas.drawRoundRect(roundRect, roundRadius, roundRadius, roundPaint);
}
} else {
@@ -411,18 +475,73 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
}
}
}
- return true;
- } else if (staticThumb != null) {
- drawRegion.set(imageX, imageY, imageX + imageW, imageY + imageH);
- staticThumb.setBounds(drawRegion);
- if (isVisible) {
- try {
- staticThumb.setAlpha(alpha);
- staticThumb.draw(canvas);
- } catch (Exception e) {
- FileLog.e("tmessages", e);
+ } else {
+ drawRegion.set(imageX, imageY, imageX + imageW, imageY + imageH);
+ drawable.setBounds(drawRegion);
+ if (isVisible) {
+ try {
+ drawable.setAlpha(alpha);
+ drawable.draw(canvas);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
}
}
+ }
+
+ private void checkAlphaAnimation() {
+ if (currentAlpha != 1) {
+ long currentTime = System.currentTimeMillis();
+ currentAlpha += (currentTime - lastUpdateAlphaTime) / 150.0f;
+ if (currentAlpha > 1) {
+ currentAlpha = 1;
+ }
+ lastUpdateAlphaTime = System.currentTimeMillis();
+ if (parentView != null) {
+ parentView.invalidate(imageX, imageY, imageX + imageW, imageY + imageH);
+ }
+ }
+ }
+
+ public boolean draw(Canvas canvas) {
+ try {
+ BitmapDrawable bitmapDrawable = null;
+ if (!forcePreview && currentImage != null) {
+ bitmapDrawable = currentImage;
+ } else if (staticThumb instanceof BitmapDrawable) {
+ bitmapDrawable = (BitmapDrawable) staticThumb;
+ } else if (currentThumb != null) {
+ bitmapDrawable = currentThumb;
+ }
+ if (bitmapDrawable != null) {
+ if (crossfadeAlpha != 0) {
+ if (crossfadeWithThumb && currentAlpha != 1.0f) {
+ Drawable thumbDrawable = null;
+ if (bitmapDrawable == currentImage) {
+ if (staticThumb != null) {
+ thumbDrawable = staticThumb;
+ } else if (currentThumb != null) {
+ thumbDrawable = currentThumb;
+ }
+ } else if (bitmapDrawable == currentThumb) {
+ if (staticThumb != null) {
+ thumbDrawable = staticThumb;
+ }
+ }
+ if (thumbDrawable != null) {
+ drawDrawable(canvas, thumbDrawable, (int) (overrideAlpha * 255));
+ }
+ }
+ drawDrawable(canvas, bitmapDrawable, (int) (overrideAlpha * currentAlpha * 255));
+ } else {
+ drawDrawable(canvas, bitmapDrawable, (int) (overrideAlpha * 255));
+ }
+
+ checkAlphaAnimation();
+ return true;
+ } else if (staticThumb != null) {
+ drawDrawable(canvas, staticThumb, 255);
+ checkAlphaAnimation();
return true;
}
} catch (Exception e) {
@@ -458,7 +577,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
}
isVisible = value;
if (invalidate && parentView != null) {
- parentView.invalidate();
+ parentView.invalidate(imageX, imageY, imageX + imageW, imageY + imageH);
}
}
@@ -467,7 +586,11 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
}
public void setAlpha(float value) {
- alpha = (int)(value * 255.0f);
+ overrideAlpha = value;
+ }
+
+ public void setCrossfadeAlpha(byte value) {
+ crossfadeAlpha = value;
}
public boolean hasImage() {
@@ -631,7 +754,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
}
}
- protected void setImageBitmapByKey(BitmapDrawable bitmap, String key, boolean thumb) {
+ protected void setImageBitmapByKey(BitmapDrawable bitmap, String key, boolean thumb, boolean memCache) {
if (bitmap == null || key == null) {
return;
}
@@ -647,17 +770,38 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
roundPaint.setShader(bitmapShader);
bitmapRect.set(0, 0, object.getWidth(), object.getHeight());
}
+
+ if (!memCache && !forcePreview) {
+ if (currentThumb == null && staticThumb == null || currentAlpha == 1.0f) {
+ currentAlpha = 0.0f;
+ lastUpdateAlphaTime = System.currentTimeMillis();
+ crossfadeWithThumb = currentThumb != null || staticThumb != null;
+ }
+ } else {
+ currentAlpha = 1.0f;
+ }
+
if (parentView != null) {
- parentView.invalidate();
+ parentView.invalidate(imageX, imageY, imageX + imageW, imageY + imageH);
}
} else if (currentThumb == null && (currentImage == null || forcePreview)) {
if (currentThumbKey == null || !key.equals(currentThumbKey)) {
return;
}
ImageLoader.getInstance().incrementUseCount(currentThumbKey);
+
currentThumb = bitmap;
+
+ if (!memCache && crossfadeAlpha != 2) {
+ currentAlpha = 0.0f;
+ lastUpdateAlphaTime = System.currentTimeMillis();
+ crossfadeWithThumb = staticThumb != null && currentKey == null;
+ } else {
+ currentAlpha = 1.0f;
+ }
+
if (!(staticThumb instanceof BitmapDrawable) && parentView != null) {
- parentView.invalidate();
+ parentView.invalidate(imageX, imageY, imageX + imageW, imageY + imageH);
}
}
@@ -722,7 +866,27 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
staticThumb = null;
}
if (parentView != null) {
- parentView.invalidate();
+ parentView.invalidate(imageX, imageY, imageX + imageW, imageY + imageH);
+ }
+ }
+ } else if (id == NotificationCenter.didReplacedPhotoInMemCache) {
+ String oldKey = (String) args[0];
+ if (currentKey != null && currentKey.equals(oldKey)) {
+ currentKey = (String) args[1];
+ currentImageLocation = (TLRPC.FileLocation) args[2];
+ }
+ if (currentThumbKey != null && currentThumbKey.equals(oldKey)) {
+ currentThumbKey = (String) args[1];
+ currentThumbLocation = (TLRPC.FileLocation) args[2];
+ }
+ if (setImageBackup != null) {
+ if (currentKey != null && currentKey.equals(oldKey)) {
+ currentKey = (String) args[1];
+ currentImageLocation = (TLRPC.FileLocation) args[2];
+ }
+ if (currentThumbKey != null && currentThumbKey.equals(oldKey)) {
+ currentThumbKey = (String) args[1];
+ currentThumbLocation = (TLRPC.FileLocation) args[2];
}
}
}
diff --git a/TMessagesProj/src/main/java/org/telegram/android/LocaleController.java b/TMessagesProj/src/main/java/org/telegram/android/LocaleController.java
index cd58ef94..d2d559b1 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/LocaleController.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/LocaleController.java
@@ -378,6 +378,10 @@ public class LocaleController {
}
}
+ public Locale getSystemDefaultLocale() {
+ return systemDefaultLocale;
+ }
+
public static String getLocaleString(Locale locale) {
if (locale == null) {
return "en";
@@ -676,11 +680,12 @@ public class LocaleController {
}
public static String formatString(String key, int res, Object... args) {
+ try {
String value = getInstance().localeValues.get(key);
if (value == null) {
value = ApplicationLoader.applicationContext.getString(res);
}
- try {
+
if (getInstance().currentLocale != null) {
return String.format(getInstance().currentLocale, value, args);
} else {
diff --git a/TMessagesProj/src/main/java/org/telegram/android/MediaController.java b/TMessagesProj/src/main/java/org/telegram/android/MediaController.java
index 800b396c..8d80b2b4 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/MediaController.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/MediaController.java
@@ -87,6 +87,8 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
public static int[] readArgs = new int[3];
+ public static String iFilter = "*";
+
public interface FileDownloadProgressListener {
void onFailedDownload(String fileName);
void onSuccessDownload(String fileName);
@@ -117,17 +119,27 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
MediaStore.Images.Media.ORIENTATION
};
+ private static final String[] projectionVideo = {
+ MediaStore.Video.Media._ID,
+ MediaStore.Video.Media.BUCKET_ID,
+ MediaStore.Video.Media.BUCKET_DISPLAY_NAME,
+ MediaStore.Video.Media.DATA,
+ MediaStore.Video.Media.DATE_TAKEN
+ };
+
public static class AlbumEntry {
public int bucketId;
public String bucketName;
public PhotoEntry coverPhoto;
public ArrayList photos = new ArrayList<>();
public HashMap photosByIds = new HashMap<>();
+ public boolean isVideo;
- public AlbumEntry(int bucketId, String bucketName, PhotoEntry coverPhoto) {
+ public AlbumEntry(int bucketId, String bucketName, PhotoEntry coverPhoto, boolean isVideo) {
this.bucketId = bucketId;
this.bucketName = bucketName;
this.coverPhoto = coverPhoto;
+ this.isVideo = isVideo;
}
public void addPhoto(PhotoEntry photoEntry) {
@@ -144,13 +156,16 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
public int orientation;
public String thumbPath;
public String imagePath;
+ public boolean isVideo;
+ public CharSequence caption;
- public PhotoEntry(int bucketId, int imageId, long dateTaken, String path, int orientation) {
+ public PhotoEntry(int bucketId, int imageId, long dateTaken, String path, int orientation, boolean isVideo) {
this.bucketId = bucketId;
this.imageId = imageId;
this.dateTaken = dateTaken;
this.path = path;
this.orientation = orientation;
+ this.isVideo = isVideo;
}
}
@@ -167,6 +182,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
public int date;
public String thumbPath;
public String imagePath;
+ public CharSequence caption;
}
public final static String MIME_TYPE = "video/avc";
@@ -178,6 +194,8 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
private final static int PROCESSOR_TYPE_TI = 5;
private final Object videoConvertSync = new Object();
+ private HashMap typingTimes = new HashMap<>();
+
private SensorManager sensorManager;
private Sensor proximitySensor;
private boolean ignoreProximity;
@@ -550,6 +568,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
videoDownloadQueue.clear();
downloadQueueKeys.clear();
videoConvertQueue.clear();
+ typingTimes.clear();
cancelVideoConvert(null);
}
@@ -975,6 +994,29 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
}
listenerInProgress = false;
processLaterArrays();
+ try {
+ ArrayList delayedMessages = SendMessagesHelper.getInstance().getDelayedMessages(fileName);
+ if (delayedMessages != null) {
+ for (SendMessagesHelper.DelayedMessage delayedMessage : delayedMessages) {
+ if (delayedMessage.encryptedChat == null) {
+ long dialog_id = delayedMessage.obj.getDialogId();
+ Long lastTime = typingTimes.get(dialog_id);
+ if (lastTime == null || lastTime + 4000 < System.currentTimeMillis()) {
+ if (delayedMessage.videoLocation != null) {
+ MessagesController.getInstance().sendTyping(dialog_id, 5, 0);
+ } else if (delayedMessage.documentLocation != null) {
+ MessagesController.getInstance().sendTyping(dialog_id, 3, 0);
+ } else if (delayedMessage.location != null) {
+ MessagesController.getInstance().sendTyping(dialog_id, 4, 0);
+ }
+ typingTimes.put(dialog_id, System.currentTimeMillis());
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
} else if (id == NotificationCenter.messagesDeleted) {
if (playingMessageObject != null) {
ArrayList markAsDeletedMessages = (ArrayList)args[0];
@@ -1970,10 +2012,12 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
@Override
public void run() {
final ArrayList albumsSorted = new ArrayList<>();
+ final ArrayList videoAlbumsSorted = new ArrayList<>();
HashMap albums = new HashMap<>();
AlbumEntry allPhotosAlbum = null;
String cameraFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath() + "/" + "Camera/";
Integer cameraAlbumId = null;
+ Integer cameraAlbumVideoId = null;
Cursor cursor = null;
try {
@@ -1993,15 +2037,15 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
String path = cursor.getString(dataColumn);
long dateTaken = cursor.getLong(dateColumn);
int orientation = cursor.getInt(orientationColumn);
-
- if (path == null || path.length() == 0) {
+ //Plus
+ if (path == null || path.length() == 0 || !iFilter.equals("*") && !path.toLowerCase().endsWith(iFilter)) {//|| !path.contains(".webp")
continue;
}
- PhotoEntry photoEntry = new PhotoEntry(bucketId, imageId, dateTaken, path, orientation);
+ PhotoEntry photoEntry = new PhotoEntry(bucketId, imageId, dateTaken, path, orientation, false);
if (allPhotosAlbum == null) {
- allPhotosAlbum = new AlbumEntry(0, LocaleController.getString("AllPhotos", R.string.AllPhotos), photoEntry);
+ allPhotosAlbum = new AlbumEntry(0, LocaleController.getString("AllPhotos", R.string.AllPhotos), photoEntry, false);
albumsSorted.add(0, allPhotosAlbum);
}
if (allPhotosAlbum != null) {
@@ -2010,7 +2054,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
AlbumEntry albumEntry = albums.get(bucketId);
if (albumEntry == null) {
- albumEntry = new AlbumEntry(bucketId, bucketName, photoEntry);
+ albumEntry = new AlbumEntry(bucketId, bucketName, photoEntry, false);
albums.put(bucketId, albumEntry);
if (cameraAlbumId == null && cameraFolder != null && path != null && path.startsWith(cameraFolder)) {
albumsSorted.add(0, albumEntry);
@@ -2034,11 +2078,72 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
}
}
}
+
+ try {
+ albums.clear();
+ allPhotosAlbum = null;
+ cursor = MediaStore.Images.Media.query(ApplicationLoader.applicationContext.getContentResolver(), MediaStore.Video.Media.EXTERNAL_CONTENT_URI, projectionVideo, "", null, MediaStore.Video.Media.DATE_TAKEN + " DESC");
+ if (cursor != null) {
+ int imageIdColumn = cursor.getColumnIndex(MediaStore.Video.Media._ID);
+ int bucketIdColumn = cursor.getColumnIndex(MediaStore.Video.Media.BUCKET_ID);
+ int bucketNameColumn = cursor.getColumnIndex(MediaStore.Video.Media.BUCKET_DISPLAY_NAME);
+ int dataColumn = cursor.getColumnIndex(MediaStore.Video.Media.DATA);
+ int dateColumn = cursor.getColumnIndex(MediaStore.Video.Media.DATE_TAKEN);
+
+ while (cursor.moveToNext()) {
+ int imageId = cursor.getInt(imageIdColumn);
+ int bucketId = cursor.getInt(bucketIdColumn);
+ String bucketName = cursor.getString(bucketNameColumn);
+ String path = cursor.getString(dataColumn);
+ long dateTaken = cursor.getLong(dateColumn);
+
+ if (path == null || path.length() == 0) {
+ continue;
+ }
+
+ PhotoEntry photoEntry = new PhotoEntry(bucketId, imageId, dateTaken, path, 0, true);
+
+ if (allPhotosAlbum == null) {
+ allPhotosAlbum = new AlbumEntry(0, LocaleController.getString("AllVideo", R.string.AllVideo), photoEntry, true);
+ videoAlbumsSorted.add(0, allPhotosAlbum);
+ }
+ if (allPhotosAlbum != null) {
+ allPhotosAlbum.addPhoto(photoEntry);
+ }
+
+ AlbumEntry albumEntry = albums.get(bucketId);
+ if (albumEntry == null) {
+ albumEntry = new AlbumEntry(bucketId, bucketName, photoEntry, true);
+ albums.put(bucketId, albumEntry);
+ if (cameraAlbumVideoId == null && cameraFolder != null && path != null && path.startsWith(cameraFolder)) {
+ videoAlbumsSorted.add(0, albumEntry);
+ cameraAlbumVideoId = bucketId;
+ } else {
+ videoAlbumsSorted.add(albumEntry);
+ }
+ }
+
+ albumEntry.addPhoto(photoEntry);
+ }
+ }
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ } finally {
+ if (cursor != null) {
+ try {
+ cursor.close();
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ }
+ }
+
final Integer cameraAlbumIdFinal = cameraAlbumId;
+ final Integer cameraAlbumVideoIdFinal = cameraAlbumVideoId;
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
- NotificationCenter.getInstance().postNotificationName(NotificationCenter.albumsDidLoaded, guid, albumsSorted, cameraAlbumIdFinal);
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.albumsDidLoaded, guid, albumsSorted, cameraAlbumIdFinal, videoAlbumsSorted, cameraAlbumVideoIdFinal);
}
});
}
diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java b/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java
index 774235e6..c8a33d07 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java
@@ -44,6 +44,7 @@ public class MessageObject {
public TLRPC.Message messageOwner;
public CharSequence messageText;
public CharSequence linkDescription;
+ public CharSequence caption;
public MessageObject replyMessageObject;
public int type;
public int contentType;
@@ -54,7 +55,7 @@ public class MessageObject {
public int audioProgressSec;
public ArrayList photoThumbs;
- private static TextPaint textPaint;
+ public static TextPaint textPaint;
private static TextPaint textPaintRight = new TextPaint(Paint.ANTI_ALIAS_FLAG);
private static TextPaint textPaintLeft = new TextPaint(Paint.ANTI_ALIAS_FLAG);
public int lastLineWidth;
@@ -163,6 +164,13 @@ public class MessageObject {
whoUser = MessagesController.getInstance().getUser(message.action.user_id);
}
if (whoUser != null && fromUser != null) {
+ if (whoUser.id == fromUser.id) {
+ if (isOut()) {
+ messageText = LocaleController.getString("ActionAddUserSelf", R.string.ActionAddUserSelf).replace("un1", LocaleController.getString("FromYou", R.string.FromYou));
+ } else {
+ messageText = replaceWithLink(LocaleController.getString("ActionAddUserSelf", R.string.ActionAddUserSelf), "un1", fromUser);
+ }
+ } else {
if (isOut()) {
messageText = replaceWithLink(LocaleController.getString("ActionYouAddUser", R.string.ActionYouAddUser), "un2", whoUser);
} else if (message.action.user_id == UserConfig.getClientUserId()) {
@@ -171,9 +179,20 @@ public class MessageObject {
messageText = replaceWithLink(LocaleController.getString("ActionAddUser", R.string.ActionAddUser), "un2", whoUser);
messageText = replaceWithLink(messageText, "un1", fromUser);
}
+ }
} else {
messageText = LocaleController.getString("ActionAddUser", R.string.ActionAddUser).replace("un2", "").replace("un1", "");
}
+ } else if (message.action instanceof TLRPC.TL_messageActionChatJoinedByLink) {
+ if (fromUser != null) {
+ if (isOut()) {
+ messageText = LocaleController.getString("ActionInviteYou", R.string.ActionInviteYou);
+ } else {
+ messageText = replaceWithLink(LocaleController.getString("ActionInviteUser", R.string.ActionInviteUser), "un1", fromUser);
+ }
+ } else {
+ messageText = LocaleController.getString("ActionInviteUser", R.string.ActionInviteUser).replace("un1", "");
+ }
} else if (message.action instanceof TLRPC.TL_messageActionChatEditPhoto) {
if (isOut()) {
messageText = LocaleController.getString("ActionYouChangedPhoto", R.string.ActionYouChangedPhoto);
@@ -298,7 +317,7 @@ public class MessageObject {
messageText = LocaleController.getString("AttachPhoto", R.string.AttachPhoto);
} else if (message.media instanceof TLRPC.TL_messageMediaVideo) {
messageText = LocaleController.getString("AttachVideo", R.string.AttachVideo);
- } else if (message.media instanceof TLRPC.TL_messageMediaGeo) {
+ } else if (message.media instanceof TLRPC.TL_messageMediaGeo || message.media instanceof TLRPC.TL_messageMediaVenue) {
messageText = LocaleController.getString("AttachLocation", R.string.AttachLocation);
} else if (message.media instanceof TLRPC.TL_messageMediaContact) {
messageText = LocaleController.getString("AttachContact", R.string.AttachContact);
@@ -333,7 +352,7 @@ public class MessageObject {
contentType = type = 0;
} else if (message.media instanceof TLRPC.TL_messageMediaPhoto) {
contentType = type = 1;
- } else if (message.media instanceof TLRPC.TL_messageMediaGeo) {
+ } else if (message.media instanceof TLRPC.TL_messageMediaGeo || message.media instanceof TLRPC.TL_messageMediaVenue) {
contentType = 1;
type = 4;
} else if (message.media instanceof TLRPC.TL_messageMediaVideo) {
@@ -393,6 +412,7 @@ public class MessageObject {
monthKey = String.format("%d_%02d", dateYear, dateMonth);
}
+ generateCaption();
if (generateLayout) {
generateLayout();
}
@@ -588,6 +608,41 @@ public class MessageObject {
}
}
+ public void generateCaption() {
+ if (caption != null) {
+ return;
+ }
+ if (messageOwner.media != null && messageOwner.media.caption != null && messageOwner.media.caption.length() > 0) {
+ caption = Emoji.replaceEmoji(messageOwner.media.caption, textPaint.getFontMetricsInt(), AndroidUtilities.dp(20));
+ if (containsUrls(caption)) {
+ try {
+ Linkify.addLinks((Spannable) caption, Linkify.WEB_URLS);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ addUsernamesAndHashtags(caption);
+ }
+ }
+ }
+
+ private void addUsernamesAndHashtags(CharSequence charSequence) {
+ try {
+ Pattern pattern = Pattern.compile("(^|\\s)@[a-zA-Z\\d_]{5,32}|(^|\\s)#[\\w\\.]+");
+ Matcher matcher = pattern.matcher(charSequence);
+ while (matcher.find()) {
+ int start = matcher.start();
+ int end = matcher.end();
+ if (charSequence.charAt(start) != '@' && charSequence.charAt(start) != '#') {
+ start++;
+ }
+ URLSpanNoUnderline url = new URLSpanNoUnderline(charSequence.subSequence(start, end).toString());
+ ((Spannable) charSequence).setSpan(url, start, end, 0);
+ }
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ }
+
private void generateLayout() {
if (type != 0 || messageOwner.to_id == null || messageText == null || messageText.length() == 0) {
return;
@@ -598,26 +653,19 @@ public class MessageObject {
if (messageText instanceof Spannable && containsUrls(messageText)) {
if (messageText.length() < 100) {
- Linkify.addLinks((Spannable) messageText, Linkify.WEB_URLS | Linkify.PHONE_NUMBERS);
- } else {
- Linkify.addLinks((Spannable) messageText, Linkify.WEB_URLS);
- }
-
- try {
- Pattern pattern = Pattern.compile("(^|\\s)@[a-zA-Z\\d_]{5,32}|(^|\\s)#[\\w\\.]+");
- Matcher matcher = pattern.matcher(messageText);
- while (matcher.find()) {
- int start = matcher.start();
- int end = matcher.end();
- if (messageText.charAt(start) != '@' && messageText.charAt(start) != '#') {
- start++;
- }
- URLSpanNoUnderline url = new URLSpanNoUnderline(messageText.subSequence(start, end).toString());
- ((Spannable) messageText).setSpan(url, start, end, 0);
+ try {
+ Linkify.addLinks((Spannable) messageText, Linkify.WEB_URLS | Linkify.PHONE_NUMBERS);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ } else {
+ try {
+ Linkify.addLinks((Spannable) messageText, Linkify.WEB_URLS);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
}
- } catch (Exception e) {
- FileLog.e("tmessages", e);
}
+ addUsernamesAndHashtags(messageText);
}
int maxWidth;
@@ -782,10 +830,33 @@ public class MessageObject {
return (messageOwner.flags & TLRPC.MESSAGE_FLAG_UNREAD) != 0;
}
+ public boolean isContentUnread() {
+ return (messageOwner.flags & TLRPC.MESSAGE_FLAG_CONTENT_UNREAD) != 0;
+ }
+
public void setIsRead() {
messageOwner.flags &= ~TLRPC.MESSAGE_FLAG_UNREAD;
}
+ public int getUnradFlags() {
+ return getUnreadFlags(messageOwner);
+ }
+
+ public static int getUnreadFlags(TLRPC.Message message) {
+ int flags = 0;
+ if ((message.flags & TLRPC.MESSAGE_FLAG_UNREAD) == 0) {
+ flags |= 1;
+ }
+ if ((message.flags & TLRPC.MESSAGE_FLAG_CONTENT_UNREAD) == 0) {
+ flags |= 2;
+ }
+ return flags;
+ }
+
+ public void setContentIsRead() {
+ messageOwner.flags &= ~TLRPC.MESSAGE_FLAG_CONTENT_UNREAD;
+ }
+
public int getId() {
return messageOwner.id;
}
@@ -801,18 +872,27 @@ public class MessageObject {
messageOwner.media instanceof TLRPC.TL_messageMediaVideo);
}
- public static void setIsUnread(TLRPC.Message message, boolean unread) {
- if (unread) {
+ public static void setUnreadFlags(TLRPC.Message message, int flag) {
+ if ((flag & 1) == 0) {
message.flags |= TLRPC.MESSAGE_FLAG_UNREAD;
} else {
message.flags &= ~TLRPC.MESSAGE_FLAG_UNREAD;
}
+ if ((flag & 2) == 0) {
+ message.flags |= TLRPC.MESSAGE_FLAG_CONTENT_UNREAD;
+ } else {
+ message.flags &= ~TLRPC.MESSAGE_FLAG_CONTENT_UNREAD;
+ }
}
public static boolean isUnread(TLRPC.Message message) {
return (message.flags & TLRPC.MESSAGE_FLAG_UNREAD) != 0;
}
+ public static boolean isContentUnread(TLRPC.Message message) {
+ return (message.flags & TLRPC.MESSAGE_FLAG_CONTENT_UNREAD) != 0;
+ }
+
public static boolean isOut(TLRPC.Message message) {
return (message.flags & TLRPC.MESSAGE_FLAG_OUT) != 0;
}
diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java
index 5773daf1..711e2ad6 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java
@@ -23,7 +23,6 @@ import org.telegram.messenger.FileLog;
import org.telegram.messenger.R;
import org.telegram.messenger.RPCRequest;
import org.telegram.messenger.SerializedData;
-import org.telegram.messenger.TLClassStore;
import org.telegram.messenger.TLObject;
import org.telegram.messenger.TLRPC;
import org.telegram.messenger.UserConfig;
@@ -34,7 +33,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
-import java.util.Locale;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Semaphore;
@@ -45,13 +43,16 @@ public class MessagesController implements NotificationCenter.NotificationCenter
private ConcurrentHashMap users = new ConcurrentHashMap<>(100, 1.0f, 2);
private ConcurrentHashMap usersByUsernames = new ConcurrentHashMap<>(100, 1.0f, 2);
+ private HashMap exportedChats = new HashMap<>();
+
public ArrayList dialogs = new ArrayList<>();
public ArrayList dialogsServerOnly = new ArrayList<>();
public ConcurrentHashMap dialogs_dict = new ConcurrentHashMap<>(100, 1.0f, 2);
public HashMap dialogMessage = new HashMap<>();
public ConcurrentHashMap> printingUsers = new ConcurrentHashMap<>(20, 1.0f, 2);
public HashMap printingStrings = new HashMap<>();
- public HashMap sendingTypings = new HashMap<>();
+ public HashMap printingStringsTypes = new HashMap<>();
+ public HashMap> sendingTypings = new HashMap<>();
public ConcurrentHashMap onlinePrivacy = new ConcurrentHashMap<>(20, 1.0f, 2);
private int lastPrintingStringCount = 0;
@@ -124,6 +125,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public static class PrintingUser {
public long lastTime;
public int userId;
+ public TLRPC.SendMessageAction action;
}
private static volatile MessagesController Instance = null;
@@ -163,9 +165,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter
byte[] bytes = Base64.decode(disabledFeaturesString, Base64.DEFAULT);
if (bytes != null) {
SerializedData data = new SerializedData(bytes);
- int count = data.readInt32();
+ int count = data.readInt32(false);
for (int a = 0; a < count; a++) {
- TLRPC.TL_disabledFeature feature = (TLRPC.TL_disabledFeature) TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.TL_disabledFeature feature = TLRPC.TL_disabledFeature.TLdeserialize(data, data.readInt32(false), false);
if (feature != null && feature.feature != null && feature.description != null) {
disabledFeatures.add(feature);
}
@@ -372,6 +374,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
SecretChatHelper.getInstance().cleanUp();
dialogs_dict.clear();
+ exportedChats.clear();
dialogs.clear();
dialogsServerOnly.clear();
users.clear();
@@ -380,6 +383,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
dialogMessage.clear();
printingUsers.clear();
printingStrings.clear();
+ printingStringsTypes.clear();
onlinePrivacy.clear();
totalDialogsCount = 0;
lastPrintingStringCount = 0;
@@ -463,6 +467,14 @@ public class MessagesController implements NotificationCenter.NotificationCenter
return chat;
}
+ public TLRPC.ExportedChatInvite getExportedInvite(int chat_id) {
+ return exportedChats.get(chat_id);
+ }
+
+ public void putExportedInvite(int chat_id, TLRPC.TL_chatInviteExported invite) {
+ exportedChats.put(chat_id, invite);
+ }
+
public boolean putUser(TLRPC.User user, boolean fromCache) {
if (user == null) {
return false;
@@ -564,7 +576,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
public void loadFullChat(final int chat_id, final int classGuid) {
- if (loadingFullChats.contains(chat_id) || loadedFullChats.contains(chat_id)) {
+ loadFullChat(chat_id, classGuid, false);
+ }
+
+ public void loadFullChat(final int chat_id, final int classGuid, boolean force) {
+ if (loadingFullChats.contains(chat_id) || !force && loadedFullChats.contains(chat_id)) {
return;
}
loadingFullChats.add(chat_id);
@@ -580,12 +596,13 @@ public class MessagesController implements NotificationCenter.NotificationCenter
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
- loadingFullChats.remove((Integer)chat_id);
+ exportedChats.put(chat_id, res.full_chat.exported_invite);
+ loadingFullChats.remove((Integer) chat_id);
loadedFullChats.add(chat_id);
putUsers(res.users, false);
putChats(res.chats, false);
- NotificationCenter.getInstance().postNotificationName(NotificationCenter.chatInfoDidLoaded, chat_id, res.full_chat.participants);
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.chatInfoDidLoaded, chat_id, res.full_chat.participants, classGuid);
}
});
} else {
@@ -617,7 +634,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
- loadingFullUsers.remove((Integer)user.id);
+ loadingFullUsers.remove((Integer) user.id);
loadedFullUsers.add(user.id);
String names = user.first_name + user.last_name + user.username;
TLRPC.TL_userFull userFull = (TLRPC.TL_userFull)response;
@@ -1275,15 +1292,72 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
}
- public void updatePrintingStrings() {
+ private String getUserNameForTyping(TLRPC.User user) {
+ if (user == null) {
+ return "";
+ }
+ if (user.first_name != null && user.first_name.length() > 0) {
+ return user.first_name;
+ } else if (user.last_name != null && user.last_name.length() > 0) {
+ return user.last_name;
+ }
+ return "";
+ }
+
+ private void updatePrintingStrings() {
final HashMap newPrintingStrings = new HashMap<>();
+ final HashMap newPrintingStringsTypes = new HashMap<>();
ArrayList keys = new ArrayList<>(printingUsers.keySet());
- for (Long key : keys) {
- if (key > 0 || key.intValue() == 0) {
- newPrintingStrings.put(key, LocaleController.getString("Typing", R.string.Typing));
+ for (HashMap.Entry> entry : printingUsers.entrySet()) {
+ long key = entry.getKey();
+ ArrayList arr = entry.getValue();
+
+ int lower_id = (int) key;
+
+ if (lower_id > 0 || lower_id == 0 || arr.size() == 1) {
+ PrintingUser pu = arr.get(0);
+ TLRPC.User user = getUser(pu.userId);
+ if (user == null) {
+ return;
+ }
+ if (pu.action instanceof TLRPC.TL_sendMessageUploadAudioAction || pu.action instanceof TLRPC.TL_sendMessageRecordAudioAction) {
+ if (lower_id < 0) {
+ newPrintingStrings.put(key, LocaleController.formatString("IsRecordingAudio", R.string.IsRecordingAudio, getUserNameForTyping(user)));
+ } else {
+ newPrintingStrings.put(key, LocaleController.getString("RecordingAudio", R.string.RecordingAudio));
+ }
+ newPrintingStringsTypes.put(key, 1);
+ } else if (pu.action instanceof TLRPC.TL_sendMessageUploadVideoAction || pu.action instanceof TLRPC.TL_sendMessageRecordVideoAction) {
+ if (lower_id < 0) {
+ newPrintingStrings.put(key, LocaleController.formatString("IsSendingVideo", R.string.IsSendingVideo, getUserNameForTyping(user)));
+ } else {
+ newPrintingStrings.put(key, LocaleController.getString("SendingVideoStatus", R.string.SendingVideoStatus));
+ }
+ newPrintingStringsTypes.put(key, 2);
+ } else if (pu.action instanceof TLRPC.TL_sendMessageUploadDocumentAction) {
+ if (lower_id < 0) {
+ newPrintingStrings.put(key, LocaleController.formatString("IsSendingFile", R.string.IsSendingFile, getUserNameForTyping(user)));
+ } else {
+ newPrintingStrings.put(key, LocaleController.getString("SendingFile", R.string.SendingFile));
+ }
+ newPrintingStringsTypes.put(key, 2);
+ } else if (pu.action instanceof TLRPC.TL_sendMessageUploadPhotoAction) {
+ if (lower_id < 0) {
+ newPrintingStrings.put(key, LocaleController.formatString("IsSendingPhoto", R.string.IsSendingPhoto, getUserNameForTyping(user)));
+ } else {
+ newPrintingStrings.put(key, LocaleController.getString("SendingPhoto", R.string.SendingPhoto));
+ }
+ newPrintingStringsTypes.put(key, 2);
+ } else {
+ if (lower_id < 0) {
+ newPrintingStrings.put(key, String.format("%s %s", getUserNameForTyping(user), LocaleController.getString("IsTyping", R.string.IsTyping)));
+ } else {
+ newPrintingStrings.put(key, LocaleController.getString("Typing", R.string.Typing));
+ }
+ newPrintingStringsTypes.put(key, 0);
+ }
} else {
- ArrayList arr = printingUsers.get(key);
int count = 0;
String label = "";
for (PrintingUser pu : arr) {
@@ -1292,11 +1366,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (label.length() != 0) {
label += ", ";
}
- if (user.first_name != null && user.first_name.length() > 0) {
- label += user.first_name;
- } else if (user.last_name != null && user.last_name.length() > 0) {
- label += user.last_name;
- }
+ label += getUserNameForTyping(user);
count++;
}
if (count == 2) {
@@ -1304,15 +1374,12 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
}
if (label.length() != 0) {
- if (count > 1) {
if (arr.size() > 2) {
newPrintingStrings.put(key, String.format("%s %s", label, LocaleController.formatPluralString("AndMoreTyping", arr.size() - 2)));
} else {
newPrintingStrings.put(key, String.format("%s %s", label, LocaleController.getString("AreTyping", R.string.AreTyping)));
}
- } else {
- newPrintingStrings.put(key, String.format("%s %s", label, LocaleController.getString("IsTyping", R.string.IsTyping)));
- }
+ newPrintingStringsTypes.put(key, 0);
}
}
}
@@ -1323,21 +1390,30 @@ public class MessagesController implements NotificationCenter.NotificationCenter
@Override
public void run() {
printingStrings = newPrintingStrings;
+ printingStringsTypes = newPrintingStringsTypes;
}
});
}
- public void cancelTyping(long dialog_id) {
- sendingTypings.remove(dialog_id);
+ public void cancelTyping(int action, long dialog_id) {
+ HashMap typings = sendingTypings.get(action);
+ if (typings != null) {
+ typings.remove(dialog_id);
+ }
}
- public void sendTyping(final long dialog_id, int classGuid) {
+ public void sendTyping(final long dialog_id, final int action, int classGuid) {
if (dialog_id == 0) {
return;
}
- if (sendingTypings.get(dialog_id) != null) {
+ HashMap typings = sendingTypings.get(action);
+ if (typings != null && typings.get(dialog_id) != null) {
return;
}
+ if (typings == null) {
+ typings = new HashMap<>();
+ sendingTypings.put(action, typings);
+ }
int lower_part = (int)dialog_id;
int high_id = (int)(dialog_id >> 32);
if (lower_part != 0) {
@@ -1364,21 +1440,41 @@ public class MessagesController implements NotificationCenter.NotificationCenter
return;
}
}
+ if (action == 0) {
req.action = new TLRPC.TL_sendMessageTypingAction();
- sendingTypings.put(dialog_id, true);
+ } else if (action == 1) {
+ req.action = new TLRPC.TL_sendMessageRecordAudioAction();
+ } else if (action == 2) {
+ req.action = new TLRPC.TL_sendMessageCancelAction();
+ } else if (action == 3) {
+ req.action = new TLRPC.TL_sendMessageUploadDocumentAction();
+ } else if (action == 4) {
+ req.action = new TLRPC.TL_sendMessageUploadPhotoAction();
+ } else if (action == 5) {
+ req.action = new TLRPC.TL_sendMessageUploadVideoAction();
+ }
+ typings.put(dialog_id, true);
long reqId = ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
- sendingTypings.remove(dialog_id);
+ HashMap typings = sendingTypings.get(action);
+ if (typings != null) {
+ typings.remove(dialog_id);
+ }
}
});
}
}, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors);
- ConnectionsManager.getInstance().bindRequestToGuid(reqId, classGuid);
+ if (classGuid != 0) {
+ ConnectionsManager.getInstance().bindRequestToGuid(reqId, classGuid);
+ }
} else {
+ if (action != 0) {
+ return;
+ }
TLRPC.EncryptedChat chat = getEncryptedChat(high_id);
if (chat.auth_key != null && chat.auth_key.length > 1 && chat instanceof TLRPC.TL_encryptedChat) {
TLRPC.TL_messages_setEncryptedTyping req = new TLRPC.TL_messages_setEncryptedTyping();
@@ -1386,14 +1482,24 @@ public class MessagesController implements NotificationCenter.NotificationCenter
req.peer.chat_id = chat.id;
req.peer.access_hash = chat.access_hash;
req.typing = true;
- sendingTypings.put(dialog_id, true);
+ typings.put(dialog_id, true);
long reqId = ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
- sendingTypings.remove(dialog_id);
+ AndroidUtilities.runOnUIThread(new Runnable() {
+ @Override
+ public void run() {
+ HashMap typings = sendingTypings.get(action);
+ if (typings != null) {
+ typings.remove(dialog_id);
+ }
+ }
+ });
}
}, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors);
- ConnectionsManager.getInstance().bindRequestToGuid(reqId, classGuid);
+ if (classGuid != 0) {
+ ConnectionsManager.getInstance().bindRequestToGuid(reqId, classGuid);
+ }
}
}
}
@@ -1567,7 +1673,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
currentDialog.unread_count = entry.getValue();
}
}
- NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces, UPDATE_MASK_READ_DIALOG_MESSAGE);
NotificationsController.getInstance().processDialogsUpdateRead(dialogsToUpdate);
}
});
@@ -1803,12 +1909,29 @@ public class MessagesController implements NotificationCenter.NotificationCenter
dialogsEndReached = (dialogsRes.dialogs.size() == 0 || dialogsRes.dialogs.size() != count) && !isCache;
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
+ generateUpdateMessage();
}
});
}
});
}
+ public void markMessageContentAsRead(int mid) {
+ TLRPC.TL_messages_readMessageContents req = new TLRPC.TL_messages_readMessageContents();
+ req.id.add(mid);
+ MessagesStorage.getInstance().markMessagesContentAsRead(req.id);
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.messagesReadContent, req.id);
+ ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
+ @Override
+ public void run(TLObject response, TLRPC.TL_error error) {
+ if (error == null) {
+ TLRPC.TL_messages_affectedMessages res = (TLRPC.TL_messages_affectedMessages) response;
+ processNewDifferenceParams(-1, res.pts, -1, res.pts_count);
+ }
+ }
+ });
+ }
+
public void markMessageAsRead(final long dialog_id, final long random_id, int ttl) {
if (random_id == 0 || dialog_id == 0 || ttl <= 0) {
return;
@@ -2030,7 +2153,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
putUsers(updates.users, false);
putChats(updates.chats, false);
- TLRPC.Chat chat = null;
if (updates.chats != null && !updates.chats.isEmpty()) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.chatDidCreated, updates.chats.get(0).id);
} else {
@@ -2213,6 +2335,35 @@ public class MessagesController implements NotificationCenter.NotificationCenter
});
}
+ public void generateUpdateMessage() {
+ Utilities.stageQueue.postRunnable(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ String build = LocaleController.getString("updateBuild", R.string.updateBuild);
+ if (build != null) {
+ int version = Utilities.parseInt(build);
+ if (version <= UserConfig.lastUpdateVersion) {
+ return;
+ }
+ UserConfig.lastUpdateVersion = version;
+ UserConfig.saveConfig(false);
+ }
+ TLRPC.TL_updateServiceNotification update = new TLRPC.TL_updateServiceNotification();
+ update.message = LocaleController.getString("updateText", R.string.updateText) + LocaleController.getString("updatePlusText", R.string.updatePlusText);
+ update.media = new TLRPC.TL_messageMediaEmpty();
+ update.type = "update";
+ update.popup = false;
+ ArrayList updates = new ArrayList<>();
+ updates.add(update);
+ processUpdateArray(updates, null, null);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ }
+ });
+ }
+
public void registerForPush(final String regid) {
if (regid == null || regid.length() == 0 || registeringForPush || UserConfig.getClientUserId() == 0) {
return;
@@ -2226,7 +2377,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter
req.token = regid;
req.app_sandbox = false;
try {
- req.lang_code = LocaleController.getLocaleString(Locale.getDefault());
+ req.lang_code = LocaleController.getLocaleString(LocaleController.getInstance().getSystemDefaultLocale());
+ if (req.lang_code == null || req.lang_code.length() == 0) {
+ req.lang_code = "en";
+ }
req.device_model = Build.MANUFACTURER + Build.MODEL;
if (req.device_model == null) {
req.device_model = "Android unknown";
@@ -2359,7 +2513,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} else if (type == 2) {
if (updates.qts <= MessagesStorage.lastQtsValue) {
return 2;
- } else if (MessagesStorage.lastQtsValue + 1 == updates.qts) {
+ } else if (MessagesStorage.lastQtsValue + updates.updates.size() == updates.qts) {
return 0;
} else {
return 1;
@@ -2375,14 +2529,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
Collections.sort(updatesQueue, new Comparator() {
@Override
public int compare(TLRPC.Updates updates, TLRPC.Updates updates2) {
- int seq1 = getUpdateSeq(updates);
- int seq2 = getUpdateSeq(updates2);
- if (seq1 == seq2) {
- return 0;
- } else if (seq1 > seq2) {
- return 1;
- }
- return -1;
+ return AndroidUtilities.compare(getUpdateSeq(updates), getUpdateSeq(updates2));
}
});
} else if (type == 1) {
@@ -2390,12 +2537,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
Collections.sort(updatesQueue, new Comparator() {
@Override
public int compare(TLRPC.Updates updates, TLRPC.Updates updates2) {
- if (updates.pts == updates2.pts) {
- return 0;
- } else if (updates.pts > updates2.pts) {
- return 1;
- }
- return -1;
+ return AndroidUtilities.compare(updates.pts, updates2.pts);
}
});
} else if (type == 2) {
@@ -2403,12 +2545,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
Collections.sort(updatesQueue, new Comparator() {
@Override
public int compare(TLRPC.Updates updates, TLRPC.Updates updates2) {
- if (updates.qts == updates2.qts) {
- return 0;
- } else if (updates.qts > updates2.qts) {
- return 1;
- }
- return -1;
+ return AndroidUtilities.compare(updates.qts, updates2.qts);
}
});
}
@@ -2710,6 +2847,17 @@ public class MessagesController implements NotificationCenter.NotificationCenter
});
}
+ private int getUpdateType(TLRPC.Update update) {
+ if (update instanceof TLRPC.TL_updateNewMessage || update instanceof TLRPC.TL_updateReadMessagesContents || update instanceof TLRPC.TL_updateReadHistoryInbox ||
+ update instanceof TLRPC.TL_updateReadHistoryOutbox || update instanceof TLRPC.TL_updateDeleteMessages) {
+ return 0;
+ } else if (update instanceof TLRPC.TL_updateNewEncryptedMessage) {
+ return 1;
+ } else {
+ return 2;
+ }
+ }
+
public void processUpdates(final TLRPC.Updates updates, boolean fromQueue) {
boolean needGetDiff = false;
boolean needReceivedQueue = false;
@@ -2719,11 +2867,12 @@ public class MessagesController implements NotificationCenter.NotificationCenter
arr.add(updates.update);
processUpdateArray(arr, null, null);
} else if (updates instanceof TLRPC.TL_updateShortChatMessage || updates instanceof TLRPC.TL_updateShortMessage) {
- TLRPC.User user = getUser(updates.user_id);
+ final int user_id = updates instanceof TLRPC.TL_updateShortChatMessage ? updates.from_id : updates.user_id;
+ TLRPC.User user = getUser(user_id);
TLRPC.User user2 = null;
if (user == null) {
- user = MessagesStorage.getInstance().getUserSync(updates.user_id);
+ user = MessagesStorage.getInstance().getUserSync(user_id);
putUser(user, true);
}
@@ -2763,13 +2912,13 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if ((updates.flags & TLRPC.MESSAGE_FLAG_OUT) != 0) {
message.from_id = UserConfig.getClientUserId();
} else {
- message.from_id = updates.user_id;
+ message.from_id = user_id;
}
message.to_id = new TLRPC.TL_peerUser();
- message.to_id.user_id = updates.user_id;
- message.dialog_id = updates.user_id;
+ message.to_id.user_id = user_id;
+ message.dialog_id = user_id;
} else {
- message.from_id = updates.user_id;
+ message.from_id = user_id;
message.to_id = new TLRPC.TL_peerChat();
message.to_id.chat_id = updates.chat_id;
message.dialog_id = -updates.chat_id;
@@ -2798,7 +2947,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (printUpdate) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces, UPDATE_MASK_USER_PRINT);
}
- updateInterfaceWithMessages(updates.user_id, objArr);
+ updateInterfaceWithMessages(user_id, objArr);
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
}
});
@@ -2840,7 +2989,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (updatesStartWaitTimePts == 0) {
updatesStartWaitTimePts = System.currentTimeMillis();
}
- FileLog.e("tmessages", "add short message to queue");
+ FileLog.e("tmessages", "add to queue");
updatesQueuePts.add(updates);
} else {
needGetDiff = true;
@@ -2849,56 +2998,92 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
} else if (updates instanceof TLRPC.TL_updatesCombined || updates instanceof TLRPC.TL_updates) {
MessagesStorage.getInstance().putUsersAndChats(updates.users, updates.chats, true, true);
- int lastQtsValue = MessagesStorage.lastQtsValue;
+ Collections.sort(updates.updates, new Comparator() {
+ @Override
+ public int compare(TLRPC.Update lhs, TLRPC.Update rhs) {
+ int ltype = getUpdateType(lhs);
+ int rtype = getUpdateType(rhs);
+ if (ltype != rtype) {
+ return AndroidUtilities.compare(ltype, rtype);
+ } else if (ltype == 0) {
+ return AndroidUtilities.compare(lhs.pts, rhs.pts);
+ } else if (ltype == 1) {
+ return AndroidUtilities.compare(lhs.qts, rhs.qts);
+ }
+ return 0;
+ }
+ });
for (int a = 0; a < updates.updates.size(); a++) {
TLRPC.Update update = updates.updates.get(a);
- if (update instanceof TLRPC.TL_updateNewMessage || update instanceof TLRPC.TL_updateReadMessages || update instanceof TLRPC.TL_updateReadHistoryInbox ||
- update instanceof TLRPC.TL_updateReadHistoryOutbox || update instanceof TLRPC.TL_updateDeleteMessages) {
+ if (getUpdateType(update) == 0) {
TLRPC.TL_updates updatesNew = new TLRPC.TL_updates();
updatesNew.updates.add(update);
updatesNew.pts = update.pts;
updatesNew.pts_count = update.pts_count;
- if (MessagesStorage.lastPtsValue + update.pts_count == update.pts) {
+ for (int b = a + 1; b < updates.updates.size(); b++) {
+ TLRPC.Update update2 = updates.updates.get(b);
+ if (getUpdateType(update2) == 0 && updatesNew.pts + update2.pts_count == update2.pts) {
+ updatesNew.updates.add(update2);
+ updatesNew.pts = update2.pts;
+ updatesNew.pts_count += update2.pts_count;
+ updates.updates.remove(b);
+ b--;
+ } else {
+ break;
+ }
+ }
+ if (MessagesStorage.lastPtsValue + updatesNew.pts_count == updatesNew.pts) {
if (!processUpdateArray(updatesNew.updates, updates.users, updates.chats)) {
FileLog.e("tmessages", "need get diff inner TL_updates, seq: " + MessagesStorage.lastSeqValue + " " + updates.seq);
needGetDiff = true;
} else {
- MessagesStorage.lastPtsValue = update.pts;
+ MessagesStorage.lastPtsValue = updatesNew.pts;
}
- } else if (MessagesStorage.lastPtsValue != update.pts) {
- FileLog.e("tmessages", update + " need get diff, pts: " + MessagesStorage.lastPtsValue + " " + update.pts + " count = " + update.pts_count);
+ } else if (MessagesStorage.lastPtsValue != updatesNew.pts) {
+ FileLog.e("tmessages", update + " need get diff, pts: " + MessagesStorage.lastPtsValue + " " + updatesNew.pts + " count = " + updatesNew.pts_count);
if (gettingDifference || updatesStartWaitTimePts == 0 || updatesStartWaitTimePts != 0 && updatesStartWaitTimePts + 1500 > System.currentTimeMillis()) {
if (updatesStartWaitTimePts == 0) {
updatesStartWaitTimePts = System.currentTimeMillis();
}
- FileLog.e("tmessages", "add short message to queue");
+ FileLog.e("tmessages", "add to queue");
updatesQueuePts.add(updatesNew);
} else {
needGetDiff = true;
}
}
- } else if (update instanceof TLRPC.TL_updateNewEncryptedMessage) {
+ } else if (getUpdateType(update) == 1) {
TLRPC.TL_updates updatesNew = new TLRPC.TL_updates();
updatesNew.updates.add(update);
updatesNew.qts = update.qts;
- if (MessagesStorage.lastQtsValue == 0 || MessagesStorage.lastQtsValue + 1 == update.qts) {
+ for (int b = a + 1; b < updates.updates.size(); b++) {
+ TLRPC.Update update2 = updates.updates.get(b);
+ if (getUpdateType(update2) == 1 && updatesNew.qts + 1 == update2.qts) {
+ updatesNew.updates.add(update2);
+ updatesNew.qts = update2.qts;
+ updates.updates.remove(b);
+ b--;
+ } else {
+ break;
+ }
+ }
+ if (MessagesStorage.lastQtsValue == 0 || MessagesStorage.lastQtsValue + updatesNew.updates.size() == updatesNew.qts) {
processUpdateArray(updatesNew.updates, updates.users, updates.chats);
- MessagesStorage.lastQtsValue = update.qts;
+ MessagesStorage.lastQtsValue = updatesNew.qts;
needReceivedQueue = true;
- } else if (MessagesStorage.lastPtsValue != update.qts) {
- FileLog.e("tmessages", update + " need get diff, qts: " + MessagesStorage.lastQtsValue + " " + update.qts);
+ } else if (MessagesStorage.lastPtsValue != updatesNew.qts) {
+ FileLog.e("tmessages", update + " need get diff, qts: " + MessagesStorage.lastQtsValue + " " + updatesNew.qts);
if (gettingDifference || updatesStartWaitTimeQts == 0 || updatesStartWaitTimeQts != 0 && updatesStartWaitTimeQts + 1500 > System.currentTimeMillis()) {
if (updatesStartWaitTimeQts == 0) {
updatesStartWaitTimeQts = System.currentTimeMillis();
}
- FileLog.e("tmessages", "add short message to queue");
+ FileLog.e("tmessages", "add to queue");
updatesQueueQts.add(updatesNew);
} else {
needGetDiff = true;
}
}
} else {
- continue;
+ break;
}
updates.updates.remove(a);
a--;
@@ -2996,6 +3181,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
final ArrayList messagesArr = new ArrayList<>();
final HashMap markAsReadMessagesInbox = new HashMap<>();
final HashMap markAsReadMessagesOutbox = new HashMap<>();
+ final ArrayList markAsReadMessages = new ArrayList<>();
final HashMap markAsReadEncrypted = new HashMap<>();
final ArrayList deletedMessages = new ArrayList<>();
boolean printChanged = false;
@@ -3078,8 +3264,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (!obj.isOut() && obj.isUnread()) {
pushMessages.add(obj);
}
- } else if (update instanceof TLRPC.TL_updateReadMessages) {
- //markAsReadMessages.addAll(update.messages); disabled for now
+ } else if (update instanceof TLRPC.TL_updateReadMessagesContents) {
+ markAsReadMessages.addAll(update.messages);
} else if (update instanceof TLRPC.TL_updateReadHistoryInbox) {
TLRPC.Peer peer = ((TLRPC.TL_updateReadHistoryInbox) update).peer;
if (peer.chat_id != 0) {
@@ -3097,12 +3283,27 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} else if (update instanceof TLRPC.TL_updateDeleteMessages) {
deletedMessages.addAll(update.messages);
} else if (update instanceof TLRPC.TL_updateUserTyping || update instanceof TLRPC.TL_updateChatUserTyping) {
- if (update.action instanceof TLRPC.TL_sendMessageTypingAction && update.user_id != UserConfig.getClientUserId()) {
+ if (update.user_id != UserConfig.getClientUserId()) {
long uid = -update.chat_id;
if (uid == 0) {
uid = update.user_id;
}
ArrayList arr = printingUsers.get(uid);
+ if (update.action instanceof TLRPC.TL_sendMessageCancelAction) {
+ if (arr != null) {
+ for (int a = 0; a < arr.size(); a++) {
+ PrintingUser pu = arr.get(a);
+ if (pu.userId == update.user_id) {
+ arr.remove(a);
+ printChanged = true;
+ break;
+ }
+ }
+ if (arr.isEmpty()) {
+ printingUsers.remove(uid);
+ }
+ }
+ } else {
if (arr == null) {
arr = new ArrayList<>();
printingUsers.put(uid, arr);
@@ -3112,6 +3313,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (u.userId == update.user_id) {
exist = true;
u.lastTime = currentTime;
+ u.action = update.action;
break;
}
}
@@ -3119,9 +3321,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter
PrintingUser newUser = new PrintingUser();
newUser.userId = update.user_id;
newUser.lastTime = currentTime;
+ newUser.action = update.action;
arr.add(newUser);
printChanged = true;
}
+ }
onlinePrivacy.put(update.user_id, ConnectionsManager.getInstance().getCurrentTime());
}
} else if (update instanceof TLRPC.TL_updateChatParticipants) {
@@ -3181,8 +3385,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter
contactsIds.add(-update.user_id);
}
}
- } else if (update instanceof TLRPC.TL_updateActivation) {
- //DEPRECATED
} else if (update instanceof TLRPC.TL_updateNewAuthorization) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
@@ -3247,6 +3449,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (u.userId == update.user_id) {
exist = true;
u.lastTime = currentTime;
+ u.action = new TLRPC.TL_sendMessageTypingAction();
break;
}
}
@@ -3254,6 +3457,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
PrintingUser newUser = new PrintingUser();
newUser.userId = update.user_id;
newUser.lastTime = currentTime;
+ newUser.action = new TLRPC.TL_sendMessageTypingAction();
arr.add(newUser);
printChanged = true;
}
@@ -3304,7 +3508,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newMessage.local_id = newMessage.id = UserConfig.getNewMessageId();
UserConfig.saveConfig(false);
newMessage.flags = TLRPC.MESSAGE_FLAG_UNREAD;
- newMessage.date = update.date;
+ newMessage.date = ConnectionsManager.getInstance().getCurrentTime();
newMessage.from_id = 777000;
newMessage.to_id = new TLRPC.TL_peerUser();
newMessage.to_id.user_id = UserConfig.getClientUserId();
@@ -3403,14 +3607,16 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
} else if (update instanceof TLRPC.TL_updateUserName) {
if (currentUser != null) {
+ if (!(currentUser instanceof TLRPC.TL_userContact)) {
+ currentUser.first_name = update.first_name;
+ currentUser.last_name = update.last_name;
+ }
if (currentUser.username != null && currentUser.username.length() > 0) {
usersByUsernames.remove(currentUser.username);
}
if (update.username != null && update.username.length() > 0) {
usersByUsernames.put(update.username, currentUser);
}
- currentUser.first_name = update.first_name;
- currentUser.last_name = update.last_name;
currentUser.username = update.username;
}
toDbUser.first_name = update.first_name;
@@ -3427,7 +3633,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} else if (update instanceof TLRPC.TL_updateUserPhone) {
if (currentUser != null) {
currentUser.phone = update.phone;
- Utilities.photoBookQueue.postRunnable(new Runnable() {
+ Utilities.phoneBookQueue.postRunnable(new Runnable() {
@Override
public void run() {
ContactsController.getInstance().addContactToPhoneBook(currentUser, true);
@@ -3470,13 +3676,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (dialog != null) {
dialog.notify_settings.mute_until = 0;
}
- //editor.remove("notify2_" + dialog_id);
- //Smart Notifications
- SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
- if (preferences.getInt("notify2_" + dialog_id, 0) != 4) {
editor.remove("notify2_" + dialog_id);
- }
- //
MessagesStorage.getInstance().setDialogFlags(dialog_id, 0);
}
@@ -3569,7 +3769,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
if (!markAsReadEncrypted.isEmpty()) {
for (HashMap.Entry entry : markAsReadEncrypted.entrySet()) {
- NotificationCenter.getInstance().postNotificationName(NotificationCenter.messagesReadedEncrypted, entry.getKey(), entry.getValue());
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.messagesReadEncrypted, entry.getKey(), entry.getValue());
long dialog_id = (long) (entry.getKey()) << 32;
TLRPC.TL_dialog dialog = dialogs_dict.get(dialog_id);
if (dialog != null) {
@@ -3581,6 +3781,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
}
}
+ if (!markAsReadMessages.isEmpty()) {
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.messagesReadContent, markAsReadMessages);
+ }
if (!deletedMessages.isEmpty()) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.messagesDeleted, deletedMessages);
for (Integer id : deletedMessages) {
@@ -3607,6 +3810,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
MessagesStorage.getInstance().markMessagesAsRead(markAsReadMessagesInbox, markAsReadMessagesOutbox, markAsReadEncrypted, true);
}
+ if (!markAsReadMessages.isEmpty()) {
+ MessagesStorage.getInstance().markMessagesContentAsRead(markAsReadMessages);
+ }
if (!deletedMessages.isEmpty()) {
MessagesStorage.getInstance().markMessagesAsDeleted(deletedMessages, true);
}
@@ -3690,7 +3896,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
NotificationCenter.getInstance().postNotificationName(NotificationCenter.didReceivedNewMessages, uid, messages);
for (MessageObject message : messages) {
- if (lastMessage == null || (!isEncryptedChat && message.getId() > lastMessage.getId() || isEncryptedChat && message.getId() < lastMessage.getId()) || message.messageOwner.date > lastMessage.messageOwner.date) {
+ if (lastMessage == null || (!isEncryptedChat && message.getId() > lastMessage.getId() || (isEncryptedChat || message.getId() < 0 && lastMessage.getId() < 0) && message.getId() < lastMessage.getId()) || message.messageOwner.date > lastMessage.messageOwner.date) {
lastMessage = message;
}
}
diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java b/TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java
index 04fe7b66..8ce15a22 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java
@@ -106,7 +106,7 @@ public class MessagesStorage {
database.executeFast("CREATE TABLE messages(mid INTEGER PRIMARY KEY, uid INTEGER, read_state INTEGER, send_state INTEGER, date INTEGER, data BLOB, out INTEGER, ttl INTEGER, media INTEGER, replydata BLOB)").stepThis().dispose();
database.executeFast("CREATE TABLE chats(uid INTEGER PRIMARY KEY, name TEXT, data BLOB)").stepThis().dispose();
database.executeFast("CREATE TABLE enc_chats(uid INTEGER PRIMARY KEY, user INTEGER, name TEXT, data BLOB, g BLOB, authkey BLOB, ttl INTEGER, layer INTEGER, seq_in INTEGER, seq_out INTEGER, use_count INTEGER, exchange_id INTEGER, key_date INTEGER, fprint INTEGER, fauthkey BLOB, khash BLOB)").stepThis().dispose();
- database.executeFast("CREATE TABLE dialogs(did INTEGER PRIMARY KEY, date INTEGER, unread_count INTEGER, last_mid INTEGER)").stepThis().dispose();
+ database.executeFast("CREATE TABLE dialogs(did INTEGER PRIMARY KEY, date INTEGER, unread_count INTEGER, last_mid INTEGER, inbox_max INTEGER, outbox_max INTEGER)").stepThis().dispose();
database.executeFast("CREATE TABLE chat_settings(uid INTEGER PRIMARY KEY, participants BLOB)").stepThis().dispose();
database.executeFast("CREATE TABLE contacts(uid INTEGER PRIMARY KEY, mutual INTEGER)").stepThis().dispose();
database.executeFast("CREATE TABLE pending_read(uid INTEGER PRIMARY KEY, max_id INTEGER)").stepThis().dispose();
@@ -164,7 +164,7 @@ public class MessagesStorage {
database.executeFast("CREATE TABLE keyvalue(id TEXT PRIMARY KEY, value TEXT)").stepThis().dispose();
//version
- database.executeFast("PRAGMA user_version = 16").stepThis().dispose();
+ database.executeFast("PRAGMA user_version = 17").stepThis().dispose();
} else {
try {
SQLiteCursor cursor = database.queryFinalized("SELECT seq, pts, date, qts, lsv, sg, pbytes FROM params WHERE id = 1");
@@ -195,7 +195,7 @@ public class MessagesStorage {
}
}
int version = database.executeInt("PRAGMA user_version");
- if (version < 16) {
+ if (version < 17) {
updateDbToLastVersion(version);
}
}
@@ -295,7 +295,7 @@ public class MessagesStorage {
if ((length = cursor.byteBufferValue(1, data.buffer)) != 0) {
for (int a = 0; a < length / 4; a++) {
state.requery();
- state.bindInteger(1, data.readInt32());
+ state.bindInteger(1, data.readInt32(false));
state.bindInteger(2, date);
state.step();
}
@@ -385,6 +385,12 @@ public class MessagesStorage {
database.executeFast("PRAGMA user_version = 16").stepThis().dispose();
version = 16;
}
+ if (version == 16 && version < 17) {
+ database.executeFast("ALTER TABLE dialogs ADD COLUMN inbox_max INTEGER default 0").stepThis().dispose();
+ database.executeFast("ALTER TABLE dialogs ADD COLUMN outbox_max INTEGER default 0").stepThis().dispose();
+ database.executeFast("PRAGMA user_version = 17").stepThis().dispose();
+ version = 17;
+ }
} catch (Exception e) {
FileLog.e("tmessages", e);
}
@@ -523,12 +529,12 @@ public class MessagesStorage {
ArrayList chatIds = new ArrayList<>();
ArrayList encryptedChatIds = new ArrayList<>();
- cursor = database.queryFinalized("SELECT read_state, data, send_state, mid, date, uid FROM messages WHERE uid IN (" + ids.toString() + ") AND out = 0 AND read_state = 0 ORDER BY date DESC LIMIT 50");
+ cursor = database.queryFinalized("SELECT read_state, data, send_state, mid, date, uid FROM messages WHERE uid IN (" + ids.toString() + ") AND out = 0 AND read_state IN(0,2) ORDER BY date DESC LIMIT 50");
while (cursor.next()) {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(1));
if (data != null && cursor.byteBufferValue(1, data.buffer) != 0) {
- TLRPC.Message message = (TLRPC.Message)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
- MessageObject.setIsUnread(message, cursor.intValue(0) != 1);
+ TLRPC.Message message = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false);
+ MessageObject.setUnreadFlags(message, cursor.intValue(0));
message.id = cursor.intValue(3);
message.date = cursor.intValue(4);
message.dialog_id = cursor.longValue(5);
@@ -762,7 +768,7 @@ public class MessagesStorage {
while (cursor.next()) {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- TLRPC.WallPaper wallPaper = (TLRPC.WallPaper) TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.WallPaper wallPaper = TLRPC.WallPaper.TLdeserialize(data, data.readInt32(false), false);
wallPapers.add(wallPaper);
}
buffersStorage.reuseFreeBuffer(data);
@@ -876,7 +882,7 @@ public class MessagesStorage {
while (cursor.next()) {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- TLRPC.Message message = (TLRPC.Message) TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.Message message = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false);
if (message == null || message.media == null) {
continue;
}
@@ -950,7 +956,7 @@ public class MessagesStorage {
while (cursor.next()) {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- TLRPC.Photo photo = (TLRPC.Photo)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.Photo photo = TLRPC.Photo.TLdeserialize(data, data.readInt32(false), false);
res.photos.add(photo);
}
buffersStorage.reuseFreeBuffer(data);
@@ -1065,7 +1071,7 @@ public class MessagesStorage {
StringBuilder mids = new StringBuilder();
SQLiteCursor cursor = null;
if (random_ids == null) {
- cursor = database.queryFinalized(String.format(Locale.US, "SELECT mid, ttl FROM messages WHERE uid = %d AND out = %d AND read_state = 1 AND ttl > 0 AND date <= %d AND send_state = 0 AND media != 1", ((long) chat_id) << 32, isOut, time));
+ cursor = database.queryFinalized(String.format(Locale.US, "SELECT mid, ttl FROM messages WHERE uid = %d AND out = %d AND read_state != 0 AND ttl > 0 AND date <= %d AND send_state = 0 AND media != 1", ((long) chat_id) << 32, isOut, time));
} else {
String ids = TextUtils.join(",", random_ids);
cursor = database.queryFinalized(String.format(Locale.US, "SELECT m.mid, m.ttl FROM messages as m INNER JOIN randoms as r ON m.mid = r.mid WHERE r.random_id IN (%s)", ids));
@@ -1147,7 +1153,7 @@ public class MessagesStorage {
cursor.dispose();
} else if (inbox != null && !inbox.isEmpty()) {
for (HashMap.Entry entry : inbox.entrySet()) {
- SQLiteCursor cursor = database.queryFinalized(String.format(Locale.US, "SELECT COUNT(mid) FROM messages WHERE uid = %d AND mid <= %d AND read_state = 0 AND out = 0", entry.getKey(), entry.getValue()));
+ SQLiteCursor cursor = database.queryFinalized(String.format(Locale.US, "SELECT COUNT(mid) FROM messages WHERE uid = %d AND mid <= %d AND read_state IN(0,2) AND out = 0", entry.getKey(), entry.getValue()));
if (cursor.next()) {
int count = cursor.intValue(0);
if (count == 0) {
@@ -1255,7 +1261,7 @@ public class MessagesStorage {
if (cursor.next()) {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- info = (TLRPC.ChatParticipants)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ info = TLRPC.ChatParticipants.TLdeserialize(data, data.readInt32(false), false);
}
buffersStorage.reuseFreeBuffer(data);
}
@@ -1318,7 +1324,7 @@ public class MessagesStorage {
if (cursor.next()) {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- info = (TLRPC.ChatParticipants)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ info = TLRPC.ChatParticipants.TLdeserialize(data, data.readInt32(false), false);
}
buffersStorage.reuseFreeBuffer(data);
}
@@ -1383,14 +1389,14 @@ public class MessagesStorage {
int lower_id = (int)dialog_id;
if (lower_id != 0) {
- state = database.executeFast("UPDATE messages SET read_state = 1 WHERE uid = ? AND mid <= ? AND read_state = 0 AND out = 0");
+ state = database.executeFast("UPDATE messages SET read_state = read_state | 1 WHERE uid = ? AND mid <= ? AND read_state IN(0,2) AND out = 0");
state.requery();
state.bindLong(1, dialog_id);
state.bindInteger(2, max_id);
state.step();
state.dispose();
} else {
- state = database.executeFast("UPDATE messages SET read_state = 1 WHERE uid = ? AND date <= ? AND read_state = 0 AND out = 0");
+ state = database.executeFast("UPDATE messages SET read_state = read_state | 1 WHERE uid = ? AND date <= ? AND read_state IN(0,2) AND out = 0");
state.requery();
state.bindLong(1, dialog_id);
state.bindInteger(2, max_date);
@@ -1613,9 +1619,9 @@ public class MessagesStorage {
while (cursor.next()) {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(1));
if (data != null && cursor.byteBufferValue(1, data.buffer) != 0) {
- TLRPC.Message message = (TLRPC.Message)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.Message message = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false);
if (!messageHashMap.containsKey(message.id)) {
- MessageObject.setIsUnread(message, cursor.intValue(0) != 1);
+ MessageObject.setUnreadFlags(message, cursor.intValue(0));
message.id = cursor.intValue(3);
message.date = cursor.intValue(4);
if (!cursor.isNull(5)) {
@@ -1798,14 +1804,14 @@ public class MessagesStorage {
}
cursor.dispose();
- cursor = database.queryFinalized(String.format(Locale.US, "SELECT min(mid), max(date) FROM messages WHERE uid = %d AND out = 0 AND read_state = 0 AND mid > 0", dialog_id));
+ cursor = database.queryFinalized(String.format(Locale.US, "SELECT min(mid), max(date) FROM messages WHERE uid = %d AND out = 0 AND read_state IN(0,2) AND mid > 0", dialog_id));
if (cursor.next()) {
min_unread_id = cursor.intValue(0);
max_unread_date = cursor.intValue(1);
}
cursor.dispose();
if (min_unread_id != 0) {
- cursor = database.queryFinalized(String.format(Locale.US, "SELECT COUNT(*) FROM messages WHERE uid = %d AND mid >= %d AND out = 0 AND read_state = 0", dialog_id, min_unread_id));
+ cursor = database.queryFinalized(String.format(Locale.US, "SELECT COUNT(*) FROM messages WHERE uid = %d AND mid >= %d AND out = 0 AND read_state IN(0,2)", dialog_id, min_unread_id));
if (cursor.next()) {
count_unread = cursor.intValue(0);
}
@@ -1843,14 +1849,14 @@ public class MessagesStorage {
}
cursor.dispose();
- cursor = database.queryFinalized(String.format(Locale.US, "SELECT max(mid), max(date) FROM messages WHERE uid = %d AND out = 0 AND read_state = 0 AND mid < 0", dialog_id));
+ cursor = database.queryFinalized(String.format(Locale.US, "SELECT max(mid), max(date) FROM messages WHERE uid = %d AND out = 0 AND read_state IN(0,2) AND mid < 0", dialog_id));
if (cursor.next()) {
min_unread_id = cursor.intValue(0);
max_unread_date = cursor.intValue(1);
}
cursor.dispose();
if (min_unread_id != 0) {
- cursor = database.queryFinalized(String.format(Locale.US, "SELECT COUNT(*) FROM messages WHERE uid = %d AND mid <= %d AND out = 0 AND read_state = 0", dialog_id, min_unread_id));
+ cursor = database.queryFinalized(String.format(Locale.US, "SELECT COUNT(*) FROM messages WHERE uid = %d AND mid <= %d AND out = 0 AND read_state IN(0,2)", dialog_id, min_unread_id));
if (cursor.next()) {
count_unread = cursor.intValue(0);
}
@@ -1876,8 +1882,8 @@ public class MessagesStorage {
while (cursor.next()) {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(1));
if (data != null && cursor.byteBufferValue(1, data.buffer) != 0) {
- TLRPC.Message message = (TLRPC.Message) TLClassStore.Instance().TLdeserialize(data, data.readInt32());
- MessageObject.setIsUnread(message, cursor.intValue(0) != 1);
+ TLRPC.Message message = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false);
+ MessageObject.setUnreadFlags(message, cursor.intValue(0));
message.id = cursor.intValue(3);
message.date = cursor.intValue(4);
message.dialog_id = dialog_id;
@@ -1900,7 +1906,7 @@ public class MessagesStorage {
if (!cursor.isNull(6)) {
ByteBufferDesc data2 = buffersStorage.getFreeBuffer(cursor.byteArrayLength(6));
if (data2 != null && cursor.byteBufferValue(6, data2.buffer) != 0) {
- message.replyMessage = (TLRPC.Message) TLClassStore.Instance().TLdeserialize(data2, data2.readInt32());
+ message.replyMessage = TLRPC.Message.TLdeserialize(data2, data2.readInt32(false), false);
if (message.replyMessage != null) {
fromUser.add(message.replyMessage.from_id);
if (message.replyMessage.action != null && message.replyMessage.action.user_id != 0) {
@@ -1987,7 +1993,7 @@ public class MessagesStorage {
while (cursor.next()) {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- TLRPC.Message message = (TLRPC.Message) TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.Message message = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false);
message.id = cursor.intValue(1);
message.date = cursor.intValue(2);
message.dialog_id = dialog_id;
@@ -2091,7 +2097,7 @@ public class MessagesStorage {
if (cursor.next()) {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- TLObject file = TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLObject file = TLClassStore.Instance().TLdeserialize(data, data.readInt32(false), false);
if (file != null) {
result.add(file);
}
@@ -2374,11 +2380,13 @@ public class MessagesStorage {
buffersStorage.reuseFreeBuffer(data5);
if (dialog != null) {
- state = database.executeFast("REPLACE INTO dialogs(did, date, unread_count, last_mid) VALUES(?, ?, ?, ?)");
+ state = database.executeFast("REPLACE INTO dialogs(did, date, unread_count, last_mid, inbox_max, outbox_max) VALUES(?, ?, ?, ?, ?, ?)");
state.bindLong(1, dialog.id);
state.bindInteger(2, dialog.last_message_date);
state.bindInteger(3, dialog.unread_count);
state.bindInteger(4, dialog.top_message);
+ state.bindInteger(5, dialog.read_inbox_max_id);
+ state.bindInteger(6, 0);
state.step();
state.dispose();
}
@@ -2469,7 +2477,7 @@ public class MessagesStorage {
try {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- TLRPC.User user = (TLRPC.User)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.User user = TLRPC.User.TLdeserialize(data, data.readInt32(false), false);
if (user != null) {
if (user.status != null) {
user.status.expires = cursor.intValue(1);
@@ -2494,7 +2502,7 @@ public class MessagesStorage {
try {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- TLRPC.Chat chat = (TLRPC.Chat)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.Chat chat = TLRPC.Chat.TLdeserialize(data, data.readInt32(false), false);
if (chat != null) {
result.add(chat);
}
@@ -2511,13 +2519,12 @@ public class MessagesStorage {
if (chatsToLoad == null || chatsToLoad.length() == 0 || result == null) {
return;
}
- //use_count INTEGER, exchange_id INTEGER, key_date INTEGER, fprint INTEGER, fauthkey BLOB
SQLiteCursor cursor = database.queryFinalized(String.format(Locale.US, "SELECT data, user, g, authkey, ttl, layer, seq_in, seq_out, use_count, exchange_id, key_date, fprint, fauthkey, khash FROM enc_chats WHERE uid IN(%s)", chatsToLoad));
while (cursor.next()) {
try {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- TLRPC.EncryptedChat chat = (TLRPC.EncryptedChat)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.EncryptedChat chat = TLRPC.EncryptedChat.TLdeserialize(data, data.readInt32(false), false);
if (chat != null) {
chat.user_id = cursor.intValue(1);
if (usersToLoad != null && !usersToLoad.contains(chat.user_id)) {
@@ -2634,7 +2641,7 @@ public class MessagesStorage {
downloadObject.id = cursor.longValue(0);
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(2));
if (data != null && cursor.byteBufferValue(2, data.buffer) != 0) {
- downloadObject.object = TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ downloadObject.object = TLClassStore.Instance().TLdeserialize(data, data.readInt32(false), false);
}
buffersStorage.reuseFreeBuffer(data);
objects.add(downloadObject);
@@ -2691,7 +2698,7 @@ public class MessagesStorage {
int mid = cursor.intValue(0);
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(1));
if (data != null && cursor.byteBufferValue(1, data.buffer) != 0) {
- TLRPC.Message message = (TLRPC.Message)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.Message message = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false);
if (message.media instanceof TLRPC.TL_messageMediaWebPage) {
message.id = mid;
message.media.webpage = webPages.get(message.media.webpage.id);
@@ -2865,7 +2872,7 @@ public class MessagesStorage {
state.bindInteger(1, messageId);
state.bindLong(2, dialog_id);
- state.bindInteger(3, (MessageObject.isUnread(message) ? 0 : 1));
+ state.bindInteger(3, MessageObject.getUnreadFlags(message));
state.bindInteger(4, message.send_state);
state.bindInteger(5, message.date);
state.bindByteBuffer(6, data.buffer);
@@ -2954,7 +2961,7 @@ public class MessagesStorage {
state4.dispose();
state5.dispose();
- state = database.executeFast("REPLACE INTO dialogs(did, date, unread_count, last_mid) VALUES(?, ?, ?, ?)");
+ state = database.executeFast("REPLACE INTO dialogs(did, date, unread_count, last_mid, inbox_max, outbox_max) VALUES(?, ?, ?, ?, ?, ?)");
for (HashMap.Entry pair : messagesMap.entrySet()) {
Long key = pair.getKey();
@@ -2987,6 +2994,8 @@ public class MessagesStorage {
}
state.bindInteger(3, old_unread_count + unread_count);
state.bindInteger(4, messageId);
+ state.bindInteger(5, 0);
+ state.bindInteger(6, 0);
state.step();
}
state.dispose();
@@ -3294,8 +3303,10 @@ public class MessagesStorage {
TLRPC.User updateUser = usersDict.get(user.id);
if (updateUser != null) {
if (updateUser.first_name != null && updateUser.last_name != null) {
+ if (!(user instanceof TLRPC.TL_userContact)) {
user.first_name = updateUser.first_name;
user.last_name = updateUser.last_name;
+ }
user.username = updateUser.username;
} else if (updateUser.photo != null) {
user.photo = updateUser.photo;
@@ -3337,25 +3348,22 @@ public class MessagesStorage {
}
private void markMessagesAsReadInternal(HashMap inbox, HashMap outbox, HashMap encryptedMessages) {
- if (Thread.currentThread().getId() != storageQueue.getId()) {
- throw new RuntimeException("wrong db thread");
- }
try {
if (inbox != null) {
for (HashMap.Entry entry : inbox.entrySet()) {
- database.executeFast(String.format(Locale.US, "UPDATE messages SET read_state = 1 WHERE uid = %d AND mid <= %d AND read_state = 0 AND out = 0", entry.getKey(), entry.getValue())).stepThis().dispose();
+ database.executeFast(String.format(Locale.US, "UPDATE messages SET read_state = read_state | 1 WHERE uid = %d AND mid <= %d AND read_state IN(0,2) AND out = 0", entry.getKey(), entry.getValue())).stepThis().dispose();
}
}
if (outbox != null) {
for (HashMap.Entry entry : outbox.entrySet()) {
- database.executeFast(String.format(Locale.US, "UPDATE messages SET read_state = 1 WHERE uid = %d AND mid <= %d AND read_state = 0 AND out = 1", entry.getKey(), entry.getValue())).stepThis().dispose();
+ database.executeFast(String.format(Locale.US, "UPDATE messages SET read_state = read_state | 1 WHERE uid = %d AND mid <= %d AND read_state IN(0,2) AND out = 1", entry.getKey(), entry.getValue())).stepThis().dispose();
}
}
if (encryptedMessages != null && !encryptedMessages.isEmpty()) {
for (HashMap.Entry entry : encryptedMessages.entrySet()) {
long dialog_id = ((long)entry.getKey()) << 32;
int max_date = entry.getValue();
- SQLitePreparedStatement state = database.executeFast("UPDATE messages SET read_state = 1 WHERE uid = ? AND date <= ? AND read_state = 0 AND out = 1");
+ SQLitePreparedStatement state = database.executeFast("UPDATE messages SET read_state = read_state | 1 WHERE uid = ? AND date <= ? AND read_state IN(0,2) AND out = 1");
state.requery();
state.bindLong(1, dialog_id);
state.bindInteger(2, max_date);
@@ -3368,6 +3376,22 @@ public class MessagesStorage {
}
}
+ public void markMessagesContentAsRead(final ArrayList mids) {
+ if (mids == null || mids.isEmpty()) {
+ return;
+ }
+ storageQueue.postRunnable(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ database.executeFast(String.format(Locale.US, "UPDATE messages SET read_state = read_state | 2 WHERE mid IN (%s)", TextUtils.join(",", mids))).stepThis().dispose();
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ }
+ });
+ }
+
public void markMessagesAsRead(final HashMap inbox, final HashMap outbox, final HashMap encryptedMessages, boolean useQueue) {
if (useQueue) {
storageQueue.postRunnable(new Runnable() {
@@ -3433,7 +3457,7 @@ public class MessagesStorage {
}
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(1));
if (data != null && cursor.byteBufferValue(1, data.buffer) != 0) {
- TLRPC.Message message = (TLRPC.Message)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.Message message = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false);
if (message == null || message.media == null) {
continue;
}
@@ -3527,8 +3551,8 @@ public class MessagesStorage {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(4));
if (data != null && cursor.byteBufferValue(4, data.buffer) != 0) {
- TLRPC.Message message = (TLRPC.Message)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
- MessageObject.setIsUnread(message, cursor.intValue(5) != 1);
+ TLRPC.Message message = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false);
+ MessageObject.setUnreadFlags(message, cursor.intValue(5));
message.id = cursor.intValue(6);
message.send_state = cursor.intValue(7);
int date = cursor.intValue(8);
@@ -3667,7 +3691,7 @@ public class MessagesStorage {
message.serializeToStream(data);
state.bindInteger(1, message.id);
state.bindLong(2, dialog_id);
- state.bindInteger(3, (MessageObject.isUnread(message) ? 0 : 1));
+ state.bindInteger(3, MessageObject.getUnreadFlags(message));
state.bindInteger(4, message.send_state);
state.bindInteger(5, message.date);
state.bindByteBuffer(6, data.buffer);
@@ -3732,9 +3756,9 @@ public class MessagesStorage {
ByteBufferDesc data = buffersStorage.getFreeBuffer(cursor.byteArrayLength(4));
if (data != null && cursor.byteBufferValue(4, data.buffer) != 0) {
- TLRPC.Message message = (TLRPC.Message)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.Message message = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false);
if (message != null) {
- MessageObject.setIsUnread(message, cursor.intValue(5) != 1);
+ MessageObject.setUnreadFlags(message, cursor.intValue(5));
message.id = cursor.intValue(6);
int date = cursor.intValue(9);
if (date != 0) {
@@ -3831,7 +3855,7 @@ public class MessagesStorage {
if (!dialogs.dialogs.isEmpty()) {
SQLitePreparedStatement state = database.executeFast("REPLACE INTO messages VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, NULL)");
- SQLitePreparedStatement state2 = database.executeFast("REPLACE INTO dialogs(did, date, unread_count, last_mid) VALUES(?, ?, ?, ?)");
+ SQLitePreparedStatement state2 = database.executeFast("REPLACE INTO dialogs(did, date, unread_count, last_mid, inbox_max, outbox_max) VALUES(?, ?, ?, ?, ?, ?)");
SQLitePreparedStatement state3 = database.executeFast("REPLACE INTO media_v2 VALUES(?, ?, ?, ?, ?)");
SQLitePreparedStatement state4 = database.executeFast("REPLACE INTO dialog_settings VALUES(?, ?)");
@@ -3850,7 +3874,7 @@ public class MessagesStorage {
state.bindInteger(1, message.id);
state.bindInteger(2, uid);
- state.bindInteger(3, (MessageObject.isUnread(message) ? 0 : 1));
+ state.bindInteger(3, MessageObject.getUnreadFlags(message));
state.bindInteger(4, message.send_state);
state.bindInteger(5, message.date);
state.bindByteBuffer(6, data.buffer);
@@ -3863,6 +3887,8 @@ public class MessagesStorage {
state2.bindInteger(2, message.date);
state2.bindInteger(3, dialog.unread_count);
state2.bindInteger(4, dialog.top_message);
+ state2.bindInteger(5, dialog.read_inbox_max_id);
+ state2.bindInteger(6, 0);
state2.step();
state4.bindLong(1, uid);
diff --git a/TMessagesProj/src/main/java/org/telegram/android/NativeLoader.java b/TMessagesProj/src/main/java/org/telegram/android/NativeLoader.java
index 6eab0a11..7ea11323 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/NativeLoader.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/NativeLoader.java
@@ -23,7 +23,7 @@ import java.util.zip.ZipFile;
public class NativeLoader {
- private final static int LIB_VERSION = 7;
+ private final static int LIB_VERSION = 8;
private final static String LIB_NAME = "tmessages." + LIB_VERSION;
private final static String LIB_SO_NAME = "lib" + LIB_NAME + ".so";
private final static String LOCALE_LIB_SO_NAME = "lib" + LIB_NAME + "loc.so";
diff --git a/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java b/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java
index 962de697..a75a4f64 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java
@@ -32,7 +32,7 @@ public class NotificationCenter {
public static final int mediaDidLoaded = totalEvents++;
public static final int mediaCountDidLoaded = totalEvents++;
public static final int encryptedChatUpdated = totalEvents++;
- public static final int messagesReadedEncrypted = totalEvents++;
+ public static final int messagesReadEncrypted = totalEvents++;
public static final int encryptedChatCreated = totalEvents++;
public static final int userPhotosLoaded = totalEvents++;
public static final int removeAllMessagesFromDialog = totalEvents++;
@@ -56,6 +56,9 @@ public class NotificationCenter {
public static final int newSessionReceived = totalEvents++;
public static final int didReceivedWebpages = totalEvents++;
public static final int didReceivedWebpagesInUpdates = totalEvents++;
+ public static final int stickersDidLoaded = totalEvents++;
+ public static final int didReplacedPhotoInMemCache = totalEvents++;
+ public static final int messagesReadContent = totalEvents++;
public static final int httpFileDidLoaded = totalEvents++;
public static final int httpFileDidFailedLoad = totalEvents++;
diff --git a/TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java b/TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java
index b31839cb..6785b8aa 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java
@@ -17,10 +17,10 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
-import android.content.res.AssetFileDescriptor;
+import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.media.AudioManager;
-import android.media.MediaPlayer;
+import android.media.SoundPool;
import android.net.Uri;
import android.os.Build;
import android.os.SystemClock;
@@ -45,9 +45,7 @@ import org.telegram.ui.PopupNotificationActivity;
import java.util.ArrayList;
import java.util.Calendar;
-import java.util.Date;
import java.util.HashMap;
-import java.util.LinkedList;
import java.util.List;
public class NotificationsController {
@@ -56,7 +54,9 @@ public class NotificationsController {
private DispatchQueue notificationsQueue = new DispatchQueue("notificationsQueue");
private ArrayList pushMessages = new ArrayList<>();
+ private ArrayList delayedPushMessages = new ArrayList<>();
private HashMap pushMessagesDict = new HashMap<>();
+ private HashMap smartNotificationsDialogs = new HashMap<>();
private NotificationManagerCompat notificationManager = null;
private HashMap pushDialogs = new HashMap<>();
private HashMap wearNoticationsIds = new HashMap<>();
@@ -69,10 +69,14 @@ public class NotificationsController {
private boolean notifyCheck = false;
private int lastOnlineFromOtherDevice = 0;
private boolean inChatSoundEnabled = true;
+ private int lastBadgeCount;
private long lastSoundPlay;
- private MediaPlayer mediaPlayerIn;
- private MediaPlayer mediaPlayerOut;
+ //private MediaPlayer mediaPlayerIn;
+ //private MediaPlayer mediaPlayerOut;
+ private SoundPool soundPool;
+ private int soundIn;
+ private int soundOut;
protected AudioManager audioManager;
private static volatile NotificationsController Instance = null;
@@ -112,6 +116,7 @@ public class NotificationsController {
popupMessages.clear();
wearNoticationsIds.clear();
notifyCheck = false;
+ lastBadgeCount = 0;
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.clear();
@@ -189,7 +194,7 @@ public class NotificationsController {
msg = LocaleController.formatString("NotificationMessageVideo", R.string.NotificationMessageVideo, ContactsController.formatName(user.first_name, user.last_name));
} else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaContact) {
msg = LocaleController.formatString("NotificationMessageContact", R.string.NotificationMessageContact, ContactsController.formatName(user.first_name, user.last_name));
- } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo) {
+ } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo || messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaVenue) {
msg = LocaleController.formatString("NotificationMessageMap", R.string.NotificationMessageMap, ContactsController.formatName(user.first_name, user.last_name));
} else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
if (messageObject.isSticker()) {
@@ -216,8 +221,14 @@ public class NotificationsController {
if (u2 == null) {
return null;
}
+ if (user.id == u2.id) {
+ msg = LocaleController.formatString("NotificationGroupAddSelf", R.string.NotificationGroupAddSelf, ContactsController.formatName(user.first_name, user.last_name), chat.title);
+ } else {
msg = LocaleController.formatString("NotificationGroupAddMember", R.string.NotificationGroupAddMember, ContactsController.formatName(user.first_name, user.last_name), chat.title, ContactsController.formatName(u2.first_name, u2.last_name));
}
+ }
+ } else if (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionChatJoinedByLink) {
+ msg = LocaleController.formatString("NotificationInvitedToGroupByLink", R.string.NotificationInvitedToGroupByLink, ContactsController.formatName(user.first_name, user.last_name), chat.title);
} else if (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionChatEditTitle) {
msg = LocaleController.formatString("NotificationEditedGroupName", R.string.NotificationEditedGroupName, ContactsController.formatName(user.first_name, user.last_name), messageObject.messageOwner.action.title);
} else if (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionChatEditPhoto || messageObject.messageOwner.action instanceof TLRPC.TL_messageActionChatDeletePhoto) {
@@ -250,7 +261,7 @@ public class NotificationsController {
msg = LocaleController.formatString("NotificationMessageGroupVideo", R.string.NotificationMessageGroupVideo, ContactsController.formatName(user.first_name, user.last_name), chat.title);
} else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaContact) {
msg = LocaleController.formatString("NotificationMessageGroupContact", R.string.NotificationMessageGroupContact, ContactsController.formatName(user.first_name, user.last_name), chat.title);
- } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo) {
+ } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo || messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaVenue) {
msg = LocaleController.formatString("NotificationMessageGroupMap", R.string.NotificationMessageGroupMap, ContactsController.formatName(user.first_name, user.last_name), chat.title);
} else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
if (messageObject.isSticker()) {
@@ -288,14 +299,14 @@ public class NotificationsController {
private void scheduleNotificationDelay(boolean onlineReason) {
try {
- FileLog.e("tmessages", "delay notification start");
+ FileLog.e("tmessages", "delay notification start, onlineReason = " + onlineReason);
AlarmManager alarm = (AlarmManager) ApplicationLoader.applicationContext.getSystemService(Context.ALARM_SERVICE);
PendingIntent pintent = PendingIntent.getService(ApplicationLoader.applicationContext, 0, new Intent(ApplicationLoader.applicationContext, NotificationDelay.class), 0);
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
if (onlineReason) {
alarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 3 * 1000, pintent);
} else {
- alarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 500, pintent);
+ alarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 1000, pintent);
}
} catch (Exception e) {
FileLog.e("tmessages", e);
@@ -304,7 +315,10 @@ public class NotificationsController {
protected void notificationDelayReached() {
FileLog.e("tmessages", "delay reached");
+ if (!delayedPushMessages.isEmpty()) {
showOrUpdateNotification(true);
+ delayedPushMessages.clear();
+ }
}
protected void repeatNotificationMaybe() {
@@ -321,6 +335,7 @@ public class NotificationsController {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
+ FileLog.e("tmessages", "set last online from other device = " + time);
lastOnlineFromOtherDevice = time;
}
});
@@ -366,54 +381,47 @@ public class NotificationsController {
boolean inAppPreview = false;
boolean inAppPriority = false;
int priority = 0;
- int priority_override = 0;
- int vibrate_override = 0;
+ int priorityOverride = 0;
+ int vibrateOverride = 0;
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE);
- int notify_override = preferences.getInt("notify2_" + override_dialog_id, 0);
- if (notify_override == 3) {
- int mute_until = preferences.getInt("notifyuntil_" + override_dialog_id, 0);
- if (mute_until >= ConnectionsManager.getInstance().getCurrentTime()) {
- notify_override = 2;
- }
- }
- if (!notifyAboutLast || notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || chat_id != 0 && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0) {
+ int notifyOverride = getNotifyOverride(preferences, override_dialog_id);
+ if (!notifyAboutLast || notifyOverride == 2 || (!preferences.getBoolean("EnableAll", true) || chat_id != 0 && !preferences.getBoolean("EnableGroup", true)) && notifyOverride == 0) {
notifyDisabled = true;
}
- //Smart notifications
- boolean use_smart_notify = preferences.getBoolean("smart_notify_" + dialog_id, false);
- Long smart_notify_timeframe = preferences.getLong("smart_notify_timeframe_" + dialog_id, 1);
- int smart_notify_max_count = preferences.getInt("smart_notify_max_count_" + dialog_id, 1);
- if (chat_id != 0 && use_smart_notify)
- {
- if (chat.sound_timestamps == null)
- chat.sound_timestamps = new LinkedList<>();
- boolean shouldAdd = true;
- Date firstNotification = chat.sound_timestamps.peek();
- Date currentDate = new Date();
- if (firstNotification != null) {
- if (currentDate.getTime() - firstNotification.getTime() < smart_notify_timeframe * 1000 && chat.sound_timestamps.size () >= smart_notify_max_count) {
- shouldAdd = false;
- }
- }
- if (!shouldAdd) {
+
+ if (!notifyDisabled && dialog_id == override_dialog_id && chat != null) {
+ int notifyMaxCount = preferences.getInt("smart_max_count_" + dialog_id, 2);
+ int notifyDelay = preferences.getInt("smart_delay_" + dialog_id, 3 * 60);
+ if (notifyMaxCount != 0) {
+ Point dialogInfo = smartNotificationsDialogs.get(dialog_id);
+ if (dialogInfo == null) {
+ dialogInfo = new Point(1, (int) (System.currentTimeMillis() / 1000));
+ smartNotificationsDialogs.put(dialog_id, dialogInfo);
+ } else {
+ int lastTime = dialogInfo.y;
+ if (lastTime + notifyDelay < System.currentTimeMillis() / 1000) {
+ dialogInfo.set(1, (int) (System.currentTimeMillis() / 1000));
+ } else {
+ int count = dialogInfo.x;
+ if (count < notifyMaxCount) {
+ dialogInfo.set(count + 1, (int) (System.currentTimeMillis() / 1000));
+ } else {
notifyDisabled = true;
}
- else {
- if (chat.sound_timestamps.size() >= smart_notify_max_count)
- chat.sound_timestamps.poll();
- chat.sound_timestamps.add(currentDate);
+ }
+ }
}
}
- //
+
String defaultPath = Settings.System.DEFAULT_NOTIFICATION_URI.getPath();
if (!notifyDisabled) {
inAppSounds = preferences.getBoolean("EnableInAppSounds", true);
inAppVibrate = preferences.getBoolean("EnableInAppVibrate", true);
inAppPreview = preferences.getBoolean("EnableInAppPreview", true);
inAppPriority = preferences.getBoolean("EnableInAppPriority", false);
- vibrate_override = preferences.getInt("vibrate_" + dialog_id, 0);
- priority_override = preferences.getInt("priority_" + dialog_id, 3);
+ vibrateOverride = preferences.getInt("vibrate_" + dialog_id, 0);
+ priorityOverride = preferences.getInt("priority_" + dialog_id, 3);
boolean vibrateOnlyIfSilent = false;
choosenSoundPath = preferences.getString("sound_path_" + dialog_id, null);
@@ -440,16 +448,16 @@ public class NotificationsController {
ledColor = preferences.getInt("color_" + dialog_id, 0);
}
- if (priority_override != 3) {
- priority = priority_override;
+ if (priorityOverride != 3) {
+ priority = priorityOverride;
}
if (needVibrate == 4) {
vibrateOnlyIfSilent = true;
needVibrate = 0;
}
- if (needVibrate == 2 && (vibrate_override == 1 || vibrate_override == 3 || vibrate_override == 5) || needVibrate != 2 && vibrate_override == 2 || vibrate_override != 0) {
- needVibrate = vibrate_override;
+ if (needVibrate == 2 && (vibrateOverride == 1 || vibrateOverride == 3 || vibrateOverride == 5) || needVibrate != 2 && vibrateOverride == 2 || vibrateOverride != 0) {
+ needVibrate = vibrateOverride;
}
if (!ApplicationLoader.mainInterfacePaused) {
if (!inAppSounds) {
@@ -538,7 +546,7 @@ public class NotificationsController {
.setGroup("messages")
.setGroupSummary(true)
//.setColor(0xff2ca5e0);
- .setColor(AndroidUtilities.getIntColor("themeColor"));
+ .setColor(AndroidUtilities.getIntColor("themeColor")); //Plus
if (priority == 0) {
mBuilder.setPriority(NotificationCompat.PRIORITY_DEFAULT);
@@ -552,9 +560,6 @@ public class NotificationsController {
if (chat == null && user != null && user.phone != null && user.phone.length() > 0) {
mBuilder.addPerson("tel:+" + user.phone);
}
- /*Bundle bundle = new Bundle();
- bundle.putString(NotificationCompat.EXTRA_PEOPLE, );
- mBuilder.setExtras()*/
String lastMessage = null;
String lastMessageFull = null;
@@ -586,7 +591,6 @@ public class NotificationsController {
}
if (i == 0) {
lastMessageFull = message;
- //lastMessage = getStringForMessage(pushMessages.get(i), true);
lastMessage = lastMessageFull;
}
if (pushDialogs.size() == 1) {
@@ -818,6 +822,7 @@ public class NotificationsController {
}
popupMessages.remove(messageObject);
pushMessagesDict.remove(messageObject.getId());
+ delayedPushMessages.remove(messageObject);
pushMessages.remove(a);
a--;
}
@@ -849,6 +854,7 @@ public class NotificationsController {
personal_count--;
}
pushMessages.remove(a);
+ delayedPushMessages.remove(messageObject);
popupMessages.remove(messageObject);
pushMessagesDict.remove(messageObject.getId());
a--;
@@ -875,14 +881,8 @@ public class NotificationsController {
try {
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE);
- int notify_override = preferences.getInt("notify2_" + openned_dialog_id, 0);
- if (notify_override == 3) {
- int mute_until = preferences.getInt("notifyuntil_" + openned_dialog_id, 0);
- if (mute_until >= ConnectionsManager.getInstance().getCurrentTime()) {
- notify_override = 2;
- }
- }
- if (notify_override == 2) {
+ int notifyOverride = getNotifyOverride(preferences, openned_dialog_id);
+ if (notifyOverride == 2) {
return;
}
notificationsQueue.postRunnable(new Runnable() {
@@ -892,7 +892,14 @@ public class NotificationsController {
return;
}
try {
- if (mediaPlayerIn == null) {
+ if (soundPool == null) {
+ soundPool = new SoundPool(4, AudioManager.STREAM_SYSTEM, 0);
+ }
+ if (soundIn == 0) {
+ soundIn = soundPool.load(ApplicationLoader.applicationContext, R.raw.sound_in, 1);
+ }
+ soundPool.play(soundIn, 1.0f, 1.0f, 1, 0, 1.0f);
+ /*if (mediaPlayerIn == null) {
AssetFileDescriptor assetFileDescriptor = ApplicationLoader.applicationContext.getResources().openRawResourceFd(R.raw.sound_in);
if (assetFileDescriptor != null) {
mediaPlayerIn = new MediaPlayer();
@@ -903,45 +910,18 @@ public class NotificationsController {
mediaPlayerIn.prepare();
}
}
- mediaPlayerIn.start();
+ try {
+ mediaPlayerIn.pause();
+ mediaPlayerIn.seekTo(0);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ mediaPlayerIn.start();*/
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
});
- /*String choosenSoundPath = null;
- String defaultPath = Settings.System.DEFAULT_NOTIFICATION_URI.getPath();
-
- choosenSoundPath = preferences.getString("sound_path_" + openned_dialog_id, null);
- boolean isChat = (int)(openned_dialog_id) < 0;
- if (isChat) {
- if (choosenSoundPath != null && choosenSoundPath.equals(defaultPath)) {
- choosenSoundPath = null;
- } else if (choosenSoundPath == null) {
- choosenSoundPath = preferences.getString("GroupSoundPath", defaultPath);
- }
- } else {
- if (choosenSoundPath != null && choosenSoundPath.equals(defaultPath)) {
- choosenSoundPath = null;
- } else if (choosenSoundPath == null) {
- choosenSoundPath = preferences.getString("GlobalSoundPath", defaultPath);
- }
- }
-
- if (choosenSoundPath != null && !choosenSoundPath.equals("NoSound")) {
- if (lastMediaPlayerUri == null || !choosenSoundPath.equals(lastMediaPlayerUri)) {
- lastMediaPlayerUri = choosenSoundPath;
- mediaPlayer.reset();
- mediaPlayer.setAudioStreamType(AudioManager.STREAM_NOTIFICATION);
- if (choosenSoundPath.equals(defaultPath)) {
- mediaPlayer.setDataSource(ApplicationLoader.applicationContext, Settings.System.DEFAULT_NOTIFICATION_URI);
- } else {
- mediaPlayer.setDataSource(ApplicationLoader.applicationContext, Uri.parse(choosenSoundPath));
- }
- mediaPlayer.prepare();
- }
- mediaPlayer.start();
- }*/
} catch (Exception e) {
FileLog.e("tmessages", e);
}
@@ -962,7 +942,14 @@ public class NotificationsController {
@Override
public void run() {
try {
- if (mediaPlayerOut == null) {
+ if (soundPool == null) {
+ soundPool = new SoundPool(4, AudioManager.STREAM_SYSTEM, 0);
+ }
+ if (soundOut == 0) {
+ soundOut = soundPool.load(ApplicationLoader.applicationContext, R.raw.sound_out, 1);
+ }
+ soundPool.play(soundOut, 1.0f, 1.0f, 1, 0, 1.0f);
+ /*if (mediaPlayerOut == null) {
AssetFileDescriptor assetFileDescriptor = ApplicationLoader.applicationContext.getResources().openRawResourceFd(R.raw.sound_out);
if (assetFileDescriptor != null) {
mediaPlayerOut = new MediaPlayer();
@@ -973,7 +960,13 @@ public class NotificationsController {
mediaPlayerOut.prepare();
}
}
- mediaPlayerOut.start();
+ try {
+ mediaPlayerOut.pause();
+ mediaPlayerOut.seekTo(0);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ mediaPlayerOut.start();*/
} catch (Exception e) {
FileLog.e("tmessages", e);
}
@@ -981,6 +974,17 @@ public class NotificationsController {
});
}
+ private int getNotifyOverride(SharedPreferences preferences, long dialog_id) {
+ int notifyOverride = preferences.getInt("notify2_" + dialog_id, 0);
+ if (notifyOverride == 3) {
+ int muteUntil = preferences.getInt("notifyuntil_" + dialog_id, 0);
+ if (muteUntil >= ConnectionsManager.getInstance().getCurrentTime()) {
+ notifyOverride = 2;
+ }
+ }
+ return notifyOverride;
+ }
+
public void processNewMessages(ArrayList messageObjects, boolean isLast) {
if (messageObjects.isEmpty()) {
return;
@@ -1014,20 +1018,15 @@ public class NotificationsController {
boolean isChat = (int)dialog_id < 0;
popup = (int)dialog_id == 0 ? 0 : preferences.getInt(isChat ? "popupGroup" : "popupAll", 0);
if (value == null) {
- int notify_override = preferences.getInt("notify2_" + dialog_id, 0);
- if (notify_override == 3) {
- int mute_until = preferences.getInt("notifyuntil_" + dialog_id, 0);
- if (mute_until >= ConnectionsManager.getInstance().getCurrentTime()) {
- notify_override = 2;
- }
- }
- value = !(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0);
+ int notifyOverride = getNotifyOverride(preferences, dialog_id);
+ value = !(notifyOverride == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notifyOverride == 0);
settingsCache.put(dialog_id, value);
}
if (value) {
if (popup != 0) {
popupMessages.add(0, messageObject);
}
+ delayedPushMessages.add(messageObject);
pushMessages.add(0, messageObject);
pushMessagesDict.put(messageObject.getId(), messageObject);
if (original_dialog_id != dialog_id) {
@@ -1058,24 +1057,22 @@ public class NotificationsController {
for (HashMap.Entry entry : dialogsToUpdate.entrySet()) {
long dialog_id = entry.getKey();
- int notify_override = preferences.getInt("notify2_" + dialog_id, 0);
- if (notify_override == 3) {
- int mute_until = preferences.getInt("notifyuntil_" + dialog_id, 0);
- if (mute_until >= ConnectionsManager.getInstance().getCurrentTime()) {
- notify_override = 2;
- }
- }
+ int notifyOverride = getNotifyOverride(preferences, dialog_id);
if (notifyCheck) {
Integer override = pushDialogsOverrideMention.get(dialog_id);
if (override != null && override == 1) {
pushDialogsOverrideMention.put(dialog_id, 0);
- notify_override = 1;
+ notifyOverride = 1;
}
}
- boolean canAddValue = !(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || ((int)dialog_id < 0) && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0);
+ boolean canAddValue = !(notifyOverride == 2 || (!preferences.getBoolean("EnableAll", true) || ((int)dialog_id < 0) && !preferences.getBoolean("EnableGroup", true)) && notifyOverride == 0);
Integer currentCount = pushDialogs.get(dialog_id);
Integer newCount = entry.getValue();
+ if (newCount == 0) {
+ smartNotificationsDialogs.remove(dialog_id);
+ }
+
if (newCount < 0) {
if (currentCount == null) {
continue;
@@ -1098,6 +1095,7 @@ public class NotificationsController {
}
pushMessages.remove(a);
a--;
+ delayedPushMessages.remove(messageObject);
pushMessagesDict.remove(messageObject.getId());
popupMessages.remove(messageObject);
}
@@ -1107,17 +1105,18 @@ public class NotificationsController {
pushDialogs.put(dialog_id, newCount);
}
}
- /*if (old_unread_count != total_unread_count) { TODO
- if (lastOnlineFromOtherDevice > ConnectionsManager.getInstance().getCurrentTime()) {
- showOrUpdateNotification(false);
- scheduleNotificationDelay(true);
- } else {
- showOrUpdateNotification(notifyCheck);
- }
- }*/
if (old_unread_count != total_unread_count) {
- showOrUpdateNotification(notifyCheck);
+ if (!notifyCheck) {
+ delayedPushMessages.clear();
+ showOrUpdateNotification(notifyCheck);
+ } else {
+ showOrUpdateNotification(false);
+ scheduleNotificationDelay(lastOnlineFromOtherDevice > ConnectionsManager.getInstance().getCurrentTime());
+ }
}
+ /*if (old_unread_count != total_unread_count) {
+ showOrUpdateNotification(notifyCheck);
+ }*/
notifyCheck = false;
if (preferences.getBoolean("badgeNumber", true)) {
setBadge(ApplicationLoader.applicationContext, total_unread_count);
@@ -1153,14 +1152,8 @@ public class NotificationsController {
}
Boolean value = settingsCache.get(dialog_id);
if (value == null) {
- int notify_override = preferences.getInt("notify2_" + dialog_id, 0);
- if (notify_override == 3) {
- int mute_until = preferences.getInt("notifyuntil_" + dialog_id, 0);
- if (mute_until >= ConnectionsManager.getInstance().getCurrentTime()) {
- notify_override = 2;
- }
- }
- value = !(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || ((int) dialog_id < 0) && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0);
+ int notifyOverride = getNotifyOverride(preferences, dialog_id);
+ value = !(notifyOverride == 2 || (!preferences.getBoolean("EnableAll", true) || ((int) dialog_id < 0) && !preferences.getBoolean("EnableGroup", true)) && notifyOverride == 0);
settingsCache.put(dialog_id, value);
}
if (!value || dialog_id == openned_dialog_id && ApplicationLoader.isScreenOn) {
@@ -1177,19 +1170,13 @@ public class NotificationsController {
long dialog_id = entry.getKey();
Boolean value = settingsCache.get(dialog_id);
if (value == null) {
- int notify_override = preferences.getInt("notify2_" + dialog_id, 0);
- if (notify_override == 3) {
- int mute_until = preferences.getInt("notifyuntil_" + dialog_id, 0);
- if (mute_until >= ConnectionsManager.getInstance().getCurrentTime()) {
- notify_override = 2;
- }
- }
+ int notifyOverride = getNotifyOverride(preferences, dialog_id);
Integer override = pushDialogsOverrideMention.get(dialog_id);
if (override != null && override == 1) {
pushDialogsOverrideMention.put(dialog_id, 0);
- notify_override = 1;
+ notifyOverride = 1;
}
- value = !(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || ((int) dialog_id < 0) && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0);
+ value = !(notifyOverride == 2 || (!preferences.getBoolean("EnableAll", true) || ((int) dialog_id < 0) && !preferences.getBoolean("EnableGroup", true)) && notifyOverride == 0);
settingsCache.put(dialog_id, value);
}
if (!value) {
@@ -1218,10 +1205,14 @@ public class NotificationsController {
notificationsQueue.postRunnable(new Runnable() {
@Override
public void run() {
+ if (lastBadgeCount == count) {
+ return;
+ }
+ lastBadgeCount = count;
try {
ContentValues cv = new ContentValues();
//cv.put("tag", "org.telegram.messenger/org.telegram.ui.LaunchActivity");
- cv.put("tag", context.getPackageName() + "/org.telegram.ui.LaunchActivity");
+ cv.put("tag", context.getPackageName() + "/org.telegram.ui.LaunchActivity"); //Plus
cv.put("count", count);
context.getContentResolver().insert(Uri.parse("content://com.teslacoilsw.notifier/unread_count"), cv);
} catch (Throwable e) {
diff --git a/TMessagesProj/src/main/java/org/telegram/android/SecretChatHelper.java b/TMessagesProj/src/main/java/org/telegram/android/SecretChatHelper.java
index 6a34ea26..2866763a 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/SecretChatHelper.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/SecretChatHelper.java
@@ -542,7 +542,7 @@ public class SecretChatHelper {
File cacheFile = new File(FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE), fileName + ".jpg");
File cacheFile2 = FileLoader.getPathToAttach(size);
cacheFile.renameTo(cacheFile2);
- ImageLoader.getInstance().replaceImageInCache(fileName, fileName2);
+ ImageLoader.getInstance().replaceImageInCache(fileName, fileName2, size.location);
ArrayList arr = new ArrayList<>();
arr.add(newMsg);
MessagesStorage.getInstance().putMessages(arr, false, true, false, 0);
@@ -557,7 +557,7 @@ public class SecretChatHelper {
newMsg.media.video.w = video.w;
newMsg.media.video.h = video.h;
newMsg.media.video.date = video.date;
- newMsg.media.video.caption = "";
+ newMsg.media.caption = video.caption != null ? video.caption : "";
newMsg.media.video.user_id = video.user_id;
newMsg.media.video.size = file.size;
newMsg.media.video.id = file.id;
@@ -565,6 +565,7 @@ public class SecretChatHelper {
newMsg.media.video.key = decryptedMessage.media.key;
newMsg.media.video.iv = decryptedMessage.media.iv;
newMsg.media.video.mime_type = video.mime_type;
+ newMsg.media.video.caption = video.caption != null ? video.caption : "";
if (newMsg.attachPath != null && newMsg.attachPath.startsWith(FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE).getAbsolutePath())) {
File cacheFile = new File(newMsg.attachPath);
@@ -893,10 +894,10 @@ public class SecretChatHelper {
return null;
}
newMessage.media = new TLRPC.TL_messageMediaPhoto();
+ newMessage.media.caption = "";
newMessage.media.photo = new TLRPC.TL_photo();
newMessage.media.photo.user_id = newMessage.from_id;
newMessage.media.photo.date = newMessage.date;
- newMessage.media.photo.caption = "";
newMessage.media.photo.geo = new TLRPC.TL_geoPointEmpty();
if (decryptedMessage.media.thumb.length != 0 && decryptedMessage.media.thumb.length <= 6000 && decryptedMessage.media.thumb_w <= 100 && decryptedMessage.media.thumb_h <= 100) {
TLRPC.TL_photoCachedSize small = new TLRPC.TL_photoCachedSize();
@@ -926,6 +927,7 @@ public class SecretChatHelper {
return null;
}
newMessage.media = new TLRPC.TL_messageMediaVideo();
+ newMessage.media.caption = "";
newMessage.media.video = new TLRPC.TL_videoEncrypted();
if (decryptedMessage.media.thumb.length != 0 && decryptedMessage.media.thumb.length <= 6000 && decryptedMessage.media.thumb_w <= 100 && decryptedMessage.media.thumb_h <= 100) {
newMessage.media.video.thumb = new TLRPC.TL_photoCachedSize();
@@ -943,7 +945,6 @@ public class SecretChatHelper {
newMessage.media.video.w = decryptedMessage.media.w;
newMessage.media.video.h = decryptedMessage.media.h;
newMessage.media.video.date = date;
- newMessage.media.video.caption = "";
newMessage.media.video.user_id = from_id;
newMessage.media.video.size = file.size;
newMessage.media.video.id = file.id;
@@ -951,6 +952,7 @@ public class SecretChatHelper {
newMessage.media.video.key = decryptedMessage.media.key;
newMessage.media.video.iv = decryptedMessage.media.iv;
newMessage.media.video.mime_type = decryptedMessage.media.mime_type;
+ newMessage.media.video.caption = "";
if (newMessage.ttl != 0) {
newMessage.ttl = Math.max(newMessage.media.video.duration + 1, newMessage.ttl);
}
@@ -1300,7 +1302,7 @@ public class SecretChatHelper {
ByteBufferDesc is = BuffersStorage.getInstance().getFreeBuffer(message.bytes.length);
is.writeRaw(message.bytes);
is.position(0);
- long fingerprint = is.readInt64();
+ long fingerprint = is.readInt64(false);
byte[] keyToDecrypt = null;
boolean new_key_used = false;
if (chat.key_fingerprint == fingerprint) {
@@ -1311,12 +1313,12 @@ public class SecretChatHelper {
}
if (keyToDecrypt != null) {
- byte[] messageKey = is.readData(16);
+ byte[] messageKey = is.readData(16, false);
MessageKeyData keyData = Utilities.generateMessageKeyData(keyToDecrypt, messageKey, false);
Utilities.aesIgeEncryption(is.buffer, keyData.aesKey, keyData.aesIv, false, false, 24, is.limit() - 24);
- int len = is.readInt32();
+ int len = is.readInt32(false);
if (len < 0 || len > is.limit() - 28) {
return null;
}
@@ -1325,7 +1327,13 @@ public class SecretChatHelper {
return null;
}
- TLObject object = TLClassStore.Instance().TLdeserialize(is, is.readInt32());
+ TLObject object = null;
+ try {
+ object = TLClassStore.Instance().TLdeserialize(is, is.readInt32(true), true);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+
BuffersStorage.getInstance().reuseFreeBuffer(is);
if (!new_key_used && AndroidUtilities.getPeerLayerVersion(chat.layer) >= 20) {
chat.key_use_count_in++;
diff --git a/TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java b/TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java
index 5b961c34..8a0d4ae5 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java
@@ -44,7 +44,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
private HashMap unsentMessages = new HashMap<>();
private HashMap sendingMessages = new HashMap<>();
- private class DelayedMessage {
+ protected class DelayedMessage {
public TLObject sendRequest;
public TLRPC.TL_decryptedMessage sendEncryptedRequest;
public int type;
@@ -458,8 +458,8 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
sendMessage(video, null, messageObject.messageOwner.attachPath, did, messageObject.replyMessageObject);
} else if (messageObject.messageOwner.media.document instanceof TLRPC.TL_document) {
sendMessage((TLRPC.TL_document) messageObject.messageOwner.media.document, null, messageObject.messageOwner.attachPath, did, messageObject.replyMessageObject);
- } else if (messageObject.messageOwner.media.geo instanceof TLRPC.TL_geoPoint) {
- sendMessage(messageObject.messageOwner.media.geo.lat, messageObject.messageOwner.media.geo._long, did, messageObject.replyMessageObject);
+ } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaVenue || messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo) {
+ sendMessage(messageObject.messageOwner.media, did, messageObject.replyMessageObject);
} else if (messageObject.messageOwner.media.phone_number != null) {
TLRPC.User user = new TLRPC.TL_userContact();
user.phone = messageObject.messageOwner.media.phone_number;
@@ -481,8 +481,53 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}
}
+ public void sendSticker(TLRPC.Document document, long peer, MessageObject replyingMessageObject) {
+ if (document == null) {
+ return;
+ }
+ if (((int) peer) == 0 && document.thumb instanceof TLRPC.TL_photoSize) {
+ File file = FileLoader.getPathToAttach(document.thumb, true);
+ if (file.exists()) {
+ try {
+ int len = (int) file.length();
+ byte[] arr = new byte[(int) file.length()];
+ RandomAccessFile reader = new RandomAccessFile(file, "r");
+ reader.readFully(arr);
+ TLRPC.TL_document newDocument = new TLRPC.TL_document();
+ newDocument.thumb = new TLRPC.TL_photoCachedSize();
+ newDocument.thumb.location = document.thumb.location;
+ newDocument.thumb.size = document.thumb.size;
+ newDocument.thumb.w = document.thumb.w;
+ newDocument.thumb.h = document.thumb.h;
+ newDocument.thumb.type = document.thumb.type;
+ newDocument.thumb.bytes = arr;
+
+ newDocument.id = document.id;
+ newDocument.access_hash = document.access_hash;
+ newDocument.date = document.date;
+ newDocument.mime_type = document.mime_type;
+ newDocument.size = document.size;
+ newDocument.dc_id = document.dc_id;
+ newDocument.attributes = document.attributes;
+ document = newDocument;
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ }
+ }
+ for (int a = 0; a < document.attributes.size(); a++) {
+ TLRPC.DocumentAttribute attribute = document.attributes.get(a);
+ if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
+ document.attributes.remove(a);
+ document.attributes.add(new TLRPC.TL_documentAttributeSticker_old());
+ break;
+ }
+ }
+ SendMessagesHelper.getInstance().sendMessage((TLRPC.TL_document) document, null, null, peer, replyingMessageObject);
+ }
+
public void sendMessage(TLRPC.User user, long peer, MessageObject reply_to_msg) {
- sendMessage(null, null, null, null, null, null, user, null, null, null, peer, false, null, reply_to_msg, null, true);
+ sendMessage(null, null, null, null, null, user, null, null, null, peer, false, null, reply_to_msg, null, true);
}
public void sendMessage(ArrayList messages, long peer) {
@@ -550,6 +595,9 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
ids.add(newMsg.fwd_msg_id);
newMsg.date = ConnectionsManager.getInstance().getCurrentTime();
newMsg.flags |= TLRPC.MESSAGE_FLAG_UNREAD;
+ if (newMsg.media instanceof TLRPC.TL_messageMediaAudio) {
+ newMsg.flags |= TLRPC.MESSAGE_FLAG_CONTENT_UNREAD;
+ }
newMsg.dialog_id = peer;
newMsg.to_id = to_id;
MessageObject newMsgObj = new MessageObject(newMsg, null, true);
@@ -560,7 +608,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
putToSendingMessages(newMsg);
if (arr.size() == 100 || a == messages.size() - 1) {
- MessagesStorage.getInstance().putMessages(arr, false, true, false, 0);
+ MessagesStorage.getInstance().putMessages(new ArrayList<>(arr), false, true, false, 0);
MessagesController.getInstance().updateInterfaceWithMessages(peer, objArr);
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
UserConfig.saveConfig(false);
@@ -655,38 +703,38 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}
public void sendMessage(MessageObject message) {
- sendMessage(null, null, null, null, null, message, null, null, null, null, message.getDialogId(), true, message.messageOwner.attachPath, null, null, true);
+ sendMessage(null, null, null, null, message, null, null, null, null, message.getDialogId(), true, message.messageOwner.attachPath, null, null, true);
}
public void sendMessage(MessageObject message, long peer) {
- sendMessage(null, null, null, null, null, message, null, null, null, null, peer, false, message.messageOwner.attachPath, null, null, true);
+ sendMessage(null, null, null, null, message, null, null, null, null, peer, false, message.messageOwner.attachPath, null, null, true);
}
public void sendMessage(TLRPC.TL_document document, String originalPath, String path, long peer, MessageObject reply_to_msg) {
- sendMessage(null, null, null, null, null, null, null, document, null, originalPath, peer, false, path, reply_to_msg, null, true);
+ sendMessage(null, null, null, null, null, null, document, null, originalPath, peer, false, path, reply_to_msg, null, true);
}
public void sendMessage(String message, long peer, MessageObject reply_to_msg, TLRPC.WebPage webPage, boolean searchLinks) {
- sendMessage(message, null, null, null, null, null, null, null, null, null, peer, false, null, reply_to_msg, webPage, searchLinks);
+ sendMessage(message, null, null, null, null, null, null, null, null, peer, false, null, reply_to_msg, webPage, searchLinks);
}
- public void sendMessage(double lat, double lon, long peer, MessageObject reply_to_msg) {
- sendMessage(null, lat, lon, null, null, null, null, null, null, null, peer, false, null, reply_to_msg, null, true);
+ public void sendMessage(TLRPC.MessageMedia location, long peer, MessageObject reply_to_msg) {
+ sendMessage(null, location, null, null, null, null, null, null, null, peer, false, null, reply_to_msg, null, true);
}
public void sendMessage(TLRPC.TL_photo photo, String originalPath, String path, long peer, MessageObject reply_to_msg) {
- sendMessage(null, null, null, photo, null, null, null, null, null, originalPath, peer, false, path, reply_to_msg, null, true);
+ sendMessage(null, null, photo, null, null, null, null, null, originalPath, peer, false, path, reply_to_msg, null, true);
}
public void sendMessage(TLRPC.TL_video video, String originalPath, String path, long peer, MessageObject reply_to_msg) {
- sendMessage(null, null, null, null, video, null, null, null, null, originalPath, peer, false, path, reply_to_msg, null, true);
+ sendMessage(null, null, null, video, null, null, null, null, originalPath, peer, false, path, reply_to_msg, null, true);
}
public void sendMessage(TLRPC.TL_audio audio, String path, long peer, MessageObject reply_to_msg) {
- sendMessage(null, null, null, null, null, null, null, null, audio, null, peer, false, path, reply_to_msg, null, true);
+ sendMessage(null, null, null, null, null, null, null, audio, null, peer, false, path, reply_to_msg, null, true);
}
- private void sendMessage(String message, Double lat, Double lon, TLRPC.TL_photo photo, TLRPC.TL_video video, MessageObject msgObj, TLRPC.User user, TLRPC.TL_document document, TLRPC.TL_audio audio, String originalPath, long peer, boolean retry, String path, MessageObject reply_to_msg, TLRPC.WebPage webPage, boolean searchLinks) {
+ private void sendMessage(String message, TLRPC.MessageMedia location, TLRPC.TL_photo photo, TLRPC.TL_video video, MessageObject msgObj, TLRPC.User user, TLRPC.TL_document document, TLRPC.TL_audio audio, String originalPath, long peer, boolean retry, String path, MessageObject reply_to_msg, TLRPC.WebPage webPage, boolean searchLinks) {
if (peer == 0) {
return;
}
@@ -713,8 +761,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
type = 0;
}
} else if (msgObj.type == 4) {
- lat = newMsg.media.geo.lat;
- lon = newMsg.media.geo._long;
+ location = newMsg.media;
type = 1;
} else if (msgObj.type == 1) {
if (msgObj.isForwarded()) {
@@ -760,16 +807,13 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}
type = 0;
newMsg.message = message;
- } else if (lat != null && lon != null) {
+ } else if (location != null) {
if (encryptedChat != null && AndroidUtilities.getPeerLayerVersion(encryptedChat.layer) >= 17) {
newMsg = new TLRPC.TL_message_secret();
} else {
newMsg = new TLRPC.TL_message();
}
- newMsg.media = new TLRPC.TL_messageMediaGeo();
- newMsg.media.geo = new TLRPC.TL_geoPoint();
- newMsg.media.geo.lat = lat;
- newMsg.media.geo._long = lon;
+ newMsg.media = location;
newMsg.message = "";
type = 1;
} else if (photo != null) {
@@ -779,6 +823,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
newMsg = new TLRPC.TL_message();
}
newMsg.media = new TLRPC.TL_messageMediaPhoto();
+ newMsg.media.caption = photo.caption != null ? photo.caption : "";
newMsg.media.photo = photo;
type = 2;
newMsg.message = "-1";
@@ -795,6 +840,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
newMsg = new TLRPC.TL_message();
}
newMsg.media = new TLRPC.TL_messageMediaVideo();
+ newMsg.media.caption = video.caption != null ? video.caption : "";
newMsg.media.video = video;
newMsg.videoEditedInfo = video.videoEditedInfo;
type = 3;
@@ -868,6 +914,9 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}
newMsg.date = ConnectionsManager.getInstance().getCurrentTime();
newMsg.flags |= TLRPC.MESSAGE_FLAG_UNREAD;
+ if (encryptedChat == null && high_id != 1 && newMsg.media instanceof TLRPC.TL_messageMediaAudio) {
+ newMsg.flags |= TLRPC.MESSAGE_FLAG_CONTENT_UNREAD;
+ }
newMsg.dialog_id = peer;
if (reply_to_msg != null) {
newMsg.flags |= TLRPC.MESSAGE_FLAG_REPLY;
@@ -993,13 +1042,22 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
TLRPC.InputMedia inputMedia = null;
DelayedMessage delayedMessage = null;
if (type == 1) {
- inputMedia = new TLRPC.TL_inputMediaGeoPoint();
+ if (location instanceof TLRPC.TL_messageMediaVenue) {
+ inputMedia = new TLRPC.TL_inputMediaVenue();
+ inputMedia.address = location.address;
+ inputMedia.title = location.title;
+ inputMedia.provider = location.provider;
+ inputMedia.venue_id = location.venue_id;
+ } else {
+ inputMedia = new TLRPC.TL_inputMediaGeoPoint();
+ }
inputMedia.geo_point = new TLRPC.TL_inputGeoPoint();
- inputMedia.geo_point.lat = lat;
- inputMedia.geo_point._long = lon;
+ inputMedia.geo_point.lat = location.geo.lat;
+ inputMedia.geo_point._long = location.geo._long;
} else if (type == 2) {
if (photo.access_hash == 0) {
inputMedia = new TLRPC.TL_inputMediaUploadedPhoto();
+ inputMedia.caption = photo.caption != null ? photo.caption : "";
delayedMessage = new DelayedMessage();
delayedMessage.originalPath = originalPath;
delayedMessage.type = 0;
@@ -1012,6 +1070,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
} else {
TLRPC.TL_inputMediaPhoto media = new TLRPC.TL_inputMediaPhoto();
media.id = new TLRPC.TL_inputPhoto();
+ media.caption = photo.caption != null ? photo.caption : "";
media.id.id = photo.id;
media.id.access_hash = photo.access_hash;
inputMedia = media;
@@ -1023,6 +1082,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
} else {
inputMedia = new TLRPC.TL_inputMediaUploadedVideo();
}
+ inputMedia.caption = video.caption != null ? video.caption : "";
inputMedia.duration = video.duration;
inputMedia.w = video.w;
inputMedia.h = video.h;
@@ -1036,6 +1096,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
} else {
TLRPC.TL_inputMediaVideo media = new TLRPC.TL_inputMediaVideo();
media.id = new TLRPC.TL_inputVideo();
+ media.caption = video.caption != null ? video.caption : "";
media.id.id = video.id;
media.id.access_hash = video.access_hash;
inputMedia = media;
@@ -1161,8 +1222,8 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
reqSend.message = "";
if (type == 1) {
reqSend.media = new TLRPC.TL_decryptedMessageMediaGeoPoint();
- reqSend.media.lat = lat;
- reqSend.media._long = lon;
+ reqSend.media.lat = location.geo.lat;
+ reqSend.media._long = location.geo._long;
SecretChatHelper.getInstance().performSendEncryptedRequest(reqSend, newMsgObj.messageOwner, encryptedChat, null, null);
} else if (type == 2) {
TLRPC.PhotoSize small = photo.sizes.get(0);
@@ -1589,7 +1650,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
cacheFile2 = new File(FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE), fileName2 + ".jpg");
}
cacheFile.renameTo(cacheFile2);
- ImageLoader.getInstance().replaceImageInCache(fileName, fileName2);
+ ImageLoader.getInstance().replaceImageInCache(fileName, fileName2, size.location);
size2.location = size.location;
break;
}
@@ -1611,7 +1672,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
File cacheFile = new File(FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE), fileName + ".jpg");
File cacheFile2 = new File(FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE), fileName2 + ".jpg");
cacheFile.renameTo(cacheFile2);
- ImageLoader.getInstance().replaceImageInCache(fileName, fileName2);
+ ImageLoader.getInstance().replaceImageInCache(fileName, fileName2, size.location);
size2.location = size.location;
}
}
@@ -1642,7 +1703,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
File cacheFile = new File(FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE), fileName + ".jpg");
File cacheFile2 = new File(FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE), fileName2 + ".jpg");
cacheFile.renameTo(cacheFile2);
- ImageLoader.getInstance().replaceImageInCache(fileName, fileName2);
+ ImageLoader.getInstance().replaceImageInCache(fileName, fileName2, size.location);
size2.location = size.location;
}
} else if (MessageObject.isStickerMessage(sentMessage) && size2.location != null) {
@@ -1697,6 +1758,10 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
arrayList.add(message);
}
+ protected ArrayList getDelayedMessages(String location) {
+ return delayedMessages.get(location);
+ }
+
protected long getNextRandomId() {
long val = 0;
while (val == 0) {
@@ -1749,7 +1814,6 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
photo.user_id = UserConfig.getClientUserId();
photo.date = ConnectionsManager.getInstance().getCurrentTime();
photo.sizes = sizes;
- photo.caption = "";
photo.geo = new TLRPC.TL_geoPointEmpty();
return photo;
}
@@ -1811,11 +1875,15 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
document.size = (int)f.length();
document.dc_id = 0;
if (ext.length() != 0) {
- String mimeType = myMime.getMimeTypeFromExtension(ext.toLowerCase());
- if (mimeType != null) {
- document.mime_type = mimeType;
+ if (ext.toLowerCase().equals("webp")) {
+ document.mime_type = "image/webp";
} else {
- document.mime_type = "application/octet-stream";
+ String mimeType = myMime.getMimeTypeFromExtension(ext.toLowerCase());
+ if (mimeType != null) {
+ document.mime_type = mimeType;
+ } else {
+ document.mime_type = "application/octet-stream";
+ }
}
} else {
document.mime_type = "application/octet-stream";
@@ -1929,9 +1997,10 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}).start();
}
- public static void prepareSendingPhoto(String imageFilePath, Uri imageUri, long dialog_id, MessageObject reply_to_msg) {
+ public static void prepareSendingPhoto(String imageFilePath, Uri imageUri, long dialog_id, MessageObject reply_to_msg, CharSequence caption) {
ArrayList paths = null;
ArrayList uris = null;
+ ArrayList captions = null;
if (imageFilePath != null && imageFilePath.length() != 0) {
paths = new ArrayList<>();
paths.add(imageFilePath);
@@ -1940,7 +2009,11 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
uris = new ArrayList<>();
uris.add(imageUri);
}
- prepareSendingPhotos(paths, uris, dialog_id, reply_to_msg);
+ if (caption != null) {
+ captions = new ArrayList<>();
+ captions.add(caption.toString());
+ }
+ prepareSendingPhotos(paths, uris, dialog_id, reply_to_msg, captions);
}
public static void prepareSendingPhotosSearch(final ArrayList photos, final long dialog_id, final MessageObject reply_to_msg) {
@@ -1951,7 +2024,8 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
@Override
public void run() {
boolean isEncrypted = (int)dialog_id == 0;
- for (final MediaController.SearchImage searchImage : photos) {
+ for (int a = 0; a < photos.size(); a++) {
+ final MediaController.SearchImage searchImage = photos.get(a);
if (searchImage.type == 1) {
TLRPC.TL_document document = null;
if (!isEncrypted) {
@@ -2029,7 +2103,6 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
photo = new TLRPC.TL_photo();
photo.user_id = UserConfig.getClientUserId();
photo.date = ConnectionsManager.getInstance().getCurrentTime();
- photo.caption = "";
photo.geo = new TLRPC.TL_geoPointEmpty();
TLRPC.TL_photoSize photoSize = new TLRPC.TL_photoSize();
photoSize.w = searchImage.width;
@@ -2042,6 +2115,9 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}
}
if (photo != null) {
+ if (searchImage.caption != null) {
+ photo.caption = searchImage.caption.toString();
+ }
final String originalPathFinal = searchImage.imageUrl;
final TLRPC.TL_photo photoFinal = photo;
final boolean needDownloadHttpFinal = needDownloadHttp;
@@ -2058,7 +2134,32 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}).start();
}
- public static void prepareSendingPhotos(ArrayList paths, ArrayList uris, final long dialog_id, final MessageObject reply_to_msg) {
+ private static String getTrimmedString(String src) {
+ String result = src.trim();
+ if (result.length() == 0) {
+ return result;
+ }
+ while (src.startsWith("\n")) {
+ src = src.substring(1);
+ }
+ while (src.endsWith("\n")) {
+ src = src.substring(0, src.length() - 1);
+ }
+ return src;
+ }
+
+ public static void prepareSendingText(String text, long dialog_id) {
+ text = getTrimmedString(text);
+ if (text.length() != 0) {
+ int count = (int) Math.ceil(text.length() / 4096.0f);
+ for (int a = 0; a < count; a++) {
+ String mess = text.substring(a * 4096, Math.min((a + 1) * 4096, text.length()));
+ SendMessagesHelper.getInstance().sendMessage(mess, dialog_id, null, null, true);
+ }
+ }
+ }
+
+ public static void prepareSendingPhotos(ArrayList paths, ArrayList uris, final long dialog_id, final MessageObject reply_to_msg, final ArrayList captions) {
if (paths == null && uris == null || paths != null && paths.isEmpty() || uris != null && uris.isEmpty()) {
return;
}
@@ -2080,6 +2181,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
int count = !pathsCopy.isEmpty() ? pathsCopy.size() : urisCopy.size();
String path = null;
Uri uri = null;
+ String extension = null;
for (int a = 0; a < count; a++) {
if (!pathsCopy.isEmpty()) {
path = pathsCopy.get(a);
@@ -2096,16 +2198,23 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
boolean isDocument = false;
if (tempPath != null && (tempPath.endsWith(".gif") || tempPath.endsWith(".webp"))) {
+ if (tempPath.endsWith(".gif")) {
+ extension = "gif";
+ } else {
+ extension = "webp";
+ }
isDocument = true;
} else if (tempPath == null && uri != null) {
if (MediaController.isGif(uri)) {
isDocument = true;
originalPath = uri.toString();
tempPath = MediaController.copyDocumentToCache(uri, "gif");
+ extension = "gif";
} else if (MediaController.isWebp(uri)) {
isDocument = true;
originalPath = uri.toString();
tempPath = MediaController.copyDocumentToCache(uri, "webp");
+ extension = "webp";
}
}
@@ -2134,6 +2243,9 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
photo = SendMessagesHelper.getInstance().generatePhotoSizes(path, uri);
}
if (photo != null) {
+ if (captions != null) {
+ photo.caption = captions.get(a);
+ }
final String originalPathFinal = originalPath;
final TLRPC.TL_photo photoFinal = photo;
AndroidUtilities.runOnUIThread(new Runnable() {
@@ -2147,7 +2259,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}
if (sendAsDocuments != null && !sendAsDocuments.isEmpty()) {
for (int a = 0; a < sendAsDocuments.size(); a++) {
- prepareSendingDocumentInternal(sendAsDocuments.get(a), sendAsDocumentsOriginal.get(a), null, "gif", dialog_id, reply_to_msg);
+ prepareSendingDocumentInternal(sendAsDocuments.get(a), sendAsDocumentsOriginal.get(a), null, extension, dialog_id, reply_to_msg);
}
}
}
@@ -2190,7 +2302,6 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
} else {
video.thumb.type = "s";
}
- video.caption = "";
video.mime_type = "video/mp4";
video.id = 0;
UserConfig.saveConfig(false);
diff --git a/TMessagesProj/src/main/java/org/telegram/android/query/SharedMediaQuery.java b/TMessagesProj/src/main/java/org/telegram/android/query/SharedMediaQuery.java
index aab9255e..345b0e49 100644
--- a/TMessagesProj/src/main/java/org/telegram/android/query/SharedMediaQuery.java
+++ b/TMessagesProj/src/main/java/org/telegram/android/query/SharedMediaQuery.java
@@ -20,7 +20,6 @@ import org.telegram.messenger.ByteBufferDesc;
import org.telegram.messenger.ConnectionsManager;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.RPCRequest;
-import org.telegram.messenger.TLClassStore;
import org.telegram.messenger.TLObject;
import org.telegram.messenger.TLRPC;
@@ -178,7 +177,7 @@ public class SharedMediaQuery {
}
final ArrayList objects = new ArrayList<>();
for (TLRPC.Message message : res.messages) {
- objects.add(new MessageObject(message, usersLocal, false));
+ objects.add(new MessageObject(message, usersLocal, true));
}
AndroidUtilities.runOnUIThread(new Runnable() {
@@ -324,7 +323,7 @@ public class SharedMediaQuery {
while (cursor.next()) {
ByteBufferDesc data = MessagesStorage.getInstance().getBuffersStorage().getFreeBuffer(cursor.byteArrayLength(0));
if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) {
- TLRPC.Message message = (TLRPC.Message) TLClassStore.Instance().TLdeserialize(data, data.readInt32());
+ TLRPC.Message message = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false);
message.id = cursor.intValue(1);
message.dialog_id = uid;
if ((int)uid == 0) {
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/AbsSerializedData.java b/TMessagesProj/src/main/java/org/telegram/messenger/AbsSerializedData.java
index 0f0bb480..1e24cd4e 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/AbsSerializedData.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/AbsSerializedData.java
@@ -20,17 +20,19 @@ public abstract class AbsSerializedData {
public abstract void writeByteArray(byte[] b, int offset, int count);
public abstract void writeByteArray(byte[] b);
public abstract void writeDouble(double d);
- public abstract int readInt32();
- public abstract int readInt32(boolean[] error);
- public abstract boolean readBool();
- public abstract long readInt64();
- public abstract long readInt64(boolean[] error);
- public abstract void readRaw(byte[] b);
- public abstract byte[] readData(int count);
- public abstract String readString();
- public abstract byte[] readByteArray();
- public abstract ByteBufferDesc readByteBuffer();
public abstract void writeByteBuffer(ByteBufferDesc buffer);
- public abstract double readDouble();
+
+ public abstract int readInt32(boolean exception);
+ public abstract boolean readBool(boolean exception);
+ public abstract long readInt64(boolean exception);
+ public abstract void readRaw(byte[] b, boolean exception);
+ public abstract byte[] readData(int count, boolean exception);
+ public abstract String readString(boolean exception);
+ public abstract byte[] readByteArray(boolean exception);
+ public abstract ByteBufferDesc readByteBuffer(boolean exception);
+ public abstract double readDouble(boolean exception);
+
public abstract int length();
+ public abstract void skip(int count);
+ public abstract int getPosition();
}
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java b/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java
index 0525ac4d..2dcace50 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java
@@ -17,8 +17,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
@@ -67,6 +65,7 @@ public class ApplicationLoader extends Application {
public static volatile boolean mainInterfacePaused = true;
public static boolean SHOW_ANDROID_EMOJI;
+ public static boolean KEEP_ORIGINAL_FILENAME;
public static boolean isCustomTheme() {
return isCustomTheme;
@@ -197,7 +196,7 @@ public class ApplicationLoader extends Application {
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
SHOW_ANDROID_EMOJI = preferences.getBoolean("showAndroidEmoji", false);
-
+ KEEP_ORIGINAL_FILENAME = preferences.getBoolean("keepOriginalFilename", false);
startPushService();
}
@@ -278,8 +277,7 @@ public class ApplicationLoader extends Application {
return "";
}
int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);
- int currentVersion = getAppVersion();
- if (registeredVersion != currentVersion) {
+ if (registeredVersion != BuildVars.BUILD_VERSION) {
FileLog.d("tmessages", "App version changed.");
return "";
}
@@ -290,15 +288,6 @@ public class ApplicationLoader extends Application {
return getSharedPreferences(ApplicationLoader.class.getSimpleName(), Context.MODE_PRIVATE);
}
- public static int getAppVersion() {
- try {
- PackageInfo packageInfo = applicationContext.getPackageManager().getPackageInfo(applicationContext.getPackageName(), 0);
- return packageInfo.versionCode;
- } catch (PackageManager.NameNotFoundException e) {
- throw new RuntimeException("Could not get package name: " + e);
- }
- }
-
private void registerInBackground() {
AsyncTask task = new AsyncTask() {
@Override
@@ -359,7 +348,7 @@ public class ApplicationLoader extends Application {
private void storeRegistrationId(Context context, String regId) {
final SharedPreferences prefs = getGCMPreferences(context);
- int appVersion = getAppVersion();
+ int appVersion = BuildVars.BUILD_VERSION;
FileLog.e("tmessages", "Saving regId on app version " + appVersion);
SharedPreferences.Editor editor = prefs.edit();
editor.putString(PROPERTY_REG_ID, regId);
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java
index d2b91b67..3ccd1a78 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java
@@ -10,10 +10,14 @@ package org.telegram.messenger;
public class BuildVars {
public static boolean DEBUG_VERSION = false;
- public static int APP_ID = 0; //obtain your own APP_ID at https://core.telegram.org/api/obtaining_api_id
- public static String APP_HASH = ""; //obtain your own APP_HASH at https://core.telegram.org/api/obtaining_api_id
- public static String HOCKEY_APP_HASH = "your-hockeyapp-api-key-here";
- public static String GCM_SENDER_ID = "760348033672";
- public static String SEND_LOGS_EMAIL = "email@gmail.com";
- public static String BING_SEARCH_KEY = ""; //obtain your own KEY at https://www.bing.com/dev/en-us/dev-center
+ public static int BUILD_VERSION = 521;
+ public static int APP_ID = 16623; //obtain your own APP_ID at https://core.telegram.org/api/obtaining_api_id
+ public static String APP_HASH = "8c9dbfe58437d1739540f5d53c72ae4b"; //obtain your own APP_HASH at https://core.telegram.org/api/obtaining_api_id
+ public static String HOCKEY_APP_HASH = "9602f502a85552c90543497e91a071f0";//"a5b5c4f551dadedc9918d9766a22ca7c";
+ public static String GCM_SENDER_ID = "326898382893";
+ public static String SEND_LOGS_EMAIL = "androiddeveloperplus@gmail.com";
+ public static String BING_SEARCH_KEY = "dKYt6BjhkmFnJABZI/nWs++mx7owYEKZLcdA3DTOO1s"; //obtain your own KEY at https://www.bing.com/dev/en-us/dev-center
+ public static String FOURSQUARE_API_KEY = "AYVLOEUWYPLCHN113NI41GHUE2NVHO4NHA5XLZWJU152N3ZP"; //obtain your own KEY at https://developer.foursquare.com/
+ public static String FOURSQUARE_API_ID = "CRY3VMYDJYBKQQDCZ4YY3ZAACTIITLVMBUUEDSPRXNZVZZA1"; //obtain your own API_ID at https://developer.foursquare.com/
+ public static String FOURSQUARE_API_VERSION = "20150326";
}
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/ByteBufferDesc.java b/TMessagesProj/src/main/java/org/telegram/messenger/ByteBufferDesc.java
index f36049bc..ca366b0b 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/ByteBufferDesc.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/ByteBufferDesc.java
@@ -109,7 +109,7 @@ public class ByteBufferDesc extends AbsSerializedData {
} else {
len += b.length;
}
- } catch (Exception x) {
+ } catch (Exception e) {
FileLog.e("tmessages", "write raw error");
}
}
@@ -121,7 +121,7 @@ public class ByteBufferDesc extends AbsSerializedData {
} else {
len += count;
}
- } catch (Exception x) {
+ } catch (Exception e) {
FileLog.e("tmessages", "write raw error");
}
}
@@ -145,7 +145,7 @@ public class ByteBufferDesc extends AbsSerializedData {
public void writeString(String s) {
try {
writeByteArray(s.getBytes("UTF-8"));
- } catch(Exception x) {
+ } catch(Exception e) {
FileLog.e("tmessages", "write string error");
}
}
@@ -182,7 +182,7 @@ public class ByteBufferDesc extends AbsSerializedData {
}
i++;
}
- } catch (Exception x) {
+ } catch (Exception e) {
FileLog.e("tmessages", "write byte array error");
}
}
@@ -219,7 +219,7 @@ public class ByteBufferDesc extends AbsSerializedData {
}
i++;
}
- } catch (Exception x) {
+ } catch (Exception e) {
FileLog.e("tmessages", "write byte array error");
}
}
@@ -227,7 +227,7 @@ public class ByteBufferDesc extends AbsSerializedData {
public void writeDouble(double d) {
try {
writeInt64(Double.doubleToRawLongBits(d));
- } catch(Exception x) {
+ } catch(Exception e) {
FileLog.e("tmessages", "write double error");
}
}
@@ -280,72 +280,92 @@ public class ByteBufferDesc extends AbsSerializedData {
}
}
- public int readInt32() {
- return readInt32(null);
+ public int getIntFromByte(byte b) {
+ return b >= 0 ? b : ((int)b) + 256;
}
- public int readInt32(boolean[] error) {
+ public int length() {
+ if (!justCalc) {
+ return buffer.position();
+ }
+ return len;
+ }
+
+ public void skip(int count) {
+ if (count == 0) {
+ return;
+ }
+ if (!justCalc) {
+ buffer.position(buffer.position() + count);
+ } else {
+ len += count;
+ }
+ }
+
+ public int getPosition() {
+ return buffer.position();
+ }
+
+ public int readInt32(boolean exception) {
try {
- int i = buffer.getInt();
- if (error != null) {
- error[0] = false;
+ return buffer.getInt();
+ } catch (Exception e) {
+ if (exception) {
+ throw new RuntimeException("read int32 error", e);
+ } else {
+ FileLog.e("tmessages", "read int32 error");
}
- return i;
- } catch (Exception x) {
- if (error != null) {
- error[0] = true;
- }
- FileLog.e("tmessages", "read int32 error");
}
return 0;
}
- public boolean readBool() {
- int consructor = readInt32();
+ public boolean readBool(boolean exception) {
+ int consructor = readInt32(exception);
if (consructor == 0x997275b5) {
return true;
} else if (consructor == 0xbc799737) {
return false;
}
- FileLog.e("tmessages", "Not bool value!");
+ if (exception) {
+ throw new RuntimeException("Not bool value!");
+ } else {
+ FileLog.e("tmessages", "Not bool value!");
+ }
return false;
}
- public long readInt64() {
- return readInt64(null);
- }
-
- public long readInt64(boolean[] error) {
+ public long readInt64(boolean exception) {
try {
- long i = buffer.getLong();
- if (error != null) {
- error[0] = false;
+ return buffer.getLong();
+ } catch (Exception e) {
+ if (exception) {
+ throw new RuntimeException("read int64 error", e);
+ } else {
+ FileLog.e("tmessages", "read int64 error");
}
- return i;
- } catch (Exception x) {
- if (error != null) {
- error[0] = true;
- }
- FileLog.e("tmessages", "read int64 error");
}
return 0;
}
- public void readRaw(byte[] b) {
+ public void readRaw(byte[] b, boolean exception) {
try {
buffer.get(b);
- } catch (Exception x) {
- FileLog.e("tmessages", "read raw error");
+ } catch (Exception e) {
+ if (exception) {
+ throw new RuntimeException("read raw error", e);
+ } else {
+ FileLog.e("tmessages", "read raw error");
+ }
}
}
- public byte[] readData(int count) {
+ public byte[] readData(int count, boolean exception) {
byte[] arr = new byte[count];
- readRaw(arr);
+ readRaw(arr, exception);
return arr;
}
- public String readString() {
+ public String readString(boolean exception) {
try {
int sl = 1;
int l = getIntFromByte(buffer.get());
@@ -361,17 +381,17 @@ public class ByteBufferDesc extends AbsSerializedData {
i++;
}
return new String(b, "UTF-8");
- } catch (Exception x) {
- FileLog.e("tmessages", "read string error");
+ } catch (Exception e) {
+ if (exception) {
+ throw new RuntimeException("read string error", e);
+ } else {
+ FileLog.e("tmessages", "read string error");
+ }
}
return null;
}
- public int getIntFromByte(byte b) {
- return b >= 0 ? b : ((int)b) + 256;
- }
-
- public byte[] readByteArray() {
+ public byte[] readByteArray(boolean exception) {
try {
int sl = 1;
int l = getIntFromByte(buffer.get());
@@ -387,13 +407,17 @@ public class ByteBufferDesc extends AbsSerializedData {
i++;
}
return b;
- } catch (Exception x) {
- FileLog.e("tmessages", "read byte array error");
+ } catch (Exception e) {
+ if (exception) {
+ throw new RuntimeException("read byte array error", e);
+ } else {
+ FileLog.e("tmessages", "read byte array error");
+ }
}
return null;
}
- public ByteBufferDesc readByteBuffer() {
+ public ByteBufferDesc readByteBuffer(boolean exception) {
try {
int sl = 1;
int l = getIntFromByte(buffer.get());
@@ -415,25 +439,26 @@ public class ByteBufferDesc extends AbsSerializedData {
i++;
}
return b;
- } catch (Exception x) {
- FileLog.e("tmessages", "read byte array error");
+ } catch (Exception e) {
+ if (exception) {
+ throw new RuntimeException("read byte array error", e);
+ } else {
+ FileLog.e("tmessages", "read byte array error");
+ }
}
return null;
}
- public double readDouble() {
+ public double readDouble(boolean exception) {
try {
- return Double.longBitsToDouble(readInt64());
- } catch(Exception x) {
- FileLog.e("tmessages", "read double error");
+ return Double.longBitsToDouble(readInt64(exception));
+ } catch(Exception e) {
+ if (exception) {
+ throw new RuntimeException("read double error", e);
+ } else {
+ FileLog.e("tmessages", "read double error");
+ }
}
return 0;
}
-
- public int length() {
- if (!justCalc) {
- return buffer.position();
- }
- return len;
- }
}
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java b/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java
index 3d8fa2a1..b0a32b64 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java
@@ -65,7 +65,6 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
private boolean updatingDcSettings = false;
private int updatingDcStartTime = 0;
private int lastDcUpdateTime = 0;
- private int currentAppVersion = 0;
private long pushSessionId;
private boolean registeringForPush = false;
@@ -85,6 +84,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
private PowerManager.WakeLock wakeLock = null;
private static volatile ConnectionsManager Instance = null;
+
public static ConnectionsManager getInstance() {
ConnectionsManager localInstance = Instance;
if (localInstance == null) {
@@ -185,7 +185,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
boolean notFound = true;
for (Action actor : actionQueue) {
if (actor instanceof HandshakeAction) {
- HandshakeAction eactor = (HandshakeAction)actor;
+ HandshakeAction eactor = (HandshakeAction) actor;
if (eactor.datacenter.datacenterId == datacenter.datacenterId) {
notFound = false;
break;
@@ -206,7 +206,6 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
};
public ConnectionsManager() {
- currentAppVersion = ApplicationLoader.getAppVersion();
lastOutgoingMessageId = 0;
movingToDatacenterId = DEFAULT_DATACENTER_ID;
loadSession();
@@ -218,7 +217,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
Utilities.stageQueue.postRunnable(stageRunnable, 1000);
try {
- PowerManager pm = (PowerManager)ApplicationLoader.applicationContext.getSystemService(Context.POWER_SERVICE);
+ PowerManager pm = (PowerManager) ApplicationLoader.applicationContext.getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "lock");
wakeLock.setReferenceCounted(false);
} catch (Exception e) {
@@ -352,20 +351,20 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (configFile.exists()) {
try {
SerializedData data = new SerializedData(configFile);
- isTestBackend = data.readInt32();
- int version = data.readInt32();
+ isTestBackend = data.readInt32(false);
+ int version = data.readInt32(false);
sessionsToDestroy.clear();
- int count = data.readInt32();
+ int count = data.readInt32(false);
for (int a = 0; a < count; a++) {
- sessionsToDestroy.add(data.readInt64());
+ sessionsToDestroy.add(data.readInt64(false));
}
- timeDifference = data.readInt32();
- count = data.readInt32();
+ timeDifference = data.readInt32(false);
+ count = data.readInt32(false);
for (int a = 0; a < count; a++) {
Datacenter datacenter = new Datacenter(data, 0);
datacenters.put(datacenter.datacenterId, datacenter);
}
- currentDatacenterId = data.readInt32();
+ currentDatacenterId = data.readInt32(false);
data.cleanup();
} catch (Exception e) {
UserConfig.clearConfig();
@@ -385,9 +384,9 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
byte[] sessionsBytes = Base64.decode(sessionsString, Base64.DEFAULT);
if (sessionsBytes != null) {
SerializedData data = new SerializedData(sessionsBytes);
- int count = data.readInt32();
+ int count = data.readInt32(false);
for (int a = 0; a < count; a++) {
- sessionsToDestroy.add(data.readInt64());
+ sessionsToDestroy.add(data.readInt64(false));
}
data.cleanup();
}
@@ -402,7 +401,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
byte[] datacentersBytes = Base64.decode(datacentersString, Base64.DEFAULT);
if (datacentersBytes != null) {
SerializedData data = new SerializedData(datacentersBytes);
- int count = data.readInt32();
+ int count = data.readInt32(false);
for (int a = 0; a < count; a++) {
Datacenter datacenter = new Datacenter(data, 1);
datacenters.put(datacenter.datacenterId, datacenter);
@@ -625,7 +624,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
long generateMessageId() {
- long messageId = (long)((((double)System.currentTimeMillis() + ((double)timeDifference) * 1000) * 4294967296.0) / 1000.0);
+ long messageId = (long) ((((double) System.currentTimeMillis() + ((double) timeDifference) * 1000) * 4294967296.0) / 1000.0);
if (messageId <= lastOutgoingMessageId) {
messageId = lastOutgoingMessageId + 1;
}
@@ -637,13 +636,14 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
long getTimeFromMsgId(long messageId) {
- return (long)(messageId / 4294967296.0 * 1000);
+ return (long) (messageId / 4294967296.0 * 1000);
}
//================================================================================
// Requests manage
//================================================================================
int lastClassGuid = 1;
+
public int generateClassGuid() {
int guid = lastClassGuid++;
requestsByGuids.put(guid, new ArrayList());
@@ -756,7 +756,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (updatingDcSettings) {
return;
}
- updatingDcStartTime = (int)(System.currentTimeMillis() / 1000);
+ updatingDcStartTime = (int) (System.currentTimeMillis() / 1000);
updatingDcSettings = true;
TLRPC.TL_help_getConfig getConfig = new TLRPC.TL_help_getConfig();
@@ -767,12 +767,12 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
return;
}
if (error == null) {
- TLRPC.TL_config config = (TLRPC.TL_config)response;
+ TLRPC.TL_config config = (TLRPC.TL_config) response;
int updateIn = config.expires - getCurrentTime();
if (updateIn <= 0) {
updateIn = 120;
}
- lastDcUpdateTime = (int)(System.currentTimeMillis() / 1000) - DC_UPDATE_TIME + updateIn;
+ lastDcUpdateTime = (int) (System.currentTimeMillis() / 1000) - DC_UPDATE_TIME + updateIn;
ArrayList datacentersArr = new ArrayList<>();
HashMap datacenterMap = new HashMap<>();
for (TLRPC.TL_dcOption datacenterDesc : config.dc_options) {
@@ -813,14 +813,17 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
private TLObject wrapInLayer(TLObject object, int datacenterId, RPCRequest request) {
if (object.layer() > 0) {
Datacenter datacenter = datacenterWithId(datacenterId);
- if (datacenter == null || datacenter.lastInitVersion != currentAppVersion) {
+ if (datacenter == null || datacenter.lastInitVersion != BuildVars.BUILD_VERSION) {
registerForPush();
request.initRequest = true;
TLRPC.initConnection invoke = new TLRPC.initConnection();
invoke.query = object;
invoke.api_id = BuildVars.APP_ID;
try {
- invoke.lang_code = LocaleController.getLocaleString(Locale.getDefault());
+ invoke.lang_code = LocaleController.getLocaleString(LocaleController.getInstance().getSystemDefaultLocale());
+ if (invoke.lang_code == null || invoke.lang_code.length() == 0) {
+ invoke.lang_code = "en";
+ }
invoke.device_model = Build.MANUFACTURER + Build.MODEL;
if (invoke.device_model == null) {
invoke.device_model = "Android unknown";
@@ -962,7 +965,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
public static boolean isNetworkOnline() {
try {
- ConnectivityManager cm = (ConnectivityManager)ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE);
+ ConnectivityManager cm = (ConnectivityManager) ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && (netInfo.isConnectedOrConnecting() || netInfo.isAvailable())) {
return true;
@@ -974,11 +977,11 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
return true;
} else {
netInfo = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
- if(netInfo != null && netInfo.isConnectedOrConnecting()) {
+ if (netInfo != null && netInfo.isConnectedOrConnecting()) {
return true;
}
}
- } catch(Exception e) {
+ } catch (Exception e) {
FileLog.e("tmessages", e);
return true;
}
@@ -987,12 +990,12 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
public static boolean isRoaming() {
try {
- ConnectivityManager cm = (ConnectivityManager)ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE);
+ ConnectivityManager cm = (ConnectivityManager) ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null) {
return netInfo.isRoaming();
}
- } catch(Exception e) {
+ } catch (Exception e) {
FileLog.e("tmessages", e);
}
return false;
@@ -1000,19 +1003,19 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
public static boolean isConnectedToWiFi() {
try {
- ConnectivityManager cm = (ConnectivityManager)ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE);
+ ConnectivityManager cm = (ConnectivityManager) ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
if (netInfo != null && netInfo.getState() == NetworkInfo.State.CONNECTED) {
return true;
}
- } catch(Exception e) {
+ } catch (Exception e) {
FileLog.e("tmessages", e);
}
return false;
}
public int getCurrentTime() {
- return (int)(System.currentTimeMillis() / 1000) + timeDifference;
+ return (int) (System.currentTimeMillis() / 1000) + timeDifference;
}
public int getTimeDifference() {
@@ -1033,7 +1036,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
genericConnection = defaultDatacenter.getGenericConnection(this);
}
- int currentTime = (int)(System.currentTimeMillis() / 1000);
+ int currentTime = (int) (System.currentTimeMillis() / 1000);
for (int i = 0; i < runningRequests.size(); i++) {
RPCRequest request = runningRequests.get(i);
@@ -1062,7 +1065,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
Datacenter requestDatacenter = datacenterWithId(datacenterId);
- if (!request.initRequest && requestDatacenter.lastInitVersion != currentAppVersion) {
+ if (!request.initRequest && requestDatacenter.lastInitVersion != BuildVars.BUILD_VERSION) {
request.rpcRequest = wrapInLayer(request.rawRequest, requestDatacenter.datacenterId, request);
ByteBufferDesc os = new ByteBufferDesc(true);
request.rpcRequest.serializeToStream(os);
@@ -1093,7 +1096,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
connection = requestDatacenter.getGenericConnection(this);
} else if ((request.flags & RPCRequest.RPCRequestClassDownloadMedia) != 0) {
connection = requestDatacenter.getDownloadConnection(this);
- } else if ((request.flags & RPCRequest.RPCRequestClassUploadMedia) != 0 ) {
+ } else if ((request.flags & RPCRequest.RPCRequestClassUploadMedia) != 0) {
connection = requestDatacenter.getUploadConnection(this);
}
@@ -1203,7 +1206,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
continue;
}
if (System.currentTimeMillis() / 1000 - lastDestroySessionRequestTime > 2.0) {
- lastDestroySessionRequestTime = (int)(System.currentTimeMillis() / 1000);
+ lastDestroySessionRequestTime = (int) (System.currentTimeMillis() / 1000);
TLRPC.TL_destroy_session destroySession = new TLRPC.TL_destroy_session();
destroySession.session_id = it;
destroyingSessions.add(it);
@@ -1277,7 +1280,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
Datacenter requestDatacenter = datacenterWithId(datacenterId);
- if (!request.initRequest && requestDatacenter.lastInitVersion != currentAppVersion) {
+ if (!request.initRequest && requestDatacenter.lastInitVersion != BuildVars.BUILD_VERSION) {
request.rpcRequest = wrapInLayer(request.rawRequest, requestDatacenter.datacenterId, request);
}
@@ -1363,7 +1366,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
request.runningMessageId = messageId;
request.runningMessageSeqNo = networkMessage.protoMessage.seqno;
request.serializedLength = requestLength;
- request.runningStartTime = (int)(System.currentTimeMillis() / 1000);
+ request.runningStartTime = (int) (System.currentTimeMillis() / 1000);
request.transportChannelToken = connection.channelToken;
if (request.requiresCompletion) {
runningRequests.add(request);
@@ -1486,7 +1489,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
boolean notFound = true;
for (Action actor : actionQueue) {
if (actor instanceof HandshakeAction) {
- HandshakeAction eactor = (HandshakeAction)actor;
+ HandshakeAction eactor = (HandshakeAction) actor;
if (eactor.datacenter.datacenterId == num) {
notFound = false;
break;
@@ -1506,7 +1509,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
boolean notFound = true;
for (Action actor : actionQueue) {
if (actor instanceof ExportAuthorizationAction) {
- ExportAuthorizationAction eactor = (ExportAuthorizationAction)actor;
+ ExportAuthorizationAction eactor = (ExportAuthorizationAction) actor;
if (eactor.datacenter.datacenterId == num) {
notFound = false;
break;
@@ -1554,7 +1557,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
ArrayList messages = new ArrayList<>();
- if(messageList != null) {
+ if (messageList != null) {
messages.addAll(messageList);
}
@@ -1638,11 +1641,11 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (BuildVars.DEBUG_VERSION) {
if (message.body instanceof TLRPC.invokeWithLayer) {
- FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer)message.body).query);
+ FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer) message.body).query);
} else if (message.body instanceof TLRPC.initConnection) {
- TLRPC.initConnection r = (TLRPC.initConnection)message.body;
+ TLRPC.initConnection r = (TLRPC.initConnection) message.body;
if (r.query instanceof TLRPC.invokeWithLayer) {
- FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer)r.query).query);
+ FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer) r.query).query);
} else {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + r.query);
}
@@ -1652,7 +1655,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
long msg_time = getTimeFromMsgId(message.msg_id);
- long currentTime = System.currentTimeMillis() + ((long)timeDifference) * 1000;
+ long currentTime = System.currentTimeMillis() + ((long) timeDifference) * 1000;
if (msg_time < currentTime - 30000 || msg_time > currentTime + 25000) {
FileLog.d("tmessages", "wrap in messages continaer");
@@ -1678,11 +1681,11 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
containerMessages.add(message);
if (BuildVars.DEBUG_VERSION) {
if (message.body instanceof TLRPC.invokeWithLayer) {
- FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer)message.body).query);
+ FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer) message.body).query);
} else if (message.body instanceof TLRPC.initConnection) {
- TLRPC.initConnection r = (TLRPC.initConnection)message.body;
+ TLRPC.initConnection r = (TLRPC.initConnection) message.body;
if (r.query instanceof TLRPC.invokeWithLayer) {
- FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer)r.query).query);
+ FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer) r.query).query);
} else {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + r.query);
}
@@ -1722,7 +1725,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (quickAckId != null) {
SerializedData data = new SerializedData(messageKeyFull);
- quickAckId.add(data.readInt32() & 0x7fffffff);
+ quickAckId.add(data.readInt32(false) & 0x7fffffff);
data.cleanup();
}
@@ -1782,7 +1785,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
performRpc(getFutureSalts, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
- TLRPC.TL_futuresalts res = (TLRPC.TL_futuresalts)response;
+ TLRPC.TL_futuresalts res = (TLRPC.TL_futuresalts) response;
if (error == null) {
int currentTime = getCurrentTime();
datacenter.mergeServerSalts(currentTime, res.salts);
@@ -1837,7 +1840,10 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
req.token = "" + pushSessionId;
req.app_sandbox = false;
try {
- req.lang_code = LocaleController.getLocaleString(Locale.getDefault());
+ req.lang_code = LocaleController.getLocaleString(LocaleController.getInstance().getSystemDefaultLocale());
+ if (req.lang_code == null || req.lang_code.length() == 0) {
+ req.lang_code = "en";
+ }
req.device_model = Build.MANUFACTURER + Build.MODEL;
if (req.device_model == null) {
req.device_model = "Android unknown";
@@ -1896,7 +1902,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
Datacenter datacenter = datacenterWithId(connection.getDatacenterId());
if (message instanceof TLRPC.TL_new_session_created) {
- TLRPC.TL_new_session_created newSession = (TLRPC.TL_new_session_created)message;
+ TLRPC.TL_new_session_created newSession = (TLRPC.TL_new_session_created) message;
if (!connection.isSessionProcessed(newSession.unique_id)) {
FileLog.d("tmessages", "New session:");
@@ -1941,7 +1947,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
timeDifference = (int)((time - currentTime) / 1000 - currentPingTime / 2.0);
}*/
- TLRPC.TL_msg_container messageContainer = (TLRPC.TL_msg_container)message;
+ TLRPC.TL_msg_container messageContainer = (TLRPC.TL_msg_container) message;
for (TLRPC.TL_protoMessage innerMessage : messageContainer.messages) {
long innerMessageId = innerMessage.msg_id;
if (innerMessage.seqno % 2 != 0) {
@@ -1989,7 +1995,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
sendingPushPing = false;
}
} else if (message instanceof TLRPC.TL_futuresalts) {
- TLRPC.TL_futuresalts futureSalts = (TLRPC.TL_futuresalts)message;
+ TLRPC.TL_futuresalts futureSalts = (TLRPC.TL_futuresalts) message;
long requestMid = futureSalts.req_msg_id;
for (RPCRequest request : runningRequests) {
if (request.respondsToMessageId(requestMid)) {
@@ -2007,7 +2013,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
}
} else if (message instanceof TLRPC.DestroySessionRes) {
- TLRPC.DestroySessionRes res = (TLRPC.DestroySessionRes)message;
+ TLRPC.DestroySessionRes res = (TLRPC.DestroySessionRes) message;
ArrayList lst = new ArrayList<>();
lst.addAll(sessionsToDestroy);
destroyingSessions.remove(res.session_id);
@@ -2019,18 +2025,18 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
}
} else if (message instanceof TLRPC.TL_rpc_result) {
- TLRPC.TL_rpc_result resultContainer = (TLRPC.TL_rpc_result)message;
+ TLRPC.TL_rpc_result resultContainer = (TLRPC.TL_rpc_result) message;
long resultMid = resultContainer.req_msg_id;
boolean ignoreResult = false;
FileLog.d("tmessages", "object in rpc_result is " + resultContainer.result);
if (resultContainer.result instanceof TLRPC.RpcError) {
- String errorMessage = ((TLRPC.RpcError)resultContainer.result).error_message;
- FileLog.e("tmessages", String.format("***** RPC error %d: %s", ((TLRPC.RpcError)resultContainer.result).error_code, errorMessage));
+ String errorMessage = ((TLRPC.RpcError) resultContainer.result).error_message;
+ FileLog.e("tmessages", String.format("***** RPC error %d: %s", ((TLRPC.RpcError) resultContainer.result).error_code, errorMessage));
int migrateToDatacenterId = DEFAULT_DATACENTER_ID;
- if (((TLRPC.RpcError)resultContainer.result).error_code == 303) {
+ if (((TLRPC.RpcError) resultContainer.result).error_code == 303) {
ArrayList migrateErrors = new ArrayList<>();
migrateErrors.add("NETWORK_MIGRATE_");
migrateErrors.add("PHONE_MIGRATE_");
@@ -2079,21 +2085,16 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
boolean discardResponse = false;
boolean isError = false;
+ boolean allowInitConnection = true;
+
if (request.completionBlock != null) {
TLRPC.TL_error implicitError = null;
if (resultContainer.result instanceof TLRPC.TL_gzip_packed) {
- TLRPC.TL_gzip_packed packet = (TLRPC.TL_gzip_packed)resultContainer.result;
- TLObject uncomressed = Utilities.decompress(packet.packed_data, request.rawRequest);
- if (uncomressed == null) {
- System.gc();
- uncomressed = Utilities.decompress(packet.packed_data, request.rawRequest);
- }
- if (uncomressed == null) {
- throw new RuntimeException("failed to decomress responce for " + request.rawRequest);
- }
- resultContainer.result = uncomressed;
+ TLRPC.TL_gzip_packed packet = (TLRPC.TL_gzip_packed) resultContainer.result;
+ resultContainer.result = Utilities.decompress(packet.packed_data, request.rawRequest, true);
}
if (resultContainer.result instanceof TLRPC.RpcError) {
+ allowInitConnection = false;
String errorMessage = ((TLRPC.RpcError) resultContainer.result).error_message;
FileLog.e("tmessages", String.format("***** RPC error %d: %s", ((TLRPC.RpcError) resultContainer.result).error_code, errorMessage));
@@ -2106,6 +2107,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
request.runningMinStartTime = request.runningStartTime + delay;
request.confirmed = false;
}
+
request.serverFailureCount++;
} else if (errorCode == 420) {
if ((request.flags & RPCRequest.RPCRequestClassFailOnServerErrors) == 0) {
@@ -2135,20 +2137,21 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
discardResponse = true;
request.wait = true;
- request.runningMinStartTime = (int)(System.currentTimeMillis() / 1000 + waitTime);
+ request.runningMinStartTime = (int) (System.currentTimeMillis() / 1000 + waitTime);
request.confirmed = false;
}
}
implicitError = new TLRPC.TL_error();
- implicitError.code = ((TLRPC.RpcError)resultContainer.result).error_code;
- implicitError.text = ((TLRPC.RpcError)resultContainer.result).error_message;
+ implicitError.code = ((TLRPC.RpcError) resultContainer.result).error_code;
+ implicitError.text = ((TLRPC.RpcError) resultContainer.result).error_message;
} else if (!(resultContainer.result instanceof TLRPC.TL_error)) {
- if (request.rawRequest == null || resultContainer.result == null || !request.rawRequest.responseClass().isAssignableFrom(resultContainer.result.getClass())) {
+ if (request.rawRequest == null || resultContainer.result == null) {
+ allowInitConnection = false;
if (request.rawRequest == null) {
FileLog.e("tmessages", "rawRequest is null");
} else {
- FileLog.e("tmessages", "***** RPC error: invalid response class " + resultContainer.result + " (" + request.rawRequest.responseClass() + " expected)");
+ FileLog.e("tmessages", "***** RPC error: invalid response class " + resultContainer.result + " (for request " + request.rawRequest + ")");
}
implicitError = new TLRPC.TL_error();
implicitError.code = -1000;
@@ -2161,6 +2164,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
isError = true;
request.completionBlock.run(null, implicitError != null ? implicitError : (TLRPC.TL_error) resultContainer.result);
} else {
+ request.completionBlock.run(resultContainer.result, null);
if (resultContainer.result instanceof TLRPC.updates_Difference) {
pushMessagesReceived = true;
AndroidUtilities.runOnUIThread(new Runnable() {
@@ -2173,24 +2177,14 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
});
}
- request.completionBlock.run(resultContainer.result, null);
}
}
if (implicitError != null && implicitError.code == 401) {
+ allowInitConnection = false;
isError = true;
if (implicitError.text != null && implicitError.text.contains("SESSION_PASSWORD_NEEDED")) {
- /*UserConfig.setWaitingForPasswordEnter(true); TODO
- UserConfig.saveConfig(false);
- if (UserConfig.isClientActivated()) {
- discardResponse = true;
- AndroidUtilities.runOnUIThread(new Runnable() {
- @Override
- public void run() {
- NotificationCenter.getInstance().postNotificationName(NotificationCenter.needPasswordEnter);
- }
- });
- }*/
+ //ignore this error
} else if (datacenter.datacenterId == currentDatacenterId || datacenter.datacenterId == movingToDatacenterId) {
if ((request.flags & RPCRequest.RPCRequestClassGeneric) != 0 && UserConfig.isClientActivated()) {
UserConfig.clearConfig();
@@ -2214,9 +2208,9 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
if (!discardResponse) {
- if (request.initRequest && !isError) {
- if (datacenter.lastInitVersion != currentAppVersion) {
- datacenter.lastInitVersion = currentAppVersion;
+ if (allowInitConnection && request.initRequest && !isError) {
+ if (datacenter.lastInitVersion != BuildVars.BUILD_VERSION) {
+ datacenter.lastInitVersion = BuildVars.BUILD_VERSION;
saveSession();
FileLog.e("tmessages", "init connection completed");
} else {
@@ -2254,7 +2248,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
} else if (message instanceof TLRPC.TL_ping) {
} else if (message instanceof TLRPC.TL_bad_msg_notification) {
- TLRPC.TL_bad_msg_notification badMsgNotification = (TLRPC.TL_bad_msg_notification)message;
+ TLRPC.TL_bad_msg_notification badMsgNotification = (TLRPC.TL_bad_msg_notification) message;
FileLog.e("tmessages", String.format("***** Bad message: %d", badMsgNotification.error_code));
@@ -2267,7 +2261,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (realId != 0) {
long time = getTimeFromMsgId(messageId);
long currentTime = System.currentTimeMillis();
- timeDifference = (int)((time - currentTime) / 1000 - currentPingTime / 2.0);
+ timeDifference = (int) ((time - currentTime) / 1000 - currentPingTime / 2.0);
}
datacenter.recreateSessions();
@@ -2283,7 +2277,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (messageId != 0) {
long time = getTimeFromMsgId(messageId);
long currentTime = System.currentTimeMillis();
- timeDifference = (int)((time - currentTime) / 1000 - currentPingTime / 2.0);
+ timeDifference = (int) ((time - currentTime) / 1000 - currentPingTime / 2.0);
lastOutgoingMessageId = Math.max(messageId, lastOutgoingMessageId);
}
@@ -2316,7 +2310,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
processRequestQueue(RPCRequest.RPCRequestClassTransportMask, datacenter.datacenterId);
}
} else if (message instanceof TLRPC.MsgDetailedInfo) {
- TLRPC.MsgDetailedInfo detailedInfo = (TLRPC.MsgDetailedInfo)message;
+ TLRPC.MsgDetailedInfo detailedInfo = (TLRPC.MsgDetailedInfo) message;
boolean requestResend = false;
boolean confirm = true;
@@ -2327,8 +2321,8 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (request.completed) {
break;
}
- if (request.lastResendTime == 0 || request.lastResendTime + 60 < (int)(System.currentTimeMillis() / 1000)) {
- request.lastResendTime = (int)(System.currentTimeMillis() / 1000);
+ if (request.lastResendTime == 0 || request.lastResendTime + 60 < (int) (System.currentTimeMillis() / 1000)) {
+ request.lastResendTime = (int) (System.currentTimeMillis() / 1000);
requestResend = true;
} else {
confirm = false;
@@ -2356,9 +2350,11 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
connection.addMessageToConfirm(detailedInfo.answer_msg_id);
}
} else if (message instanceof TLRPC.TL_gzip_packed) {
- TLRPC.TL_gzip_packed packet = (TLRPC.TL_gzip_packed)message;
- TLObject result = Utilities.decompress(packet.packed_data, getRequestWithMessageId(messageId));
- processMessage(result, messageId, messageSeqNo, messageSalt, connection, innerMsgId, containerMessageId);
+ TLRPC.TL_gzip_packed packet = (TLRPC.TL_gzip_packed) message;
+ TLObject result = Utilities.decompress(packet.packed_data, getRequestWithMessageId(messageId), true);
+ if (result != null) {
+ processMessage(result, messageId, messageSeqNo, messageSalt, connection, innerMsgId, containerMessageId);
+ }
} else if (message instanceof TLRPC.Updates) {
if ((connection.transportRequestClass & RPCRequest.RPCRequestClassPush) != 0) {
FileLog.e("tmessages", "received internal push");
@@ -2375,6 +2371,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
resumeNetworkInternal();
} else {
pushMessagesReceived = true;
+ MessagesController.getInstance().processUpdates((TLRPC.Updates) message, false);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
@@ -2384,7 +2381,6 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
}
});
- MessagesController.getInstance().processUpdates((TLRPC.Updates) message, false);
}
} else {
FileLog.e("tmessages", "***** Error: unknown message class " + message);
@@ -2464,7 +2460,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
if (BuildVars.DEBUG_VERSION) {
try {
- ConnectivityManager cm = (ConnectivityManager)ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE);
+ ConnectivityManager cm = (ConnectivityManager) ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo[] networkInfos = cm.getAllNetworkInfo();
for (int a = 0; a < 2; a++) {
if (a >= networkInfos.length) {
@@ -2491,7 +2487,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
FileLog.e("tmessages", "push connection closed");
if (BuildVars.DEBUG_VERSION) {
try {
- ConnectivityManager cm = (ConnectivityManager)ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE);
+ ConnectivityManager cm = (ConnectivityManager) ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo[] networkInfos = cm.getAllNetworkInfo();
for (int a = 0; a < 2; a++) {
if (a >= networkInfos.length) {
@@ -2577,7 +2573,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
}
if (length == 4) {
- int error = data.readInt32();
+ int error = data.readInt32(false);
FileLog.e("tmessages", "mtproto error = " + error);
connection.suspendConnection(true);
connection.connect();
@@ -2585,22 +2581,20 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
Datacenter datacenter = datacenterWithId(connection.getDatacenterId());
- long keyId = data.readInt64();
+ long keyId = data.readInt64(false);
if (keyId == 0) {
- long messageId = data.readInt64();
+ long messageId = data.readInt64(false);
if (connection.isMessageIdProcessed(messageId)) {
finishUpdatingState(connection);
return;
}
- int messageLength = data.readInt32();
- int constructor = data.readInt32();
+ int messageLength = data.readInt32(false);
- TLObject object = TLClassStore.Instance().TLdeserialize(data, constructor, getRequestWithMessageId(messageId));
+ TLObject message = deserialize(getRequestWithMessageId(messageId), data, true);
- processMessage(object, messageId, 0, 0, connection, 0, 0);
-
- if (object != null) {
+ if (message != null) {
+ processMessage(message, messageId, 0, 0, connection, 0, 0);
connection.addProcessedMessageId(messageId);
}
} else {
@@ -2612,13 +2606,13 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
return;
}
- byte[] messageKey = data.readData(16);
+ byte[] messageKey = data.readData(16, false);
MessageKeyData keyData = Utilities.generateMessageKeyData(datacenter.authKey, messageKey, true);
Utilities.aesIgeEncryption(data.buffer, keyData.aesKey, keyData.aesIv, false, false, data.position(), length - 24);
- long messageServerSalt = data.readInt64();
- long messageSessionId = data.readInt64();
+ long messageServerSalt = data.readInt64(false);
+ long messageSessionId = data.readInt64(false);
if (messageSessionId != connection.getSissionId()) {
FileLog.e("tmessages", String.format("***** Error: invalid message session ID (%d instead of %d)", messageSessionId, connection.getSissionId()));
@@ -2628,9 +2622,9 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
boolean doNotProcess = false;
- long messageId = data.readInt64();
- int messageSeqNo = data.readInt32();
- int messageLength = data.readInt32();
+ long messageId = data.readInt64(false);
+ int messageSeqNo = data.readInt32(false);
+ int messageLength = data.readInt32(false);
if (connection.isMessageIdProcessed(messageId)) {
doNotProcess = true;
@@ -2654,12 +2648,8 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
if (!doNotProcess) {
- int constructor = data.readInt32();
- TLObject message = TLClassStore.Instance().TLdeserialize(data, constructor, getRequestWithMessageId(messageId));
-
- if (message == null) {
- FileLog.e("tmessages", "***** Error parsing message: " + constructor);
- } else {
+ TLObject message = deserialize(getRequestWithMessageId(messageId), data, true);
+ if (message != null) {
FileLog.d("tmessages", "received object " + message);
processMessage(message, messageId, messageSeqNo, messageServerSalt, connection, 0, 0);
connection.addProcessedMessageId(messageId);
@@ -2680,6 +2670,33 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
}
+ protected TLObject deserialize(TLObject request, AbsSerializedData data, boolean exception) {
+ int constructor = data.readInt32(exception);
+ TLObject message = null;
+ try {
+ message = TLClassStore.Instance().TLdeserialize(data, constructor, request, exception);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ if (message == null) {
+ if (request != null) {
+ try {
+ message = request.deserializeResponse(data, constructor, exception);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ if (message == null) {
+ FileLog.e("tmessages", String.format(Locale.US, "***** Error parsing message: %x", constructor));
+ }
+ } else {
+ FileLog.d("tmessages", String.format(Locale.US, "***** Not found request to parse message: %x", constructor));
+ }
+ } else if (message instanceof TLRPC.TL_rpc_result && ((TLRPC.TL_rpc_result) message).result == null) {
+ message = null;
+ }
+ return message;
+ }
+
public TLObject getRequestWithMessageId(long msgId) {
for (RPCRequest request : runningRequests) {
if (msgId == request.runningMessageId) {
@@ -2712,7 +2729,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
@Override
public void run(TLObject response, TLRPC.TL_error error) {
if (error == null) {
- movingAuthorization = (TLRPC.TL_auth_exportedAuthorization)response;
+ movingAuthorization = (TLRPC.TL_auth_exportedAuthorization) response;
authorizeOnMovingDatacenter();
} else {
Utilities.stageQueue.postRunnable(new Runnable() {
@@ -2797,12 +2814,12 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
@Override
public void ActionDidFinishExecution(final Action action, HashMap params) {
if (action instanceof HandshakeAction) {
- HandshakeAction eactor = (HandshakeAction)action;
+ HandshakeAction eactor = (HandshakeAction) action;
eactor.datacenter.connection.delegate = this;
saveSession();
if (eactor.datacenter.datacenterId == currentDatacenterId || eactor.datacenter.datacenterId == movingToDatacenterId) {
- timeDifference = (Integer)params.get("timeDifference");
+ timeDifference = (Integer) params.get("timeDifference");
eactor.datacenter.recreateSessions();
clearRequestsForRequestClass(RPCRequest.RPCRequestClassGeneric, eactor.datacenter);
@@ -2811,7 +2828,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
processRequestQueue(RPCRequest.RPCRequestClassTransportMask, eactor.datacenter.datacenterId);
} else if (action instanceof ExportAuthorizationAction) {
- ExportAuthorizationAction eactor = (ExportAuthorizationAction)action;
+ ExportAuthorizationAction eactor = (ExportAuthorizationAction) action;
Datacenter datacenter = eactor.datacenter;
datacenter.authorized = true;
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Datacenter.java b/TMessagesProj/src/main/java/org/telegram/messenger/Datacenter.java
index 61c63d2a..04ffccfa 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/Datacenter.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/Datacenter.java
@@ -45,64 +45,64 @@ public class Datacenter {
public Datacenter(SerializedData data, int version) {
if (version == 0) {
- datacenterId = data.readInt32();
- String address = data.readString();
+ datacenterId = data.readInt32(false);
+ String address = data.readString(false);
addresses.add(address);
- int port = data.readInt32();
+ int port = data.readInt32(false);
ports.put(address, port);
- int len = data.readInt32();
+ int len = data.readInt32(false);
if (len != 0) {
- authKey = data.readData(len);
+ authKey = data.readData(len, false);
}
- len = data.readInt32();
+ len = data.readInt32(false);
if (len != 0) {
- authKeyId = data.readInt64();
+ authKeyId = data.readInt64(false);
}
- authorized = data.readInt32() != 0;
- len = data.readInt32();
+ authorized = data.readInt32(false) != 0;
+ len = data.readInt32(false);
for (int a = 0; a < len; a++) {
ServerSalt salt = new ServerSalt();
- salt.validSince = data.readInt32();
- salt.validUntil = data.readInt32();
- salt.value = data.readInt64();
+ salt.validSince = data.readInt32(false);
+ salt.validUntil = data.readInt32(false);
+ salt.value = data.readInt64(false);
if (authServerSaltSet == null) {
authServerSaltSet = new ArrayList<>();
}
authServerSaltSet.add(salt);
}
} else if (version == 1) {
- int currentVersion = data.readInt32();
+ int currentVersion = data.readInt32(false);
if (currentVersion == 2 || currentVersion == 3 || currentVersion == 4) {
- datacenterId = data.readInt32();
+ datacenterId = data.readInt32(false);
if (currentVersion >= 3) {
- lastInitVersion = data.readInt32();
+ lastInitVersion = data.readInt32(false);
}
- int len = data.readInt32();
+ int len = data.readInt32(false);
for (int a = 0; a < len; a++) {
- String address = data.readString();
+ String address = data.readString(false);
addresses.add(address);
- ports.put(address, data.readInt32());
+ ports.put(address, data.readInt32(false));
}
- len = data.readInt32();
+ len = data.readInt32(false);
if (len != 0) {
- authKey = data.readData(len);
+ authKey = data.readData(len, false);
}
if (currentVersion == 4) {
- authKeyId = data.readInt64();
+ authKeyId = data.readInt64(false);
} else {
- len = data.readInt32();
+ len = data.readInt32(false);
if (len != 0) {
- authKeyId = data.readInt64();
+ authKeyId = data.readInt64(false);
}
}
- authorized = data.readInt32() != 0;
- len = data.readInt32();
+ authorized = data.readInt32(false) != 0;
+ len = data.readInt32(false);
for (int a = 0; a < len; a++) {
ServerSalt salt = new ServerSalt();
- salt.validSince = data.readInt32();
- salt.validUntil = data.readInt32();
- salt.value = data.readInt64();
+ salt.validSince = data.readInt32(false);
+ salt.validUntil = data.readInt32(false);
+ salt.value = data.readInt64(false);
if (authServerSaltSet == null) {
authServerSaltSet = new ArrayList<>();
}
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/FileLoadOperation.java b/TMessagesProj/src/main/java/org/telegram/messenger/FileLoadOperation.java
index 62f21744..bd61dd05 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/FileLoadOperation.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/FileLoadOperation.java
@@ -8,8 +8,8 @@
package org.telegram.messenger;
-import java.io.RandomAccessFile;
import java.io.File;
+import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Scanner;
@@ -54,6 +54,8 @@ public class FileLoadOperation {
private File tempPath = null;
private boolean isForceRequest = false;
+ private static String orgName = null;
+
public interface FileLoadOperationDelegate {
void didFinishLoadingFile(FileLoadOperation operation, File finalFile);
void didFailedLoadingFile(FileLoadOperation operation, int state);
@@ -83,6 +85,7 @@ public class FileLoadOperation {
if (ext == null) {
ext = "jpg";
}
+ orgName = null;
}
public FileLoadOperation(TLRPC.Video videoLocation) {
@@ -149,6 +152,9 @@ public class FileLoadOperation {
ext = "";
}
}
+ if(ApplicationLoader.KEEP_ORIGINAL_FILENAME && !ext.contains("webp")){
+ orgName = FileLoader.getDocName(documentLocation);
+ }
}
public void setForceRequest(boolean forceRequest) {
@@ -215,9 +221,19 @@ public class FileLoadOperation {
return;
}
}
-
+ //
+ if(ApplicationLoader.KEEP_ORIGINAL_FILENAME && orgName != null){
+ fileNameFinal = orgName;
+ }
+ //
cacheFileFinal = new File(storePath, fileNameFinal);
boolean exist = cacheFileFinal.exists();
+ //
+ if(exist && orgName != null && ApplicationLoader.KEEP_ORIGINAL_FILENAME){
+ exist = false;
+ cacheFileFinal.delete();
+ }
+ //
if (exist && totalBytesCount != 0 && totalBytesCount != cacheFileFinal.length()) {
exist = false;
cacheFileFinal.delete();
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java b/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java
index dad1b9bf..42177106 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java
@@ -11,9 +11,12 @@ package org.telegram.messenger;
import org.telegram.android.AndroidUtilities;
import java.io.File;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Calendar;
import java.util.HashMap;
import java.util.LinkedList;
+import java.util.Locale;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Semaphore;
@@ -632,6 +635,10 @@ public class FileLoader {
}
public static TLRPC.PhotoSize getClosestPhotoSizeWithSize(ArrayList sizes, int side) {
+ return getClosestPhotoSizeWithSize(sizes, side, false);
+ }
+
+ public static TLRPC.PhotoSize getClosestPhotoSizeWithSize(ArrayList sizes, int side, boolean byMinSide) {
if (sizes == null || sizes.isEmpty()) {
return null;
}
@@ -641,11 +648,19 @@ public class FileLoader {
if (obj == null) {
continue;
}
- int currentSide = obj.w >= obj.h ? obj.w : obj.h;
- if (closestObject == null || side > 100 && closestObject.location != null && closestObject.location.dc_id == Integer.MIN_VALUE || obj instanceof TLRPC.TL_photoCachedSize || currentSide <= side && lastSide < currentSide) {
+ if (byMinSide) {
+ int currentSide = obj.h >= obj.w ? obj.w : obj.h;
+ if (closestObject == null || side > 100 && closestObject.location != null && closestObject.location.dc_id == Integer.MIN_VALUE || obj instanceof TLRPC.TL_photoCachedSize || side > lastSide && lastSide < currentSide) {
closestObject = obj;
lastSide = currentSide;
}
+ } else {
+ int currentSide = obj.w >= obj.h ? obj.w : obj.h;
+ if (closestObject == null || side > 100 && closestObject.location != null && closestObject.location.dc_id == Integer.MIN_VALUE || obj instanceof TLRPC.TL_photoCachedSize || currentSide <= side && lastSide < currentSide) {
+ closestObject = obj;
+ lastSide = currentSide;
+ }
+ }
}
return closestObject;
}
@@ -675,6 +690,7 @@ public class FileLoader {
ext = ext.substring(idx);
}
if (ext.length() > 1) {
+ if(ApplicationLoader.KEEP_ORIGINAL_FILENAME && !ext.contains("webp"))return getDocName(document); //Plus
return document.dc_id + "_" + document.id + ext;
} else {
return document.dc_id + "_" + document.id;
@@ -694,6 +710,64 @@ public class FileLoader {
}
return "";
}
+ //Plus
+ public static String getAttachFileName(TLObject attach, boolean out) {
+ if (attach instanceof TLRPC.Video) {
+ TLRPC.Video video = (TLRPC.Video)attach;
+ return video.dc_id + "_" + video.id + ".mp4";
+ } else if (attach instanceof TLRPC.Document) {
+ TLRPC.Document document = (TLRPC.Document)attach;
+ String ext = getDocumentFileName(document);
+ int idx = -1;
+ if (ext == null || (idx = ext.lastIndexOf(".")) == -1) {
+ ext = "";
+ } else {
+ ext = ext.substring(idx);
+ }
+ if (ext.length() > 1) {
+ if(!out && ApplicationLoader.KEEP_ORIGINAL_FILENAME && !ext.contains("webp"))return getDocName(document);
+ return document.dc_id + "_" + document.id + ext;
+ } else {
+ return document.dc_id + "_" + document.id;
+ }
+ } else if (attach instanceof TLRPC.PhotoSize) {
+ TLRPC.PhotoSize photo = (TLRPC.PhotoSize)attach;
+ if (photo.location == null) {
+ return "";
+ }
+ return photo.location.volume_id + "_" + photo.location.local_id + "." + (photo.location.ext != null ? photo.location.ext : "jpg");
+ } else if (attach instanceof TLRPC.Audio) {
+ TLRPC.Audio audio = (TLRPC.Audio)attach;
+ return audio.dc_id + "_" + audio.id + ".ogg";
+ } else if (attach instanceof TLRPC.FileLocation) {
+ TLRPC.FileLocation location = (TLRPC.FileLocation)attach;
+ return location.volume_id + "_" + location.local_id + "." + (location.ext != null ? location.ext : "jpg");
+ }
+ return "";
+ }
+ //Plus
+ public static String getDocName(TLRPC.Document document) {
+ String name = getDocumentFileName(document);
+ //boolean org = false;
+ //if(org)return name;
+ String date = document.date +"";
+ String ext = name;
+ int idx = -1;
+ if (ext == null || (idx = ext.lastIndexOf(".")) == -1) {
+ ext = "";
+ } else {
+ ext = ext.substring(idx);
+ }
+ int pos = name.lastIndexOf(".");
+ SimpleDateFormat formatter = new SimpleDateFormat("ddMMyyHHmmss", Locale.US);
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTimeInMillis(document.date * 1000L);
+ date = formatter.format(calendar.getTime());
+ if (pos > 0) {
+ name = name.substring(0, pos) + "_" + date + ext;
+ }
+ return name;
+ }
public void deleteFiles(final ArrayList files) {
if (files == null || files.isEmpty()) {
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/HandshakeAction.java b/TMessagesProj/src/main/java/org/telegram/messenger/HandshakeAction.java
index dc5f426d..cf64c98e 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/HandshakeAction.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/HandshakeAction.java
@@ -340,7 +340,7 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
Utilities.aesIgeEncryption(answerWithHash.buffer, tmpAesKey.toByteArray(), tmpAesIv.toByteArray(), false, false, 0, serverDhParams.encrypted_answer.length);
byte[] answerHash = new byte[20];
- answerWithHash.readRaw(answerHash);
+ answerWithHash.readRaw(answerHash, false);
boolean hashVerified = false;
for (int i = 0; i < 16; i++) {
@@ -358,8 +358,8 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
return;
}
- int constructor = answerWithHash.readInt32();
- TLRPC.TL_server_DH_inner_data dhInnerData = (TLRPC.TL_server_DH_inner_data)TLClassStore.Instance().TLdeserialize(answerWithHash, constructor);
+ int constructor = answerWithHash.readInt32(false);
+ TLRPC.TL_server_DH_inner_data dhInnerData = TLRPC.TL_server_DH_inner_data.TLdeserialize(answerWithHash, constructor, false);
BuffersStorage.getInstance().reuseFreeBuffer(answerWithHash);
if (!(dhInnerData instanceof TLRPC.TL_server_DH_inner_data)) {
@@ -627,17 +627,17 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
@Override
public void tcpConnectionReceivedData(TcpConnection connection, ByteBufferDesc data, int length) {
- long keyId = data.readInt64();
+ long keyId = data.readInt64(false);
if (keyId == 0) {
- long messageId = data.readInt64();
+ long messageId = data.readInt64(false);
if (processedMessageIds.contains(messageId)) {
FileLog.d("tmessages", String.format("===== Duplicate message id %d received, ignoring", messageId));
return;
}
- int messageLength = data.readInt32();
+ int messageLength = data.readInt32(false);
- int constructor = data.readInt32();
- TLObject object = TLClassStore.Instance().TLdeserialize(data, constructor);
+ int constructor = data.readInt32(false);
+ TLObject object = TLClassStore.Instance().TLdeserialize(data, constructor, false);
if (object != null) {
processedMessageIds.add(messageId);
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/SerializedData.java b/TMessagesProj/src/main/java/org/telegram/messenger/SerializedData.java
index 40847dab..f0130942 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/SerializedData.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/SerializedData.java
@@ -47,6 +47,7 @@ public class SerializedData extends AbsSerializedData {
isOut = false;
inbuf = new ByteArrayInputStream(data);
in = new DataInputStream(inbuf);
+ len = 0;
}
public void cleanup() {
@@ -131,17 +132,6 @@ public class SerializedData extends AbsSerializedData {
}
}
- public boolean readBool() {
- int consructor = readInt32();
- if (consructor == 0x997275b5) {
- return true;
- } else if (consructor == 0xbc799737) {
- return false;
- }
- FileLog.e("tmessages", "Not bool value!");
- return false;
- }
-
public void writeBool(boolean value) {
if (!justCalc) {
if (value) {
@@ -173,52 +163,6 @@ public class SerializedData extends AbsSerializedData {
}
}
- public int readInt32() {
- return readInt32(null);
- }
-
- public int readInt32(boolean[] error) {
- try {
- int i = 0;
- for(int j = 0; j < 4; j++) {
- i |= (in.read() << (j * 8));
- }
- if (error != null) {
- error[0] = false;
- }
- return i;
- } catch(Exception x) {
- if (error != null) {
- error[0] = true;
- }
- FileLog.e("tmessages", "read int32 error");
- }
- return 0;
- }
-
- public long readInt64() {
- return readInt64(null);
- }
-
- public long readInt64(boolean[] error) {
- try {
- long i = 0;
- for(int j = 0; j < 8; j++) {
- i |= ((long)in.read() << (j * 8));
- }
- if (error != null) {
- error[0] = false;
- }
- return i;
- } catch (Exception x) {
- if (error != null) {
- error[0] = true;
- }
- FileLog.e("tmessages", "read int64 error");
- }
- return 0;
- }
-
public void writeRaw(byte[] b) {
try {
if (!justCalc) {
@@ -226,7 +170,7 @@ public class SerializedData extends AbsSerializedData {
} else {
len += b.length;
}
- } catch (Exception x) {
+ } catch (Exception e) {
FileLog.e("tmessages", "write raw error");
}
}
@@ -238,7 +182,7 @@ public class SerializedData extends AbsSerializedData {
} else {
len += count;
}
- } catch (Exception x) {
+ } catch (Exception e) {
FileLog.e("tmessages", "write raw error");
}
}
@@ -246,7 +190,7 @@ public class SerializedData extends AbsSerializedData {
public void writeByte(int i) {
try {
if (!justCalc) {
- out.writeByte((byte)i);
+ out.writeByte((byte) i);
} else {
len += 1;
}
@@ -267,68 +211,6 @@ public class SerializedData extends AbsSerializedData {
}
}
- public void readRaw(byte[] b) {
- try {
- in.read(b);
- } catch (Exception x) {
- FileLog.e("tmessages", "read raw error");
- }
- }
-
- public byte[] readData(int count) {
- byte[] arr = new byte[count];
- readRaw(arr);
- return arr;
- }
-
- public String readString() {
- try {
- int sl = 1;
- int l = in.read();
- if(l >= 254) {
- l = in.read() | (in.read() << 8) | (in.read() << 16);
- sl = 4;
- }
- byte[] b = new byte[l];
- in.read(b);
- int i=sl;
- while((l + i) % 4 != 0) {
- in.read();
- i++;
- }
- return new String(b, "UTF-8");
- } catch (Exception x) {
- FileLog.e("tmessages", "read string error");
- }
- return null;
- }
-
- public byte[] readByteArray() {
- try {
- int sl = 1;
- int l = in.read();
- if (l >= 254) {
- l = in.read() | (in.read() << 8) | (in.read() << 16);
- sl = 4;
- }
- byte[] b = new byte[l];
- in.read(b);
- int i = sl;
- while((l + i) % 4 != 0) {
- in.read();
- i++;
- }
- return b;
- } catch (Exception x) {
- FileLog.e("tmessages", "read byte array error");
- }
- return null;
- }
-
- public ByteBufferDesc readByteBuffer() {
- throw new RuntimeException("SerializedData don't support readByteBuffer");
- }
-
public void writeByteArray(byte[] b) {
try {
if (b.length <= 253) {
@@ -361,7 +243,7 @@ public class SerializedData extends AbsSerializedData {
}
i++;
}
- } catch (Exception x) {
+ } catch (Exception e) {
FileLog.e("tmessages", "write byte array error");
}
}
@@ -369,7 +251,7 @@ public class SerializedData extends AbsSerializedData {
public void writeString(String s) {
try {
writeByteArray(s.getBytes("UTF-8"));
- } catch(Exception x) {
+ } catch(Exception e) {
FileLog.e("tmessages", "write string error");
}
}
@@ -406,24 +288,15 @@ public class SerializedData extends AbsSerializedData {
}
i++;
}
- } catch (Exception x) {
+ } catch (Exception e) {
FileLog.e("tmessages", "write byte array error");
}
}
- public double readDouble() {
- try {
- return Double.longBitsToDouble(readInt64());
- } catch(Exception x) {
- FileLog.e("tmessages", "read double error");
- }
- return 0;
- }
-
public void writeDouble(double d) {
try {
writeInt64(Double.doubleToRawLongBits(d));
- } catch(Exception x) {
+ } catch(Exception e) {
FileLog.e("tmessages", "write double error");
}
}
@@ -444,4 +317,172 @@ public class SerializedData extends AbsSerializedData {
public byte[] toByteArray() {
return outbuf.toByteArray();
}
+
+ public void skip(int count) {
+ if (count == 0) {
+ return;
+ }
+ if (!justCalc) {
+ if (in != null) {
+ try {
+ in.skipBytes(count);
+ } catch (Exception e) {
+ FileLog.e("tmessages", e);
+ }
+ }
+ } else {
+ len += count;
+ }
+ }
+
+ public int getPosition() {
+ return len;
+ }
+
+ public boolean readBool(boolean exception) {
+ int consructor = readInt32(exception);
+ if (consructor == 0x997275b5) {
+ return true;
+ } else if (consructor == 0xbc799737) {
+ return false;
+ }
+ if (exception) {
+ throw new RuntimeException("Not bool value!");
+ } else {
+ FileLog.e("tmessages", "Not bool value!");
+ }
+ return false;
+ }
+
+ public void readRaw(byte[] b, boolean exception) {
+ try {
+ in.read(b);
+ len += b.length;
+ } catch (Exception e) {
+ if (exception) {
+ throw new RuntimeException("read raw error", e);
+ } else {
+ FileLog.e("tmessages", "read raw error");
+ }
+ }
+ }
+
+ public byte[] readData(int count, boolean exception) {
+ byte[] arr = new byte[count];
+ readRaw(arr, exception);
+ return arr;
+ }
+
+ public String readString(boolean exception) {
+ try {
+ int sl = 1;
+ int l = in.read();
+ len++;
+ if(l >= 254) {
+ l = in.read() | (in.read() << 8) | (in.read() << 16);
+ len += 3;
+ sl = 4;
+ }
+ byte[] b = new byte[l];
+ in.read(b);
+ len++;
+ int i=sl;
+ while((l + i) % 4 != 0) {
+ in.read();
+ len++;
+ i++;
+ }
+ return new String(b, "UTF-8");
+ } catch (Exception e) {
+ if (exception) {
+ throw new RuntimeException("read string error", e);
+ } else {
+ FileLog.e("tmessages", "read string error");
+ }
+ }
+ return null;
+ }
+
+ public byte[] readByteArray(boolean exception) {
+ try {
+ int sl = 1;
+ int l = in.read();
+ len++;
+ if (l >= 254) {
+ l = in.read() | (in.read() << 8) | (in.read() << 16);
+ len += 3;
+ sl = 4;
+ }
+ byte[] b = new byte[l];
+ in.read(b);
+ len++;
+ int i = sl;
+ while((l + i) % 4 != 0) {
+ in.read();
+ len++;
+ i++;
+ }
+ return b;
+ } catch (Exception e) {
+ if (exception) {
+ throw new RuntimeException("read byte array error", e);
+ } else {
+ FileLog.e("tmessages", "read byte array error");
+ }
+ }
+ return null;
+ }
+
+ public ByteBufferDesc readByteBuffer(boolean exception) {
+ throw new RuntimeException("SerializedData don't support readByteBuffer");
+ }
+
+ public double readDouble(boolean exception) {
+ try {
+ return Double.longBitsToDouble(readInt64(exception));
+ } catch(Exception e) {
+ if (exception) {
+ throw new RuntimeException("read double error", e);
+ } else {
+ FileLog.e("tmessages", "read double error");
+ }
+ }
+ return 0;
+ }
+
+ public int readInt32(boolean exception) {
+ try {
+ int i = 0;
+ for(int j = 0; j < 4; j++) {
+ i |= (in.read() << (j * 8));
+ len++;
+ }
+ return i;
+ } catch(Exception e) {
+ if (exception) {
+ throw new RuntimeException("read int32 error", e);
+ } else {
+ FileLog.e("tmessages", "read int32 error");
+ }
+ }
+ return 0;
+ }
+
+ public long readInt64(boolean exception) {
+ try {
+ long i = 0;
+ for(int j = 0; j < 8; j++) {
+ i |= ((long)in.read() << (j * 8));
+ len++;
+ }
+ return i;
+ } catch (Exception e) {
+ if (exception) {
+ throw new RuntimeException("read int64 error", e);
+ } else {
+ FileLog.e("tmessages", "read int64 error");
+ }
+ }
+ return 0;
+ }
}
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/TLClassStore.java b/TMessagesProj/src/main/java/org/telegram/messenger/TLClassStore.java
index c3e862ad..8b433f28 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/TLClassStore.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/TLClassStore.java
@@ -16,415 +16,86 @@ public class TLClassStore {
public TLClassStore () {
classStore = new HashMap<>();
- classStore.put(TLRPC.TL_chatPhotoEmpty.constructor, TLRPC.TL_chatPhotoEmpty.class);
- classStore.put(TLRPC.TL_chatPhoto.constructor, TLRPC.TL_chatPhoto.class);
classStore.put(TLRPC.TL_futuresalts.constructor, TLRPC.TL_futuresalts.class);
- classStore.put(TLRPC.TL_bad_msg_notification.constructor, TLRPC.TL_bad_msg_notification.class);
- classStore.put(TLRPC.TL_bad_server_salt.constructor, TLRPC.TL_bad_server_salt.class);
+ classStore.put(TLRPC.TL_msg_new_detailed_info.constructor, TLRPC.TL_msg_new_detailed_info.class);
+ classStore.put(TLRPC.TL_msg_detailed_info.constructor, TLRPC.TL_msg_detailed_info.class);
classStore.put(TLRPC.TL_error.constructor, TLRPC.TL_error.class);
- classStore.put(TLRPC.TL_messages_sentEncryptedMessage.constructor, TLRPC.TL_messages_sentEncryptedMessage.class);
- classStore.put(TLRPC.TL_messages_sentEncryptedFile.constructor, TLRPC.TL_messages_sentEncryptedFile.class);
- classStore.put(TLRPC.TL_notifyAll.constructor, TLRPC.TL_notifyAll.class);
- classStore.put(TLRPC.TL_notifyChats.constructor, TLRPC.TL_notifyChats.class);
- classStore.put(TLRPC.TL_notifyUsers.constructor, TLRPC.TL_notifyUsers.class);
- classStore.put(TLRPC.TL_notifyPeer.constructor, TLRPC.TL_notifyPeer.class);
- classStore.put(TLRPC.TL_auth_checkedPhone.constructor, TLRPC.TL_auth_checkedPhone.class);
- classStore.put(TLRPC.TL_msgs_ack.constructor, TLRPC.TL_msgs_ack.class);
- classStore.put(TLRPC.TL_messages_chatFull.constructor, TLRPC.TL_messages_chatFull.class);
- classStore.put(TLRPC.TL_documentAttributeAnimated.constructor, TLRPC.TL_documentAttributeAnimated.class);
- classStore.put(TLRPC.TL_documentAttributeAudio.constructor, TLRPC.TL_documentAttributeAudio.class);
- classStore.put(TLRPC.TL_documentAttributeFilename.constructor, TLRPC.TL_documentAttributeFilename.class);
- classStore.put(TLRPC.TL_documentAttributeVideo.constructor, TLRPC.TL_documentAttributeVideo.class);
- classStore.put(TLRPC.TL_documentAttributeSticker.constructor, TLRPC.TL_documentAttributeSticker.class);
- classStore.put(TLRPC.TL_documentAttributeImageSize.constructor, TLRPC.TL_documentAttributeImageSize.class);
- classStore.put(TLRPC.TL_rpc_result.constructor, TLRPC.TL_rpc_result.class);
- classStore.put(TLRPC.TL_contactStatus.constructor, TLRPC.TL_contactStatus.class);
classStore.put(TLRPC.TL_auth_authorization.constructor, TLRPC.TL_auth_authorization.class);
- classStore.put(TLRPC.TL_messages_messages.constructor, TLRPC.TL_messages_messages.class);
- classStore.put(TLRPC.TL_messages_messagesSlice.constructor, TLRPC.TL_messages_messagesSlice.class);
- classStore.put(TLRPC.TL_rpc_answer_unknown.constructor, TLRPC.TL_rpc_answer_unknown.class);
- classStore.put(TLRPC.TL_rpc_answer_dropped.constructor, TLRPC.TL_rpc_answer_dropped.class);
- classStore.put(TLRPC.TL_rpc_answer_dropped_running.constructor, TLRPC.TL_rpc_answer_dropped_running.class);
- classStore.put(TLRPC.TL_contacts_link.constructor, TLRPC.TL_contacts_link.class);
- classStore.put(TLRPC.TL_peerUser.constructor, TLRPC.TL_peerUser.class);
- classStore.put(TLRPC.TL_peerChat.constructor, TLRPC.TL_peerChat.class);
- classStore.put(TLRPC.TL_encryptedFile.constructor, TLRPC.TL_encryptedFile.class);
- classStore.put(TLRPC.TL_encryptedFileEmpty.constructor, TLRPC.TL_encryptedFileEmpty.class);
- classStore.put(TLRPC.TL_destroy_session_ok.constructor, TLRPC.TL_destroy_session_ok.class);
- classStore.put(TLRPC.TL_destroy_session_none.constructor, TLRPC.TL_destroy_session_none.class);
- classStore.put(TLRPC.TL_updates_differenceEmpty.constructor, TLRPC.TL_updates_differenceEmpty.class);
- classStore.put(TLRPC.TL_updates_differenceSlice.constructor, TLRPC.TL_updates_differenceSlice.class);
- classStore.put(TLRPC.TL_updates_difference.constructor, TLRPC.TL_updates_difference.class);
- classStore.put(TLRPC.TL_geoPointEmpty.constructor, TLRPC.TL_geoPointEmpty.class);
- classStore.put(TLRPC.TL_geoPoint.constructor, TLRPC.TL_geoPoint.class);
- classStore.put(TLRPC.TL_privacyKeyStatusTimestamp.constructor, TLRPC.TL_privacyKeyStatusTimestamp.class);
- classStore.put(TLRPC.TL_account_privacyRules.constructor, TLRPC.TL_account_privacyRules.class);
- classStore.put(TLRPC.TL_help_appUpdate.constructor, TLRPC.TL_help_appUpdate.class);
- classStore.put(TLRPC.TL_help_noAppUpdate.constructor, TLRPC.TL_help_noAppUpdate.class);
- classStore.put(TLRPC.TL_messageEmpty.constructor, TLRPC.TL_messageEmpty.class);
- classStore.put(TLRPC.TL_message.constructor, TLRPC.TL_message.class);
- classStore.put(TLRPC.TL_messageService.constructor, TLRPC.TL_messageService.class);
- classStore.put(TLRPC.TL_inputPhoneContact.constructor, TLRPC.TL_inputPhoneContact.class);
- classStore.put(TLRPC.TL_sendMessageGeoLocationAction.constructor, TLRPC.TL_sendMessageGeoLocationAction.class);
- classStore.put(TLRPC.TL_sendMessageChooseContactAction.constructor, TLRPC.TL_sendMessageChooseContactAction.class);
- classStore.put(TLRPC.TL_sendMessageTypingAction.constructor, TLRPC.TL_sendMessageTypingAction.class);
- classStore.put(TLRPC.TL_sendMessageUploadDocumentAction.constructor, TLRPC.TL_sendMessageUploadDocumentAction.class);
- classStore.put(TLRPC.TL_sendMessageRecordVideoAction.constructor, TLRPC.TL_sendMessageRecordVideoAction.class);
- classStore.put(TLRPC.TL_sendMessageUploadPhotoAction.constructor, TLRPC.TL_sendMessageUploadPhotoAction.class);
- classStore.put(TLRPC.TL_sendMessageUploadVideoAction.constructor, TLRPC.TL_sendMessageUploadVideoAction.class);
- classStore.put(TLRPC.TL_sendMessageUploadAudioAction.constructor, TLRPC.TL_sendMessageUploadAudioAction.class);
- classStore.put(TLRPC.TL_sendMessageCancelAction.constructor, TLRPC.TL_sendMessageCancelAction.class);
- classStore.put(TLRPC.TL_sendMessageRecordAudioAction.constructor, TLRPC.TL_sendMessageRecordAudioAction.class);
- classStore.put(TLRPC.TL_invokeAfterMsg.constructor, TLRPC.TL_invokeAfterMsg.class);
- classStore.put(TLRPC.TL_messageMediaVideo.constructor, TLRPC.TL_messageMediaVideo.class);
- classStore.put(TLRPC.TL_messageMediaPhoto.constructor, TLRPC.TL_messageMediaPhoto.class);
- classStore.put(TLRPC.TL_messageMediaDocument.constructor, TLRPC.TL_messageMediaDocument.class);
- classStore.put(TLRPC.TL_messageMediaGeo.constructor, TLRPC.TL_messageMediaGeo.class);
- classStore.put(TLRPC.TL_messageMediaEmpty.constructor, TLRPC.TL_messageMediaEmpty.class);
- classStore.put(TLRPC.TL_messageMediaAudio.constructor, TLRPC.TL_messageMediaAudio.class);
- classStore.put(TLRPC.TL_messageMediaContact.constructor, TLRPC.TL_messageMediaContact.class);
- classStore.put(TLRPC.TL_messageMediaUnsupported.constructor, TLRPC.TL_messageMediaUnsupported.class);
- classStore.put(TLRPC.TL_auth_sentAppCode.constructor, TLRPC.TL_auth_sentAppCode.class);
- classStore.put(TLRPC.TL_auth_sentCode.constructor, TLRPC.TL_auth_sentCode.class);
- classStore.put(TLRPC.TL_peerNotifySettingsEmpty.constructor, TLRPC.TL_peerNotifySettingsEmpty.class);
- classStore.put(TLRPC.TL_peerNotifySettings.constructor, TLRPC.TL_peerNotifySettings.class);
- classStore.put(TLRPC.TL_msg_resend_req.constructor, TLRPC.TL_msg_resend_req.class);
- classStore.put(TLRPC.TL_http_wait.constructor, TLRPC.TL_http_wait.class);
- classStore.put(TLRPC.TL_contacts_blocked.constructor, TLRPC.TL_contacts_blocked.class);
- classStore.put(TLRPC.TL_contacts_blockedSlice.constructor, TLRPC.TL_contacts_blockedSlice.class);
- classStore.put(TLRPC.TL_inputGeoPoint.constructor, TLRPC.TL_inputGeoPoint.class);
- classStore.put(TLRPC.TL_inputGeoPointEmpty.constructor, TLRPC.TL_inputGeoPointEmpty.class);
- classStore.put(TLRPC.TL_help_inviteText.constructor, TLRPC.TL_help_inviteText.class);
- classStore.put(TLRPC.TL_messages_dhConfigNotModified.constructor, TLRPC.TL_messages_dhConfigNotModified.class);
- classStore.put(TLRPC.TL_messages_dhConfig.constructor, TLRPC.TL_messages_dhConfig.class);
- classStore.put(TLRPC.TL_audioEmpty.constructor, TLRPC.TL_audioEmpty.class);
- classStore.put(TLRPC.TL_audio.constructor, TLRPC.TL_audio.class);
- classStore.put(TLRPC.TL_destroy_sessions_res.constructor, TLRPC.TL_destroy_sessions_res.class);
- classStore.put(TLRPC.TL_privacyValueAllowUsers.constructor, TLRPC.TL_privacyValueAllowUsers.class);
- classStore.put(TLRPC.TL_privacyValueDisallowAll.constructor, TLRPC.TL_privacyValueDisallowAll.class);
- classStore.put(TLRPC.TL_privacyValueAllowContacts.constructor, TLRPC.TL_privacyValueAllowContacts.class);
- classStore.put(TLRPC.TL_privacyValueDisallowContacts.constructor, TLRPC.TL_privacyValueDisallowContacts.class);
- classStore.put(TLRPC.TL_privacyValueAllowAll.constructor, TLRPC.TL_privacyValueAllowAll.class);
- classStore.put(TLRPC.TL_privacyValueDisallowUsers.constructor, TLRPC.TL_privacyValueDisallowUsers.class);
- classStore.put(TLRPC.TL_contacts_contacts.constructor, TLRPC.TL_contacts_contacts.class);
- classStore.put(TLRPC.TL_contacts_contactsNotModified.constructor, TLRPC.TL_contacts_contactsNotModified.class);
- classStore.put(TLRPC.TL_inputPrivacyKeyStatusTimestamp.constructor, TLRPC.TL_inputPrivacyKeyStatusTimestamp.class);
- classStore.put(TLRPC.TL_photos_photos.constructor, TLRPC.TL_photos_photos.class);
- classStore.put(TLRPC.TL_photos_photosSlice.constructor, TLRPC.TL_photos_photosSlice.class);
- classStore.put(TLRPC.TL_chatFull.constructor, TLRPC.TL_chatFull.class);
- classStore.put(TLRPC.TL_msgs_all_info.constructor, TLRPC.TL_msgs_all_info.class);
- classStore.put(TLRPC.TL_inputPeerNotifySettings.constructor, TLRPC.TL_inputPeerNotifySettings.class);
- classStore.put(TLRPC.TL_null.constructor, TLRPC.TL_null.class);
- classStore.put(TLRPC.TL_inputUserSelf.constructor, TLRPC.TL_inputUserSelf.class);
- classStore.put(TLRPC.TL_inputUserForeign.constructor, TLRPC.TL_inputUserForeign.class);
- classStore.put(TLRPC.TL_inputUserEmpty.constructor, TLRPC.TL_inputUserEmpty.class);
- classStore.put(TLRPC.TL_inputUserContact.constructor, TLRPC.TL_inputUserContact.class);
- classStore.put(TLRPC.TL_p_q_inner_data.constructor, TLRPC.TL_p_q_inner_data.class);
- classStore.put(TLRPC.TL_msgs_state_req.constructor, TLRPC.TL_msgs_state_req.class);
- classStore.put(TLRPC.TL_boolTrue.constructor, TLRPC.TL_boolTrue.class);
- classStore.put(TLRPC.TL_boolFalse.constructor, TLRPC.TL_boolFalse.class);
- classStore.put(TLRPC.TL_auth_exportedAuthorization.constructor, TLRPC.TL_auth_exportedAuthorization.class);
- classStore.put(TLRPC.TL_inputNotifyChats.constructor, TLRPC.TL_inputNotifyChats.class);
- classStore.put(TLRPC.TL_inputNotifyPeer.constructor, TLRPC.TL_inputNotifyPeer.class);
- classStore.put(TLRPC.TL_inputNotifyUsers.constructor, TLRPC.TL_inputNotifyUsers.class);
- classStore.put(TLRPC.TL_inputNotifyGeoChatPeer.constructor, TLRPC.TL_inputNotifyGeoChatPeer.class);
- classStore.put(TLRPC.TL_inputNotifyAll.constructor, TLRPC.TL_inputNotifyAll.class);
- classStore.put(TLRPC.TL_inputAudioFileLocation.constructor, TLRPC.TL_inputAudioFileLocation.class);
- classStore.put(TLRPC.TL_inputEncryptedFileLocation.constructor, TLRPC.TL_inputEncryptedFileLocation.class);
- classStore.put(TLRPC.TL_inputVideoFileLocation.constructor, TLRPC.TL_inputVideoFileLocation.class);
- classStore.put(TLRPC.TL_inputDocumentFileLocation.constructor, TLRPC.TL_inputDocumentFileLocation.class);
- classStore.put(TLRPC.TL_inputFileLocation.constructor, TLRPC.TL_inputFileLocation.class);
- classStore.put(TLRPC.TL_photos_photo.constructor, TLRPC.TL_photos_photo.class);
- classStore.put(TLRPC.TL_userContact.constructor, TLRPC.TL_userContact.class);
- classStore.put(TLRPC.TL_userRequest.constructor, TLRPC.TL_userRequest.class);
- classStore.put(TLRPC.TL_userForeign.constructor, TLRPC.TL_userForeign.class);
- classStore.put(TLRPC.TL_userDeleted.constructor, TLRPC.TL_userDeleted.class);
- classStore.put(TLRPC.TL_userSelf.constructor, TLRPC.TL_userSelf.class);
- classStore.put(TLRPC.TL_userEmpty.constructor, TLRPC.TL_userEmpty.class);
- classStore.put(TLRPC.TL_geoChatMessage.constructor, TLRPC.TL_geoChatMessage.class);
- classStore.put(TLRPC.TL_geoChatMessageService.constructor, TLRPC.TL_geoChatMessageService.class);
- classStore.put(TLRPC.TL_geoChatMessageEmpty.constructor, TLRPC.TL_geoChatMessageEmpty.class);
- classStore.put(TLRPC.TL_pong.constructor, TLRPC.TL_pong.class);
- classStore.put(TLRPC.TL_messageActionChatEditPhoto.constructor, TLRPC.TL_messageActionChatEditPhoto.class);
- classStore.put(TLRPC.TL_messageActionChatDeleteUser.constructor, TLRPC.TL_messageActionChatDeleteUser.class);
- classStore.put(TLRPC.TL_messageActionChatDeletePhoto.constructor, TLRPC.TL_messageActionChatDeletePhoto.class);
- classStore.put(TLRPC.TL_messageActionChatAddUser.constructor, TLRPC.TL_messageActionChatAddUser.class);
- classStore.put(TLRPC.TL_messageActionChatCreate.constructor, TLRPC.TL_messageActionChatCreate.class);
- classStore.put(TLRPC.TL_messageActionEmpty.constructor, TLRPC.TL_messageActionEmpty.class);
- classStore.put(TLRPC.TL_messageActionChatEditTitle.constructor, TLRPC.TL_messageActionChatEditTitle.class);
- classStore.put(TLRPC.TL_messageActionGeoChatCreate.constructor, TLRPC.TL_messageActionGeoChatCreate.class);
- classStore.put(TLRPC.TL_messageActionGeoChatCheckin.constructor, TLRPC.TL_messageActionGeoChatCheckin.class);
classStore.put(TLRPC.TL_dh_gen_retry.constructor, TLRPC.TL_dh_gen_retry.class);
classStore.put(TLRPC.TL_dh_gen_fail.constructor, TLRPC.TL_dh_gen_fail.class);
classStore.put(TLRPC.TL_dh_gen_ok.constructor, TLRPC.TL_dh_gen_ok.class);
- classStore.put(TLRPC.TL_peerNotifyEventsEmpty.constructor, TLRPC.TL_peerNotifyEventsEmpty.class);
- classStore.put(TLRPC.TL_peerNotifyEventsAll.constructor, TLRPC.TL_peerNotifyEventsAll.class);
- classStore.put(TLRPC.TL_chatLocated.constructor, TLRPC.TL_chatLocated.class);
- classStore.put(TLRPC.TL_decryptedMessageService.constructor, TLRPC.TL_decryptedMessageService.class);
- classStore.put(TLRPC.TL_decryptedMessage.constructor, TLRPC.TL_decryptedMessage.class);
- classStore.put(TLRPC.TL_inputPeerNotifyEventsAll.constructor, TLRPC.TL_inputPeerNotifyEventsAll.class);
- classStore.put(TLRPC.TL_inputPeerNotifyEventsEmpty.constructor, TLRPC.TL_inputPeerNotifyEventsEmpty.class);
- classStore.put(TLRPC.TL_client_DH_inner_data.constructor, TLRPC.TL_client_DH_inner_data.class);
- classStore.put(TLRPC.TL_video.constructor, TLRPC.TL_video.class);
- classStore.put(TLRPC.TL_videoEmpty.constructor, TLRPC.TL_videoEmpty.class);
- classStore.put(TLRPC.TL_contactBlocked.constructor, TLRPC.TL_contactBlocked.class);
- classStore.put(TLRPC.TL_inputDocumentEmpty.constructor, TLRPC.TL_inputDocumentEmpty.class);
- classStore.put(TLRPC.TL_inputDocument.constructor, TLRPC.TL_inputDocument.class);
- classStore.put(TLRPC.TL_inputAppEvent.constructor, TLRPC.TL_inputAppEvent.class);
- classStore.put(TLRPC.TL_messages_affectedHistory.constructor, TLRPC.TL_messages_affectedHistory.class);
- classStore.put(TLRPC.TL_documentEmpty.constructor, TLRPC.TL_documentEmpty.class);
- classStore.put(TLRPC.TL_document.constructor, TLRPC.TL_document.class);
- classStore.put(TLRPC.TL_inputPrivacyValueDisallowUsers.constructor, TLRPC.TL_inputPrivacyValueDisallowUsers.class);
- classStore.put(TLRPC.TL_inputPrivacyValueDisallowAll.constructor, TLRPC.TL_inputPrivacyValueDisallowAll.class);
- classStore.put(TLRPC.TL_inputPrivacyValueDisallowContacts.constructor, TLRPC.TL_inputPrivacyValueDisallowContacts.class);
- classStore.put(TLRPC.TL_inputPrivacyValueAllowAll.constructor, TLRPC.TL_inputPrivacyValueAllowAll.class);
- classStore.put(TLRPC.TL_inputPrivacyValueAllowContacts.constructor, TLRPC.TL_inputPrivacyValueAllowContacts.class);
- classStore.put(TLRPC.TL_inputPrivacyValueAllowUsers.constructor, TLRPC.TL_inputPrivacyValueAllowUsers.class);
- classStore.put(TLRPC.TL_inputMediaContact.constructor, TLRPC.TL_inputMediaContact.class);
- classStore.put(TLRPC.TL_inputMediaUploadedThumbDocument.constructor, TLRPC.TL_inputMediaUploadedThumbDocument.class);
- classStore.put(TLRPC.TL_inputMediaAudio.constructor, TLRPC.TL_inputMediaAudio.class);
- classStore.put(TLRPC.TL_inputMediaDocument.constructor, TLRPC.TL_inputMediaDocument.class);
- classStore.put(TLRPC.TL_inputMediaVideo.constructor, TLRPC.TL_inputMediaVideo.class);
- classStore.put(TLRPC.TL_inputMediaGeoPoint.constructor, TLRPC.TL_inputMediaGeoPoint.class);
- classStore.put(TLRPC.TL_inputMediaEmpty.constructor, TLRPC.TL_inputMediaEmpty.class);
- classStore.put(TLRPC.TL_inputMediaUploadedThumbVideo.constructor, TLRPC.TL_inputMediaUploadedThumbVideo.class);
- classStore.put(TLRPC.TL_inputMediaUploadedPhoto.constructor, TLRPC.TL_inputMediaUploadedPhoto.class);
- classStore.put(TLRPC.TL_inputMediaUploadedAudio.constructor, TLRPC.TL_inputMediaUploadedAudio.class);
- classStore.put(TLRPC.TL_inputMediaUploadedVideo.constructor, TLRPC.TL_inputMediaUploadedVideo.class);
- classStore.put(TLRPC.TL_inputMediaUploadedDocument.constructor, TLRPC.TL_inputMediaUploadedDocument.class);
- classStore.put(TLRPC.TL_inputMediaPhoto.constructor, TLRPC.TL_inputMediaPhoto.class);
- classStore.put(TLRPC.TL_geochats_messagesSlice.constructor, TLRPC.TL_geochats_messagesSlice.class);
- classStore.put(TLRPC.TL_geochats_messages.constructor, TLRPC.TL_geochats_messages.class);
- classStore.put(TLRPC.TL_messages_sentMessage.constructor, TLRPC.TL_messages_sentMessage.class);
- classStore.put(TLRPC.TL_messages_sentMessageLink.constructor, TLRPC.TL_messages_sentMessageLink.class);
- classStore.put(TLRPC.TL_encryptedMessageService.constructor, TLRPC.TL_encryptedMessageService.class);
- classStore.put(TLRPC.TL_encryptedMessage.constructor, TLRPC.TL_encryptedMessage.class);
- classStore.put(TLRPC.TL_contactSuggested.constructor, TLRPC.TL_contactSuggested.class);
- classStore.put(TLRPC.TL_server_DH_params_fail.constructor, TLRPC.TL_server_DH_params_fail.class);
- classStore.put(TLRPC.TL_server_DH_params_ok.constructor, TLRPC.TL_server_DH_params_ok.class);
- classStore.put(TLRPC.TL_userStatusOffline.constructor, TLRPC.TL_userStatusOffline.class);
- classStore.put(TLRPC.TL_userStatusLastWeek.constructor, TLRPC.TL_userStatusLastWeek.class);
- classStore.put(TLRPC.TL_userStatusEmpty.constructor, TLRPC.TL_userStatusEmpty.class);
- classStore.put(TLRPC.TL_userStatusLastMonth.constructor, TLRPC.TL_userStatusLastMonth.class);
- classStore.put(TLRPC.TL_userStatusOnline.constructor, TLRPC.TL_userStatusOnline.class);
- classStore.put(TLRPC.TL_userStatusRecently.constructor, TLRPC.TL_userStatusRecently.class);
- classStore.put(TLRPC.TL_msg_copy.constructor, TLRPC.TL_msg_copy.class);
- classStore.put(TLRPC.TL_contacts_importedContacts.constructor, TLRPC.TL_contacts_importedContacts.class);
- classStore.put(TLRPC.TL_disabledFeature.constructor, TLRPC.TL_disabledFeature.class);
+ classStore.put(TLRPC.TL_server_DH_inner_data.constructor, TLRPC.TL_server_DH_inner_data.class);
+ classStore.put(TLRPC.TL_msgs_ack.constructor, TLRPC.TL_msgs_ack.class);
classStore.put(TLRPC.TL_futureSalt.constructor, TLRPC.TL_futureSalt.class);
- classStore.put(TLRPC.TL_updateEncryptedMessagesRead.constructor, TLRPC.TL_updateEncryptedMessagesRead.class);
- classStore.put(TLRPC.TL_updateContactLink.constructor, TLRPC.TL_updateContactLink.class);
- classStore.put(TLRPC.TL_updateReadMessages.constructor, TLRPC.TL_updateReadMessages.class);
- classStore.put(TLRPC.TL_updateChatParticipantDelete.constructor, TLRPC.TL_updateChatParticipantDelete.class);
- classStore.put(TLRPC.TL_updateServiceNotification.constructor, TLRPC.TL_updateServiceNotification.class);
- classStore.put(TLRPC.TL_updateNotifySettings.constructor, TLRPC.TL_updateNotifySettings.class);
- classStore.put(TLRPC.TL_updateUserTyping.constructor, TLRPC.TL_updateUserTyping.class);
- classStore.put(TLRPC.TL_updateChatUserTyping.constructor, TLRPC.TL_updateChatUserTyping.class);
- classStore.put(TLRPC.TL_updateUserName.constructor, TLRPC.TL_updateUserName.class);
- classStore.put(TLRPC.TL_updateNewEncryptedMessage.constructor, TLRPC.TL_updateNewEncryptedMessage.class);
- classStore.put(TLRPC.TL_updateNewMessage.constructor, TLRPC.TL_updateNewMessage.class);
- classStore.put(TLRPC.TL_updateMessageID.constructor, TLRPC.TL_updateMessageID.class);
- classStore.put(TLRPC.TL_updateDeleteMessages.constructor, TLRPC.TL_updateDeleteMessages.class);
- classStore.put(TLRPC.TL_updateEncryptedChatTyping.constructor, TLRPC.TL_updateEncryptedChatTyping.class);
- classStore.put(TLRPC.TL_updateDcOptions.constructor, TLRPC.TL_updateDcOptions.class);
- classStore.put(TLRPC.TL_updateChatParticipants.constructor, TLRPC.TL_updateChatParticipants.class);
- classStore.put(TLRPC.TL_updatePrivacy.constructor, TLRPC.TL_updatePrivacy.class);
- classStore.put(TLRPC.TL_updateEncryption.constructor, TLRPC.TL_updateEncryption.class);
- classStore.put(TLRPC.TL_updateUserBlocked.constructor, TLRPC.TL_updateUserBlocked.class);
- classStore.put(TLRPC.TL_updateActivation.constructor, TLRPC.TL_updateActivation.class);
- classStore.put(TLRPC.TL_updateNewAuthorization.constructor, TLRPC.TL_updateNewAuthorization.class);
- classStore.put(TLRPC.TL_updateNewGeoChatMessage.constructor, TLRPC.TL_updateNewGeoChatMessage.class);
- classStore.put(TLRPC.TL_updateUserPhoto.constructor, TLRPC.TL_updateUserPhoto.class);
- classStore.put(TLRPC.TL_updateContactRegistered.constructor, TLRPC.TL_updateContactRegistered.class);
- classStore.put(TLRPC.TL_updateChatParticipantAdd.constructor, TLRPC.TL_updateChatParticipantAdd.class);
- classStore.put(TLRPC.TL_updateUserStatus.constructor, TLRPC.TL_updateUserStatus.class);
- classStore.put(TLRPC.TL_contacts_suggested.constructor, TLRPC.TL_contacts_suggested.class);
+ classStore.put(TLRPC.TL_msg_resend_req.constructor, TLRPC.TL_msg_resend_req.class);
classStore.put(TLRPC.TL_rpc_error.constructor, TLRPC.TL_rpc_error.class);
classStore.put(TLRPC.TL_rpc_req_error.constructor, TLRPC.TL_rpc_req_error.class);
- classStore.put(TLRPC.TL_inputEncryptedFile.constructor, TLRPC.TL_inputEncryptedFile.class);
- classStore.put(TLRPC.TL_inputEncryptedFileBigUploaded.constructor, TLRPC.TL_inputEncryptedFileBigUploaded.class);
- classStore.put(TLRPC.TL_inputEncryptedFileEmpty.constructor, TLRPC.TL_inputEncryptedFileEmpty.class);
- classStore.put(TLRPC.TL_inputEncryptedFileUploaded.constructor, TLRPC.TL_inputEncryptedFileUploaded.class);
- classStore.put(TLRPC.TL_decryptedMessageActionFlushHistory.constructor, TLRPC.TL_decryptedMessageActionFlushHistory.class);
- classStore.put(TLRPC.TL_decryptedMessageActionResend.constructor, TLRPC.TL_decryptedMessageActionResend.class);
- classStore.put(TLRPC.TL_decryptedMessageActionNotifyLayer.constructor, TLRPC.TL_decryptedMessageActionNotifyLayer.class);
- classStore.put(TLRPC.TL_decryptedMessageActionSetMessageTTL.constructor, TLRPC.TL_decryptedMessageActionSetMessageTTL.class);
- classStore.put(TLRPC.TL_decryptedMessageActionDeleteMessages.constructor, TLRPC.TL_decryptedMessageActionDeleteMessages.class);
- classStore.put(TLRPC.TL_decryptedMessageActionTyping.constructor, TLRPC.TL_decryptedMessageActionTyping.class);
- classStore.put(TLRPC.TL_decryptedMessageActionReadMessages.constructor, TLRPC.TL_decryptedMessageActionReadMessages.class);
- classStore.put(TLRPC.TL_decryptedMessageActionScreenshotMessages.constructor, TLRPC.TL_decryptedMessageActionScreenshotMessages.class);
- classStore.put(TLRPC.TL_server_DH_inner_data.constructor, TLRPC.TL_server_DH_inner_data.class);
+ classStore.put(TLRPC.TL_decryptedMessageService.constructor, TLRPC.TL_decryptedMessageService.class);
+ classStore.put(TLRPC.TL_decryptedMessage.constructor, TLRPC.TL_decryptedMessage.class);
+ classStore.put(TLRPC.TL_bad_msg_notification.constructor, TLRPC.TL_bad_msg_notification.class);
+ classStore.put(TLRPC.TL_bad_server_salt.constructor, TLRPC.TL_bad_server_salt.class);
classStore.put(TLRPC.TL_new_session_created.constructor, TLRPC.TL_new_session_created.class);
- classStore.put(TLRPC.TL_account_password.constructor, TLRPC.TL_account_password.class);
- classStore.put(TLRPC.TL_account_noPassword.constructor, TLRPC.TL_account_noPassword.class);
- classStore.put(TLRPC.TL_userProfilePhotoEmpty.constructor, TLRPC.TL_userProfilePhotoEmpty.class);
- classStore.put(TLRPC.TL_userProfilePhoto.constructor, TLRPC.TL_userProfilePhoto.class);
- classStore.put(TLRPC.TL_photo.constructor, TLRPC.TL_photo.class);
- classStore.put(TLRPC.TL_photoEmpty.constructor, TLRPC.TL_photoEmpty.class);
- classStore.put(TLRPC.TL_encryptedChatWaiting.constructor, TLRPC.TL_encryptedChatWaiting.class);
- classStore.put(TLRPC.TL_encryptedChatEmpty.constructor, TLRPC.TL_encryptedChatEmpty.class);
- classStore.put(TLRPC.TL_encryptedChatDiscarded.constructor, TLRPC.TL_encryptedChatDiscarded.class);
- classStore.put(TLRPC.TL_encryptedChat.constructor, TLRPC.TL_encryptedChat.class);
- classStore.put(TLRPC.TL_encryptedChatRequested.constructor, TLRPC.TL_encryptedChatRequested.class);
- classStore.put(TLRPC.TL_geochats_statedMessage.constructor, TLRPC.TL_geochats_statedMessage.class);
- classStore.put(TLRPC.TL_contact.constructor, TLRPC.TL_contact.class);
- classStore.put(TLRPC.TL_config.constructor, TLRPC.TL_config.class);
- classStore.put(TLRPC.TL_inputAudio.constructor, TLRPC.TL_inputAudio.class);
- classStore.put(TLRPC.TL_inputAudioEmpty.constructor, TLRPC.TL_inputAudioEmpty.class);
- classStore.put(TLRPC.TL_help_support.constructor, TLRPC.TL_help_support.class);
- classStore.put(TLRPC.TL_messages_chats.constructor, TLRPC.TL_messages_chats.class);
- classStore.put(TLRPC.TL_contacts_found.constructor, TLRPC.TL_contacts_found.class);
- classStore.put(TLRPC.TL_chatParticipants.constructor, TLRPC.TL_chatParticipants.class);
- classStore.put(TLRPC.TL_chatParticipantsForbidden.constructor, TLRPC.TL_chatParticipantsForbidden.class);
- classStore.put(TLRPC.TL_decryptedMessageMediaDocument.constructor, TLRPC.TL_decryptedMessageMediaDocument.class);
- classStore.put(TLRPC.TL_decryptedMessageMediaGeoPoint.constructor, TLRPC.TL_decryptedMessageMediaGeoPoint.class);
- classStore.put(TLRPC.TL_decryptedMessageMediaAudio.constructor, TLRPC.TL_decryptedMessageMediaAudio.class);
- classStore.put(TLRPC.TL_decryptedMessageMediaVideo.constructor, TLRPC.TL_decryptedMessageMediaVideo.class);
- classStore.put(TLRPC.TL_decryptedMessageMediaContact.constructor, TLRPC.TL_decryptedMessageMediaContact.class);
- classStore.put(TLRPC.TL_decryptedMessageMediaEmpty.constructor, TLRPC.TL_decryptedMessageMediaEmpty.class);
- classStore.put(TLRPC.TL_decryptedMessageMediaPhoto.constructor, TLRPC.TL_decryptedMessageMediaPhoto.class);
- classStore.put(TLRPC.TL_chatParticipant.constructor, TLRPC.TL_chatParticipant.class);
- classStore.put(TLRPC.TL_chatForbidden.constructor, TLRPC.TL_chatForbidden.class);
- classStore.put(TLRPC.TL_geoChat.constructor, TLRPC.TL_geoChat.class);
- classStore.put(TLRPC.TL_chatEmpty.constructor, TLRPC.TL_chatEmpty.class);
- classStore.put(TLRPC.TL_chat.constructor, TLRPC.TL_chat.class);
- classStore.put(TLRPC.TL_storage_fileUnknown.constructor, TLRPC.TL_storage_fileUnknown.class);
- classStore.put(TLRPC.TL_storage_fileMp4.constructor, TLRPC.TL_storage_fileMp4.class);
- classStore.put(TLRPC.TL_storage_fileWebp.constructor, TLRPC.TL_storage_fileWebp.class);
- classStore.put(TLRPC.TL_storage_filePng.constructor, TLRPC.TL_storage_filePng.class);
- classStore.put(TLRPC.TL_storage_fileGif.constructor, TLRPC.TL_storage_fileGif.class);
- classStore.put(TLRPC.TL_storage_filePdf.constructor, TLRPC.TL_storage_filePdf.class);
- classStore.put(TLRPC.TL_storage_fileMp3.constructor, TLRPC.TL_storage_fileMp3.class);
- classStore.put(TLRPC.TL_storage_fileJpeg.constructor, TLRPC.TL_storage_fileJpeg.class);
- classStore.put(TLRPC.TL_storage_fileMov.constructor, TLRPC.TL_storage_fileMov.class);
- classStore.put(TLRPC.TL_storage_filePartial.constructor, TLRPC.TL_storage_filePartial.class);
- classStore.put(TLRPC.TL_inputMessagesFilterVideo.constructor, TLRPC.TL_inputMessagesFilterVideo.class);
- classStore.put(TLRPC.TL_inputMessagesFilterEmpty.constructor, TLRPC.TL_inputMessagesFilterEmpty.class);
- classStore.put(TLRPC.TL_inputMessagesFilterPhotos.constructor, TLRPC.TL_inputMessagesFilterPhotos.class);
- classStore.put(TLRPC.TL_inputMessagesFilterPhotoVideo.constructor, TLRPC.TL_inputMessagesFilterPhotoVideo.class);
- classStore.put(TLRPC.TL_inputMessagesFilterDocument.constructor, TLRPC.TL_inputMessagesFilterDocument.class);
- classStore.put(TLRPC.TL_inputMessagesFilterAudio.constructor, TLRPC.TL_inputMessagesFilterAudio.class);
- classStore.put(TLRPC.TL_msgs_state_info.constructor, TLRPC.TL_msgs_state_info.class);
- classStore.put(TLRPC.TL_upload_file.constructor, TLRPC.TL_upload_file.class);
- classStore.put(TLRPC.TL_dialog.constructor, TLRPC.TL_dialog.class);
- classStore.put(TLRPC.TL_fileLocation.constructor, TLRPC.TL_fileLocation.class);
- classStore.put(TLRPC.TL_fileLocationUnavailable.constructor, TLRPC.TL_fileLocationUnavailable.class);
- classStore.put(TLRPC.TL_messages_messageEmpty.constructor, TLRPC.TL_messages_messageEmpty.class);
- classStore.put(TLRPC.TL_messages_message.constructor, TLRPC.TL_messages_message.class);
- classStore.put(TLRPC.TL_geochats_located.constructor, TLRPC.TL_geochats_located.class);
- classStore.put(TLRPC.TL_inputGeoChat.constructor, TLRPC.TL_inputGeoChat.class);
- classStore.put(TLRPC.TL_protoMessage.constructor, TLRPC.TL_protoMessage.class);
- classStore.put(TLRPC.TL_photoSize.constructor, TLRPC.TL_photoSize.class);
- classStore.put(TLRPC.TL_photoSizeEmpty.constructor, TLRPC.TL_photoSizeEmpty.class);
- classStore.put(TLRPC.TL_photoCachedSize.constructor, TLRPC.TL_photoCachedSize.class);
- classStore.put(TLRPC.TL_contactFound.constructor, TLRPC.TL_contactFound.class);
- classStore.put(TLRPC.TL_inputFileBig.constructor, TLRPC.TL_inputFileBig.class);
- classStore.put(TLRPC.TL_inputFile.constructor, TLRPC.TL_inputFile.class);
- classStore.put(TLRPC.TL_userFull.constructor, TLRPC.TL_userFull.class);
- classStore.put(TLRPC.TL_updates_state.constructor, TLRPC.TL_updates_state.class);
classStore.put(TLRPC.TL_resPQ.constructor, TLRPC.TL_resPQ.class);
+ classStore.put(TLRPC.TL_config.constructor, TLRPC.TL_config.class);
+ classStore.put(TLRPC.TL_msg_copy.constructor, TLRPC.TL_msg_copy.class);
+ classStore.put(TLRPC.TL_pong.constructor, TLRPC.TL_pong.class);
+ classStore.put(TLRPC.TL_rpc_answer_unknown.constructor, TLRPC.TL_rpc_answer_unknown.class);
+ classStore.put(TLRPC.TL_rpc_answer_dropped.constructor, TLRPC.TL_rpc_answer_dropped.class);
+ classStore.put(TLRPC.TL_rpc_answer_dropped_running.constructor, TLRPC.TL_rpc_answer_dropped_running.class);
+ classStore.put(TLRPC.TL_rpc_result.constructor, TLRPC.TL_rpc_result.class);
+ classStore.put(TLRPC.TL_auth_exportedAuthorization.constructor, TLRPC.TL_auth_exportedAuthorization.class);
+ classStore.put(TLRPC.TL_destroy_session_ok.constructor, TLRPC.TL_destroy_session_ok.class);
+ classStore.put(TLRPC.TL_destroy_session_none.constructor, TLRPC.TL_destroy_session_none.class);
+ classStore.put(TLRPC.TL_msgs_state_req.constructor, TLRPC.TL_msgs_state_req.class);
+ classStore.put(TLRPC.TL_server_DH_params_fail.constructor, TLRPC.TL_server_DH_params_fail.class);
+ classStore.put(TLRPC.TL_server_DH_params_ok.constructor, TLRPC.TL_server_DH_params_ok.class);
+ classStore.put(TLRPC.TL_protoMessage.constructor, TLRPC.TL_protoMessage.class);
+ classStore.put(TLRPC.TL_msgs_all_info.constructor, TLRPC.TL_msgs_all_info.class);
+ classStore.put(TLRPC.TL_p_q_inner_data.constructor, TLRPC.TL_p_q_inner_data.class);
classStore.put(TLRPC.TL_updateShortChatMessage.constructor, TLRPC.TL_updateShortChatMessage.class);
classStore.put(TLRPC.TL_updates.constructor, TLRPC.TL_updates.class);
classStore.put(TLRPC.TL_updateShortMessage.constructor, TLRPC.TL_updateShortMessage.class);
classStore.put(TLRPC.TL_updateShort.constructor, TLRPC.TL_updateShort.class);
classStore.put(TLRPC.TL_updatesCombined.constructor, TLRPC.TL_updatesCombined.class);
classStore.put(TLRPC.TL_updatesTooLong.constructor, TLRPC.TL_updatesTooLong.class);
- classStore.put(TLRPC.TL_wallPaper.constructor, TLRPC.TL_wallPaper.class);
- classStore.put(TLRPC.TL_wallPaperSolid.constructor, TLRPC.TL_wallPaperSolid.class);
- classStore.put(TLRPC.TL_msg_new_detailed_info.constructor, TLRPC.TL_msg_new_detailed_info.class);
- classStore.put(TLRPC.TL_msg_detailed_info.constructor, TLRPC.TL_msg_detailed_info.class);
- classStore.put(TLRPC.TL_inputEncryptedChat.constructor, TLRPC.TL_inputEncryptedChat.class);
- classStore.put(TLRPC.TL_inputChatPhoto.constructor, TLRPC.TL_inputChatPhoto.class);
- classStore.put(TLRPC.TL_inputChatPhotoEmpty.constructor, TLRPC.TL_inputChatPhotoEmpty.class);
- classStore.put(TLRPC.TL_inputChatUploadedPhoto.constructor, TLRPC.TL_inputChatUploadedPhoto.class);
- classStore.put(TLRPC.TL_inputVideoEmpty.constructor, TLRPC.TL_inputVideoEmpty.class);
- classStore.put(TLRPC.TL_inputVideo.constructor, TLRPC.TL_inputVideo.class);
- classStore.put(TLRPC.TL_nearestDc.constructor, TLRPC.TL_nearestDc.class);
- classStore.put(TLRPC.TL_inputPhotoEmpty.constructor, TLRPC.TL_inputPhotoEmpty.class);
- classStore.put(TLRPC.TL_inputPhoto.constructor, TLRPC.TL_inputPhoto.class);
- classStore.put(TLRPC.TL_importedContact.constructor, TLRPC.TL_importedContact.class);
- classStore.put(TLRPC.TL_accountDaysTTL.constructor, TLRPC.TL_accountDaysTTL.class);
- classStore.put(TLRPC.TL_stickerPack.constructor, TLRPC.TL_stickerPack.class);
- classStore.put(TLRPC.TL_messages_allStickers.constructor, TLRPC.TL_messages_allStickers.class);
- classStore.put(TLRPC.TL_messages_allStickersNotModified.constructor, TLRPC.TL_messages_allStickersNotModified.class);
- classStore.put(TLRPC.TL_inputPeerContact.constructor, TLRPC.TL_inputPeerContact.class);
- classStore.put(TLRPC.TL_inputPeerChat.constructor, TLRPC.TL_inputPeerChat.class);
- classStore.put(TLRPC.TL_inputPeerEmpty.constructor, TLRPC.TL_inputPeerEmpty.class);
- classStore.put(TLRPC.TL_inputPeerSelf.constructor, TLRPC.TL_inputPeerSelf.class);
- classStore.put(TLRPC.TL_inputPeerForeign.constructor, TLRPC.TL_inputPeerForeign.class);
- classStore.put(TLRPC.TL_dcOption.constructor, TLRPC.TL_dcOption.class);
+ classStore.put(TLRPC.TL_msgs_state_info.constructor, TLRPC.TL_msgs_state_info.class);
classStore.put(TLRPC.TL_decryptedMessageLayer.constructor, TLRPC.TL_decryptedMessageLayer.class);
- classStore.put(TLRPC.TL_inputPhotoCropAuto.constructor, TLRPC.TL_inputPhotoCropAuto.class);
- classStore.put(TLRPC.TL_inputPhotoCrop.constructor, TLRPC.TL_inputPhotoCrop.class);
- classStore.put(TLRPC.TL_messages_dialogs.constructor, TLRPC.TL_messages_dialogs.class);
- classStore.put(TLRPC.TL_messages_dialogsSlice.constructor, TLRPC.TL_messages_dialogsSlice.class);
- classStore.put(TLRPC.TL_account_sentChangePhoneCode.constructor, TLRPC.TL_account_sentChangePhoneCode.class);
- classStore.put(TLRPC.TL_updateUserPhone.constructor, TLRPC.TL_updateUserPhone.class);
- classStore.put(TLRPC.TL_decryptedMessageActionRequestKey.constructor, TLRPC.TL_decryptedMessageActionRequestKey.class);
- classStore.put(TLRPC.TL_decryptedMessageActionAcceptKey.constructor, TLRPC.TL_decryptedMessageActionAcceptKey.class);
- classStore.put(TLRPC.TL_decryptedMessageActionCommitKey.constructor, TLRPC.TL_decryptedMessageActionCommitKey.class);
- classStore.put(TLRPC.TL_decryptedMessageActionAbortKey.constructor, TLRPC.TL_decryptedMessageActionAbortKey.class);
- classStore.put(TLRPC.TL_decryptedMessageActionNoop.constructor, TLRPC.TL_decryptedMessageActionNoop.class);
- classStore.put(TLRPC.TL_decryptedMessageMediaExternalDocument.constructor, TLRPC.TL_decryptedMessageMediaExternalDocument.class);
- classStore.put(TLRPC.TL_updateReadHistoryInbox.constructor, TLRPC.TL_updateReadHistoryInbox.class);
- classStore.put(TLRPC.TL_updateReadHistoryOutbox.constructor, TLRPC.TL_updateReadHistoryOutbox.class);
- classStore.put(TLRPC.TL_contactLinkUnknown.constructor, TLRPC.TL_contactLinkUnknown.class);
- classStore.put(TLRPC.TL_contactLinkNone.constructor, TLRPC.TL_contactLinkNone.class);
- classStore.put(TLRPC.TL_contactLinkHasPhone.constructor, TLRPC.TL_contactLinkHasPhone.class);
- classStore.put(TLRPC.TL_contactLinkContact.constructor, TLRPC.TL_contactLinkContact.class);
- classStore.put(TLRPC.TL_messages_affectedMessages.constructor, TLRPC.TL_messages_affectedMessages.class);
- classStore.put(TLRPC.TL_updateWebPage.constructor, TLRPC.TL_updateWebPage.class);
- classStore.put(TLRPC.TL_webPagePending.constructor, TLRPC.TL_webPagePending.class);
- classStore.put(TLRPC.TL_webPageEmpty.constructor, TLRPC.TL_webPageEmpty.class);
- classStore.put(TLRPC.TL_webPage.constructor, TLRPC.TL_webPage.class);
- classStore.put(TLRPC.TL_messageMediaWebPage.constructor, TLRPC.TL_messageMediaWebPage.class);
- classStore.put(TLRPC.TL_authorization.constructor, TLRPC.TL_authorization.class);
- classStore.put(TLRPC.TL_account_authorizations.constructor, TLRPC.TL_account_authorizations.class);
- classStore.put(TLRPC.TL_account_passwordSettings.constructor, TLRPC.TL_account_passwordSettings.class);
- classStore.put(TLRPC.TL_account_passwordInputSettings.constructor, TLRPC.TL_account_passwordInputSettings.class);
- classStore.put(TLRPC.TL_auth_passwordRecovery.constructor, TLRPC.TL_auth_passwordRecovery.class);
- classStore.put(TLRPC.TL_messages_getWebPagePreview.constructor, TLRPC.TL_messages_getWebPagePreview.class);
-
- classStore.put(TLRPC.TL_messageMediaUnsupported_old.constructor, TLRPC.TL_messageMediaUnsupported_old.class);
- classStore.put(TLRPC.TL_userSelf_old2.constructor, TLRPC.TL_userSelf_old2.class);
- classStore.put(TLRPC.TL_msg_container.constructor, TLRPC.TL_msg_container.class);
- classStore.put(TLRPC.TL_fileEncryptedLocation.constructor, TLRPC.TL_fileEncryptedLocation.class);
- classStore.put(TLRPC.TL_messageActionTTLChange.constructor, TLRPC.TL_messageActionTTLChange.class);
- classStore.put(TLRPC.TL_videoEncrypted.constructor, TLRPC.TL_videoEncrypted.class);
- classStore.put(TLRPC.TL_documentEncrypted.constructor, TLRPC.TL_documentEncrypted.class);
- classStore.put(TLRPC.TL_audioEncrypted.constructor, TLRPC.TL_audioEncrypted.class);
+ classStore.put(TLRPC.TL_http_wait.constructor, TLRPC.TL_http_wait.class);
classStore.put(TLRPC.TL_gzip_packed.constructor, TLRPC.TL_gzip_packed.class);
- classStore.put(TLRPC.Vector.constructor, TLRPC.Vector.class);
- classStore.put(TLRPC.TL_userProfilePhotoOld.constructor, TLRPC.TL_userProfilePhotoOld.class);
- classStore.put(TLRPC.TL_messageActionUserUpdatedPhoto.constructor, TLRPC.TL_messageActionUserUpdatedPhoto.class);
- classStore.put(TLRPC.TL_messageActionUserJoined.constructor, TLRPC.TL_messageActionUserJoined.class);
- classStore.put(TLRPC.TL_messageActionLoginUnknownLocation.constructor, TLRPC.TL_messageActionLoginUnknownLocation.class);
- classStore.put(TLRPC.TL_encryptedChat_old.constructor, TLRPC.TL_encryptedChat_old.class);
- classStore.put(TLRPC.TL_encryptedChatRequested_old.constructor, TLRPC.TL_encryptedChatRequested_old.class);
- classStore.put(TLRPC.TL_decryptedMessageMediaVideo_old.constructor, TLRPC.TL_decryptedMessageMediaVideo_old.class);
- classStore.put(TLRPC.TL_decryptedMessageMediaAudio_old.constructor, TLRPC.TL_decryptedMessageMediaAudio_old.class);
- classStore.put(TLRPC.TL_audio_old.constructor, TLRPC.TL_audio_old.class);
- classStore.put(TLRPC.TL_video_old.constructor, TLRPC.TL_video_old.class);
- classStore.put(TLRPC.TL_messageActionCreatedBroadcastList.constructor, TLRPC.TL_messageActionCreatedBroadcastList.class);
- classStore.put(TLRPC.TL_messageForwarded_old.constructor, TLRPC.TL_messageForwarded_old.class);
- classStore.put(TLRPC.TL_message_old.constructor, TLRPC.TL_message_old.class);
- classStore.put(TLRPC.TL_messageService_old.constructor, TLRPC.TL_messageService_old.class);
classStore.put(TLRPC.TL_decryptedMessageService_old.constructor, TLRPC.TL_decryptedMessageService_old.class);
classStore.put(TLRPC.TL_decryptedMessage_old.constructor, TLRPC.TL_decryptedMessage_old.class);
classStore.put(TLRPC.TL_message_secret.constructor, TLRPC.TL_message_secret.class);
- classStore.put(TLRPC.TL_userSelf_old.constructor, TLRPC.TL_userSelf_old.class);
- classStore.put(TLRPC.TL_userContact_old.constructor, TLRPC.TL_userContact_old.class);
- classStore.put(TLRPC.TL_userRequest_old.constructor, TLRPC.TL_userRequest_old.class);
- classStore.put(TLRPC.TL_userForeign_old.constructor, TLRPC.TL_userForeign_old.class);
- classStore.put(TLRPC.TL_userDeleted_old.constructor, TLRPC.TL_userDeleted_old.class);
classStore.put(TLRPC.TL_messageEncryptedAction.constructor, TLRPC.TL_messageEncryptedAction.class);
classStore.put(TLRPC.TL_decryptedMessageHolder.constructor, TLRPC.TL_decryptedMessageHolder.class);
+ classStore.put(TLRPC.TL_client_DH_inner_data.constructor, TLRPC.TL_client_DH_inner_data.class);
+ classStore.put(TLRPC.TL_null.constructor, TLRPC.TL_null.class);
+ classStore.put(TLRPC.TL_destroy_sessions_res.constructor, TLRPC.TL_destroy_sessions_res.class);
+ classStore.put(TLRPC.TL_msg_container.constructor, TLRPC.TL_msg_container.class);
+
+
+ classStore.put(TLRPC.TL_video.constructor, TLRPC.TL_video.class);
+ classStore.put(TLRPC.TL_videoEmpty.constructor, TLRPC.TL_videoEmpty.class);
+ classStore.put(TLRPC.TL_video_old2.constructor, TLRPC.TL_video_old2.class);
+ classStore.put(TLRPC.TL_video_old.constructor, TLRPC.TL_video_old.class);
+ classStore.put(TLRPC.TL_videoEncrypted.constructor, TLRPC.TL_videoEncrypted.class);
+
+ classStore.put(TLRPC.TL_audio.constructor, TLRPC.TL_audio.class);
+ classStore.put(TLRPC.TL_audioEncrypted.constructor, TLRPC.TL_audioEncrypted.class);
+ classStore.put(TLRPC.TL_audioEmpty.constructor, TLRPC.TL_audioEmpty.class);
+ classStore.put(TLRPC.TL_audio_old.constructor, TLRPC.TL_audio_old.class);
+
+ classStore.put(TLRPC.TL_document.constructor, TLRPC.TL_document.class);
+ classStore.put(TLRPC.TL_documentEmpty.constructor, TLRPC.TL_documentEmpty.class);
classStore.put(TLRPC.TL_documentEncrypted_old.constructor, TLRPC.TL_documentEncrypted_old.class);
+ classStore.put(TLRPC.TL_documentEncrypted.constructor, TLRPC.TL_documentEncrypted.class);
classStore.put(TLRPC.TL_document_old.constructor, TLRPC.TL_document_old.class);
- classStore.put(TLRPC.TL_config_old.constructor, TLRPC.TL_config_old.class);
- classStore.put(TLRPC.TL_messageForwarded_old2.constructor, TLRPC.TL_messageForwarded_old2.class);
- classStore.put(TLRPC.TL_message_old2.constructor, TLRPC.TL_message_old2.class);
- classStore.put(TLRPC.TL_documentAttributeSticker_old.constructor, TLRPC.TL_documentAttributeSticker_old.class);
+
+ classStore.put(TLRPC.TL_photo.constructor, TLRPC.TL_photo.class);
+ classStore.put(TLRPC.TL_photoEmpty.constructor, TLRPC.TL_photoEmpty.class);
+ classStore.put(TLRPC.TL_photoSize.constructor, TLRPC.TL_photoSize.class);
+ classStore.put(TLRPC.TL_photoSizeEmpty.constructor, TLRPC.TL_photoSizeEmpty.class);
+ classStore.put(TLRPC.TL_photoCachedSize.constructor, TLRPC.TL_photoCachedSize.class);
+ classStore.put(TLRPC.TL_photo_old.constructor, TLRPC.TL_photo_old.class);
}
static TLClassStore store = null;
@@ -436,46 +107,27 @@ public class TLClassStore {
return store;
}
- public TLObject TLdeserialize(AbsSerializedData stream, int constructor) {
+ public TLObject TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
try {
- return TLdeserialize(stream, constructor, null);
+ return TLdeserialize(stream, constructor, null, exception);
} catch (Exception e) {
return null;
}
}
- public TLObject TLdeserialize(AbsSerializedData stream, int constructor, TLObject request) {
+ public TLObject TLdeserialize(AbsSerializedData stream, int constructor, TLObject request, boolean exception) {
Class objClass = classStore.get(constructor);
if (objClass != null) {
try {
TLObject response = (TLObject)objClass.newInstance();
- if (response instanceof TLRPC.Vector) {
- if (request != null) {
- request.parseVector((TLRPC.Vector)response, stream);
- } else {
- int size = stream.readInt32();
- for (int a = 0; a < size; a++) {
- ((TLRPC.Vector)response).objects.add(stream.readInt32());
- }
- }
- } else {
- response.readParams(stream);
- }
+ response.readParams(stream, exception);
return response;
- } catch (IllegalAccessException e) {
- FileLog.e("tmessages", "can't create class");
- return null;
- } catch (InstantiationException e2) {
+ } catch (Throwable e) {
FileLog.e("tmessages", "can't create class");
return null;
}
} else {
- FileLog.e("tmessages", String.format("unknown class %x", constructor));
- if (BuildVars.DEBUG_VERSION) {
- throw new RuntimeException(String.format("unknown class %x", constructor));
- } else {
- return null;
- }
+ return null;
}
}
}
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/TLObject.java b/TMessagesProj/src/main/java/org/telegram/messenger/TLObject.java
index 8ee8bc00..17c49307 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/TLObject.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/TLObject.java
@@ -11,15 +11,15 @@ package org.telegram.messenger;
public class TLObject {
public boolean disableFree = false;
- public TLObject () {
+ public TLObject() {
}
- public void readParams(AbsSerializedData stream) {
+ public void readParams(AbsSerializedData stream, boolean exception) {
}
- public byte[] serialize () {
+ public byte[] serialize() {
return null;
}
@@ -27,16 +27,12 @@ public class TLObject {
}
- public Class extends TLObject> responseClass () {
- return this.getClass();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return null;
}
- public int layer () {
- return 11;
- }
-
- public void parseVector(TLRPC.Vector vector, AbsSerializedData data) {
-
+ public int layer() {
+ return 11;
}
public void freeResources() {
diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java b/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java
index ce412857..cd093459 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java
@@ -19,2100 +19,37 @@ public class TLRPC {
public static final int MESSAGE_FLAG_FWD = 4;
public static final int MESSAGE_FLAG_REPLY = 8;
public static final int MESSAGE_FLAG_MENTION = 16;
- public static final int LAYER = 27;
+ public static final int MESSAGE_FLAG_CONTENT_UNREAD = 32;
+ public static final int LAYER = 28;
- public static class ChatPhoto extends TLObject {
- public FileLocation photo_small;
- public FileLocation photo_big;
- }
+ public static class TL_inputEncryptedChat extends TLObject {
+ public static int constructor = 0xf141b5e1;
- public static class TL_chatPhotoEmpty extends ChatPhoto {
- public static int constructor = 0x37c1011c;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_chatPhoto extends ChatPhoto {
- public static int constructor = 0x6153276a;
-
-
- public void readParams(AbsSerializedData stream) {
- photo_small = (FileLocation)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- photo_big = (FileLocation)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- photo_small.serializeToStream(stream);
- photo_big.serializeToStream(stream);
- }
- }
-
- public static class BadMsgNotification extends TLObject {
- public long bad_msg_id;
- public int bad_msg_seqno;
- public int error_code;
- public long new_server_salt;
- }
-
- public static class TL_bad_msg_notification extends BadMsgNotification {
- public static int constructor = 0xa7eff811;
-
-
- public void readParams(AbsSerializedData stream) {
- bad_msg_id = stream.readInt64();
- bad_msg_seqno = stream.readInt32();
- error_code = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(bad_msg_id);
- stream.writeInt32(bad_msg_seqno);
- stream.writeInt32(error_code);
- }
- }
-
- public static class TL_bad_server_salt extends BadMsgNotification {
- public static int constructor = 0xedab447b;
-
-
- public void readParams(AbsSerializedData stream) {
- bad_msg_id = stream.readInt64();
- bad_msg_seqno = stream.readInt32();
- error_code = stream.readInt32();
- new_server_salt = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(bad_msg_id);
- stream.writeInt32(bad_msg_seqno);
- stream.writeInt32(error_code);
- stream.writeInt64(new_server_salt);
- }
- }
-
- public static class TL_error extends TLObject {
- public static int constructor = 0xc4b9f9bb;
-
- public int code;
- public String text;
-
- public void readParams(AbsSerializedData stream) {
- code = stream.readInt32();
- text = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(code);
- stream.writeString(text);
- }
- }
-
- public static class messages_SentEncryptedMessage extends TLObject {
- public int date;
- public EncryptedFile file;
- }
-
- public static class TL_messages_sentEncryptedMessage extends messages_SentEncryptedMessage {
- public static int constructor = 0x560f8935;
-
-
- public void readParams(AbsSerializedData stream) {
- date = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(date);
- }
- }
-
- public static class TL_messages_sentEncryptedFile extends messages_SentEncryptedMessage {
- public static int constructor = 0x9493ff32;
-
-
- public void readParams(AbsSerializedData stream) {
- date = stream.readInt32();
- file = (EncryptedFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(date);
- file.serializeToStream(stream);
- }
- }
-
- public static class NotifyPeer extends TLObject {
- public Peer peer;
- }
-
- public static class TL_notifyAll extends NotifyPeer {
- public static int constructor = 0x74d07c60;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_notifyChats extends NotifyPeer {
- public static int constructor = 0xc007cec3;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_notifyUsers extends NotifyPeer {
- public static int constructor = 0xb4c83b4c;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_notifyPeer extends NotifyPeer {
- public static int constructor = 0x9fd40bd8;
-
-
- public void readParams(AbsSerializedData stream) {
- peer = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- peer.serializeToStream(stream);
- }
- }
-
- public static class TL_auth_checkedPhone extends TLObject {
- public static int constructor = 0x811ea28e;
-
- public boolean phone_registered;
-
- public void readParams(AbsSerializedData stream) {
- phone_registered = stream.readBool();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeBool(phone_registered);
- }
- }
-
- public static class TL_msgs_ack extends TLObject {
- public static int constructor = 0x62d6b459;
-
- public ArrayList msg_ids = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- msg_ids.add(stream.readInt64());
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = msg_ids.size();
- stream.writeInt32(count);
- for (Long msg_id : msg_ids) {
- stream.writeInt64(msg_id);
- }
- }
- }
-
- public static class TL_messages_chatFull extends TLObject {
- public static int constructor = 0xe5d7d19c;
-
- public TL_chatFull full_chat;
- public ArrayList chats = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- full_chat = (TL_chatFull)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData 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 = 0xb7b72ab3;
-
- public String email;
-
- public void readParams(AbsSerializedData stream) {
- email = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(email);
- }
- }
-
- public static class DocumentAttribute extends TLObject {
- public int duration;
- public String file_name;
- public String alt;
- public int w;
- public int h;
- }
-
- public static class TL_documentAttributeAnimated extends DocumentAttribute {
- public static int constructor = 0x11b58939;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_documentAttributeAudio extends DocumentAttribute {
- public static int constructor = 0x51448e5;
-
-
- public void readParams(AbsSerializedData stream) {
- duration = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(duration);
- }
- }
-
- public static class TL_documentAttributeFilename extends DocumentAttribute {
- public static int constructor = 0x15590068;
-
-
- public void readParams(AbsSerializedData stream) {
- file_name = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(file_name);
- }
- }
-
- public static class TL_documentAttributeVideo extends DocumentAttribute {
- public static int constructor = 0x5910cccb;
-
-
- public void readParams(AbsSerializedData stream) {
- duration = stream.readInt32();
- w = stream.readInt32();
- h = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(duration);
- stream.writeInt32(w);
- stream.writeInt32(h);
- }
- }
-
- public static class TL_documentAttributeSticker extends DocumentAttribute {
- public static int constructor = 0x994c9882;
-
-
- public void readParams(AbsSerializedData stream) {
- alt = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(alt);
- }
- }
-
- public static class TL_documentAttributeImageSize extends DocumentAttribute {
- public static int constructor = 0x6c37c15c;
-
-
- public void readParams(AbsSerializedData stream) {
- w = stream.readInt32();
- h = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(w);
- stream.writeInt32(h);
- }
- }
-
- public static class TL_contactStatus extends TLObject {
- public static int constructor = 0xd3680c61;
-
- public int user_id;
- public UserStatus status;
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- status.serializeToStream(stream);
- }
- }
-
- public static class TL_auth_authorization extends TLObject {
- public static int constructor = 0xf6b673a4;
-
- public int expires;
- public User user;
-
- public void readParams(AbsSerializedData stream) {
- expires = stream.readInt32();
- user = (User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(expires);
- user.serializeToStream(stream);
- }
- }
-
- public static class messages_Messages extends TLObject {
- public ArrayList messages = new ArrayList<>();
- public ArrayList chats = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
- public int count;
- }
-
- public static class TL_messages_messages extends messages_Messages {
- public static int constructor = 0x8c718e87;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- messages.add((Message)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int 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);
- }
- }
- }
-
- public static class TL_messages_messagesSlice extends messages_Messages {
- public static int constructor = 0xb446ae3;
-
-
- public void readParams(AbsSerializedData stream) {
- count = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- messages.add((Message)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(count);
- stream.writeInt32(0x1cb5c415);
- int 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);
- }
- }
- }
-
- public static class RpcDropAnswer extends TLObject {
- public long msg_id;
- public int seq_no;
- public int bytes;
- }
-
- public static class TL_rpc_answer_unknown extends RpcDropAnswer {
- public static int constructor = 0x5e2ad36e;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_rpc_answer_dropped extends RpcDropAnswer {
- public static int constructor = 0xa43ad8b7;
-
-
- public void readParams(AbsSerializedData stream) {
- msg_id = stream.readInt64();
- seq_no = stream.readInt32();
- bytes = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(msg_id);
- stream.writeInt32(seq_no);
- stream.writeInt32(bytes);
- }
- }
-
- public static class TL_rpc_answer_dropped_running extends RpcDropAnswer {
- public static int constructor = 0xcd78e586;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_contacts_link extends TLObject {
- public static int constructor = 0x3ace484c;
-
- public ContactLink my_link;
- public ContactLink foreign_link;
- public User user;
-
- public void readParams(AbsSerializedData stream) {
- my_link = (ContactLink)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- foreign_link = (ContactLink)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- user = (User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- my_link.serializeToStream(stream);
- foreign_link.serializeToStream(stream);
- user.serializeToStream(stream);
- }
- }
-
- public static class Peer extends TLObject {
- public int user_id;
public int chat_id;
- }
+ public long access_hash;
- public static class TL_peerUser extends Peer {
- public static int constructor = 0x9db1bc6d;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
+ public static TL_inputEncryptedChat TLdeserialize(AbsSerializedData 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 serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- }
- }
-
- public static class TL_peerChat extends Peer {
- public static int constructor = 0xbad0e5bb;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ access_hash = stream.readInt64(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(chat_id);
- }
- }
-
- public static class EncryptedFile extends TLObject {
- public long id;
- public long access_hash;
- public int size;
- public int dc_id;
- public int key_fingerprint;
- }
-
- public static class TL_encryptedFile extends EncryptedFile {
- public static int constructor = 0x4a70994c;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- size = stream.readInt32();
- dc_id = stream.readInt32();
- key_fingerprint = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData 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 void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_messages_affectedMessages extends TLObject {
- public static int constructor = 0x84d19185;
-
- public int pts;
- public int pts_count;
-
- public void readParams(AbsSerializedData stream) {
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(pts);
- stream.writeInt32(pts_count);
- }
- }
-
- public static class TL_authorization extends TLObject {
- public static int constructor = 0x7bf2e6f6;
-
- public long hash;
- public int flags;
- public String device_model;
- public String platform;
- public String system_version;
- public int api_id;
- public String app_name;
- public String app_version;
- public int date_created;
- public int date_active;
- public String ip;
- public String country;
- public String region;
-
- public void readParams(AbsSerializedData stream) {
- hash = stream.readInt64();
- flags = stream.readInt32();
- device_model = stream.readString();
- platform = stream.readString();
- system_version = stream.readString();
- api_id = stream.readInt32();
- app_name = stream.readString();
- app_version = stream.readString();
- date_created = stream.readInt32();
- date_active = stream.readInt32();
- ip = stream.readString();
- country = stream.readString();
- region = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(hash);
- stream.writeInt32(flags);
- stream.writeString(device_model);
- stream.writeString(platform);
- stream.writeString(system_version);
- stream.writeInt32(api_id);
- stream.writeString(app_name);
- stream.writeString(app_version);
- stream.writeInt32(date_created);
- stream.writeInt32(date_active);
- stream.writeString(ip);
- stream.writeString(country);
- stream.writeString(region);
- }
- }
-
- public static class DestroySessionRes extends TLObject {
- public long session_id;
- }
-
- public static class TL_destroy_session_ok extends DestroySessionRes {
- public static int constructor = 0xe22045fc;
-
-
- public void readParams(AbsSerializedData stream) {
- session_id = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(session_id);
- }
- }
-
- public static class TL_destroy_session_none extends DestroySessionRes {
- public static int constructor = 0x62d350c9;
-
-
- public void readParams(AbsSerializedData stream) {
- session_id = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(session_id);
- }
- }
-
- public static class updates_Difference extends TLObject {
- public int date;
- public int seq;
- 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 intermediate_state;
- public TL_updates_state state;
- }
-
- public static class TL_updates_differenceEmpty extends updates_Difference {
- public static int constructor = 0x5d75a138;
-
-
- public void readParams(AbsSerializedData stream) {
- date = stream.readInt32();
- seq = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(date);
- stream.writeInt32(seq);
- }
- }
-
- public static class TL_updates_differenceSlice extends updates_Difference {
- public static int constructor = 0xa8fb1981;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- new_messages.add((Message)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- new_encrypted_messages.add((EncryptedMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- other_updates.add((Update)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- intermediate_state = (TL_updates_state)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData 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_difference extends updates_Difference {
- public static int constructor = 0xf49ca0;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- new_messages.add((Message)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- new_encrypted_messages.add((EncryptedMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- other_updates.add((Update)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- state = (TL_updates_state)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData 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 GeoPoint extends TLObject {
- public double _long;
- public double lat;
- }
-
- public static class TL_geoPointEmpty extends GeoPoint {
- public static int constructor = 0x1117dd5f;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_geoPoint extends GeoPoint {
- public static int constructor = 0x2049d70c;
-
-
- public void readParams(AbsSerializedData stream) {
- _long = stream.readDouble();
- lat = stream.readDouble();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeDouble(_long);
- stream.writeDouble(lat);
- }
- }
-
- public static class TL_privacyKeyStatusTimestamp extends TLObject {
- public static int constructor = 0xbc2eab30;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_account_privacyRules extends TLObject {
- public static int constructor = 0x554abb6f;
-
- public ArrayList rules = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- rules.add((PrivacyRule)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = rules.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- rules.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 help_AppUpdate extends TLObject {
- public int id;
- public boolean critical;
- public String url;
- public String text;
- }
-
- public static class TL_help_appUpdate extends help_AppUpdate {
- public static int constructor = 0x8987f311;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- critical = stream.readBool();
- url = stream.readString();
- text = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeBool(critical);
- stream.writeString(url);
- stream.writeString(text);
- }
- }
-
- public static class TL_help_noAppUpdate extends help_AppUpdate {
- public static int constructor = 0xc45a6536;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_messageEmpty extends Message {
- public static int constructor = 0x83e5de54;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- }
- }
-
- 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 void readParams(AbsSerializedData stream) {
- client_id = stream.readInt64();
- phone = stream.readString();
- first_name = stream.readString();
- last_name = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(client_id);
- stream.writeString(phone);
- stream.writeString(first_name);
- stream.writeString(last_name);
- }
- }
-
- public static class SendMessageAction extends TLObject {
- }
-
- public static class TL_sendMessageGeoLocationAction extends SendMessageAction {
- public static int constructor = 0x176f8ba1;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_sendMessageChooseContactAction extends SendMessageAction {
- public static int constructor = 0x628cbc6f;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_sendMessageTypingAction extends SendMessageAction {
- public static int constructor = 0x16bf744e;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_sendMessageUploadDocumentAction extends SendMessageAction {
- public static int constructor = 0x8faee98e;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_sendMessageRecordVideoAction extends SendMessageAction {
- public static int constructor = 0xa187d66f;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_sendMessageUploadPhotoAction extends SendMessageAction {
- public static int constructor = 0x990a3c1a;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_sendMessageUploadVideoAction extends SendMessageAction {
- public static int constructor = 0x92042ff7;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_sendMessageUploadAudioAction extends SendMessageAction {
- public static int constructor = 0xe6ac8a6f;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_sendMessageCancelAction extends SendMessageAction {
- public static int constructor = 0xfd5ec8f5;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_sendMessageRecordAudioAction extends SendMessageAction {
- public static int constructor = 0xd52f73f7;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_invokeAfterMsg extends TLObject {
- public static int constructor = 0xcb9f372d;
-
- public long msg_id;
- public TLObject query;
-
- public void readParams(AbsSerializedData stream) {
- msg_id = stream.readInt64();
- query = TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(msg_id);
- query.serializeToStream(stream);
- }
- }
-
- public static class MessageMedia extends TLObject {
- public Video video;
- public Photo photo;
- public WebPage webpage;
- public Document document;
- public GeoPoint geo;
- public Audio audio;
- public String phone_number;
- public String first_name;
- public String last_name;
- public int user_id;
- public byte[] bytes;
- }
-
- public static class TL_messageMediaVideo extends MessageMedia {
- public static int constructor = 0xa2d24290;
-
-
- public void readParams(AbsSerializedData stream) {
- video = (Video)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- video.serializeToStream(stream);
- }
- }
-
- public static class TL_messageMediaPhoto extends MessageMedia {
- public static int constructor = 0xc8c45a2a;
-
-
- public void readParams(AbsSerializedData stream) {
- photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- photo.serializeToStream(stream);
- }
- }
-
- public static class TL_messageMediaWebPage extends MessageMedia {
- public static int constructor = 0xa32dd600;
-
-
- public void readParams(AbsSerializedData stream) {
- webpage = (WebPage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- webpage.serializeToStream(stream);
- }
- }
-
- public static class TL_messageMediaDocument extends MessageMedia {
- public static int constructor = 0x2fda2204;
-
-
- public void readParams(AbsSerializedData stream) {
- document = (Document)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- document.serializeToStream(stream);
- }
- }
-
- public static class TL_messageMediaGeo extends MessageMedia {
- public static int constructor = 0x56e0d474;
-
-
- public void readParams(AbsSerializedData stream) {
- geo = (GeoPoint)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- geo.serializeToStream(stream);
- }
- }
-
- public static class TL_messageMediaEmpty extends MessageMedia {
- public static int constructor = 0x3ded6320;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_messageMediaAudio extends MessageMedia {
- public static int constructor = 0xc6b68300;
-
-
- public void readParams(AbsSerializedData stream) {
- audio = (Audio)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- audio.serializeToStream(stream);
- }
- }
-
- public static class TL_messageMediaContact extends MessageMedia {
- public static int constructor = 0x5e7d2f39;
-
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- first_name = stream.readString();
- last_name = stream.readString();
- user_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(phone_number);
- stream.writeString(first_name);
- stream.writeString(last_name);
- stream.writeInt32(user_id);
- }
- }
-
- public static class TL_messageMediaUnsupported extends MessageMedia {
- public static int constructor = 0x9f84f49e;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class auth_SentCode extends TLObject {
- public boolean phone_registered;
- public String phone_code_hash;
- public int send_call_timeout;
- public boolean is_password;
- }
-
- public static class TL_auth_sentAppCode extends auth_SentCode {
- public static int constructor = 0xe325edcf;
-
-
- public void readParams(AbsSerializedData stream) {
- phone_registered = stream.readBool();
- phone_code_hash = stream.readString();
- send_call_timeout = stream.readInt32();
- is_password = stream.readBool();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeBool(phone_registered);
- stream.writeString(phone_code_hash);
- stream.writeInt32(send_call_timeout);
- stream.writeBool(is_password);
- }
- }
-
- public static class TL_auth_sentCode extends auth_SentCode {
- public static int constructor = 0xefed51d9;
-
-
- public void readParams(AbsSerializedData stream) {
- phone_registered = stream.readBool();
- phone_code_hash = stream.readString();
- send_call_timeout = stream.readInt32();
- is_password = stream.readBool();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeBool(phone_registered);
- stream.writeString(phone_code_hash);
- stream.writeInt32(send_call_timeout);
- stream.writeBool(is_password);
- }
- }
-
- public static class PeerNotifySettings extends TLObject {
- public int mute_until;
- public String sound;
- public boolean show_previews;
- public int events_mask;
- }
-
- public static class TL_peerNotifySettingsEmpty extends PeerNotifySettings {
- public static int constructor = 0x70a68512;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_peerNotifySettings extends PeerNotifySettings {
- public static int constructor = 0x8d5e11ee;
-
-
- public void readParams(AbsSerializedData stream) {
- mute_until = stream.readInt32();
- sound = stream.readString();
- show_previews = stream.readBool();
- events_mask = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(mute_until);
- stream.writeString(sound);
- stream.writeBool(show_previews);
- stream.writeInt32(events_mask);
- }
- }
-
- public static class TL_msg_resend_req extends TLObject {
- public static int constructor = 0x7d861a08;
-
- public ArrayList msg_ids = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- msg_ids.add(stream.readInt64());
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = msg_ids.size();
- stream.writeInt32(count);
- for (Long msg_id : msg_ids) {
- stream.writeInt64(msg_id);
- }
- }
- }
-
- public static class TL_http_wait extends TLObject {
- public static int constructor = 0x9299359f;
-
- public int max_delay;
- public int wait_after;
- public int max_wait;
-
- public void readParams(AbsSerializedData stream) {
- max_delay = stream.readInt32();
- wait_after = stream.readInt32();
- max_wait = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(max_delay);
- stream.writeInt32(wait_after);
- stream.writeInt32(max_wait);
- }
- }
-
- public static class contacts_Blocked extends TLObject {
- public ArrayList blocked = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
- public int count;
- }
-
- public static class TL_contacts_blocked extends contacts_Blocked {
- public static int constructor = 0x1c138d15;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- blocked.add((TL_contactBlocked)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = blocked.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- blocked.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_blockedSlice extends contacts_Blocked {
- public static int constructor = 0x900802a1;
-
-
- public void readParams(AbsSerializedData stream) {
- count = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- blocked.add((TL_contactBlocked)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(count);
- stream.writeInt32(0x1cb5c415);
- int count = blocked.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- blocked.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 InputGeoPoint extends TLObject {
- public double lat;
- public double _long;
- }
-
- public static class TL_inputGeoPoint extends InputGeoPoint {
- public static int constructor = 0xf3b7acc9;
-
-
- public void readParams(AbsSerializedData stream) {
- lat = stream.readDouble();
- _long = stream.readDouble();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeDouble(lat);
- stream.writeDouble(_long);
- }
- }
-
- public static class TL_inputGeoPointEmpty extends InputGeoPoint {
- public static int constructor = 0xe4c123d6;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_help_inviteText extends TLObject {
- public static int constructor = 0x18cb9f78;
-
- public String message;
-
- public void readParams(AbsSerializedData stream) {
- message = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(message);
- }
- }
-
- public static class messages_DhConfig extends TLObject {
- public byte[] random;
- public int g;
- public byte[] p;
- public int version;
- }
-
- public static class TL_messages_dhConfigNotModified extends messages_DhConfig {
- public static int constructor = 0xc0e24635;
-
-
- public void readParams(AbsSerializedData stream) {
- random = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeByteArray(random);
- }
- }
-
- public static class TL_messages_dhConfig extends messages_DhConfig {
- public static int constructor = 0x2c221edd;
-
-
- public void readParams(AbsSerializedData stream) {
- g = stream.readInt32();
- p = stream.readByteArray();
- version = stream.readInt32();
- random = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(g);
- stream.writeByteArray(p);
- stream.writeInt32(version);
- stream.writeByteArray(random);
- }
- }
-
- public static class TL_audioEmpty extends Audio {
- public static int constructor = 0x586988d8;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- }
- }
-
- public static class TL_audio extends Audio {
- public static int constructor = 0xc7ac6496;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- user_id = stream.readInt32();
- date = stream.readInt32();
- duration = stream.readInt32();
- mime_type = stream.readString();
- size = stream.readInt32();
- dc_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- stream.writeInt32(user_id);
- stream.writeInt32(date);
- stream.writeInt32(duration);
- stream.writeString(mime_type);
- stream.writeInt32(size);
- stream.writeInt32(dc_id);
- }
- }
-
- public static class TL_destroy_sessions_res extends TLObject {
- public static int constructor = 0xfb95abcd;
-
- public ArrayList destroy_results = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- destroy_results.add((DestroySessionRes)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- int count = destroy_results.size();
- stream.writeInt32(count);
- for (DestroySessionRes destroy_result : destroy_results) {
- destroy_result.serializeToStream(stream);
- }
- }
- }
-
- public static class PrivacyRule extends TLObject {
- public ArrayList users = new ArrayList<>();
- }
-
- public static class TL_privacyValueAllowUsers extends PrivacyRule {
- public static int constructor = 0x4d5bbe0c;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add(stream.readInt32());
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = users.size();
- stream.writeInt32(count);
- for (Integer user : users) {
- stream.writeInt32(user);
- }
- }
- }
-
- public static class TL_privacyValueDisallowAll extends PrivacyRule {
- public static int constructor = 0x8b73e763;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_privacyValueAllowContacts extends PrivacyRule {
- public static int constructor = 0xfffe1bac;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_privacyValueDisallowContacts extends PrivacyRule {
- public static int constructor = 0xf888fa1a;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_privacyValueAllowAll extends PrivacyRule {
- public static int constructor = 0x65427b82;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_privacyValueDisallowUsers extends PrivacyRule {
- public static int constructor = 0xc7f49b7;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add(stream.readInt32());
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = users.size();
- stream.writeInt32(count);
- for (Integer user : users) {
- stream.writeInt32(user);
- }
- }
- }
-
- public static class contacts_Contacts extends TLObject {
- public ArrayList contacts = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
- }
-
- public static class TL_contacts_contacts extends contacts_Contacts {
- public static int constructor = 0x6f8b8cb2;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- contacts.add((TL_contact)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData 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(0x1cb5c415);
- count = users.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- users.get(a).serializeToStream(stream);
- }
- }
- }
-
- public static class TL_contacts_contactsNotModified extends contacts_Contacts {
- public static int constructor = 0xb74ba9d2;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputPrivacyKeyStatusTimestamp extends TLObject {
- public static int constructor = 0x4f96cb18;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class photos_Photos extends TLObject {
- public ArrayList photos = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
- public int count;
- }
-
- public static class TL_photos_photos extends photos_Photos {
- public static int constructor = 0x8dca6aa5;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- photos.add((Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData 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);
- }
- }
- }
-
- public static class TL_photos_photosSlice extends photos_Photos {
- public static int constructor = 0x15051f54;
-
-
- public void readParams(AbsSerializedData stream) {
- count = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- photos.add((Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData 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);
- count = users.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- users.get(a).serializeToStream(stream);
- }
- }
- }
-
- public static class TL_chatFull extends TLObject {
- public static int constructor = 0x630e61be;
-
- public int id;
- public ChatParticipants participants;
- public Photo chat_photo;
- public PeerNotifySettings notify_settings;
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- participants = (ChatParticipants)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- chat_photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- notify_settings = (PeerNotifySettings)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- participants.serializeToStream(stream);
- chat_photo.serializeToStream(stream);
- notify_settings.serializeToStream(stream);
- }
- }
-
- public static class TL_msgs_all_info extends TLObject {
- public static int constructor = 0x8cc0d131;
-
- public ArrayList msg_ids = new ArrayList<>();
- public String info;
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- msg_ids.add(stream.readInt64());
- }
- info = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = msg_ids.size();
- stream.writeInt32(count);
- for (Long msg_id : msg_ids) {
- stream.writeInt64(msg_id);
- }
- stream.writeString(info);
- }
- }
-
- public static class TL_inputPeerNotifySettings extends TLObject {
- public static int constructor = 0x46a2ce98;
-
- public int mute_until;
- public String sound;
- public boolean show_previews;
- public int events_mask;
-
- public void readParams(AbsSerializedData stream) {
- mute_until = stream.readInt32();
- sound = stream.readString();
- show_previews = stream.readBool();
- events_mask = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(mute_until);
- stream.writeString(sound);
- stream.writeBool(show_previews);
- stream.writeInt32(events_mask);
- }
- }
-
- public static class TL_null extends TLObject {
- public static int constructor = 0x56730bcc;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class InputUser extends TLObject {
- public int user_id;
- public long access_hash;
- }
-
- public static class TL_inputUserSelf extends InputUser {
- public static int constructor = 0xf7c1b13f;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputUserForeign extends InputUser {
- public static int constructor = 0x655e74ff;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeInt64(access_hash);
- }
- }
-
- public static class TL_inputUserEmpty extends InputUser {
- public static int constructor = 0xb98886cf;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputUserContact extends InputUser {
- public static int constructor = 0x86e94f65;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- }
- }
-
- public static class TL_p_q_inner_data extends TLObject {
- public static int constructor = 0x83c95aec;
-
- public byte[] pq;
- public byte[] p;
- public byte[] q;
- public byte[] nonce;
- public byte[] server_nonce;
- public byte[] new_nonce;
-
- public void readParams(AbsSerializedData stream) {
- pq = stream.readByteArray();
- p = stream.readByteArray();
- q = stream.readByteArray();
- nonce = stream.readData(16);
- server_nonce = stream.readData(16);
- new_nonce = stream.readData(32);
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeByteArray(pq);
- stream.writeByteArray(p);
- stream.writeByteArray(q);
- stream.writeRaw(nonce);
- stream.writeRaw(server_nonce);
- stream.writeRaw(new_nonce);
- }
- }
-
- public static class TL_msgs_state_req extends TLObject {
- public static int constructor = 0xda69fb52;
-
- public ArrayList msg_ids = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- msg_ids.add(stream.readInt64());
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = msg_ids.size();
- stream.writeInt32(count);
- for (Long msg_id : msg_ids) {
- stream.writeInt64(msg_id);
- }
- }
- }
-
- public static class Bool extends TLObject {
- }
-
- public static class TL_boolTrue extends Bool {
- public static int constructor = 0x997275b5;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_boolFalse extends Bool {
- public static int constructor = 0xbc799737;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_auth_exportedAuthorization extends TLObject {
- public static int constructor = 0xdf969c2d;
-
- public int id;
- public byte[] bytes;
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- bytes = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeByteArray(bytes);
}
}
@@ -2133,15 +70,37 @@ public class TLRPC {
public int embed_height;
public int duration;
public String author;
+
+ public static WebPage TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ WebPage result = null;
+ switch(constructor) {
+ case 0xc586da1c:
+ result = new TL_webPagePending();
+ break;
+ case 0xeb1477e8:
+ result = new TL_webPageEmpty();
+ break;
+ case 0xa31ea0b5:
+ result = new TL_webPage();
+ 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_webPagePending extends WebPage {
public static int constructor = 0xc586da1c;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- date = stream.readInt32();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ date = stream.readInt32(exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -2155,67 +114,57 @@ public class TLRPC {
public static int constructor = 0xeb1477e8;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(id);
}
- }
-
- public static class TL_auth_passwordRecovery extends TLObject {
- public static int constructor = 0x137948a5;
-
- public String email_pattern;
-
- public void readParams(AbsSerializedData stream) {
- email_pattern = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(email_pattern);
- }
}
public static class TL_webPage extends WebPage {
public static int constructor = 0xa31ea0b5;
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- id = stream.readInt64();
- url = stream.readString();
- display_url = stream.readString();
+
+ public void readParams(AbsSerializedData 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();
+ type = stream.readString(exception);
}
if ((flags & 2) != 0) {
- site_name = stream.readString();
+ site_name = stream.readString(exception);
}
if ((flags & 4) != 0) {
- title = stream.readString();
+ title = stream.readString(exception);
}
if ((flags & 8) != 0) {
- description = stream.readString();
+ description = stream.readString(exception);
}
if ((flags & 16) != 0) {
- photo = (Photo) TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception);
}
if ((flags & 32) != 0) {
- embed_url = stream.readString();
- embed_type = stream.readString();
+ embed_url = stream.readString(exception);
+ }
+ if ((flags & 32) != 0) {
+ embed_type = stream.readString(exception);
}
if ((flags & 64) != 0) {
- embed_width = stream.readInt32();
- embed_height = stream.readInt32();
- }
+ embed_width = stream.readInt32(exception);
+ }
+ if ((flags & 64) != 0) {
+ embed_height = stream.readInt32(exception);
+ }
if ((flags & 128) != 0) {
- duration = stream.readInt32();
+ duration = stream.readInt32(exception);
}
if ((flags & 256) != 0) {
- author = stream.readString();
+ author = stream.readString(exception);
}
}
@@ -2242,10 +191,14 @@ public class TLRPC {
}
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) {
@@ -2257,479 +210,196 @@ public class TLRPC {
}
}
- public static class InputNotifyPeer extends TLObject {
- }
+ public static class TL_inputPeerNotifySettings extends TLObject {
+ public static int constructor = 0x46a2ce98;
- public static class TL_inputNotifyChats extends InputNotifyPeer {
- public static int constructor = 0x4a95e84e;
+ public int mute_until;
+ public String sound;
+ public boolean show_previews;
+ public int events_mask;
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputNotifyPeer extends InputNotifyPeer {
- public static int constructor = 0xb8bc5b0c;
-
- public InputPeer peer;
-
- public void readParams(AbsSerializedData stream) {
- peer = (InputPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- peer.serializeToStream(stream);
- }
- }
-
- public static class TL_inputNotifyUsers extends InputNotifyPeer {
- public static int constructor = 0x193b4417;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputNotifyGeoChatPeer extends InputNotifyPeer {
- public static int constructor = 0x4d8ddec8;
-
- public TL_inputGeoChat peer;
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputGeoChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- peer.serializeToStream(stream);
- }
- }
-
- public static class TL_inputNotifyAll extends InputNotifyPeer {
- public static int constructor = 0xa429b886;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class InputFileLocation extends TLObject {
- public long id;
- public long access_hash;
- public long volume_id;
- public int local_id;
- public long secret;
- }
-
- public static class TL_inputAudioFileLocation extends InputFileLocation {
- public static int constructor = 0x74dc404d;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- }
- }
-
- public static class TL_inputEncryptedFileLocation extends InputFileLocation {
- public static int constructor = 0xf5235d55;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- }
- }
-
- public static class TL_inputVideoFileLocation extends InputFileLocation {
- public static int constructor = 0x3d0364ec;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- }
- }
-
- public static class TL_inputDocumentFileLocation extends InputFileLocation {
- public static int constructor = 0x4e45abe9;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- }
- }
-
- public static class TL_inputFileLocation extends InputFileLocation {
- public static int constructor = 0x14637196;
-
-
- public void readParams(AbsSerializedData stream) {
- volume_id = stream.readInt64();
- local_id = stream.readInt32();
- secret = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(volume_id);
- stream.writeInt32(local_id);
- stream.writeInt64(secret);
- }
- }
-
- public static class TL_photos_photo extends TLObject {
- public static int constructor = 0x20212ca8;
-
- public Photo photo;
- public ArrayList users = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User) TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ public static TL_inputPeerNotifySettings TLdeserialize(AbsSerializedData 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(AbsSerializedData 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(AbsSerializedData stream) {
stream.writeInt32(constructor);
- photo.serializeToStream(stream);
- stream.writeInt32(0x1cb5c415);
- int count = users.size();
- stream.writeInt32(count);
- for (User user : users) {
- user.serializeToStream(stream);
- }
+ stream.writeInt32(mute_until);
+ stream.writeString(sound);
+ stream.writeBool(show_previews);
+ stream.writeInt32(events_mask);
}
}
- public static class TL_userContact extends User {
- public static int constructor = 0xcab35e18;
+ public static class TL_inputEncryptedFile extends InputEncryptedFile {
+ public static int constructor = 0x5a17b5e5;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- username = stream.readString();
- access_hash = stream.readInt64();
- phone = stream.readString();
- photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ access_hash = stream.readInt64(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(first_name);
- stream.writeString(last_name);
- stream.writeString(username);
+ stream.writeInt64(id);
stream.writeInt64(access_hash);
- stream.writeString(phone);
- photo.serializeToStream(stream);
- status.serializeToStream(stream);
}
}
- public static class TL_userRequest extends User {
- public static int constructor = 0xd9ccc4ef;
+ public static class TL_inputEncryptedFileBigUploaded extends InputEncryptedFile {
+ public static int constructor = 0x2dc173c8;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- username = stream.readString();
- access_hash = stream.readInt64();
- phone = stream.readString();
- photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ parts = stream.readInt32(exception);
+ key_fingerprint = stream.readInt32(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt32(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.writeInt64(id);
+ stream.writeInt32(parts);
+ stream.writeInt32(key_fingerprint);
}
}
- public static class TL_userForeign extends User {
- public static int constructor = 0x75cf7a8;
+ public static class TL_inputEncryptedFileEmpty extends InputEncryptedFile {
+ public static int constructor = 0x1837c364;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- username = stream.readString();
- access_hash = stream.readInt64();
- photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputEncryptedFileUploaded extends InputEncryptedFile {
+ public static int constructor = 0x64bd0306;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ parts = stream.readInt32(exception);
+ md5_checksum = stream.readString(exception);
+ key_fingerprint = stream.readInt32(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(first_name);
- stream.writeString(last_name);
- stream.writeString(username);
- stream.writeInt64(access_hash);
- photo.serializeToStream(stream);
- status.serializeToStream(stream);
+ stream.writeInt64(id);
+ stream.writeInt32(parts);
+ stream.writeString(md5_checksum);
+ stream.writeInt32(key_fingerprint);
}
}
- public static class TL_userDeleted extends User {
- public static int constructor = 0xd6016d7a;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- username = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(first_name);
- stream.writeString(last_name);
- stream.writeString(username);
- }
- }
-
- public static class TL_userSelf extends User {
- public static int constructor = 0x1c60e608;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- username = stream.readString();
- phone = stream.readString();
- photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(first_name);
- stream.writeString(last_name);
- stream.writeString(username);
- stream.writeString(phone);
- photo.serializeToStream(stream);
- status.serializeToStream(stream);
- }
- }
-
- public static class GeoChatMessage extends TLObject {
- public int chat_id;
- public int id;
- public int from_id;
- public int date;
- public String message;
- public MessageMedia media;
- public MessageAction action;
- }
-
- public static class TL_geoChatMessage extends GeoChatMessage {
- public static int constructor = 0x4505f8e1;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- id = stream.readInt32();
- from_id = stream.readInt32();
- date = stream.readInt32();
- message = stream.readString();
- media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- stream.writeInt32(id);
- stream.writeInt32(from_id);
- stream.writeInt32(date);
- stream.writeString(message);
- media.serializeToStream(stream);
- }
- }
-
- public static class TL_geoChatMessageService extends GeoChatMessage {
- public static int constructor = 0xd34fa24e;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- id = stream.readInt32();
- from_id = stream.readInt32();
- date = stream.readInt32();
- action = (MessageAction)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- stream.writeInt32(id);
- stream.writeInt32(from_id);
- stream.writeInt32(date);
- action.serializeToStream(stream);
- }
- }
-
- public static class TL_geoChatMessageEmpty extends GeoChatMessage {
- public static int constructor = 0x60311a9b;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- stream.writeInt32(id);
- }
- }
-
- public static class TL_pong extends TLObject {
- public static int constructor = 0x347773c5;
-
+ public static class MsgDetailedInfo extends TLObject {
+ public long answer_msg_id;
+ public int bytes;
+ public int status;
public long msg_id;
- public long ping_id;
- public void readParams(AbsSerializedData stream) {
- msg_id = stream.readInt64();
- ping_id = stream.readInt64();
+ public static MsgDetailedInfo TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ MsgDetailedInfo result = null;
+ switch(constructor) {
+ case 0x809db6df:
+ result = new TL_msg_new_detailed_info();
+ break;
+ case 0x276d3ec6:
+ result = new TL_msg_detailed_info();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in MsgDetailedInfo", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_msg_new_detailed_info extends MsgDetailedInfo {
+ public static int constructor = 0x809db6df;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ answer_msg_id = stream.readInt64(exception);
+ bytes = stream.readInt32(exception);
+ status = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(answer_msg_id);
+ stream.writeInt32(bytes);
+ stream.writeInt32(status);
+ }
+ }
+
+ public static class TL_msg_detailed_info extends MsgDetailedInfo {
+ public static int constructor = 0x276d3ec6;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ msg_id = stream.readInt64(exception);
+ answer_msg_id = stream.readInt64(exception);
+ bytes = stream.readInt32(exception);
+ status = stream.readInt32(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(msg_id);
- stream.writeInt64(ping_id);
+ stream.writeInt64(answer_msg_id);
+ stream.writeInt32(bytes);
+ stream.writeInt32(status);
}
}
- public static class TL_messageActionChatEditPhoto extends MessageAction {
- public static int constructor = 0x7fcb13a8;
+ public static class GeoPoint extends TLObject {
+ public double _long;
+ public double lat;
-
- public void readParams(AbsSerializedData stream) {
- photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- photo.serializeToStream(stream);
- }
- }
-
- public static class TL_messageActionChatDeleteUser extends MessageAction {
- public static int constructor = 0xb2ae9b0c;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- }
- }
-
- public static class TL_messageActionChatDeletePhoto extends MessageAction {
- public static int constructor = 0x95e3fbef;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_messageActionChatAddUser extends MessageAction {
- public static int constructor = 0x5e3cfc4b;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- }
- }
-
- public static class TL_messageActionChatCreate extends MessageAction {
- public static int constructor = 0xa6638b9a;
-
-
- public void readParams(AbsSerializedData stream) {
- title = stream.readString();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add(stream.readInt32());
+ public static GeoPoint TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ GeoPoint result = null;
+ switch(constructor) {
+ case 0x1117dd5f:
+ result = new TL_geoPointEmpty();
+ break;
+ case 0x2049d70c:
+ result = new TL_geoPoint();
+ break;
}
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(title);
- stream.writeInt32(0x1cb5c415);
- int count = users.size();
- stream.writeInt32(count);
- for (Integer user : users) {
- stream.writeInt32(user);
+ 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_messageActionEmpty extends MessageAction {
- public static int constructor = 0xb6aef7b0;
+ public static class TL_geoPointEmpty extends GeoPoint {
+ public static int constructor = 0x1117dd5f;
public void serializeToStream(AbsSerializedData stream) {
@@ -2737,307 +407,171 @@ public class TLRPC {
}
}
- public static class TL_messageActionChatEditTitle extends MessageAction {
- public static int constructor = 0xb5a1ce5a;
+ public static class TL_geoPoint extends GeoPoint {
+ public static int constructor = 0x2049d70c;
- public void readParams(AbsSerializedData stream) {
- title = stream.readString();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ _long = stream.readDouble(exception);
+ lat = stream.readDouble(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeString(title);
+ stream.writeDouble(_long);
+ stream.writeDouble(lat);
}
}
- public static class TL_messageActionGeoChatCreate extends MessageAction {
- public static int constructor = 0x6f038ebc;
+ public static class TL_accountDaysTTL extends TLObject {
+ public static int constructor = 0xb8d0afdf;
+ public int days;
- public void readParams(AbsSerializedData stream) {
- title = stream.readString();
- address = stream.readString();
+ public static TL_accountDaysTTL TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ days = stream.readInt32(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeString(title);
- stream.writeString(address);
+ stream.writeInt32(days);
}
}
- public static class TL_messageActionGeoChatCheckin extends MessageAction {
- public static int constructor = 0xc7d53de;
+ public static class TL_error extends TLObject {
+ public static int constructor = 0xc4b9f9bb;
+ public int code;
+ public String text;
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
+ public static TL_error TLdeserialize(AbsSerializedData 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 class Set_client_DH_params_answer extends TLObject {
- public byte[] nonce;
- public byte[] server_nonce;
- public byte[] new_nonce_hash2;
- public byte[] new_nonce_hash3;
- public byte[] new_nonce_hash1;
- }
-
- public static class TL_dh_gen_retry extends Set_client_DH_params_answer {
- public static int constructor = 0x46dc1fb9;
-
-
- public void readParams(AbsSerializedData stream) {
- nonce = stream.readData(16);
- server_nonce = stream.readData(16);
- new_nonce_hash2 = stream.readData(16);
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ code = stream.readInt32(exception);
+ text = stream.readString(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeRaw(nonce);
- stream.writeRaw(server_nonce);
- stream.writeRaw(new_nonce_hash2);
+ stream.writeInt32(code);
+ stream.writeString(text);
}
}
- public static class TL_dh_gen_fail extends Set_client_DH_params_answer {
- public static int constructor = 0xa69dae02;
+ public static class TL_messageService extends Message {
+ public static int constructor = 0x1d86f70e;
-
- public void readParams(AbsSerializedData stream) {
- nonce = stream.readData(16);
- server_nonce = stream.readData(16);
- new_nonce_hash3 = stream.readData(16);
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ flags = stream.readInt32(exception);
+ id = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ to_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ date = stream.readInt32(exception);
+ action = MessageAction.TLdeserialize(stream, stream.readInt32(exception), exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeRaw(nonce);
- stream.writeRaw(server_nonce);
- stream.writeRaw(new_nonce_hash3);
- }
- }
-
- public static class TL_dh_gen_ok extends Set_client_DH_params_answer {
- public static int constructor = 0x3bcbf734;
-
-
- public void readParams(AbsSerializedData stream) {
- nonce = stream.readData(16);
- server_nonce = stream.readData(16);
- new_nonce_hash1 = stream.readData(16);
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeRaw(nonce);
- stream.writeRaw(server_nonce);
- stream.writeRaw(new_nonce_hash1);
- }
- }
-
- public static class PeerNotifyEvents extends TLObject {
- }
-
- public static class TL_peerNotifyEventsEmpty extends PeerNotifyEvents {
- public static int constructor = 0xadd53cb3;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_peerNotifyEventsAll extends PeerNotifyEvents {
- public static int constructor = 0x6d1ded88;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_chatLocated extends TLObject {
- public static int constructor = 0x3631cf4c;
-
- public int chat_id;
- public int distance;
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- distance = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- stream.writeInt32(distance);
- }
- }
-
- public static class DecryptedMessage extends TLObject {
- public long random_id;
- public byte[] random_bytes;
- public DecryptedMessageAction action;
- public int ttl;
- public String message;
- public DecryptedMessageMedia media;
- }
-
- public static class TL_decryptedMessageService extends DecryptedMessage {
- public static int constructor = 0x73164160;
-
-
- public void readParams(AbsSerializedData stream) {
- random_id = stream.readInt64();
- action = (DecryptedMessageAction)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(random_id);
+ stream.writeInt32(flags);
+ stream.writeInt32(id);
+ stream.writeInt32(from_id);
+ to_id.serializeToStream(stream);
+ stream.writeInt32(date);
action.serializeToStream(stream);
}
}
- public static class TL_decryptedMessage extends DecryptedMessage {
- public static int constructor = 0x204d3878;
+ public static class TL_messageEmpty extends Message {
+ public static int constructor = 0x83e5de54;
- public void readParams(AbsSerializedData stream) {
- random_id = stream.readInt64();
- ttl = stream.readInt32();
- message = stream.readString();
- media = (DecryptedMessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt64(random_id);
- stream.writeInt32(ttl);
- stream.writeString(message);
- media.serializeToStream(stream);
+ stream.writeInt32(id);
}
}
- public static class InputPeerNotifyEvents extends TLObject {
- }
-
- public static class TL_inputPeerNotifyEventsAll extends InputPeerNotifyEvents {
- public static int constructor = 0xe86a2c74;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputPeerNotifyEventsEmpty extends InputPeerNotifyEvents {
- public static int constructor = 0xf03064d8;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_client_DH_inner_data extends TLObject {
- public static int constructor = 0x6643b654;
-
- public byte[] nonce;
- public byte[] server_nonce;
- public long retry_id;
- public byte[] g_b;
-
- public void readParams(AbsSerializedData stream) {
- nonce = stream.readData(16);
- server_nonce = stream.readData(16);
- retry_id = stream.readInt64();
- g_b = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeRaw(nonce);
- stream.writeRaw(server_nonce);
- stream.writeInt64(retry_id);
- stream.writeByteArray(g_b);
- }
- }
-
- public static class TL_video extends Video {
- public static int constructor = 0x388fa391;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- user_id = stream.readInt32();
- date = stream.readInt32();
- caption = stream.readString();
- duration = stream.readInt32();
- mime_type = stream.readString();
- size = stream.readInt32();
- thumb = (PhotoSize)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- dc_id = stream.readInt32();
- w = stream.readInt32();
- h = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- stream.writeInt32(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 extends Video {
- public static int constructor = 0xc10658a8;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- }
- }
-
- public static class TL_contactBlocked extends TLObject {
- public static int constructor = 0x561bc879;
+ public static class TL_contactStatus extends TLObject {
+ public static int constructor = 0xd3680c61;
public int user_id;
- public int date;
+ public UserStatus status;
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- date = stream.readInt32();
+ public static TL_contactStatus TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_contactStatus.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_contactStatus", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_contactStatus result = new TL_contactStatus();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(user_id);
- stream.writeInt32(date);
+ status.serializeToStream(stream);
}
}
public static class InputDocument extends TLObject {
public long id;
public long access_hash;
+
+ public static InputDocument TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputDocument result = null;
+ switch(constructor) {
+ case 0x72f0eaae:
+ result = new TL_inputDocumentEmpty();
+ break;
+ case 0x18798952:
+ 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 {
@@ -3053,9 +587,9 @@ public class TLRPC {
public static int constructor = 0x18798952;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ access_hash = stream.readInt64(exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -3065,93 +599,239 @@ public class TLRPC {
}
}
- public static class TL_inputAppEvent extends TLObject {
- public static int constructor = 0x770656a8;
+ public static class TL_auth_authorization extends TLObject {
+ public static int constructor = 0xf6b673a4;
- public double time;
- public String type;
- public long peer;
- public String data;
+ public int expires;
+ public User user;
- public void readParams(AbsSerializedData stream) {
- time = stream.readDouble();
- type = stream.readString();
- peer = stream.readInt64();
- data = stream.readString();
+ public static TL_auth_authorization TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_auth_authorization.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_auth_authorization", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_auth_authorization result = new TL_auth_authorization();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ expires = stream.readInt32(exception);
+ user = User.TLdeserialize(stream, stream.readInt32(exception), exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeDouble(time);
- stream.writeString(type);
- stream.writeInt64(peer);
- stream.writeString(data);
+ stream.writeInt32(expires);
+ user.serializeToStream(stream);
}
}
- public static class TL_messages_affectedHistory extends TLObject {
- public static int constructor = 0xb45c69d1;
+ public static class Set_client_DH_params_answer extends TLObject {
+ public byte[] nonce;
+ public byte[] server_nonce;
+ public byte[] new_nonce_hash2;
+ public byte[] new_nonce_hash3;
+ public byte[] new_nonce_hash1;
- public int pts;
- public int pts_count;
- public int offset;
+ public static Set_client_DH_params_answer TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ Set_client_DH_params_answer result = null;
+ switch(constructor) {
+ case 0x46dc1fb9:
+ result = new TL_dh_gen_retry();
+ break;
+ case 0xa69dae02:
+ result = new TL_dh_gen_fail();
+ break;
+ case 0x3bcbf734:
+ result = new TL_dh_gen_ok();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in Set_client_DH_params_answer", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
- public void readParams(AbsSerializedData stream) {
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- offset = stream.readInt32();
+ public static class TL_dh_gen_retry extends Set_client_DH_params_answer {
+ public static int constructor = 0x46dc1fb9;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ nonce = stream.readData(16, exception);
+ server_nonce = stream.readData(16, exception);
+ new_nonce_hash2 = stream.readData(16, exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt32(pts);
- stream.writeInt32(pts_count);
- stream.writeInt32(offset);
+ stream.writeRaw(nonce);
+ stream.writeRaw(server_nonce);
+ stream.writeRaw(new_nonce_hash2);
}
}
- public static class TL_documentEmpty extends Document {
- public static int constructor = 0x36f8c871;
+ public static class TL_dh_gen_fail extends Set_client_DH_params_answer {
+ public static int constructor = 0xa69dae02;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ nonce = stream.readData(16, exception);
+ server_nonce = stream.readData(16, exception);
+ new_nonce_hash3 = stream.readData(16, exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt64(id);
+ stream.writeRaw(nonce);
+ stream.writeRaw(server_nonce);
+ stream.writeRaw(new_nonce_hash3);
}
}
- public static class TL_document extends Document {
- public static int constructor = 0xf9a39f4f;
+ public static class TL_dh_gen_ok extends Set_client_DH_params_answer {
+ public static int constructor = 0x3bcbf734;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- date = stream.readInt32();
- mime_type = stream.readString();
- size = stream.readInt32();
- thumb = (PhotoSize)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- dc_id = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ nonce = stream.readData(16, exception);
+ server_nonce = stream.readData(16, exception);
+ new_nonce_hash1 = stream.readData(16, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeRaw(nonce);
+ stream.writeRaw(server_nonce);
+ stream.writeRaw(new_nonce_hash1);
+ }
+ }
+
+ public static class InputMedia extends TLObject {
+ public String phone_number;
+ public String first_name;
+ public String last_name;
+ public InputFile file;
+ public InputFile thumb;
+ public String mime_type;
+ public ArrayList attributes = new ArrayList<>();
+ public String caption;
+ public InputGeoPoint geo_point;
+ public int duration;
+ public int w;
+ public int h;
+ public String title;
+ public String address;
+ public String provider;
+ public String venue_id;
+
+ public static InputMedia TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputMedia result = null;
+ switch(constructor) {
+ case 0xa6e45987:
+ result = new TL_inputMediaContact();
+ break;
+ case 0x41481486:
+ result = new TL_inputMediaUploadedThumbDocument();
+ break;
+ case 0x89938781:
+ result = new TL_inputMediaAudio();
+ break;
+ case 0xd184e841:
+ result = new TL_inputMediaDocument();
+ break;
+ case 0x936a4ebd:
+ result = new TL_inputMediaVideo();
+ break;
+ case 0xf9c44144:
+ result = new TL_inputMediaGeoPoint();
+ break;
+ case 0x9664f57f:
+ result = new TL_inputMediaEmpty();
+ break;
+ case 0x96fb97dc:
+ result = new TL_inputMediaUploadedThumbVideo();
+ break;
+ case 0xf7aff1c0:
+ result = new TL_inputMediaUploadedPhoto();
+ break;
+ case 0x2827a81a:
+ result = new TL_inputMediaVenue();
+ break;
+ case 0x4e498cab:
+ result = new TL_inputMediaUploadedAudio();
+ break;
+ case 0xe13fd4bc:
+ result = new TL_inputMediaUploadedVideo();
+ break;
+ case 0xffe76b78:
+ result = new TL_inputMediaUploadedDocument();
+ break;
+ case 0xe9bfb4f3:
+ 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 = 0xa6e45987;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ phone_number = stream.readString(exception);
+ first_name = stream.readString(exception);
+ last_name = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(phone_number);
+ stream.writeString(first_name);
+ stream.writeString(last_name);
+ }
+ }
+
+ public static class TL_inputMediaUploadedThumbDocument extends InputMedia {
+ public static int constructor = 0x41481486;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ file = InputFile.TLdeserialize(stream, stream.readInt32(exception), exception);
+ thumb = InputFile.TLdeserialize(stream, stream.readInt32(exception), 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++) {
- attributes.add((DocumentAttribute)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ attributes.add(DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception));
}
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- stream.writeInt32(date);
- stream.writeString(mime_type);
- stream.writeInt32(size);
+ file.serializeToStream(stream);
thumb.serializeToStream(stream);
- stream.writeInt32(dc_id);
+ stream.writeString(mime_type);
stream.writeInt32(0x1cb5c415);
int count = attributes.size();
stream.writeInt32(count);
@@ -3161,11 +841,69 @@ public class TLRPC {
}
}
- public static class ContactLink extends TLObject {
+ public static class TL_inputMediaAudio extends InputMedia {
+ public static int constructor = 0x89938781;
+
+ public InputAudio id;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = InputAudio.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ id.serializeToStream(stream);
+ }
}
- public static class TL_contactLinkNone extends ContactLink {
- public static int constructor = 0xfeedd3ad;
+ public static class TL_inputMediaDocument extends InputMedia {
+ public static int constructor = 0xd184e841;
+
+ public InputDocument id;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = InputDocument.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ id.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_inputMediaVideo extends InputMedia {
+ public static int constructor = 0x936a4ebd;
+
+ public InputVideo id;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = InputVideo.TLdeserialize(stream, stream.readInt32(exception), exception);
+ caption = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ id.serializeToStream(stream);
+ stream.writeString(caption);
+ }
+ }
+
+ public static class TL_inputMediaGeoPoint extends InputMedia {
+ public static int constructor = 0xf9c44144;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ geo_point = InputGeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ geo_point.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_inputMediaEmpty extends InputMedia {
+ public static int constructor = 0x9664f57f;
public void serializeToStream(AbsSerializedData stream) {
@@ -3173,46 +911,507 @@ public class TLRPC {
}
}
- public static class TL_contactLinkContact extends ContactLink {
- public static int constructor = 0xd502c2d0;
+ public static class TL_inputMediaUploadedThumbVideo extends InputMedia {
+ public static int constructor = 0x96fb97dc;
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ file = InputFile.TLdeserialize(stream, stream.readInt32(exception), exception);
+ thumb = InputFile.TLdeserialize(stream, stream.readInt32(exception), exception);
+ duration = stream.readInt32(exception);
+ w = stream.readInt32(exception);
+ h = stream.readInt32(exception);
+ caption = stream.readString(exception);
+ }
+
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
+ file.serializeToStream(stream);
+ thumb.serializeToStream(stream);
+ stream.writeInt32(duration);
+ stream.writeInt32(w);
+ stream.writeInt32(h);
+ stream.writeString(caption);
}
}
- public static class TL_contactLinkHasPhone extends ContactLink {
- public static int constructor = 0x268f3f59;
+ public static class TL_inputMediaUploadedPhoto extends InputMedia {
+ public static int constructor = 0xf7aff1c0;
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ file = InputFile.TLdeserialize(stream, stream.readInt32(exception), exception);
+ caption = stream.readString(exception);
+ }
+
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
+ file.serializeToStream(stream);
+ stream.writeString(caption);
}
}
- public static class TL_contactLinkUnknown extends ContactLink {
- public static int constructor = 0x5f4f9247;
+ public static class TL_inputMediaVenue extends InputMedia {
+ public static int constructor = 0x2827a81a;
+ public void readParams(AbsSerializedData 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);
+ }
+
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
+ geo_point.serializeToStream(stream);
+ stream.writeString(title);
+ stream.writeString(address);
+ stream.writeString(provider);
+ stream.writeString(venue_id);
+ }
+ }
+
+ public static class TL_inputMediaUploadedAudio extends InputMedia {
+ public static int constructor = 0x4e498cab;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ file = InputFile.TLdeserialize(stream, stream.readInt32(exception), exception);
+ duration = stream.readInt32(exception);
+ mime_type = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ file.serializeToStream(stream);
+ stream.writeInt32(duration);
+ stream.writeString(mime_type);
+ }
+ }
+
+ public static class TL_inputMediaUploadedVideo extends InputMedia {
+ public static int constructor = 0xe13fd4bc;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ file = InputFile.TLdeserialize(stream, stream.readInt32(exception), exception);
+ duration = stream.readInt32(exception);
+ w = stream.readInt32(exception);
+ h = stream.readInt32(exception);
+ caption = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ file.serializeToStream(stream);
+ stream.writeInt32(duration);
+ stream.writeInt32(w);
+ stream.writeInt32(h);
+ stream.writeString(caption);
+ }
+ }
+
+ public static class TL_inputMediaUploadedDocument extends InputMedia {
+ public static int constructor = 0xffe76b78;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ file = InputFile.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ attributes.add(DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ file.serializeToStream(stream);
+ 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_inputMediaPhoto extends InputMedia {
+ public static int constructor = 0xe9bfb4f3;
+
+ public InputPhoto id;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = InputPhoto.TLdeserialize(stream, stream.readInt32(exception), exception);
+ caption = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ id.serializeToStream(stream);
+ stream.writeString(caption);
+ }
+ }
+
+ public static class TL_geochats_statedMessage extends TLObject {
+ public static int constructor = 0x17b1578b;
+
+ public GeoChatMessage message;
+ public ArrayList chats = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
+ public int seq;
+
+ public static TL_geochats_statedMessage TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_geochats_statedMessage.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_geochats_statedMessage", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_geochats_statedMessage result = new TL_geochats_statedMessage();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ message = GeoChatMessage.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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ seq = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ message.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);
+ }
+ stream.writeInt32(seq);
+ }
+ }
+
+ public static class messages_Dialogs extends TLObject {
+ public ArrayList dialogs = new ArrayList<>();
+ public ArrayList messages = new ArrayList<>();
+ public ArrayList chats = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
+ public int count;
+
+ public static messages_Dialogs TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ messages_Dialogs result = null;
+ switch(constructor) {
+ case 0x15ba6c40:
+ result = new TL_messages_dialogs();
+ break;
+ case 0x71e094f3:
+ result = new TL_messages_dialogsSlice();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in messages_Dialogs", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_messages_dialogs extends messages_Dialogs {
+ public static int constructor = 0x15ba6c40;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ dialogs.add(TL_dialog.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ messages.add(Message.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData 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);
+ }
+ }
+ }
+
+ public static class TL_messages_dialogsSlice extends messages_Dialogs {
+ public static int constructor = 0x71e094f3;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ dialogs.add(TL_dialog.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ messages.add(Message.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(count);
+ 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);
+ }
+ }
+ }
+
+ public static class TL_server_DH_inner_data extends TLObject {
+ public static int constructor = 0xb5890dba;
+
+ public byte[] nonce;
+ public byte[] server_nonce;
+ public int g;
+ public byte[] dh_prime;
+ public byte[] g_a;
+ public int server_time;
+
+ public static TL_server_DH_inner_data TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_server_DH_inner_data.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_server_DH_inner_data", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_server_DH_inner_data result = new TL_server_DH_inner_data();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ nonce = stream.readData(16, exception);
+ server_nonce = stream.readData(16, exception);
+ g = stream.readInt32(exception);
+ dh_prime = stream.readByteArray(exception);
+ g_a = stream.readByteArray(exception);
+ server_time = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeRaw(nonce);
+ stream.writeRaw(server_nonce);
+ stream.writeInt32(g);
+ stream.writeByteArray(dh_prime);
+ stream.writeByteArray(g_a);
+ stream.writeInt32(server_time);
}
}
public static class InputPrivacyRule extends TLObject {
public ArrayList users = new ArrayList<>();
+
+ public static InputPrivacyRule TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputPrivacyRule result = null;
+ switch(constructor) {
+ case 0x90110467:
+ result = new TL_inputPrivacyValueDisallowUsers();
+ break;
+ case 0xd66b66c9:
+ result = new TL_inputPrivacyValueDisallowAll();
+ break;
+ case 0xba52007:
+ result = new TL_inputPrivacyValueDisallowContacts();
+ break;
+ case 0x184b35ce:
+ result = new TL_inputPrivacyValueAllowAll();
+ break;
+ case 0xd09e07b:
+ result = new TL_inputPrivacyValueAllowContacts();
+ break;
+ case 0x131cc67f:
+ result = new TL_inputPrivacyValueAllowUsers();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in InputPrivacyRule", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
}
public static class TL_inputPrivacyValueDisallowUsers extends InputPrivacyRule {
public static int constructor = 0x90110467;
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
+ public void readParams(AbsSerializedData 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((InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ users.add(InputUser.TLdeserialize(stream, stream.readInt32(exception), exception));
}
}
@@ -3221,8 +1420,8 @@ public class TLRPC {
stream.writeInt32(0x1cb5c415);
int count = users.size();
stream.writeInt32(count);
- for (InputUser user : users) {
- user.serializeToStream(stream);
+ for (int a = 0; a < count; a++) {
+ users.get(a).serializeToStream(stream);
}
}
}
@@ -3267,11 +1466,17 @@ public class TLRPC {
public static int constructor = 0x131cc67f;
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
+ public void readParams(AbsSerializedData 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((InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ users.add(InputUser.TLdeserialize(stream, stream.readInt32(exception), exception));
}
}
@@ -3280,34 +1485,954 @@ public class TLRPC {
stream.writeInt32(0x1cb5c415);
int count = users.size();
stream.writeInt32(count);
- for (InputUser user : users) {
- user.serializeToStream(stream);
+ for (int a = 0; a < count; a++) {
+ users.get(a).serializeToStream(stream);
}
}
}
- public static class InputMedia extends TLObject {
- public String phone_number;
- public String first_name;
- public String last_name;
- public InputFile file;
- public InputFile thumb;
- public String mime_type;
- public ArrayList attributes = new ArrayList<>();
- public InputGeoPoint geo_point;
- public int duration;
- public int w;
- public int h;
+ public static class TL_contacts_link extends TLObject {
+ public static int constructor = 0x3ace484c;
+
+ public ContactLink my_link;
+ public ContactLink foreign_link;
+ public User user;
+
+ public static TL_contacts_link TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_contacts_link.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_contacts_link", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_contacts_link result = new TL_contacts_link();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ my_link = ContactLink.TLdeserialize(stream, stream.readInt32(exception), exception);
+ foreign_link = ContactLink.TLdeserialize(stream, stream.readInt32(exception), exception);
+ user = User.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ my_link.serializeToStream(stream);
+ foreign_link.serializeToStream(stream);
+ user.serializeToStream(stream);
+ }
}
- public static class TL_inputMediaContact extends InputMedia {
- public static int constructor = 0xa6e45987;
+ public static class photos_Photos extends TLObject {
+ public ArrayList photos = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
+ public int count;
+
+ public static photos_Photos TLdeserialize(AbsSerializedData 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 void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- first_name = stream.readString();
- last_name = stream.readString();
+ public void readParams(AbsSerializedData 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.add(Photo.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData 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);
+ }
+ }
+ }
+
+ public static class TL_photos_photosSlice extends photos_Photos {
+ public static int constructor = 0x15051f54;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ photos.add(Photo.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData 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);
+ count = users.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ users.get(a).serializeToStream(stream);
+ }
+ }
+ }
+
+ public static class TL_msgs_ack extends TLObject {
+ public static int constructor = 0x62d6b459;
+
+ public ArrayList msg_ids = new ArrayList<>();
+
+ public static TL_msgs_ack TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_msgs_ack.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_msgs_ack", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_msgs_ack result = new TL_msgs_ack();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData 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++) {
+ msg_ids.add(stream.readInt64(exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = msg_ids.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ stream.writeInt64(msg_ids.get(a));
+ }
+ }
+ }
+
+ public static class TL_userStatusLastWeek extends UserStatus {
+ public static int constructor = 0x7bf09fc;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_userStatusEmpty extends UserStatus {
+ public static int constructor = 0x9d05049;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_userStatusLastMonth extends UserStatus {
+ public static int constructor = 0x77ebc742;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_userStatusOnline extends UserStatus {
+ public static int constructor = 0xedb93949;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ expires = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(expires);
+ }
+ }
+
+ public static class TL_userStatusRecently extends UserStatus {
+ public static int constructor = 0xe26f42f1;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_userFull extends TLObject {
+ public static int constructor = 0x771095da;
+
+ public User user;
+ public TL_contacts_link link;
+ public Photo profile_photo;
+ public PeerNotifySettings notify_settings;
+ public boolean blocked;
+ public String real_first_name;
+ public String real_last_name;
+
+ public static TL_userFull TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_userFull.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_userFull", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_userFull result = new TL_userFull();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user = User.TLdeserialize(stream, stream.readInt32(exception), exception);
+ link = TL_contacts_link.TLdeserialize(stream, stream.readInt32(exception), exception);
+ profile_photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception);
+ notify_settings = PeerNotifySettings.TLdeserialize(stream, stream.readInt32(exception), exception);
+ blocked = stream.readBool(exception);
+ real_first_name = stream.readString(exception);
+ real_last_name = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ user.serializeToStream(stream);
+ link.serializeToStream(stream);
+ profile_photo.serializeToStream(stream);
+ notify_settings.serializeToStream(stream);
+ stream.writeBool(blocked);
+ stream.writeString(real_first_name);
+ stream.writeString(real_last_name);
+ }
+ }
+
+ public static class TL_msg_resend_req extends TLObject {
+ public static int constructor = 0x7d861a08;
+
+ public ArrayList msg_ids = new ArrayList<>();
+
+ public static TL_msg_resend_req TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_msg_resend_req.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_msg_resend_req", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_msg_resend_req result = new TL_msg_resend_req();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData 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++) {
+ msg_ids.add(stream.readInt64(exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = msg_ids.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ stream.writeInt64(msg_ids.get(a));
+ }
+ }
+ }
+
+ public static class TL_contact extends TLObject {
+ public static int constructor = 0xf911c994;
+
+ public int user_id;
+ public boolean mutual;
+
+ public static TL_contact TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_contact.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_contact", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_contact result = new TL_contact();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ mutual = stream.readBool(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeBool(mutual);
+ }
+ }
+
+ public static class TL_chatLocated extends TLObject {
+ public static int constructor = 0x3631cf4c;
+
+ public int chat_id;
+ public int distance;
+
+ public static TL_chatLocated TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_chatLocated.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_chatLocated", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_chatLocated result = new TL_chatLocated();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ distance = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ stream.writeInt32(distance);
+ }
+ }
+
+ public static class RpcError extends TLObject {
+ public int error_code;
+ public String error_message;
+ public long query_id;
+
+ public static RpcError TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ RpcError result = null;
+ switch(constructor) {
+ case 0x2144ca19:
+ result = new TL_rpc_error();
+ break;
+ case 0x7ae432f5:
+ result = new TL_rpc_req_error();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in RpcError", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_rpc_error extends RpcError {
+ public static int constructor = 0x2144ca19;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ error_code = stream.readInt32(exception);
+ error_message = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(error_code);
+ stream.writeString(error_message);
+ }
+ }
+
+ public static class TL_rpc_req_error extends RpcError {
+ public static int constructor = 0x7ae432f5;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ query_id = stream.readInt64(exception);
+ error_code = stream.readInt32(exception);
+ error_message = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(query_id);
+ stream.writeInt32(error_code);
+ stream.writeString(error_message);
+ }
+ }
+
+ public static class TL_privacyKeyStatusTimestamp extends TLObject {
+ public static int constructor = 0xbc2eab30;
+
+
+ public static TL_privacyKeyStatusTimestamp TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_privacyKeyStatusTimestamp.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_privacyKeyStatusTimestamp", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_privacyKeyStatusTimestamp result = new TL_privacyKeyStatusTimestamp();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class ChatParticipants extends TLObject {
+ public int chat_id;
+ public int admin_id;
+ public ArrayList participants = new ArrayList<>();
+ public int version;
+
+ public static ChatParticipants TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ ChatParticipants result = null;
+ switch(constructor) {
+ case 0x7841b415:
+ result = new TL_chatParticipants();
+ break;
+ case 0xfd2bb8a:
+ result = new TL_chatParticipantsForbidden();
+ 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;
+ }
+ }
+
+ public static class TL_chatParticipants extends ChatParticipants {
+ public static int constructor = 0x7841b415;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ admin_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++) {
+ participants.add(TL_chatParticipant.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ version = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ stream.writeInt32(admin_id);
+ stream.writeInt32(0x1cb5c415);
+ int count = participants.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ participants.get(a).serializeToStream(stream);
+ }
+ stream.writeInt32(version);
+ }
+ }
+
+ public static class TL_chatParticipantsForbidden extends ChatParticipants {
+ public static int constructor = 0xfd2bb8a;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ }
+ }
+
+ public static class TL_auth_passwordRecovery extends TLObject {
+ public static int constructor = 0x137948a5;
+
+ public String email_pattern;
+
+ public static TL_auth_passwordRecovery TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ email_pattern = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(email_pattern);
+ }
+ }
+
+ public static class TL_decryptedMessageService extends DecryptedMessage {
+ public static int constructor = 0x73164160;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ random_id = stream.readInt64(exception);
+ action = DecryptedMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(random_id);
+ action.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_decryptedMessage extends DecryptedMessage {
+ public static int constructor = 0x204d3878;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(random_id);
+ stream.writeInt32(ttl);
+ stream.writeString(message);
+ media.serializeToStream(stream);
+ }
+ }
+
+ public static class messages_Messages extends TLObject {
+ public ArrayList messages = new ArrayList<>();
+ public ArrayList chats = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
+ public int count;
+
+ public static messages_Messages TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ messages_Messages result = null;
+ switch(constructor) {
+ case 0x8c718e87:
+ result = new TL_messages_messages();
+ break;
+ case 0xb446ae3:
+ result = new TL_messages_messagesSlice();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in messages_Messages", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_messages_messages extends messages_Messages {
+ public static int constructor = 0x8c718e87;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ messages.add(Message.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int 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);
+ }
+ }
+ }
+
+ public static class TL_messages_messagesSlice extends messages_Messages {
+ public static int constructor = 0xb446ae3;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ messages.add(Message.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(count);
+ stream.writeInt32(0x1cb5c415);
+ int 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);
+ }
+ }
+ }
+
+ public static class BadMsgNotification extends TLObject {
+ public long bad_msg_id;
+ public int bad_msg_seqno;
+ public int error_code;
+ public long new_server_salt;
+
+ public static BadMsgNotification TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ BadMsgNotification result = null;
+ switch(constructor) {
+ case 0xa7eff811:
+ result = new TL_bad_msg_notification();
+ break;
+ case 0xedab447b:
+ result = new TL_bad_server_salt();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in BadMsgNotification", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_bad_msg_notification extends BadMsgNotification {
+ public static int constructor = 0xa7eff811;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ bad_msg_id = stream.readInt64(exception);
+ bad_msg_seqno = stream.readInt32(exception);
+ error_code = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(bad_msg_id);
+ stream.writeInt32(bad_msg_seqno);
+ stream.writeInt32(error_code);
+ }
+ }
+
+ public static class TL_bad_server_salt extends BadMsgNotification {
+ public static int constructor = 0xedab447b;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ bad_msg_id = stream.readInt64(exception);
+ bad_msg_seqno = stream.readInt32(exception);
+ error_code = stream.readInt32(exception);
+ new_server_salt = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(bad_msg_id);
+ stream.writeInt32(bad_msg_seqno);
+ stream.writeInt32(error_code);
+ stream.writeInt64(new_server_salt);
+ }
+ }
+
+ public static class TL_decryptedMessageMediaDocument extends DecryptedMessageMedia {
+ public static int constructor = 0xb095434b;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData 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_decryptedMessageMediaGeoPoint extends DecryptedMessageMedia {
+ public static int constructor = 0x35480a59;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ lat = stream.readDouble(exception);
+ _long = stream.readDouble(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeDouble(lat);
+ stream.writeDouble(_long);
+ }
+ }
+
+ public static class TL_decryptedMessageMediaAudio extends DecryptedMessageMedia {
+ public static int constructor = 0x57e0a9cb;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(duration);
+ stream.writeString(mime_type);
+ stream.writeInt32(size);
+ stream.writeByteArray(key);
+ stream.writeByteArray(iv);
+ }
+ }
+
+ public static class TL_decryptedMessageMediaVideo extends DecryptedMessageMedia {
+ public static int constructor = 0x524a415d;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData 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_decryptedMessageMediaContact extends DecryptedMessageMedia {
+ public static int constructor = 0x588a0a97;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
@@ -3315,99 +2440,12 @@ public class TLRPC {
stream.writeString(phone_number);
stream.writeString(first_name);
stream.writeString(last_name);
+ stream.writeInt32(user_id);
}
}
- public static class TL_inputMediaUploadedThumbDocument extends InputMedia {
- public static int constructor = 0x41481486;
-
-
- public void readParams(AbsSerializedData stream) {
- file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- thumb = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- mime_type = stream.readString();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- attributes.add((DocumentAttribute)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- file.serializeToStream(stream);
- thumb.serializeToStream(stream);
- 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_inputMediaAudio extends InputMedia {
- public static int constructor = 0x89938781;
-
- public InputAudio id;
-
- public void readParams(AbsSerializedData stream) {
- id = (InputAudio)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- id.serializeToStream(stream);
- }
- }
-
- public static class TL_inputMediaDocument extends InputMedia {
- public static int constructor = 0xd184e841;
-
- public InputDocument id;
-
- public void readParams(AbsSerializedData stream) {
- id = (InputDocument)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- id.serializeToStream(stream);
- }
- }
-
- public static class TL_inputMediaVideo extends InputMedia {
- public static int constructor = 0x7f023ae6;
-
- public InputVideo id;
-
- public void readParams(AbsSerializedData stream) {
- id = (InputVideo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- id.serializeToStream(stream);
- }
- }
-
- public static class TL_inputMediaGeoPoint extends InputMedia {
- public static int constructor = 0xf9c44144;
-
-
- public void readParams(AbsSerializedData stream) {
- geo_point = (InputGeoPoint)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- geo_point.serializeToStream(stream);
- }
- }
-
- public static class TL_inputMediaEmpty extends InputMedia {
- public static int constructor = 0x9664f57f;
+ public static class TL_decryptedMessageMediaEmpty extends DecryptedMessageMedia {
+ public static int constructor = 0x89f5c4a;
public void serializeToStream(AbsSerializedData stream) {
@@ -3415,123 +2453,5226 @@ public class TLRPC {
}
}
- public static class TL_inputMediaUploadedThumbVideo extends InputMedia {
- public static int constructor = 0x9912dabf;
+ public static class TL_decryptedMessageMediaPhoto extends DecryptedMessageMedia {
+ public static int constructor = 0x32798a8c;
- public void readParams(AbsSerializedData stream) {
- file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- thumb = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- duration = stream.readInt32();
- w = stream.readInt32();
- h = stream.readInt32();
- mime_type = stream.readString();
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
stream.writeInt32(constructor);
- file.serializeToStream(stream);
- thumb.serializeToStream(stream);
- stream.writeInt32(duration);
+ stream.writeByteArray(thumb);
+ stream.writeInt32(thumb_w);
+ stream.writeInt32(thumb_h);
stream.writeInt32(w);
stream.writeInt32(h);
- stream.writeString(mime_type);
+ stream.writeInt32(size);
+ stream.writeByteArray(key);
+ stream.writeByteArray(iv);
}
}
- public static class TL_inputMediaUploadedPhoto extends InputMedia {
- public static int constructor = 0x2dc53a7d;
+ public static class TL_userContact extends User {
+ public static int constructor = 0xcab35e18;
- public void readParams(AbsSerializedData stream) {
- file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
stream.writeInt32(constructor);
- file.serializeToStream(stream);
+ stream.writeInt32(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);
}
}
- public static class TL_inputMediaUploadedAudio extends InputMedia {
- public static int constructor = 0x4e498cab;
+ public static class TL_userRequest extends User {
+ public static int constructor = 0xd9ccc4ef;
- public void readParams(AbsSerializedData stream) {
- file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- duration = stream.readInt32();
- mime_type = stream.readString();
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
stream.writeInt32(constructor);
- file.serializeToStream(stream);
- stream.writeInt32(duration);
- stream.writeString(mime_type);
+ stream.writeInt32(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);
}
}
- public static class TL_inputMediaUploadedVideo extends InputMedia {
- public static int constructor = 0x133ad6f6;
+ public static class TL_userForeign extends User {
+ public static int constructor = 0x75cf7a8;
- public void readParams(AbsSerializedData stream) {
- file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- duration = stream.readInt32();
- w = stream.readInt32();
- h = stream.readInt32();
- mime_type = stream.readString();
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
stream.writeInt32(constructor);
- file.serializeToStream(stream);
- stream.writeInt32(duration);
- stream.writeInt32(w);
- stream.writeInt32(h);
- stream.writeString(mime_type);
+ stream.writeInt32(id);
+ 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_inputMediaUploadedDocument extends InputMedia {
- public static int constructor = 0xffe76b78;
+ public static class TL_userDeleted extends User {
+ public static int constructor = 0xd6016d7a;
- public void readParams(AbsSerializedData stream) {
- file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- mime_type = stream.readString();
- stream.readInt32();
- int count = stream.readInt32();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ first_name = stream.readString(exception);
+ last_name = stream.readString(exception);
+ username = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeString(first_name);
+ stream.writeString(last_name);
+ stream.writeString(username);
+ }
+ }
+
+ public static class TL_userSelf extends User {
+ public static int constructor = 0x1c60e608;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeString(first_name);
+ stream.writeString(last_name);
+ stream.writeString(username);
+ stream.writeString(phone);
+ photo.serializeToStream(stream);
+ status.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_messageMediaVideo extends MessageMedia {
+ public static int constructor = 0x5bcf1675;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ video = Video.TLdeserialize(stream, stream.readInt32(exception), exception);
+ caption = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ video.serializeToStream(stream);
+ stream.writeString(caption);
+ }
+ }
+
+ public static class TL_messageMediaPhoto extends MessageMedia {
+ public static int constructor = 0x3d8ce53d;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception);
+ caption = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ photo.serializeToStream(stream);
+ stream.writeString(caption);
+ }
+ }
+
+ public static class TL_messageMediaWebPage extends MessageMedia {
+ public static int constructor = 0xa32dd600;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ webpage = WebPage.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ webpage.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_messageMediaDocument extends MessageMedia {
+ public static int constructor = 0x2fda2204;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ document = Document.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ document.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_messageMediaGeo extends MessageMedia {
+ public static int constructor = 0x56e0d474;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ geo.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_messageMediaEmpty extends MessageMedia {
+ public static int constructor = 0x3ded6320;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_messageMediaAudio extends MessageMedia {
+ public static int constructor = 0xc6b68300;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ audio = Audio.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ audio.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_messageMediaVenue extends MessageMedia {
+ public static int constructor = 0x7912b71f;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ geo.serializeToStream(stream);
+ stream.writeString(title);
+ stream.writeString(address);
+ stream.writeString(provider);
+ stream.writeString(venue_id);
+ }
+ }
+
+ public static class TL_messageMediaContact extends MessageMedia {
+ public static int constructor = 0x5e7d2f39;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(phone_number);
+ stream.writeString(first_name);
+ stream.writeString(last_name);
+ stream.writeInt32(user_id);
+ }
+ }
+
+ public static class TL_messageMediaUnsupported extends MessageMedia {
+ public static int constructor = 0x9f84f49e;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_nearestDc extends TLObject {
+ public static int constructor = 0x8e1a1775;
+
+ public String country;
+ public int this_dc;
+ public int nearest_dc;
+
+ public static TL_nearestDc TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ country = stream.readString(exception);
+ this_dc = stream.readInt32(exception);
+ nearest_dc = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(country);
+ stream.writeInt32(this_dc);
+ stream.writeInt32(nearest_dc);
+ }
+ }
+
+ public static class TL_contactFound extends TLObject {
+ public static int constructor = 0xea879f95;
+
+ public int user_id;
+
+ public static TL_contactFound TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_contactFound.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_contactFound", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_contactFound result = new TL_contactFound();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ }
+ }
+
+ public static class TL_new_session_created extends TLObject {
+ public static int constructor = 0x9ec20908;
+
+ public long first_msg_id;
+ public long unique_id;
+ public long server_salt;
+
+ public static TL_new_session_created TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_new_session_created.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_new_session_created", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_new_session_created result = new TL_new_session_created();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ first_msg_id = stream.readInt64(exception);
+ unique_id = stream.readInt64(exception);
+ server_salt = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(first_msg_id);
+ stream.writeInt64(unique_id);
+ stream.writeInt64(server_salt);
+ }
+ }
+
+ public static class TL_contacts_suggested extends TLObject {
+ public static int constructor = 0x5649dcc5;
+
+ public ArrayList results = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
+
+ public static TL_contacts_suggested TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_contacts_suggested.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_contacts_suggested", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_contacts_suggested result = new TL_contacts_suggested();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData 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++) {
- attributes.add((DocumentAttribute)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ results.add(TL_contactSuggested.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
}
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- file.serializeToStream(stream);
- stream.writeString(mime_type);
stream.writeInt32(0x1cb5c415);
- int count = attributes.size();
+ int count = results.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
- attributes.get(a).serializeToStream(stream);
+ results.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_inputMediaPhoto extends InputMedia {
- public static int constructor = 0x8f2ab2ec;
+ public static class WallPaper extends TLObject {
+ public int id;
+ public String title;
+ public ArrayList sizes = new ArrayList<>();
+ public int color;
+ public int bg_color;
+ public static WallPaper TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ WallPaper result = null;
+ switch(constructor) {
+ case 0xccb03657:
+ result = new TL_wallPaper();
+ break;
+ case 0x63117f24:
+ result = new TL_wallPaperSolid();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in WallPaper", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_wallPaper extends WallPaper {
+ public static int constructor = 0xccb03657;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(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++) {
+ sizes.add(PhotoSize.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ color = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeString(title);
+ stream.writeInt32(0x1cb5c415);
+ int count = sizes.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ sizes.get(a).serializeToStream(stream);
+ }
+ stream.writeInt32(color);
+ }
+ }
+
+ public static class TL_wallPaperSolid extends WallPaper {
+ public static int constructor = 0x63117f24;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ title = stream.readString(exception);
+ bg_color = stream.readInt32(exception);
+ color = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeString(title);
+ stream.writeInt32(bg_color);
+ stream.writeInt32(color);
+ }
+ }
+
+ public static class NotifyPeer extends TLObject {
+ public Peer peer;
+
+ public static NotifyPeer TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ NotifyPeer result = null;
+ switch(constructor) {
+ case 0x74d07c60:
+ result = new TL_notifyAll();
+ break;
+ case 0xc007cec3:
+ result = new TL_notifyChats();
+ break;
+ case 0xb4c83b4c:
+ result = new TL_notifyUsers();
+ break;
+ case 0x9fd40bd8:
+ result = new TL_notifyPeer();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in NotifyPeer", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_notifyAll extends NotifyPeer {
+ public static int constructor = 0x74d07c60;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_notifyChats extends NotifyPeer {
+ public static int constructor = 0xc007cec3;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_notifyUsers extends NotifyPeer {
+ public static int constructor = 0xb4c83b4c;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_notifyPeer extends NotifyPeer {
+ public static int constructor = 0x9fd40bd8;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ peer = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ peer.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_inputPrivacyKeyStatusTimestamp extends TLObject {
+ public static int constructor = 0x4f96cb18;
+
+
+ public static TL_inputPrivacyKeyStatusTimestamp TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_inputPrivacyKeyStatusTimestamp.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_inputPrivacyKeyStatusTimestamp", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_inputPrivacyKeyStatusTimestamp result = new TL_inputPrivacyKeyStatusTimestamp();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_account_sentChangePhoneCode extends TLObject {
+ public static int constructor = 0xa4f58c4c;
+
+ public String phone_code_hash;
+ public int send_call_timeout;
+
+ public static TL_account_sentChangePhoneCode TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_account_sentChangePhoneCode.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_account_sentChangePhoneCode", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_account_sentChangePhoneCode result = new TL_account_sentChangePhoneCode();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ phone_code_hash = stream.readString(exception);
+ send_call_timeout = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(phone_code_hash);
+ stream.writeInt32(send_call_timeout);
+ }
+ }
+
+ public static class ChatInvite extends TLObject {
+ public String title;
+ public Chat chat;
+
+ public static ChatInvite TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ ChatInvite result = null;
+ switch(constructor) {
+ case 0xce917dcd:
+ result = new TL_chatInvite();
+ break;
+ case 0x5a686d7c:
+ result = new TL_chatInviteAlready();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in ChatInvite", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_chatInvite extends ChatInvite {
+ public static int constructor = 0xce917dcd;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ title = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(title);
+ }
+ }
+
+ public static class TL_chatInviteAlready extends ChatInvite {
+ public static int constructor = 0x5a686d7c;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat = Chat.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ chat.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_photos_photo extends TLObject {
+ public static int constructor = 0x20212ca8;
+
+ public Photo photo;
+ public ArrayList users = new ArrayList<>();
+
+ public static TL_photos_photo TLdeserialize(AbsSerializedData 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;
+ }
+
+ public void readParams(AbsSerializedData 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ photo.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 class TL_resPQ extends TLObject {
+ public static int constructor = 0x05162463;
+
+ public byte[] nonce;
+ public byte[] server_nonce;
+ public byte[] pq;
+ public ArrayList server_public_key_fingerprints = new ArrayList<>();
+
+ public static TL_resPQ TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_resPQ.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_resPQ", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_resPQ result = new TL_resPQ();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ nonce = stream.readData(16, exception);
+ server_nonce = stream.readData(16, exception);
+ pq = 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++) {
+ server_public_key_fingerprints.add(stream.readInt64(exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeRaw(nonce);
+ stream.writeRaw(server_nonce);
+ stream.writeByteArray(pq);
+ stream.writeInt32(0x1cb5c415);
+ int count = server_public_key_fingerprints.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ stream.writeInt64(server_public_key_fingerprints.get(a));
+ }
+ }
+ }
+
+ public static class messages_SentEncryptedMessage extends TLObject {
+ public int date;
+ public EncryptedFile file;
+
+ public static messages_SentEncryptedMessage TLdeserialize(AbsSerializedData 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 void readParams(AbsSerializedData stream, boolean exception) {
+ date = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(date);
+ }
+ }
+
+ public static class TL_messages_sentEncryptedFile extends messages_SentEncryptedMessage {
+ public static int constructor = 0x9493ff32;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ date = stream.readInt32(exception);
+ file = EncryptedFile.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(date);
+ file.serializeToStream(stream);
+ }
+ }
+
+ public static class Update extends TLObject {
+ public int chat_id;
+ public int max_date;
+ public int date;
+ public int user_id;
+ public ContactLink my_link;
+ public ContactLink foreign_link;
+ public int max_id;
+ public int pts;
+ public int pts_count;
+ public int version;
+ public WebPage webpage;
+ public String type;
+ public MessageMedia media;
+ public boolean popup;
+ public PeerNotifySettings notify_settings;
+ public SendMessageAction action;
+ public String first_name;
+ public String last_name;
+ public String username;
+ public int qts;
+ public int id;
+ public long random_id;
+ public ArrayList dc_options = new ArrayList<>();
+ public ArrayList messages = new ArrayList<>();
+ public ChatParticipants participants;
+ public TL_privacyKeyStatusTimestamp key;
+ public ArrayList rules = new ArrayList<>();
+ public EncryptedChat chat;
+ public boolean blocked;
+ public String phone;
+ public long auth_key_id;
+ public String device;
+ public String location;
+ public UserProfilePhoto photo;
+ public boolean previous;
+ public int inviter_id;
+ public UserStatus status;
+ public NotifyPeer peer;
+
+ public static Update TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ Update result = null;
+ switch(constructor) {
+ case 0x38fe25b7:
+ result = new TL_updateEncryptedMessagesRead();
+ break;
+ case 0x9d2e67c5:
+ result = new TL_updateContactLink();
+ break;
+ case 0x9961fd5c:
+ result = new TL_updateReadHistoryInbox();
+ break;
+ case 0x2f2f21bf:
+ result = new TL_updateReadHistoryOutbox();
+ break;
+ case 0x6e5f8c22:
+ result = new TL_updateChatParticipantDelete();
+ break;
+ case 0x2cc36971:
+ result = new TL_updateWebPage();
+ break;
+ case 0x382dd3e4:
+ result = new TL_updateServiceNotification();
+ break;
+ case 0xbec268ef:
+ result = new TL_updateNotifySettings();
+ break;
+ case 0x5c486927:
+ result = new TL_updateUserTyping();
+ break;
+ case 0x9a65ea1f:
+ result = new TL_updateChatUserTyping();
+ break;
+ case 0xa7332b73:
+ result = new TL_updateUserName();
+ break;
+ case 0x12bcbd9a:
+ result = new TL_updateNewEncryptedMessage();
+ break;
+ case 0x1f2b0afd:
+ result = new TL_updateNewMessage();
+ break;
+ case 0x4e90bfd6:
+ result = new TL_updateMessageID();
+ break;
+ case 0x8e5e9873:
+ result = new TL_updateDcOptions();
+ break;
+ case 0x1710f156:
+ result = new TL_updateEncryptedChatTyping();
+ break;
+ case 0xa20db0e5:
+ result = new TL_updateDeleteMessages();
+ break;
+ case 0x68c13933:
+ result = new TL_updateReadMessagesContents();
+ break;
+ case 0x7761198:
+ result = new TL_updateChatParticipants();
+ break;
+ case 0xee3b272a:
+ result = new TL_updatePrivacy();
+ break;
+ case 0xb4a2e88d:
+ result = new TL_updateEncryption();
+ break;
+ case 0x80ece81a:
+ result = new TL_updateUserBlocked();
+ break;
+ case 0x12b9417b:
+ result = new TL_updateUserPhone();
+ break;
+ case 0x8f06529a:
+ result = new TL_updateNewAuthorization();
+ break;
+ case 0x5a68e3f7:
+ result = new TL_updateNewGeoChatMessage();
+ break;
+ case 0x95313b0c:
+ result = new TL_updateUserPhoto();
+ break;
+ case 0x2575bbb9:
+ result = new TL_updateContactRegistered();
+ break;
+ case 0x3a0eeb22:
+ result = new TL_updateChatParticipantAdd();
+ break;
+ case 0x1bfbd823:
+ result = new TL_updateUserStatus();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in Update", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_updateEncryptedMessagesRead extends Update {
+ public static int constructor = 0x38fe25b7;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ max_date = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ stream.writeInt32(max_date);
+ stream.writeInt32(date);
+ }
+ }
+
+ public static class TL_updateContactLink extends Update {
+ public static int constructor = 0x9d2e67c5;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ my_link = ContactLink.TLdeserialize(stream, stream.readInt32(exception), exception);
+ foreign_link = ContactLink.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ my_link.serializeToStream(stream);
+ foreign_link.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_updateReadHistoryInbox extends Update {
+ public static int constructor = 0x9961fd5c;
+
+ public Peer peer;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ peer = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ max_id = stream.readInt32(exception);
+ pts = stream.readInt32(exception);
+ pts_count = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ peer.serializeToStream(stream);
+ stream.writeInt32(max_id);
+ stream.writeInt32(pts);
+ stream.writeInt32(pts_count);
+ }
+ }
+
+ public static class TL_updateReadHistoryOutbox extends Update {
+ public static int constructor = 0x2f2f21bf;
+
+ public Peer peer;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ peer = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ max_id = stream.readInt32(exception);
+ pts = stream.readInt32(exception);
+ pts_count = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ peer.serializeToStream(stream);
+ stream.writeInt32(max_id);
+ stream.writeInt32(pts);
+ stream.writeInt32(pts_count);
+ }
+ }
+
+ public static class TL_updateChatParticipantDelete extends Update {
+ public static int constructor = 0x6e5f8c22;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ user_id = stream.readInt32(exception);
+ version = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ stream.writeInt32(user_id);
+ stream.writeInt32(version);
+ }
+ }
+
+ public static class TL_updateWebPage extends Update {
+ public static int constructor = 0x2cc36971;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ webpage = WebPage.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ webpage.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_updateServiceNotification extends Update {
+ public static int constructor = 0x382dd3e4;
+
+ public String message;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ type = stream.readString(exception);
+ message = stream.readString(exception);
+ media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception);
+ popup = stream.readBool(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(type);
+ stream.writeString(message);
+ media.serializeToStream(stream);
+ stream.writeBool(popup);
+ }
+ }
+
+ public static class TL_updateNotifySettings extends Update {
+ public static int constructor = 0xbec268ef;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ peer = NotifyPeer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ notify_settings = PeerNotifySettings.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ peer.serializeToStream(stream);
+ notify_settings.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_updateUserTyping extends Update {
+ public static int constructor = 0x5c486927;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ action = SendMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ action.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_updateChatUserTyping extends Update {
+ public static int constructor = 0x9a65ea1f;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ user_id = stream.readInt32(exception);
+ action = SendMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ stream.writeInt32(user_id);
+ action.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_updateUserName extends Update {
+ public static int constructor = 0xa7332b73;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ first_name = stream.readString(exception);
+ last_name = stream.readString(exception);
+ username = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeString(first_name);
+ stream.writeString(last_name);
+ stream.writeString(username);
+ }
+ }
+
+ public static class TL_updateNewEncryptedMessage extends Update {
+ public static int constructor = 0x12bcbd9a;
+
+ public EncryptedMessage message;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ message = EncryptedMessage.TLdeserialize(stream, stream.readInt32(exception), exception);
+ qts = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ message.serializeToStream(stream);
+ stream.writeInt32(qts);
+ }
+ }
+
+ public static class TL_updateNewMessage extends Update {
+ public static int constructor = 0x1f2b0afd;
+
+ public Message message;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ message = Message.TLdeserialize(stream, stream.readInt32(exception), exception);
+ pts = stream.readInt32(exception);
+ pts_count = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ message.serializeToStream(stream);
+ stream.writeInt32(pts);
+ stream.writeInt32(pts_count);
+ }
+ }
+
+ public static class TL_updateMessageID extends Update {
+ public static int constructor = 0x4e90bfd6;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ random_id = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeInt64(random_id);
+ }
+ }
+
+ public static class TL_updateDcOptions extends Update {
+ public static int constructor = 0x8e5e9873;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ dc_options.add(TL_dcOption.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = dc_options.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ dc_options.get(a).serializeToStream(stream);
+ }
+ }
+ }
+
+ public static class TL_updateEncryptedChatTyping extends Update {
+ public static int constructor = 0x1710f156;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ }
+ }
+
+ public static class TL_updateDeleteMessages extends Update {
+ public static int constructor = 0xa20db0e5;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ messages.add(stream.readInt32(exception));
+ }
+ pts = stream.readInt32(exception);
+ pts_count = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = messages.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ stream.writeInt32(messages.get(a));
+ }
+ stream.writeInt32(pts);
+ stream.writeInt32(pts_count);
+ }
+ }
+
+ public static class TL_updateReadMessagesContents extends Update {
+ public static int constructor = 0x68c13933;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ messages.add(stream.readInt32(exception));
+ }
+ pts = stream.readInt32(exception);
+ pts_count = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = messages.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ stream.writeInt32(messages.get(a));
+ }
+ stream.writeInt32(pts);
+ stream.writeInt32(pts_count);
+ }
+ }
+
+ public static class TL_updateChatParticipants extends Update {
+ public static int constructor = 0x7761198;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ participants = ChatParticipants.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ participants.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_updatePrivacy extends Update {
+ public static int constructor = 0xee3b272a;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ key = TL_privacyKeyStatusTimestamp.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++) {
+ rules.add(PrivacyRule.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ key.serializeToStream(stream);
+ stream.writeInt32(0x1cb5c415);
+ int count = rules.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ rules.get(a).serializeToStream(stream);
+ }
+ }
+ }
+
+ public static class TL_updateEncryption extends Update {
+ public static int constructor = 0xb4a2e88d;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat = EncryptedChat.TLdeserialize(stream, stream.readInt32(exception), exception);
+ date = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ chat.serializeToStream(stream);
+ stream.writeInt32(date);
+ }
+ }
+
+ public static class TL_updateUserBlocked extends Update {
+ public static int constructor = 0x80ece81a;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ blocked = stream.readBool(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeBool(blocked);
+ }
+ }
+
+ public static class TL_updateUserPhone extends Update {
+ public static int constructor = 0x12b9417b;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ phone = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeString(phone);
+ }
+ }
+
+ public static class TL_updateNewAuthorization extends Update {
+ public static int constructor = 0x8f06529a;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ auth_key_id = stream.readInt64(exception);
+ date = stream.readInt32(exception);
+ device = stream.readString(exception);
+ location = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(auth_key_id);
+ stream.writeInt32(date);
+ stream.writeString(device);
+ stream.writeString(location);
+ }
+ }
+
+ public static class TL_updateNewGeoChatMessage extends Update {
+ public static int constructor = 0x5a68e3f7;
+
+ public GeoChatMessage message;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ message = GeoChatMessage.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ message.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_updateUserPhoto extends Update {
+ public static int constructor = 0x95313b0c;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ photo = UserProfilePhoto.TLdeserialize(stream, stream.readInt32(exception), exception);
+ previous = stream.readBool(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeInt32(date);
+ photo.serializeToStream(stream);
+ stream.writeBool(previous);
+ }
+ }
+
+ public static class TL_updateContactRegistered extends Update {
+ public static int constructor = 0x2575bbb9;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeInt32(date);
+ }
+ }
+
+ public static class TL_updateChatParticipantAdd extends Update {
+ public static int constructor = 0x3a0eeb22;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ user_id = stream.readInt32(exception);
+ inviter_id = stream.readInt32(exception);
+ version = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ stream.writeInt32(user_id);
+ stream.writeInt32(inviter_id);
+ stream.writeInt32(version);
+ }
+ }
+
+ public static class TL_updateUserStatus extends Update {
+ public static int constructor = 0x1bfbd823;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ status = UserStatus.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ status.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_config extends TLObject {
+ public static int constructor = 0x4e32b894;
+
+ public int date;
+ public int expires;
+ public boolean test_mode;
+ public int this_dc;
+ public ArrayList dc_options = new ArrayList<>();
+ public int chat_size_max;
+ public int broadcast_size_max;
+ public int forwarded_count_max;
+ public int online_update_period_ms;
+ public int offline_blur_timeout_ms;
+ public int offline_idle_timeout_ms;
+ public int online_cloud_timeout_ms;
+ public int notify_cloud_delay_ms;
+ public int notify_default_delay_ms;
+ public int chat_big_size;
+ public int push_chat_period_ms;
+ public int push_chat_limit;
+ public ArrayList disabled_features = new ArrayList<>();
+
+ public static TL_config TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_config.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_config", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_config result = new TL_config();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ date = stream.readInt32(exception);
+ expires = stream.readInt32(exception);
+ test_mode = stream.readBool(exception);
+ this_dc = 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++) {
+ dc_options.add(TL_dcOption.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ chat_size_max = stream.readInt32(exception);
+ broadcast_size_max = stream.readInt32(exception);
+ forwarded_count_max = stream.readInt32(exception);
+ online_update_period_ms = stream.readInt32(exception);
+ offline_blur_timeout_ms = stream.readInt32(exception);
+ offline_idle_timeout_ms = stream.readInt32(exception);
+ online_cloud_timeout_ms = stream.readInt32(exception);
+ notify_cloud_delay_ms = stream.readInt32(exception);
+ notify_default_delay_ms = stream.readInt32(exception);
+ chat_big_size = stream.readInt32(exception);
+ push_chat_period_ms = stream.readInt32(exception);
+ push_chat_limit = 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++) {
+ disabled_features.add(TL_disabledFeature.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(date);
+ stream.writeInt32(expires);
+ stream.writeBool(test_mode);
+ stream.writeInt32(this_dc);
+ stream.writeInt32(0x1cb5c415);
+ int count = dc_options.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ dc_options.get(a).serializeToStream(stream);
+ }
+ stream.writeInt32(chat_size_max);
+ stream.writeInt32(broadcast_size_max);
+ stream.writeInt32(forwarded_count_max);
+ stream.writeInt32(online_update_period_ms);
+ stream.writeInt32(offline_blur_timeout_ms);
+ stream.writeInt32(offline_idle_timeout_ms);
+ stream.writeInt32(online_cloud_timeout_ms);
+ stream.writeInt32(notify_cloud_delay_ms);
+ stream.writeInt32(notify_default_delay_ms);
+ stream.writeInt32(chat_big_size);
+ stream.writeInt32(push_chat_period_ms);
+ stream.writeInt32(push_chat_limit);
+ stream.writeInt32(0x1cb5c415);
+ count = disabled_features.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ disabled_features.get(a).serializeToStream(stream);
+ }
+ }
+ }
+
+ public static class InputAudio extends TLObject {
+ public long id;
+ public long access_hash;
+
+ public static InputAudio TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputAudio result = null;
+ switch(constructor) {
+ case 0x77d440ff:
+ result = new TL_inputAudio();
+ break;
+ case 0xd95adc84:
+ result = new TL_inputAudioEmpty();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in InputAudio", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_inputAudio extends InputAudio {
+ public static int constructor = 0x77d440ff;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ access_hash = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ stream.writeInt64(access_hash);
+ }
+ }
+
+ public static class TL_inputAudioEmpty extends InputAudio {
+ public static int constructor = 0xd95adc84;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class PeerNotifySettings extends TLObject {
+ public int mute_until;
+ public String sound;
+ public boolean show_previews;
+ public int events_mask;
+
+ public static PeerNotifySettings TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ PeerNotifySettings result = null;
+ switch(constructor) {
+ case 0x70a68512:
+ result = new TL_peerNotifySettingsEmpty();
+ break;
+ case 0x8d5e11ee:
+ result = new TL_peerNotifySettings();
+ 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_peerNotifySettingsEmpty extends PeerNotifySettings {
+ public static int constructor = 0x70a68512;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_peerNotifySettings extends PeerNotifySettings {
+ public static int constructor = 0x8d5e11ee;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(mute_until);
+ stream.writeString(sound);
+ stream.writeBool(show_previews);
+ stream.writeInt32(events_mask);
+ }
+ }
+
+ public static class GeoChatMessage extends TLObject {
+ public int chat_id;
+ public int id;
+ public int from_id;
+ public int date;
+ public String message;
+ public MessageMedia media;
+ public MessageAction action;
+
+ public static GeoChatMessage TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ GeoChatMessage result = null;
+ switch(constructor) {
+ case 0x4505f8e1:
+ result = new TL_geoChatMessage();
+ break;
+ case 0xd34fa24e:
+ result = new TL_geoChatMessageService();
+ break;
+ case 0x60311a9b:
+ result = new TL_geoChatMessageEmpty();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in GeoChatMessage", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_geoChatMessage extends GeoChatMessage {
+ public static int constructor = 0x4505f8e1;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ id = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ message = stream.readString(exception);
+ media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ stream.writeInt32(id);
+ stream.writeInt32(from_id);
+ stream.writeInt32(date);
+ stream.writeString(message);
+ media.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_geoChatMessageService extends GeoChatMessage {
+ public static int constructor = 0xd34fa24e;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ id = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ action = MessageAction.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ stream.writeInt32(id);
+ stream.writeInt32(from_id);
+ stream.writeInt32(date);
+ action.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_geoChatMessageEmpty extends GeoChatMessage {
+ public static int constructor = 0x60311a9b;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ stream.writeInt32(id);
+ }
+ }
+
+ public static class messages_SentMessage extends TLObject {
+ public int id;
+ public int date;
+ public MessageMedia media;
+ public int pts;
+ public int pts_count;
+ public ArrayList links = new ArrayList<>();
+ public int seq;
+
+ public static messages_SentMessage TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ messages_SentMessage result = null;
+ switch(constructor) {
+ case 0x4c3d47f3:
+ result = new TL_messages_sentMessage();
+ break;
+ case 0x35a1a663:
+ result = new TL_messages_sentMessageLink();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in messages_SentMessage", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_messages_sentMessage extends messages_SentMessage {
+ public static int constructor = 0x4c3d47f3;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception);
+ pts = stream.readInt32(exception);
+ pts_count = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeInt32(date);
+ media.serializeToStream(stream);
+ stream.writeInt32(pts);
+ stream.writeInt32(pts_count);
+ }
+ }
+
+ public static class TL_messages_sentMessageLink extends messages_SentMessage {
+ public static int constructor = 0x35a1a663;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception);
+ pts = stream.readInt32(exception);
+ pts_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++) {
+ links.add(TL_contacts_link.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ seq = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeInt32(date);
+ media.serializeToStream(stream);
+ stream.writeInt32(pts);
+ stream.writeInt32(pts_count);
+ stream.writeInt32(0x1cb5c415);
+ int count = links.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ links.get(a).serializeToStream(stream);
+ }
+ stream.writeInt32(seq);
+ }
+ }
+
+ public static class TL_contactSuggested extends TLObject {
+ public static int constructor = 0x3de191a1;
+
+ public int user_id;
+ public int mutual_contacts;
+
+ public static TL_contactSuggested TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_contactSuggested.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_contactSuggested", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_contactSuggested result = new TL_contactSuggested();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ mutual_contacts = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeInt32(mutual_contacts);
+ }
+ }
+
+ public static class InputChatPhoto extends TLObject {
public InputPhoto id;
+ public InputPhotoCrop crop;
+ public InputFile file;
- public void readParams(AbsSerializedData stream) {
- id = (InputPhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public static InputChatPhoto TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputChatPhoto result = null;
+ switch(constructor) {
+ case 0xb2e1bf08:
+ result = new TL_inputChatPhoto();
+ break;
+ case 0x1ca48f57:
+ result = new TL_inputChatPhotoEmpty();
+ break;
+ case 0x94254732:
+ result = new TL_inputChatUploadedPhoto();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in InputChatPhoto", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_inputChatPhoto extends InputChatPhoto {
+ public static int constructor = 0xb2e1bf08;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = InputPhoto.TLdeserialize(stream, stream.readInt32(exception), exception);
+ crop = InputPhotoCrop.TLdeserialize(stream, stream.readInt32(exception), exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
id.serializeToStream(stream);
+ crop.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_inputChatPhotoEmpty extends InputChatPhoto {
+ public static int constructor = 0x1ca48f57;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputChatUploadedPhoto extends InputChatPhoto {
+ public static int constructor = 0x94254732;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ file = InputFile.TLdeserialize(stream, stream.readInt32(exception), exception);
+ crop = InputPhotoCrop.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ file.serializeToStream(stream);
+ crop.serializeToStream(stream);
+ }
+ }
+
+ public static class InputPeer extends TLObject {
+ public int user_id;
+ public int chat_id;
+ public long access_hash;
+
+ public static InputPeer TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputPeer result = null;
+ switch(constructor) {
+ case 0x1023dbe8:
+ result = new TL_inputPeerContact();
+ break;
+ case 0x179be863:
+ result = new TL_inputPeerChat();
+ break;
+ case 0x7f3b18ea:
+ result = new TL_inputPeerEmpty();
+ break;
+ case 0x7da07ec9:
+ result = new TL_inputPeerSelf();
+ break;
+ case 0x9b447325:
+ result = new TL_inputPeerForeign();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in InputPeer", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_inputPeerContact extends InputPeer {
+ public static int constructor = 0x1023dbe8;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ }
+ }
+
+ public static class TL_inputPeerChat extends InputPeer {
+ public static int constructor = 0x179be863;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ }
+ }
+
+ public static class TL_inputPeerEmpty extends InputPeer {
+ public static int constructor = 0x7f3b18ea;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputPeerSelf extends InputPeer {
+ public static int constructor = 0x7da07ec9;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputPeerForeign extends InputPeer {
+ public static int constructor = 0x9b447325;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ access_hash = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeInt64(access_hash);
+ }
+ }
+
+ public static class TL_msg_copy extends TLObject {
+ public static int constructor = 0xe06046b2;
+
+ public TL_protoMessage orig_message;
+
+ public static TL_msg_copy TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_msg_copy.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_msg_copy", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_msg_copy result = new TL_msg_copy();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ orig_message = TL_protoMessage.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ orig_message.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_fileLocation extends FileLocation {
+ public static int constructor = 0x53d69076;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ dc_id = stream.readInt32(exception);
+ volume_id = stream.readInt64(exception);
+ local_id = stream.readInt32(exception);
+ secret = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(dc_id);
+ stream.writeInt64(volume_id);
+ stream.writeInt32(local_id);
+ stream.writeInt64(secret);
+ }
+ }
+
+ public static class TL_fileLocationUnavailable extends FileLocation {
+ public static int constructor = 0x7c596b46;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ volume_id = stream.readInt64(exception);
+ local_id = stream.readInt32(exception);
+ secret = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(volume_id);
+ stream.writeInt32(local_id);
+ stream.writeInt64(secret);
+ }
+ }
+
+ public static class TL_pong extends TLObject {
+ public static int constructor = 0x347773c5;
+
+ public long msg_id;
+ public long ping_id;
+
+ public static TL_pong TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_pong.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_pong", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_pong result = new TL_pong();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ msg_id = stream.readInt64(exception);
+ ping_id = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(msg_id);
+ stream.writeInt64(ping_id);
+ }
+ }
+
+ public static class TL_inputAppEvent extends TLObject {
+ public static int constructor = 0x770656a8;
+
+ public double time;
+ public String type;
+ public long peer;
+ public String data;
+
+ public static TL_inputAppEvent TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_inputAppEvent.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_inputAppEvent", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_inputAppEvent result = new TL_inputAppEvent();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ time = stream.readDouble(exception);
+ type = stream.readString(exception);
+ peer = stream.readInt64(exception);
+ data = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeDouble(time);
+ stream.writeString(type);
+ stream.writeInt64(peer);
+ stream.writeString(data);
+ }
+ }
+
+ public static class TL_messages_chatFull extends TLObject {
+ public static int constructor = 0xe5d7d19c;
+
+ public TL_chatFull full_chat;
+ public ArrayList chats = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
+
+ public static TL_messages_chatFull TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ full_chat = TL_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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData 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 InputNotifyPeer extends TLObject {
+
+ public static InputNotifyPeer TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputNotifyPeer result = null;
+ switch(constructor) {
+ case 0x4a95e84e:
+ result = new TL_inputNotifyChats();
+ break;
+ case 0xb8bc5b0c:
+ result = new TL_inputNotifyPeer();
+ break;
+ case 0x193b4417:
+ result = new TL_inputNotifyUsers();
+ break;
+ case 0x4d8ddec8:
+ result = new TL_inputNotifyGeoChatPeer();
+ break;
+ case 0xa429b886:
+ result = new TL_inputNotifyAll();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in InputNotifyPeer", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_inputNotifyChats extends InputNotifyPeer {
+ public static int constructor = 0x4a95e84e;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputNotifyPeer extends InputNotifyPeer {
+ public static int constructor = 0xb8bc5b0c;
+
+ public InputPeer peer;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ peer = InputPeer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ peer.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_inputNotifyUsers extends InputNotifyPeer {
+ public static int constructor = 0x193b4417;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputNotifyGeoChatPeer extends InputNotifyPeer {
+ public static int constructor = 0x4d8ddec8;
+
+ public TL_inputGeoChat peer;
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ peer = TL_inputGeoChat.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ peer.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_inputNotifyAll extends InputNotifyPeer {
+ public static int constructor = 0xa429b886;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_messages_affectedHistory extends TLObject {
+ public static int constructor = 0xb45c69d1;
+
+ public int pts;
+ public int pts_count;
+ public int offset;
+
+ public static TL_messages_affectedHistory TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ pts = stream.readInt32(exception);
+ pts_count = stream.readInt32(exception);
+ offset = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(pts);
+ stream.writeInt32(pts_count);
+ stream.writeInt32(offset);
+ }
+ }
+
+ public static class RpcDropAnswer extends TLObject {
+ public long msg_id;
+ public int seq_no;
+ public int bytes;
+
+ public static RpcDropAnswer TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ RpcDropAnswer result = null;
+ switch(constructor) {
+ case 0x5e2ad36e:
+ result = new TL_rpc_answer_unknown();
+ break;
+ case 0xa43ad8b7:
+ result = new TL_rpc_answer_dropped();
+ break;
+ case 0xcd78e586:
+ result = new TL_rpc_answer_dropped_running();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in RpcDropAnswer", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_rpc_answer_unknown extends RpcDropAnswer {
+ public static int constructor = 0x5e2ad36e;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_rpc_answer_dropped extends RpcDropAnswer {
+ public static int constructor = 0xa43ad8b7;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ msg_id = stream.readInt64(exception);
+ seq_no = stream.readInt32(exception);
+ bytes = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(msg_id);
+ stream.writeInt32(seq_no);
+ stream.writeInt32(bytes);
+ }
+ }
+
+ public static class TL_rpc_answer_dropped_running extends RpcDropAnswer {
+ public static int constructor = 0xcd78e586;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class InputVideo extends TLObject {
+ public long id;
+ public long access_hash;
+
+ public static InputVideo TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputVideo result = null;
+ switch(constructor) {
+ case 0x5508ec75:
+ result = new TL_inputVideoEmpty();
+ break;
+ case 0xee579652:
+ result = new TL_inputVideo();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in InputVideo", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_inputVideoEmpty extends InputVideo {
+ public static int constructor = 0x5508ec75;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputVideo extends InputVideo {
+ public static int constructor = 0xee579652;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ access_hash = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ stream.writeInt64(access_hash);
+ }
+ }
+
+ public static class messages_DhConfig extends TLObject {
+ public byte[] random;
+ public int g;
+ public byte[] p;
+ public int version;
+
+ public static messages_DhConfig TLdeserialize(AbsSerializedData 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 void readParams(AbsSerializedData stream, boolean exception) {
+ random = stream.readByteArray(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeByteArray(random);
+ }
+ }
+
+ public static class TL_messages_dhConfig extends messages_DhConfig {
+ public static int constructor = 0x2c221edd;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ g = stream.readInt32(exception);
+ p = stream.readByteArray(exception);
+ version = stream.readInt32(exception);
+ random = stream.readByteArray(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(g);
+ stream.writeByteArray(p);
+ stream.writeInt32(version);
+ stream.writeByteArray(random);
+ }
+ }
+
+ public static class Peer extends TLObject {
+ public int user_id;
+ public int chat_id;
+
+ public static Peer TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ Peer result = null;
+ switch(constructor) {
+ case 0x9db1bc6d:
+ result = new TL_peerUser();
+ break;
+ case 0xbad0e5bb:
+ result = new TL_peerChat();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in Peer", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_peerUser extends Peer {
+ public static int constructor = 0x9db1bc6d;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ }
+ }
+
+ public static class TL_peerChat extends Peer {
+ public static int constructor = 0xbad0e5bb;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ }
+ }
+
+ public static class TL_dcOption extends TLObject {
+ public static int constructor = 0x2ec2a43c;
+
+ public int id;
+ public String hostname;
+ public String ip_address;
+ public int port;
+
+ public static TL_dcOption TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ hostname = stream.readString(exception);
+ ip_address = stream.readString(exception);
+ port = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeString(hostname);
+ stream.writeString(ip_address);
+ stream.writeInt32(port);
+ }
+ }
+
+ public static class InputFile extends TLObject {
+ public long id;
+ public int parts;
+ public String name;
+ public String md5_checksum;
+
+ public static InputFile TLdeserialize(AbsSerializedData 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 void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ parts = stream.readInt32(exception);
+ name = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ parts = stream.readInt32(exception);
+ name = stream.readString(exception);
+ md5_checksum = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ stream.writeInt32(parts);
+ stream.writeString(name);
+ stream.writeString(md5_checksum);
+ }
+ }
+
+ public static class TL_account_passwordInputSettings extends TLObject {
+ public static int constructor = 0xbcfc532c;
+
+ public int flags;
+ public byte[] new_salt;
+ public byte[] new_password_hash;
+ public String hint;
+ public String email;
+
+ public static TL_account_passwordInputSettings TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ flags = stream.readInt32(exception);
+ if ((flags & 1) != 0) {
+ new_salt = stream.readByteArray(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);
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(flags);
+ if ((flags & 1) != 0) {
+ stream.writeByteArray(new_salt);
+ }
+ if ((flags & 1) != 0) {
+ stream.writeByteArray(new_password_hash);
+ }
+ if ((flags & 1) != 0) {
+ stream.writeString(hint);
+ }
+ if ((flags & 2) != 0) {
+ stream.writeString(email);
+ }
+ }
+ }
+
+ public static class InputUser extends TLObject {
+ public int user_id;
+ public long access_hash;
+
+ public static InputUser TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputUser result = null;
+ switch(constructor) {
+ case 0xf7c1b13f:
+ result = new TL_inputUserSelf();
+ break;
+ case 0x655e74ff:
+ result = new TL_inputUserForeign();
+ break;
+ case 0xb98886cf:
+ result = new TL_inputUserEmpty();
+ break;
+ case 0x86e94f65:
+ result = new TL_inputUserContact();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in InputUser", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_inputUserSelf extends InputUser {
+ public static int constructor = 0xf7c1b13f;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputUserForeign extends InputUser {
+ public static int constructor = 0x655e74ff;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ access_hash = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeInt64(access_hash);
+ }
+ }
+
+ public static class TL_inputUserEmpty extends InputUser {
+ public static int constructor = 0xb98886cf;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputUserContact extends InputUser {
+ public static int constructor = 0x86e94f65;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ }
+ }
+
+ public static class TL_chatParticipant extends TLObject {
+ public static int constructor = 0xc8d7493e;
+
+ public int user_id;
+ public int inviter_id;
+ public int date;
+
+ public static TL_chatParticipant TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_chatParticipant.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_chatParticipant", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_chatParticipant result = new TL_chatParticipant();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ inviter_id = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeInt32(inviter_id);
+ stream.writeInt32(date);
+ }
+ }
+
+ public static class EncryptedFile extends TLObject {
+ public long id;
+ public long access_hash;
+ public int size;
+ public int dc_id;
+ public int key_fingerprint;
+
+ public static EncryptedFile TLdeserialize(AbsSerializedData 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 void readParams(AbsSerializedData 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(AbsSerializedData 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 void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_account_privacyRules extends TLObject {
+ public static int constructor = 0x554abb6f;
+
+ public ArrayList rules = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
+
+ public static TL_account_privacyRules TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_account_privacyRules.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_account_privacyRules", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_account_privacyRules result = new TL_account_privacyRules();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData 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++) {
+ rules.add(PrivacyRule.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = rules.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ rules.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_auth_exportedAuthorization extends TLObject {
+ public static int constructor = 0xdf969c2d;
+
+ public int id;
+ public byte[] bytes;
+
+ public static TL_auth_exportedAuthorization TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_auth_exportedAuthorization.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_auth_exportedAuthorization", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_auth_exportedAuthorization result = new TL_auth_exportedAuthorization();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ bytes = stream.readByteArray(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeByteArray(bytes);
+ }
+ }
+
+ public static class InputFileLocation extends TLObject {
+ public long id;
+ public long access_hash;
+ public long volume_id;
+ public int local_id;
+ public long secret;
+
+ public static InputFileLocation TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputFileLocation result = null;
+ switch(constructor) {
+ case 0x74dc404d:
+ result = new TL_inputAudioFileLocation();
+ break;
+ case 0xf5235d55:
+ result = new TL_inputEncryptedFileLocation();
+ break;
+ case 0x3d0364ec:
+ result = new TL_inputVideoFileLocation();
+ break;
+ case 0x4e45abe9:
+ result = new TL_inputDocumentFileLocation();
+ break;
+ case 0x14637196:
+ result = new TL_inputFileLocation();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in InputFileLocation", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_inputAudioFileLocation extends InputFileLocation {
+ public static int constructor = 0x74dc404d;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ access_hash = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ stream.writeInt64(access_hash);
+ }
+ }
+
+ public static class TL_inputEncryptedFileLocation extends InputFileLocation {
+ public static int constructor = 0xf5235d55;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ access_hash = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ stream.writeInt64(access_hash);
+ }
+ }
+
+ public static class TL_inputVideoFileLocation extends InputFileLocation {
+ public static int constructor = 0x3d0364ec;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ access_hash = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ stream.writeInt64(access_hash);
+ }
+ }
+
+ public static class TL_inputDocumentFileLocation extends InputFileLocation {
+ public static int constructor = 0x4e45abe9;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ access_hash = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ stream.writeInt64(access_hash);
+ }
+ }
+
+ public static class TL_inputFileLocation extends InputFileLocation {
+ public static int constructor = 0x14637196;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ volume_id = stream.readInt64(exception);
+ local_id = stream.readInt32(exception);
+ secret = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(volume_id);
+ stream.writeInt32(local_id);
+ stream.writeInt64(secret);
+ }
+ }
+
+ public static class TL_chatFull extends TLObject {
+ public static int constructor = 0xcade0791;
+
+ public int id;
+ public ChatParticipants participants;
+ public Photo chat_photo;
+ public PeerNotifySettings notify_settings;
+ public ExportedChatInvite exported_invite;
+
+ public static TL_chatFull TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_chatFull.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_chatFull", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_chatFull result = new TL_chatFull();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ participants = ChatParticipants.TLdeserialize(stream, stream.readInt32(exception), exception);
+ chat_photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception);
+ notify_settings = PeerNotifySettings.TLdeserialize(stream, stream.readInt32(exception), exception);
+ exported_invite = ExportedChatInvite.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ participants.serializeToStream(stream);
+ chat_photo.serializeToStream(stream);
+ notify_settings.serializeToStream(stream);
+ exported_invite.serializeToStream(stream);
+ }
+ }
+
+ public static class InputGeoPoint extends TLObject {
+ public double lat;
+ public double _long;
+
+ public static InputGeoPoint TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputGeoPoint result = null;
+ switch(constructor) {
+ case 0xf3b7acc9:
+ 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;
+ }
+ }
+
+ public static class TL_inputGeoPoint extends InputGeoPoint {
+ public static int constructor = 0xf3b7acc9;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ lat = stream.readDouble(exception);
+ _long = stream.readDouble(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeDouble(lat);
+ stream.writeDouble(_long);
+ }
+ }
+
+ public static class TL_inputGeoPointEmpty extends InputGeoPoint {
+ public static int constructor = 0xe4c123d6;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_photo extends Photo {
+ public static int constructor = 0xc3838076;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ access_hash = stream.readInt64(exception);
+ user_id = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ geo = GeoPoint.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++) {
+ sizes.add(PhotoSize.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ stream.writeInt64(access_hash);
+ stream.writeInt32(user_id);
+ stream.writeInt32(date);
+ geo.serializeToStream(stream);
+ stream.writeInt32(0x1cb5c415);
+ int count = sizes.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ sizes.get(a).serializeToStream(stream);
+ }
+ }
+ }
+
+ public static class TL_photoEmpty extends Photo {
+ public static int constructor = 0x2331b22d;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ }
+ }
+
+ public static class TL_help_support extends TLObject {
+ public static int constructor = 0x17c6b5f6;
+
+ public String phone_number;
+ public User user;
+
+ public static TL_help_support TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ phone_number = stream.readString(exception);
+ user = User.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(phone_number);
+ user.serializeToStream(stream);
+ }
+ }
+
+ 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 static TL_inputPhoneContact TLdeserialize(AbsSerializedData 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(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(client_id);
+ stream.writeString(phone);
+ stream.writeString(first_name);
+ stream.writeString(last_name);
+ }
+ }
+
+ public static class Bool extends TLObject {
+
+ public static Bool TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ Bool result = null;
+ switch(constructor) {
+ case 0x997275b5:
+ result = new TL_boolTrue();
+ break;
+ case 0xbc799737:
+ 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;
+ }
+ }
+
+ public static class TL_boolTrue extends Bool {
+ public static int constructor = 0x997275b5;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_boolFalse extends Bool {
+ public static int constructor = 0xbc799737;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static 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(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ random_id = stream.readInt64(exception);
+ chat_id = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ bytes = stream.readByteArray(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData 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(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(random_id);
+ stream.writeInt32(chat_id);
+ stream.writeInt32(date);
+ stream.writeByteArray(bytes);
+ file.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_messages_messageEmpty extends TLObject {
+ public static int constructor = 0x3f4e0648;
+
+
+ public static TL_messages_messageEmpty TLdeserialize(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class DestroySessionRes extends TLObject {
+ public long session_id;
+
+ public static DestroySessionRes TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ DestroySessionRes result = null;
+ switch(constructor) {
+ case 0xe22045fc:
+ result = new TL_destroy_session_ok();
+ break;
+ case 0x62d350c9:
+ result = new TL_destroy_session_none();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in DestroySessionRes", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_destroy_session_ok extends DestroySessionRes {
+ public static int constructor = 0xe22045fc;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ session_id = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(session_id);
+ }
+ }
+
+ public static class TL_destroy_session_none extends DestroySessionRes {
+ public static int constructor = 0x62d350c9;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ session_id = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(session_id);
+ }
+ }
+
+ public static 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(AbsSerializedData stream, int constructor, boolean exception) {
+ PhotoSize result = null;
+ switch(constructor) {
+ case 0x77bfb61b:
+ result = new TL_photoSize();
+ break;
+ case 0xe17e23c:
+ result = new TL_photoSizeEmpty();
+ break;
+ case 0xe9a734fa:
+ result = new TL_photoCachedSize();
+ 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);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_photoSize extends PhotoSize {
+ public static int constructor = 0x77bfb61b;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ type = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(type);
+ }
+ }
+
+ public static class TL_photoCachedSize extends PhotoSize {
+ public static int constructor = 0xe9a734fa;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(type);
+ location.serializeToStream(stream);
+ stream.writeInt32(w);
+ stream.writeInt32(h);
+ stream.writeByteArray(bytes);
+ }
+ }
+
+ public static class TL_messageActionChatEditPhoto extends MessageAction {
+ public static int constructor = 0x7fcb13a8;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ photo.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_messageActionChatDeleteUser extends MessageAction {
+ public static int constructor = 0xb2ae9b0c;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ }
+ }
+
+ public static class TL_messageActionChatJoinedByLink extends MessageAction {
+ public static int constructor = 0xf89cf5e8;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ inviter_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(inviter_id);
+ }
+ }
+
+ public static class TL_messageActionChatDeletePhoto extends MessageAction {
+ public static int constructor = 0x95e3fbef;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_messageActionChatAddUser extends MessageAction {
+ public static int constructor = 0x5e3cfc4b;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ }
+ }
+
+ public static class TL_messageActionChatCreate extends MessageAction {
+ public static int constructor = 0xa6638b9a;
+
+
+ public void readParams(AbsSerializedData 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(stream.readInt32(exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData 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(users.get(a));
+ }
+ }
+ }
+
+ public static class TL_messageActionEmpty extends MessageAction {
+ public static int constructor = 0xb6aef7b0;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_messageActionChatEditTitle extends MessageAction {
+ public static int constructor = 0xb5a1ce5a;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ title = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(title);
+ }
+ }
+
+ public static class TL_messageActionGeoChatCreate extends MessageAction {
+ public static int constructor = 0x6f038ebc;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ title = stream.readString(exception);
+ address = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(title);
+ stream.writeString(address);
+ }
+ }
+
+ public static class TL_messageActionGeoChatCheckin extends MessageAction {
+ public static int constructor = 0xc7d53de;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static 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(AbsSerializedData 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) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_decryptedMessageActionSetMessageTTL extends DecryptedMessageAction {
+ public static int constructor = 0xa1733aec;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ ttl_seconds = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(ttl_seconds);
+ }
+ }
+
+ public static class TL_decryptedMessageActionNotifyLayer extends DecryptedMessageAction {
+ public static int constructor = 0xf3048883;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ layer = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(layer);
+ }
+ }
+
+ public static class TL_decryptedMessageActionDeleteMessages extends DecryptedMessageAction {
+ public static int constructor = 0x65614304;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ exchange_id = stream.readInt64(exception);
+ key_fingerprint = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ exchange_id = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(exchange_id);
+ }
+ }
+
+ public static class TL_decryptedMessageActionFlushHistory extends DecryptedMessageAction {
+ public static int constructor = 0x6719e45c;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_decryptedMessageActionTyping extends DecryptedMessageAction {
+ public static int constructor = 0xccb27641;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ action = SendMessageAction.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ action.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_decryptedMessageActionAcceptKey extends DecryptedMessageAction {
+ public static int constructor = 0x6fe1735b;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ exchange_id = stream.readInt64(exception);
+ g_b = stream.readByteArray(exception);
+ key_fingerprint = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData 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(AbsSerializedData 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(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ start_seq_no = stream.readInt32(exception);
+ end_seq_no = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ exchange_id = stream.readInt64(exception);
+ g_a = stream.readByteArray(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData 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(AbsSerializedData 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(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputGeoChat extends TLObject {
+ public static int constructor = 0x74d456fa;
+
+ public int chat_id;
+ public long access_hash;
+
+ public static TL_inputGeoChat TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_inputGeoChat.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_inputGeoChat", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_inputGeoChat result = new TL_inputGeoChat();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ chat_id = stream.readInt32(exception);
+ access_hash = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ stream.writeInt64(access_hash);
+ }
+ }
+
+ public static class TL_msgs_state_req extends TLObject {
+ public static int constructor = 0xda69fb52;
+
+ public ArrayList msg_ids = new ArrayList<>();
+
+ public static TL_msgs_state_req TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_msgs_state_req.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_msgs_state_req", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_msgs_state_req result = new TL_msgs_state_req();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData 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++) {
+ msg_ids.add(stream.readInt64(exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = msg_ids.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ stream.writeInt64(msg_ids.get(a));
+ }
+ }
+ }
+
+ public static class TL_importedContact extends TLObject {
+ public static int constructor = 0xd0028438;
+
+ public int user_id;
+ public long client_id;
+
+ public static TL_importedContact TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_importedContact.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_importedContact", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_importedContact result = new TL_importedContact();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ client_id = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(user_id);
+ stream.writeInt64(client_id);
+ }
+ }
+
+ public static class auth_SentCode extends TLObject {
+ public boolean phone_registered;
+ public String phone_code_hash;
+ public int send_call_timeout;
+ public boolean is_password;
+
+ public static auth_SentCode TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ auth_SentCode result = null;
+ switch(constructor) {
+ case 0xe325edcf:
+ result = new TL_auth_sentAppCode();
+ break;
+ case 0xefed51d9:
+ result = new TL_auth_sentCode();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in auth_SentCode", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_auth_sentAppCode extends auth_SentCode {
+ public static int constructor = 0xe325edcf;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ phone_registered = stream.readBool(exception);
+ phone_code_hash = stream.readString(exception);
+ send_call_timeout = stream.readInt32(exception);
+ is_password = stream.readBool(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeBool(phone_registered);
+ stream.writeString(phone_code_hash);
+ stream.writeInt32(send_call_timeout);
+ stream.writeBool(is_password);
+ }
+ }
+
+ public static class TL_auth_sentCode extends auth_SentCode {
+ public static int constructor = 0xefed51d9;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ phone_registered = stream.readBool(exception);
+ phone_code_hash = stream.readString(exception);
+ send_call_timeout = stream.readInt32(exception);
+ is_password = stream.readBool(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeBool(phone_registered);
+ stream.writeString(phone_code_hash);
+ stream.writeInt32(send_call_timeout);
+ stream.writeBool(is_password);
+ }
+ }
+
+ public static class TL_help_inviteText extends TLObject {
+ public static int constructor = 0x18cb9f78;
+
+ public String message;
+
+ public static TL_help_inviteText TLdeserialize(AbsSerializedData 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 {
+ return null;
+ }
+ }
+ TL_help_inviteText result = new TL_help_inviteText();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ message = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(message);
+ }
+ }
+
+ public static class messages_AllStickers extends TLObject {
+ public String hash;
+ public ArrayList packs = new ArrayList<>();
+ public ArrayList documents = new ArrayList<>();
+
+ public static messages_AllStickers TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ messages_AllStickers result = null;
+ switch(constructor) {
+ case 0xdcef3102:
+ 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;
+ }
+ }
+
+ public static class TL_messages_allStickers extends messages_AllStickers {
+ public static int constructor = 0xdcef3102;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ hash = 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++) {
+ packs.add(TL_stickerPack.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ documents.add(Document.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(hash);
+ stream.writeInt32(0x1cb5c415);
+ int count = packs.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ packs.get(a).serializeToStream(stream);
+ }
+ stream.writeInt32(0x1cb5c415);
+ count = documents.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ documents.get(a).serializeToStream(stream);
+ }
+ }
+ }
+
+ public static class TL_messages_allStickersNotModified extends messages_AllStickers {
+ public static int constructor = 0xe86602c3;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_auth_checkedPhone extends TLObject {
+ public static int constructor = 0x811ea28e;
+
+ public boolean phone_registered;
+
+ public static TL_auth_checkedPhone TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_auth_checkedPhone.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_auth_checkedPhone", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_auth_checkedPhone result = new TL_auth_checkedPhone();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ phone_registered = stream.readBool(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeBool(phone_registered);
+ }
+ }
+
+ public static class TL_userProfilePhotoEmpty extends UserProfilePhoto {
+ public static int constructor = 0x4f11bae1;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_userProfilePhoto extends UserProfilePhoto {
+ public static int constructor = 0xd559d8c8;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ photo_id = stream.readInt64(exception);
+ photo_small = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception);
+ photo_big = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(photo_id);
+ photo_small.serializeToStream(stream);
+ photo_big.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_authorization extends TLObject {
+ public static int constructor = 0x7bf2e6f6;
+
+ public long hash;
+ public int flags;
+ public String device_model;
+ public String platform;
+ public String system_version;
+ public int api_id;
+ public String app_name;
+ public String app_version;
+ public int date_created;
+ public int date_active;
+ public String ip;
+ public String country;
+ public String region;
+
+ public static TL_authorization TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_authorization.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_authorization", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_authorization result = new TL_authorization();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ hash = stream.readInt64(exception);
+ flags = stream.readInt32(exception);
+ device_model = stream.readString(exception);
+ platform = stream.readString(exception);
+ system_version = stream.readString(exception);
+ api_id = stream.readInt32(exception);
+ app_name = stream.readString(exception);
+ app_version = stream.readString(exception);
+ date_created = stream.readInt32(exception);
+ date_active = stream.readInt32(exception);
+ ip = stream.readString(exception);
+ country = stream.readString(exception);
+ region = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(hash);
+ stream.writeInt32(flags);
+ stream.writeString(device_model);
+ stream.writeString(platform);
+ stream.writeString(system_version);
+ stream.writeInt32(api_id);
+ stream.writeString(app_name);
+ stream.writeString(app_version);
+ stream.writeInt32(date_created);
+ stream.writeInt32(date_active);
+ stream.writeString(ip);
+ stream.writeString(country);
+ stream.writeString(region);
+ }
+ }
+
+ public static class Server_DH_Params extends TLObject {
+ public byte[] nonce;
+ public byte[] server_nonce;
+ public byte[] new_nonce_hash;
+ public byte[] encrypted_answer;
+
+ public static Server_DH_Params TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ Server_DH_Params result = null;
+ switch(constructor) {
+ case 0x79cb045d:
+ result = new TL_server_DH_params_fail();
+ break;
+ case 0xd0e8075c:
+ result = new TL_server_DH_params_ok();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in Server_DH_Params", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_server_DH_params_fail extends Server_DH_Params {
+ public static int constructor = 0x79cb045d;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ nonce = stream.readData(16, exception);
+ server_nonce = stream.readData(16, exception);
+ new_nonce_hash = stream.readData(16, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeRaw(nonce);
+ stream.writeRaw(server_nonce);
+ stream.writeRaw(new_nonce_hash);
+ }
+ }
+
+ public static class TL_server_DH_params_ok extends Server_DH_Params {
+ public static int constructor = 0xd0e8075c;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ nonce = stream.readData(16, exception);
+ server_nonce = stream.readData(16, exception);
+ encrypted_answer = stream.readByteArray(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeRaw(nonce);
+ stream.writeRaw(server_nonce);
+ stream.writeByteArray(encrypted_answer);
+ }
+ }
+
+ public static class TL_protoMessage extends TLObject {
+ public static int constructor = 0x5bb8e511;
+
+ public long msg_id;
+ public int seqno;
+ public int bytes;
+ public TLObject body;
+
+ public static TL_protoMessage TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_protoMessage.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_protoMessage", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_protoMessage result = new TL_protoMessage();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ msg_id = stream.readInt64(exception);
+ seqno = stream.readInt32(exception);
+ bytes = stream.readInt32(exception);
+ body = TLClassStore.Instance().TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(msg_id);
+ stream.writeInt32(seqno);
+ stream.writeInt32(bytes);
+ body.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_geochats_located extends TLObject {
+ public static int constructor = 0x48feb267;
+
+ public ArrayList results = new ArrayList<>();
+ public ArrayList messages = new ArrayList<>();
+ public ArrayList chats = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
+
+ public static TL_geochats_located TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_geochats_located.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_geochats_located", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_geochats_located result = new TL_geochats_located();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData 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++) {
+ results.add(TL_chatLocated.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ messages.add(GeoChatMessage.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = results.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ results.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);
+ }
+ }
+ }
+
+ public static class TL_msgs_all_info extends TLObject {
+ public static int constructor = 0x8cc0d131;
+
+ public ArrayList msg_ids = new ArrayList<>();
+ public String info;
+
+ public static TL_msgs_all_info TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_msgs_all_info.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_msgs_all_info", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_msgs_all_info result = new TL_msgs_all_info();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData 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++) {
+ msg_ids.add(stream.readInt64(exception));
+ }
+ info = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = msg_ids.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ stream.writeInt64(msg_ids.get(a));
+ }
+ stream.writeString(info);
+ }
+ }
+
+ public static class contacts_Blocked extends TLObject {
+ public ArrayList blocked = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
+ public int count;
+
+ public static contacts_Blocked TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ contacts_Blocked result = null;
+ switch(constructor) {
+ case 0x1c138d15:
+ result = new TL_contacts_blocked();
+ break;
+ case 0x900802a1:
+ result = new TL_contacts_blockedSlice();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in contacts_Blocked", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_contacts_blocked extends contacts_Blocked {
+ public static int constructor = 0x1c138d15;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ blocked.add(TL_contactBlocked.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = blocked.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ blocked.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_blockedSlice extends contacts_Blocked {
+ public static int constructor = 0x900802a1;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ blocked.add(TL_contactBlocked.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(count);
+ stream.writeInt32(0x1cb5c415);
+ int count = blocked.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ blocked.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_encryptedChatWaiting extends EncryptedChat {
+ public static int constructor = 0x3bf703dc;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeInt64(access_hash);
+ stream.writeInt32(date);
+ stream.writeInt32(admin_id);
+ stream.writeInt32(participant_id);
+ }
+ }
+
+ public static class TL_encryptedChatEmpty extends EncryptedChat {
+ public static int constructor = 0xab7ec0a0;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ }
+ }
+
+ public static class TL_encryptedChatDiscarded extends EncryptedChat {
+ public static int constructor = 0x13d6dd27;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ }
+ }
+
+ public static class TL_encryptedChat extends EncryptedChat {
+ public static int constructor = 0xfa56ce36;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeInt64(access_hash);
+ stream.writeInt32(date);
+ stream.writeInt32(admin_id);
+ stream.writeInt32(participant_id);
+ stream.writeByteArray(g_a_or_b);
+ stream.writeInt64(key_fingerprint);
+ }
+ }
+
+ public static class TL_encryptedChatRequested extends EncryptedChat {
+ public static int constructor = 0xc878527e;
+
+
+ public void readParams(AbsSerializedData 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);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeInt64(access_hash);
+ stream.writeInt32(date);
+ stream.writeInt32(admin_id);
+ stream.writeInt32(participant_id);
+ stream.writeByteArray(g_a);
+ }
+ }
+
+ public static class help_AppUpdate extends TLObject {
+ public int id;
+ public boolean critical;
+ public String url;
+ public String text;
+
+ public static help_AppUpdate TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ help_AppUpdate result = null;
+ switch(constructor) {
+ case 0x8987f311:
+ result = new TL_help_appUpdate();
+ break;
+ case 0xc45a6536:
+ result = new TL_help_noAppUpdate();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in help_AppUpdate", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_help_appUpdate extends help_AppUpdate {
+ public static int constructor = 0x8987f311;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ critical = stream.readBool(exception);
+ url = stream.readString(exception);
+ text = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeBool(critical);
+ stream.writeString(url);
+ stream.writeString(text);
+ }
+ }
+
+ public static class TL_help_noAppUpdate extends help_AppUpdate {
+ public static int constructor = 0xc45a6536;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class messages_Stickers extends TLObject {
+ public String hash;
+ public ArrayList stickers = new ArrayList<>();
+
+ public static messages_Stickers TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ messages_Stickers result = null;
+ switch(constructor) {
+ case 0xf1749a22:
+ result = new TL_messages_stickersNotModified();
+ break;
+ case 0x8a8ecd32:
+ 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;
+ }
+ }
+
+ public static class TL_messages_stickersNotModified extends messages_Stickers {
+ public static int constructor = 0xf1749a22;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_messages_stickers extends messages_Stickers {
+ public static int constructor = 0x8a8ecd32;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ hash = 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++) {
+ stickers.add(Document.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(hash);
+ stream.writeInt32(0x1cb5c415);
+ int count = stickers.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ stickers.get(a).serializeToStream(stream);
+ }
+ }
+ }
+
+ public static class TL_video extends Video {
+ public static int constructor = 0xee9f4a4d;
+
+
+ public void readParams(AbsSerializedData 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(stream, stream.readInt32(exception), exception);
+ dc_id = stream.readInt32(exception);
+ w = stream.readInt32(exception);
+ h = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ stream.writeInt64(access_hash);
+ stream.writeInt32(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_videoEmpty extends Video {
+ public static int constructor = 0xc10658a8;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ }
+ }
+
+ public static class TL_messages_affectedMessages extends TLObject {
+ public static int constructor = 0x84d19185;
+
+ public int pts;
+ public int pts_count;
+
+ public static TL_messages_affectedMessages TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ pts = stream.readInt32(exception);
+ pts_count = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(pts);
+ stream.writeInt32(pts_count);
}
}
@@ -3540,28 +7681,65 @@ public class TLRPC {
public ArrayList messages = new ArrayList<>();
public ArrayList chats = new ArrayList<>();
public ArrayList users = new ArrayList<>();
+
+ public static geochats_Messages TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ geochats_Messages result = null;
+ switch(constructor) {
+ case 0xbc5863e8:
+ result = new TL_geochats_messagesSlice();
+ break;
+ case 0xd1526db1:
+ result = new TL_geochats_messages();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in geochats_Messages", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
}
public static class TL_geochats_messagesSlice extends geochats_Messages {
public static int constructor = 0xbc5863e8;
- public void readParams(AbsSerializedData stream) {
- count = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- messages.add((GeoChatMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ public void readParams(AbsSerializedData 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;
}
- stream.readInt32();
- count = stream.readInt32();
+ int count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ messages.add(GeoChatMessage.TLdeserialize(stream, stream.readInt32(exception), exception));
}
- stream.readInt32();
- count = stream.readInt32();
+ 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++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
}
}
@@ -3593,21 +7771,39 @@ public class TLRPC {
public static int constructor = 0xd1526db1;
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- messages.add((GeoChatMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ public void readParams(AbsSerializedData 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;
}
- stream.readInt32();
- count = stream.readInt32();
+ int count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ messages.add(GeoChatMessage.TLdeserialize(stream, stream.readInt32(exception), exception));
}
- stream.readInt32();
- count = stream.readInt32();
+ 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++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
}
}
@@ -3634,243 +7830,48 @@ public class TLRPC {
}
}
- public static class messages_SentMessage extends TLObject {
- public int id;
- public int date;
- public MessageMedia media;
- public int pts;
- public int pts_count;
- public ArrayList links = new ArrayList<>();
- public int seq;
- }
+ public static class TL_stickerPack extends TLObject {
+ public static int constructor = 0x12b299d4;
- public static class TL_messages_sentMessage extends messages_SentMessage {
- public static int constructor = 0x4c3d47f3;
+ public String emoticon;
+ public ArrayList documents = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- date = stream.readInt32();
- media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeInt32(date);
- media.serializeToStream(stream);
- stream.writeInt32(pts);
- stream.writeInt32(pts_count);
- }
- }
-
- public static class TL_messages_sentMessageLink extends messages_SentMessage {
- public static int constructor = 0x35a1a663;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- date = stream.readInt32();
- media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- links.add((TL_contacts_link)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ public static TL_stickerPack TLdeserialize(AbsSerializedData 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(AbsSerializedData 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));
}
- seq = stream.readInt32();
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeInt32(date);
- media.serializeToStream(stream);
- stream.writeInt32(pts);
- stream.writeInt32(pts_count);
+ stream.writeString(emoticon);
stream.writeInt32(0x1cb5c415);
- int count = links.size();
+ int count = documents.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
- links.get(a).serializeToStream(stream);
- }
- stream.writeInt32(seq);
- }
- }
-
- public static class EncryptedMessage extends TLObject {
- public long random_id;
- public int chat_id;
- public int date;
- public byte[] bytes;
- public EncryptedFile file;
- }
-
- public static class TL_encryptedMessageService extends EncryptedMessage {
- public static int constructor = 0x23734b06;
-
-
- public void readParams(AbsSerializedData stream) {
- random_id = stream.readInt64();
- chat_id = stream.readInt32();
- date = stream.readInt32();
- bytes = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData 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(AbsSerializedData stream) {
- random_id = stream.readInt64();
- chat_id = stream.readInt32();
- date = stream.readInt32();
- bytes = stream.readByteArray();
- file = (EncryptedFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(random_id);
- stream.writeInt32(chat_id);
- stream.writeInt32(date);
- stream.writeByteArray(bytes);
- file.serializeToStream(stream);
- }
- }
-
- public static class TL_contactSuggested extends TLObject {
- public static int constructor = 0x3de191a1;
-
- public int user_id;
- public int mutual_contacts;
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- mutual_contacts = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeInt32(mutual_contacts);
- }
- }
-
- public static class Server_DH_Params extends TLObject {
- public byte[] nonce;
- public byte[] server_nonce;
- public byte[] new_nonce_hash;
- public byte[] encrypted_answer;
- }
-
- public static class TL_server_DH_params_fail extends Server_DH_Params {
- public static int constructor = 0x79cb045d;
-
-
- public void readParams(AbsSerializedData stream) {
- nonce = stream.readData(16);
- server_nonce = stream.readData(16);
- new_nonce_hash = stream.readData(16);
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeRaw(nonce);
- stream.writeRaw(server_nonce);
- stream.writeRaw(new_nonce_hash);
- }
- }
-
- public static class TL_server_DH_params_ok extends Server_DH_Params {
- public static int constructor = 0xd0e8075c;
-
-
- public void readParams(AbsSerializedData stream) {
- nonce = stream.readData(16);
- server_nonce = stream.readData(16);
- encrypted_answer = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeRaw(nonce);
- stream.writeRaw(server_nonce);
- stream.writeByteArray(encrypted_answer);
- }
- }
-
- public static class TL_msg_copy extends TLObject {
- public static int constructor = 0xe06046b2;
-
- public TL_protoMessage orig_message;
-
- public void readParams(AbsSerializedData stream) {
- orig_message = (TL_protoMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- orig_message.serializeToStream(stream);
- }
- }
-
- public static class TL_contacts_importedContacts extends TLObject {
- public static int constructor = 0xad524315;
-
- public ArrayList imported = new ArrayList<>();
- public ArrayList retry_contacts = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- imported.add((TL_importedContact)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- retry_contacts.add(stream.readInt64());
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = imported.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- imported.get(a).serializeToStream(stream);
- }
- stream.writeInt32(0x1cb5c415);
- count = retry_contacts.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- stream.writeInt64(retry_contacts.get(a));
- }
- stream.writeInt32(0x1cb5c415);
- count = users.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- users.get(a).serializeToStream(stream);
+ stream.writeInt64(documents.get(a));
}
}
}
@@ -3881,9 +7882,22 @@ public class TLRPC {
public String feature;
public String description;
- public void readParams(AbsSerializedData stream) {
- feature = stream.readString();
- description = stream.readString();
+ public static TL_disabledFeature TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_disabledFeature.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_disabledFeature", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_disabledFeature result = new TL_disabledFeature();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ feature = stream.readString(exception);
+ description = stream.readString(exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -3893,2219 +7907,50 @@ public class TLRPC {
}
}
- public static class TL_futureSalt extends TLObject {
- public static int constructor = 0x0949d9dc;
-
- public int valid_since;
- public int valid_until;
- public long salt;
-
- public void readParams(AbsSerializedData stream) {
- valid_since = stream.readInt32();
- valid_until = stream.readInt32();
- salt = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(valid_since);
- stream.writeInt32(valid_until);
- stream.writeInt64(salt);
- }
- }
-
- public static class Update extends TLObject {
- public int chat_id;
- public int max_date;
- public int date;
- public int user_id;
- public ContactLink my_link;
- public ContactLink foreign_link;
- public ArrayList messages = new ArrayList<>();
- public int pts;
- public int pts_count;
- public int max_id;
- public int version;
- public WebPage webpage;
- public String type;
- public MessageMedia media;
- public boolean popup;
- public NotifyPeer peer;
- public PeerNotifySettings notify_settings;
- public SendMessageAction action;
- public String first_name;
- public String last_name;
- public String username;
- public String phone;
- public int qts;
- public int id;
- public long random_id;
- public ArrayList dc_options = new ArrayList<>();
- public ChatParticipants participants;
- public TL_privacyKeyStatusTimestamp key;
- public ArrayList rules = new ArrayList<>();
- public EncryptedChat chat;
- public boolean blocked;
- public long auth_key_id;
- public String device;
- public String location;
- public UserProfilePhoto photo;
- public boolean previous;
- public int inviter_id;
- public UserStatus status;
- }
-
- public static class TL_updateEncryptedMessagesRead extends Update {
- public static int constructor = 0x38fe25b7;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- max_date = stream.readInt32();
- date = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- stream.writeInt32(max_date);
- stream.writeInt32(date);
- }
- }
-
- public static class TL_updateContactLink extends Update {
- public static int constructor = 0x9d2e67c5;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- my_link = (ContactLink)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- foreign_link = (ContactLink)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- my_link.serializeToStream(stream);
- foreign_link.serializeToStream(stream);
- }
- }
-
- public static class TL_updateReadMessages extends Update {
- public static int constructor = 0x2e5ab668;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- messages.add(stream.readInt32());
- }
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = messages.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- stream.writeInt32(messages.get(a));
- }
- stream.writeInt32(pts);
- stream.writeInt32(pts_count);
- }
- }
-
- public static class TL_updateReadHistoryInbox extends Update {
- public static int constructor = 0x9961fd5c;
-
- public Peer peer;
-
- public void readParams(AbsSerializedData stream) {
- peer = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- max_id = stream.readInt32();
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- peer.serializeToStream(stream);
- stream.writeInt32(max_id);
- stream.writeInt32(pts);
- stream.writeInt32(pts_count);
- }
- }
-
- public static class TL_updateChatParticipantDelete extends Update {
- public static int constructor = 0x6e5f8c22;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- user_id = stream.readInt32();
- version = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- stream.writeInt32(user_id);
- stream.writeInt32(version);
- }
- }
-
- public static class TL_updateReadHistoryOutbox extends Update {
- public static int constructor = 0x2f2f21bf;
-
- public Peer peer;
-
- public void readParams(AbsSerializedData stream) {
- peer = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- max_id = stream.readInt32();
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- peer.serializeToStream(stream);
- stream.writeInt32(max_id);
- stream.writeInt32(pts);
- stream.writeInt32(pts_count);
- }
- }
-
- public static class TL_updateWebPage extends Update {
- public static int constructor = 0x2cc36971;
-
-
- public void readParams(AbsSerializedData stream) {
- webpage = (WebPage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- webpage.serializeToStream(stream);
- }
- }
-
- public static class TL_updateServiceNotification extends Update {
- public static int constructor = 0x382dd3e4;
-
- public String message;
-
- public void readParams(AbsSerializedData stream) {
- type = stream.readString();
- message = stream.readString();
- media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- popup = stream.readBool();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(type);
- stream.writeString(message);
- media.serializeToStream(stream);
- stream.writeBool(popup);
- }
- }
-
- public static class TL_updateNotifySettings extends Update {
- public static int constructor = 0xbec268ef;
-
-
- public void readParams(AbsSerializedData stream) {
- peer = (NotifyPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- notify_settings = (PeerNotifySettings)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- peer.serializeToStream(stream);
- notify_settings.serializeToStream(stream);
- }
- }
-
- public static class TL_updateUserTyping extends Update {
- public static int constructor = 0x5c486927;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- action = (SendMessageAction)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- action.serializeToStream(stream);
- }
- }
-
- public static class TL_updateChatUserTyping extends Update {
- public static int constructor = 0x9a65ea1f;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- user_id = stream.readInt32();
- action = (SendMessageAction) TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- stream.writeInt32(user_id);
- action.serializeToStream(stream);
- }
- }
-
- public static class TL_updateUserName extends Update {
- public static int constructor = 0xa7332b73;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- username = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeString(first_name);
- stream.writeString(last_name);
- stream.writeString(username);
- }
- }
-
- public static class TL_updateNewEncryptedMessage extends Update {
- public static int constructor = 0x12bcbd9a;
-
- public EncryptedMessage message;
-
- public void readParams(AbsSerializedData stream) {
- message = (EncryptedMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- qts = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- message.serializeToStream(stream);
- stream.writeInt32(qts);
- }
- }
-
- public static class TL_updateNewMessage extends Update {
- public static int constructor = 0x1f2b0afd;
-
- public Message message;
-
- public void readParams(AbsSerializedData stream) {
- message = (Message)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- message.serializeToStream(stream);
- stream.writeInt32(pts);
- stream.writeInt32(pts_count);
- }
- }
-
- public static class TL_updateMessageID extends Update {
- public static int constructor = 0x4e90bfd6;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- random_id = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeInt64(random_id);
- }
- }
-
- public static class TL_updateDeleteMessages extends Update {
- public static int constructor = 0xa20db0e5;
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- messages.add(stream.readInt32());
- }
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = messages.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- stream.writeInt32(messages.get(a));
- }
- stream.writeInt32(pts);
- stream.writeInt32(pts_count);
- }
- }
-
- public static class TL_updateEncryptedChatTyping extends Update {
- public static int constructor = 0x1710f156;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- }
- }
-
- public static class TL_updateDcOptions extends Update {
- public static int constructor = 0x8e5e9873;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- dc_options.add((TL_dcOption)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = dc_options.size();
- stream.writeInt32(count);
- for (TL_dcOption dc_option : dc_options) {
- dc_option.serializeToStream(stream);
- }
- }
- }
-
- public static class TL_updateChatParticipants extends Update {
- public static int constructor = 0x7761198;
-
-
- public void readParams(AbsSerializedData stream) {
- participants = (ChatParticipants)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- participants.serializeToStream(stream);
- }
- }
-
- public static class TL_updateUserPhone extends Update {
- public static int constructor = 0x12b9417b;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- phone = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeString(phone);
- }
- }
-
- public static class TL_updatePrivacy extends Update {
- public static int constructor = 0xee3b272a;
-
-
- public void readParams(AbsSerializedData stream) {
- key = (TL_privacyKeyStatusTimestamp)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- rules.add((PrivacyRule)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- key.serializeToStream(stream);
- stream.writeInt32(0x1cb5c415);
- int count = rules.size();
- stream.writeInt32(count);
- for (PrivacyRule rule : rules) {
- rule.serializeToStream(stream);
- }
- }
- }
-
- public static class TL_updateEncryption extends Update {
- public static int constructor = 0xb4a2e88d;
-
-
- public void readParams(AbsSerializedData stream) {
- chat = (EncryptedChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- date = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- chat.serializeToStream(stream);
- stream.writeInt32(date);
- }
- }
-
- public static class TL_updateUserBlocked extends Update {
- public static int constructor = 0x80ece81a;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- blocked = stream.readBool();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeBool(blocked);
- }
- }
-
- public static class TL_updateActivation extends Update {
- public static int constructor = 0x6f690963;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- }
- }
-
- public static class TL_updateNewAuthorization extends Update {
- public static int constructor = 0x8f06529a;
-
-
- public void readParams(AbsSerializedData stream) {
- auth_key_id = stream.readInt64();
- date = stream.readInt32();
- device = stream.readString();
- location = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(auth_key_id);
- stream.writeInt32(date);
- stream.writeString(device);
- stream.writeString(location);
- }
- }
-
- public static class TL_updateNewGeoChatMessage extends Update {
- public static int constructor = 0x5a68e3f7;
-
- public GeoChatMessage message;
-
- public void readParams(AbsSerializedData stream) {
- message = (GeoChatMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- message.serializeToStream(stream);
- }
- }
-
- public static class TL_updateUserPhoto extends Update {
- public static int constructor = 0x95313b0c;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- date = stream.readInt32();
- photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- previous = stream.readBool();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeInt32(date);
- photo.serializeToStream(stream);
- stream.writeBool(previous);
- }
- }
-
- public static class TL_updateContactRegistered extends Update {
- public static int constructor = 0x2575bbb9;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- date = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeInt32(date);
- }
- }
-
- public static class TL_updateChatParticipantAdd extends Update {
- public static int constructor = 0x3a0eeb22;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- user_id = stream.readInt32();
- inviter_id = stream.readInt32();
- version = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- stream.writeInt32(user_id);
- stream.writeInt32(inviter_id);
- stream.writeInt32(version);
- }
- }
-
- public static class TL_updateUserStatus extends Update {
- public static int constructor = 0x1bfbd823;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- status.serializeToStream(stream);
- }
- }
-
- public static class TL_contacts_suggested extends TLObject {
- public static int constructor = 0x5649dcc5;
-
- public ArrayList results = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- results.add((TL_contactSuggested)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = results.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- results.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 RpcError extends TLObject {
- public int error_code;
- public String error_message;
- public long query_id;
- }
-
- public static class TL_rpc_error extends RpcError {
- public static int constructor = 0x2144ca19;
-
-
- public void readParams(AbsSerializedData stream) {
- error_code = stream.readInt32();
- error_message = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(error_code);
- stream.writeString(error_message);
- }
- }
-
- public static class TL_rpc_req_error extends RpcError {
- public static int constructor = 0x7ae432f5;
-
-
- public void readParams(AbsSerializedData stream) {
- query_id = stream.readInt64();
- error_code = stream.readInt32();
- error_message = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(query_id);
- stream.writeInt32(error_code);
- stream.writeString(error_message);
- }
- }
-
- public static class TL_inputEncryptedFile extends InputEncryptedFile {
- public static int constructor = 0x5a17b5e5;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData 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(AbsSerializedData stream) {
- id = stream.readInt64();
- parts = stream.readInt32();
- key_fingerprint = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData 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 serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputEncryptedFileUploaded extends InputEncryptedFile {
- public static int constructor = 0x64bd0306;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- parts = stream.readInt32();
- md5_checksum = stream.readString();
- key_fingerprint = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt32(parts);
- stream.writeString(md5_checksum);
- stream.writeInt32(key_fingerprint);
- }
- }
-
- public static class DecryptedMessageAction extends TLObject {
- public int start_seq_no;
- public int end_seq_no;
- public int ttl_seconds;
- public int layer;
- public ArrayList random_ids = new ArrayList<>();
- public long exchange_id;
- public long key_fingerprint;
- public byte[] g_b;
- public SendMessageAction action;
- public byte[] g_a;
- }
-
- public static class TL_decryptedMessageActionSetMessageTTL extends DecryptedMessageAction {
- public static int constructor = 0xa1733aec;
-
- public void readParams(AbsSerializedData stream) {
- ttl_seconds = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(ttl_seconds);
- }
- }
-
- public static class TL_decryptedMessageActionFlushHistory extends DecryptedMessageAction {
- public static int constructor = 0x6719e45c;
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_decryptedMessageActionAcceptKey extends DecryptedMessageAction {
- public static int constructor = 0x6fe1735b;
-
-
- public void readParams(AbsSerializedData stream) {
- exchange_id = stream.readInt64();
- g_b = stream.readByteArray();
- key_fingerprint = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(exchange_id);
- stream.writeByteArray(g_b);
- stream.writeInt64(key_fingerprint);
- }
- }
-
- public static class TL_decryptedMessageActionResend extends DecryptedMessageAction {
- public static int constructor = 0x511110b0;
-
-
- public void readParams(AbsSerializedData stream) {
- start_seq_no = stream.readInt32();
- end_seq_no = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(start_seq_no);
- stream.writeInt32(end_seq_no);
- }
- }
-
- public static class TL_decryptedMessageActionNotifyLayer extends DecryptedMessageAction {
- public static int constructor = 0xf3048883;
-
-
- public void readParams(AbsSerializedData stream) {
- layer = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(layer);
- }
- }
-
- public static class TL_decryptedMessageActionReadMessages extends DecryptedMessageAction {
- public static int constructor = 0xc4f40be;
-
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- random_ids.add(stream.readInt64());
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = random_ids.size();
- stream.writeInt32(count);
- for (Long random_id : random_ids) {
- stream.writeInt64(random_id);
- }
- }
- }
-
- public static class TL_decryptedMessageActionRequestKey extends DecryptedMessageAction {
- public static int constructor = 0xf3c9611b;
-
-
- public void readParams(AbsSerializedData stream) {
- exchange_id = stream.readInt64();
- g_a = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(exchange_id);
- stream.writeByteArray(g_a);
- }
- }
-
- public static class TL_decryptedMessageActionTyping extends DecryptedMessageAction {
- public static int constructor = 0xccb27641;
-
-
- public void readParams(AbsSerializedData stream) {
- action = (SendMessageAction)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- action.serializeToStream(stream);
- }
- }
-
- public static class TL_server_DH_inner_data extends TLObject {
- public static int constructor = 0xb5890dba;
-
- public byte[] nonce;
- public byte[] server_nonce;
- public int g;
- public byte[] dh_prime;
- public byte[] g_a;
- public int server_time;
-
- public void readParams(AbsSerializedData stream) {
- nonce = stream.readData(16);
- server_nonce = stream.readData(16);
- g = stream.readInt32();
- dh_prime = stream.readByteArray();
- g_a = stream.readByteArray();
- server_time = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeRaw(nonce);
- stream.writeRaw(server_nonce);
- stream.writeInt32(g);
- stream.writeByteArray(dh_prime);
- stream.writeByteArray(g_a);
- stream.writeInt32(server_time);
- }
- }
-
- public static class TL_new_session_created extends TLObject {
- public static int constructor = 0x9ec20908;
-
- public long first_msg_id;
- public long unique_id;
- public long server_salt;
-
- public void readParams(AbsSerializedData stream) {
- first_msg_id = stream.readInt64();
- unique_id = stream.readInt64();
- server_salt = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(first_msg_id);
- stream.writeInt64(unique_id);
- stream.writeInt64(server_salt);
- }
- }
-
- public static class messages_AllStickers extends TLObject {
- public String hash;
- public ArrayList packs = new ArrayList<>();
- public ArrayList documents = new ArrayList<>();
- }
-
- public static class TL_messages_allStickers extends messages_AllStickers {
- public static int constructor = 0xdcef3102;
-
-
- public void readParams(AbsSerializedData stream) {
- hash = stream.readString();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- packs.add((TL_stickerPack)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- documents.add((Document)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(hash);
- stream.writeInt32(0x1cb5c415);
- int count = packs.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- packs.get(a).serializeToStream(stream);
- }
- stream.writeInt32(0x1cb5c415);
- count = documents.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- documents.get(a).serializeToStream(stream);
- }
- }
- }
-
- public static class TL_messages_allStickersNotModified extends messages_AllStickers {
- public static int constructor = 0xe86602c3;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class account_Password extends TLObject {
- public byte[] current_salt;
- public byte[] new_salt;
- public String hint;
- public boolean has_recovery;
- public String email_unconfirmed_pattern;
- }
-
- public static class TL_account_password extends account_Password {
- public static int constructor = 0x7c18141c;
-
-
- public void readParams(AbsSerializedData stream) {
- current_salt = stream.readByteArray();
- new_salt = stream.readByteArray();
- hint = stream.readString();
- has_recovery = stream.readBool();
- email_unconfirmed_pattern = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeByteArray(current_salt);
- stream.writeByteArray(new_salt);
- stream.writeString(hint);
- stream.writeBool(has_recovery);
- stream.writeString(email_unconfirmed_pattern);
- }
- }
-
- public static class TL_account_noPassword extends account_Password {
- public static int constructor = 0x96dabc18;
-
-
- public void readParams(AbsSerializedData stream) {
- new_salt = stream.readByteArray();
- email_unconfirmed_pattern = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeByteArray(new_salt);
- stream.writeString(email_unconfirmed_pattern);
- }
- }
-
- public static class UserProfilePhoto extends TLObject {
- public long photo_id;
- public FileLocation photo_small;
- public FileLocation photo_big;
- }
-
- public static class TL_userProfilePhotoEmpty extends UserProfilePhoto {
- public static int constructor = 0x4f11bae1;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_userProfilePhoto extends UserProfilePhoto {
- public static int constructor = 0xd559d8c8;
-
-
- public void readParams(AbsSerializedData stream) {
- photo_id = stream.readInt64();
- photo_small = (FileLocation)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- photo_big = (FileLocation)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(photo_id);
- photo_small.serializeToStream(stream);
- photo_big.serializeToStream(stream);
- }
- }
-
- public static class Photo extends TLObject {
- public long id;
- public long access_hash;
- public int user_id;
- public int date;
- public String caption;
- public GeoPoint geo;
- public ArrayList sizes = new ArrayList<>();
- }
-
- public static class TL_photo extends Photo {
- public static int constructor = 0x22b56751;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- user_id = stream.readInt32();
- date = stream.readInt32();
- caption = stream.readString();
- geo = (GeoPoint)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- PhotoSize size = (PhotoSize)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- if (size != null) {
- sizes.add(size);
- }
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- stream.writeInt32(user_id);
- stream.writeInt32(date);
- stream.writeString(caption);
- geo.serializeToStream(stream);
- stream.writeInt32(0x1cb5c415);
- int count = sizes.size();
- stream.writeInt32(count);
- for (PhotoSize size : sizes) {
- size.serializeToStream(stream);
- }
- }
- }
-
- public static class TL_photoEmpty extends Photo {
- public static int constructor = 0x2331b22d;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- }
- }
-
- public static class TL_encryptedChatWaiting extends EncryptedChat {
- public static int constructor = 0x3bf703dc;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- access_hash = stream.readInt64();
- date = stream.readInt32();
- admin_id = stream.readInt32();
- participant_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeInt64(access_hash);
- stream.writeInt32(date);
- stream.writeInt32(admin_id);
- stream.writeInt32(participant_id);
- }
- }
-
- public static class TL_encryptedChatEmpty extends EncryptedChat {
- public static int constructor = 0xab7ec0a0;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- }
- }
-
- public static class TL_encryptedChatDiscarded extends EncryptedChat {
- public static int constructor = 0x13d6dd27;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- }
- }
-
- public static class TL_encryptedChat extends EncryptedChat {
- public static int constructor = 0xfa56ce36;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- access_hash = stream.readInt64();
- date = stream.readInt32();
- admin_id = stream.readInt32();
- participant_id = stream.readInt32();
- g_a_or_b = stream.readByteArray();
- key_fingerprint = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeInt64(access_hash);
- stream.writeInt32(date);
- stream.writeInt32(admin_id);
- stream.writeInt32(participant_id);
- stream.writeByteArray(g_a_or_b);
- stream.writeInt64(key_fingerprint);
- }
- }
-
- public static class TL_encryptedChatRequested extends EncryptedChat {
- public static int constructor = 0xc878527e;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- access_hash = stream.readInt64();
- date = stream.readInt32();
- admin_id = stream.readInt32();
- participant_id = stream.readInt32();
- g_a = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeInt64(access_hash);
- stream.writeInt32(date);
- stream.writeInt32(admin_id);
- stream.writeInt32(participant_id);
- stream.writeByteArray(g_a);
- }
- }
-
- public static class TL_geochats_statedMessage extends TLObject {
- public static int constructor = 0x17b1578b;
-
- public GeoChatMessage message;
- public ArrayList chats = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
- public int seq;
-
- public void readParams(AbsSerializedData stream) {
- message = (GeoChatMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- seq = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- message.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);
- }
- stream.writeInt32(seq);
- }
- }
-
- public static class TL_contact extends TLObject {
- public static int constructor = 0xf911c994;
-
- public int user_id;
- public boolean mutual;
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- mutual = stream.readBool();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeBool(mutual);
- }
- }
-
- public static class TL_config extends TLObject {
- public static int constructor = 0x68bac247;
-
- public int date;
- public int expires;
- public boolean test_mode;
- public int this_dc;
- public ArrayList dc_options = new ArrayList<>();
- public int chat_size_max;
- public int broadcast_size_max;
- public int forwarded_count_max;
- public int online_update_period_ms;
- public int offline_blur_timeout_ms;
- public int offline_idle_timeout_ms;
- public int online_cloud_timeout_ms;
- public int notify_cloud_delay_ms;
- public int notify_default_delay_ms;
- public int chat_big_size;
- public ArrayList disabled_features = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- date = stream.readInt32();
- expires = stream.readInt32();
- test_mode = stream.readBool();
- this_dc = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- dc_options.add((TL_dcOption)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- chat_size_max = stream.readInt32();
- broadcast_size_max = stream.readInt32();
- forwarded_count_max = stream.readInt32();
- online_update_period_ms = stream.readInt32();
- offline_blur_timeout_ms = stream.readInt32();
- offline_idle_timeout_ms = stream.readInt32();
- online_cloud_timeout_ms = stream.readInt32();
- notify_cloud_delay_ms = stream.readInt32();
- notify_default_delay_ms = stream.readInt32();
- chat_big_size = stream.readInt32();
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- disabled_features.add((TL_disabledFeature)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(date);
- stream.writeInt32(expires);
- stream.writeBool(test_mode);
- stream.writeInt32(this_dc);
- stream.writeInt32(0x1cb5c415);
- int count = dc_options.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- dc_options.get(a).serializeToStream(stream);
- }
- stream.writeInt32(chat_size_max);
- stream.writeInt32(broadcast_size_max);
- stream.writeInt32(forwarded_count_max);
- stream.writeInt32(online_update_period_ms);
- stream.writeInt32(offline_blur_timeout_ms);
- stream.writeInt32(offline_idle_timeout_ms);
- stream.writeInt32(online_cloud_timeout_ms);
- stream.writeInt32(notify_cloud_delay_ms);
- stream.writeInt32(notify_default_delay_ms);
- stream.writeInt32(chat_big_size);
- stream.writeInt32(0x1cb5c415);
- count = disabled_features.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- disabled_features.get(a).serializeToStream(stream);
- }
- }
- }
-
- public static class TL_help_support extends TLObject {
- public static int constructor = 0x17c6b5f6;
-
- public String phone_number;
- public User user;
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- user = (User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(phone_number);
- user.serializeToStream(stream);
- }
- }
-
- public static class TL_help_getSupport extends TLObject {
- public static int constructor = 0x9cdf08cd;
-
- public Class responseClass () {
- return TL_help_support.class;
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_auth_sendSms extends TLObject {
- public static int constructor = 0xda9f3e8;
-
- public String phone_number;
- public String phone_code_hash;
-
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- phone_code_hash = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(phone_number);
- stream.writeString(phone_code_hash);
- }
- }
-
- public static class TL_messages_readMessageContents extends TLObject {
- public static int constructor = 0x36a73f77;
-
- public ArrayList id = new ArrayList<>();
-
- public Class responseClass () {
- return TL_messages_affectedMessages.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- id.add(stream.readInt32());
- }
- }
-
- public void serializeToStream(AbsSerializedData 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_account_getPrivacy extends TLObject {
- public static int constructor = 0xdadbc950;
-
- public TL_inputPrivacyKeyStatusTimestamp key;
-
- public Class responseClass () {
- return TL_account_privacyRules.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- key = (TL_inputPrivacyKeyStatusTimestamp)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- key.serializeToStream(stream);
- }
- }
-
- public static class TL_account_setPrivacy extends TLObject {
- public static int constructor = 0xc9f81ce8;
-
- public TL_inputPrivacyKeyStatusTimestamp key;
- public ArrayList rules = new ArrayList<>();
-
- public Class responseClass () {
- return TL_account_privacyRules.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- key = (TL_inputPrivacyKeyStatusTimestamp)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- rules.add((InputPrivacyRule)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- key.serializeToStream(stream);
- stream.writeInt32(0x1cb5c415);
- int count = rules.size();
- stream.writeInt32(count);
- for (InputPrivacyRule rule : rules) {
- rule.serializeToStream(stream);
- }
- }
- }
-
- public static class TL_account_deleteAccount extends TLObject {
- public static int constructor = 0x418d4e0b;
-
- public String reason;
-
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- reason = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(reason);
- }
- }
-
- public static class TL_account_getAccountTTL extends TLObject {
- public static int constructor = 0x8fc711d;
-
-
- public Class responseClass () {
- return TL_accountDaysTTL.class;
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_account_setAccountTTL extends TLObject {
- public static int constructor = 0x2442485e;
-
- public TL_accountDaysTTL ttl;
-
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- ttl = (TL_accountDaysTTL)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- ttl.serializeToStream(stream);
- }
- }
-
- public static class TL_account_sendChangePhoneCode extends TLObject {
- public static int constructor = 0xa407a8f4;
-
- public String phone_number;
-
- public Class responseClass() {
- return TL_account_sentChangePhoneCode.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(phone_number);
- }
- }
-
- 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 Class responseClass () {
- return User.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- phone_code_hash = stream.readString();
- phone_code = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(phone_number);
- stream.writeString(phone_code_hash);
- stream.writeString(phone_code);
- }
- }
-
- public static class TL_account_updateDeviceLocked extends TLObject {
- public static int constructor = 0x38df3532;
-
- public int period;
-
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- period = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(period);
- }
- }
-
- public static class TL_account_getAuthorizations extends TLObject {
- public static int constructor = 0xe320c158;
-
-
- public Class responseClass () {
- return TL_account_authorizations.class;
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_account_resetAuthorization extends TLObject {
- public static int constructor = 0xdf77f3bc;
-
- public long hash;
-
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(hash);
- }
- }
-
- public static class TL_messages_getAllStickers extends TLObject {
- public static int constructor = 0xaa3bc868;
-
- public String hash;
-
- public Class responseClass () {
- return messages_AllStickers.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- hash = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(hash);
- }
- }
-
- public static class TL_messages_getWebPagePreview extends TLObject {
- public static int constructor = 0x25223e24;
-
- public String message;
-
- public Class responseClass () {
- return MessageMedia.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- message = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(message);
- }
- }
-
- public static class TL_account_checkUsername extends TLObject {
- public static int constructor = 0x2714d86c;
-
- public String username;
-
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- username = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(username);
- }
- }
-
- public static class TL_account_updateUsername extends TLObject {
- public static int constructor = 0x3e0bdd7c;
-
- public String username;
-
- public Class responseClass () {
- return User.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- username = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(username);
- }
- }
-
- public static class TL_contacts_resolveUsername extends TLObject {
- public static int constructor = 0xbf0131c;
-
- public String username;
-
- public Class responseClass () {
- return User.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- username = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(username);
- }
- }
-
- public static class InputAudio extends TLObject {
- public long id;
- public long access_hash;
- }
-
- public static class TL_inputAudio extends InputAudio {
- public static int constructor = 0x77d440ff;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- }
- }
-
- public static class TL_inputAudioEmpty extends InputAudio {
- public static int constructor = 0xd95adc84;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_messages_chats extends TLObject {
- public static int constructor = 0x64ff9fd5;
-
- public ArrayList chats = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData 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_contacts_found extends TLObject {
- public static int constructor = 0x566000e;
-
- public ArrayList results = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- results.add((TL_contactFound)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- int count = results.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- results.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 ChatParticipants extends TLObject {
- public int chat_id;
- public int admin_id;
- public ArrayList participants = new ArrayList<>();
- public int version;
- }
-
- public static class TL_chatParticipants extends ChatParticipants {
- public static int constructor = 0x7841b415;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- admin_id = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- participants.add((TL_chatParticipant)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- version = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- stream.writeInt32(admin_id);
- stream.writeInt32(0x1cb5c415);
- int count = participants.size();
- stream.writeInt32(count);
- for (TL_chatParticipant participant : participants) {
- participant.serializeToStream(stream);
- }
- stream.writeInt32(version);
- }
- }
-
- public static class TL_chatParticipantsForbidden extends ChatParticipants {
- public static int constructor = 0xfd2bb8a;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- }
- }
-
- public static class DecryptedMessageMedia extends TLObject {
- public long id;
- public long access_hash;
- public int date;
- public PhotoSize thumbImage;
- public byte[] thumb;
- public int thumb_w;
- public int thumb_h;
- public String file_name;
- public String mime_type;
- public int size;
- public int dc_id;
- public ArrayList attributes = new ArrayList<>();
- public byte[] key;
- public byte[] iv;
- public double lat;
- public double _long;
- public int duration;
- public int w;
- public int h;
- public String phone_number;
- public String first_name;
- public String last_name;
- public int user_id;
- }
-
- public static class TL_decryptedMessageMediaExternalDocument extends DecryptedMessageMedia {
- public static int constructor = 0xfa95b0dd;
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- date = stream.readInt32();
- mime_type = stream.readString();
- size = stream.readInt32();
- thumbImage = (PhotoSize)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- dc_id = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- attributes.add((DocumentAttribute)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- stream.writeInt32(date);
- stream.writeString(mime_type);
- stream.writeInt32(size);
- thumbImage.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_decryptedMessageMediaDocument extends DecryptedMessageMedia {
- public static int constructor = 0xb095434b;
-
-
- public void readParams(AbsSerializedData stream) {
- thumb = stream.readByteArray();
- thumb_w = stream.readInt32();
- thumb_h = stream.readInt32();
- file_name = stream.readString();
- mime_type = stream.readString();
- size = stream.readInt32();
- key = stream.readByteArray();
- iv = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData 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_decryptedMessageMediaGeoPoint extends DecryptedMessageMedia {
- public static int constructor = 0x35480a59;
-
-
- public void readParams(AbsSerializedData stream) {
- lat = stream.readDouble();
- _long = stream.readDouble();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeDouble(lat);
- stream.writeDouble(_long);
- }
- }
-
- public static class TL_decryptedMessageMediaAudio extends DecryptedMessageMedia {
- public static int constructor = 0x57e0a9cb;
-
-
- public void readParams(AbsSerializedData stream) {
- duration = stream.readInt32();
- mime_type = stream.readString();
- size = stream.readInt32();
- key = stream.readByteArray();
- iv = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(duration);
- stream.writeString(mime_type);
- stream.writeInt32(size);
- stream.writeByteArray(key);
- stream.writeByteArray(iv);
- }
- }
-
- public static class TL_decryptedMessageMediaVideo extends DecryptedMessageMedia {
- public static int constructor = 0x524a415d;
-
-
- public void readParams(AbsSerializedData stream) {
- thumb = stream.readByteArray();
- thumb_w = stream.readInt32();
- thumb_h = stream.readInt32();
- duration = stream.readInt32();
- mime_type = stream.readString();
- w = stream.readInt32();
- h = stream.readInt32();
- size = stream.readInt32();
- key = stream.readByteArray();
- iv = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData 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_decryptedMessageMediaContact extends DecryptedMessageMedia {
- public static int constructor = 0x588a0a97;
-
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- first_name = stream.readString();
- last_name = stream.readString();
- user_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(phone_number);
- stream.writeString(first_name);
- stream.writeString(last_name);
- stream.writeInt32(user_id);
- }
- }
-
- public static class TL_decryptedMessageMediaEmpty extends DecryptedMessageMedia {
- public static int constructor = 0x89f5c4a;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_decryptedMessageMediaPhoto extends DecryptedMessageMedia {
- public static int constructor = 0x32798a8c;
-
-
- public void readParams(AbsSerializedData stream) {
- thumb = stream.readByteArray();
- thumb_w = stream.readInt32();
- thumb_h = stream.readInt32();
- w = stream.readInt32();
- h = stream.readInt32();
- size = stream.readInt32();
- key = stream.readByteArray();
- iv = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData 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_chatParticipant extends TLObject {
- public static int constructor = 0xc8d7493e;
-
- public int user_id;
- public int inviter_id;
- public int date;
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- inviter_id = stream.readInt32();
- date = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeInt32(inviter_id);
- stream.writeInt32(date);
- }
- }
-
- public static class Chat extends TLObject {
- public int id;
- public String title;
- public int date;
- public long access_hash;
- public String address;
- public String venue;
- public GeoPoint geo;
- public ChatPhoto photo;
- public int participants_count;
- public boolean checked_in;
- public int version;
- public boolean left;
- //Smart Notifications
- public java.util.Queue sound_timestamps = null;
- //
- }
-
- public static class TL_chatForbidden extends Chat {
- public static int constructor = 0xfb0ccc41;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- title = stream.readString();
- date = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(title);
- stream.writeInt32(date);
- }
- }
-
- public static class TL_geoChat extends Chat {
- public static int constructor = 0x75eaea5a;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- access_hash = stream.readInt64();
- title = stream.readString();
- address = stream.readString();
- venue = stream.readString();
- geo = (GeoPoint)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- photo = (ChatPhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- participants_count = stream.readInt32();
- date = stream.readInt32();
- checked_in = stream.readBool();
- version = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeInt64(access_hash);
- stream.writeString(title);
- stream.writeString(address);
- stream.writeString(venue);
- geo.serializeToStream(stream);
- photo.serializeToStream(stream);
- stream.writeInt32(participants_count);
- stream.writeInt32(date);
- stream.writeBool(checked_in);
- stream.writeInt32(version);
- }
- }
- public static class TL_chat extends Chat {
- public static int constructor = 0x6e9c9bc7;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- title = stream.readString();
- photo = (ChatPhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- participants_count = stream.readInt32();
- date = stream.readInt32();
- left = stream.readBool();
- version = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(title);
- photo.serializeToStream(stream);
- stream.writeInt32(participants_count);
- stream.writeInt32(date);
- stream.writeBool(left);
- stream.writeInt32(version);
- }
- }
-
public static class storage_FileType extends TLObject {
+
+ public static storage_FileType TLdeserialize(AbsSerializedData 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 {
@@ -6117,6 +7962,15 @@ public class TLRPC {
}
}
+ public static class TL_storage_fileMp4 extends storage_FileType {
+ public static int constructor = 0xb3cea0e4;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
public static class TL_storage_fileWebp extends storage_FileType {
public static int constructor = 0x1081464c;
@@ -6153,15 +8007,6 @@ public class TLRPC {
}
}
- public static class TL_storage_fileMov extends storage_FileType {
- public static int constructor = 0x4b09ebbc;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
public static class TL_storage_fileMp3 extends storage_FileType {
public static int constructor = 0x528a0677;
@@ -6180,6 +8025,15 @@ public class TLRPC {
}
}
+ public static class TL_storage_fileMov extends storage_FileType {
+ public static int constructor = 0x4b09ebbc;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
public static class TL_storage_filePartial extends storage_FileType {
public static int constructor = 0x40bc6f52;
@@ -6189,522 +8043,255 @@ public class TLRPC {
}
}
- public static class TL_storage_fileMp4 extends storage_FileType {
- public static int constructor = 0xb3cea0e4;
+ public static class TL_account_authorizations extends TLObject {
+ public static int constructor = 0x1250abde;
+ public ArrayList authorizations = new ArrayList<>();
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class MessagesFilter extends TLObject {
- }
-
- public static class TL_inputMessagesFilterVideo extends MessagesFilter {
- public static int constructor = 0x9fc00e65;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputMessagesFilterEmpty extends MessagesFilter {
- public static int constructor = 0x57e2f66c;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputMessagesFilterPhotos extends MessagesFilter {
- public static int constructor = 0x9609a51c;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputMessagesFilterPhotoVideo extends MessagesFilter {
- public static int constructor = 0x56e9f0e4;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputMessagesFilterDocument extends MessagesFilter {
- public static int constructor = 0x9eddf188;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputMessagesFilterAudio extends MessagesFilter {
- public static int constructor = 0xcfc87522;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_msgs_state_info extends TLObject {
- public static int constructor = 0x04deb57d;
-
- public long req_msg_id;
- public String info;
-
- public void readParams(AbsSerializedData stream) {
- req_msg_id = stream.readInt64();
- info = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(req_msg_id);
- stream.writeString(info);
- }
- }
-
- public static class TL_fileLocation extends FileLocation {
- public static int constructor = 0x53d69076;
-
-
- public void readParams(AbsSerializedData stream) {
- dc_id = stream.readInt32();
- volume_id = stream.readInt64();
- local_id = stream.readInt32();
- secret = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(dc_id);
- stream.writeInt64(volume_id);
- stream.writeInt32(local_id);
- stream.writeInt64(secret);
- }
- }
-
- public static class TL_fileLocationUnavailable extends FileLocation {
- public static int constructor = 0x7c596b46;
-
-
- public void readParams(AbsSerializedData stream) {
- volume_id = stream.readInt64();
- local_id = stream.readInt32();
- secret = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(volume_id);
- stream.writeInt32(local_id);
- stream.writeInt64(secret);
- }
- }
-
- public static class messages_Message extends TLObject {
- public Message message;
- public ArrayList chats = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
- }
-
- public static class TL_messages_messageEmpty extends messages_Message {
- public static int constructor = 0x3f4e0648;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_messages_message extends messages_Message {
- public static int constructor = 0xff90c417;
-
-
- public void readParams(AbsSerializedData stream) {
- message = (Message)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ public static TL_account_authorizations TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_account_authorizations.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_account_authorizations", constructor));
+ } else {
+ return null;
+ }
}
+ TL_account_authorizations result = new TL_account_authorizations();
+ result.readParams(stream, exception);
+ return result;
}
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- message.serializeToStream(stream);
- stream.writeInt32(0x1cb5c415);
- int count = chats.size();
- stream.writeInt32(count);
- for (int a = 0; a < count; a++) {
- chats.get(a).serializeToStream(stream);
+ public void readParams(AbsSerializedData 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;
}
- stream.writeInt32(0x1cb5c415);
- count = users.size();
- stream.writeInt32(count);
+ int count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
- users.get(a).serializeToStream(stream);
- }
- }
- }
-
- public static class TL_geochats_located extends TLObject {
- public static int constructor = 0x48feb267;
-
- public ArrayList results = new ArrayList<>();
- public ArrayList messages = new ArrayList<>();
- public ArrayList chats = new ArrayList<>();
- public ArrayList users = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- results.add((TL_chatLocated)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- messages.add((GeoChatMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ authorizations.add(TL_authorization.TLdeserialize(stream, stream.readInt32(exception), exception));
}
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(0x1cb5c415);
- int count = results.size();
+ int count = authorizations.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
- results.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);
+ authorizations.get(a).serializeToStream(stream);
}
}
}
- public static class TL_inputGeoChat extends TLObject {
- public static int constructor = 0x74d456fa;
+ public static class TL_p_q_inner_data extends TLObject {
+ public static int constructor = 0x83c95aec;
- public int chat_id;
+ public byte[] pq;
+ public byte[] p;
+ public byte[] q;
+ public byte[] nonce;
+ public byte[] server_nonce;
+ public byte[] new_nonce;
+
+ public static TL_p_q_inner_data TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_p_q_inner_data.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_p_q_inner_data", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_p_q_inner_data result = new TL_p_q_inner_data();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ pq = stream.readByteArray(exception);
+ p = stream.readByteArray(exception);
+ q = stream.readByteArray(exception);
+ nonce = stream.readData(16, exception);
+ server_nonce = stream.readData(16, exception);
+ new_nonce = stream.readData(32, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeByteArray(pq);
+ stream.writeByteArray(p);
+ stream.writeByteArray(q);
+ stream.writeRaw(nonce);
+ stream.writeRaw(server_nonce);
+ stream.writeRaw(new_nonce);
+ }
+ }
+
+ public static class InputPhoto extends TLObject {
+ public long id;
public long access_hash;
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- access_hash = stream.readInt64();
+ public static InputPhoto TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputPhoto result = null;
+ switch(constructor) {
+ case 0x1cd7bf0d:
+ result = new TL_inputPhotoEmpty();
+ break;
+ case 0xfb95c6c4:
+ 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 void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputPhoto extends InputPhoto {
+ public static int constructor = 0xfb95c6c4;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ access_hash = stream.readInt64(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
+ stream.writeInt64(id);
stream.writeInt64(access_hash);
}
}
- public static class TL_protoMessage extends TLObject {
- public static int constructor = 0x5bb8e511;
+ public static class contacts_Contacts extends TLObject {
+ public ArrayList contacts = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
- public long msg_id;
- public int seqno;
- public int bytes;
- public TLObject body;
+ public static contacts_Contacts TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ contacts_Contacts result = null;
+ switch(constructor) {
+ case 0xb74ba9d2:
+ result = new TL_contacts_contactsNotModified();
+ break;
+ case 0x6f8b8cb2:
+ 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 void readParams(AbsSerializedData stream) {
- msg_id = stream.readInt64();
- seqno = stream.readInt32();
- bytes = stream.readInt32();
- body = TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public static class TL_contacts_contactsNotModified extends contacts_Contacts {
+ public static int constructor = 0xb74ba9d2;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_contacts_contacts extends contacts_Contacts {
+ public static int constructor = 0x6f8b8cb2;
+
+
+ public void readParams(AbsSerializedData 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++) {
+ contacts.add(TL_contact.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt64(msg_id);
- stream.writeInt32(seqno);
- stream.writeInt32(bytes);
- body.serializeToStream(stream);
+ stream.writeInt32(0x1cb5c415);
+ int count = contacts.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ contacts.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 PhotoSize extends TLObject {
- public String type;
- public FileLocation location;
- public int w;
- public int h;
- public int size;
- public byte[] bytes;
- }
-
- public static class TL_photoSize extends PhotoSize {
- public static int constructor = 0x77bfb61b;
-
-
- public void readParams(AbsSerializedData stream) {
- type = stream.readString();
- location = (FileLocation)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- w = stream.readInt32();
- h = stream.readInt32();
- size = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData 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(AbsSerializedData stream) {
- type = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(type);
- }
- }
-
- public static class TL_photoCachedSize extends PhotoSize {
- public static int constructor = 0xe9a734fa;
-
-
- public void readParams(AbsSerializedData stream) {
- type = stream.readString();
- location = (FileLocation)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- w = stream.readInt32();
- h = stream.readInt32();
- bytes = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(type);
- location.serializeToStream(stream);
- stream.writeInt32(w);
- stream.writeInt32(h);
- stream.writeByteArray(bytes);
- }
- }
-
- public static class TL_contactFound extends TLObject {
- public static int constructor = 0xea879f95;
+ public static class TL_contactBlocked extends TLObject {
+ public static int constructor = 0x561bc879;
public int user_id;
+ public int date;
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
+ public static TL_contactBlocked TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_contactBlocked.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_contactBlocked", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_contactBlocked result = new TL_contactBlocked();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ user_id = stream.readInt32(exception);
+ date = stream.readInt32(exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(user_id);
- }
- }
-
- public static class TL_account_sentChangePhoneCode extends TLObject {
- public static int constructor = 0xa4f58c4c;
-
- public String phone_code_hash;
- public int send_call_timeout;
-
- public void readParams(AbsSerializedData stream) {
- phone_code_hash = stream.readString();
- send_call_timeout = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(phone_code_hash);
- stream.writeInt32(send_call_timeout);
- }
- }
-
- public static class InputFile extends TLObject {
- public long id;
- public int parts;
- public String name;
- public String md5_checksum;
- }
-
- public static class TL_inputFileBig extends InputFile {
- public static int constructor = 0xfa4f0bb5;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- parts = stream.readInt32();
- name = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData 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(AbsSerializedData stream) {
- id = stream.readInt64();
- parts = stream.readInt32();
- name = stream.readString();
- md5_checksum = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt32(parts);
- stream.writeString(name);
- stream.writeString(md5_checksum);
- }
- }
-
- public static class TL_userFull extends TLObject {
- public static int constructor = 0x771095da;
-
- public User user;
- public TL_contacts_link link;
- public Photo profile_photo;
- public PeerNotifySettings notify_settings;
- public boolean blocked;
- public String real_first_name;
- public String real_last_name;
-
- public void readParams(AbsSerializedData stream) {
- user = (User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- link = (TL_contacts_link)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- profile_photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- notify_settings = (PeerNotifySettings)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- blocked = stream.readBool();
- real_first_name = stream.readString();
- real_last_name = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- user.serializeToStream(stream);
- link.serializeToStream(stream);
- profile_photo.serializeToStream(stream);
- notify_settings.serializeToStream(stream);
- stream.writeBool(blocked);
- stream.writeString(real_first_name);
- stream.writeString(real_last_name);
- }
- }
-
- 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 void readParams(AbsSerializedData stream) {
- pts = stream.readInt32();
- qts = stream.readInt32();
- date = stream.readInt32();
- seq = stream.readInt32();
- unread_count = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(pts);
- stream.writeInt32(qts);
stream.writeInt32(date);
- stream.writeInt32(seq);
- stream.writeInt32(unread_count);
- }
- }
-
- public static class TL_resPQ extends TLObject {
- public static int constructor = 0x05162463;
-
- public byte[] nonce;
- public byte[] server_nonce;
- public byte[] pq;
- public ArrayList server_public_key_fingerprints = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- nonce = stream.readData(16);
- server_nonce = stream.readData(16);
- pq = stream.readByteArray();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- server_public_key_fingerprints.add(stream.readInt64());
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeRaw(nonce);
- stream.writeRaw(server_nonce);
- stream.writeByteArray(pq);
- stream.writeInt32(0x1cb5c415);
- int count = server_public_key_fingerprints.size();
- stream.writeInt32(count);
- for (Long server_public_key_fingerprint : server_public_key_fingerprints) {
- stream.writeInt64(server_public_key_fingerprint);
- }
}
}
public static class Updates extends TLObject {
public int flags;
public int id;
+ public int from_id;
public int chat_id;
public String message;
public int pts;
@@ -6721,27 +8308,60 @@ public class TLRPC {
public Update update;
public int seq_start;
public int qts;
+
+ public static Updates TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ Updates result = null;
+ switch(constructor) {
+ case 0x52238b3c:
+ result = new TL_updateShortChatMessage();
+ break;
+ case 0x74ae4240:
+ result = new TL_updates();
+ break;
+ case 0xed5c2127:
+ result = new TL_updateShortMessage();
+ break;
+ case 0x78d4dec1:
+ result = new TL_updateShort();
+ break;
+ case 0x725b04c3:
+ result = new TL_updatesCombined();
+ break;
+ 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;
+ }
}
public static class TL_updateShortChatMessage extends Updates {
public static int constructor = 0x52238b3c;
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- id = stream.readInt32();
- user_id = stream.readInt32();
- chat_id = stream.readInt32();
- message = stream.readString();
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- date = stream.readInt32();
- if ((flags & MESSAGE_FLAG_FWD) != 0) {
- fwd_from_id = stream.readInt32();
- fwd_date = stream.readInt32();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ flags = stream.readInt32(exception);
+ id = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ chat_id = stream.readInt32(exception);
+ message = stream.readString(exception);
+ pts = stream.readInt32(exception);
+ pts_count = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ if ((flags & 4) != 0) {
+ fwd_from_id = stream.readInt32(exception);
}
- if ((flags & MESSAGE_FLAG_REPLY) != 0) {
- reply_to_msg_id = stream.readInt32();
+ if ((flags & 4) != 0) {
+ fwd_date = stream.readInt32(exception);
+ }
+ if ((flags & 8) != 0) {
+ reply_to_msg_id = stream.readInt32(exception);
}
}
@@ -6749,17 +8369,19 @@ public class TLRPC {
stream.writeInt32(constructor);
stream.writeInt32(flags);
stream.writeInt32(id);
- stream.writeInt32(user_id);
+ stream.writeInt32(from_id);
stream.writeInt32(chat_id);
stream.writeString(message);
stream.writeInt32(pts);
stream.writeInt32(pts_count);
stream.writeInt32(date);
- if ((flags & MESSAGE_FLAG_FWD) != 0) {
+ if ((flags & 4) != 0) {
stream.writeInt32(fwd_from_id);
+ }
+ if ((flags & 4) != 0) {
stream.writeInt32(fwd_date);
}
- if ((flags & MESSAGE_FLAG_REPLY) != 0) {
+ if ((flags & 8) != 0) {
stream.writeInt32(reply_to_msg_id);
}
}
@@ -6769,24 +8391,42 @@ public class TLRPC {
public static int constructor = 0x74ae4240;
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- updates.add((Update)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ public void readParams(AbsSerializedData 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;
}
- stream.readInt32();
- count = stream.readInt32();
+ int count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ updates.add(Update.TLdeserialize(stream, stream.readInt32(exception), exception));
}
- stream.readInt32();
- count = stream.readInt32();
+ 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++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
}
- date = stream.readInt32();
- seq = stream.readInt32();
+ 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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ date = stream.readInt32(exception);
+ seq = stream.readInt32(exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -6818,20 +8458,22 @@ public class TLRPC {
public static int constructor = 0xed5c2127;
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- id = stream.readInt32();
- user_id = stream.readInt32();
- message = stream.readString();
- pts = stream.readInt32();
- pts_count = stream.readInt32();
- date = stream.readInt32();
- if ((flags & MESSAGE_FLAG_FWD) != 0) {
- fwd_from_id = stream.readInt32();
- fwd_date = stream.readInt32();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ flags = stream.readInt32(exception);
+ id = stream.readInt32(exception);
+ user_id = stream.readInt32(exception);
+ message = stream.readString(exception);
+ pts = stream.readInt32(exception);
+ pts_count = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ if ((flags & 4) != 0) {
+ fwd_from_id = stream.readInt32(exception);
}
- if ((flags & MESSAGE_FLAG_REPLY) != 0) {
- reply_to_msg_id = stream.readInt32();
+ if ((flags & 4) != 0) {
+ fwd_date = stream.readInt32(exception);
+ }
+ if ((flags & 8) != 0) {
+ reply_to_msg_id = stream.readInt32(exception);
}
}
@@ -6844,11 +8486,13 @@ public class TLRPC {
stream.writeInt32(pts);
stream.writeInt32(pts_count);
stream.writeInt32(date);
- if ((flags & MESSAGE_FLAG_FWD) != 0) {
+ if ((flags & 4) != 0) {
stream.writeInt32(fwd_from_id);
+ }
+ if ((flags & 4) != 0) {
stream.writeInt32(fwd_date);
}
- if ((flags & MESSAGE_FLAG_REPLY) != 0) {
+ if ((flags & 8) != 0) {
stream.writeInt32(reply_to_msg_id);
}
}
@@ -6858,9 +8502,9 @@ public class TLRPC {
public static int constructor = 0x78d4dec1;
- public void readParams(AbsSerializedData stream) {
- update = (Update)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- date = stream.readInt32();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ update = Update.TLdeserialize(stream, stream.readInt32(exception), exception);
+ date = stream.readInt32(exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -6874,25 +8518,43 @@ public class TLRPC {
public static int constructor = 0x725b04c3;
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- updates.add((Update)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ public void readParams(AbsSerializedData 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;
}
- stream.readInt32();
- count = stream.readInt32();
+ int count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ updates.add(Update.TLdeserialize(stream, stream.readInt32(exception), exception));
}
- stream.readInt32();
- count = stream.readInt32();
+ 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++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
}
- date = stream.readInt32();
- seq_start = stream.readInt32();
- seq = stream.readInt32();
+ 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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ date = stream.readInt32(exception);
+ seq_start = stream.readInt32(exception);
+ seq = stream.readInt32(exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -6930,438 +8592,371 @@ public class TLRPC {
}
}
- public static class WallPaper extends TLObject {
- public int id;
- public String title;
- public ArrayList sizes = new ArrayList<>();
- public int color;
- public int bg_color;
+ public static class InputPeerNotifyEvents extends TLObject {
+
+ public static InputPeerNotifyEvents TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputPeerNotifyEvents result = null;
+ switch(constructor) {
+ case 0xe86a2c74:
+ result = new TL_inputPeerNotifyEventsAll();
+ break;
+ case 0xf03064d8:
+ result = new TL_inputPeerNotifyEventsEmpty();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in InputPeerNotifyEvents", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
}
- public static class TL_wallPaper extends WallPaper {
- public static int constructor = 0xccb03657;
+ public static class TL_inputPeerNotifyEventsAll extends InputPeerNotifyEvents {
+ public static int constructor = 0xe86a2c74;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- title = stream.readString();
- stream.readInt32();
- int count = stream.readInt32();
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputPeerNotifyEventsEmpty extends InputPeerNotifyEvents {
+ public static int constructor = 0xf03064d8;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_msgs_state_info extends TLObject {
+ public static int constructor = 0x04deb57d;
+
+ public long req_msg_id;
+ public String info;
+
+ public static TL_msgs_state_info TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_msgs_state_info.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_msgs_state_info", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_msgs_state_info result = new TL_msgs_state_info();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ req_msg_id = stream.readInt64(exception);
+ info = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(req_msg_id);
+ stream.writeString(info);
+ }
+ }
+
+ public static class updates_Difference extends TLObject {
+ public int date;
+ public int seq;
+ 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 intermediate_state;
+ public TL_updates_state state;
+
+ public static updates_Difference TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ updates_Difference result = null;
+ switch(constructor) {
+ case 0x5d75a138:
+ result = new TL_updates_differenceEmpty();
+ break;
+ case 0xa8fb1981:
+ result = new TL_updates_differenceSlice();
+ break;
+ case 0xf49ca0:
+ result = new TL_updates_difference();
+ 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_differenceEmpty extends updates_Difference {
+ public static int constructor = 0x5d75a138;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ date = stream.readInt32(exception);
+ seq = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(date);
+ stream.writeInt32(seq);
+ }
+ }
+
+ public static class TL_updates_differenceSlice extends updates_Difference {
+ public static int constructor = 0xa8fb1981;
+
+
+ public void readParams(AbsSerializedData 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++) {
- sizes.add((PhotoSize)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ new_messages.add(Message.TLdeserialize(stream, stream.readInt32(exception), exception));
}
- color = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(title);
- stream.writeInt32(0x1cb5c415);
- int count = sizes.size();
- stream.writeInt32(count);
- for (PhotoSize size : sizes) {
- size.serializeToStream(stream);
+ magic = stream.readInt32(exception);
+ if (magic != 0x1cb5c415) {
+ if (exception) {
+ throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
+ }
+ return;
}
- stream.writeInt32(color);
- }
- }
-
- public static class TL_wallPaperSolid extends WallPaper {
- public static int constructor = 0x63117f24;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- title = stream.readString();
- bg_color = stream.readInt32();
- color = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(title);
- stream.writeInt32(bg_color);
- stream.writeInt32(color);
- }
- }
-
- public static class MsgDetailedInfo extends TLObject {
- public long answer_msg_id;
- public int bytes;
- public int status;
- public long msg_id;
- }
-
- public static class TL_msg_new_detailed_info extends MsgDetailedInfo {
- public static int constructor = 0x809db6df;
-
-
- public void readParams(AbsSerializedData stream) {
- answer_msg_id = stream.readInt64();
- bytes = stream.readInt32();
- status = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(answer_msg_id);
- stream.writeInt32(bytes);
- stream.writeInt32(status);
- }
- }
-
- public static class TL_msg_detailed_info extends MsgDetailedInfo {
- public static int constructor = 0x276d3ec6;
-
-
- public void readParams(AbsSerializedData stream) {
- msg_id = stream.readInt64();
- answer_msg_id = stream.readInt64();
- bytes = stream.readInt32();
- status = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(msg_id);
- stream.writeInt64(answer_msg_id);
- stream.writeInt32(bytes);
- stream.writeInt32(status);
- }
- }
-
- public static class TL_stickerPack extends TLObject {
- public static int constructor = 0x12b299d4;
-
- public String emoticon;
- public ArrayList documents = new ArrayList<>();
-
- public void readParams(AbsSerializedData stream) {
- emoticon = stream.readString();
- stream.readInt32();
- int count = stream.readInt32();
+ count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
- documents.add(stream.readInt64());
+ new_encrypted_messages.add(EncryptedMessage.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ other_updates.add(Update.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ intermediate_state = TL_updates_state.TLdeserialize(stream, stream.readInt32(exception), exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeString(emoticon);
stream.writeInt32(0x1cb5c415);
- int count = documents.size();
+ int count = new_messages.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
- stream.writeInt64(documents.get(a));
+ new_messages.get(a).serializeToStream(stream);
}
- }
- }
-
- public static class TL_inputEncryptedChat extends TLObject {
- public static int constructor = 0xf141b5e1;
-
- public int chat_id;
- public long access_hash;
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- stream.writeInt64(access_hash);
- }
- }
-
- public static class InputChatPhoto extends TLObject {
- public InputPhoto id;
- public InputPhotoCrop crop;
- public InputFile file;
- }
-
- public static class TL_inputChatPhoto extends InputChatPhoto {
- public static int constructor = 0xb2e1bf08;
-
-
- public void readParams(AbsSerializedData stream) {
- id = (InputPhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- crop = (InputPhotoCrop)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- id.serializeToStream(stream);
- crop.serializeToStream(stream);
- }
- }
-
- public static class TL_inputChatPhotoEmpty extends InputChatPhoto {
- public static int constructor = 0x1ca48f57;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputChatUploadedPhoto extends InputChatPhoto {
- public static int constructor = 0x94254732;
-
-
- public void readParams(AbsSerializedData stream) {
- file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- crop = (InputPhotoCrop)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- file.serializeToStream(stream);
- crop.serializeToStream(stream);
- }
- }
-
- public static class InputVideo extends TLObject {
- public long id;
- public long access_hash;
- }
-
- public static class TL_inputVideoEmpty extends InputVideo {
- public static int constructor = 0x5508ec75;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputVideo extends InputVideo {
- public static int constructor = 0xee579652;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- }
- }
-
- public static class TL_nearestDc extends TLObject {
- public static int constructor = 0x8e1a1775;
-
- public String country;
- public int this_dc;
- public int nearest_dc;
-
- public void readParams(AbsSerializedData stream) {
- country = stream.readString();
- this_dc = stream.readInt32();
- nearest_dc = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(country);
- stream.writeInt32(this_dc);
- stream.writeInt32(nearest_dc);
- }
- }
-
- public static class InputPhoto extends TLObject {
- public long id;
- public long access_hash;
- }
-
- public static class TL_inputPhotoEmpty extends InputPhoto {
- public static int constructor = 0x1cd7bf0d;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputPhoto extends InputPhoto {
- public static int constructor = 0xfb95c6c4;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(id);
- stream.writeInt64(access_hash);
- }
- }
-
- public static class TL_importedContact extends TLObject {
- public static int constructor = 0xd0028438;
-
- public int user_id;
- public long client_id;
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- client_id = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeInt64(client_id);
- }
- }
-
- public static class TL_accountDaysTTL extends TLObject {
- public static int constructor = 0xb8d0afdf;
-
- public int days;
-
- public void readParams(AbsSerializedData stream) {
- days = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(days);
- }
- }
-
- public static class InputPeer extends TLObject {
- public int user_id;
- public int chat_id;
- public long access_hash;
- }
-
- public static class TL_inputPeerContact extends InputPeer {
- public static int constructor = 0x1023dbe8;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- }
- }
-
- public static class TL_inputPeerChat extends InputPeer {
- public static int constructor = 0x179be863;
-
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(chat_id);
- }
- }
-
- public static class TL_inputPeerEmpty extends InputPeer {
- public static int constructor = 0x7f3b18ea;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputPeerSelf extends InputPeer {
- public static int constructor = 0x7da07ec9;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_inputPeerForeign extends InputPeer {
- public static int constructor = 0x9b447325;
-
-
- public void readParams(AbsSerializedData stream) {
- user_id = stream.readInt32();
- access_hash = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(user_id);
- stream.writeInt64(access_hash);
- }
- }
-
- public static class TL_account_passwordInputSettings extends TLObject {
- public static int constructor = 0xbcfc532c;
-
- public int flags;
- public byte[] new_salt;
- public byte[] new_password_hash;
- public String hint;
- public String email;
-
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- if ((flags & 1) != 0) {
- new_salt = stream.readByteArray();
- new_password_hash = stream.readByteArray();
- hint = stream.readString();
+ 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);
}
- if ((flags & 2) != 0) {
- email = stream.readString();
+ stream.writeInt32(0x1cb5c415);
+ count = other_updates.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ other_updates.get(a).serializeToStream(stream);
}
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(flags);
- if ((flags & 1) != 0) {
- stream.writeByteArray(new_salt);
- stream.writeByteArray(new_password_hash);
- stream.writeString(hint);
+ stream.writeInt32(0x1cb5c415);
+ count = chats.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ chats.get(a).serializeToStream(stream);
}
- if ((flags & 2) != 0) {
- stream.writeString(email);
+ 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_dcOption extends TLObject {
- public static int constructor = 0x2ec2a43c;
+ public static class TL_updates_difference extends updates_Difference {
+ public static int constructor = 0xf49ca0;
- public int id;
- public String hostname;
- public String ip_address;
- public int port;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- hostname = stream.readString();
- ip_address = stream.readString();
- port = stream.readInt32();
+ public void readParams(AbsSerializedData 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++) {
+ new_messages.add(Message.TLdeserialize(stream, stream.readInt32(exception), 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_encrypted_messages.add(EncryptedMessage.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ other_updates.add(Update.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ state = TL_updates_state.TLdeserialize(stream, stream.readInt32(exception), exception);
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(hostname);
- stream.writeString(ip_address);
- stream.writeInt32(port);
+ 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 ChatPhoto extends TLObject {
+ public FileLocation photo_small;
+ public FileLocation photo_big;
+
+ public static ChatPhoto TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ ChatPhoto result = null;
+ switch(constructor) {
+ case 0x37c1011c:
+ result = new TL_chatPhotoEmpty();
+ break;
+ case 0x6153276a:
+ result = new TL_chatPhoto();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in ChatPhoto", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_chatPhotoEmpty extends ChatPhoto {
+ public static int constructor = 0x37c1011c;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_chatPhoto extends ChatPhoto {
+ public static int constructor = 0x6153276a;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ photo_small = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception);
+ photo_big = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ photo_small.serializeToStream(stream);
+ photo_big.serializeToStream(stream);
}
}
@@ -7374,12 +8969,25 @@ public class TLRPC {
public int out_seq_no;
public DecryptedMessage message;
- public void readParams(AbsSerializedData stream) {
- random_bytes = stream.readByteArray();
- layer = stream.readInt32();
- in_seq_no = stream.readInt32();
- out_seq_no = stream.readInt32();
- message = (DecryptedMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public static TL_decryptedMessageLayer TLdeserialize(AbsSerializedData 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(AbsSerializedData 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);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7392,10 +9000,397 @@ public class TLRPC {
}
}
+ public static class TL_audioEmpty extends Audio {
+ public static int constructor = 0x586988d8;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ }
+ }
+
+ public static class TL_audio extends Audio {
+ public static int constructor = 0xc7ac6496;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ stream.writeInt64(access_hash);
+ stream.writeInt32(user_id);
+ stream.writeInt32(date);
+ stream.writeInt32(duration);
+ stream.writeString(mime_type);
+ stream.writeInt32(size);
+ stream.writeInt32(dc_id);
+ }
+ }
+
+ public static class TL_contacts_found extends TLObject {
+ public static int constructor = 0x566000e;
+
+ public ArrayList results = new ArrayList<>();
+ public ArrayList users = new ArrayList<>();
+
+ public static TL_contacts_found TLdeserialize(AbsSerializedData 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(AbsSerializedData 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++) {
+ results.add(TL_contactFound.TLdeserialize(stream, stream.readInt32(exception), 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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(0x1cb5c415);
+ int count = results.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ results.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_documentEmpty extends Document {
+ public static int constructor = 0x36f8c871;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(id);
+ }
+ }
+
+ public static class TL_document extends Document {
+ public static int constructor = 0xf9a39f4f;
+
+
+ public void readParams(AbsSerializedData 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(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++) {
+ attributes.add(DocumentAttribute.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData 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 MessagesFilter extends TLObject {
+
+ public static MessagesFilter TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ MessagesFilter result = null;
+ switch(constructor) {
+ case 0x9eddf188:
+ result = new TL_inputMessagesFilterDocument();
+ break;
+ case 0x9fc00e65:
+ result = new TL_inputMessagesFilterVideo();
+ break;
+ case 0x9609a51c:
+ result = new TL_inputMessagesFilterPhotos();
+ break;
+ case 0xd95e73bb:
+ result = new TL_inputMessagesFilterPhotoVideoDocuments();
+ break;
+ case 0xcfc87522:
+ result = new TL_inputMessagesFilterAudio();
+ break;
+ case 0x57e2f66c:
+ result = new TL_inputMessagesFilterEmpty();
+ break;
+ case 0x56e9f0e4:
+ result = new TL_inputMessagesFilterPhotoVideo();
+ 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_inputMessagesFilterDocument extends MessagesFilter {
+ public static int constructor = 0x9eddf188;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputMessagesFilterVideo extends MessagesFilter {
+ public static int constructor = 0x9fc00e65;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputMessagesFilterPhotos extends MessagesFilter {
+ public static int constructor = 0x9609a51c;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputMessagesFilterPhotoVideoDocuments extends MessagesFilter {
+ public static int constructor = 0xd95e73bb;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputMessagesFilterAudio extends MessagesFilter {
+ public static int constructor = 0xcfc87522;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputMessagesFilterEmpty extends MessagesFilter {
+ public static int constructor = 0x57e2f66c;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_inputMessagesFilterPhotoVideo extends MessagesFilter {
+ public static int constructor = 0x56e9f0e4;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_account_passwordSettings extends TLObject {
+ public static int constructor = 0xb7b72ab3;
+
+ public String email;
+
+ public static TL_account_passwordSettings TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ email = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(email);
+ }
+ }
+
+ public static class ExportedChatInvite extends TLObject {
+ public String link;
+
+ public static ExportedChatInvite TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ ExportedChatInvite result = null;
+ switch(constructor) {
+ case 0xfc2e05bc:
+ result = new TL_chatInviteExported();
+ break;
+ case 0x69df3769:
+ result = new TL_chatInviteEmpty();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in ExportedChatInvite", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_chatInviteExported extends ExportedChatInvite {
+ public static int constructor = 0xfc2e05bc;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ link = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(link);
+ }
+ }
+
+ public static class TL_chatInviteEmpty extends ExportedChatInvite {
+ public static int constructor = 0x69df3769;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_http_wait extends TLObject {
+ public static int constructor = 0x9299359f;
+
+ public int max_delay;
+ public int wait_after;
+ public int max_wait;
+
+ public static TL_http_wait TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_http_wait.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_http_wait", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_http_wait result = new TL_http_wait();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ max_delay = stream.readInt32(exception);
+ wait_after = stream.readInt32(exception);
+ max_wait = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(max_delay);
+ stream.writeInt32(wait_after);
+ stream.writeInt32(max_wait);
+ }
+ }
+
public static class InputPhotoCrop extends TLObject {
public double crop_left;
public double crop_top;
public double crop_width;
+
+ public static InputPhotoCrop TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ InputPhotoCrop result = null;
+ switch(constructor) {
+ case 0xade6b004:
+ result = new TL_inputPhotoCropAuto();
+ break;
+ case 0xd9915325:
+ result = new TL_inputPhotoCrop();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in InputPhotoCrop", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
}
public static class TL_inputPhotoCropAuto extends InputPhotoCrop {
@@ -7411,10 +9406,10 @@ public class TLRPC {
public static int constructor = 0xd9915325;
- public void readParams(AbsSerializedData stream) {
- crop_left = stream.readDouble();
- crop_top = stream.readDouble();
- crop_width = stream.readDouble();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ crop_left = stream.readDouble(exception);
+ crop_top = stream.readDouble(exception);
+ crop_width = stream.readDouble(exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7425,60 +9420,659 @@ public class TLRPC {
}
}
- public static class messages_Dialogs extends TLObject {
- public ArrayList dialogs = new ArrayList<>();
- public ArrayList messages = new ArrayList<>();
+ public static class Chat extends TLObject {
+ public int id;
+ public String title;
+ public int date;
+ public long access_hash;
+ public String address;
+ public String venue;
+ public GeoPoint geo;
+ public ChatPhoto photo;
+ public int participants_count;
+ public boolean checked_in;
+ public int version;
+ public boolean left;
+
+ public static Chat TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ Chat result = null;
+ switch(constructor) {
+ case 0xfb0ccc41:
+ result = new TL_chatForbidden();
+ break;
+ case 0x75eaea5a:
+ result = new TL_geoChat();
+ break;
+ case 0x9ba2d800:
+ result = new TL_chatEmpty();
+ break;
+ case 0x6e9c9bc7:
+ result = new TL_chat();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in Chat", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_chatForbidden extends Chat {
+ public static int constructor = 0xfb0ccc41;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ title = stream.readString(exception);
+ date = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeString(title);
+ stream.writeInt32(date);
+ }
+ }
+
+ public static class TL_geoChat extends Chat {
+ public static int constructor = 0x75eaea5a;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ access_hash = stream.readInt64(exception);
+ title = stream.readString(exception);
+ address = stream.readString(exception);
+ venue = stream.readString(exception);
+ geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception);
+ photo = ChatPhoto.TLdeserialize(stream, stream.readInt32(exception), exception);
+ participants_count = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ checked_in = stream.readBool(exception);
+ version = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeInt64(access_hash);
+ stream.writeString(title);
+ stream.writeString(address);
+ stream.writeString(venue);
+ geo.serializeToStream(stream);
+ photo.serializeToStream(stream);
+ stream.writeInt32(participants_count);
+ stream.writeInt32(date);
+ stream.writeBool(checked_in);
+ stream.writeInt32(version);
+ }
+ }
+
+ public static class TL_chat extends Chat {
+ public static int constructor = 0x6e9c9bc7;
+
+
+ public void readParams(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeString(title);
+ photo.serializeToStream(stream);
+ stream.writeInt32(participants_count);
+ stream.writeInt32(date);
+ stream.writeBool(left);
+ stream.writeInt32(version);
+ }
+ }
+
+ public static class TL_messages_chats extends TLObject {
+ public static int constructor = 0x64ff9fd5;
+
public ArrayList chats = new ArrayList<>();
+
+ public static TL_messages_chats TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_messages_chats.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_messages_chats", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_messages_chats result = new TL_messages_chats();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData 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++) {
+ chats.add(Chat.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData 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 ContactLink extends TLObject {
+
+ public static ContactLink TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ ContactLink result = null;
+ switch(constructor) {
+ case 0xfeedd3ad:
+ result = new TL_contactLinkNone();
+ break;
+ case 0xd502c2d0:
+ result = new TL_contactLinkContact();
+ break;
+ case 0x268f3f59:
+ result = new TL_contactLinkHasPhone();
+ break;
+ case 0x5f4f9247:
+ result = new TL_contactLinkUnknown();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in ContactLink", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_contactLinkNone extends ContactLink {
+ public static int constructor = 0xfeedd3ad;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_contactLinkContact extends ContactLink {
+ public static int constructor = 0xd502c2d0;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_contactLinkHasPhone extends ContactLink {
+ public static int constructor = 0x268f3f59;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_contactLinkUnknown extends ContactLink {
+ public static int constructor = 0x5f4f9247;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class PeerNotifyEvents extends TLObject {
+
+ public static PeerNotifyEvents TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ PeerNotifyEvents result = null;
+ switch(constructor) {
+ case 0xadd53cb3:
+ result = new TL_peerNotifyEventsEmpty();
+ break;
+ case 0x6d1ded88:
+ result = new TL_peerNotifyEventsAll();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in PeerNotifyEvents", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_peerNotifyEventsEmpty extends PeerNotifyEvents {
+ public static int constructor = 0xadd53cb3;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_peerNotifyEventsAll extends PeerNotifyEvents {
+ public static int constructor = 0x6d1ded88;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_sendMessageRecordAudioAction extends SendMessageAction {
+ public static int constructor = 0xd52f73f7;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_sendMessageUploadAudioAction extends SendMessageAction {
+ public static int constructor = 0xf351d7ab;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ progress = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(progress);
+ }
+ }
+
+ public static class TL_sendMessageUploadPhotoAction extends SendMessageAction {
+ public static int constructor = 0xd1d34a26;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ progress = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(progress);
+ }
+ }
+
+ public static class TL_sendMessageUploadVideoAction extends SendMessageAction {
+ public static int constructor = 0xe9763aec;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ progress = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(progress);
+ }
+ }
+
+ public static class TL_sendMessageCancelAction extends SendMessageAction {
+ public static int constructor = 0xfd5ec8f5;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_sendMessageGeoLocationAction extends SendMessageAction {
+ public static int constructor = 0x176f8ba1;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_sendMessageChooseContactAction extends SendMessageAction {
+ public static int constructor = 0x628cbc6f;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_sendMessageTypingAction extends SendMessageAction {
+ public static int constructor = 0x16bf744e;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_sendMessageUploadDocumentAction extends SendMessageAction {
+ public static int constructor = 0xaa0cd9e4;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ progress = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(progress);
+ }
+ }
+
+ public static class TL_sendMessageRecordVideoAction extends SendMessageAction {
+ public static int constructor = 0xa187d66f;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_client_DH_inner_data extends TLObject {
+ public static int constructor = 0x6643b654;
+
+ public byte[] nonce;
+ public byte[] server_nonce;
+ public long retry_id;
+ public byte[] g_b;
+
+ public static TL_client_DH_inner_data TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_client_DH_inner_data.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_client_DH_inner_data", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_client_DH_inner_data result = new TL_client_DH_inner_data();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ nonce = stream.readData(16, exception);
+ server_nonce = stream.readData(16, exception);
+ retry_id = stream.readInt64(exception);
+ g_b = stream.readByteArray(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeRaw(nonce);
+ stream.writeRaw(server_nonce);
+ stream.writeInt64(retry_id);
+ stream.writeByteArray(g_b);
+ }
+ }
+
+ public static class TL_null extends TLObject {
+ public static int constructor = 0x56730bcc;
+
+
+ public static TL_null TLdeserialize(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class account_Password extends TLObject {
+ public byte[] current_salt;
+ public byte[] new_salt;
+ public String hint;
+ public boolean has_recovery;
+ public String email_unconfirmed_pattern;
+
+ public static account_Password TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ account_Password result = null;
+ switch(constructor) {
+ case 0x7c18141c:
+ result = new TL_account_password();
+ break;
+ case 0x96dabc18:
+ result = new TL_account_noPassword();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in account_Password", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_account_password extends account_Password {
+ public static int constructor = 0x7c18141c;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ current_salt = stream.readByteArray(exception);
+ new_salt = stream.readByteArray(exception);
+ hint = stream.readString(exception);
+ has_recovery = stream.readBool(exception);
+ email_unconfirmed_pattern = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeByteArray(current_salt);
+ stream.writeByteArray(new_salt);
+ stream.writeString(hint);
+ stream.writeBool(has_recovery);
+ stream.writeString(email_unconfirmed_pattern);
+ }
+ }
+
+ public static class TL_account_noPassword extends account_Password {
+ public static int constructor = 0x96dabc18;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ new_salt = stream.readByteArray(exception);
+ email_unconfirmed_pattern = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeByteArray(new_salt);
+ stream.writeString(email_unconfirmed_pattern);
+ }
+ }
+
+ public static class TL_documentAttributeAnimated extends DocumentAttribute {
+ public static int constructor = 0x11b58939;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_documentAttributeImageSize extends DocumentAttribute {
+ public static int constructor = 0x6c37c15c;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ w = stream.readInt32(exception);
+ h = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(w);
+ stream.writeInt32(h);
+ }
+ }
+
+ public static class TL_documentAttributeFilename extends DocumentAttribute {
+ public static int constructor = 0x15590068;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ file_name = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(file_name);
+ }
+ }
+
+ public static class TL_documentAttributeVideo extends DocumentAttribute {
+ public static int constructor = 0x5910cccb;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ duration = stream.readInt32(exception);
+ w = stream.readInt32(exception);
+ h = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(duration);
+ stream.writeInt32(w);
+ stream.writeInt32(h);
+ }
+ }
+
+ public static class TL_documentAttributeSticker extends DocumentAttribute {
+ public static int constructor = 0x994c9882;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ alt = stream.readString(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(alt);
+ }
+ }
+
+ public static class TL_documentAttributeAudio extends DocumentAttribute {
+ public static int constructor = 0x51448e5;
+
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ duration = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(duration);
+ }
+ }
+
+ public static class TL_contacts_importedContacts extends TLObject {
+ public static int constructor = 0xad524315;
+
+ public ArrayList imported = new ArrayList<>();
+ public ArrayList retry_contacts = new ArrayList<>();
public ArrayList users = new ArrayList<>();
- public int count;
- }
- public static class TL_messages_dialogs extends messages_Dialogs {
- public static int constructor = 0x15ba6c40;
+ public static TL_contacts_importedContacts TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_contacts_importedContacts.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_contacts_importedContacts", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_contacts_importedContacts result = new TL_contacts_importedContacts();
+ result.readParams(stream, exception);
+ return result;
+ }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- dialogs.add((TL_dialog)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ public void readParams(AbsSerializedData 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;
}
- stream.readInt32();
- count = stream.readInt32();
+ int count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
- messages.add((Message)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ imported.add(TL_importedContact.TLdeserialize(stream, stream.readInt32(exception), exception));
}
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ magic = stream.readInt32(exception);
+ if (magic != 0x1cb5c415) {
+ if (exception) {
+ throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
+ }
+ return;
}
- stream.readInt32();
- count = stream.readInt32();
+ count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ retry_contacts.add(stream.readInt64(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++) {
+ users.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
}
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(0x1cb5c415);
- int count = dialogs.size();
+ int count = imported.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
- dialogs.get(a).serializeToStream(stream);
+ imported.get(a).serializeToStream(stream);
}
stream.writeInt32(0x1cb5c415);
- count = messages.size();
+ count = retry_contacts.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.writeInt64(retry_contacts.get(a));
}
stream.writeInt32(0x1cb5c415);
count = users.size();
@@ -7489,99 +10083,248 @@ public class TLRPC {
}
}
- public static class TL_messages_dialogsSlice extends messages_Dialogs {
- public static int constructor = 0x71e094f3;
+ public static class PrivacyRule extends TLObject {
+ public ArrayList users = new ArrayList<>();
+
+ public static PrivacyRule TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ PrivacyRule result = null;
+ switch(constructor) {
+ case 0x4d5bbe0c:
+ result = new TL_privacyValueAllowUsers();
+ break;
+ case 0x8b73e763:
+ result = new TL_privacyValueDisallowAll();
+ break;
+ case 0xfffe1bac:
+ result = new TL_privacyValueAllowContacts();
+ break;
+ case 0xf888fa1a:
+ result = new TL_privacyValueDisallowContacts();
+ break;
+ case 0x65427b82:
+ result = new TL_privacyValueAllowAll();
+ break;
+ case 0xc7f49b7:
+ result = new TL_privacyValueDisallowUsers();
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in PrivacyRule", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
+ }
+
+ public static class TL_privacyValueAllowUsers extends PrivacyRule {
+ public static int constructor = 0x4d5bbe0c;
- public void readParams(AbsSerializedData stream) {
- count = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- dialogs.add((TL_dialog)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ public void readParams(AbsSerializedData 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;
}
- stream.readInt32();
- count = stream.readInt32();
+ int count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
- messages.add((Message)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ users.add(stream.readInt32(exception));
}
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt32(count);
stream.writeInt32(0x1cb5c415);
- int count = dialogs.size();
+ int count = users.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);
+ stream.writeInt32(users.get(a));
}
}
}
- public static class TL_account_authorizations extends TLObject {
- public static int constructor = 0x1250abde;
+ public static class TL_privacyValueDisallowAll extends PrivacyRule {
+ public static int constructor = 0x8b73e763;
- public ArrayList authorizations = new ArrayList<>();
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_privacyValueAllowContacts extends PrivacyRule {
+ public static int constructor = 0xfffe1bac;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_privacyValueDisallowContacts extends PrivacyRule {
+ public static int constructor = 0xf888fa1a;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_privacyValueAllowAll extends PrivacyRule {
+ public static int constructor = 0x65427b82;
+
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_privacyValueDisallowUsers extends PrivacyRule {
+ public static int constructor = 0xc7f49b7;
+
+
+ public void readParams(AbsSerializedData 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++) {
- authorizations.add((TL_authorization)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ users.add(stream.readInt32(exception));
}
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(0x1cb5c415);
- int count = authorizations.size();
+ int count = users.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
- authorizations.get(a).serializeToStream(stream);
+ stream.writeInt32(users.get(a));
}
}
}
+ 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(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ pts = stream.readInt32(exception);
+ qts = stream.readInt32(exception);
+ date = stream.readInt32(exception);
+ seq = stream.readInt32(exception);
+ unread_count = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(pts);
+ stream.writeInt32(qts);
+ stream.writeInt32(date);
+ stream.writeInt32(seq);
+ stream.writeInt32(unread_count);
+ }
+ }
+
+ public static class TL_destroy_sessions_res extends TLObject {
+ public static int constructor = 0xfb95abcd;
+
+ public ArrayList destroy_results = new ArrayList<>();
+
+ public static TL_destroy_sessions_res TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ if (TL_destroy_sessions_res.constructor != constructor) {
+ if (exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in TL_destroy_sessions_res", constructor));
+ } else {
+ return null;
+ }
+ }
+ TL_destroy_sessions_res result = new TL_destroy_sessions_res();
+ result.readParams(stream, exception);
+ return result;
+ }
+
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ int count = stream.readInt32(exception);
+ for (int a = 0; a < count; a++) {
+ destroy_results.add(DestroySessionRes.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ int count = destroy_results.size();
+ stream.writeInt32(count);
+ for (int a = 0; a < count; a++) {
+ destroy_results.get(a).serializeToStream(stream);
+ }
+ }
+ }
+
+ public static class TL_receivedNotifyMessage extends TLObject {
+ public static int constructor = 0xa384b779;
+
+ public int id;
+ public int flags;
+
+ public static TL_receivedNotifyMessage TLdeserialize(AbsSerializedData 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(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ flags = stream.readInt32(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(id);
+ stream.writeInt32(flags);
+ }
+ }
+
public static class TL_req_pq extends TLObject {
public static int constructor = 0x60469778;
public byte[] nonce;
- public Class responseClass () {
- return TL_resPQ.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- nonce = stream.readData(16);
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_resPQ.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7600,17 +10343,8 @@ public class TLRPC {
public long public_key_fingerprint;
public byte[] encrypted_data;
- public Class responseClass () {
- return Server_DH_Params.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- nonce = stream.readData(16);
- server_nonce = stream.readData(16);
- p = stream.readByteArray();
- q = stream.readByteArray();
- public_key_fingerprint = stream.readInt64();
- encrypted_data = stream.readByteArray();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Server_DH_Params.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7629,12 +10363,8 @@ public class TLRPC {
public String phone_number;
- public Class responseClass () {
- return TL_auth_checkedPhone.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_auth_checkedPhone.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7652,16 +10382,8 @@ public class TLRPC {
public String api_hash;
public String lang_code;
- public Class responseClass () {
- return TL_auth_sentCode.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- sms_type = stream.readInt32();
- api_id = stream.readInt32();
- api_hash = stream.readString();
- lang_code = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return auth_SentCode.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7680,13 +10402,8 @@ public class TLRPC {
public String phone_number;
public String phone_code_hash;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- phone_code_hash = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7705,16 +10422,8 @@ public class TLRPC {
public String first_name;
public String last_name;
- public Class responseClass () {
- return TL_auth_authorization.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- phone_code_hash = stream.readString();
- phone_code = stream.readString();
- first_name = stream.readString();
- last_name = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_auth_authorization.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7734,14 +10443,8 @@ public class TLRPC {
public String phone_code_hash;
public String phone_code;
- public Class responseClass () {
- return TL_auth_authorization.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- phone_number = stream.readString();
- phone_code_hash = stream.readString();
- phone_code = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_auth_authorization.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7756,8 +10459,8 @@ public class TLRPC {
public static int constructor = 0x5717da40;
- public Class responseClass () {
- return Bool.class;
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7769,8 +10472,8 @@ public class TLRPC {
public static int constructor = 0x9fab0d1a;
- public Class responseClass () {
- return Bool.class;
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7784,17 +10487,8 @@ public class TLRPC {
public ArrayList phone_numbers = new ArrayList<>();
public String message;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- phone_numbers.add(stream.readString());
- }
- message = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7802,8 +10496,8 @@ public class TLRPC {
stream.writeInt32(0x1cb5c415);
int count = phone_numbers.size();
stream.writeInt32(count);
- for (String phone_number : phone_numbers) {
- stream.writeString(phone_number);
+ for (int a = 0; a < count; a++) {
+ stream.writeString(phone_numbers.get(a));
}
stream.writeString(message);
}
@@ -7814,12 +10508,8 @@ public class TLRPC {
public int dc_id;
- public Class responseClass () {
- return TL_auth_exportedAuthorization.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- dc_id = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_auth_exportedAuthorization.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7834,13 +10524,8 @@ public class TLRPC {
public int id;
public byte[] bytes;
- public Class responseClass () {
- return TL_auth_authorization.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- bytes = stream.readByteArray();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_auth_authorization.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7850,6 +10535,27 @@ public class TLRPC {
}
}
+ public static class TL_auth_bindTempAuthKey extends TLObject {
+ public static int constructor = 0xcdd42a05;
+
+ public long perm_auth_key_id;
+ public long nonce;
+ public int expires_at;
+ public byte[] encrypted_message;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(perm_auth_key_id);
+ stream.writeInt64(nonce);
+ stream.writeInt32(expires_at);
+ stream.writeByteArray(encrypted_message);
+ }
+ }
+
public static class TL_account_registerDevice extends TLObject {
public static int constructor = 0x446c712c;
@@ -7861,18 +10567,8 @@ public class TLRPC {
public boolean app_sandbox;
public String lang_code;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- token_type = stream.readInt32();
- token = stream.readString();
- device_model = stream.readString();
- system_version = stream.readString();
- app_version = stream.readString();
- app_sandbox = stream.readBool();
- lang_code = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7893,13 +10589,8 @@ public class TLRPC {
public int token_type;
public String token;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- token_type = stream.readInt32();
- token = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7915,13 +10606,8 @@ public class TLRPC {
public InputNotifyPeer peer;
public TL_inputPeerNotifySettings settings;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (InputNotifyPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- settings = (TL_inputPeerNotifySettings)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7936,12 +10622,8 @@ public class TLRPC {
public InputNotifyPeer peer;
- public Class responseClass () {
- return PeerNotifySettings.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (InputNotifyPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return PeerNotifySettings.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7954,8 +10636,8 @@ public class TLRPC {
public static int constructor = 0xdb7e1747;
- public Class responseClass () {
- return Bool.class;
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7969,13 +10651,8 @@ public class TLRPC {
public String first_name;
public String last_name;
- public Class responseClass () {
- return User.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- first_name = stream.readString();
- last_name = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return User.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -7990,12 +10667,8 @@ public class TLRPC {
public boolean offline;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- offline = stream.readBool();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8004,17 +10677,36 @@ public class TLRPC {
}
}
+ public static class TL_account_getWallPapers extends TLObject {
+ public static int constructor = 0xc04cfac2;
+
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ Vector vector = new Vector();
+ int size = stream.readInt32(exception);
+ for (int a = 0; a < size; a++) {
+ vector.objects.add(WallPaper.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ return vector;
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
public static class TL_users_getUsers extends TLObject {
public static int constructor = 0xd91a548;
public ArrayList id = new ArrayList<>();
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- id.add((InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ Vector vector = new Vector();
+ int size = stream.readInt32(exception);
+ for (int a = 0; a < size; a++) {
+ vector.objects.add(User.TLdeserialize(stream, stream.readInt32(exception), exception));
}
+ return vector;
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8022,8 +10714,8 @@ public class TLRPC {
stream.writeInt32(0x1cb5c415);
int count = id.size();
stream.writeInt32(count);
- for (InputUser anId : id) {
- anId.serializeToStream(stream);
+ for (int a = 0; a < count; a++) {
+ id.get(a).serializeToStream(stream);
}
}
}
@@ -8033,12 +10725,8 @@ public class TLRPC {
public InputUser id;
- public Class responseClass () {
- return TL_userFull.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- id = (InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_userFull.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8050,17 +10738,14 @@ public class TLRPC {
public static class TL_contacts_getStatuses extends TLObject {
public static int constructor = 0xc4a353ee;
- public ArrayList id = new ArrayList<>();
- public Class responseClass () {
- return Vector.class;
- }
-
- public void parseVector(Vector vector, AbsSerializedData data) {
- int size = data.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ Vector vector = new Vector();
+ int size = stream.readInt32(exception);
for (int a = 0; a < size; a++) {
- vector.objects.add(TLClassStore.Instance().TLdeserialize(data, data.readInt32()));
+ vector.objects.add(TL_contactStatus.TLdeserialize(stream, stream.readInt32(exception), exception));
}
+ return vector;
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8073,12 +10758,8 @@ public class TLRPC {
public String hash;
- public Class responseClass () {
- return contacts_Contacts.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- hash = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return contacts_Contacts.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8093,17 +10774,8 @@ public class TLRPC {
public ArrayList contacts = new ArrayList<>();
public boolean replace;
- public Class responseClass () {
- return TL_contacts_importedContacts.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- contacts.add((TL_inputPhoneContact)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- replace = stream.readBool();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_contacts_importedContacts.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8111,46 +10783,20 @@ public class TLRPC {
stream.writeInt32(0x1cb5c415);
int count = contacts.size();
stream.writeInt32(count);
- for (TL_inputPhoneContact contact : contacts) {
- contact.serializeToStream(stream);
+ for (int a = 0; a < count; a++) {
+ contacts.get(a).serializeToStream(stream);
}
stream.writeBool(replace);
}
}
- public static class TL_contacts_search extends TLObject {
- public static int constructor = 0x11f812d8;
-
- public String q;
- public int limit;
-
- public Class responseClass () {
- return TL_contacts_found.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- q = stream.readString();
- limit = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeString(q);
- stream.writeInt32(limit);
- }
- }
-
public static class TL_contacts_getSuggested extends TLObject {
public static int constructor = 0xcd773428;
public int limit;
- public Class responseClass () {
- return TL_contacts_suggested.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_contacts_suggested.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8164,12 +10810,8 @@ public class TLRPC {
public InputUser id;
- public Class responseClass () {
- return TL_contacts_link.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- id = (InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_contacts_link.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8183,16 +10825,8 @@ public class TLRPC {
public ArrayList id = new ArrayList<>();
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- id.add((InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8200,8 +10834,8 @@ public class TLRPC {
stream.writeInt32(0x1cb5c415);
int count = id.size();
stream.writeInt32(count);
- for (InputUser anId : id) {
- anId.serializeToStream(stream);
+ for (int a = 0; a < count; a++) {
+ id.get(a).serializeToStream(stream);
}
}
}
@@ -8211,12 +10845,8 @@ public class TLRPC {
public InputUser id;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- id = (InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8230,12 +10860,8 @@ public class TLRPC {
public InputUser id;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- id = (InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8250,13 +10876,8 @@ public class TLRPC {
public int offset;
public int limit;
- public Class responseClass () {
- return contacts_Blocked.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- offset = stream.readInt32();
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return contacts_Blocked.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8266,21 +10887,51 @@ public class TLRPC {
}
}
+ public static class TL_contacts_exportCard extends TLObject {
+ public static int constructor = 0x84e53737;
+
+
+ public TLObject deserializeResponse(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_contacts_importCard extends TLObject {
+ public static int constructor = 0x4fe196fe;
+
+ public ArrayList export_card = new ArrayList<>();
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return User.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData 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));
+ }
+ }
+ }
+
public static class TL_messages_getMessages extends TLObject {
public static int constructor = 0x4222fa74;
public ArrayList id = new ArrayList<>();
- public Class responseClass () {
- return messages_Messages.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- id.add(stream.readInt32());
- }
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return messages_Messages.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8288,8 +10939,8 @@ public class TLRPC {
stream.writeInt32(0x1cb5c415);
int count = id.size();
stream.writeInt32(count);
- for (Integer anId : id) {
- stream.writeInt32(anId);
+ for (int a = 0; a < count; a++) {
+ stream.writeInt32(id.get(a));
}
}
}
@@ -8301,14 +10952,8 @@ public class TLRPC {
public int max_id;
public int limit;
- public Class responseClass () {
- return messages_Dialogs.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- offset = stream.readInt32();
- max_id = stream.readInt32();
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return messages_Dialogs.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8327,15 +10972,8 @@ public class TLRPC {
public int max_id;
public int limit;
- public Class responseClass () {
- return messages_Messages.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (InputPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- offset = stream.readInt32();
- max_id = stream.readInt32();
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return messages_Messages.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8359,19 +10997,8 @@ public class TLRPC {
public int max_id;
public int limit;
- public Class responseClass () {
- return messages_Messages.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (InputPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- q = stream.readString();
- filter = (MessagesFilter)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- min_date = stream.readInt32();
- max_date = stream.readInt32();
- offset = stream.readInt32();
- max_id = stream.readInt32();
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return messages_Messages.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8394,14 +11021,8 @@ public class TLRPC {
public int max_id;
public int offset;
- public Class responseClass () {
- return TL_messages_affectedHistory.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (InputPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- max_id = stream.readInt32();
- offset = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_messages_affectedHistory.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8418,13 +11039,8 @@ public class TLRPC {
public InputPeer peer;
public int offset;
- public Class responseClass () {
- return TL_messages_affectedHistory.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (InputPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- offset = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_messages_affectedHistory.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8434,19 +11050,54 @@ public class TLRPC {
}
}
+ public static class TL_messages_deleteMessages extends TLObject {
+ public static int constructor = 0xa5f18925;
+
+ public ArrayList id = new ArrayList<>();
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_messages_affectedMessages.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData 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_receivedMessages extends TLObject {
+ public static int constructor = 0x5a954c0;
+
+ public int max_id;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ Vector vector = new Vector();
+ int size = stream.readInt32(exception);
+ for (int a = 0; a < size; a++) {
+ vector.objects.add(TL_receivedNotifyMessage.TLdeserialize(stream, stream.readInt32(exception), exception));
+ }
+ return vector;
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(max_id);
+ }
+ }
+
public static class TL_messages_setTyping extends TLObject {
public static int constructor = 0xa3825e50;
public InputPeer peer;
public SendMessageAction action;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (InputPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- action = (SendMessageAction)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8465,18 +11116,8 @@ public class TLRPC {
public String message;
public long random_id;
- public Class responseClass () {
- return messages_SentMessage.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- peer = (InputPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- if ((flags & 1) != 0) {
- reply_to_msg_id = stream.readInt32();
- }
- message = stream.readString();
- random_id = stream.readInt64();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return messages_SentMessage.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8500,18 +11141,8 @@ public class TLRPC {
public InputMedia media;
public long random_id;
- public Class responseClass () {
- return Updates.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- peer = (InputPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- if ((flags & 1) != 0) {
- reply_to_msg_id = stream.readInt32();
- }
- media = (InputMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- random_id = stream.readInt64();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Updates.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8533,22 +11164,8 @@ public class TLRPC {
public ArrayList id = new ArrayList<>();
public ArrayList random_id = new ArrayList<>();
- public Class responseClass () {
- return Updates.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (InputPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- id.add(stream.readInt32());
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- random_id.add(stream.readInt64());
- }
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Updates.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8574,16 +11191,8 @@ public class TLRPC {
public ArrayList id = new ArrayList<>();
- public Class responseClass () {
- return TL_messages_chats.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- id.add(stream.readInt32());
- }
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_messages_chats.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8591,8 +11200,8 @@ public class TLRPC {
stream.writeInt32(0x1cb5c415);
int count = id.size();
stream.writeInt32(count);
- for (Integer anId : id) {
- stream.writeInt32(anId);
+ for (int a = 0; a < count; a++) {
+ stream.writeInt32(id.get(a));
}
}
}
@@ -8602,12 +11211,8 @@ public class TLRPC {
public int chat_id;
- public Class responseClass () {
- return TL_messages_chatFull.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_messages_chatFull.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8622,13 +11227,8 @@ public class TLRPC {
public int chat_id;
public String title;
- public Class responseClass () {
- return Updates.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- title = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Updates.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8644,13 +11244,8 @@ public class TLRPC {
public int chat_id;
public InputChatPhoto photo;
- public Class responseClass () {
- return Updates.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- photo = (InputChatPhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Updates.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8667,14 +11262,8 @@ public class TLRPC {
public InputUser user_id;
public int fwd_limit;
- public Class responseClass () {
- return Updates.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- user_id = (InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- fwd_limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Updates.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8691,13 +11280,8 @@ public class TLRPC {
public int chat_id;
public InputUser user_id;
- public Class responseClass () {
- return Updates.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
- user_id = (InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Updates.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8713,17 +11297,8 @@ public class TLRPC {
public ArrayList users = new ArrayList<>();
public String title;
- public Class responseClass () {
- return Updates.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- users.add((InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- title = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Updates.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8742,8 +11317,8 @@ public class TLRPC {
public static int constructor = 0xedd4882a;
- public Class responseClass () {
- return TL_updates_state.class;
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_updates_state.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8758,14 +11333,8 @@ public class TLRPC {
public int date;
public int qts;
- public Class responseClass () {
- return updates_Difference.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- pts = stream.readInt32();
- date = stream.readInt32();
- qts = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return updates_Difference.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8782,13 +11351,8 @@ public class TLRPC {
public InputPhoto id;
public InputPhotoCrop crop;
- public Class responseClass () {
- return UserProfilePhoto.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- id = (InputPhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- crop = (InputPhotoCrop)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return UserProfilePhoto.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8798,32 +11362,6 @@ public class TLRPC {
}
}
- public static class TL_photos_deletePhotos extends TLObject {
- public static int constructor = 0x87cf7f2f;
-
- public ArrayList id = new ArrayList<>();
-
- public Class responseClass () {
- return Vector.class;
- }
-
- public void parseVector(Vector vector, AbsSerializedData data) {
- int size = data.readInt32();
- for (int a = 0; a < size; a++) {
- vector.objects.add(data.readInt64());
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(0x1cb5c415);
- stream.writeInt32(id.size());
- for (InputPhoto inputPhoto : id) {
- inputPhoto.serializeToStream(stream);
- }
- }
- }
-
public static class TL_photos_uploadProfilePhoto extends TLObject {
public static int constructor = 0xd50f9c88;
@@ -8832,15 +11370,8 @@ public class TLRPC {
public InputGeoPoint geo_point;
public InputPhotoCrop crop;
- public Class responseClass () {
- return TL_photos_photo.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- caption = stream.readString();
- geo_point = (InputGeoPoint)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- crop = (InputPhotoCrop)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_photos_photo.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8852,6 +11383,31 @@ public class TLRPC {
}
}
+ public static class TL_photos_deletePhotos extends TLObject {
+ public static int constructor = 0x87cf7f2f;
+
+ public ArrayList id = new ArrayList<>();
+
+ public TLObject deserializeResponse(AbsSerializedData 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(AbsSerializedData 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_upload_getFile extends TLObject {
public static int constructor = 0xe3a6cfb5;
@@ -8859,14 +11415,8 @@ public class TLRPC {
public int offset;
public int limit;
- public Class responseClass() {
- return TL_upload_file.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- location = (InputFileLocation)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- offset = stream.readInt32();
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_upload_file.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8881,8 +11431,8 @@ public class TLRPC {
public static int constructor = 0xc4f9186b;
- public Class responseClass () {
- return TL_config.class;
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_config.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8894,8 +11444,8 @@ public class TLRPC {
public static int constructor = 0x1fb33026;
- public Class responseClass () {
- return TL_nearestDc.class;
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_nearestDc.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8911,15 +11461,8 @@ public class TLRPC {
public String app_version;
public String lang_code;
- public Class responseClass () {
- return help_AppUpdate.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- device_model = stream.readString();
- system_version = stream.readString();
- app_version = stream.readString();
- lang_code = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return help_AppUpdate.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8936,16 +11479,8 @@ public class TLRPC {
public ArrayList events = new ArrayList<>();
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- events.add((TL_inputAppEvent)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8953,8 +11488,8 @@ public class TLRPC {
stream.writeInt32(0x1cb5c415);
int count = events.size();
stream.writeInt32(count);
- for (TL_inputAppEvent event : events) {
- event.serializeToStream(stream);
+ for (int a = 0; a < count; a++) {
+ events.get(a).serializeToStream(stream);
}
}
}
@@ -8964,12 +11499,8 @@ public class TLRPC {
public String lang_code;
- public Class responseClass () {
- return TL_help_inviteText.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- lang_code = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_help_inviteText.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -8986,15 +11517,8 @@ public class TLRPC {
public int max_id;
public int limit;
- public Class responseClass () {
- return photos_Photos.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- user_id = (InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- offset = stream.readInt32();
- max_id = stream.readInt32();
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return photos_Photos.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9013,14 +11537,8 @@ public class TLRPC {
public int id;
public long random_id;
- public Class responseClass () {
- return Updates.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (InputPeer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- id = stream.readInt32();
- random_id = stream.readInt64();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Updates.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9039,23 +11557,8 @@ public class TLRPC {
public String message;
public InputMedia media;
- public Class responseClass () {
- return Updates.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- contacts.add((InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- stream.readInt32();
- count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- random_id.add(stream.readInt64());
- }
- message = stream.readString();
- media = (InputMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Updates.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9084,14 +11587,8 @@ public class TLRPC {
public int radius;
public int limit;
- public Class responseClass () {
- return TL_geochats_located.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- geo_point = (InputGeoPoint)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- radius = stream.readInt32();
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_geochats_located.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9108,13 +11605,8 @@ public class TLRPC {
public int offset;
public int limit;
- public Class responseClass () {
- return geochats_Messages.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- offset = stream.readInt32();
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return geochats_Messages.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9129,12 +11621,8 @@ public class TLRPC {
public TL_inputGeoChat peer;
- public Class responseClass () {
- return TL_geochats_statedMessage.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputGeoChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_geochats_statedMessage.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9148,12 +11636,8 @@ public class TLRPC {
public TL_inputGeoChat peer;
- public Class responseClass() {
- return TL_messages_chatFull.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputGeoChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_messages_chatFull.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9169,14 +11653,8 @@ public class TLRPC {
public String title;
public String address;
- public Class responseClass () {
- return TL_geochats_statedMessage.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputGeoChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- title = stream.readString();
- address = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_geochats_statedMessage.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9193,13 +11671,8 @@ public class TLRPC {
public TL_inputGeoChat peer;
public InputChatPhoto photo;
- public Class responseClass () {
- return TL_geochats_statedMessage.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputGeoChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- photo = (InputChatPhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_geochats_statedMessage.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9221,19 +11694,8 @@ public class TLRPC {
public int max_id;
public int limit;
- public Class responseClass () {
- return geochats_Messages.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputGeoChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- q = stream.readString();
- filter = (MessagesFilter)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- min_date = stream.readInt32();
- max_date = stream.readInt32();
- offset = stream.readInt32();
- max_id = stream.readInt32();
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return geochats_Messages.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9257,15 +11719,8 @@ public class TLRPC {
public int max_id;
public int limit;
- public Class responseClass () {
- return geochats_Messages.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputGeoChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- offset = stream.readInt32();
- max_id = stream.readInt32();
- limit = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return geochats_Messages.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9283,13 +11738,8 @@ public class TLRPC {
public TL_inputGeoChat peer;
public boolean typing;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputGeoChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- typing = stream.readBool();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9306,14 +11756,8 @@ public class TLRPC {
public String message;
public long random_id;
- public Class responseClass () {
- return TL_geochats_statedMessage.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputGeoChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- message = stream.readString();
- random_id = stream.readInt64();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_geochats_statedMessage.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9331,14 +11775,8 @@ public class TLRPC {
public InputMedia media;
public long random_id;
- public Class responseClass () {
- return TL_geochats_statedMessage.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputGeoChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- media = (InputMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- random_id = stream.readInt64();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_geochats_statedMessage.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9357,15 +11795,8 @@ public class TLRPC {
public String address;
public String venue;
- public Class responseClass () {
- return TL_geochats_statedMessage.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- title = stream.readString();
- geo_point = (InputGeoPoint)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- address = stream.readString();
- venue = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_geochats_statedMessage.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9383,13 +11814,8 @@ public class TLRPC {
public int version;
public int random_length;
- public Class responseClass () {
- return messages_DhConfig.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- version = stream.readInt32();
- random_length = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return messages_DhConfig.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9406,14 +11832,8 @@ public class TLRPC {
public int random_id;
public byte[] g_a;
- public Class responseClass () {
- return EncryptedChat.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- user_id = (InputUser)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- random_id = stream.readInt32();
- g_a = stream.readByteArray();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return EncryptedChat.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9431,14 +11851,8 @@ public class TLRPC {
public byte[] g_b;
public long key_fingerprint;
- public Class responseClass () {
- return EncryptedChat.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputEncryptedChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- g_b = stream.readByteArray();
- key_fingerprint = stream.readInt64();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return EncryptedChat.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9454,12 +11868,8 @@ public class TLRPC {
public int chat_id;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- chat_id = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9474,13 +11884,8 @@ public class TLRPC {
public TL_inputEncryptedChat peer;
public boolean typing;
- public Class responseClass() {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputEncryptedChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- typing = stream.readBool();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9496,13 +11901,8 @@ public class TLRPC {
public TL_inputEncryptedChat peer;
public int max_date;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- peer = (TL_inputEncryptedChat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- max_date = stream.readInt32();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9512,21 +11912,63 @@ public class TLRPC {
}
}
- public static class TL_messages_deleteMessages extends TLObject {
- public static int constructor = 0xa5f18925;
+ public static class TL_messages_receivedQueue extends TLObject {
+ public static int constructor = 0x55a5bb66;
+
+ public int max_qts;
+
+ public TLObject deserializeResponse(AbsSerializedData 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(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(max_qts);
+ }
+ }
+
+ public static class TL_help_getSupport extends TLObject {
+ public static int constructor = 0x9cdf08cd;
+
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_help_support.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_auth_sendSms extends TLObject {
+ public static int constructor = 0xda9f3e8;
+
+ public String phone_number;
+ public String phone_code_hash;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(phone_number);
+ stream.writeString(phone_code_hash);
+ }
+ }
+
+ public static class TL_messages_readMessageContents extends TLObject {
+ public static int constructor = 0x36a73f77;
public ArrayList id = new ArrayList<>();
- public Class responseClass () {
- return TL_messages_affectedMessages.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- id.add(stream.readInt32());
- }
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_messages_affectedMessages.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9540,12 +11982,278 @@ public class TLRPC {
}
}
+ public static class TL_account_checkUsername extends TLObject {
+ public static int constructor = 0x2714d86c;
+
+ public String username;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(username);
+ }
+ }
+
+ public static class TL_account_updateUsername extends TLObject {
+ public static int constructor = 0x3e0bdd7c;
+
+ public String username;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return User.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(username);
+ }
+ }
+
+ public static class TL_contacts_search extends TLObject {
+ public static int constructor = 0x11f812d8;
+
+ public String q;
+ public int limit;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_contacts_found.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(q);
+ stream.writeInt32(limit);
+ }
+ }
+
+ public static class TL_account_getPrivacy extends TLObject {
+ public static int constructor = 0xdadbc950;
+
+ public TL_inputPrivacyKeyStatusTimestamp key;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_account_privacyRules.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ key.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_account_setPrivacy extends TLObject {
+ public static int constructor = 0xc9f81ce8;
+
+ public TL_inputPrivacyKeyStatusTimestamp key;
+ public ArrayList rules = new ArrayList<>();
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_account_privacyRules.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ key.serializeToStream(stream);
+ stream.writeInt32(0x1cb5c415);
+ 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 String reason;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(reason);
+ }
+ }
+
+ public static class TL_account_getAccountTTL extends TLObject {
+ public static int constructor = 0x8fc711d;
+
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_accountDaysTTL.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_account_setAccountTTL extends TLObject {
+ public static int constructor = 0x2442485e;
+
+ public TL_accountDaysTTL ttl;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ ttl.serializeToStream(stream);
+ }
+ }
+
+ public static class TL_contacts_resolveUsername extends TLObject {
+ public static int constructor = 0xbf0131c;
+
+ public String username;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return User.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(username);
+ }
+ }
+
+ public static class TL_account_sendChangePhoneCode extends TLObject {
+ public static int constructor = 0xa407a8f4;
+
+ public String phone_number;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_account_sentChangePhoneCode.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(phone_number);
+ }
+ }
+
+ 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 TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return User.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(phone_number);
+ stream.writeString(phone_code_hash);
+ stream.writeString(phone_code);
+ }
+ }
+
+ public static class TL_messages_getStickers extends TLObject {
+ public static int constructor = 0xae22e045;
+
+ public String emoticon;
+ public String hash;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return messages_Stickers.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(emoticon);
+ stream.writeString(hash);
+ }
+ }
+
+ public static class TL_messages_getAllStickers extends TLObject {
+ public static int constructor = 0xaa3bc868;
+
+ public String hash;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return messages_AllStickers.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(hash);
+ }
+ }
+
+ public static class TL_account_updateDeviceLocked extends TLObject {
+ public static int constructor = 0x38df3532;
+
+ public int period;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(period);
+ }
+ }
+
+ public static class TL_messages_getWebPagePreview extends TLObject {
+ public static int constructor = 0x25223e24;
+
+ public String message;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return MessageMedia.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(message);
+ }
+ }
+
+ public static class TL_account_getAuthorizations extends TLObject {
+ public static int constructor = 0xe320c158;
+
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_account_authorizations.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ }
+ }
+
+ public static class TL_account_resetAuthorization extends TLObject {
+ public static int constructor = 0xdf77f3bc;
+
+ public long hash;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt64(hash);
+ }
+ }
+
public static class TL_account_getPassword extends TLObject {
public static int constructor = 0x548a30f5;
- public Class responseClass () {
- return account_Password.class;
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return account_Password.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9558,12 +12266,8 @@ public class TLRPC {
public byte[] current_password_hash;
- public Class responseClass () {
- return TL_account_passwordSettings.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- current_password_hash = stream.readByteArray();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_account_passwordSettings.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9578,13 +12282,8 @@ public class TLRPC {
public byte[] current_password_hash;
public TL_account_passwordInputSettings new_settings;
- public Class responseClass () {
- return Bool.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- current_password_hash = stream.readByteArray();
- new_settings = (TL_account_passwordInputSettings)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9599,12 +12298,8 @@ public class TLRPC {
public byte[] password_hash;
- public Class responseClass () {
- return TL_auth_authorization.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- password_hash = stream.readByteArray();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_auth_authorization.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9617,8 +12312,8 @@ public class TLRPC {
public static int constructor = 0xd897bc66;
- public Class responseClass () {
- return TL_auth_passwordRecovery.class;
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_auth_passwordRecovery.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9631,12 +12326,8 @@ public class TLRPC {
public String code;
- public Class responseClass () {
- return TL_auth_authorization.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- code = stream.readString();
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return TL_auth_authorization.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -9645,765 +12336,323 @@ public class TLRPC {
}
}
+ public static class TL_messages_exportChatInvite extends TLObject {
+ public static int constructor = 0x7d885289;
+
+ public int chat_id;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return ExportedChatInvite.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeInt32(chat_id);
+ }
+ }
+
+ public static class TL_messages_checkChatInvite extends TLObject {
+ public static int constructor = 0x3eadb1bb;
+
+ public String hash;
+
+ public TLObject deserializeResponse(AbsSerializedData stream, int constructor, boolean exception) {
+ return ChatInvite.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData 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(AbsSerializedData stream, int constructor, boolean exception) {
+ return Updates.TLdeserialize(stream, constructor, exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(constructor);
+ stream.writeString(hash);
+ }
+ }
+
//manually created
- public static class TL_documentAttributeSticker_old extends TL_documentAttributeSticker {
- public static int constructor = 0xfb0a5727;
-
- public void readParams(AbsSerializedData stream) {
-
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_messageMediaUnsupported_old extends TL_messageMediaUnsupported {
- public static int constructor = 0x29632a36;
-
-
- public void readParams(AbsSerializedData stream) {
- bytes = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeByteArray(bytes);
- }
- }
-
- public static class TL_config_old extends TL_config {
- public static int constructor = 0x2e54dd74;
-
- public void readParams(AbsSerializedData stream) {
- date = stream.readInt32();
- test_mode = stream.readBool();
- this_dc = stream.readInt32();
- stream.readInt32();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- dc_options.add((TL_dcOption) TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
- }
- chat_size_max = stream.readInt32();
- broadcast_size_max = stream.readInt32();
- expires = (int) (System.currentTimeMillis() / 1000) + 3600;
- chat_big_size = 10;
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(date);
- stream.writeBool(test_mode);
- stream.writeInt32(this_dc);
- stream.writeInt32(0x1cb5c415);
- int count = dc_options.size();
- stream.writeInt32(count);
- for (TL_dcOption dc_option : dc_options) {
- dc_option.serializeToStream(stream);
- }
- stream.writeInt32(chat_size_max);
- stream.writeInt32(broadcast_size_max);
- }
- }
-
- public static class TL_document_old extends TL_document {
- public static int constructor = 0x9efc6326;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt64();
- access_hash = stream.readInt64();
- stream.readInt32();
- date = stream.readInt32();
- TL_documentAttributeFilename fileName = new TL_documentAttributeFilename();
- fileName.file_name = stream.readString();
- attributes.add(fileName);
- mime_type = stream.readString();
- size = stream.readInt32();
- thumb = (PhotoSize)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- dc_id = stream.readInt32();
- }
- }
-
- public static class TL_decryptedMessageHolder extends TLObject {
- public static int constructor = 0x555555F9;
-
- public long random_id;
+ //Photo start
+ public static class Photo extends TLObject {
+ public long id;
+ public long access_hash;
+ public int user_id;
public int date;
- public TL_decryptedMessageLayer layer;
- public EncryptedFile file;
- public boolean new_key_used;
+ public GeoPoint geo;
+ public ArrayList sizes = new ArrayList<>();
+ public String caption; //custom
- public void readParams(AbsSerializedData stream) {
- random_id = stream.readInt64();
- date = stream.readInt32();
- layer = (TL_decryptedMessageLayer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- if (stream.readBool()) {
- file = (EncryptedFile) TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public static Photo TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ Photo result = null;
+ switch(constructor) {
+ case 0xc3838076:
+ result = new TL_photo();
+ break;
+ case 0x2331b22d:
+ result = new TL_photoEmpty();
+ break;
+ case 0x22b56751:
+ result = new TL_photo_old(); //custom
+ break;
}
- new_key_used = stream.readBool();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(random_id);
- stream.writeInt32(date);
- layer.serializeToStream(stream);
- stream.writeBool(file != null);
- if (file != null) {
- file.serializeToStream(stream);
- }
- stream.writeBool(new_key_used);
- }
- }
-
- public static class TL_messages_sendEncryptedService extends TLObject {
- public static int constructor = 0x32d439a4;
-
- public TL_inputEncryptedChat peer;
- public long random_id;
- public ByteBufferDesc data;
-
- public Class responseClass () {
- return messages_SentEncryptedMessage.class;
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- peer.serializeToStream(stream);
- stream.writeInt64(random_id);
- stream.writeByteBuffer(data);
- }
-
- @Override
- public void freeResources() {
- if (disableFree) {
- return;
- }
- if (data != null) {
- BuffersStorage.getInstance().reuseFreeBuffer(data);
- data = null;
- }
- }
- }
-
- public static class TL_userDeleted_old extends TL_userDeleted {
- public static int constructor = 0xb29ad7cc;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(first_name);
- stream.writeString(last_name);
- }
- }
-
- public static class TL_userForeign_old extends TL_userForeign {
- public static int constructor = 0x5214c89d;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- access_hash = stream.readInt64();
- photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(first_name);
- stream.writeString(last_name);
- stream.writeInt64(access_hash);
- photo.serializeToStream(stream);
- status.serializeToStream(stream);
- }
- }
-
- public static class TL_userRequest_old extends TL_userRequest {
- public static int constructor = 0x22e8ceb0;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- access_hash = stream.readInt64();
- phone = stream.readString();
- photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- 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_userContact_old extends TL_userContact {
- public static int constructor = 0xf2fb8319;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- access_hash = stream.readInt64();
- phone = stream.readString();
- photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- 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_userSelf_old2 extends TL_userSelf {
- public static int constructor = 0x7007b451;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- username = stream.readString();
- phone = stream.readString();
- photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- inactive = stream.readBool();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- 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 class TL_userSelf_old extends TL_userSelf {
- public static int constructor = 0x720535ec;
-
-
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- first_name = stream.readString();
- last_name = stream.readString();
- phone = stream.readString();
- photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- inactive = stream.readBool();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(id);
- stream.writeString(first_name);
- stream.writeString(last_name);
- stream.writeString(phone);
- photo.serializeToStream(stream);
- status.serializeToStream(stream);
- stream.writeBool(inactive);
- }
- }
-
- public static class TL_set_client_DH_params extends TLObject {
- public static int constructor = 0xf5045f1f;
-
- public byte[] nonce;
- public byte[] server_nonce;
- public ByteBufferDesc encrypted_data;
-
- public Class responseClass () {
- return Set_client_DH_params_answer.class;
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeRaw(nonce);
- stream.writeRaw(server_nonce);
- stream.writeByteBuffer(encrypted_data);
- }
-
- @Override
- public void freeResources() {
- if (disableFree) {
- return;
- }
- if (encrypted_data != null) {
- BuffersStorage.getInstance().reuseFreeBuffer(encrypted_data);
- encrypted_data = null;
- }
- }
- }
-
- public static class TL_messages_sendEncrypted extends TLObject {
- public static int constructor = 0xa9776773;
-
- public TL_inputEncryptedChat peer;
- public long random_id;
- public ByteBufferDesc data;
-
- public Class responseClass () {
- return messages_SentEncryptedMessage.class;
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- peer.serializeToStream(stream);
- stream.writeInt64(random_id);
- stream.writeByteBuffer(data);
- }
-
- @Override
- public void freeResources() {
- if (disableFree) {
- return;
- }
- if (data != null) {
- BuffersStorage.getInstance().reuseFreeBuffer(data);
- data = null;
- }
- }
- }
-
- public static class TL_decryptedMessageService_old extends TL_decryptedMessageService {
- public static int constructor = 0xaa48327d;
-
-
- public void readParams(AbsSerializedData stream) {
- random_id = stream.readInt64();
- random_bytes = stream.readByteArray();
- action = (DecryptedMessageAction)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(random_id);
- stream.writeByteArray(random_bytes);
- action.serializeToStream(stream);
- }
- }
-
- public static class TL_decryptedMessage_old extends TL_decryptedMessage {
- public static int constructor = 0x1f814f1f;
-
-
- public void readParams(AbsSerializedData stream) {
- random_id = stream.readInt64();
- random_bytes = stream.readByteArray();
- message = stream.readString();
- media = (DecryptedMessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(random_id);
- stream.writeByteArray(random_bytes);
- stream.writeString(message);
- media.serializeToStream(stream);
- }
- }
-
- public static class TL_messages_sendEncryptedFile extends TLObject {
- public static int constructor = 0x9a901b66;
-
- public TL_inputEncryptedChat peer;
- public long random_id;
- public ByteBufferDesc data;
- public InputEncryptedFile file;
-
- public Class responseClass () {
- return messages_SentEncryptedMessage.class;
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- peer.serializeToStream(stream);
- stream.writeInt64(random_id);
- stream.writeByteBuffer(data);
- file.serializeToStream(stream);
- }
-
- @Override
- public void freeResources() {
- if (disableFree) {
- return;
- }
- if (data != null) {
- BuffersStorage.getInstance().reuseFreeBuffer(data);
- data = null;
- }
- }
- }
-
- public static class UserStatus extends TLObject {
- public int expires;
- }
-
- public static class TL_userStatusLastWeek extends UserStatus {
- public static int constructor = 0x7bf09fc;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_userStatusEmpty extends UserStatus {
- public static int constructor = 0x9d05049;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_userStatusLastMonth extends UserStatus {
- public static int constructor = 0x77ebc742;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_userStatusOnline extends UserStatus {
- public static int constructor = 0xedb93949;
-
-
- public void readParams(AbsSerializedData stream) {
- expires = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(expires);
- }
- }
-
- public static class TL_userStatusRecently extends UserStatus {
- public static int constructor = 0xe26f42f1;
-
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
- }
-
- public static class TL_userStatusOffline extends UserStatus {
- public static int constructor = 0x8c703f;
-
-
- public void readParams(AbsSerializedData stream) {
- expires = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(expires);
- }
- }
-
- public static class TL_upload_file extends TLObject {
- public static int constructor = 0x96a18d5;
-
- public storage_FileType type;
- public int mtime;
- public ByteBufferDesc bytes;
-
- public void readParams(AbsSerializedData stream) {
- type = (storage_FileType)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- mtime = stream.readInt32();
- bytes = stream.readByteBuffer();
- }
-
- @Override
- public void freeResources() {
- if (disableFree) {
- return;
- }
- if (bytes != null) {
- BuffersStorage.getInstance().reuseFreeBuffer(bytes);
- bytes = null;
- }
- }
- }
-
- public static class TL_messages_receivedQueue extends TLObject {
- public static int constructor = 0x55a5bb66;
-
- public int max_qts;
-
- public Class responseClass () {
- return Vector.class;
- }
-
- public void parseVector(Vector vector, AbsSerializedData data) {
- int size = data.readInt32();
- for (int a = 0; a < size; a++) {
- vector.objects.add(data.readInt64());
- }
- }
-
- public void readParams(AbsSerializedData stream) {
- max_qts = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(max_qts);
- }
- }
-
- public static class TL_account_getWallPapers extends TLObject {
- public static int constructor = 0xc04cfac2;
-
- public Class responseClass () {
- return Vector.class;
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- }
-
- public void parseVector(Vector vector, AbsSerializedData data) {
- int size = data.readInt32();
- for (int a = 0; a < size; a++) {
- vector.objects.add(TLClassStore.Instance().TLdeserialize(data, data.readInt32()));
- }
- }
- }
-
- public static class TL_get_future_salts extends TLObject {
- public static int constructor = 0xb921bd04;
-
- public int num;
-
- public int layer () {
- return 0;
- }
-
- public Class responseClass () {
- return TL_futuresalts.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- num = stream.readInt32();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(num);
- }
- }
-
- public static class TL_rpc_drop_answer extends TLObject {
- public static int constructor = 0x58e4a740;
-
- public long req_msg_id;
-
- public int layer () {
- return 0;
- }
-
- public Class responseClass() {
- return RpcDropAnswer.class;
- }
-
- public void readParams(AbsSerializedData stream) {
- req_msg_id = stream.readInt64();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(req_msg_id);
- }
- }
-
- public static class TL_msg_container extends TLObject {
- public ArrayList messages;
-
- public static int constructor = 0x73f1f8dc;
-
- public void readParams(AbsSerializedData stream) {
- messages = new ArrayList<>();
- int count = stream.readInt32();
- for (int a = 0; a < count; a++) {
- TL_protoMessage message = new TL_protoMessage();
- message.msg_id = stream.readInt64();
- message.seqno = stream.readInt32();
- message.bytes = stream.readInt32();
- int constructor = stream.readInt32();
- TLObject request = ConnectionsManager.getInstance().getRequestWithMessageId(message.msg_id);
- message.body = TLClassStore.Instance().TLdeserialize(stream, constructor, request);
- messages.add(message);
- }
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(messages.size());
- for (TLObject obj : messages) {
- TL_protoMessage proto = (TL_protoMessage)obj;
- stream.writeInt64(proto.msg_id);
- stream.writeInt32(proto.seqno);
- stream.writeInt32(proto.bytes);
- proto.body.serializeToStream(stream);
- }
- }
- }
-
- public static class TL_rpc_result extends TLObject {
- public static int constructor = 0xf35c6d01;
-
- public long req_msg_id;
- public TLObject result;
-
- public void readParams(AbsSerializedData stream) {
- req_msg_id = stream.readInt64();
- TLObject request = ConnectionsManager.getInstance().getRequestWithMessageId(req_msg_id);
- result = TLClassStore.Instance().TLdeserialize(stream, stream.readInt32(), request);
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt64(req_msg_id);
- result.serializeToStream(stream);
- }
-
- @Override
- public void freeResources() {
- if (disableFree) {
- return;
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in Photo", constructor));
}
if (result != null) {
- result.freeResources();
+ result.readParams(stream, exception);
}
+ return result;
}
}
- public static class TL_futuresalts extends TLObject {
- public static int constructor = 0xae500895;
+ public static class TL_photo_old extends TL_photo {
+ public static int constructor = 0x22b56751;
- public long req_msg_id;
- public int now;
- public ArrayList salts = new ArrayList<>();
- public void readParams(AbsSerializedData stream) {
- req_msg_id = stream.readInt64();
- now = stream.readInt32();
- int count = stream.readInt32();
+ public void readParams(AbsSerializedData 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);
+ geo = GeoPoint.TLdeserialize(stream, stream.readInt32(exception), exception);
+ stream.readInt32(exception);
+ int count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
- TL_futureSalt salt = new TL_futureSalt();
- salt.readParams(stream);
- salts.add(salt);
+ sizes.add(PhotoSize.TLdeserialize(stream, stream.readInt32(exception), exception));
}
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
- stream.writeInt64(req_msg_id);
- stream.writeInt32(now);
- int count = salts.size();
+ stream.writeInt64(id);
+ stream.writeInt64(access_hash);
+ stream.writeInt32(user_id);
+ stream.writeInt32(date);
+ stream.writeString(caption);
+ geo.serializeToStream(stream);
+ stream.writeInt32(0x1cb5c415);
+ int count = sizes.size();
stream.writeInt32(count);
- for (TL_futureSalt salt : salts) {
- salt.serializeToStream(stream);
+ for (int a = 0; a < count; a++) {
+ sizes.get(a).serializeToStream(stream);
}
}
}
+ //Photo end
- public static class TL_gzip_packed extends TLObject {
- public static int constructor = 0x3072cfa1;
+ //EncryptedChat start
+ public static class EncryptedChat extends TLObject {
+ public int id;
+ public long access_hash;
+ public int date;
+ public int admin_id;
+ public int participant_id;
+ public byte[] g_a_or_b;
+ public long key_fingerprint;
+ public byte[] g_a;
+ public byte[] a_or_b; //custom
+ public byte[] auth_key; //custom
+ public int user_id; //custom
+ public int ttl; //custom
+ public int layer; //custom
+ public int seq_in; //custom
+ public int seq_out; //custom
+ public byte[] key_hash; //custom
+ public short key_use_count_in; //custom
+ public short key_use_count_out; //custom
+ public long exchange_id; //custom
+ public int key_create_date; //custom
+ public long future_key_fingerprint; //custom
+ public byte[] future_auth_key; //custom
- public byte[] packed_data;
-
- public void readParams(AbsSerializedData stream) {
- packed_data = stream.readByteArray();
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeByteArray(packed_data);
+ public static EncryptedChat TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ EncryptedChat result = null;
+ switch(constructor) {
+ case 0x3bf703dc:
+ result = new TL_encryptedChatWaiting();
+ break;
+ case 0xab7ec0a0:
+ result = new TL_encryptedChatEmpty();
+ break;
+ case 0x13d6dd27:
+ result = new TL_encryptedChatDiscarded();
+ break;
+ case 0xfa56ce36:
+ result = new TL_encryptedChat();
+ break;
+ case 0xc878527e:
+ result = new TL_encryptedChatRequested();
+ break;
+ case 0x6601d14f:
+ result = new TL_encryptedChat_old(); //custom
+ break;
+ case 0xfda9a7b7:
+ result = new TL_encryptedChatRequested_old(); //custom
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in EncryptedChat", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
}
}
+ public static class TL_encryptedChat_old extends TL_encryptedChat {
+ public static int constructor = 0x6601d14f;
+
+
+ public void readParams(AbsSerializedData 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);
+ stream.readByteArray(exception);
+ key_fingerprint = stream.readInt64(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(TL_encryptedChat.constructor);
+ stream.writeInt32(id);
+ stream.writeInt64(access_hash);
+ stream.writeInt32(date);
+ stream.writeInt32(admin_id);
+ stream.writeInt32(participant_id);
+ stream.writeByteArray(g_a_or_b);
+ stream.writeInt64(key_fingerprint);
+ }
+ }
+
+ public static class TL_encryptedChatRequested_old extends EncryptedChat {
+ public static int constructor = 0xfda9a7b7;
+
+
+ public void readParams(AbsSerializedData 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);
+ stream.readByteArray(exception);
+ }
+
+ public void serializeToStream(AbsSerializedData stream) {
+ stream.writeInt32(TL_encryptedChatRequested.constructor);
+ stream.writeInt32(id);
+ stream.writeInt64(access_hash);
+ stream.writeInt32(date);
+ stream.writeInt32(admin_id);
+ stream.writeInt32(participant_id);
+ stream.writeByteArray(g_a);
+ }
+ }
+ //EncryptedChat end
+
+ //Message start
public static class Message extends TLObject {
- public int flags;
public int id;
- public int fwd_from_id;
- public int fwd_date;
public int from_id;
public Peer to_id;
public int date;
+ public MessageAction action;
+ public int fwd_from_id;
+ public int fwd_date;
+ public int reply_to_msg_id;
public String message;
public MessageMedia media;
- public int reply_to_msg_id;
- public MessageAction action;
- public int send_state = 0;
- public int fwd_msg_id = 0;
- public String attachPath = "";
- public long random_id;
- public int local_id = 0;
- public long dialog_id;
- public int ttl;
- public int destroyTime;
- public int layer;
- public int seq_in;
- public int seq_out;
- public TLRPC.Message replyMessage;
- public VideoEditedInfo videoEditedInfo = null;
+ public int flags;
+ public int send_state = 0; //custom
+ public int fwd_msg_id = 0; //custom
+ public String attachPath = ""; //custom
+ public long random_id; //custom
+ public int local_id = 0; //custom
+ public long dialog_id; //custom
+ public int ttl; //custom
+ public int destroyTime; //custom
+ public int layer; //custom
+ public int seq_in; //custom
+ public int seq_out; //custom
+ public TLRPC.Message replyMessage; //custom
+ public VideoEditedInfo videoEditedInfo = null; //custom
+
+ public static Message TLdeserialize(AbsSerializedData stream, int constructor, boolean exception) {
+ Message result = null;
+ switch(constructor) {
+ case 0x1d86f70e:
+ result = new TL_messageService();
+ break;
+ case 0xa7ab1991:
+ result = new TL_message();
+ break;
+ case 0x83e5de54:
+ result = new TL_messageEmpty();
+ break;
+ case 0xa367e716:
+ result = new TL_messageForwarded_old2(); //custom
+ break;
+ case 0x5f46804:
+ result = new TL_messageForwarded_old(); //custom
+ break;
+ case 0x567699b3:
+ result = new TL_message_old2(); //custom
+ break;
+ case 0x9f8d60bb:
+ result = new TL_messageService_old(); //custom
+ break;
+ case 0x22eb6aba:
+ result = new TL_message_old(); //custom
+ break;
+ case 0x555555F8:
+ result = new TL_message_secret(); //custom
+ break;
+ }
+ if (result == null && exception) {
+ throw new RuntimeException(String.format("can't parse magic %x in Message", constructor));
+ }
+ if (result != null) {
+ result.readParams(stream, exception);
+ }
+ return result;
+ }
}
public static class TL_messageForwarded_old2 extends Message {
public static int constructor = 0xa367e716;
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- id = stream.readInt32();
- fwd_from_id = stream.readInt32();
- fwd_date = stream.readInt32();
- from_id = stream.readInt32();
- to_id = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- date = stream.readInt32();
- message = stream.readString();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ flags = stream.readInt32(exception);
+ id = stream.readInt32(exception);
+ fwd_from_id = stream.readInt32(exception);
+ fwd_date = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ to_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ date = stream.readInt32(exception);
+ message = stream.readString(exception);
flags |= MESSAGE_FLAG_FWD;
- media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception);
if (id < 0) {
- fwd_msg_id = stream.readInt32();
+ fwd_msg_id = stream.readInt32(exception);
}
if (id < 0 || (media != null && !(media instanceof TL_messageMediaEmpty) && message != null && message.length() != 0 && message.startsWith("-1"))) {
- attachPath = stream.readString();
+ attachPath = stream.readString(exception);
}
if (id < 0 && message.length() > 6 && media instanceof TL_messageMediaVideo) {
videoEditedInfo = new VideoEditedInfo();
@@ -10432,31 +12681,32 @@ public class TLRPC {
public static class TL_message extends Message {
public static int constructor = 0xa7ab1991;
-
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- id = stream.readInt32();
- from_id = stream.readInt32();
- to_id = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- if ((flags & MESSAGE_FLAG_FWD) != 0) {
- fwd_from_id = stream.readInt32();
- fwd_date = stream.readInt32();
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ flags = stream.readInt32(exception);
+ id = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ to_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ if ((flags & 4) != 0) {
+ fwd_from_id = stream.readInt32(exception);
}
- if ((flags & MESSAGE_FLAG_REPLY) != 0) {
- reply_to_msg_id = stream.readInt32();
+ if ((flags & 4) != 0) {
+ fwd_date = stream.readInt32(exception);
}
- date = stream.readInt32();
- message = stream.readString();
- media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ if ((flags & 8) != 0) {
+ reply_to_msg_id = stream.readInt32(exception);
+ }
+ date = stream.readInt32(exception);
+ message = stream.readString(exception);
+ media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception);
if (id < 0 || (media != null && !(media instanceof TL_messageMediaEmpty) && message != null && message.length() != 0 && message.startsWith("-1"))) {
- attachPath = stream.readString();
+ attachPath = stream.readString(exception);
}
if (id < 0 && message.length() > 6 && media instanceof TL_messageMediaVideo) {
videoEditedInfo = new VideoEditedInfo();
videoEditedInfo.parseString(message);
}
if ((flags & MESSAGE_FLAG_FWD) != 0 && id < 0) {
- fwd_msg_id = stream.readInt32();
+ fwd_msg_id = stream.readInt32(exception);
}
}
@@ -10466,11 +12716,13 @@ public class TLRPC {
stream.writeInt32(id);
stream.writeInt32(from_id);
to_id.serializeToStream(stream);
- if ((flags & MESSAGE_FLAG_FWD) != 0) {
+ if ((flags & 4) != 0) {
stream.writeInt32(fwd_from_id);
+ }
+ if ((flags & 4) != 0) {
stream.writeInt32(fwd_date);
}
- if ((flags & MESSAGE_FLAG_REPLY) != 0) {
+ if ((flags & 8) != 0) {
stream.writeInt32(reply_to_msg_id);
}
stream.writeInt32(date);
@@ -10487,16 +12739,16 @@ public class TLRPC {
public static int constructor = 0x567699b3;
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- id = stream.readInt32();
- from_id = stream.readInt32();
- to_id = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- date = stream.readInt32();
- message = stream.readString();
- media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ flags = stream.readInt32(exception);
+ id = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ to_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 (id < 0 || (media != null && !(media instanceof TL_messageMediaEmpty) && message != null && message.length() != 0 && message.startsWith("-1"))) {
- attachPath = stream.readString();
+ attachPath = stream.readString(exception);
}
if (id < 0 && message.length() > 6 && media instanceof TL_messageMediaVideo) {
videoEditedInfo = new VideoEditedInfo();
@@ -10517,42 +12769,18 @@ public class TLRPC {
}
}
- public static class TL_messageService extends Message {
- public static int constructor = 0x1d86f70e;
-
-
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- id = stream.readInt32();
- from_id = stream.readInt32();
- to_id = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- date = stream.readInt32();
- action = (MessageAction)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- }
-
- public void serializeToStream(AbsSerializedData stream) {
- stream.writeInt32(constructor);
- stream.writeInt32(flags);
- stream.writeInt32(id);
- stream.writeInt32(from_id);
- to_id.serializeToStream(stream);
- stream.writeInt32(date);
- action.serializeToStream(stream);
- }
- }
-
public static class TL_messageService_old extends TL_messageService {
public static int constructor = 0x9f8d60bb;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- from_id = stream.readInt32();
- to_id = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- flags |= stream.readBool() ? MESSAGE_FLAG_OUT : 0;
- flags |= stream.readBool() ? MESSAGE_FLAG_UNREAD : 0;
- date = stream.readInt32();
- action = (MessageAction)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ to_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ flags |= stream.readBool(exception) ? MESSAGE_FLAG_OUT : 0;
+ flags |= stream.readBool(exception) ? MESSAGE_FLAG_UNREAD : 0;
+ date = stream.readInt32(exception);
+ action = MessageAction.TLdeserialize(stream, stream.readInt32(exception), exception);
}
public void serializeToStream(AbsSerializedData stream) {
@@ -10571,23 +12799,23 @@ public class TLRPC {
public static int constructor = 0x5f46804;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- fwd_from_id = stream.readInt32();
- fwd_date = stream.readInt32();
- from_id = stream.readInt32();
- to_id = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- flags |= stream.readBool() ? MESSAGE_FLAG_OUT : 0;
- flags |= stream.readBool() ? MESSAGE_FLAG_UNREAD : 0;
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ fwd_from_id = stream.readInt32(exception);
+ fwd_date = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ to_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ flags |= stream.readBool(exception) ? MESSAGE_FLAG_OUT : 0;
+ flags |= stream.readBool(exception) ? MESSAGE_FLAG_UNREAD : 0;
flags |= MESSAGE_FLAG_FWD;
- date = stream.readInt32();
- message = stream.readString();
- media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ date = stream.readInt32(exception);
+ message = stream.readString(exception);
+ media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception);
if (id < 0) {
- fwd_msg_id = stream.readInt32();
+ fwd_msg_id = stream.readInt32(exception);
}
if (id < 0 || (media != null && !(media instanceof TL_messageMediaEmpty) && message != null && message.length() != 0 && message.startsWith("-1"))) {
- attachPath = stream.readString();
+ attachPath = stream.readString(exception);
}
if (id < 0 && message.length() > 6 && media instanceof TL_messageMediaVideo) {
videoEditedInfo = new VideoEditedInfo();
@@ -10617,17 +12845,17 @@ public class TLRPC {
public static class TL_message_old extends TL_message {
public static int constructor = 0x22eb6aba;
- public void readParams(AbsSerializedData stream) {
- id = stream.readInt32();
- from_id = stream.readInt32();
- to_id = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- flags |= stream.readBool() ? MESSAGE_FLAG_OUT : 0;
- flags |= stream.readBool() ? MESSAGE_FLAG_UNREAD : 0;
- date = stream.readInt32();
- message = stream.readString();
- media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ id = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ to_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
+ flags |= stream.readBool(exception) ? MESSAGE_FLAG_OUT : 0;
+ flags |= stream.readBool(exception) ? MESSAGE_FLAG_UNREAD : 0;
+ date = stream.readInt32(exception);
+ message = stream.readString(exception);
+ media = MessageMedia.TLdeserialize(stream, stream.readInt32(exception), exception);
if (id < 0 || (media != null && !(media instanceof TL_messageMediaEmpty) && message != null && message.length() != 0 && message.startsWith("-1"))) {
- attachPath = stream.readString();
+ attachPath = stream.readString(exception);
}
if (id < 0 && message.length() > 6 && media instanceof TL_messageMediaVideo) {
videoEditedInfo = new VideoEditedInfo();
@@ -10652,17 +12880,17 @@ public class TLRPC {
public static class TL_message_secret extends TL_message {
public static int constructor = 0x555555F8;
- public void readParams(AbsSerializedData stream) {
- flags = stream.readInt32();
- id = stream.readInt32();
- ttl = stream.readInt32();
- from_id = stream.readInt32();
- to_id = (Peer)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
- date = stream.readInt32();
- message = stream.readString();
- media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
+ public void readParams(AbsSerializedData stream, boolean exception) {
+ flags = stream.readInt32(exception);
+ id = stream.readInt32(exception);
+ ttl = stream.readInt32(exception);
+ from_id = stream.readInt32(exception);
+ to_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 (id < 0 || (media != null && !(media instanceof TL_messageMediaEmpty) && message != null && message.length() != 0 && message.startsWith("-1"))) {
- attachPath = stream.readString();
+ attachPath = stream.readString(exception);
}
if (id < 0 && message.length() > 6 && media instanceof TL_messageMediaVideo) {
videoEditedInfo = new VideoEditedInfo();
@@ -10683,12 +12911,294 @@ public class TLRPC {
stream.writeString(attachPath);
}
}
+ //Message end
- public static class Vector extends TLObject {
- public static int constructor = 0x1cb5c415;
- public ArrayList