FreeBSD Bugzilla – Attachment 249838 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), 4.85 KB, created by
Mikhail T.
on 2024-04-08 17:47:19 UTC
(
hide
)
Description:
the patch
Filename:
MIME Type:
Creator:
Mikhail T.
Created:
2024-04-08 17:47:19 UTC
Size:
4.85 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,
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