Update API scheme.

This commit is contained in:
John Preston 2020-11-26 14:04:00 +03:00
parent 0537d4c199
commit 858ee0e8c4
5 changed files with 18 additions and 14 deletions

View File

@ -1185,15 +1185,15 @@ peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
stats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats; stats.messageStats#8999f295 views_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#55903081 flags:# id:long access_hash:long participants_count:int params:flags.0?DataJSON version:int = GroupCall; groupCall#55903081 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true id:long access_hash:long participants_count:int params:flags.0?DataJSON version:int = GroupCall;
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall; inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
groupCallParticipant#89a0d26c flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true user_id:int date:int source:int = GroupCallParticipant; groupCallParticipant#56b087c9 flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true user_id:int date:int active_date:flags.3?int source:int = GroupCallParticipant;
phone.groupCall#564c9fd8 call:GroupCall sources:Vector<int> participants:Vector<GroupCallParticipant> users:Vector<User> = phone.GroupCall; phone.groupCall#985c2087 call:GroupCall sources:Vector<int> participants:Vector<GroupCallParticipant> participants_next_offset:string users:Vector<User> = phone.GroupCall;
phone.groupParticipants#3cdb7991 count:int participants:Vector<GroupCallParticipant> users:Vector<User> version:int = phone.GroupParticipants; phone.groupParticipants#9cfeb92d count:int participants:Vector<GroupCallParticipant> next_offset:string users:Vector<User> version:int = phone.GroupParticipants;
---functions--- ---functions---
@ -1551,12 +1551,13 @@ 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#e428fa02 channel:InputChannel random_id:int = Updates; phone.createGroupCall#e428fa02 channel:InputChannel random_id:int = Updates;
phone.joinGroupCall#5f9c8e62 flags:# muted:flags.0?true call:InputGroupCall params:DataJSON = Updates; phone.joinGroupCall#5f9c8e62 flags:# muted:flags.0?true call:InputGroupCall params:DataJSON = Updates;
phone.leaveGroupCall#60e98e5f call:InputGroupCall = Updates; phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;
phone.editGroupCallMember#63146ae4 flags:# muted:flags.0?true call:InputGroupCall user_id:InputUser = Updates; phone.editGroupCallMember#63146ae4 flags:# muted:flags.0?true call:InputGroupCall user_id:InputUser = 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;
phone.toggleGroupCallSettings#74bbb43d flags:# call:InputGroupCall join_muted:flags.0?Bool = Updates;
phone.getGroupCall#c7cb017 call:InputGroupCall = phone.GroupCall; phone.getGroupCall#c7cb017 call:InputGroupCall = phone.GroupCall;
phone.getGroupParticipants#de41d3b2 call:InputGroupCall max_date:int limit:int = phone.GroupParticipants; phone.getGroupParticipants#ae1910a4 call:InputGroupCall offset:string limit:int = phone.GroupParticipants;
phone.checkGroupCall#b74a7bea call:InputGroupCall source:int = Bool; phone.checkGroupCall#b74a7bea call:InputGroupCall source:int = Bool;
langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference; langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;

View File

@ -205,14 +205,15 @@ void GroupCall::finish(FinishType type) {
|| state == State::Failed) { || state == State::Failed) {
return; return;
} }
if (!joined()) { if (!_mySsrc) {
setState(finalState); setState(finalState);
return; return;
} }
setState(hangupState); setState(hangupState);
_api.request(MTPphone_LeaveGroupCall( _api.request(MTPphone_LeaveGroupCall(
inputCall() inputCall(),
MTP_int(_mySsrc)
)).done([=](const MTPUpdates &result) { )).done([=](const MTPUpdates &result) {
// Here 'this' could be destroyed by updates, so we set Ended after // Here 'this' could be destroyed by updates, so we set Ended after
// updates being handled, but in a guarded way. // updates being handled, but in a guarded way.

View File

@ -369,9 +369,9 @@ int GroupMembers::desiredHeight() const {
} }
return 0; return 0;
}(); }();
desired += qMax(count, _list->fullRowsCount()) desired += std::max(count, _list->fullRowsCount())
* st::groupCallMembersList.item.height; * st::groupCallMembersList.item.height;
return qMax(height(), desired); return std::max(height(), desired);
} }
void GroupMembers::setupHeader(not_null<GroupCall*> call) { void GroupMembers::setupHeader(not_null<GroupCall*> call) {

View File

@ -60,17 +60,18 @@ void GroupCall::requestParticipants() {
return; return;
} else if (_participants.size() >= _fullCount && _allReceived) { } else if (_participants.size() >= _fullCount && _allReceived) {
return; return;
} else if (_allReceived) {
reload();
return;
} }
const auto requestFromDate = (_allReceived || _participants.empty())
? TimeId(0)
: _participants.back().date;
auto &api = _channel->session().api(); auto &api = _channel->session().api();
_participantsRequestId = api.request(MTPphone_GetGroupParticipants( _participantsRequestId = api.request(MTPphone_GetGroupParticipants(
input(), input(),
MTP_int(requestFromDate), MTP_string(_nextOffset),
MTP_int(kRequestPerPage) MTP_int(kRequestPerPage)
)).done([=](const MTPphone_GroupParticipants &result) { )).done([=](const MTPphone_GroupParticipants &result) {
result.match([&](const MTPDphone_groupParticipants &data) { result.match([&](const MTPDphone_groupParticipants &data) {
_nextOffset = qs(data.vnext_offset());
_channel->owner().processUsers(data.vusers()); _channel->owner().processUsers(data.vusers());
applyParticipantsSlice(data.vparticipants().v); applyParticipantsSlice(data.vparticipants().v);
_fullCount = data.vcount().v; _fullCount = data.vcount().v;

View File

@ -58,6 +58,7 @@ private:
std::vector<Participant> _participants; std::vector<Participant> _participants;
base::flat_set<uint32> _sources; base::flat_set<uint32> _sources;
QString _nextOffset;
int _fullCount = 0; int _fullCount = 0;
int _duration = 0; int _duration = 0;
bool _finished = false; bool _finished = false;