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

Show privacy / incompatibility errors in calls.

This commit is contained in:
John Preston
2017-04-29 19:25:33 +03:00
parent a3252c13d7
commit d5ff728da6
4 changed files with 52 additions and 7 deletions

View File

@@ -22,6 +22,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "mtproto/connection.h"
#include "auth_session.h"
#include "apiwrap.h"
#include "lang.h"
#include "boxes/confirm_box.h"
#include "calls/calls_call.h"
#include "calls/calls_panel.h"
@@ -39,6 +42,12 @@ void Instance::startOutgoingCall(gsl::not_null<UserData*> user) {
_currentCallPanel->showAndActivate();
return; // Already in a call.
}
if (user->callsStatus() == UserData::CallsStatus::Private) {
// Request full user once more to refresh the setting in case it was changed.
AuthSession::Current().api().requestFullPeer(user);
Ui::show(Box<InformBox>(lng_call_error_not_available(lt_user, App::peerName(user))));
return;
}
createCall(user, Call::Type::Outgoing);
}