Telegram: bump version

This commit is contained in:
Gerasim Troeglazov
2024-05-06 23:07:45 +10:00
parent d47be5739e
commit 06ddfc6c6f
4 changed files with 385 additions and 373 deletions

View File

@@ -1,6 +1,6 @@
From 96b4ead8a0059b6d4f80a9ccd2293e0f4710412b Mon Sep 17 00:00:00 2001
From b93338ef2551f9fdc2268756613cf167c95e4ccc Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 10 Apr 2024 18:48:02 +1000
Date: Sun, 5 May 2024 20:34:48 +1000
Subject: Add haiku support

View File

@@ -1,11 +1,11 @@
From 3c04c33ea44f0c33d83afc1b65a81dc7c6ffee0a Mon Sep 17 00:00:00 2001
From 03c1778982d17224751dd9369f57fd24b4ac3dba Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 15 Apr 2024 18:02:44 +1000
Date: Mon, 6 May 2024 19:24:35 +1000
Subject: Add haiku support
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3bf1369..2f75e69 100644
index 4e2ac34..648adfd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,12 +27,12 @@ elseif (LINUX)
@@ -138,7 +138,7 @@ index 0000000..e5f8b64
+
+resource("BEOS:default_shortcut") "S";
diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt
index 2e26bf4..c4dbcfb 100644
index 2f42270..350b113 100644
--- a/Telegram/CMakeLists.txt
+++ b/Telegram/CMakeLists.txt
@@ -93,6 +93,15 @@ PRIVATE
@@ -157,13 +157,12 @@ index 2e26bf4..c4dbcfb 100644
target_precompile_headers(Telegram PRIVATE $<$<COMPILE_LANGUAGE:CXX,OBJCXX>:${src_loc}/stdafx.h>)
nice_target_sources(Telegram ${src_loc}
PRIVATE
@@ -1556,6 +1565,17 @@ if (NOT build_winstore)
@@ -1559,6 +1568,16 @@ if (NOT build_winstore)
)
endif()
+if (HAIKU)
+ remove_target_sources(Telegram ${src_loc}
+ platform/linux/notifications_manager_linux_dummy.cpp
+ platform/linux/notifications_manager_linux.cpp
+ )
+ nice_target_sources(Telegram ${src_loc}
@@ -172,10 +171,10 @@ index 2e26bf4..c4dbcfb 100644
+ )
+endif()
+
if (DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
if (DESKTOP_APP_USE_PACKAGED)
remove_target_sources(Telegram ${src_loc}
platform/linux/linux_wayland_integration.cpp
@@ -1741,7 +1761,7 @@ else()
platform/mac/mac_iconv_helper.c
@@ -1721,7 +1740,7 @@ else()
set(bundle_identifier "com.tdesktop.Telegram")
endif()
set(bundle_entitlements "Telegram.entitlements")
@@ -205,10 +204,10 @@ index 51a9068..b5296bc 100644
if (const auto strong = weak.get()) {
showBox(Box(SettingsBox, strong));
diff --git a/Telegram/SourceFiles/core/core_settings.h b/Telegram/SourceFiles/core/core_settings.h
index 93e0727..33aa2ca 100644
index 9ebd488..4b51d48 100644
--- a/Telegram/SourceFiles/core/core_settings.h
+++ b/Telegram/SourceFiles/core/core_settings.h
@@ -964,7 +964,7 @@ private:
@@ -972,7 +972,7 @@ private:
rpl::variable<float64> _dialogsWidthRatio; // per-window
rpl::variable<int> _thirdColumnWidth = kDefaultThirdColumnWidth; // p-w
bool _notifyFromAll = true;
@@ -218,10 +217,10 @@ index 93e0727..33aa2ca 100644
rpl::variable<bool> _systemDarkModeEnabled = false;
rpl::variable<WindowTitleContent> _windowTitleContent;
diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp
index 6feacdb..38f5f23 100644
index 3daf917..0876c08 100644
--- a/Telegram/SourceFiles/core/sandbox.cpp
+++ b/Telegram/SourceFiles/core/sandbox.cpp
@@ -234,7 +234,7 @@ void Sandbox::setupScreenScale() {
@@ -233,7 +233,7 @@ void Sandbox::setupScreenScale() {
const auto screen = Sandbox::primaryScreen();
const auto dpi = screen->logicalDotsPerInch();
@@ -230,7 +229,7 @@ index 6feacdb..38f5f23 100644
const auto base = (basePair.first + basePair.second) * 0.5;
const auto screenScaleExact = dpi / base;
const auto screenScale = int(base::SafeRound(screenScaleExact * 20)) * 5;
@@ -257,9 +257,12 @@ Sandbox::~Sandbox() = default;
@@ -256,9 +256,12 @@ Sandbox::~Sandbox() = default;
bool Sandbox::event(QEvent *e) {
if (e->type() == QEvent::Quit && !Quitting()) {
@@ -246,7 +245,7 @@ index 6feacdb..38f5f23 100644
} else if (e->type() == QEvent::Close) {
Quit();
} else if (e->type() == DeadlockDetector::PingPongEvent::Type()) {
@@ -273,7 +276,7 @@ bool Sandbox::event(QEvent *e) {
@@ -272,7 +275,7 @@ bool Sandbox::event(QEvent *e) {
void Sandbox::socketConnected() {
LOG(("Socket connected, this is not the first application instance, sending show command..."));
_secondInstance = true;
@@ -255,6 +254,58 @@ index 6feacdb..38f5f23 100644
QString commands;
const QStringList &lst(cSendPaths());
for (QStringList::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) {
diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp
index d79e477..9d9b67e 100644
--- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp
+++ b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp
@@ -16,6 +16,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <xdpopenuri/xdpopenuri.hpp>
#include <xdprequest/xdprequest.hpp>
+#ifdef Q_OS_HAIKU
+#include <base/haiku_types.h>
+#include <InterfaceKit.h>
+#include <StorageKit.h>
+#include <SupportKit.h>
+#include <MimeType.h>
+#include <Roster.h>
+#endif
+
namespace Platform {
namespace File {
namespace {
@@ -26,6 +35,22 @@ using base::Platform::XdgActivationToken;
} // namespace
bool UnsafeShowOpenWith(const QString &filepath) {
+#ifdef Q_OS_HAIKU
+ BMessenger trackerMessenger("application/x-vnd.Be-TRAK");
+ if (trackerMessenger.IsValid()) {
+ update_mime_info(filepath.toUtf8().data(), false, true, false);
+
+ BEntry fileEntry(filepath.toUtf8().data());
+ entry_ref fileRef;
+ if (fileEntry.GetRef(&fileRef) == B_OK) {
+ BMessage openCommand(B_REFS_RECEIVED);
+ openCommand.AddRef("refs", &fileRef);
+ openCommand.AddInt32("launchUsingSelector", 0);
+ if (trackerMessenger.SendMessage(&openCommand) == B_OK)
+ return true;
+ }
+ }
+#else
auto proxy = XdpOpenURI::OpenURIProxy::new_for_bus_sync(
Gio::BusType::SESSION_,
Gio::DBusProxyFlags::NONE_,
@@ -119,7 +144,7 @@ bool UnsafeShowOpenWith(const QString &filepath) {
window.setWindowModality(Qt::ApplicationModal);
window.show();
loop.run();
-
+#endif
return true;
}
diff --git a/Telegram/SourceFiles/platform/linux/integration_linux.cpp b/Telegram/SourceFiles/platform/linux/integration_linux.cpp
index b2a8cf6..71882ef 100644
--- a/Telegram/SourceFiles/platform/linux/integration_linux.cpp
@@ -287,63 +338,11 @@ index b2a8cf6..71882ef 100644
} // namespace
std::unique_ptr<Integration> CreateIntegration() {
diff --git a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp
index 9e409b9..26a0700 100644
--- a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp
+++ b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp
@@ -16,6 +16,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <xdpopenuri/xdpopenuri.hpp>
#include <xdprequest/xdprequest.hpp>
+#ifdef Q_OS_HAIKU
+#include <base/haiku_types.h>
+#include <InterfaceKit.h>
+#include <StorageKit.h>
+#include <SupportKit.h>
+#include <MimeType.h>
+#include <Roster.h>
+#endif
+
namespace Platform {
namespace File {
namespace internal {
@@ -27,6 +36,22 @@ using base::Platform::XdgActivationToken;
} // namespace
bool ShowXDPOpenWithDialog(const QString &filepath) {
+#ifdef Q_OS_HAIKU
+ BMessenger trackerMessenger("application/x-vnd.Be-TRAK");
+ if (trackerMessenger.IsValid()) {
+ update_mime_info(filepath.toUtf8().data(), false, true, false);
+
+ BEntry fileEntry(filepath.toUtf8().data());
+ entry_ref fileRef;
+ if (fileEntry.GetRef(&fileRef) == B_OK) {
+ BMessage openCommand(B_REFS_RECEIVED);
+ openCommand.AddRef("refs", &fileRef);
+ openCommand.AddInt32("launchUsingSelector", 0);
+ if (trackerMessenger.SendMessage(&openCommand) == B_OK)
+ return true;
+ }
+ }
+#else
auto proxy = XdpOpenURI::OpenURIProxy::new_for_bus_sync(
Gio::BusType::SESSION_,
Gio::DBusProxyFlags::NONE_,
@@ -120,7 +145,7 @@ bool ShowXDPOpenWithDialog(const QString &filepath) {
window.setWindowModality(Qt::ApplicationModal);
window.show();
loop.run();
-
+#endif
return true;
}
diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp
index e6a3b68..d4f771f 100644
index ba73e3b..a95a647 100644
--- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp
+++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp
@@ -36,6 +36,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
@@ -35,6 +35,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/platform/linux/base_linux_xcb_utilities.h"
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
@@ -354,7 +353,7 @@ index e6a3b68..d4f771f 100644
#include <QtCore/QSize>
#include <QtCore/QMimeData>
#include <QtGui/QWindow>
@@ -220,6 +224,12 @@ void MainWindow::workmodeUpdated(Core::Settings::WorkMode mode) {
@@ -173,6 +177,12 @@ void MainWindow::workmodeUpdated(Core::Settings::WorkMode mode) {
SkipTaskbar(windowHandle(), mode == WorkMode::TrayOnly);
}
@@ -682,10 +681,10 @@ index 0000000..21935f0
+} // namespace Notifications
+} // namespace Platform
diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp
index 29b8879..f559014 100644
index c874ae7..80072c8 100644
--- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp
+++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp
@@ -26,6 +26,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
@@ -25,6 +25,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/platform/linux/base_linux_xcb_utilities.h"
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
@@ -696,7 +695,7 @@ index 29b8879..f559014 100644
#include <QtWidgets/QApplication>
#include <QtWidgets/QSystemTrayIcon>
#include <QtCore/QStandardPaths>
@@ -49,6 +53,33 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
@@ -48,6 +52,33 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <iostream>
namespace {
@@ -730,7 +729,7 @@ index 29b8879..f559014 100644
using namespace gi::repository;
namespace GObject = gi::repository::GObject;
@@ -525,6 +556,10 @@ bool AutostartSupported() {
@@ -523,6 +554,10 @@ bool AutostartSupported() {
}
void AutostartToggle(bool enabled, Fn<void(bool)> done) {
@@ -741,7 +740,7 @@ index 29b8879..f559014 100644
if (KSandbox::isFlatpak()) {
PortalAutostart(enabled, done);
return;
@@ -552,6 +587,7 @@ void AutostartToggle(bool enabled, Fn<void(bool)> done) {
@@ -550,6 +585,7 @@ void AutostartToggle(bool enabled, Fn<void(bool)> done) {
if (done) {
done(enabled && success);
}
@@ -749,7 +748,7 @@ index 29b8879..f559014 100644
}
bool AutostartSkip() {
@@ -617,7 +653,11 @@ QString psAppDataPath() {
@@ -611,7 +647,11 @@ QString psAppDataPath() {
}
}
@@ -761,7 +760,7 @@ index 29b8879..f559014 100644
}
void psDoCleanup() {
@@ -727,6 +767,7 @@ bool OpenSystemSettings(SystemSettingsType type) {
@@ -721,6 +761,7 @@ bool OpenSystemSettings(SystemSettingsType type) {
}
options.push_back(std::move(command));
};
@@ -769,7 +768,7 @@ index 29b8879..f559014 100644
add("unity-control-center", "sound");
add("kcmshell6", "kcm_pulseaudio");
add("kcmshell5", "kcm_pulseaudio");
@@ -736,7 +777,7 @@ bool OpenSystemSettings(SystemSettingsType type) {
@@ -730,7 +771,7 @@ bool OpenSystemSettings(SystemSettingsType type) {
add("mate-volume-control");
add("pavucontrol-qt");
add("pavucontrol");
@@ -1028,10 +1027,10 @@ index af97691..1a0f256 100644
#include <QtGui/QWindow>
diff --git a/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp b/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp
index 3d851b8..dce45d2 100644
index cb992b0..3015247 100644
--- a/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp
+++ b/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp
@@ -17,6 +17,10 @@
@@ -16,6 +16,10 @@
#include "base/platform/linux/base_linux_xcb_utilities.h"
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
@@ -1191,7 +1190,7 @@ index 6e19fcf..e7a6990 100644
#include "webrtc/webrtc_device_common.h"
diff --git a/cmake/external/CMakeLists.txt b/cmake/external/CMakeLists.txt
index d9af92a..cd4ba1d 100644
index a8406e1..3eb0414 100644
--- a/cmake/external/CMakeLists.txt
+++ b/cmake/external/CMakeLists.txt
@@ -18,7 +18,7 @@ if (add_cld3_library)

View File

@@ -3,9 +3,9 @@ DESCRIPTION="Unofficial build of the original Telegram client for Haiku."
HOMEPAGE="https://www.telegram.org/"
COPYRIGHT="2013-2024 Telegram"
LICENSE="GNU GPL v3"
REVISION="2"
REVISION="1"
SOURCE_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v$portVersion/tdesktop-$portVersion-full.tar.gz"
CHECKSUM_SHA256="5a4dead506eb7c6458d98e8d12dd0f5f9321ec470e93019f9a6d6e816d67dd59"
CHECKSUM_SHA256="728bf0cf4c795ef3c481c958ab9b2a8e4799679f6ad7e823723b984dd3ce72d8"
SOURCE_FILENAME="tdesktop-$portVersion-full.tar.gz"
SOURCE_DIR="tdesktop-$portVersion-full"
srcGitRev_2="2b383fe05f8ae78ac99470b9a2b9ea22b3ee5a92"