Skip to content

Commit

Permalink
Merge remote-tracking branch 'official/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Jan 27, 2025
2 parents 6024965 + eee720e commit 1cd827c
Show file tree
Hide file tree
Showing 435 changed files with 48,714 additions and 42,514 deletions.
185 changes: 149 additions & 36 deletions TMessagesProj/jni/tgnet/ApiScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,17 @@ TL_username *TL_username::TLdeserialize(NativeByteBuffer *stream, uint32_t const
return result;
}

TL_peerColor *TL_peerColor::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
if (TL_peerColor::constructor != constructor) {
error = true;
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in TL_peerColor", constructor);
return nullptr;
}
TL_peerColor *result = new TL_peerColor();
result->readParams(stream, instanceNum, error);
return result;
}

void TL_restrictionReason::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
platform = stream->readString(&error);
reason = stream->readString(&error);
Expand Down Expand Up @@ -405,6 +416,132 @@ void TL_username::serializeToStream(NativeByteBuffer *stream) {
stream->writeString(username);
}

void TL_peerColor::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
flags = stream->readInt32(&error);
if ((flags & 1) != 0) {
color = stream->readInt32(&error);
}
if ((flags & 2) != 0) {
background_emoji_id = stream->readInt64(&error);
}
}

void TL_peerColor::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeInt32(flags);
if ((flags & 1) != 0) {
stream->writeInt32(color);
}
if ((flags & 2) != 0) {
stream->writeInt64(background_emoji_id);
}
}

EmojiStatus *EmojiStatus::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
EmojiStatus *result = nullptr;
switch (constructor) {
case TL_emojiStatusEmpty::constructor:
result = new TL_emojiStatusEmpty();
break;
case TL_emojiStatus::constructor:
result = new TL_emojiStatus();
break;
case TL_emojiStatusCollectible::constructor:
result = new TL_emojiStatusCollectible();
break;
case TL_emojiStatus_layer197::constructor:
result = new TL_emojiStatus_layer197();
break;
case TL_emojiStatusUntil_layer197::constructor:
result = new TL_emojiStatusUntil_layer197();
break;
default:
error = true;
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in User", constructor);
return nullptr;
}
result->readParams(stream, instanceNum, error);
return result;
}

void TL_emojiStatusEmpty::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {

}

void TL_emojiStatusEmpty::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
}

void TL_emojiStatus::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
flags = stream->readInt32(&error);
document_id = stream->readInt64(&error);
if ((flags & 1) != 0) {
until = stream->readInt64(&error);
}
}

void TL_emojiStatus::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeInt32(flags);
stream->writeInt64(document_id);
if ((flags & 1) != 0) {
stream->writeInt32(until);
}
}

void TL_emojiStatus_layer197::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
document_id = stream->readInt64(&error);
}

void TL_emojiStatus_layer197::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeInt64(document_id);
}

void TL_emojiStatusUntil_layer197::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
document_id = stream->readInt64(&error);
until = stream->readInt32(&error);
}

void TL_emojiStatusUntil_layer197::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeInt64(document_id);
stream->writeInt32(until);
}

void TL_emojiStatusCollectible::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
flags = stream->readInt32(&error);
collectible_id = stream->readInt64(&error);
document_id = stream->readInt64(&error);
title = stream->readString(&error);
slug = stream->readString(&error);
pattern_document_id = stream->readInt64(&error);
center_color = stream->readInt32(&error);
edge_color = stream->readInt32(&error);
pattern_color = stream->readInt32(&error);
text_color = stream->readInt32(&error);
if ((flags & 1) != 0) {
until = stream->readInt64(&error);
}
}

void TL_emojiStatusCollectible::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeInt32(flags);
stream->writeInt64(collectible_id);
stream->writeInt64(document_id);
stream->writeString(title);
stream->writeString(slug);
stream->writeInt64(pattern_document_id);
stream->writeInt32(center_color);
stream->writeInt32(edge_color);
stream->writeInt32(pattern_color);
stream->writeInt32(text_color);
if ((flags & 1) != 0) {
stream->writeInt32(until);
}
}

