Update API scheme to layer 202.

This commit is contained in:
John Preston 2025-03-24 21:58:06 +04:00
parent 8e643fbf87
commit 214cc83d4a
20 changed files with 179 additions and 15 deletions

View file

@ -2220,6 +2220,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_action_message_price_paid#other" = "Messages now cost {count} Stars each in this group."; "lng_action_message_price_paid#other" = "Messages now cost {count} Stars each in this group.";
"lng_you_paid_stars#one" = "You paid {count} Star."; "lng_you_paid_stars#one" = "You paid {count} Star.";
"lng_you_paid_stars#other" = "You paid {count} Stars."; "lng_you_paid_stars#other" = "You paid {count} Stars.";
"lng_action_confcall_invitation" = "Call invitation...";
"lng_action_confcall_missed" = "Missed conference call";
"lng_action_confcall_ongoing" = "Ongoing conference call";
"lng_action_confcall_finished" = "Conference call";
"lng_you_joined_group" = "You joined this group"; "lng_you_joined_group" = "You joined this group";
@ -4904,6 +4908,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_group_call_rtmp_viewers#one" = "{count} viewer"; "lng_group_call_rtmp_viewers#one" = "{count} viewer";
"lng_group_call_rtmp_viewers#other" = "{count} viewers"; "lng_group_call_rtmp_viewers#other" = "{count} viewers";
"lng_confcall_join_title" = "Group Call";
"lng_confcall_join_text" = "You are invited to join a Telegram Call.";
"lng_confcall_join_button" = "Join Group Call";
"lng_no_mic_permission" = "Telegram needs microphone access so that you can make calls and record voice messages."; "lng_no_mic_permission" = "Telegram needs microphone access so that you can make calls and record voice messages.";
"lng_player_message_today" = "today at {time}"; "lng_player_message_today" = "today at {time}";

View file

