Skip to content

Commit eee720e

Browse files
committed
update to 11.7.0 (5663)
1 parent 9dcd88b commit eee720e

File tree

432 files changed

+48731
-42558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

432 files changed

+48731
-42558
lines changed

TMessagesProj/jni/tgnet/ApiScheme.cpp

Lines changed: 149 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,17 @@ TL_username *TL_username::TLdeserialize(NativeByteBuffer *stream, uint32_t const
377377
return result;
378378
}
379379

380+
TL_peerColor *TL_peerColor::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
381+
if (TL_peerColor::constructor != constructor) {
382+
error = true;
383+
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in TL_peerColor", constructor);
384+
return nullptr;
385+
}
386+
TL_peerColor *result = new TL_peerColor();
387+
result->readParams(stream, instanceNum, error);
388+
return result;
389+
}
390+
380391
void TL_restrictionReason::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
381392
platform = stream->readString(&error);
382393
reason = stream->readString(&error);
@@ -405,6 +416,132 @@ void TL_username::serializeToStream(NativeByteBuffer *stream) {
405416
stream->writeString(username);
406417
}
407418

419+
void TL_peerColor::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
420+
flags = stream->readInt32(&error);
421+
if ((flags & 1) != 0) {
422+
color = stream->readInt32(&error);
423+
}
424+
if ((flags & 2) != 0) {
425+
background_emoji_id = stream->readInt64(&error);
426+
}
427+
}
428+
429+
void TL_peerColor::serializeToStream(NativeByteBuffer *stream) {
430+
stream->writeInt32(constructor);
431+
stream->writeInt32(flags);
432+
if ((flags & 1) != 0) {
433+
stream->writeInt32(color);
434+
}
435+
if ((flags & 2) != 0) {
436+
stream->writeInt64(background_emoji_id);
437+
}
438+
}
439+
440+
EmojiStatus *EmojiStatus::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
441+
EmojiStatus *result = nullptr;
442+
switch (constructor) {
443+
case TL_emojiStatusEmpty::constructor:
444+
result = new TL_emojiStatusEmpty();
445+
break;
446+
case TL_emojiStatus::constructor:
447+
result = new TL_emojiStatus();
448+
break;
449+
case TL_emojiStatusCollectible::constructor:
450+
result = new TL_emojiStatusCollectible();
451+
break;
452+
case TL_emojiStatus_layer197::constructor:
453+
result = new TL_emojiStatus_layer197();
454+
break;
455+
case TL_emojiStatusUntil_layer197::constructor:
456+
result = new TL_emojiStatusUntil_layer197();
457+
break;
458+
default:
459+
error = true;
460+
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in User", constructor);
461+
return nullptr;
462+
}
463+
result->readParams(stream, instanceNum, error);
464+
return result;
465+
}
466+
467+
void TL_emojiStatusEmpty::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
468+
469+
}
470+
471+
void TL_emojiStatusEmpty::serializeToStream(NativeByteBuffer *stream) {
472+
stream->writeInt32(constructor);
473+
}
474+
475+
void TL_emojiStatus::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
476+
flags = stream->readInt32(&error);
477+
document_id = stream->readInt64(&error);
478+
if ((flags & 1) != 0) {
479+
until = stream->readInt64(&error);
480+
}
481+
}
482+
483+
void TL_emojiStatus::serializeToStream(NativeByteBuffer *stream) {
484+
stream->writeInt32(constructor);
485+
stream->writeInt32(flags);
486+
stream->writeInt64(document_id);
487+
if ((flags & 1) != 0) {
488+
stream->writeInt32(until);
489+
}
490+
}
491+
492+
void TL_emojiStatus_layer197::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
493+
document_id = stream->readInt64(&error);
494+
}
495+
496+
void TL_emojiStatus_layer197::serializeToStream(NativeByteBuffer *stream) {
497+
stream->writeInt32(constructor);
498+
stream->writeInt64(document_id);
499+
}
500+
501+
void TL_emojiStatusUntil_layer197::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
502+
document_id = stream->readInt64(&error);
503+
until = stream->readInt32(&error);
504+
}
505+
506+
void TL_emojiStatusUntil_layer197::serializeToStream(NativeByteBuffer *stream) {
507+
stream->writeInt32(constructor);
508+
stream->writeInt64(document_id);
509+
stream->writeInt32(until);
510+
}
511+
512+
void TL_emojiStatusCollectible::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
513+
flags = stream->readInt32(&error);
514+
collectible_id = stream->readInt64(&error);
515+
document_id = stream->readInt64(&error);
516+
title = stream->readString(&error);
517+
slug = stream->readString(&error);
518+
pattern_document_id = stream->readInt64(&error);
519+
center_color = stream->readInt32(&error);
520+
edge_color = stream->readInt32(&error);
521+
pattern_color = stream->readInt32(&error);
522+
text_color = stream->readInt32(&error);
523+
if ((flags & 1) != 0) {
524+
until = stream->readInt64(&error);
525+
}
526+
}
527+
528+
void TL_emojiStatusCollectible::serializeToStream(NativeByteBuffer *stream) {
529+
stream->writeInt32(constructor);
530+
stream->writeInt32(flags);
531+
stream->writeInt64(collectible_id);
532+
stream->writeInt64(document_id);
533+
stream->writeString(title);
534+
stream->writeString(slug);
535+
stream->writeInt64(pattern_document_id);
536+
stream->writeInt32(center_color);
537+
stream->writeInt32(edge_color);
538+
stream->writeInt32(pattern_color);
539+
stream->writeInt32(text_color);
540+
if ((flags & 1) != 0) {
541+
stream->writeInt32(until);
542+
}
543+
}
544+
408545
User *User::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
409546
User *result = nullptr;
410547
switch (constructor) {
@@ -483,21 +620,7 @@ void TL_user::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &er
483620
lang_code = stream->readString(&error);
484621
}
485622
if ((flags & 1073741824) != 0) {
486-
emojiStatusMagic = stream->readUint32(&error);
487-
if (emojiStatusMagic == 0x2de11aae) {
488-
// emojiStatusEmpty
489-
} else if (emojiStatusMagic == 0x929b619d) {
490-
// emojiStatus
491-
emojiStatusDocumentId = stream->readInt64(&error);
492-
} else if (emojiStatusMagic == 0xfa30a8c7) {
493-
// emojiStatusUntil
494-
emojiStatusDocumentId = stream->readInt64(&error);
495-
emojiStatusUntil = stream->readInt32(&error);
496-
} else {
497-
error = true;
498-
if (LOGS_ENABLED) DEBUG_FATAL("wrong EmojiStatus magic, got %x", emojiStatusMagic);
499-
return;
500-
}
623+
emoji_status = std::unique_ptr<EmojiStatus>(EmojiStatus::TLdeserialize(stream, stream->readInt32(&error), instanceNum, error));
501624
}
502625
if ((flags2 & 1) != 0) {
503626
uint32_t magic = stream->readUint32(&error);
@@ -519,18 +642,17 @@ void TL_user::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &er
519642
stories_max_id = stream->readInt32(&error);
520643
}
521644
if ((flags2 & 256) != 0) {
522-
int magic = stream->readInt32(&error);
523-
color_color = stream->readInt32(&error);
524-
color_background_emoji_id = stream->readInt64(&error);
645+
color = std::unique_ptr<TL_peerColor>(TL_peerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
525646
}
526647
if ((flags2 & 512) != 0) {
527-
int magic = stream->readInt32(&error);
528-
profile_color_color = stream->readInt32(&error);
529-
profile_color_background_emoji_id = stream->readInt64(&error);
648+
profile_color = std::unique_ptr<TL_peerColor>(TL_peerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
530649
}
531650
if ((flags2 & 4096) != 0) {
532651
bot_active_users = stream->readInt32(&error);
533652
}
653+
if ((flags2 & 16384) != 0) {
654+
bot_verification_icon = stream->readInt64(&error);
655+
}
534656
}
535657

536658
void TL_user::serializeToStream(NativeByteBuffer *stream) {
@@ -577,15 +699,7 @@ void TL_user::serializeToStream(NativeByteBuffer *stream) {
577699
stream->writeString(lang_code);
578700
}
579701
if ((flags & 1073741824) != 0) {
580-
stream->writeInt32(emojiStatusMagic);
581-
if (emojiStatusMagic == 0x929b619d) {
582-
// emojiStatus
583-
stream->writeInt64(emojiStatusDocumentId);
584-
} else if (emojiStatusMagic == 0xfa30a8c7) {
585-
// emojiStatusUntil
586-
stream->writeInt64(emojiStatusDocumentId);
587-
stream->writeInt32(emojiStatusUntil);
588-
}
702+
emoji_status->serializeToStream(stream);
589703
}
590704
if ((flags2 & 1) != 0) {
591705
stream->writeInt32(0x1cb5c415);
@@ -599,18 +713,17 @@ void TL_user::serializeToStream(NativeByteBuffer *stream) {
599713
stream->writeInt32(stories_max_id);
600714
}
601715
if ((flags2 & 256) != 0) {
602-
stream->writeInt32(0xba278146);
603-
stream->writeInt32(color_color);
604-
stream->writeInt32(color_background_emoji_id);
716+
color->serializeToStream(stream);
605717
}
606718
if ((flags2 & 512) != 0) {
607-
stream->writeInt32(0xba278146);
608-
stream->writeInt32(profile_color_color);
609-
stream->writeInt32(profile_color_background_emoji_id);
719+
profile_color->serializeToStream(stream);
610720
}
611721
if ((flags2 & 4096) != 0) {
612722
stream->writeInt32(bot_active_users);
613723
}
724+
if ((flags2 & 16384) != 0) {
725+
stream->writeInt64(bot_verification_icon);
726+
}
614727
}
615728

616729
InputPeer *InputPeer::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {

TMessagesProj/jni/tgnet/ApiScheme.h

Lines changed: 84 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,85 @@ class TL_username : public TLObject {
362362
void serializeToStream(NativeByteBuffer *stream);
363363
};
364364

365+
class TL_peerColor : public TLObject {
366+
public:
367+
static const uint32_t constructor = 0xb54b5acf;
368+
369+
int32_t flags;
370+
int32_t color;
371+
int64_t background_emoji_id;
372+
373+
static TL_peerColor *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error);
374+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
375+
void serializeToStream(NativeByteBuffer *stream);
376+
};
377+
378+
class EmojiStatus : public TLObject {
379+
public:
380+
static EmojiStatus *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error);
381+
};
382+
383+
class TL_emojiStatusEmpty : public EmojiStatus {
384+
public:
385+
static const uint32_t constructor = 0xb54b5acf;
386+
387+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
388+
void serializeToStream(NativeByteBuffer *stream);
389+
};
390+
391+
class TL_emojiStatus : public EmojiStatus {
392+
public:
393+
static const uint32_t constructor = 0xe7ff068a;
394+
395+
int32_t flags;
396+
int64_t document_id;
397+
int32_t until;
398+
399+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
400+
void serializeToStream(NativeByteBuffer *stream);
401+
};
402+
403+
class TL_emojiStatus_layer197 : public EmojiStatus {
404+
public:
405+
static const uint32_t constructor = 0x929b619d;
406+
407+
int64_t document_id;
408+
409+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
410+
void serializeToStream(NativeByteBuffer *stream);
411+
};
412+
413+
class TL_emojiStatusUntil_layer197 : public EmojiStatus {
414+
public:
415+
static const uint32_t constructor = 0xfa30a8c7;
416+
417+
int64_t document_id;
418+
int32_t until;
419+
420+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
421+
void serializeToStream(NativeByteBuffer *stream);
422+
};
423+
424+
class TL_emojiStatusCollectible : public EmojiStatus {
425+
public:
426+
static const uint32_t constructor = 0x7141dbf;
427+
428+
int32_t flags;
429+
int64_t collectible_id;
430+
int64_t document_id;
431+
std::string title;
432+
std::string slug;
433+
int64_t pattern_document_id;
434+
int32_t center_color;
435+
int32_t edge_color;
436+
int32_t pattern_color;
437+
int32_t text_color;
438+
int32_t until;
439+
440+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
441+
void serializeToStream(NativeByteBuffer *stream);
442+
};
443+
365444
class User : public TLObject {
366445

367446
public:
@@ -381,14 +460,11 @@ class User : public TLObject {
381460
std::string lang_code;
382461
std::vector<std::unique_ptr<TL_username>> usernames;
383462
int32_t stories_max_id;
384-
int32_t emojiStatusMagic;
385-
int64_t emojiStatusDocumentId;
386-
int32_t emojiStatusUntil;
387-
int32_t color_color;
388-
int64_t color_background_emoji_id;
389-
int32_t profile_color_color;
390-
int64_t profile_color_background_emoji_id;
463+
std::unique_ptr<EmojiStatus> emoji_status;
464+
std::unique_ptr<TL_peerColor> color;
465+
std::unique_ptr<TL_peerColor> profile_color;
391466
int32_t bot_active_users;
467+
int64_t bot_verification_icon;
392468

393469
static User *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error);
394470
};
@@ -405,7 +481,7 @@ class TL_userEmpty : public User {
405481
class TL_user : public User {
406482

407483
public:
408-
static const uint32_t constructor = 0x83314fca;
484+
static const uint32_t constructor = 0x4b46c37e;
409485

410486
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
411487
void serializeToStream(NativeByteBuffer *stream);

TMessagesProj/jni/voip/webrtc/p2p/base/turn_port.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,9 +1759,9 @@ int TurnEntry::Send(const void* data,
17591759
size_t size,
17601760
bool payload,
17611761
const rtc::PacketOptions& options) {
1762+
if (port_ == nullptr) return -1;
17621763
rtc::ByteBufferWriter buf;
1763-
if (state_ != STATE_BOUND ||
1764-
!port_->TurnCustomizerAllowChannelData(data, size, payload)) {
1764+
if (state_ != STATE_BOUND || !port_->TurnCustomizerAllowChannelData(data, size, payload)) {
17651765
// If we haven't bound the channel yet, we have to use a Send Indication.
17661766
// The turn_customizer_ can also make us use Send Indication.
17671767
TurnMessage msg(TURN_SEND_INDICATION);
@@ -1781,6 +1781,7 @@ int TurnEntry::Send(const void* data,
17811781
state_ = STATE_BINDING;
17821782
}
17831783
} else {
1784+
if (data == nullptr && size > 0) return -1;
17841785
// If the channel is bound, we can send the data as a Channel Message.
17851786
buf.WriteUInt16(channel_id_);
17861787
buf.WriteUInt16(static_cast<uint16_t>(size));

TMessagesProj/src/main/assets/darkblue.attheme

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,3 +453,6 @@ table_background=177390847
453453
table_border=436207615
454454
dialogCardShadow=1073741824
455455
dialogTopBackground=-13473128
456+
share_icon=-1
457+
share_linkText=-1207959553
458+
share_linkBackground=352321535
2.14 KB
Loading
Binary file not shown.
4.83 KB
Loading
Binary file not shown.

TMessagesProj/src/main/assets/night.attheme

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,3 +476,6 @@ table_background=177390847
476476
table_border=436207615
477477
dialogCardShadow=1073741824
478478
dialogTopBackground=-13473128
479+
share_icon=-1
480+
share_linkText=-1207959553
481+
share_linkBackground=352321535

0 commit comments

Comments
 (0)