2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Add call top bar above the media player.

This commit is contained in:
John Preston
2017-04-25 23:36:04 +03:00
parent 60ac7572af
commit f6eb2c5205
17 changed files with 413 additions and 30 deletions

View File

@@ -37,22 +37,25 @@ void Instance::startOutgoingCall(gsl::not_null<UserData*> user) {
}
void Instance::callFinished(gsl::not_null<Call*> call) {
if (_currentCall.get() == call) {
_currentCallPanel.reset();
_currentCall.reset();
}
destroyCall(call);
}
void Instance::callFailed(gsl::not_null<Call*> call) {
destroyCall(call);
}
void Instance::destroyCall(gsl::not_null<Call*> call) {
if (_currentCall.get() == call) {
_currentCallPanel.reset();
_currentCall.reset();
_currentCallChanged.notify(nullptr, true);
}
}
void Instance::createCall(gsl::not_null<UserData*> user, Call::Type type) {
_currentCall = std::make_unique<Call>(getCallDelegate(), user, type);
_currentCallPanel = std::make_unique<Panel>(_currentCall.get());
_currentCallChanged.notify(_currentCall.get(), true);
refreshDhConfig();
}
@@ -108,6 +111,12 @@ void Instance::handleUpdate(const MTPDupdatePhoneCall& update) {
handleCallUpdate(update.vphone_call);
}
void Instance::showInfoPanel(gsl::not_null<Call*> call) {
if (_currentCall.get() == call) {
_currentCallPanel->showAndActivate();
}
}
void Instance::handleCallUpdate(const MTPPhoneCall &call) {
if (call.type() == mtpc_phoneCallRequested) {
auto &phoneCall = call.c_phoneCallRequested();