@ -632,6 +632,8 @@ void Instance::handleGroupCallUpdate(
}, [](const MTPDupdateGroupCallParticipants &data) { }, [](const MTPDupdateGroupCallParticipants &data) {
return data.vcall().match([&](const MTPDinputGroupCall &data) { return data.vcall().match([&](const MTPDinputGroupCall &data) {
return data.vid().v; return data.vid().v;
}, [](const MTPDinputGroupCallSlug &) -> CallId {
Unexpected("slug in Instance::handleGroupCallUpdate");
}); });
}, [](const auto &) -> CallId { }, [](const auto &) -> CallId {
Unexpected("Type in Instance::handleGroupCallUpdate."); Unexpected("Type in Instance::handleGroupCallUpdate.");

View file

@ -1091,6 +1091,8 @@ void GroupCall::join(const MTPInputGroupCall &inputCall) {
inputCall.match([&](const MTPDinputGroupCall &data) { inputCall.match([&](const MTPDinputGroupCall &data) {
_id = data.vid().v; _id = data.vid().v;
_accessHash = data.vaccess_hash().v; _accessHash = data.vaccess_hash().v;
}, [&](const MTPDinputGroupCallSlug &) {
Unexpected("inputGroupCallSlug in GroupCall::join.");
}); });
setState(_scheduleDate ? State::Waiting : State::Joining); setState(_scheduleDate ? State::Waiting : State::Joining);
@ -1377,7 +1379,8 @@ void GroupCall::rejoin(not_null<PeerData*> as) {
inputCall(), inputCall(),
joinAs()->input, joinAs()->input,
MTP_string(_joinHash), MTP_string(_joinHash),
MTPlong(), // key_fingerprint MTPint256(), // public_key
MTPint(), // invite_msg_id
MTP_dataJSON(MTP_bytes(json)) MTP_dataJSON(MTP_bytes(json))
)).done([=]( )).done([=](
const MTPUpdates &updates, const MTPUpdates &updates,
@ -1607,7 +1610,8 @@ void GroupCall::applyMeInCallLocally() {
MTPstring(), // Don't update about text in local updates. MTPstring(), // Don't update about text in local updates.
MTP_long(raisedHandRating), MTP_long(raisedHandRating),
MTPGroupCallParticipantVideo(), MTPGroupCallParticipantVideo(),
MTPGroupCallParticipantVideo())), MTPGroupCallParticipantVideo(),
AssertIsDebug() MTPint256())), // public_key
MTP_int(0)).c_updateGroupCallParticipants()); MTP_int(0)).c_updateGroupCallParticipants());
} }
@ -1654,7 +1658,8 @@ void GroupCall::applyParticipantLocally(
MTPstring(), // Don't update about text in local updates. MTPstring(), // Don't update about text in local updates.
MTP_long(participant->raisedHandRating), MTP_long(participant->raisedHandRating),
MTPGroupCallParticipantVideo(), MTPGroupCallParticipantVideo(),
MTPGroupCallParticipantVideo())), MTPGroupCallParticipantVideo(),
AssertIsDebug() MTPint256())), // public_key
MTP_int(0)).c_updateGroupCallParticipants()); MTP_int(0)).c_updateGroupCallParticipants());
} }
@ -1966,8 +1971,11 @@ void GroupCall::handleUpdate(const MTPDupdateGroupCall &data) {
} }
void GroupCall::handleUpdate(const MTPDupdateGroupCallParticipants &data) { void GroupCall::handleUpdate(const MTPDupdateGroupCallParticipants &data) {
const auto callId = data.vcall().match([](const auto &data) { const auto callId = data.vcall().match([](
const MTPDinputGroupCall &data) {
return data.vid().v; return data.vid().v;
}, [](const MTPDinputGroupCallSlug &) -> CallId {
Unexpected("inputGroupCallSlug in GroupCall::handleUpdate.");
}); });
if (_id != callId) { if (_id != callId) {
return; return;

View file

@ -50,4 +50,23 @@ object_ptr<Ui::GenericBox> ScreenSharingPrivacyRequestBox() {
#endif // Q_OS_MAC #endif // Q_OS_MAC
} }
void ConferenceCallJoinConfirm(
not_null<Ui::GenericBox*> box,
std::shared_ptr<Data::GroupCall> call) {
box->setTitle(tr::lng_confcall_join_title());
box->addRow(
object_ptr<Ui::FlatLabel>(
box,
tr::lng_confcall_join_text(),
st::boxLabel));
box->addButton(tr::lng_confcall_join_button(), [=] {
});
box->addButton(tr::lng_cancel(), [=] {
box->closeBox();
});
}
} // namespace Calls::Group } // namespace Calls::Group

View file

@ -11,6 +11,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
class UserData; class UserData;
namespace Data {
class GroupCall;
} // namespace Data
namespace Ui { namespace Ui {
class GenericBox; class GenericBox;
} // namespace Ui } // namespace Ui
@ -93,4 +97,8 @@ using StickedTooltips = base::flags<StickedTooltip>;
[[nodiscard]] object_ptr<Ui::GenericBox> ScreenSharingPrivacyRequestBox(); [[nodiscard]] object_ptr<Ui::GenericBox> ScreenSharingPrivacyRequestBox();
void ConferenceCallJoinConfirm(
not_null<Ui::GenericBox*> box,
std::shared_ptr<Data::GroupCall> call);
} // namespace Calls::Group } // namespace Calls::Group

View file

@ -1448,6 +1448,21 @@ bool ResolveUniqueGift(
return true; return true;
} }
bool ResolveConferenceCall(
Window::SessionController *controller,
const Match &match,
const QVariant &context) {
if (!controller) {
return false;
}
const auto slug = match->captured(1);
if (slug.isEmpty()) {
return false;
}
controller->window().activate();
controller->resolveConferenceCall(match->captured(1));
return true;
}
} // namespace } // namespace
const std::vector<LocalUrlHandler> &LocalUrlHandlers() { const std::vector<LocalUrlHandler> &LocalUrlHandlers() {
@ -1544,6 +1559,10 @@ const std::vector<LocalUrlHandler> &LocalUrlHandlers() {
u"^nft/?\\?slug=([a-zA-Z0-9\\.\\_\\-]+)(&|$)"_q, u"^nft/?\\?slug=([a-zA-Z0-9\\.\\_\\-]+)(&|$)"_q,
ResolveUniqueGift ResolveUniqueGift
}, },
{
u"^call/?\\?slug=([a-zA-Z0-9\\.\\_\\-]+)(&|$)"_q,
ResolveConferenceCall
},
{ {
u"^([^\\?]+)(\\?|#|$)"_q, u"^([^\\?]+)(\\?|#|$)"_q,
HandleUnknown HandleUnknown
@ -1704,6 +1723,9 @@ QString TryConvertUrlToLocal(QString url) {
} else if (const auto nftMatch = regex_match(u"^nft/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"_q, query, matchOptions)) { } else if (const auto nftMatch = regex_match(u"^nft/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"_q, query, matchOptions)) {
const auto slug = nftMatch->captured(1); const auto slug = nftMatch->captured(1);
return u"tg://nft?slug="_q + slug; return u"tg://nft?slug="_q + slug;
} else if (const auto callMatch = regex_match(u"^call/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"_q, query, matchOptions)) {
const auto slug = callMatch->captured(1);
return u"tg://call?slug="_q + slug;
} else if (const auto privateMatch = regex_match(u"^" } else if (const auto privateMatch = regex_match(u"^"
"c/(\\-?\\d+)" "c/(\\-?\\d+)"
"(" "("

View file

@ -1005,6 +1005,8 @@ void ChannelData::setGroupCall(
owner().registerGroupCall(_call.get()); owner().registerGroupCall(_call.get());
session().changes().peerUpdated(this, UpdateFlag::GroupCall); session().changes().peerUpdated(this, UpdateFlag::GroupCall);
addFlags(Flag::CallActive); addFlags(Flag::CallActive);
}, [&](const MTPDinputGroupCallSlug &) {
clearGroupCall();
}); });
} }

View file

@ -238,6 +238,8 @@ void ChatData::setGroupCall(
owner().registerGroupCall(_call.get()); owner().registerGroupCall(_call.get());
session().changes().peerUpdated(this, UpdateFlag::GroupCall); session().changes().peerUpdated(this, UpdateFlag::GroupCall);
addFlags(Flag::CallActive); addFlags(Flag::CallActive);
}, [&](const MTPDinputGroupCallSlug &) {
clearGroupCall();
}); });
} }

