mirror of https://github.com/procxx/kepka.git
Fix passport for Xcode and macOS.
Also use different bundle id for debug builds.
This commit is contained in:
parent
ead31757d7
commit
8969a7d929
|
@ -22,6 +22,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
constexpr auto kEmptyPidForCommandResponse = 0ULL;
|
||||||
|
|
||||||
QChar _toHex(ushort v) {
|
QChar _toHex(ushort v) {
|
||||||
v = v & 0x000F;
|
v = v & 0x000F;
|
||||||
return QChar::fromLatin1((v >= 10) ? ('a' + (v - 10)) : ('0' + v));
|
return QChar::fromLatin1((v >= 10) ? ('a' + (v - 10)) : ('0' + v));
|
||||||
|
@ -62,6 +64,26 @@ QString _escapeFrom7bit(const QString &str) {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
bool StartUrlRequiresActivate(const QString &url) {
|
||||||
|
const auto urlTrimmed = url.trimmed();
|
||||||
|
if (!urlTrimmed.startsWith(qstr("tg://"), Qt::CaseInsensitive) || App::passcoded()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const auto command = urlTrimmed.midRef(qstr("tg://").size());
|
||||||
|
|
||||||
|
using namespace qthelp;
|
||||||
|
const auto matchOptions = RegExOption::CaseInsensitive;
|
||||||
|
const auto authMatch = regex_match(
|
||||||
|
qsl("^passport/?\\?(.+)(#|$)"),
|
||||||
|
command,
|
||||||
|
matchOptions);
|
||||||
|
const auto authLegacyMatch = regex_match(
|
||||||
|
qsl("^resolve/?\\?domain=telegrampassport&(.+)(#|$)"),
|
||||||
|
command,
|
||||||
|
matchOptions);
|
||||||
|
return !authMatch->hasMatch() && !authLegacyMatch->hasMatch();
|
||||||
|
}
|
||||||
|
|
||||||
Application::Application(
|
Application::Application(
|
||||||
not_null<Core::Launcher*> launcher,
|
not_null<Core::Launcher*> launcher,
|
||||||
int &argc,
|
int &argc,
|
||||||
|
|
|
@ -12,6 +12,8 @@ class Launcher;
|
||||||
class UpdateChecker;
|
class UpdateChecker;
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|
||||||
|
bool StartUrlRequiresActivate(const QString &url);
|
||||||
|
|
||||||
class Application : public QApplication {
|
class Application : public QApplication {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
|
@ -274,7 +274,9 @@ bool Messenger::eventFilter(QObject *object, QEvent *e) {
|
||||||
cSetStartUrl(url.mid(0, 8192));
|
cSetStartUrl(url.mid(0, 8192));
|
||||||
checkStartUrl();
|
checkStartUrl();
|
||||||
}
|
}
|
||||||
_window->activate();
|
if (StartUrlRequiresActivate(url)) {
|
||||||
|
_window->activate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,11 +287,13 @@ void Panel::showInner(base::unique_qptr<Ui::RpWidget> inner) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Panel::focusInEvent(QFocusEvent *e) {
|
void Panel::focusInEvent(QFocusEvent *e) {
|
||||||
if (_layer) {
|
crl::on_main(this, [=] {
|
||||||
_layer->setInnerFocus();
|
if (_layer) {
|
||||||
} else if (!_inner->isHidden()) {
|
_layer->setInnerFocus();
|
||||||
_inner->setFocus();
|
} else if (!_inner->isHidden()) {
|
||||||
}
|
_inner->setFocus();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Panel::initGeometry() {
|
void Panel::initGeometry() {
|
||||||
|
|
|
@ -92,8 +92,6 @@ private:
|
||||||
QPoint _dragStartMousePosition;
|
QPoint _dragStartMousePosition;
|
||||||
QPoint _dragStartMyPosition;
|
QPoint _dragStartMyPosition;
|
||||||
|
|
||||||
int _stateChangedSubscription = 0;
|
|
||||||
|
|
||||||
Animation _titleLeft;
|
Animation _titleLeft;
|
||||||
bool _visible = false;
|
bool _visible = false;
|
||||||
|
|
||||||
|
|
|
@ -663,7 +663,7 @@ void PanelController::editScope(int index, int documentIndex) {
|
||||||
return object_ptr<PanelEditContact>(
|
return object_ptr<PanelEditContact>(
|
||||||
_panel.get(),
|
_panel.get(),
|
||||||
this,
|
this,
|
||||||
std::move(GetContactScheme(_editScope->type)),
|
GetContactScheme(_editScope->type),
|
||||||
(valueIt == end(parsed.fields)
|
(valueIt == end(parsed.fields)
|
||||||
? QString()
|
? QString()
|
||||||
: valueIt->second),
|
: valueIt->second),
|
||||||
|
@ -862,4 +862,6 @@ rpl::lifetime &PanelController::lifetime() {
|
||||||
return _lifetime;
|
return _lifetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PanelController::~PanelController() = default;
|
||||||
|
|
||||||
} // namespace Passport
|
} // namespace Passport
|
||||||
|
|
|
@ -94,6 +94,8 @@ public:
|
||||||
|
|
||||||
rpl::lifetime &lifetime();
|
rpl::lifetime &lifetime();
|
||||||
|
|
||||||
|
~PanelController();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ensurePanelCreated();
|
void ensurePanelCreated();
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,9 @@ void PanelEditContact::setupControls(
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelEditContact::focusInEvent(QFocusEvent *e) {
|
void PanelEditContact::focusInEvent(QFocusEvent *e) {
|
||||||
_field->setFocusFast();
|
crl::on_main(this, [=] {
|
||||||
|
_field->setFocusFast();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelEditContact::resizeEvent(QResizeEvent *e) {
|
void PanelEditContact::resizeEvent(QResizeEvent *e) {
|
||||||
|
|
|
@ -256,11 +256,13 @@ not_null<Ui::RpWidget*> PanelEditDocument::setupContent(
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelEditDocument::focusInEvent(QFocusEvent *e) {
|
void PanelEditDocument::focusInEvent(QFocusEvent *e) {
|
||||||
for (const auto [index, row] : _details) {
|
crl::on_main(this, [=] {
|
||||||
if (row->setFocusFast()) {
|
for (const auto [index, row] : _details) {
|
||||||
return;
|
if (row->setFocusFast()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelEditDocument::resizeEvent(QResizeEvent *e) {
|
void PanelEditDocument::resizeEvent(QResizeEvent *e) {
|
||||||
|
|
|
@ -89,16 +89,14 @@ void PanelAskPassword::submit() {
|
||||||
_controller->submitPassword(_password->getLastText());
|
_controller->submitPassword(_password->getLastText());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelAskPassword::setInnerFocus() {
|
|
||||||
_password->setFocusFast();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PanelAskPassword::resizeEvent(QResizeEvent *e) {
|
void PanelAskPassword::resizeEvent(QResizeEvent *e) {
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelAskPassword::focusInEvent(QFocusEvent *e) {
|
void PanelAskPassword::focusInEvent(QFocusEvent *e) {
|
||||||
_password->setFocusFast();
|
crl::on_main(this, [=] {
|
||||||
|
_password->setFocusFast();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelAskPassword::updateControlsGeometry() {
|
void PanelAskPassword::updateControlsGeometry() {
|
||||||
|
|
|
@ -27,7 +27,6 @@ public:
|
||||||
QWidget *parent,
|
QWidget *parent,
|
||||||
not_null<PanelController*> controller);
|
not_null<PanelController*> controller);
|
||||||
|
|
||||||
void setInnerFocus();
|
|
||||||
void submit();
|
void submit();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
],
|
],
|
||||||
}], [ 'build_macold', {
|
}], [ 'build_macold', {
|
||||||
'xcode_settings': {
|
'xcode_settings': {
|
||||||
'PRODUCT_BUNDLE_IDENTIFIER': 'com.tdesktop.Telegram',
|
|
||||||
'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ],
|
'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ],
|
||||||
'OTHER_LDFLAGS': [
|
'OTHER_LDFLAGS': [
|
||||||
'-lbase',
|
'-lbase',
|
||||||
|
@ -77,11 +76,17 @@
|
||||||
],
|
],
|
||||||
'configurations': {
|
'configurations': {
|
||||||
'Debug': {
|
'Debug': {
|
||||||
|
'xcode_settings': {
|
||||||
|
'PRODUCT_BUNDLE_IDENTIFIER': 'com.tdesktop.TelegramDebugOld',
|
||||||
|
},
|
||||||
'library_dirs': [
|
'library_dirs': [
|
||||||
'<(libs_loc)/macold/crashpad/out/Debug',
|
'<(libs_loc)/macold/crashpad/out/Debug',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'Release': {
|
'Release': {
|
||||||
|
'xcode_settings': {
|
||||||
|
'PRODUCT_BUNDLE_IDENTIFIER': 'com.tdesktop.Telegram',
|
||||||
|
},
|
||||||
'library_dirs': [
|
'library_dirs': [
|
||||||
'<(libs_loc)/macold/crashpad/out/Release',
|
'<(libs_loc)/macold/crashpad/out/Release',
|
||||||
],
|
],
|
||||||
|
@ -147,13 +152,24 @@
|
||||||
},
|
},
|
||||||
}], [ '"<(build_macold)" != "1" and "<(build_macstore)" != "1"', {
|
}], [ '"<(build_macold)" != "1" and "<(build_macstore)" != "1"', {
|
||||||
'xcode_settings': {
|
'xcode_settings': {
|
||||||
'PRODUCT_BUNDLE_IDENTIFIER': 'com.tdesktop.Telegram',
|
|
||||||
'OTHER_LDFLAGS': [
|
'OTHER_LDFLAGS': [
|
||||||
'-lbase',
|
'-lbase',
|
||||||
'-lcrashpad_client',
|
'-lcrashpad_client',
|
||||||
'-lcrashpad_util',
|
'-lcrashpad_util',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
'configurations': {
|
||||||
|
'Debug': {
|
||||||
|
'xcode_settings': {
|
||||||
|
'PRODUCT_BUNDLE_IDENTIFIER': 'com.tdesktop.TelegramDebug',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'Release': {
|
||||||
|
'xcode_settings': {
|
||||||
|
'PRODUCT_BUNDLE_IDENTIFIER': 'com.tdesktop.Telegram',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
'postbuilds': [{
|
'postbuilds': [{
|
||||||
'postbuild_name': 'Force Frameworks path',
|
'postbuild_name': 'Force Frameworks path',
|
||||||
'action': [
|
'action': [
|
||||||
|
|
Loading…
Reference in New Issue