FreeBSD Bugzilla – Attachment 249839 Details for
Bug 278263
net-im/tdlib-purple: add more "community" patches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
the patch
tdlib-purple.diff (text/plain), 6.70 KB, created by
Mikhail T.
on 2024-04-08 17:49:11 UTC
(
hide
)
Description:
the patch
Filename:
MIME Type:
Creator:
Mikhail T.
Created:
2024-04-08 17:49:11 UTC
Size:
6.70 KB
patch
obsolete
>diff --git a/net-im/tdlib-purple/files/patch-self-destructing-messages b/net-im/tdlib-purple/files/patch-self-destructing-messages >new file mode 100644 >index 00000000000..308cb868dc2 >--- /dev/null >+++ b/net-im/tdlib-purple/files/patch-self-destructing-messages >@@ -0,0 +1,80 @@ >+The material part of https://github.com/ars3niy/tdlib-purple/pull/159 -- with the >+default switched to TRUE (to show self-destruct messages out of the box). >+ >+ -mi >+--- purple-info.h >++++ purple-info.h >+@@ -40,6 +40,8 @@ namespace AccountOptions { >+ constexpr gboolean EnableSecretChatsDefault = TRUE; >+ constexpr const char *AnimatedStickers = "animated-stickers"; >+ constexpr gboolean AnimatedStickersDefault = TRUE; >++ constexpr const char *ShowSelfDestruct = "show-self-destruct"; >++ constexpr gboolean ShowSelfDestructDefault = TRUE; >+ constexpr const char *DownloadBehaviour = "download-behaviour"; >+ constexpr const char *DownloadBehaviourHyperlink = "hyperlink"; >+ constexpr const char *DownloadBehaviourStandard = "file-transfer"; >+--- receiving.cpp >++++ receiving.cpp >+@@ -634,22 +634,37 @@ void showMessage(const td::td_api::chat &chat, IncomingMessage &fullMessage, >+ messageInfo.repliedMessage = std::move(fullMessage.repliedMessage); >+ >+ if (message.ttl_ != 0) { >+- // TRANSLATOR: In-chat warning message >+- const char *text = _("Received self-destructing message, not displayed due to lack of support"); >+- std::string notice = makeNoticeWithSender(chat, messageInfo, text, account.purpleAccount); >+- showMessageText(account, chat, messageInfo, NULL, notice.c_str()); >+- return; >++ if (purple_account_get_bool(account.purpleAccount, AccountOptions::ShowSelfDestruct, AccountOptions::ShowSelfDestructDefault)) { >++ // TRANSLATOR: In-chat warning message >++ const char *text = _("Received self-destructing message, displaying anyway"); >++ std::string notice = makeNoticeWithSender(chat, messageInfo, text, account.purpleAccount); >++ showMessageText(account, chat, messageInfo, NULL, notice.c_str()); >++ } else { >++ // TRANSLATOR: In-chat warning message >++ const char *text = _("Received self-destructing message, not displayed due to lack of support"); >++ std::string notice = makeNoticeWithSender(chat, messageInfo, text, account.purpleAccount); >++ showMessageText(account, chat, messageInfo, NULL, notice.c_str()); >++ return; >++ } >+ } >+ >+ FileInfo fileInfo; >+ getFileFromMessage(fullMessage, fileInfo); >+ if (fileInfo.secret) { >+- // TRANSLATOR: In-chat warning message >+- std::string notice = formatMessage("Ignoring secret file ({})", fileInfo.description); >+- notice = makeNoticeWithSender(chat, messageInfo, notice.c_str(), account.purpleAccount); >+- showMessageText(account, chat, messageInfo, !fileInfo.caption.empty() ? fileInfo.caption.c_str() : nullptr, >+- notice.c_str()); >+- return; >++ if (purple_account_get_bool(account.purpleAccount, AccountOptions::ShowSelfDestruct, AccountOptions::ShowSelfDestructDefault)) { >++ // TRANSLATOR: In-chat warning message >++ std::string notice = formatMessage("Received secret file {}, displaying anyway", fileInfo.description); >++ notice = makeNoticeWithSender(chat, messageInfo, notice.c_str(), account.purpleAccount); >++ showMessageText(account, chat, messageInfo, !fileInfo.caption.empty() ? fileInfo.caption.c_str() : nullptr, >++ notice.c_str()); >++ } else { >++ // TRANSLATOR: In-chat warning message >++ std::string notice = formatMessage("Ignoring secret file ({})", fileInfo.description); >++ notice = makeNoticeWithSender(chat, messageInfo, notice.c_str(), account.purpleAccount); >++ showMessageText(account, chat, messageInfo, !fileInfo.caption.empty() ? fileInfo.caption.c_str() : nullptr, >++ notice.c_str()); >++ return; >++ } >+ } >+ >+ switch (message.content_->get_id()) { >+--- tdlib-purple.cpp >++++ tdlib-purple.cpp >+@@ -1020,6 +1020,11 @@ static void tgprpl_init (PurplePlugin *plugin) >+ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, opt); >+ #endif >+ >++ // TRANSLATOR: Account settings, key (boolean) >++ opt = purple_account_option_bool_new(_("Show self-destructing messages anyway"), AccountOptions::ShowSelfDestruct, >++ AccountOptions::ShowSelfDestructDefault); >++ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, opt); >++ >+ if (canDisableReadReceipts()) { >+ opt = purple_account_option_bool_new ("Send read receipts", >+ AccountOptions::ReadReceipts, >diff --git a/net-im/tdlib-purple/Makefile b/net-im/tdlib-purple/Makefile >index ba55fbb99d1..f3c90dc1ce9 100644 >--- a/net-im/tdlib-purple/Makefile >+++ b/net-im/tdlib-purple/Makefile >@@ -1,10 +1,14 @@ > PORTNAME= tdlib-purple > DISTVERSIONPREFIX= v > DISTVERSION= 0.8.1 >+PORTREVISION= 1 > CATEGORIES= net-im > >-PATCH_SITES= https://github.com/ars3niy/tdlib-purple/commit/ >-PATCHFILES+= 8c87b899ddbec32.patch:-p1 # https://github.com/ars3niy/tdlib-purple/pull/154 >+PATCH_SITES= https://github.com/ars3niy/tdlib-purple/pull/ >+PATCHFILES= 129.diff:-p1 \ >+ 154.diff:-p1 \ >+ 163.diff:-p1 >+PATCH_SITE_SUBDIR=${PORTNAME} > > MAINTAINER= mi@aldan.algebra.com > COMMENT= Telegram plugin for libpurple, using tdlib >@@ -36,7 +40,7 @@ CMAKE_ON+= NoBundledLottie # Using graphics/rlottie > NLS_CMAKE_OFF+= -DNoTranslations=1 > NLS_USES= gettext-tools gettext-runtime > >-EXTRACT_AFTER_ARGS=--exclude rlottie --exclude fmt >+EXTRACT_AFTER_ARGS=--exclude rlottie --exclude fmt --exclude .github > > .include <bsd.port.options.mk> > >diff --git a/net-im/tdlib-purple/distinfo b/net-im/tdlib-purple/distinfo >index d8975e6dc44..42044f99f27 100644 >--- a/net-im/tdlib-purple/distinfo >+++ b/net-im/tdlib-purple/distinfo >@@ -1,5 +1,9 @@ >-TIMESTAMP = 1702875649 >+TIMESTAMP = 1712597997 > SHA256 (ars3niy-tdlib-purple-v0.8.1_GH0.tar.gz) = 8eb8b10c714368d7435d34ccda66a918e59c4cb4d2f49b6e16a246a78abd1a62 > SIZE (ars3niy-tdlib-purple-v0.8.1_GH0.tar.gz) = 776564 >-SHA256 (8c87b899ddbec32.patch) = b6861f1129a8e17564c2f4abfc264fc95801ad22d00326c3c05d3003fd1b3832 >-SIZE (8c87b899ddbec32.patch) = 11742 >+SHA256 (129.diff) = 7dc6e4a2957a59ba9c97c3ba8ffb9e599ed4ebe39ac859ba127e4b79a38d1d2e >+SIZE (129.diff) = 4492 >+SHA256 (154.diff) = 95a6d82d796e41de97b5446963e1a747f0ff0f128b5e1d5a073140fe35dccea9 >+SIZE (154.diff) = 11297 >+SHA256 (163.diff) = 104dba0df7fc95bcd8a5a814033289676551cdcb88650047c7be881440a79dd4 >+SIZE (163.diff) = 1791
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 278263
:
249838
|
249839
|
250796