Update layer 135

This commit is contained in:
xaxtix 2021-11-23 16:06:43 +03:00
parent e8242b5054
commit 350fbf1ede
2 changed files with 16776 additions and 16468 deletions

View file

@ -3445,7 +3445,11 @@ public class MessagesController extends BaseController implements NotificationCe
}
int reqId = getConnectionsManager().sendRequest(req, (response, error) -> {
if (error == null) {
TLRPC.UserFull userFull = (TLRPC.UserFull) response;
TLRPC.TL_users_userFull res = (TLRPC.TL_users_userFull) response;
TLRPC.UserFull userFull = res.full_user;
putUsers(res.users, false);
putChats(res.chats, false);
res.full_user.user = getUser(res.full_user.id);
getMessagesStorage().updateUserInfo(userFull, false);
AndroidUtilities.runOnUIThread(() -> {
@ -3736,7 +3740,12 @@ public class MessagesController extends BaseController implements NotificationCe
getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
loadingPeerSettings.remove(dialogId);
if (response != null) {
savePeerSettings(dialogId, (TLRPC.TL_peerSettings) response, false);
TLRPC.TL_messages_peerSettings res = (TLRPC.TL_messages_peerSettings) response;
TLRPC.TL_peerSettings settings = res.settings;
putUsers(res.users, false);
putChats(res.chats, false);
savePeerSettings(dialogId, settings, false);
}
}));
}
@ -4688,9 +4697,9 @@ public class MessagesController extends BaseController implements NotificationCe
if (offset == 0) {
getMessagesStorage().deleteUserChatHistory(-chat.id, user.id);
}
TLRPC.TL_channels_deleteUserHistory req = new TLRPC.TL_channels_deleteUserHistory();
TLRPC.TL_channels_deleteParticipantHistory req = new TLRPC.TL_channels_deleteParticipantHistory();
req.channel = getInputChannel(chat);
req.user_id = getInputUser(user);
req.participant = getInputPeer(user);
getConnectionsManager().sendRequest(req, (response, error) -> {
if (error == null) {
TLRPC.TL_messages_affectedHistory res = (TLRPC.TL_messages_affectedHistory) response;

View file

@ -4397,6 +4397,7 @@ public class TLRPC {
public boolean current;
public boolean official_app;
public boolean password_pending;
public boolean encrypted_requests_disabled;
public long hash;
public String device_model;
public String platform;
@ -4428,6 +4429,7 @@ public class TLRPC {
current = (flags & 1) != 0;
official_app = (flags & 2) != 0;
password_pending = (flags & 4) != 0;
encrypted_requests_disabled = (flags & 8) != 0;
hash = stream.readInt64(exception);
device_model = stream.readString(exception);
platform = stream.readString(exception);
@ -4447,6 +4449,7 @@ public class TLRPC {
flags = current ? (flags | 1) : (flags &~ 1);
flags = official_app ? (flags | 2) : (flags &~ 2);
flags = password_pending ? (flags | 4) : (flags &~ 4);
flags = encrypted_requests_disabled ? (flags | 8) : (flags &~ 8);
stream.writeInt32(flags);
stream.writeInt64(hash);
stream.writeString(device_model);
@ -6237,7 +6240,7 @@ public class TLRPC {
}
public static class TL_peerSettings extends TLObject {
public static int constructor = 0x733f2961;
public static int constructor = 0xa8228d2e;
public int flags;
public boolean report_spam;
@ -6249,6 +6252,8 @@ public class TLRPC {
public boolean autoarchived;
public boolean invite_members;
public int geo_distance;
public Peer request_chat;
public int request_chat_date;
public static TL_peerSettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
if (TL_peerSettings.constructor != constructor) {
@ -6276,6 +6281,12 @@ public class TLRPC {
if ((flags & 64) != 0) {
geo_distance = stream.readInt32(exception);
}
if ((flags & 512) != 0) {
request_chat = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
}
if ((flags & 512) != 0) {
request_chat_date = stream.readInt32(exception);
}
}
public void serializeToStream(AbstractSerializedData stream) {
@ -6292,6 +6303,12 @@ public class TLRPC {
if ((flags & 64) != 0) {
stream.writeInt32(geo_distance);
}
if ((flags & 512) != 0) {
request_chat.serializeToStream(stream);
}
if ((flags & 512) != 0) {
stream.writeInt32(request_chat_date);
}
}
}
@ -8567,25 +8584,34 @@ public class TLRPC {
}
}
public static class TL_messages_stickerSet extends TLObject {
public static int constructor = 0xb60a24a6;
public static abstract class messages_StickerSet extends TLObject {
public StickerSet set;
public ArrayList<TL_stickerPack> packs = new ArrayList<>();
public ArrayList<Document> documents = new ArrayList<>();
public static TL_messages_stickerSet TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
if (TL_messages_stickerSet.constructor != constructor) {
if (exception) {
throw new RuntimeException(String.format("can't parse magic %x in TL_messages_stickerSet", constructor));
} else {
return null;
TL_messages_stickerSet result = null;
switch (constructor) {
case 0xb60a24a6:
result = new TL_messages_stickerSet();
break;
case 0xd3f924eb:
result = new TL_messages_stickerSetNotModified();
break;
}
if (result == null && exception) {
throw new RuntimeException(String.format("can't parse magic %x in messages_StickerSet", constructor));
}
TL_messages_stickerSet result = new TL_messages_stickerSet();
if (result != null) {
result.readParams(stream, exception);
}
return result;
}
}
public static class TL_messages_stickerSet extends messages_StickerSet {
public static int constructor = 0xb60a24a6;
public void readParams(AbstractSerializedData stream, boolean exception) {
set = StickerSet.TLdeserialize(stream, stream.readInt32(exception), exception);
@ -8639,6 +8665,14 @@ public class TLRPC {
}
}
public static class TL_messages_stickerSetNotModified extends TL_messages_stickerSet {
public static int constructor = 0xd3f924eb;
public void serializeToStream(AbstractSerializedData stream) {
stream.writeInt32(constructor);
}
}
public static abstract class InputGeoPoint extends TLObject {
public int flags;
@ -22979,6 +23013,78 @@ public class TLRPC {
}
}
public static class TL_users_userFull extends TLObject {
public static int constructor = 0x3b6d152e;
public UserFull full_user;
public ArrayList<Chat> chats = new ArrayList<>();
public ArrayList<User> users = new ArrayList<>();
public static TL_users_userFull TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
if (TL_users_userFull.constructor != constructor) {
if (exception) {
throw new RuntimeException(String.format("can't parse magic %x in TL_users_userFull", constructor));
} else {
return null;
}
}
TL_users_userFull result = new TL_users_userFull();
result.readParams(stream, exception);
return result;
}
public void readParams(AbstractSerializedData stream, boolean exception) {
full_user = UserFull.TLdeserialize(stream, stream.readInt32(exception), exception);
int magic = stream.readInt32(exception);
if (magic != 0x1cb5c415) {
if (exception) {
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
}
return;
}
int count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception);
if (object == null) {
return;
}
chats.add(object);
}
magic = stream.readInt32(exception);
if (magic != 0x1cb5c415) {
if (exception) {
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
}
return;
}
count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
User object = User.TLdeserialize(stream, stream.readInt32(exception), exception);
if (object == null) {
return;
}
users.add(object);
}
}
public void serializeToStream(AbstractSerializedData stream) {
stream.writeInt32(constructor);
full_user.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_shippingOption extends TLObject {
public static int constructor = 0xb6213cdf;
@ -26200,6 +26306,78 @@ public class TLRPC {
}
}
public static class TL_messages_peerSettings extends TLObject {
public static int constructor = 0x6880b94d;
public TL_peerSettings settings;
public ArrayList<Chat> chats = new ArrayList<>();
public ArrayList<User> users = new ArrayList<>();
public static TL_messages_peerSettings TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
if (TL_messages_peerSettings.constructor != constructor) {
if (exception) {
throw new RuntimeException(String.format("can't parse magic %x in TL_messages_peerSettings", constructor));
} else {
return null;
}
}
TL_messages_peerSettings result = new TL_messages_peerSettings();
result.readParams(stream, exception);
return result;
}
public void readParams(AbstractSerializedData stream, boolean exception) {
settings = TL_peerSettings.TLdeserialize(stream, stream.readInt32(exception), exception);
int magic = stream.readInt32(exception);
if (magic != 0x1cb5c415) {
if (exception) {
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
}
return;
}
int count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
Chat object = Chat.TLdeserialize(stream, stream.readInt32(exception), exception);
if (object == null) {
return;
}
chats.add(object);
}
magic = stream.readInt32(exception);
if (magic != 0x1cb5c415) {
if (exception) {
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
}
return;
}
count = stream.readInt32(exception);
for (int a = 0; a < count; a++) {
User object = User.TLdeserialize(stream, stream.readInt32(exception), exception);
if (object == null) {
return;
}
users.add(object);
}
}
public void serializeToStream(AbstractSerializedData stream) {
stream.writeInt32(constructor);
settings.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_messages_checkedHistoryImportPeer extends TLObject {
public static int constructor = 0xa24de717;
@ -28573,7 +28751,7 @@ public class TLRPC {
public TL_messages_stickerSet stickerset;
public void readParams(AbstractSerializedData stream, boolean exception) {
stickerset = TL_messages_stickerSet.TLdeserialize(stream, stream.readInt32(exception), exception);
stickerset = messages_StickerSet.TLdeserialize(stream, stream.readInt32(exception), exception);
}
public void serializeToStream(AbstractSerializedData stream) {
@ -40763,13 +40941,18 @@ public class TLRPC {
public int ttl_period;
public TL_peerSettings settings;
public String theme_emoticon;
public long id;
public String private_forward_name;
public static UserFull TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
UserFull result = null;
switch (constructor) {
case 0xd697ff05:
case 0xcf366521:
result = new TL_userFull();
break;
case 0xd697ff05:
result = new TL_userFull_layer134();
break;
case 0x139a9a77:
result = new TL_userFull_layer131();
break;
@ -40794,6 +40977,87 @@ public class TLRPC {
}
public static class TL_userFull extends UserFull {
public static int constructor = 0xcf366521;
public void readParams(AbstractSerializedData stream, boolean exception) {
flags = stream.readInt32(exception);
blocked = (flags & 1) != 0;
phone_calls_available = (flags & 16) != 0;
phone_calls_private = (flags & 32) != 0;
can_pin_message = (flags & 128) != 0;
has_scheduled = (flags & 4096) != 0;
video_calls_available = (flags & 8192) != 0;
id = stream.readInt64(exception);
if ((flags & 2) != 0) {
about = stream.readString(exception);
}
settings = TL_peerSettings.TLdeserialize(stream, stream.readInt32(exception), exception);
if ((flags & 4) != 0) {
profile_photo = Photo.TLdeserialize(stream, stream.readInt32(exception), exception);
}
notify_settings = PeerNotifySettings.TLdeserialize(stream, stream.readInt32(exception), exception);
if ((flags & 8) != 0) {
bot_info = BotInfo.TLdeserialize(stream, stream.readInt32(exception), exception);
}
if ((flags & 64) != 0) {
pinned_msg_id = stream.readInt32(exception);
}
common_chats_count = stream.readInt32(exception);
if ((flags & 2048) != 0) {
folder_id = stream.readInt32(exception);
}
if ((flags & 16384) != 0) {
ttl_period = stream.readInt32(exception);
}
if ((flags & 32768) != 0) {
theme_emoticon = stream.readString(exception);
}
if ((flags & 65536) != 0) {
private_forward_name = stream.readString(exception);
}
}
public void serializeToStream(AbstractSerializedData stream) {
stream.writeInt32(constructor);
flags = blocked ? (flags | 1) : (flags &~ 1);
flags = phone_calls_available ? (flags | 16) : (flags &~ 16);
flags = phone_calls_private ? (flags | 32) : (flags &~ 32);
flags = can_pin_message ? (flags | 128) : (flags &~ 128);
flags = has_scheduled ? (flags | 4096) : (flags &~ 4096);
flags = video_calls_available ? (flags | 8192) : (flags &~ 8192);
stream.writeInt32(flags);
stream.writeInt64(id);
if ((flags & 2) != 0) {
stream.writeString(about);
}
settings.serializeToStream(stream);
if ((flags & 4) != 0) {
profile_photo.serializeToStream(stream);
}
notify_settings.serializeToStream(stream);
if ((flags & 8) != 0) {
bot_info.serializeToStream(stream);
}
if ((flags & 64) != 0) {
stream.writeInt32(pinned_msg_id);
}
stream.writeInt32(common_chats_count);
if ((flags & 2048) != 0) {
stream.writeInt32(folder_id);
}
if ((flags & 16384) != 0) {
stream.writeInt32(ttl_period);
}
if ((flags & 32768) != 0) {
stream.writeString(theme_emoticon);
}
if ((flags & 65536) != 0) {
stream.writeString(private_forward_name);
}
}
}
public static class TL_userFull_layer134 extends TL_userFull {
public static int constructor = 0xd697ff05;
@ -43468,8 +43732,9 @@ public class TLRPC {
}
public static class TL_account_authorizations extends TLObject {
public static int constructor = 0x1250abde;
public static int constructor = 0x4bff8ea0;
public int authorization_ttl_days;
public ArrayList<TL_authorization> authorizations = new ArrayList<>();
public static TL_account_authorizations TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
@ -43486,6 +43751,7 @@ public class TLRPC {
}
public void readParams(AbstractSerializedData stream, boolean exception) {
authorization_ttl_days = stream.readInt32(exception);
int magic = stream.readInt32(exception);
if (magic != 0x1cb5c415) {
if (exception) {
@ -43505,6 +43771,7 @@ public class TLRPC {
public void serializeToStream(AbstractSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(authorization_ttl_days);
stream.writeInt32(0x1cb5c415);
int count = authorizations.size();
stream.writeInt32(count);
@ -44005,13 +44272,45 @@ public class TLRPC {
}
}
public static class TL_account_setAuthorizationTTL extends TLObject {
public static int constructor = 0xbf899aa0;
public int authorization_ttl_days;
public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) {
return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbstractSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(authorization_ttl_days);
}
}
public static class TL_account_changeAuthorizationSettings extends TLObject {
public static int constructor = 0x432910d5;
public long hash;
public boolean encrypted_requests_disabled;
public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) {
return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbstractSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(hash);
stream.writeBool(encrypted_requests_disabled);
}
}
public static class TL_users_getFullUser extends TLObject {
public static int constructor = 0xca30a5b1;
public static int constructor = 0xb60f5918;
public InputUser id;
public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) {
return UserFull.TLdeserialize(stream, constructor, exception);
return TL_users_userFull.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbstractSerializedData stream) {
@ -45077,12 +45376,12 @@ public class TLRPC {
}
public static class TL_messages_getPeerSettings extends TLObject {
public static int constructor = 0x3672e09c;
public static int constructor = 0xefd9a6a2;
public InputPeer peer;
public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) {
return TL_peerSettings.TLdeserialize(stream, constructor, exception);
return TL_messages_peerSettings.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbstractSerializedData stream) {
@ -49418,11 +49717,11 @@ public class TLRPC {
}
}
public static class TL_channels_deleteUserHistory extends TLObject {
public static int constructor = 0xd10dd71b;
public static class TL_channels_deleteParticipantHistory extends TLObject {
public static int constructor = 0x367544db;
public InputChannel channel;
public InputUser user_id;
public InputPeer participant;
public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) {
return TL_messages_affectedHistory.TLdeserialize(stream, constructor, exception);
@ -49431,7 +49730,7 @@ public class TLRPC {
public void serializeToStream(AbstractSerializedData stream) {
stream.writeInt32(constructor);
channel.serializeToStream(stream);
user_id.serializeToStream(stream);
participant.serializeToStream(stream);
}
}