Add ContactsManager::can_use_premium_custom_emoji.
This commit is contained in:
parent
cc08225d30
commit
e556ed04a0
@ -5931,6 +5931,17 @@ FolderId ContactsManager::get_secret_chat_initial_folder_id(SecretChatId secret_
|
||||
return c->initial_folder_id;
|
||||
}
|
||||
|
||||
bool ContactsManager::can_use_premium_custom_emoji() const {
|
||||
if (td_->option_manager_->get_option_boolean("is_premium")) {
|
||||
return true;
|
||||
}
|
||||
if (!td_->auth_manager_->is_bot()) {
|
||||
return false;
|
||||
}
|
||||
const User *u = get_user(get_my_id());
|
||||
return u == nullptr || u->usernames.get_active_usernames().size() > (u->usernames.has_editable_username() ? 1u : 0u);
|
||||
}
|
||||
|
||||
UserId ContactsManager::get_my_id() const {
|
||||
LOG_IF(ERROR, !my_id_.is_valid()) << "Wrong or unknown my ID returned";
|
||||
return my_id_;
|
||||
|
@ -290,6 +290,8 @@ class ContactsManager final : public Actor {
|
||||
|
||||
void unregister_message_channels(MessageFullId message_full_id, vector<ChannelId> channel_ids);
|
||||
|
||||
bool can_use_premium_custom_emoji() const;
|
||||
|
||||
UserId get_my_id() const;
|
||||
|
||||
void set_my_online_status(bool is_online, bool send_update, bool is_local);
|
||||
|
@ -4531,8 +4531,8 @@ void remove_unallowed_entities(const Td *td, FormattedText &text, DialogId dialo
|
||||
remove_intersecting_entities(text.entities);
|
||||
}
|
||||
}
|
||||
if (!td->option_manager_->get_option_boolean("is_premium") &&
|
||||
dialog_id != DialogId(td->contacts_manager_->get_my_id())) {
|
||||
if (dialog_id != DialogId(td->contacts_manager_->get_my_id()) &&
|
||||
!td->contacts_manager_->can_use_premium_custom_emoji()) {
|
||||
remove_premium_custom_emoji_entities(td, text.entities, false);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user