mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Update API scheme.
This commit is contained in:
parent
31417fd005
commit
d16bc36bae
6 changed files with 28 additions and 46 deletions
|
@ -63,7 +63,7 @@ inputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMe
|
||||||
inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
|
inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
|
||||||
inputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;
|
inputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;
|
||||||
inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
|
inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
|
||||||
inputMediaDocument#23ab23d2 flags:# id:InputDocument ttl_seconds:flags.0?int = InputMedia;
|
inputMediaDocument#33473058 flags:# id:InputDocument ttl_seconds:flags.0?int query:flags.1?string = InputMedia;
|
||||||
inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;
|
inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;
|
||||||
inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;
|
inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;
|
||||||
inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;
|
inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;
|
||||||
|
@ -1195,7 +1195,7 @@ groupCall#55903081 flags:# join_muted:flags.1?true can_change_join_muted:flags.2
|
||||||
|
|
||||||
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
|
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
|
||||||
|
|
||||||
groupCallParticipant#56b087c9 flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true user_id:int date:int active_date:flags.3?int source:int = GroupCallParticipant;
|
groupCallParticipant#56b087c9 flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true user_id:int date:int active_date:flags.3?int source:int = GroupCallParticipant;
|
||||||
|
|
||||||
phone.groupCall#66ab0bfc call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string users:Vector<User> = phone.GroupCall;
|
phone.groupCall#66ab0bfc call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string users:Vector<User> = phone.GroupCall;
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,8 @@ void SendExistingDocument(
|
||||||
return MTP_inputMediaDocument(
|
return MTP_inputMediaDocument(
|
||||||
MTP_flags(0),
|
MTP_flags(0),
|
||||||
document->mtpInput(),
|
document->mtpInput(),
|
||||||
MTPint());
|
MTPint(), // ttl_seconds
|
||||||
|
MTPstring()); // query
|
||||||
};
|
};
|
||||||
SendExistingMedia(
|
SendExistingMedia(
|
||||||
std::move(message),
|
std::move(message),
|
||||||
|
|
|
@ -4645,7 +4645,8 @@ void ApiWrap::uploadAlbumMedia(
|
||||||
fields.vid(),
|
fields.vid(),
|
||||||
fields.vaccess_hash(),
|
fields.vaccess_hash(),
|
||||||
fields.vfile_reference()),
|
fields.vfile_reference()),
|
||||||
MTP_int(data.vttl_seconds().value_or_empty()));
|
MTP_int(data.vttl_seconds().value_or_empty()),
|
||||||
|
MTPstring()); // query
|
||||||
sendAlbumWithUploaded(item, groupId, media);
|
sendAlbumWithUploaded(item, groupId, media);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,36 +312,6 @@ void GroupCall::applyParticipantsSlice(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupCall::applyParticipantsMutes(
|
|
||||||
const MTPDupdateGroupCallParticipants &update) {
|
|
||||||
for (const auto &participant : update.vparticipants().v) {
|
|
||||||
participant.match([&](const MTPDgroupCallParticipant &data) {
|
|
||||||
if (data.is_left()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const auto userId = data.vuser_id().v;
|
|
||||||
const auto user = _peer->owner().user(userId);
|
|
||||||
const auto i = ranges::find(
|
|
||||||
_participants,
|
|
||||||
user,
|
|
||||||
&Participant::user);
|
|
||||||
if (i != end(_participants)) {
|
|
||||||
const auto was = *i;
|
|
||||||
i->muted = data.is_muted();
|
|
||||||
i->canSelfUnmute = !i->muted || data.is_can_self_unmute();
|
|
||||||
if (!i->canSelfUnmute) {
|
|
||||||
i->speaking = false;
|
|
||||||
_speakingByActiveFinishes.remove(i->user);
|
|
||||||
}
|
|
||||||
_participantUpdates.fire({
|
|
||||||
.was = was,
|
|
||||||
.now = *i,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupCall::applyLastSpoke(
|
void GroupCall::applyLastSpoke(
|
||||||
uint32 ssrc,
|
uint32 ssrc,
|
||||||
LastSpokeTimes when,
|
LastSpokeTimes when,
|
||||||
|
@ -563,17 +533,29 @@ bool GroupCall::inCall() const {
|
||||||
|
|
||||||
void GroupCall::applyUpdate(const MTPDupdateGroupCallParticipants &update) {
|
void GroupCall::applyUpdate(const MTPDupdateGroupCallParticipants &update) {
|
||||||
const auto version = update.vversion().v;
|
const auto version = update.vversion().v;
|
||||||
if (version < _version) {
|
const auto applyUpdate = [&] {
|
||||||
return;
|
if (version < _version) {
|
||||||
} else if (version == _version) {
|
return false;
|
||||||
applyParticipantsMutes(update);
|
}
|
||||||
return;
|
auto versionShouldIncrement = false;
|
||||||
} else if (version != _version + 1) {
|
for (const auto &participant : update.vparticipants().v) {
|
||||||
applyParticipantsMutes(update);
|
const auto versioned = participant.match([&](
|
||||||
reload();
|
const MTPDgroupCallParticipant &data) {
|
||||||
|
return data.is_versioned();
|
||||||
|
});
|
||||||
|
if (versioned) {
|
||||||
|
versionShouldIncrement = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return versionShouldIncrement
|
||||||
|
? (version == _version + 1)
|
||||||
|
: (version == _version);
|
||||||
|
}();
|
||||||
|
if (!applyUpdate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_version = update.vversion().v;
|
_version = version;
|
||||||
applyUpdateChecked(update);
|
applyUpdateChecked(update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,8 +91,6 @@ private:
|
||||||
void applyParticipantsSlice(
|
void applyParticipantsSlice(
|
||||||
const QVector<MTPGroupCallParticipant> &list,
|
const QVector<MTPGroupCallParticipant> &list,
|
||||||
ApplySliceSource sliceSource);
|
ApplySliceSource sliceSource);
|
||||||
void applyParticipantsMutes(
|
|
||||||
const MTPDupdateGroupCallParticipants &update);
|
|
||||||
void requestUnknownParticipants();
|
void requestUnknownParticipants();
|
||||||
void changePeerEmptyCallFlag();
|
void changePeerEmptyCallFlag();
|
||||||
void checkFinishSpeakingByActive();
|
void checkFinishSpeakingByActive();
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit beb63dd9a68662cf96c4b3b165bad3907323ea89
|
Subproject commit 4bc51d6f6d5740159fdb51cb1593e80ce149ed4e
|
Loading…
Add table
Reference in a new issue