User *User::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
User *result = nullptr;
switch (constructor) {
Expand Down Expand Up @@ -483,21 +620,7 @@ void TL_user::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &er
lang_code = stream->readString(&error);
}
if ((flags & 1073741824) != 0) {
emojiStatusMagic = stream->readUint32(&error);
if (emojiStatusMagic == 0x2de11aae) {
// emojiStatusEmpty
} else if (emojiStatusMagic == 0x929b619d) {
// emojiStatus
emojiStatusDocumentId = stream->readInt64(&error);
} else if (emojiStatusMagic == 0xfa30a8c7) {
// emojiStatusUntil
emojiStatusDocumentId = stream->readInt64(&error);
emojiStatusUntil = stream->readInt32(&error);
} else {
error = true;
if (LOGS_ENABLED) DEBUG_FATAL("wrong EmojiStatus magic, got %x", emojiStatusMagic);
return;
}
emoji_status = std::unique_ptr<EmojiStatus>(EmojiStatus::TLdeserialize(stream, stream->readInt32(&error), instanceNum, error));
}
if ((flags2 & 1) != 0) {
uint32_t magic = stream->readUint32(&error);
Expand All @@ -519,18 +642,17 @@ void TL_user::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &er
stories_max_id = stream->readInt32(&error);
}
if ((flags2 & 256) != 0) {
int magic = stream->readInt32(&error);
color_color = stream->readInt32(&error);
color_background_emoji_id = stream->readInt64(&error);
color = std::unique_ptr<TL_peerColor>(TL_peerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
}
if ((flags2 & 512) != 0) {
int magic = stream->readInt32(&error);
profile_color_color = stream->readInt32(&error);
profile_color_background_emoji_id = stream->readInt64(&error);
profile_color = std::unique_ptr<TL_peerColor>(TL_peerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
}
if ((flags2 & 4096) != 0) {
bot_active_users = stream->readInt32(&error);
}
if ((flags2 & 16384) != 0) {
bot_verification_icon = stream->readInt64(&error);
}
}

void TL_user::serializeToStream(NativeByteBuffer *stream) {
Expand Down Expand Up @@ -577,15 +699,7 @@ void TL_user::serializeToStream(NativeByteBuffer *stream) {
stream->writeString(lang_code);
}
if ((flags & 1073741824) != 0) {
stream->writeInt32(emojiStatusMagic);
if (emojiStatusMagic == 0x929b619d) {
// emojiStatus
stream->writeInt64(emojiStatusDocumentId);
} else if (emojiStatusMagic == 0xfa30a8c7) {
// emojiStatusUntil
stream->writeInt64(emojiStatusDocumentId);
stream->writeInt32(emojiStatusUntil);
}
emoji_status->serializeToStream(stream);
}
if ((flags2 & 1) != 0) {
stream->writeInt32(0x1cb5c415);
Expand All @@ -599,18 +713,17 @@ void TL_user::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(stories_max_id);
}
if ((flags2 & 256) != 0) {
stream->writeInt32(0xba278146);
stream->writeInt32(color_color);
stream->writeInt32(color_background_emoji_id);
color->serializeToStream(stream);
}
if ((flags2 & 512) != 0) {
stream->writeInt32(0xba278146);
stream->writeInt32(profile_color_color);
stream->writeInt32(profile_color_background_emoji_id);
profile_color->serializeToStream(stream);
}
if ((flags2 & 4096) != 0) {
stream->writeInt32(bot_active_users);
}
if ((flags2 & 16384) != 0) {
stream->writeInt64(bot_verification_icon);
}
}

InputPeer *InputPeer::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
Expand Down
92 changes: 84 additions & 8 deletions TMessagesProj/jni/tgnet/ApiScheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,85 @@ class TL_username : public TLObject {
void serializeToStream(NativeByteBuffer *stream);
};

class TL_peerColor : public TLObject {
public:
static const uint32_t constructor = 0xb54b5acf;

int32_t flags;
int32_t color;
int64_t background_emoji_id;

static TL_peerColor *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error);
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
void serializeToStream(NativeByteBuffer *stream);
};

