Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,15 @@ if (WIN32)
${src_loc}/cloudveil/sentry/release/breakpad_client.lib
${src_loc}/cloudveil/sentry/release/sentry.lib
)
target_compile_definitions(Telegram PRIVATE DESKTOP_APP_USE_SENTRY=1)
elseif (APPLE)
target_link_libraries(Telegram
PRIVATE
curl
${src_loc}/cloudveil/sentry/release/libbreakpad_client.a
${src_loc}/cloudveil/sentry/release/libsentry.a
${src_loc}/cloudveil/sentry/release_mac/libbreakpad_client.a
${src_loc}/cloudveil/sentry/release_mac/libsentry.a
)
target_compile_definitions(Telegram PRIVATE DESKTOP_APP_USE_SENTRY=1)
endif()

target_precompile_headers(Telegram PRIVATE $<$<COMPILE_LANGUAGE:CXX,OBJCXX>:${src_loc}/stdafx.h>)
Expand Down Expand Up @@ -1893,15 +1895,15 @@ if (build_macstore)
)
else()
if (CMAKE_GENERATOR STREQUAL Xcode)
set(bundle_identifier "com.tdesktop.Telegram$<$<CONFIG:Debug>:Debug>")
set(bundle_identifier "org.cloudveil.desktopmessenger$<$<CONFIG:Debug>:Debug>")
else()
set(bundle_identifier "com.tdesktop.Telegram")
set(bundle_identifier "org.cloudveil.desktopmessenger")
endif()
set(bundle_entitlements "Telegram.entitlements")
if (LINUX AND DESKTOP_APP_USE_PACKAGED)
set(output_name "telegram-desktop")
set(output_name "cloudveil-messenger")
else()
set(output_name "Telegram")
set(output_name "CloudVeil Messenger")
endif()
endif()

Expand Down Expand Up @@ -2042,21 +2044,21 @@ endif()

