mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Moved type of call id to alias.
This commit is contained in:
parent
08939ac51d
commit
70e9b4a332
11 changed files with 32 additions and 31 deletions
|
@ -535,7 +535,7 @@ void Instance::handleGroupCallUpdate(
|
|||
return data.vcall().match([&](const MTPDinputGroupCall &data) {
|
||||
return data.vid().v;
|
||||
});
|
||||
}, [](const auto &) -> uint64 {
|
||||
}, [](const auto &) -> CallId {
|
||||
Unexpected("Type in Instance::handleGroupCallUpdate.");
|
||||
});
|
||||
if (const auto existing = session->data().groupCall(callId)) {
|
||||
|
|
|
@ -62,7 +62,7 @@ constexpr auto kMaxMediumQualities = 16; // 4 Fulls or 16 Mediums.
|
|||
|
||||
[[nodiscard]] const Data::GroupCallParticipant *LookupParticipant(
|
||||
not_null<PeerData*> peer,
|
||||
uint64 id,
|
||||
CallId id,
|
||||
not_null<PeerData*> participantPeer) {
|
||||
const auto call = peer->groupCall();
|
||||
return (id && call && call->id() == id)
|
||||
|
|
|
@ -213,7 +213,7 @@ public:
|
|||
const MTPInputGroupCall &inputCall);
|
||||
~GroupCall();
|
||||
|
||||
[[nodiscard]] uint64 id() const {
|
||||
[[nodiscard]] CallId id() const {
|
||||
return _id;
|
||||
}
|
||||
[[nodiscard]] not_null<PeerData*> peer() const {
|
||||
|
@ -587,8 +587,8 @@ private:
|
|||
rpl::event_stream<Group::ParticipantState> _otherParticipantStateValue;
|
||||
std::vector<MTPGroupCallParticipant> _queuedSelfUpdates;
|
||||
|
||||
uint64 _id = 0;
|
||||
uint64 _accessHash = 0;
|
||||
CallId _id = 0;
|
||||
CallId _accessHash = 0;
|
||||
JoinState _joinState;
|
||||
JoinState _screenJoinState;
|
||||
std::string _cameraEndpoint;
|
||||
|
|
|
@ -64,7 +64,7 @@ constexpr auto kCheckAccessibilityInterval = crl::time(500);
|
|||
|
||||
void SaveCallJoinMuted(
|
||||
not_null<PeerData*> peer,
|
||||
uint64 callId,
|
||||
CallId callId,
|
||||
bool joinMuted) {
|
||||
const auto call = peer->groupCall();
|
||||
if (!call
|
||||
|
|
|
@ -53,8 +53,8 @@ bool GroupCallParticipant::screenPaused() const {
|
|||
|
||||
GroupCall::GroupCall(
|
||||
not_null<PeerData*> peer,
|
||||
uint64 id,
|
||||
uint64 accessHash,
|
||||
CallId id,
|
||||
CallId accessHash,
|
||||
TimeId scheduleDate)
|
||||
: _id(id)
|
||||
, _accessHash(accessHash)
|
||||
|
@ -70,7 +70,7 @@ GroupCall::~GroupCall() {
|
|||
api().request(_reloadRequestId).cancel();
|
||||
}
|
||||
|
||||
uint64 GroupCall::id() const {
|
||||
CallId GroupCall::id() const {
|
||||
return _id;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,12 +53,12 @@ class GroupCall final {
|
|||
public:
|
||||
GroupCall(
|
||||
not_null<PeerData*> peer,
|
||||
uint64 id,
|
||||
uint64 accessHash,
|
||||
CallId id,
|
||||
CallId accessHash,
|
||||
TimeId scheduleDate);
|
||||
~GroupCall();
|
||||
|
||||
[[nodiscard]] uint64 id() const;
|
||||
[[nodiscard]] CallId id() const;
|
||||
[[nodiscard]] bool loaded() const;
|
||||
[[nodiscard]] not_null<PeerData*> peer() const;
|
||||
[[nodiscard]] MTPInputGroupCall input() const;
|
||||
|
@ -194,8 +194,8 @@ private:
|
|||
void finishParticipantsSliceRequest();
|
||||
[[nodiscard]] Participant *findParticipant(not_null<PeerData*> peer);
|
||||
|
||||
const uint64 _id = 0;
|
||||
const uint64 _accessHash = 0;
|
||||
const CallId _id = 0;
|
||||
const CallId _accessHash = 0;
|
||||
|
||||
not_null<PeerData*> _peer;
|
||||
int _version = 0;
|
||||
|
|
|
@ -871,12 +871,12 @@ void Session::unregisterGroupCall(not_null<GroupCall*> call) {
|
|||
_groupCalls.remove(call->id());
|
||||
}
|
||||
|
||||
GroupCall *Session::groupCall(uint64 callId) const {
|
||||
GroupCall *Session::groupCall(CallId callId) const {
|
||||
const auto i = _groupCalls.find(callId);
|
||||
return (i != end(_groupCalls)) ? i->second.get() : nullptr;
|
||||
}
|
||||
|
||||
auto Session::invitedToCallUsers(uint64 callId) const
|
||||
auto Session::invitedToCallUsers(CallId callId) const
|
||||
-> const base::flat_set<not_null<UserData*>> & {
|
||||
static const base::flat_set<not_null<UserData*>> kEmpty;
|
||||
const auto i = _invitedToCallUsers.find(callId);
|
||||
|
@ -884,7 +884,7 @@ auto Session::invitedToCallUsers(uint64 callId) const
|
|||
}
|
||||
|
||||
void Session::registerInvitedToCallUser(
|
||||
uint64 callId,
|
||||
CallId callId,
|
||||
not_null<PeerData*> peer,
|
||||
not_null<UserData*> user) {
|
||||
const auto call = peer->groupCall();
|
||||
|
@ -902,7 +902,7 @@ void Session::registerInvitedToCallUser(
|
|||
}
|
||||
|
||||
void Session::unregisterInvitedToCallUser(
|
||||
uint64 callId,
|
||||
CallId callId,
|
||||
not_null<UserData*> user) {
|
||||
const auto i = _invitedToCallUsers.find(callId);
|
||||
if (i != _invitedToCallUsers.end()) {
|
||||
|
|
|
@ -164,18 +164,18 @@ public:
|
|||
|
||||
void registerGroupCall(not_null<GroupCall*> call);
|
||||
void unregisterGroupCall(not_null<GroupCall*> call);
|
||||
GroupCall *groupCall(uint64 callId) const;
|
||||
GroupCall *groupCall(CallId callId) const;
|
||||
|
||||
[[nodiscard]] auto invitedToCallUsers(uint64 callId) const
|
||||
[[nodiscard]] auto invitedToCallUsers(CallId callId) const
|
||||
-> const base::flat_set<not_null<UserData*>> &;
|
||||
void registerInvitedToCallUser(
|
||||
uint64 callId,
|
||||
CallId callId,
|
||||
not_null<PeerData*> peer,
|
||||
not_null<UserData*> user);
|
||||
void unregisterInvitedToCallUser(uint64 callId, not_null<UserData*> user);
|
||||
void unregisterInvitedToCallUser(CallId callId, not_null<UserData*> user);
|
||||
|
||||
struct InviteToCall {
|
||||
uint64 id = 0;
|
||||
CallId id = 0;
|
||||
not_null<UserData*> user;
|
||||
};
|
||||
[[nodiscard]] rpl::producer<InviteToCall> invitesToCalls() const {
|
||||
|
|
|
@ -127,6 +127,7 @@ using WebPageId = uint64;
|
|||
using GameId = uint64;
|
||||
using PollId = uint64;
|
||||
using WallPaperId = uint64;
|
||||
using CallId = uint64;
|
||||
constexpr auto CancelledWebPageId = WebPageId(0xFFFFFFFFFFFFFFFFULL);
|
||||
|
||||
struct PreparedPhotoThumb {
|
||||
|
|
|
@ -58,7 +58,7 @@ using ItemPreview = HistoryView::ItemPreview;
|
|||
|
||||
[[nodiscard]] rpl::producer<bool> PeerHasThisCallValue(
|
||||
not_null<PeerData*> peer,
|
||||
uint64 id) {
|
||||
CallId id) {
|
||||
return peer->session().changes().peerFlagsValue(
|
||||
peer,
|
||||
Data::PeerUpdate::Flag::GroupCall
|
||||
|
@ -75,7 +75,7 @@ using ItemPreview = HistoryView::ItemPreview;
|
|||
);
|
||||
}
|
||||
|
||||
[[nodiscard]] uint64 CallIdFromInput(const MTPInputGroupCall &data) {
|
||||
[[nodiscard]] CallId CallIdFromInput(const MTPInputGroupCall &data) {
|
||||
return data.match([&](const MTPDinputGroupCall &data) {
|
||||
return data.vid().v;
|
||||
});
|
||||
|
@ -83,7 +83,7 @@ using ItemPreview = HistoryView::ItemPreview;
|
|||
|
||||
[[nodiscard]] ClickHandlerPtr GroupCallClickHandler(
|
||||
not_null<PeerData*> peer,
|
||||
uint64 callId) {
|
||||
CallId callId) {
|
||||
return std::make_shared<LambdaClickHandler>([=] {
|
||||
const auto call = peer->groupCall();
|
||||
if (call && call->id() == callId) {
|
||||
|
@ -623,7 +623,7 @@ bool HistoryService::updateDependent(bool force) {
|
|||
|
||||
HistoryService::PreparedText HistoryService::prepareInvitedToCallText(
|
||||
const QVector<MTPlong> &users,
|
||||
uint64 linkCallId) {
|
||||
CallId linkCallId) {
|
||||
const auto owner = &history()->owner();
|
||||
auto chatText = tr::lng_action_invite_user_chat(tr::now);
|
||||
auto result = PreparedText{};
|
||||
|
@ -1265,7 +1265,7 @@ not_null<HistoryService*> GenerateJoinedMessage(
|
|||
|
||||
std::optional<bool> PeerHasThisCall(
|
||||
not_null<PeerData*> peer,
|
||||
uint64 id) {
|
||||
CallId id) {
|
||||
const auto call = peer->groupCall();
|
||||
return call
|
||||
? std::make_optional(call->id() == id)
|
||||
|
|
|
@ -51,7 +51,7 @@ struct HistoryServiceSelfDestruct
|
|||
|
||||
struct HistoryServiceOngoingCall
|
||||
: public RuntimeComponent<HistoryServiceOngoingCall, HistoryItem> {
|
||||
uint64 id = 0;
|
||||
CallId id = 0;
|
||||
ClickHandlerPtr link;
|
||||
rpl::lifetime lifetime;
|
||||
};
|
||||
|
@ -164,7 +164,7 @@ private:
|
|||
PreparedText preparePaymentSentText();
|
||||
PreparedText prepareInvitedToCallText(
|
||||
const QVector<MTPlong> &users,
|
||||
uint64 linkCallId);
|
||||
CallId linkCallId);
|
||||
PreparedText prepareCallScheduledText(
|
||||
TimeId scheduleDate);
|
||||
|
||||
|
@ -178,4 +178,4 @@ private:
|
|||
not_null<UserData*> inviter);
|
||||
[[nodiscard]] std::optional<bool> PeerHasThisCall(
|
||||
not_null<PeerData*> peer,
|
||||
uint64 id);
|
||||
CallId id);
|
||||
|
|
Loading…
Add table
Reference in a new issue