Update layer 116. Add UserFull.supports_video_calls flag.

GitOrigin-RevId: 67aa9a84ed676e3969beb1c5a01a012167744c6d
This commit is contained in:
levlam 2020-08-05 21:34:04 +03:00
parent c5059bcac3
commit b340b0deaa
7 changed files with 21 additions and 11 deletions

View File

@ -405,12 +405,13 @@ user id:int32 first_name:string last_name:string username:string phone_number:st
//@photo User profile photo; may be null
//@is_blocked True, if the user is blocked by the current user
//@can_be_called True, if the user can be called
//@supports_video_calls True, if a video call can be created with the user
//@has_private_calls True, if the user can't be called due to their privacy settings
//@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used
//@bio A short user bio @share_text For bots, the text that is included with the link when users share the bot
//@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user
//@bot_info If the user is a bot, information about the bot; may be null
userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool has_private_calls:Bool need_phone_number_privacy_exception:Bool bio:string share_text:string group_in_common_count:int32 bot_info:botInfo = UserFullInfo;
userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool need_phone_number_privacy_exception:Bool bio:string share_text:string group_in_common_count:int32 bot_info:botInfo = UserFullInfo;
//@description Represents a list of users @total_count Approximate total count of users found @user_ids A list of user identifiers
users total_count:int32 user_ids:vector<int32> = Users;

Binary file not shown.

View File

@ -212,7 +212,7 @@ inputReportReasonOther#e1746d0a text:string = ReportReason;
inputReportReasonCopyright#9b89f93a = ReportReason;
inputReportReasonGeoIrrelevant#dbd4feed = ReportReason;
userFull#edf17c12 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int = UserFull;
userFull#edf17c12 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int = UserFull;
contact#f911c994 user_id:int mutual:Bool = Contact;
@ -805,11 +805,11 @@ inputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_co
inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;
phoneCallEmpty#5366c915 id:long = PhoneCall;
phoneCallWaiting#1b8f4ad1 flags:# video:flags.5?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;
phoneCallRequested#87eabb53 flags:# video:flags.5?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCallAccepted#997c454a flags:# video:flags.5?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCall#8742ae7f flags:# p2p_allowed:flags.5?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int = PhoneCall;
phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.5?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;
phoneCallWaiting#1b8f4ad1 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;
phoneCallRequested#87eabb53 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCallAccepted#997c454a flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCall#8742ae7f flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int = PhoneCall;
phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;
phoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;

Binary file not shown.

View File

@ -407,6 +407,8 @@ Status CallActor::do_update_call(telegram_api::phoneCall &call) {
}
cancel_timeout();
is_video_ |= (call.flags_ & telegram_api::phoneCall::VIDEO_MASK) != 0;
LOG(DEBUG) << "Do update call to Ready from state " << static_cast<int32>(state_);
if (state_ == State::WaitAcceptResult) {
dh_handshake_.set_g_a(call.g_a_or_b_.as_slice());

View File

@ -3365,6 +3365,7 @@ void ContactsManager::UserFull::store(StorerT &storer) const {
STORE_FLAG(can_pin_messages);
STORE_FLAG(need_phone_number_privacy_exception);
STORE_FLAG(has_photo);
STORE_FLAG(supports_video_calls);
END_STORE_FLAGS();
if (has_about) {
store(about, storer);
@ -3389,6 +3390,7 @@ void ContactsManager::UserFull::parse(ParserT &parser) {
PARSE_FLAG(can_pin_messages);
PARSE_FLAG(need_phone_number_privacy_exception);
PARSE_FLAG(has_photo);
PARSE_FLAG(supports_video_calls);
END_PARSE_FLAGS();
if (has_about) {
parse(about, parser);
@ -9184,10 +9186,12 @@ void ContactsManager::on_get_user_full(tl_object_ptr<telegram_api::userFull> &&u
}
bool can_be_called = user_full->phone_calls_available_ && !user_full->phone_calls_private_;
bool supports_video_calls = user_full->video_calls_available_ && !user_full->phone_calls_private_;
bool has_private_calls = user_full->phone_calls_private_;
if (user->can_be_called != can_be_called || user->has_private_calls != has_private_calls ||
user->about != user_full->about_) {
if (user->can_be_called != can_be_called || user->supports_video_calls != supports_video_calls ||
user->has_private_calls != has_private_calls || user->about != user_full->about_) {
user->can_be_called = can_be_called;
user->supports_video_calls = supports_video_calls;
user->has_private_calls = has_private_calls;
user->about = std::move(user_full->about_);
@ -10243,6 +10247,7 @@ void ContactsManager::drop_user_full(UserId user_id) {
user_full->photo = Photo();
user_full->is_blocked = false;
user_full->can_be_called = false;
user_full->supports_video_calls = false;
user_full->has_private_calls = false;
user_full->need_phone_number_privacy_exception = false;
user_full->about = string();
@ -14071,8 +14076,9 @@ tl_object_ptr<td_api::userFullInfo> ContactsManager::get_user_full_info_object(U
bool is_bot = is_user_bot(user_id);
return make_tl_object<td_api::userFullInfo>(
get_chat_photo_object(td_->file_manager_.get(), user_full->photo), user_full->is_blocked,
user_full->can_be_called, user_full->has_private_calls, user_full->need_phone_number_privacy_exception,
is_bot ? string() : user_full->about, is_bot ? user_full->about : string(), user_full->common_chat_count,
user_full->can_be_called, user_full->supports_video_calls, user_full->has_private_calls,
user_full->need_phone_number_privacy_exception, is_bot ? string() : user_full->about,
is_bot ? user_full->about : string(), user_full->common_chat_count,
is_bot ? get_bot_info_object(user_id) : nullptr);
}

View File

@ -671,6 +671,7 @@ class ContactsManager : public Actor {
bool is_blocked = false;
bool can_be_called = false;
bool supports_video_calls = false;
bool has_private_calls = false;
bool can_pin_messages = false;
bool need_phone_number_privacy_exception = false;