Add supergroup.show_message_sender.
This commit is contained in:
parent
2c1ec31420
commit
b041bf0e97
@ -1333,7 +1333,8 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb
|
||||
//@boost_level Approximate boost level for the chat
|
||||
//@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel
|
||||
//@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup
|
||||
//@sign_messages True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels
|
||||
//@sign_messages True, if messages sent to the channel contains name of the sender. This field is only applicable to channels
|
||||
//@show_message_sender True, if messages sent to the channel have information about the sender user. This field is only applicable to channels
|
||||
//@join_to_send_messages True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups
|
||||
//@join_by_request True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat
|
||||
//@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup
|
||||
@ -1346,7 +1347,7 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb
|
||||
//@is_fake True, if many users reported this supergroup or channel as a fake account
|
||||
//@has_active_stories True, if the supergroup or channel has non-expired stories available to the current user
|
||||
//@has_unread_active_stories True, if the supergroup or channel has unread non-expired stories available to the current user
|
||||
supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool = Supergroup;
|
||||
supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool show_message_sender:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool = Supergroup;
|
||||
|
||||
//@description Contains full information about a supergroup or channel
|
||||
//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
|
||||
|
@ -1975,6 +1975,7 @@ void ChatManager::Channel::store(StorerT &storer) const {
|
||||
STORE_FLAG(has_profile_background_custom_emoji_id);
|
||||
STORE_FLAG(has_boost_level);
|
||||
STORE_FLAG(has_emoji_status);
|
||||
STORE_FLAG(show_message_sender);
|
||||
END_STORE_FLAGS();
|
||||
}
|
||||
|
||||
@ -2103,6 +2104,7 @@ void ChatManager::Channel::parse(ParserT &parser) {
|
||||
PARSE_FLAG(has_profile_background_custom_emoji_id);
|
||||
PARSE_FLAG(has_boost_level);
|
||||
PARSE_FLAG(has_emoji_status);
|
||||
PARSE_FLAG(show_message_sender);
|
||||
END_PARSE_FLAGS();
|
||||
}
|
||||
|
||||
@ -2197,7 +2199,10 @@ void ChatManager::Channel::parse(ParserT &parser) {
|
||||
if (legacy_has_active_group_call) {
|
||||
cache_version = 0;
|
||||
}
|
||||
if (!is_megagroup && status.is_restricted()) {
|
||||
if (is_megagroup) {
|
||||
show_message_sender = true;
|
||||
} else {
|
||||
if (status.is_restricted()) {
|
||||
if (status.is_member()) {
|
||||
status = DialogParticipantStatus::Member(0);
|
||||
} else {
|
||||
@ -2205,6 +2210,7 @@ void ChatManager::Channel::parse(ParserT &parser) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class StorerT>
|
||||
void ChatManager::ChannelFull::store(StorerT &storer) const {
|
||||
@ -8368,6 +8374,7 @@ void ChatManager::on_get_channel(telegram_api::channel &channel, const char *sou
|
||||
int32 participant_count = have_participant_count ? channel.participants_count_ : 0;
|
||||
bool stories_available = channel.stories_max_id_ > 0;
|
||||
bool stories_unavailable = channel.stories_unavailable_;
|
||||
bool show_message_sender = channel.signature_profiles_;
|
||||
auto boost_level = channel.level_;
|
||||
|
||||
if (have_participant_count) {
|
||||
@ -8387,6 +8394,7 @@ void ChatManager::on_get_channel(telegram_api::channel &channel, const char *sou
|
||||
if (is_megagroup) {
|
||||
LOG_IF(ERROR, sign_messages) << "Need to sign messages in the supergroup " << channel_id << " from " << source;
|
||||
sign_messages = true;
|
||||
show_message_sender = true;
|
||||
} else {
|
||||
LOG_IF(ERROR, is_slow_mode_enabled && channel_id.get() >= 8000000000)
|
||||
<< "Slow mode enabled in the " << channel_id << " from " << source;
|
||||
@ -8562,9 +8570,11 @@ void ChatManager::on_get_channel(telegram_api::channel &channel, const char *sou
|
||||
|
||||
c->need_save_to_database = true;
|
||||
}
|
||||
if (c->is_verified != is_verified || c->sign_messages != sign_messages) {
|
||||
if (c->is_verified != is_verified || c->sign_messages != sign_messages ||
|
||||
c->show_message_sender != show_message_sender) {
|
||||
c->is_verified = is_verified;
|
||||
c->sign_messages = sign_messages;
|
||||
c->show_message_sender = show_message_sender;
|
||||
|
||||
c->is_changed = true;
|
||||
}
|
||||
@ -8655,6 +8665,7 @@ void ChatManager::on_get_channel_forbidden(telegram_api::channelForbidden &chann
|
||||
}
|
||||
|
||||
bool sign_messages = false;
|
||||
bool show_message_sender = false;
|
||||
bool join_to_send = false;
|
||||
bool join_request = false;
|
||||
bool is_slow_mode_enabled = false;
|
||||
@ -8672,6 +8683,7 @@ void ChatManager::on_get_channel_forbidden(telegram_api::channelForbidden &chann
|
||||
|
||||
if (is_megagroup) {
|
||||
sign_messages = true;
|
||||
show_message_sender = true;
|
||||
}
|
||||
|
||||
bool need_invalidate_channel_full = false;
|
||||
@ -8696,9 +8708,11 @@ void ChatManager::on_get_channel_forbidden(telegram_api::channelForbidden &chann
|
||||
|
||||
c->need_save_to_database = true;
|
||||
}
|
||||
if (c->sign_messages != sign_messages || c->is_verified != is_verified) {
|
||||
c->sign_messages = sign_messages;
|
||||
if (c->is_verified != is_verified || c->sign_messages != sign_messages ||
|
||||
c->show_message_sender != show_message_sender) {
|
||||
c->is_verified = is_verified;
|
||||
c->sign_messages = sign_messages;
|
||||
c->show_message_sender = show_message_sender;
|
||||
|
||||
c->is_changed = true;
|
||||
}
|
||||
@ -8820,8 +8834,8 @@ td_api::object_ptr<td_api::updateSupergroup> ChatManager::get_update_unknown_sup
|
||||
bool is_megagroup = min_channel == nullptr ? false : min_channel->is_megagroup_;
|
||||
return td_api::make_object<td_api::updateSupergroup>(td_api::make_object<td_api::supergroup>(
|
||||
channel_id.get(), nullptr, 0, DialogParticipantStatus::Banned(0).get_chat_member_status_object(), 0, 0, false,
|
||||
false, false, !is_megagroup, false, false, !is_megagroup, false, false, false, string(), false, false, false,
|
||||
false));
|
||||
false, false, false, !is_megagroup, false, false, !is_megagroup, false, false, false, string(), false, false,
|
||||
false, false));
|
||||
}
|
||||
|
||||
int64 ChatManager::get_supergroup_id_object(ChannelId channel_id, const char *source) const {
|
||||
@ -8858,7 +8872,7 @@ tl_object_ptr<td_api::supergroup> ChatManager::get_supergroup_object(ChannelId c
|
||||
return td_api::make_object<td_api::supergroup>(
|
||||
channel_id.get(), c->usernames.get_usernames_object(), c->date,
|
||||
get_channel_status(c).get_chat_member_status_object(), c->participant_count, c->boost_level,
|
||||
c->has_linked_channel, c->has_location, c->sign_messages, get_channel_join_to_send(c),
|
||||
c->has_linked_channel, c->has_location, c->sign_messages, c->show_message_sender, get_channel_join_to_send(c),
|
||||
get_channel_join_request(c), c->is_slow_mode_enabled, !c->is_megagroup, c->is_gigagroup, c->is_forum,
|
||||
c->is_verified, get_restriction_reason_description(c->restriction_reasons), c->is_scam, c->is_fake,
|
||||
c->max_active_story_id.is_valid(), get_channel_has_unread_stories(c));
|
||||
|
@ -491,6 +491,7 @@ class ChatManager final : public Actor {
|
||||
bool has_linked_channel = false;
|
||||
bool has_location = false;
|
||||
bool sign_messages = false;
|
||||
bool show_message_sender = false;
|
||||
bool is_slow_mode_enabled = false;
|
||||
bool noforwards = false;
|
||||
bool can_be_deleted = false;
|
||||
|
Loading…
Reference in New Issue
Block a user