From 0221d5913ea26fde9493dadfbb265f2ff103124f Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sat, 30 Sep 2023 15:21:49 +0300 Subject: 2023-09-30 --- modules/common/common/nix/default.nix | 4 +- .../common/nix/patches/tdesktop-no-ads.patch | 45 ---------------------- .../nix/patches/telegram-desktop-no-ads.patch | 45 ++++++++++++++++++++++ modules/common/emacs/default.nix | 2 +- 4 files changed, 48 insertions(+), 48 deletions(-) delete mode 100644 modules/common/common/nix/patches/tdesktop-no-ads.patch create mode 100644 modules/common/common/nix/patches/telegram-desktop-no-ads.patch (limited to 'modules/common') diff --git a/modules/common/common/nix/default.nix b/modules/common/common/nix/default.nix index dc99434..bbb06d0 100644 --- a/modules/common/common/nix/default.nix +++ b/modules/common/common/nix/default.nix @@ -115,8 +115,8 @@ with lib; { patches = final.patches ++ [./patches/alejandra-no-ads.patch]; }); - tdesktop = super.tdesktop.overrideAttrs (_: final: { - patches = final.patches ++ [./patches/tdesktop-no-ads.patch]; + telegram-desktop = super.telegram-desktop.overrideAttrs (_: final: { + patches = final.patches ++ [./patches/telegram-desktop-no-ads.patch]; }); inherit (pkgsPr 245433 "sha256-FF1WW0+/pJ15+mPVjv0bkrh0dpHfQU08HNat2gu1PQk=") openmw; diff --git a/modules/common/common/nix/patches/tdesktop-no-ads.patch b/modules/common/common/nix/patches/tdesktop-no-ads.patch deleted file mode 100644 index d066066..0000000 --- a/modules/common/common/nix/patches/tdesktop-no-ads.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff --git i/Telegram/SourceFiles/data/data_sponsored_messages.cpp w/Telegram/SourceFiles/data/data_sponsored_messages.cpp -index fa21af469..263ea3e61 100644 ---- i/Telegram/SourceFiles/data/data_sponsored_messages.cpp -+++ w/Telegram/SourceFiles/data/data_sponsored_messages.cpp -@@ -179,39 +179,7 @@ bool SponsoredMessages::canHaveFor(not_null history) const { - } - - void SponsoredMessages::request(not_null history, Fn done) { -- if (!canHaveFor(history)) { -- return; -- } -- auto &request = _requests[history]; -- if (request.requestId || TooEarlyForRequest(request.lastReceived)) { -- return; -- } -- { -- const auto it = _data.find(history); -- if (it != end(_data)) { -- auto &list = it->second; -- // Don't rebuild currently displayed messages. -- const auto proj = [](const Entry &e) { -- return e.item != nullptr; -- }; -- if (ranges::any_of(list.entries, proj)) { -- return; -- } -- } -- } -- const auto channel = history->peer->asChannel(); -- Assert(channel != nullptr); -- request.requestId = _session->api().request( -- MTPchannels_GetSponsoredMessages( -- channel->inputChannel) -- ).done([=](const MTPmessages_sponsoredMessages &result) { -- parse(history, result); -- if (done) { -- done(); -- } -- }).fail([=] { -- _requests.remove(history); -- }).send(); -+ return; - } - - void SponsoredMessages::parse( diff --git a/modules/common/common/nix/patches/telegram-desktop-no-ads.patch b/modules/common/common/nix/patches/telegram-desktop-no-ads.patch new file mode 100644 index 0000000..d066066 --- /dev/null +++ b/modules/common/common/nix/patches/telegram-desktop-no-ads.patch @@ -0,0 +1,45 @@ +diff --git i/Telegram/SourceFiles/data/data_sponsored_messages.cpp w/Telegram/SourceFiles/data/data_sponsored_messages.cpp +index fa21af469..263ea3e61 100644 +--- i/Telegram/SourceFiles/data/data_sponsored_messages.cpp ++++ w/Telegram/SourceFiles/data/data_sponsored_messages.cpp +@@ -179,39 +179,7 @@ bool SponsoredMessages::canHaveFor(not_null history) const { + } + + void SponsoredMessages::request(not_null history, Fn done) { +- if (!canHaveFor(history)) { +- return; +- } +- auto &request = _requests[history]; +- if (request.requestId || TooEarlyForRequest(request.lastReceived)) { +- return; +- } +- { +- const auto it = _data.find(history); +- if (it != end(_data)) { +- auto &list = it->second; +- // Don't rebuild currently displayed messages. +- const auto proj = [](const Entry &e) { +- return e.item != nullptr; +- }; +- if (ranges::any_of(list.entries, proj)) { +- return; +- } +- } +- } +- const auto channel = history->peer->asChannel(); +- Assert(channel != nullptr); +- request.requestId = _session->api().request( +- MTPchannels_GetSponsoredMessages( +- channel->inputChannel) +- ).done([=](const MTPmessages_sponsoredMessages &result) { +- parse(history, result); +- if (done) { +- done(); +- } +- }).fail([=] { +- _requests.remove(history); +- }).send(); ++ return; + } + + void SponsoredMessages::parse( diff --git a/modules/common/emacs/default.nix b/modules/common/emacs/default.nix index 1d205b9..a21b5ab 100644 --- a/modules/common/emacs/default.nix +++ b/modules/common/emacs/default.nix @@ -149,7 +149,7 @@ in { (appendq! auth-sources '("${config.secrets.authinfo.path}")) - ;; Font must be set to N+2 because otherwise it looks too small. + ;; The font must be set to n+2, otherwise it looks too small. (setq doom-font (font-spec :family "${config.fontScheme.monospaceFont.family}" :size ${toString (config.fontScheme.monospaceFont.size + 2)}) -- cgit 1.4.1