class EmojiStatus : public TLObject {
public:
static EmojiStatus *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error);
};

class TL_emojiStatusEmpty : public EmojiStatus {
public:
static const uint32_t constructor = 0xb54b5acf;

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

class TL_emojiStatus : public EmojiStatus {
public:
static const uint32_t constructor = 0xe7ff068a;

int32_t flags;
int64_t document_id;
int32_t until;

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

class TL_emojiStatus_layer197 : public EmojiStatus {
public:
static const uint32_t constructor = 0x929b619d;

int64_t document_id;

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

class TL_emojiStatusUntil_layer197 : public EmojiStatus {
public:
static const uint32_t constructor = 0xfa30a8c7;

int64_t document_id;
int32_t until;

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

class TL_emojiStatusCollectible : public EmojiStatus {
public:
static const uint32_t constructor = 0x7141dbf;

int32_t flags;
int64_t collectible_id;
int64_t document_id;
std::string title;
std::string slug;
int64_t pattern_document_id;
int32_t center_color;
int32_t edge_color;
int32_t pattern_color;
int32_t text_color;
int32_t until;

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

class User : public TLObject {

public:
Expand All @@ -381,14 +460,11 @@ class User : public TLObject {
std::string lang_code;
std::vector<std::unique_ptr<TL_username>> usernames;
int32_t stories_max_id;
int32_t emojiStatusMagic;
int64_t emojiStatusDocumentId;
int32_t emojiStatusUntil;
int32_t color_color;
int64_t color_background_emoji_id;
int32_t profile_color_color;
int64_t profile_color_background_emoji_id;
std::unique_ptr<EmojiStatus> emoji_status;
std::unique_ptr<TL_peerColor> color;
std::unique_ptr<TL_peerColor> profile_color;
int32_t bot_active_users;
int64_t bot_verification_icon;

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

public:
static const uint32_t constructor = 0x83314fca;
static const uint32_t constructor = 0x4b46c37e;

void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
void serializeToStream(NativeByteBuffer *stream);
Expand Down
5 changes: 3 additions & 2 deletions TMessagesProj/jni/voip/webrtc/p2p/base/turn_port.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1759,9 +1759,9 @@ int TurnEntry::Send(const void* data,
size_t size,
bool payload,
const rtc::PacketOptions& options) {
if (port_ == nullptr) return -1;
rtc::ByteBufferWriter buf;
if (state_ != STATE_BOUND ||
!port_->TurnCustomizerAllowChannelData(data, size, payload)) {
if (state_ != STATE_BOUND || !port_->TurnCustomizerAllowChannelData(data, size, payload)) {
// If we haven't bound the channel yet, we have to use a Send Indication.
// The turn_customizer_ can also make us use Send Indication.
TurnMessage msg(TURN_SEND_INDICATION);
Expand All @@ -1781,6 +1781,7 @@ int TurnEntry::Send(const void* data,
state_ = STATE_BINDING;
}
} else {
if (data == nullptr && size > 0) return -1;
// If the channel is bound, we can send the data as a Channel Message.
buf.WriteUInt16(channel_id_);
buf.WriteUInt16(static_cast<uint16_t>(size));
Expand Down
3 changes: 3 additions & 0 deletions TMessagesProj/src/main/assets/darkblue.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,6 @@ table_background=177390847
table_border=436207615
dialogCardShadow=1073741824
dialogTopBackground=-13473128
share_icon=-1
share_linkText=-1207959553
share_linkBackground=352321535
Binary file modified TMessagesProj/src/main/assets/models/coin_border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified TMessagesProj/src/main/assets/models/coin_logo.binobj
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified TMessagesProj/src/main/assets/models/deal_logo.binobj
Binary file not shown.
3 changes: 3 additions & 0 deletions TMessagesProj/src/main/assets/night.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -476,3 +476,6 @@ table_background=177390847
table_border=436207615
dialogCardShadow=1073741824
dialogTopBackground=-13473128
share_icon=-1
share_linkText=-1207959553
share_linkBackground=352321535
Loading

0 comments on commit 1cd827c

Please sign in to comment.