Skip to content

Commit 95aa95f

Browse files
committed
Fix bug
1 parent 8b99644 commit 95aa95f

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/main/java/org/telegram/api/chat/TLChat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ public void deserializeBody(InputStream stream, TLContext context)
192192
this.flags = StreamingUtils.readInt(stream);
193193
this.id = StreamingUtils.readInt(stream);
194194
this.title = StreamingUtils.readTLString(stream);
195-
this.photo = ((TLAbsChatPhoto) StreamingUtils.readTLObject(stream, context));
195+
this.photo = StreamingUtils.readTLObject(stream, context, TLAbsChatPhoto.class);
196196
this.participantsCount = StreamingUtils.readInt(stream);
197197
this.date = StreamingUtils.readInt(stream);
198198
this.version = StreamingUtils.readInt(stream);
199199
if ((this.flags & FLAG_MIGRATED_TO) != 0) {
200-
this.migratedTo = (TLAbsInputChannel) StreamingUtils.readTLObject(stream, context);
200+
this.migratedTo = StreamingUtils.readTLObject(stream, context, TLAbsInputChannel.class);
201201
}
202202
}
203203

src/main/java/org/telegram/api/updates/TLUpdates.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ public void serializeBody(OutputStream stream)
138138

139139
public void deserializeBody(InputStream stream, TLContext context)
140140
throws IOException {
141-
this.updates = StreamingUtils.readTLVector(stream, context);
142-
this.users = StreamingUtils.readTLVector(stream, context);
143-
this.chats = StreamingUtils.readTLVector(stream, context);
141+
this.updates = StreamingUtils.readTLVector(stream, context, TLAbsUpdate.class);
142+
this.users = StreamingUtils.readTLVector(stream, context, TLAbsUser.class);
143+
this.chats = StreamingUtils.readTLVector(stream, context, TLAbsChat.class);
144144
this.date = StreamingUtils.readInt(stream);
145145
this.seq = StreamingUtils.readInt(stream);
146146
}

src/main/java/org/telegram/api/user/TLUser.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class TLUser extends TLAbsUser {
3939
private static final int FLAG_INLINE_PLACEHOLDER = 0x00080000; // 19
4040
private static final int FLAG_MIN = 0x00100000; // 20
4141
private static final int FLAG_BOT_INLINE_GEO = 0x00200000; // 21
42-
private static final int FLAG_LANG_CODE = 0x00200000; // 22
42+
private static final int FLAG_LANG_CODE = 0x00400000; // 22
4343

4444
private int flags;
4545
private long accessHash;
@@ -58,7 +58,6 @@ public TLUser() {
5858
super();
5959
}
6060

61-
6261
@Override
6362
public int getClassId() {
6463
return CLASS_ID;
@@ -236,10 +235,10 @@ public void deserializeBody(InputStream stream, TLContext context) throws IOExce
236235
this.phone = StreamingUtils.readTLString(stream);
237236
}
238237
if ((this.flags & FLAG_PHOTO) != 0) {
239-
this.photo = (TLAbsUserProfilePhoto) StreamingUtils.readTLObject(stream, context);
238+
this.photo = StreamingUtils.readTLObject(stream, context, TLAbsUserProfilePhoto.class);
240239
}
241240
if ((this.flags & FLAG_STATUS) != 0) {
242-
this.status = (TLAbsUserStatus) StreamingUtils.readTLObject(stream, context);
241+
this.status = StreamingUtils.readTLObject(stream, context, TLAbsUserStatus.class);
243242
}
244243
if ((this.flags & FLAG_BOT) != 0) {
245244
this.botInfoVersion = StreamingUtils.readInt(stream);

0 commit comments

Comments
 (0)