Add chatInviteLinkInfo.accent_color_id_.

This commit is contained in:
levlam 2023-10-19 15:40:55 +03:00
parent 8a7322cef2
commit edc3e4c18a
3 changed files with 12 additions and 4 deletions

View File

@ -989,6 +989,7 @@ inviteLinkChatTypeChannel = InviteLinkChatType;
//@type Type of the chat
//@title Title of the chat
//@photo Chat photo; may be null
//@accent_color_id Identifier of the accent color for chat title and background of chat photo
//@param_description Chat description
//@member_count Number of members in the chat
//@member_user_ids User identifiers of some chat members that may be known to the current user
@ -997,7 +998,7 @@ inviteLinkChatTypeChannel = InviteLinkChatType;
//@is_verified True, if the chat is verified
//@is_scam True, if many users reported this chat as a scam
//@is_fake True, if many users reported this chat as a fake account
chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo description:string member_count:int32 member_user_ids:vector<int53> creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo;
chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:accentColorId description:string member_count:int32 member_user_ids:vector<int53> creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo;
//@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user

View File

@ -15529,6 +15529,7 @@ void ContactsManager::on_get_dialog_invite_link_info(const string &invite_link,
invite_link_info->dialog_id = DialogId();
invite_link_info->title = chat_invite->title_;
invite_link_info->photo = get_photo(td_, std::move(chat_invite->photo_), DialogId());
invite_link_info->accent_color_id = AccentColorId(chat_invite->color_);
invite_link_info->description = std::move(chat_invite->about_);
invite_link_info->participant_count = chat_invite->participants_count_;
invite_link_info->participant_user_ids = std::move(participant_user_ids);
@ -19795,6 +19796,7 @@ tl_object_ptr<td_api::chatInviteLinkInfo> ContactsManager::get_chat_invite_link_
string title;
const DialogPhoto *photo = nullptr;
DialogPhoto invite_link_photo;
AccentColorId accent_color_id;
string description;
int32 participant_count = 0;
vector<int64> member_user_ids;
@ -19820,6 +19822,7 @@ tl_object_ptr<td_api::chatInviteLinkInfo> ContactsManager::get_chat_invite_link_
} else {
LOG(ERROR) << "Have no information about " << chat_id;
}
accent_color_id = get_chat_accent_color_id(chat_id);
break;
}
case DialogType::Channel: {
@ -19839,6 +19842,7 @@ tl_object_ptr<td_api::chatInviteLinkInfo> ContactsManager::get_chat_invite_link_
} else {
LOG(ERROR) << "Have no information about " << channel_id;
}
accent_color_id = get_channel_accent_color_id(channel_id);
break;
}
default:
@ -19851,6 +19855,7 @@ tl_object_ptr<td_api::chatInviteLinkInfo> ContactsManager::get_chat_invite_link_
title = invite_link_info->title;
invite_link_photo = as_fake_dialog_photo(invite_link_info->photo, dialog_id, false);
photo = &invite_link_photo;
accent_color_id = invite_link_info->accent_color_id;
description = invite_link_info->description;
participant_count = invite_link_info->participant_count;
member_user_ids = get_user_ids_object(invite_link_info->participant_user_ids, "get_chat_invite_link_info_object");
@ -19883,8 +19888,9 @@ tl_object_ptr<td_api::chatInviteLinkInfo> ContactsManager::get_chat_invite_link_
return td_api::make_object<td_api::chatInviteLinkInfo>(
td_->messages_manager_->get_chat_id_object(dialog_id, "chatInviteLinkInfo"), accessible_for, std::move(chat_type),
title, get_chat_photo_info_object(td_->file_manager_.get(), photo), description, participant_count,
std::move(member_user_ids), creates_join_request, is_public, is_verified, is_scam, is_fake);
title, get_chat_photo_info_object(td_->file_manager_.get(), photo), accent_color_id.get_accent_color_id_object(),
description, participant_count, std::move(member_user_ids), creates_join_request, is_public, is_verified, is_scam,
is_fake);
}
void ContactsManager::get_support_user(Promise<td_api::object_ptr<td_api::user>> &&promise) {

View File

@ -1150,9 +1150,10 @@ class ContactsManager final : public Actor {
// unknown dialog
string title;
Photo photo;
string description;
AccentColorId accent_color_id;
int32 participant_count = 0;
vector<UserId> participant_user_ids;
string description;
bool creates_join_request = false;
bool is_chat = false;
bool is_channel = false;