if (LINUX AND DESKTOP_APP_USE_PACKAGED)
include(GNUInstallDirs)
configure_file("../lib/xdg/org.telegram.desktop.service" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.service" @ONLY)
configure_file("../lib/xdg/org.telegram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml")
configure_file("../lib/xdg/org.cloudveil.messenger.service" "${CMAKE_CURRENT_BINARY_DIR}/org.cloudveil.messenger.service" @ONLY)
configure_file("../lib/xdg/org.cloudveil.messenger.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/org.cloudveil.messenger.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/org.cloudveil.messenger.metainfo.xml")
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "org.telegram.desktop.png")
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "org.telegram.desktop.png")
install(FILES "Resources/art/icon48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "org.telegram.desktop.png")
install(FILES "Resources/art/icon64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "org.telegram.desktop.png")
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "org.telegram.desktop.png")
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "org.telegram.desktop.png")
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "org.telegram.desktop.png")
install(FILES "Resources/icons/tray_monochrome.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "org.telegram.desktop-symbolic.svg")
install(FILES "Resources/icons/tray_monochrome_attention.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "org.telegram.desktop-attention-symbolic.svg")
install(FILES "Resources/icons/tray_monochrome_mute.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "org.telegram.desktop-mute-symbolic.svg")
install(FILES "../lib/xdg/org.telegram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "org.cloudveil.messenger.png")
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "org.cloudveil.messenger.png")
install(FILES "Resources/art/icon48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "org.cloudveil.messenger.png")
install(FILES "Resources/art/icon64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "org.cloudveil.messenger.png")
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "org.cloudveil.messenger.png")
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "org.cloudveil.messenger.png")
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "org.cloudveil.messenger.png")
install(FILES "Resources/icons/tray_monochrome.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "org.cloudveil.messenger-symbolic.svg")
install(FILES "Resources/icons/tray_monochrome_attention.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "org.cloudveil.messenger-attention-symbolic.svg")
install(FILES "Resources/icons/tray_monochrome_mute.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "org.cloudveil.messenger-mute-symbolic.svg")
install(FILES "../lib/xdg/org.cloudveil.messenger.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.cloudveil.messenger.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.cloudveil.messenger.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
endif()
2 changes: 1 addition & 1 deletion Telegram/Resources/qrc/telegram/telegram.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
</qresource>
<qresource prefix="/misc">
<file alias="default_shortcuts-custom.json">../../default_shortcuts-custom.json</file>
<file alias="org.telegram.desktop.desktop">../../../../lib/xdg/org.telegram.desktop.desktop</file>
<file alias="org.cloudveil.messenger.desktop">../../../../lib/xdg/org.cloudveil.messenger.desktop</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion Telegram/Resources/uwp/AppX/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="5.14.3.0" />
Version="5.14.4.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
Expand Down
4 changes: 2 additions & 2 deletions Telegram/Resources/winrc/Telegram.rc
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "CloudVeil"
VALUE "FileDescription", "CloudVeil Messenger Desktop"
VALUE "FileVersion", "5.14.3.0"
VALUE "FileVersion", "5.14.4.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2025"
VALUE "ProductName", "CloudVeil Messenger Desktop"
VALUE "ProductVersion", "5.14.3.0"
VALUE "ProductVersion", "5.14.4.0"
END
END
BLOCK "VarFileInfo"
Expand Down
4 changes: 2 additions & 2 deletions Telegram/Resources/winrc/Updater.rc
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "5.14.3.0"
VALUE "FileVersion", "5.14.4.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2025"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.14.3.0"
VALUE "ProductVersion", "5.14.4.0"
END
END
BLOCK "VarFileInfo"
Expand Down
3 changes: 3 additions & 0 deletions Telegram/SourceFiles/cloudveil/DialogHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

DialogHelper::CheckDialogResult DialogHelper::checkAndShowDialogForbidden(PeerData* peerData, UserData* userData, Window::SessionController *controller) {
if (!GlobalSecuritySettings::getSettings().isDialogAllowed(peerData)) {
if (controller) {
controller->closeThirdSection();
}
// Kenji: this line below makes the user lose the current view context
// It usually opens the first chat or the saved chat, so I commented it out.
// controller->showPeerHistory(userData->id);
Expand Down
1 change: 1 addition & 0 deletions Telegram/SourceFiles/cloudveil/GlobalSecuritySettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ void GlobalSecuritySettings::addDialogToRequest(SettingsRequest &request, PeerDa
SettingsRequest::Row row;
row.isMegagroup = false;
row.isPublic = false;
row.migratedFromTelegramId = 0;

// peer->usernames() will internally handle the underlying user/channel/chat object.
std::vector<QString> userNames = peer->usernames();
Expand Down
6 changes: 6 additions & 0 deletions Telegram/SourceFiles/cloudveil/SimpleUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ void SimpleUpdater::processDownloadedResponse(QNetworkReply* networkReply) {
downloadedFile.close();
}

#ifdef Q_OS_WIN
QString path = QDir::tempPath() + "/cvm_update_package.exe";
#elif defined(Q_OS_MAC)
QString path = QDir::tempPath() + "/cvm_update_package.dmg";
#else
QString path = QDir::tempPath() + "/cvm_update_package";
#endif

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mac update launches DMG directly

Medium Severity

On macOS, the update mechanism saves the update file as a .dmg. The subsequent update process attempts to execute this .dmg directly. As disk images are not executables, in-app updates on macOS will likely fail after download.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d42fa59. Configure here.

downloadedFile.setFileName(path);
if (QFile::exists(path)) {
downloadedFile.remove();
Expand Down
4 changes: 3 additions & 1 deletion Telegram/SourceFiles/cloudveil/request/SettingsRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SettingsRequest
QStringList userNames;
bool isMegagroup;
bool isPublic;
qint64 migratedFromTelegramId;
qint64 migratedFromTelegramId = 0;

void writeToJson(QJsonObject &json, bool writeIsMegagroup = false, bool writeIsPublic=false);
bool equalsTo(Row& r);
Expand All @@ -20,6 +20,8 @@ class SettingsRequest
QStringList userNames;
#ifdef __APPLE__
QString clientOsType = "macOS";
#elif defined(__linux__)
QString clientOsType = "Linux";
#else
QString clientOsType = "Windows";
#endif
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/core/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ constexpr auto AppNameOld = "CloudVeil Messenger Win (Unofficial)"_cs;
constexpr auto AppName = "CloudVeil Messenger Desktop"_cs;
constexpr auto AppFile = "Telegram"_cs;
constexpr auto AppVersion = 5014003;
constexpr auto AppVersionStr = "5.14.3";
constexpr auto AppVersionStr = "5.14.4";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVersion numeric string mismatch

Medium Severity

AppVersion in version.h is 5014003, out of sync with the 5.14.4 release. This mismatch causes update checks, settings migration, and clientVersionCode to report an incorrect numeric version to services, even though the UI displays 5.14.4.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d42fa59. Configure here.

constexpr auto AppBetaVersion = false;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
9 changes: 8 additions & 1 deletion Telegram/SourceFiles/data/data_search_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ For license and copyright information please follow this link:
#include "history/history.h"
#include "history/history_item.h"
#include "apiwrap.h"
// CloudVeil start
#include "cloudveil/GlobalSecuritySettings.h"
// CloudVeil end

namespace Api {
namespace {
Expand Down Expand Up @@ -122,7 +125,11 @@ GlobalMediaResult ParseGlobalMediaResult(
message,
MessageFlags(),
addType);
if (item) {
// CloudVeil start: disable search results for blocked chats
if (item
&& GlobalSecuritySettings::getSettings().isDialogAllowed(
item->history()->peer)) {
// CloudVeil end
result.messageIds.push_back(item->position());
}
}
Expand Down
32 changes: 26 additions & 6 deletions Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ For license and copyright information please follow this link:
#include "mainwidget.h"
#include "storage/storage_account.h"
#include "apiwrap.h"
// CloudVeil start
#include "cloudveil/GlobalSecuritySettings.h"
// CloudVeil end
#include "main/main_session.h"
#include "main/main_session_settings.h"
#include "menu/menu_sponsored.h"
Expand Down Expand Up @@ -3425,11 +3428,18 @@ void InnerWidget::applySearchState(SearchState state) {
const auto append = [&](not_null<IndexedList*> list) {
const auto results = list->filtered(words);
auto top = filteredHeight();
auto i = _filterResults.insert(
end(_filterResults),
begin(results),
end(results));
for (const auto e = end(_filterResults); i != e; ++i) {
// CloudVeil start: disable search results for blocked chats
for (const auto &row : results) {
if (const auto history = row->history()) {
if (!GlobalSecuritySettings::getSettings()
.isDialogAllowed(history->peer)) {
continue;
}
}
auto i = _filterResults.insert(
end(_filterResults),
FilterResult(row));
// CloudVeil end
i->top = top;
i->row->recountHeight(_narrowRatio, _filterId);
top += i->row->height();
Expand Down Expand Up @@ -3812,7 +3822,11 @@ void InnerWidget::searchReceived(
: Key(_openedForum->history());
if (inject
&& (!_searchState.inChat
|| inject->history() == _searchState.inChat.history())) {
// CloudVeil start: disable search results for blocked chats
|| inject->history() == _searchState.inChat.history())
&& GlobalSecuritySettings::getSettings().isDialogAllowed(
inject->history()->peer)) {
// CloudVeil end
Assert(_searchResults.empty());
Assert(!toPreview);
const auto index = int(_searchResults.size());
Expand All @@ -3827,6 +3841,12 @@ void InnerWidget::searchReceived(
auto &results = toPreview ? _previewResults : _searchResults;
for (const auto &item : messages) {
const auto history = item->history();
// CloudVeil start: disable search results for blocked chats
if (!GlobalSecuritySettings::getSettings().isDialogAllowed(
history->peer)) {
continue;
}
// CloudVeil end
if (toPreview || !uniquePeers || !hasHistoryInResults(history)) {
const auto index = int(results.size());
const auto repaint = toPreview
Expand Down
17 changes: 16 additions & 1 deletion Telegram/SourceFiles/dialogs/dialogs_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ For license and copyright information please follow this link:
#include "data/data_stories.h"
#include "info/downloads/info_downloads_widget.h"
#include "info/info_memento.h"
//CloudVeil start
#include "cloudveil/DialogHelper.h"
#include "cloudveil/GlobalSecuritySettings.h"
//CloudVeil end
#include "inline_bots/bot_attach_web_view.h"
#include "styles/style_dialogs.h"
#include "styles/style_chat.h"
Expand Down Expand Up @@ -1787,6 +1791,13 @@ void Widget::updateSuggestions(anim::type animated) {
}

void Widget::openBotMainApp(not_null<UserData*> bot) {
// CloudVeil start: disable mini-app for blocked bots
if (DialogHelper::CheckDialogResult::APPROVED
!= DialogHelper::checkAndShowDialogForbidden(
bot, session().user(), controller())) {
return;
}
// CloudVeil end
session().attachWebView().open({
.bot = bot,
.context = {
Expand Down Expand Up @@ -2994,7 +3005,11 @@ void Widget::searchReceived(
const auto peerId = PeerFromMessage(message);
const auto lastDate = DateFromMessage(message);
if (const auto peer = session().data().peerLoaded(peerId)) {
if (lastDate) {
// CloudVeil start: disable search results for blocked chats
if (lastDate
&& GlobalSecuritySettings::getSettings().isDialogAllowed(
peer)) {
// CloudVeil end
const auto item = session().data().addNewMessage(
message,
MessageFlags(),
Expand Down
37 changes: 31 additions & 6 deletions Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ For license and copyright information please follow this link:
#include "ui/unread_badge_paint.h"
#include "ui/ui_utility.h"
#include "window/window_separate_id.h"
// CloudVeil start
#include "cloudveil/DialogHelper.h"
#include "cloudveil/GlobalSecuritySettings.h"
// CloudVeil end
#include "window/window_session_controller.h"
#include "window/window_peer_menu.h"
#include "styles/style_chat.h"
Expand Down Expand Up @@ -955,9 +959,13 @@ void MyChannelsController::prepare() {
const auto add = [&](not_null<Dialogs::MainList*> list) {
for (const auto &row : list->indexed()->all()) {
if (const auto history = row->history()) {
if (history->peer->isBroadcast()) {
// CloudVeil start: hide blocked channels in suggestion list
if (history->peer->isBroadcast()
&& GlobalSecuritySettings::getSettings().isDialogAllowed(
history->peer)) {
_channels.push_back(history);
}
// CloudVeil end
}
}
};
Expand All @@ -984,11 +992,14 @@ void MyChannelsController::prepare() {
const auto list = owner->chatsList(folder);
for (const auto &row : list->indexed()->all()) {
if (const auto history = row->history()) {
if (history->peer->isBroadcast()) {
if (ranges::contains(_channels, not_null(history))) {
_channels.push_back(history);
}
// CloudVeil start: hide blocked channels in suggestion list
if (history->peer->isBroadcast()
&& !ranges::contains(_channels, not_null(history))
&& GlobalSecuritySettings::getSettings().isDialogAllowed(
history->peer)) {
_channels.push_back(history);
}
// CloudVeil end
}
}
const auto was = countCurrent();
Expand Down Expand Up @@ -1078,6 +1089,9 @@ void RecommendationsController::load() {
void RecommendationsController::fill() {
const auto participants = &session().api().chatParticipants();
const auto &list = participants->recommendations().list;
// CloudVeil start: hide recommendations
return;
// CloudVeil end
if (list.empty()) {
return;
}
Expand Down Expand Up @@ -2054,7 +2068,9 @@ std::vector<Suggestions::Key> Suggestions::TabKeysFor(
auto result = std::vector<Key>{
{ Tab::Chats },
{ Tab::Channels },
{ Tab::Apps },
// CloudVeil start: hide Apps tab
//{ Tab::Apps },
// CloudVeil end
{ Tab::Media, MediaType::Photo },
{ Tab::Media, MediaType::Video },
{ Tab::Downloads },
Expand Down Expand Up @@ -2674,6 +2690,15 @@ object_ptr<Ui::BoxContent> StarsExamplesBox(
if (const auto user = peer->asUser()) {
if (const auto info = user->botInfo.get()) {
if (info->hasMainApp) {
// CloudVeil start: disable mini-app for blocked bots
if (DialogHelper::CheckDialogResult::APPROVED
!= DialogHelper::checkAndShowDialogForbidden(
user,
window->session().user(),
window)) {
return;
}
// CloudVeil end
window->session().attachWebView().open({
.bot = user,
.context = {
Expand Down
Loading
Loading