2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Use 48 bit [User/Chat/Channel]Id, 56 bit PeerId.

This commit is contained in:
John Preston
2021-04-02 01:04:10 +04:00
parent 61d0cc38b0
commit 1342077dcb
83 changed files with 904 additions and 475 deletions

View File

@@ -490,13 +490,13 @@ bool Call::handleUpdate(const MTPPhoneCall &call) {
auto &data = call.c_phoneCallRequested();
if (_type != Type::Incoming
|| _id != 0
|| peerToUser(_user->id) != data.vadmin_id().v) {
|| peerToUser(_user->id) != UserId(data.vadmin_id())) {
Unexpected("phoneCallRequested call inside an existing call handleUpdate()");
}
if (_user->session().userId() != data.vparticipant_id().v) {
if (_user->session().userId() != UserId(data.vparticipant_id())) {
LOG(("Call Error: Wrong call participant_id %1, expected %2."
).arg(data.vparticipant_id().v
).arg(_user->session().userId()));
).arg(_user->session().userId().bare));
finish(FinishType::Failed);
return true;
}
@@ -891,12 +891,12 @@ bool Call::checkCallCommonFields(const T &call) {
}
auto adminId = (_type == Type::Outgoing) ? _user->session().userId() : peerToUser(_user->id);
auto participantId = (_type == Type::Outgoing) ? peerToUser(_user->id) : _user->session().userId();
if (call.vadmin_id().v != adminId) {
LOG(("Call Error: Wrong call admin_id %1, expected %2.").arg(call.vadmin_id().v).arg(adminId));
if (UserId(call.vadmin_id()) != adminId) {
LOG(("Call Error: Wrong call admin_id %1, expected %2.").arg(call.vadmin_id().v).arg(adminId.bare));
return checkFailed();
}
if (call.vparticipant_id().v != participantId) {
LOG(("Call Error: Wrong call participant_id %1, expected %2.").arg(call.vparticipant_id().v).arg(participantId));
if (UserId(call.vparticipant_id()) != participantId) {
LOG(("Call Error: Wrong call participant_id %1, expected %2.").arg(call.vparticipant_id().v).arg(participantId.bare));
return checkFailed();
}
return true;