View file

@ -60,7 +60,7 @@ bool GroupCallParticipant::screenPaused() const {
GroupCall::GroupCall( GroupCall::GroupCall(
not_null<PeerData*> peer, not_null<PeerData*> peer,
CallId id, CallId id,
CallId accessHash, uint64 accessHash,
TimeId scheduleDate, TimeId scheduleDate,
bool rtmp) bool rtmp)
: _id(id) : _id(id)

View file

@ -56,7 +56,7 @@ public:
GroupCall( GroupCall(
not_null<PeerData*> peer, not_null<PeerData*> peer,
CallId id, CallId id,
CallId accessHash, uint64 accessHash,
TimeId scheduleDate, TimeId scheduleDate,
bool rtmp); bool rtmp);
~GroupCall(); ~GroupCall();
@ -201,7 +201,7 @@ private:
[[nodiscard]] Participant *findParticipant(not_null<PeerData*> peer); [[nodiscard]] Participant *findParticipant(not_null<PeerData*> peer);
const CallId _id = 0; const CallId _id = 0;
const CallId _accessHash = 0; const uint64 _accessHash = 0;
not_null<PeerData*> _peer; not_null<PeerData*> _peer;
int _version = 0; int _version = 0;

View file

@ -1713,6 +1713,12 @@ ServiceAction ParseServiceAction(
result.content = ActionPaidMessagesPrice{ result.content = ActionPaidMessagesPrice{
.stars = int(data.vstars().v), .stars = int(data.vstars().v),
}; };
}, [&](const MTPDmessageActionConferenceCall &data) {
result.content = ActionConferenceCall{
.duration = data.vduration().value_or_empty(),
.active = data.is_active(),
.missed = data.is_missed(),
};
}, [](const MTPDmessageActionEmpty &data) {}); }, [](const MTPDmessageActionEmpty &data) {});
return result; return result;
} }

View file

