mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 11:40:06 +02:00
Telegram: fix build
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
From 30f2bf354259b22fbdc1b55af18a284d5abfe68d Mon Sep 17 00:00:00 2001
|
||||
From 90ef5477ee4c8ebb41a3ce3613aa1d0ec6db8951 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Thu, 31 Jan 2019 10:33:51 +1000
|
||||
Date: Sun, 3 Feb 2019 00:23:28 +1000
|
||||
Subject: Add Haiku support
|
||||
|
||||
|
||||
@@ -46,32 +46,6 @@ index 9e3df82..3092663 100644
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
diff --git a/Telegram/SourceFiles/base/basic_types.h b/Telegram/SourceFiles/base/basic_types.h
|
||||
index c32a4b4..3f800cf 100644
|
||||
--- a/Telegram/SourceFiles/base/basic_types.h
|
||||
+++ b/Telegram/SourceFiles/base/basic_types.h
|
||||
@@ -35,6 +35,13 @@ template <typename Signature>
|
||||
using FnMut = base::unique_function<Signature>;
|
||||
|
||||
//using uchar = unsigned char; // Qt has uchar
|
||||
+#ifdef __HAIKU__
|
||||
+#include <SupportDefs.h>
|
||||
+#define int64 XXX
|
||||
+#define uint64 YYY
|
||||
+using int64 = qint64;
|
||||
+using uint64 = quint64;
|
||||
+#else
|
||||
using int8 = qint8;
|
||||
using uint8 = quint8;
|
||||
using int16 = qint16;
|
||||
@@ -43,6 +50,7 @@ using int32 = qint32;
|
||||
using uint32 = quint32;
|
||||
using int64 = qint64;
|
||||
using uint64 = quint64;
|
||||
+#endif
|
||||
using float32 = float;
|
||||
using float64 = double;
|
||||
|
||||
diff --git a/Telegram/SourceFiles/base/build_config.h b/Telegram/SourceFiles/base/build_config.h
|
||||
index 3bcb595..b97d66a 100644
|
||||
--- a/Telegram/SourceFiles/base/build_config.h
|
||||
@@ -158,11 +132,53 @@ index fbdcb56..0eb0e4f 100644
|
||||
#include <QFile>
|
||||
|
||||
int (*TestForkedMethod)()/* = nullptr*/;
|
||||
diff --git a/Telegram/SourceFiles/boxes/add_contact_box.cpp b/Telegram/SourceFiles/boxes/add_contact_box.cpp
|
||||
index a7a150d..d95a157 100644
|
||||
--- a/Telegram/SourceFiles/boxes/add_contact_box.cpp
|
||||
+++ b/Telegram/SourceFiles/boxes/add_contact_box.cpp
|
||||
@@ -88,7 +88,7 @@ void ShowAddParticipantsError(
|
||||
const auto makeAdmin = [=] {
|
||||
const auto user = users.front();
|
||||
const auto weak = std::make_shared<QPointer<EditAdminBox>>();
|
||||
- const auto close = [=](auto&&...) {
|
||||
+ const auto close = [=] {
|
||||
if (*weak) {
|
||||
(*weak)->closeBox();
|
||||
}
|
||||
@@ -96,7 +96,7 @@ void ShowAddParticipantsError(
|
||||
const auto saveCallback = SaveAdminCallback(
|
||||
channel,
|
||||
user,
|
||||
- close,
|
||||
+ [=](auto&&...) { close(); },
|
||||
close);
|
||||
auto box = Box<EditAdminBox>(
|
||||
channel,
|
||||
diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp
|
||||
index faf45cd..254a4bb 100644
|
||||
index faf45cd..ea4691f 100644
|
||||
--- a/Telegram/SourceFiles/core/launcher.cpp
|
||||
+++ b/Telegram/SourceFiles/core/launcher.cpp
|
||||
@@ -230,6 +230,10 @@ int Launcher::exec() {
|
||||
@@ -5,6 +5,7 @@ the official desktop application for the Telegram messaging service.
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
+
|
||||
#include "core/launcher.h"
|
||||
|
||||
#include "platform/platform_launcher.h"
|
||||
@@ -15,6 +16,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "core/sandbox.h"
|
||||
#include "base/concurrent_timer.h"
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <signal.h>
|
||||
+#include <unistd.h>
|
||||
+#endif
|
||||
+
|
||||
namespace Core {
|
||||
namespace {
|
||||
|
||||
@@ -230,6 +236,10 @@ int Launcher::exec() {
|
||||
|
||||
// I don't know why path is not in QT_PLUGIN_PATH by default
|
||||
QCoreApplication::addLibraryPath("/usr/lib/qt/plugins");
|
||||
@@ -173,7 +189,7 @@ index faf45cd..254a4bb 100644
|
||||
// without this Telegram doesn't start on Ubuntu 17.04 due GTK errors
|
||||
setenv("QT_STYLE_OVERRIDE", "qwerty", false);
|
||||
// Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943
|
||||
@@ -331,6 +335,9 @@ void Launcher::prepareSettings() {
|
||||
@@ -331,6 +341,9 @@ void Launcher::prepareSettings() {
|
||||
case dbipMacOld:
|
||||
gPlatformString = qsl("MacOSold");
|
||||
break;
|
||||
@@ -183,6 +199,23 @@ index faf45cd..254a4bb 100644
|
||||
case dbipLinux64:
|
||||
gPlatformString = qsl("Linux64bit");
|
||||
break;
|
||||
@@ -447,7 +460,16 @@ int Launcher::executeApplication() {
|
||||
Sandbox sandbox(this, _argc, _argv);
|
||||
MainQueueProcessor processor;
|
||||
base::ConcurrentTimerEnvironment environment;
|
||||
+#ifdef __HAIKU__
|
||||
+ int res = sandbox.start();
|
||||
+ CrashReports::Finish();
|
||||
+ Platform::finish();
|
||||
+ Logs::finish();
|
||||
+ kill(::getpid(), SIGKILL);
|
||||
+ return res;
|
||||
+#else
|
||||
return sandbox.start();
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp
|
||||
index dabeddc..20dd2c1 100644
|
||||
--- a/Telegram/SourceFiles/core/update_checker.cpp
|
||||
@@ -217,6 +250,64 @@ index e8b0d33..99d61bc 100644
|
||||
};
|
||||
|
||||
enum DBIPeerReportSpamStatus {
|
||||
diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp
|
||||
index 3dc7b4e..3506b23 100644
|
||||
--- a/Telegram/SourceFiles/export/data/export_data_types.cpp
|
||||
+++ b/Telegram/SourceFiles/export/data/export_data_types.cpp
|
||||
@@ -242,7 +242,8 @@ Image ParseMaxImage(
|
||||
result.width = data.vw.v;
|
||||
result.height = data.vh.v;
|
||||
result.file.location = ParseLocation(data.vlocation);
|
||||
- if constexpr (MTPDphotoCachedSize::Is<decltype(data)>()) {
|
||||
+ constexpr bool is = (MTPDphotoCachedSize::Is<decltype(data)>());
|
||||
+ if constexpr (is) {
|
||||
result.file.content = data.vbytes.v;
|
||||
result.file.size = result.file.content.size();
|
||||
} else {
|
||||
@@ -431,7 +432,8 @@ Image ParseDocumentThumb(
|
||||
result.width = data.vw.v;
|
||||
result.height = data.vh.v;
|
||||
result.file.location = ParseLocation(data.vlocation);
|
||||
- if constexpr (MTPDphotoCachedSize::Is<decltype(data)>()) {
|
||||
+ constexpr bool is = (MTPDphotoCachedSize::Is<decltype(data)>());
|
||||
+ if constexpr (is) {
|
||||
result.file.content = data.vbytes.v;
|
||||
result.file.size = result.file.content.size();
|
||||
} else {
|
||||
@@ -1122,7 +1124,8 @@ Message ParseMessage(
|
||||
auto result = Message();
|
||||
data.match([&](const auto &data) {
|
||||
result.id = data.vid.v;
|
||||
- if constexpr (!MTPDmessageEmpty::Is<decltype(data)>()) {
|
||||
+ constexpr bool is = (!MTPDmessageEmpty::Is<decltype(data)>());
|
||||
+ if constexpr (is) {
|
||||
result.toId = ParsePeerId(data.vto_id);
|
||||
const auto peerId = (!data.is_out()
|
||||
&& data.has_from_id()
|
||||
diff --git a/Telegram/SourceFiles/export/export_api_wrap.cpp b/Telegram/SourceFiles/export/export_api_wrap.cpp
|
||||
index f183f3b..44053fc 100644
|
||||
--- a/Telegram/SourceFiles/export/export_api_wrap.cpp
|
||||
+++ b/Telegram/SourceFiles/export/export_api_wrap.cpp
|
||||
@@ -720,7 +720,8 @@ void ApiWrap::handleUserpicsSlice(const MTPphotos_Photos &result) {
|
||||
Expects(_userpicsProcess != nullptr);
|
||||
|
||||
result.match([&](const auto &data) {
|
||||
- if constexpr (MTPDphotos_photos::Is<decltype(data)>()) {
|
||||
+ constexpr bool is = (MTPDphotos_photos::Is<decltype(data)>());
|
||||
+ if constexpr (is) {
|
||||
_userpicsProcess->lastSlice = true;
|
||||
}
|
||||
loadUserpicsFiles(Data::ParseUserpicsSlice(
|
||||
@@ -1257,7 +1258,8 @@ void ApiWrap::requestMessagesSlice() {
|
||||
result.match([&](const MTPDmessages_messagesNotModified &data) {
|
||||
error("Unexpected messagesNotModified received.");
|
||||
}, [&](const auto &data) {
|
||||
- if constexpr (MTPDmessages_messages::Is<decltype(data)>()) {
|
||||
+ constexpr bool is = (MTPDmessages_messages::Is<decltype(data)>());
|
||||
+ if constexpr (is) {
|
||||
_chatProcess->lastSlice = true;
|
||||
}
|
||||
loadMessagesFiles(Data::ParseMessagesSlice(
|
||||
diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp
|
||||
index 84c9af0..5e343c6 100644
|
||||
--- a/Telegram/SourceFiles/logs.cpp
|
||||
@@ -231,7 +322,7 @@ index 84c9af0..5e343c6 100644
|
||||
if (!cWorkingDir().isEmpty()) {
|
||||
// This value must come from TelegramForcePortable
|
||||
diff --git a/Telegram/SourceFiles/media/media_audio.cpp b/Telegram/SourceFiles/media/media_audio.cpp
|
||||
index cb0cacb..540a581 100644
|
||||
index b9843c2..898fbb2 100644
|
||||
--- a/Telegram/SourceFiles/media/media_audio.cpp
|
||||
+++ b/Telegram/SourceFiles/media/media_audio.cpp
|
||||
@@ -99,6 +99,7 @@ void EnumeratePlaybackDevices() {
|
||||
@@ -253,10 +344,10 @@ index cb0cacb..540a581 100644
|
||||
} else {
|
||||
diff --git a/Telegram/SourceFiles/platform/haiku/file_utilities_haiku.cpp b/Telegram/SourceFiles/platform/haiku/file_utilities_haiku.cpp
|
||||
new file mode 100644
|
||||
index 0000000..d360bc0
|
||||
index 0000000..47a223f
|
||||
--- /dev/null
|
||||
+++ b/Telegram/SourceFiles/platform/haiku/file_utilities_haiku.cpp
|
||||
@@ -0,0 +1,134 @@
|
||||
@@ -0,0 +1,133 @@
|
||||
+/*
|
||||
+This file is part of Telegram Desktop for Haiku,
|
||||
+
|
||||
@@ -275,7 +366,6 @@ index 0000000..d360bc0
|
||||
+
|
||||
+#include "platform/haiku/file_utilities_haiku.h"
|
||||
+
|
||||
+#include "messenger.h"
|
||||
+#include "mainwindow.h"
|
||||
+#include "storage/localstorage.h"
|
||||
+
|
||||
@@ -690,10 +780,10 @@ index 0000000..54073f5
|
||||
+} // namespace Platform
|
||||
diff --git a/Telegram/SourceFiles/platform/haiku/main_window_haiku.cpp b/Telegram/SourceFiles/platform/haiku/main_window_haiku.cpp
|
||||
new file mode 100644
|
||||
index 0000000..ad21aed
|
||||
index 0000000..af88932
|
||||
--- /dev/null
|
||||
+++ b/Telegram/SourceFiles/platform/haiku/main_window_haiku.cpp
|
||||
@@ -0,0 +1,132 @@
|
||||
@@ -0,0 +1,128 @@
|
||||
+/*
|
||||
+This file is part of Telegram Desktop for Haiku,
|
||||
+
|
||||
@@ -710,16 +800,13 @@ index 0000000..ad21aed
|
||||
+Copyright (c) 2018 Gerasim Troeglazov, 3dEyes@gmail.com
|
||||
+*/
|
||||
+
|
||||
+#include <Deskbar.h>
|
||||
+
|
||||
+#include "platform/haiku/main_window_haiku.h"
|
||||
+
|
||||
+#include "styles/style_window.h"
|
||||
+#include "platform/haiku/haiku_desktop_environment.h"
|
||||
+#include "history/history.h"
|
||||
+#include "mainwindow.h"
|
||||
+#include "messenger.h"
|
||||
+#include "application.h"
|
||||
+#include "core/application.h"
|
||||
+#include "lang/lang_keys.h"
|
||||
+#include "storage/localstorage.h"
|
||||
+
|
||||
@@ -754,7 +841,7 @@ index 0000000..ad21aed
|
||||
+ if (!trayIcon) {
|
||||
+ trayIcon = new QSystemTrayIcon(this);
|
||||
+
|
||||
+ auto icon = QIcon(App::pixmapFromImageInPlace(Messenger::Instance().logoNoMargin()));
|
||||
+ auto icon = QIcon(App::pixmapFromImageInPlace(Core::App().logoNoMargin()));
|
||||
+
|
||||
+ trayIcon->setIcon(icon);
|
||||
+ trayIcon->setToolTip(str_const_toString(AppName));
|
||||
@@ -788,9 +875,8 @@ index 0000000..ad21aed
|
||||
+}
|
||||
+
|
||||
+void MainWindow::updateIconCounters() {
|
||||
+ BDeskbar deskbar;
|
||||
+ const auto counter = Messenger::Instance().unreadBadge();
|
||||
+ const auto muted = Messenger::Instance().unreadBadgeMuted();
|
||||
+ const auto counter = Core::App().unreadBadge();
|
||||
+ const auto muted = Core::App().unreadBadgeMuted();
|
||||
+ auto &bg = (muted ? st::trayCounterBgMute : st::trayCounterBg);
|
||||
+ auto &fg = st::trayCounterFg;
|
||||
+ if (trayIcon) {
|
||||
@@ -1004,10 +1090,10 @@ index 0000000..b6f3490
|
||||
+resource app_signature "application/x-vnd.tg-notify-gate";
|
||||
diff --git a/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.cpp b/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.cpp
|
||||
new file mode 100644
|
||||
index 0000000..5d447d1
|
||||
index 0000000..def91de
|
||||
--- /dev/null
|
||||
+++ b/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.cpp
|
||||
@@ -0,0 +1,202 @@
|
||||
@@ -0,0 +1,212 @@
|
||||
+/*
|
||||
+This file is part of Telegram Desktop for Haiku,
|
||||
+
|
||||
@@ -1024,11 +1110,21 @@ index 0000000..5d447d1
|
||||
+Copyright (c) 2018 Gerasim Troeglazov, 3dEyes@gmail.com
|
||||
+*/
|
||||
+
|
||||
+#define int64 XXX
|
||||
+#define uint64 YYY
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <unistd.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <fcntl.h>
|
||||
+
|
||||
+#include <SupportDefs.h>
|
||||
+#include <Notification.h>
|
||||
+#include <Bitmap.h>
|
||||
+#include <TranslationUtils.h>
|
||||
+#include <Entry.h>
|
||||
+#include <OS.h>
|
||||
+
|
||||
+#include "platform/haiku/notifications_manager_haiku.h"
|
||||
+
|
||||
+#include "window/notifications_utilities.h"
|
||||
@@ -1212,10 +1308,10 @@ index 0000000..5d447d1
|
||||
+} // namespace Platform
|
||||
diff --git a/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.h b/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.h
|
||||
new file mode 100644
|
||||
index 0000000..06815f4
|
||||
index 0000000..25c8e26
|
||||
--- /dev/null
|
||||
+++ b/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.h
|
||||
@@ -0,0 +1,136 @@
|
||||
@@ -0,0 +1,130 @@
|
||||
+/*
|
||||
+This file is part of Telegram Desktop for Haiku,
|
||||
+
|
||||
@@ -1241,12 +1337,6 @@ index 0000000..06815f4
|
||||
+#include <QThread>
|
||||
+#include <QObject>
|
||||
+
|
||||
+#include <Notification.h>
|
||||
+#include <Bitmap.h>
|
||||
+#include <TranslationUtils.h>
|
||||
+#include <Entry.h>
|
||||
+#include <OS.h>
|
||||
+
|
||||
+#define NOTIFY_MESSAGE_DEEP 16
|
||||
+#define NOTIFY_PORT_NAME "tg_notify"
|
||||
+#define NOTIFY_GATE_NAME "/bin/tg-notify-gate"
|
||||
@@ -1284,7 +1374,7 @@ index 0000000..06815f4
|
||||
+signals:
|
||||
+ void notificationActivated(PeerId peerId, MsgId msgId);
|
||||
+private:
|
||||
+ port_id portId;
|
||||
+ int32 portId;
|
||||
+};
|
||||
+
|
||||
+
|
||||
@@ -1354,10 +1444,10 @@ index 0000000..06815f4
|
||||
+} // namespace Platform
|
||||
diff --git a/Telegram/SourceFiles/platform/haiku/specific_haiku.cpp b/Telegram/SourceFiles/platform/haiku/specific_haiku.cpp
|
||||
new file mode 100644
|
||||
index 0000000..61cea84
|
||||
index 0000000..5acf791
|
||||
--- /dev/null
|
||||
+++ b/Telegram/SourceFiles/platform/haiku/specific_haiku.cpp
|
||||
@@ -0,0 +1,432 @@
|
||||
@@ -0,0 +1,431 @@
|
||||
+/*
|
||||
+This file is part of Telegram Desktop for Haiku,
|
||||
+
|
||||
@@ -1377,7 +1467,6 @@ index 0000000..61cea84
|
||||
+#include "platform/haiku/specific_haiku.h"
|
||||
+
|
||||
+#include "lang/lang_keys.h"
|
||||
+#include "application.h"
|
||||
+#include "mainwidget.h"
|
||||
+#include "mainwindow.h"
|
||||
+#include "storage/localstorage.h"
|
||||
@@ -2588,202 +2677,30 @@ index 622462e..e3ba800 100644
|
||||
2.19.1
|
||||
|
||||
|
||||
From 417121218a212881e9c172e093d4a741b03b68e4 Mon Sep 17 00:00:00 2001
|
||||
From 733717189728393b3fff7a14c4845df10d38130e Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Fri, 1 Feb 2019 18:31:41 +1000
|
||||
Subject: Fix for new API
|
||||
Date: Sun, 3 Feb 2019 17:49:16 +1000
|
||||
Subject: Fix build for hybrid
|
||||
|
||||
|
||||
diff --git a/Telegram/SourceFiles/platform/haiku/file_utilities_haiku.cpp b/Telegram/SourceFiles/platform/haiku/file_utilities_haiku.cpp
|
||||
index d360bc0..47a223f 100644
|
||||
--- a/Telegram/SourceFiles/platform/haiku/file_utilities_haiku.cpp
|
||||
+++ b/Telegram/SourceFiles/platform/haiku/file_utilities_haiku.cpp
|
||||
@@ -16,7 +16,6 @@ Copyright (c) 2018 Gerasim Troeglazov, 3dEyes@gmail.com
|
||||
diff --git a/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.cpp b/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.cpp
|
||||
index def91de..7747c72 100644
|
||||
--- a/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.cpp
|
||||
+++ b/Telegram/SourceFiles/platform/haiku/notifications_manager_haiku.cpp
|
||||
@@ -14,8 +14,13 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2018 Gerasim Troeglazov, 3dEyes@gmail.com
|
||||
*/
|
||||
|
||||
#include "platform/haiku/file_utilities_haiku.h"
|
||||
|
||||
-#include "messenger.h"
|
||||
#include "mainwindow.h"
|
||||
#include "storage/localstorage.h"
|
||||
|
||||
diff --git a/Telegram/SourceFiles/platform/haiku/main_window_haiku.cpp b/Telegram/SourceFiles/platform/haiku/main_window_haiku.cpp
|
||||
index ad21aed..f19fb3d 100644
|
||||
--- a/Telegram/SourceFiles/platform/haiku/main_window_haiku.cpp
|
||||
+++ b/Telegram/SourceFiles/platform/haiku/main_window_haiku.cpp
|
||||
@@ -22,8 +22,7 @@ Copyright (c) 2018 Gerasim Troeglazov, 3dEyes@gmail.com
|
||||
#include "platform/haiku/haiku_desktop_environment.h"
|
||||
#include "history/history.h"
|
||||
#include "mainwindow.h"
|
||||
-#include "messenger.h"
|
||||
-#include "application.h"
|
||||
+#include "core/application.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "storage/localstorage.h"
|
||||
|
||||
@@ -58,7 +57,7 @@ void MainWindow::psSetupTrayIcon() {
|
||||
if (!trayIcon) {
|
||||
trayIcon = new QSystemTrayIcon(this);
|
||||
|
||||
- auto icon = QIcon(App::pixmapFromImageInPlace(Messenger::Instance().logoNoMargin()));
|
||||
+ auto icon = QIcon(App::pixmapFromImageInPlace(Core::App().logoNoMargin()));
|
||||
|
||||
trayIcon->setIcon(icon);
|
||||
trayIcon->setToolTip(str_const_toString(AppName));
|
||||
@@ -93,8 +92,8 @@ void MainWindow::unreadCounterChangedHook() {
|
||||
|
||||
void MainWindow::updateIconCounters() {
|
||||
BDeskbar deskbar;
|
||||
- const auto counter = Messenger::Instance().unreadBadge();
|
||||
- const auto muted = Messenger::Instance().unreadBadgeMuted();
|
||||
+ const auto counter = Core::App().unreadBadge();
|
||||
+ const auto muted = Core::App().unreadBadgeMuted();
|
||||
auto &bg = (muted ? st::trayCounterBgMute : st::trayCounterBg);
|
||||
auto &fg = st::trayCounterFg;
|
||||
if (trayIcon) {
|
||||
diff --git a/Telegram/SourceFiles/platform/haiku/specific_haiku.cpp b/Telegram/SourceFiles/platform/haiku/specific_haiku.cpp
|
||||
index 61cea84..5acf791 100644
|
||||
--- a/Telegram/SourceFiles/platform/haiku/specific_haiku.cpp
|
||||
+++ b/Telegram/SourceFiles/platform/haiku/specific_haiku.cpp
|
||||
@@ -17,7 +17,6 @@ Copyright (c) 2018 Gerasim Troeglazov, 3dEyes@gmail.com
|
||||
#include "platform/haiku/specific_haiku.h"
|
||||
|
||||
#include "lang/lang_keys.h"
|
||||
-#include "application.h"
|
||||
#include "mainwidget.h"
|
||||
#include "mainwindow.h"
|
||||
#include "storage/localstorage.h"
|
||||
--
|
||||
2.19.1
|
||||
|
||||
|
||||
From 4c0802d5c566d1c807e1650ae93397278eab7f02 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Fri, 1 Feb 2019 18:32:21 +1000
|
||||
Subject: Fix for GCC7 crash
|
||||
|
||||
|
||||
diff --git a/Telegram/SourceFiles/boxes/add_contact_box.cpp b/Telegram/SourceFiles/boxes/add_contact_box.cpp
|
||||
index a7a150d..d95a157 100644
|
||||
--- a/Telegram/SourceFiles/boxes/add_contact_box.cpp
|
||||
+++ b/Telegram/SourceFiles/boxes/add_contact_box.cpp
|
||||
@@ -88,7 +88,7 @@ void ShowAddParticipantsError(
|
||||
const auto makeAdmin = [=] {
|
||||
const auto user = users.front();
|
||||
const auto weak = std::make_shared<QPointer<EditAdminBox>>();
|
||||
- const auto close = [=](auto&&...) {
|
||||
+ const auto close = [=] {
|
||||
if (*weak) {
|
||||
(*weak)->closeBox();
|
||||
}
|
||||
@@ -96,7 +96,7 @@ void ShowAddParticipantsError(
|
||||
const auto saveCallback = SaveAdminCallback(
|
||||
channel,
|
||||
user,
|
||||
- close,
|
||||
+ [=](auto&&...) { close(); },
|
||||
close);
|
||||
auto box = Box<EditAdminBox>(
|
||||
channel,
|
||||
diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp
|
||||
index 3dc7b4e..3506b23 100644
|
||||
--- a/Telegram/SourceFiles/export/data/export_data_types.cpp
|
||||
+++ b/Telegram/SourceFiles/export/data/export_data_types.cpp
|
||||
@@ -242,7 +242,8 @@ Image ParseMaxImage(
|
||||
result.width = data.vw.v;
|
||||
result.height = data.vh.v;
|
||||
result.file.location = ParseLocation(data.vlocation);
|
||||
- if constexpr (MTPDphotoCachedSize::Is<decltype(data)>()) {
|
||||
+ constexpr bool is = (MTPDphotoCachedSize::Is<decltype(data)>());
|
||||
+ if constexpr (is) {
|
||||
result.file.content = data.vbytes.v;
|
||||
result.file.size = result.file.content.size();
|
||||
} else {
|
||||
@@ -431,7 +432,8 @@ Image ParseDocumentThumb(
|
||||
result.width = data.vw.v;
|
||||
result.height = data.vh.v;
|
||||
result.file.location = ParseLocation(data.vlocation);
|
||||
- if constexpr (MTPDphotoCachedSize::Is<decltype(data)>()) {
|
||||
+ constexpr bool is = (MTPDphotoCachedSize::Is<decltype(data)>());
|
||||
+ if constexpr (is) {
|
||||
result.file.content = data.vbytes.v;
|
||||
result.file.size = result.file.content.size();
|
||||
} else {
|
||||
@@ -1122,7 +1124,8 @@ Message ParseMessage(
|
||||
auto result = Message();
|
||||
data.match([&](const auto &data) {
|
||||
result.id = data.vid.v;
|
||||
- if constexpr (!MTPDmessageEmpty::Is<decltype(data)>()) {
|
||||
+ constexpr bool is = (!MTPDmessageEmpty::Is<decltype(data)>());
|
||||
+ if constexpr (is) {
|
||||
result.toId = ParsePeerId(data.vto_id);
|
||||
const auto peerId = (!data.is_out()
|
||||
&& data.has_from_id()
|
||||
diff --git a/Telegram/SourceFiles/export/export_api_wrap.cpp b/Telegram/SourceFiles/export/export_api_wrap.cpp
|
||||
index f183f3b..44053fc 100644
|
||||
--- a/Telegram/SourceFiles/export/export_api_wrap.cpp
|
||||
+++ b/Telegram/SourceFiles/export/export_api_wrap.cpp
|
||||
@@ -720,7 +720,8 @@ void ApiWrap::handleUserpicsSlice(const MTPphotos_Photos &result) {
|
||||
Expects(_userpicsProcess != nullptr);
|
||||
|
||||
result.match([&](const auto &data) {
|
||||
- if constexpr (MTPDphotos_photos::Is<decltype(data)>()) {
|
||||
+ constexpr bool is = (MTPDphotos_photos::Is<decltype(data)>());
|
||||
+ if constexpr (is) {
|
||||
_userpicsProcess->lastSlice = true;
|
||||
}
|
||||
loadUserpicsFiles(Data::ParseUserpicsSlice(
|
||||
@@ -1257,7 +1258,8 @@ void ApiWrap::requestMessagesSlice() {
|
||||
result.match([&](const MTPDmessages_messagesNotModified &data) {
|
||||
error("Unexpected messagesNotModified received.");
|
||||
}, [&](const auto &data) {
|
||||
- if constexpr (MTPDmessages_messages::Is<decltype(data)>()) {
|
||||
+ constexpr bool is = (MTPDmessages_messages::Is<decltype(data)>());
|
||||
+ if constexpr (is) {
|
||||
_chatProcess->lastSlice = true;
|
||||
}
|
||||
loadMessagesFiles(Data::ParseMessagesSlice(
|
||||
--
|
||||
2.19.1
|
||||
|
||||
|
||||
From 7bc9dc46e03382512f1c3ddf28c41003a4c5c806 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Fri, 1 Feb 2019 19:36:23 +1000
|
||||
Subject: Dirty hack for fix crash on exit
|
||||
|
||||
|
||||
diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp
|
||||
index 254a4bb..60729d3 100644
|
||||
--- a/Telegram/SourceFiles/core/launcher.cpp
|
||||
+++ b/Telegram/SourceFiles/core/launcher.cpp
|
||||
@@ -15,6 +15,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "core/sandbox.h"
|
||||
#include "base/concurrent_timer.h"
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <OS.h>
|
||||
+#endif
|
||||
+
|
||||
namespace Core {
|
||||
namespace {
|
||||
|
||||
@@ -454,7 +458,16 @@ int Launcher::executeApplication() {
|
||||
Sandbox sandbox(this, _argc, _argv);
|
||||
MainQueueProcessor processor;
|
||||
base::ConcurrentTimerEnvironment environment;
|
||||
+#ifdef __HAIKU__
|
||||
+ int res = sandbox.start();
|
||||
+ CrashReports::Finish();
|
||||
+ Platform::finish();
|
||||
+ Logs::finish();
|
||||
+ kill(::getpid(), SIGKILL);
|
||||
+ return res;
|
||||
+#ifdef __x86_64__
|
||||
#define int64 XXX
|
||||
#define uint64 YYY
|
||||
+#else
|
||||
return sandbox.start();
|
||||
+#define int32 XXX
|
||||
+#define uint32 YYY
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
--
|
||||
2.19.1
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ DESCRIPTION="Official desktop version of Telegram messaging app."
|
||||
HOMEPAGE="https://www.telegram.org/"
|
||||
COPYRIGHT="2013-2019 Telegram"
|
||||
LICENSE="GNU GPL v3"
|
||||
REVISION="1"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://github.com/telegramdesktop/tdesktop/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="e7dde48fc0bb9d5e5a94d5f4300b68033700bb8bf7926d710334e0ba9b7d6af8"
|
||||
SOURCE_FILENAME="tdesktop-$portVersion.tar.gz"
|
||||
|
||||
Reference in New Issue
Block a user