@ -671,6 +671,12 @@ struct ActionPaidMessagesPrice {
int stars = 0; int stars = 0;
}; };
struct ActionConferenceCall {
int duration = 0;
bool active = false;
bool missed = false;
};
struct ServiceAction { struct ServiceAction {
std::variant< std::variant<
v::null_t, v::null_t,
@ -718,7 +724,8 @@ struct ServiceAction {
ActionPrizeStars, ActionPrizeStars,
ActionStarGift, ActionStarGift,
ActionPaidMessagesRefunded, ActionPaidMessagesRefunded,
ActionPaidMessagesPrice> content; ActionPaidMessagesPrice,
ActionConferenceCall> content;
}; };
ServiceAction ParseServiceAction( ServiceAction ParseServiceAction(

View file

@ -1387,6 +1387,16 @@ auto HtmlWriter::Wrap::pushMessage(
+ QString::number(data.stars).toUtf8() + QString::number(data.stars).toUtf8()
+ " Telegram Stars."; + " Telegram Stars.";
return result; return result;
}, [&](const ActionConferenceCall &data) {
return data.missed
? "Missed conference call"
: data.active
? "Ongoing conference call"
: data.duration
? "Conference call ("
+ NumberToString(data.duration)
+ " seconds)"
: "Declined conference call";
}, [](v::null_t) { return QByteArray(); }); }, [](v::null_t) { return QByteArray(); });
if (!serviceText.isEmpty()) { if (!serviceText.isEmpty()) {

View file

@ -672,6 +672,12 @@ QByteArray SerializeMessage(
pushActor(); pushActor();
pushAction("paid_messages_price_change"); pushAction("paid_messages_price_change");
push("price_stars", data.stars); push("price_stars", data.stars);
}, [&](const ActionConferenceCall &data) {
pushActor();
pushAction("conference_call");
push("duration_seconds", data.duration);
push("is_missed", data.missed);
push("is_active", data.active);
}, [](v::null_t) {}); }, [](v::null_t) {});
if (v::is_null(message.action.content)) { if (v::is_null(message.action.content)) {

View file

@ -5624,6 +5624,19 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) {
return result; return result;
}; };
auto prepareConferenceCall = [&](const MTPDmessageActionConferenceCall &action) {
auto result = PreparedServiceText();
const auto duration = action.vduration().value_or_empty();
result.text.text = action.is_missed()
? tr::lng_action_confcall_missed(tr::now)
: action.is_active()
? tr::lng_action_confcall_ongoing(tr::now)
: duration
? tr::lng_action_confcall_finished(tr::now)
: tr::lng_action_confcall_invitation(tr::now);
return result;
};
setServiceText(action.match( setServiceText(action.match(
prepareChatAddUserText, prepareChatAddUserText,
prepareChatJoinedByLink, prepareChatJoinedByLink,
@ -5673,6 +5686,7 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) {
prepareStarGiftUnique, prepareStarGiftUnique,
preparePaidMessagesRefunded, preparePaidMessagesRefunded,
preparePaidMessagesPrice, preparePaidMessagesPrice,
prepareConferenceCall,
PrepareEmptyText<MTPDmessageActionRequestedPeerSentMe>, PrepareEmptyText<MTPDmessageActionRequestedPeerSentMe>,
PrepareErrorText<MTPDmessageActionEmpty>)); PrepareErrorText<MTPDmessageActionEmpty>));

View file

@ -915,6 +915,8 @@ MediaCheckResult CheckMessageMedia(const MTPMessageMedia &media) {
[[nodiscard]] CallId CallIdFromInput(const MTPInputGroupCall &data) { [[nodiscard]] CallId CallIdFromInput(const MTPInputGroupCall &data) {
return data.match([&](const MTPDinputGroupCall &data) { return data.match([&](const MTPDinputGroupCall &data) {
return data.vid().v; return data.vid().v;
}, [](const MTPDinputGroupCallSlug &) -> CallId {
Unexpected("inputGroupCallSlug in CallIdFromInput.");
}); });
} }

View file

@ -187,6 +187,7 @@ messageActionStarGift#4717e8a4 flags:# name_hidden:flags.0?true saved:flags.2?tr
messageActionStarGiftUnique#acdfcb81 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long = MessageAction; messageActionStarGiftUnique#acdfcb81 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long = MessageAction;
messageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction; messageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction;
messageActionPaidMessagesPrice#bcd71419 stars:long = MessageAction; messageActionPaidMessagesPrice#bcd71419 stars:long = MessageAction;
messageActionConferenceCall#ff397dea flags:# missed:flags.0?true active:flags.1?true call_id:long slug:string duration:flags.2?int other_participants:flags.3?Vector<Peer> = MessageAction;
dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog; dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog;
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog; dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
@ -431,6 +432,7 @@ updateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update;
updateBotPurchasedPaidMedia#283bd312 user_id:long payload:string qts:int = Update; updateBotPurchasedPaidMedia#283bd312 user_id:long payload:string qts:int = Update;
updatePaidReactionPrivacy#8b725fce private:PaidReactionPrivacy = Update; updatePaidReactionPrivacy#8b725fce private:PaidReactionPrivacy = Update;
updateSentPhoneCode#504aa18f sent_code:auth.SentCode = Update; updateSentPhoneCode#504aa18f sent_code:auth.SentCode = Update;
updateGroupCallChainBlocks#a477288f call:InputGroupCall sub_chain_id:int blocks:Vector<bytes> next_offset:int = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@ -1340,11 +1342,12 @@ peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats; stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats;
groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall; groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;
groupCall#cdf8d3e3 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int conference_from_call:flags.14?long = GroupCall; groupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall; inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
inputGroupCallSlug#fe06823f slug:string = InputGroupCall;
groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant; groupCallParticipant#23860077 flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo public_key:flags.16?int256 = GroupCallParticipant;
phone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall; phone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;
@ -2582,7 +2585,7 @@ phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhon
phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool; phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;
phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool; phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool;
phone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates; phone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;
phone.joinGroupCall#d61e1df3 flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string key_fingerprint:flags.3?long params:DataJSON = Updates; phone.joinGroupCall#ffae43f4 flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string public_key:flags.3?int256 invite_msg_id:flags.4?int params:DataJSON = Updates;
phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates; phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;
phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector<InputUser> = Updates; phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector<InputUser> = Updates;
phone.discardGroupCall#7a777135 call:InputGroupCall = Updates; phone.discardGroupCall#7a777135 call:InputGroupCall = Updates;
@ -2603,7 +2606,13 @@ phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;
phone.getGroupCallStreamChannels#1ab21940 call:InputGroupCall = phone.GroupCallStreamChannels; phone.getGroupCallStreamChannels#1ab21940 call:InputGroupCall = phone.GroupCallStreamChannels;
phone.getGroupCallStreamRtmpUrl#deb3abbf peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl; phone.getGroupCallStreamRtmpUrl#deb3abbf peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl;
phone.saveCallLog#41248786 peer:InputPhoneCall file:InputFile = Bool; phone.saveCallLog#41248786 peer:InputPhoneCall file:InputFile = Bool;
phone.createConferenceCall#dfc909ab peer:InputPhoneCall key_fingerprint:long = phone.PhoneCall; phone.createConferenceCall#dae2632f public_key:int256 zero_block:bytes = phone.GroupCall;
phone.addConferenceCallParticipant#3cb2a504 call:InputGroupCall peer:InputPeer block:bytes = Updates;
phone.deleteConferenceCallParticipant#7b8cc2a3 call:InputGroupCall peer:InputPeer block:bytes = Updates;
phone.sendConferenceCallBroadcast#c6701900 call:InputGroupCall block:bytes = Updates;
phone.inviteConferenceCallParticipant#3e9cf7ee call:InputGroupCall user_id:InputUser = Updates;
phone.declineConferenceCallInvite#3c479971 msg_id:int = Updates;
phone.getGroupCallChainBlocks#ee9f88a6 call:InputGroupCall sub_chain_id:int offset:int limit:int = Updates;
langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference; langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;
langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>; langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;
@ -2679,4 +2688,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool;
fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo; fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;
// LAYER 201 // LAYER 202

View file

@ -172,6 +172,8 @@ StorageFileLocation::StorageFileLocation(
data.vcall().match([&](const MTPDinputGroupCall &data) { data.vcall().match([&](const MTPDinputGroupCall &data) {
_id = data.vid().v; _id = data.vid().v;
_accessHash = data.vaccess_hash().v; _accessHash = data.vaccess_hash().v;
}, [](const auto &data) {
Unexpected("inputGroupCallSlug in inputGroupCallStream.");
}); });
_volumeId = data.vtime_ms().v; _volumeId = data.vtime_ms().v;
_localId = data.vscale().v; _localId = data.vscale().v;

View file

@ -72,6 +72,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/toast/toast.h" #include "ui/toast/toast.h"
#include "calls/calls_instance.h" // Core::App().calls().inCall(). #include "calls/calls_instance.h" // Core::App().calls().inCall().
#include "calls/group/calls_group_call.h" #include "calls/group/calls_group_call.h"
#include "calls/group/calls_group_common.h"
#include "ui/boxes/calendar_box.h" #include "ui/boxes/calendar_box.h"
#include "ui/boxes/collectible_info_box.h" #include "ui/boxes/collectible_info_box.h"
#include "ui/boxes/confirm_box.h" #include "ui/boxes/confirm_box.h"
@ -816,10 +817,9 @@ void SessionNavigation::resolveCollectible(
Fn<void(QString)> fail) { Fn<void(QString)> fail) {
if (_collectibleEntity == entity) { if (_collectibleEntity == entity) {
return; return;
} else {
_api.request(base::take(_collectibleRequestId)).cancel();
} }
_collectibleEntity = entity; _collectibleEntity = entity;
_api.request(base::take(_collectibleRequestId)).cancel();
_collectibleRequestId = _api.request(MTPfragment_GetCollectibleInfo( _collectibleRequestId = _api.request(MTPfragment_GetCollectibleInfo(
((Ui::DetectCollectibleType(entity) == Ui::CollectibleType::Phone) ((Ui::DetectCollectibleType(entity) == Ui::CollectibleType::Phone)
? MTP_inputCollectiblePhone(MTP_string(entity)) ? MTP_inputCollectiblePhone(MTP_string(entity))
@ -840,6 +840,39 @@ void SessionNavigation::resolveCollectible(
}).send(); }).send();
} }
void SessionNavigation::resolveConferenceCall(const QString &slug) {
if (_conferenceCallSlug == slug) {
return;
}
_api.request(base::take(_conferenceCallRequestId)).cancel();
_conferenceCallSlug = slug;
const auto limit = 5;
_conferenceCallRequestId = _api.request(MTPphone_GetGroupCall(
MTP_inputGroupCallSlug(MTP_string(slug)),
MTP_int(limit)
)).done([=](const MTPphone_GroupCall &result) {
_conferenceCallRequestId = 0;
_conferenceCallSlug = QString();
result.data().vcall().match([&](const auto &data) {
const auto call = std::make_shared<Data::GroupCall>(
session().user(),
data.vid().v,
data.vaccess_hash().v,
TimeId(), // scheduleDate
false); // rtmp
call->processFullCall(result);
uiShow()->show(
Box(Calls::Group::ConferenceCallJoinConfirm, call));
});
}).fail([=] {
_conferenceCallRequestId = 0;
_conferenceCallSlug = QString();
showToast(tr::lng_group_invite_bad_link(tr::now));
}).send();
}
void SessionNavigation::applyBoost( void SessionNavigation::applyBoost(
not_null<ChannelData*> channel, not_null<ChannelData*> channel,
Fn<void(Ui::BoostCounters)> done) { Fn<void(Ui::BoostCounters)> done) {

View file

@ -264,6 +264,7 @@ public:
PeerId ownerId, PeerId ownerId,
const QString &entity, const QString &entity,
Fn<void(QString)> fail = nullptr); Fn<void(QString)> fail = nullptr);
void resolveConferenceCall(const QString &slug);
base::weak_ptr<Ui::Toast::Instance> showToast( base::weak_ptr<Ui::Toast::Instance> showToast(
Ui::Toast::Config &&config); Ui::Toast::Config &&config);
@ -329,6 +330,9 @@ private:
QString _collectibleEntity; QString _collectibleEntity;
mtpRequestId _collectibleRequestId = 0; mtpRequestId _collectibleRequestId = 0;
QString _conferenceCallSlug;
mtpRequestId _conferenceCallRequestId = 0;
}; };
class SessionController : public SessionNavigation { class SessionController : public SessionNavigation {