View | Details | Raw Unified | Return to bug 278263 | Differences between
and this patch

Collapse All | Expand All

(-)b/net-im/tdlib-purple/Makefile (-3 / +6 lines)
Lines 4-11 DISTVERSION= 0.8.1 Link Here
4
PORTREVISION=	1
4
PORTREVISION=	1
5
CATEGORIES=	net-im
5
CATEGORIES=	net-im
6
6
7
PATCH_SITES=	https://github.com/ars3niy/tdlib-purple/commit/
7
PATCH_SITES=	https://github.com/ars3niy/tdlib-purple/pull/
8
PATCHFILES+=	8c87b899ddbec32.patch:-p1 # https://github.com/ars3niy/tdlib-purple/pull/154
8
PATCHFILES=	129.diff:-p1	\
9
		154.diff:-p1 	\
10
		163.diff:-p1
11
DIST_SUBDIR=	${PORTNAME}
9
12
10
MAINTAINER=	ports@virtual-estates.net
13
MAINTAINER=	ports@virtual-estates.net
11
COMMENT=	Telegram plugin for libpurple, using tdlib
14
COMMENT=	Telegram plugin for libpurple, using tdlib
Lines 37-43 CMAKE_ON+= NoBundledLottie # Using graphics/rlottie Link Here
37
NLS_CMAKE_OFF+=	-DNoTranslations=1
40
NLS_CMAKE_OFF+=	-DNoTranslations=1
38
NLS_USES=	gettext-tools gettext-runtime
41
NLS_USES=	gettext-tools gettext-runtime
39
42
40
EXTRACT_AFTER_ARGS=--exclude rlottie --exclude fmt
43
EXTRACT_AFTER_ARGS=--exclude rlottie --exclude fmt --exclude .github
41
44
42
.include <bsd.port.options.mk>
45
.include <bsd.port.options.mk>
43
46
(-)b/net-im/tdlib-purple/distinfo (-5 / +9 lines)
Lines 1-5 Link Here
1
TIMESTAMP = 1702875649
1
TIMESTAMP = 1716045517
2
SHA256 (ars3niy-tdlib-purple-v0.8.1_GH0.tar.gz) = 8eb8b10c714368d7435d34ccda66a918e59c4cb4d2f49b6e16a246a78abd1a62
2
SHA256 (tdlib-purple/ars3niy-tdlib-purple-v0.8.1_GH0.tar.gz) = 8eb8b10c714368d7435d34ccda66a918e59c4cb4d2f49b6e16a246a78abd1a62
3
SIZE (ars3niy-tdlib-purple-v0.8.1_GH0.tar.gz) = 776564
3
SIZE (tdlib-purple/ars3niy-tdlib-purple-v0.8.1_GH0.tar.gz) = 776564
4
SHA256 (8c87b899ddbec32.patch) = b6861f1129a8e17564c2f4abfc264fc95801ad22d00326c3c05d3003fd1b3832
4
SHA256 (tdlib-purple/129.diff) = 7dc6e4a2957a59ba9c97c3ba8ffb9e599ed4ebe39ac859ba127e4b79a38d1d2e
5
SIZE (8c87b899ddbec32.patch) = 11742
5
SIZE (tdlib-purple/129.diff) = 4492
6
SHA256 (tdlib-purple/154.diff) = 95a6d82d796e41de97b5446963e1a747f0ff0f128b5e1d5a073140fe35dccea9
7
SIZE (tdlib-purple/154.diff) = 11297
8
SHA256 (tdlib-purple/163.diff) = 104dba0df7fc95bcd8a5a814033289676551cdcb88650047c7be881440a79dd4
9
SIZE (tdlib-purple/163.diff) = 1791
(-)b/net-im/tdlib-purple/files/patch-purple-info (+11 lines)
Added Link Here
1
--- purple-info.cpp	2021-12-17 04:50:38.000000000 -0500
2
+++ purple-info.cpp	2024-02-13 18:24:00.349617000 -0500
3
@@ -149,5 +149,7 @@
4
 {
5
     GHashTable *ui_info = purple_core_get_ui_info();
6
-    const char *name = static_cast<char *>(g_hash_table_lookup(ui_info, "name"));
7
+    if (ui_info == NULL)
8
+        return "";
9
+    const char *name = static_cast<const char *>(g_hash_table_lookup(ui_info, "name"));
10
     return name ? name : "";
11
 }
(-)b/net-im/tdlib-purple/files/patch-self-destructing-messages (+80 lines)
Added Link Here
1
The material part of https://github.com/ars3niy/tdlib-purple/pull/159 -- with the
2
default switched to TRUE (to show self-destruct messages out of the box).
3
4
	-mi
5
--- purple-info.h
6
+++ purple-info.h
7
@@ -40,6 +40,8 @@ namespace AccountOptions {
8
     constexpr gboolean    EnableSecretChatsDefault   = TRUE;
9
     constexpr const char *AnimatedStickers           = "animated-stickers";
10
     constexpr gboolean    AnimatedStickersDefault    = TRUE;
11
+    constexpr const char *ShowSelfDestruct           = "show-self-destruct";
12
+    constexpr gboolean    ShowSelfDestructDefault    = TRUE;
13
     constexpr const char *DownloadBehaviour          = "download-behaviour";
14
     constexpr const char *DownloadBehaviourHyperlink = "hyperlink";
15
     constexpr const char *DownloadBehaviourStandard  = "file-transfer";
16
--- receiving.cpp
17
+++ receiving.cpp
18
@@ -634,22 +634,37 @@ void showMessage(const td::td_api::chat &chat, IncomingMessage &fullMessage,
19
     messageInfo.repliedMessage = std::move(fullMessage.repliedMessage);
20
 
21
     if (message.ttl_ != 0) {
22
-        // TRANSLATOR: In-chat warning message
23
-        const char *text   = _("Received self-destructing message, not displayed due to lack of support");
24
-        std::string notice = makeNoticeWithSender(chat, messageInfo, text, account.purpleAccount);
25
-        showMessageText(account, chat, messageInfo, NULL, notice.c_str());
26
-        return;
27
+        if (purple_account_get_bool(account.purpleAccount, AccountOptions::ShowSelfDestruct, AccountOptions::ShowSelfDestructDefault)) {
28
+            // TRANSLATOR: In-chat warning message
29
+            const char *text   = _("Received self-destructing message, displaying anyway");
30
+            std::string notice = makeNoticeWithSender(chat, messageInfo, text, account.purpleAccount);
31
+            showMessageText(account, chat, messageInfo, NULL, notice.c_str());
32
+        } else {
33
+            // TRANSLATOR: In-chat warning message
34
+            const char *text   = _("Received self-destructing message, not displayed due to lack of support");
35
+            std::string notice = makeNoticeWithSender(chat, messageInfo, text, account.purpleAccount);
36
+            showMessageText(account, chat, messageInfo, NULL, notice.c_str());
37
+            return;
38
+        }
39
     }
40
 
41
     FileInfo fileInfo;
42
     getFileFromMessage(fullMessage, fileInfo);
43
     if (fileInfo.secret) {
44
-        // TRANSLATOR: In-chat warning message
45
-        std::string notice = formatMessage("Ignoring secret file ({})", fileInfo.description);
46
-        notice = makeNoticeWithSender(chat, messageInfo, notice.c_str(), account.purpleAccount);
47
-        showMessageText(account, chat, messageInfo, !fileInfo.caption.empty() ? fileInfo.caption.c_str() : nullptr,
48
-                        notice.c_str());
49
-        return;
50
+        if (purple_account_get_bool(account.purpleAccount, AccountOptions::ShowSelfDestruct, AccountOptions::ShowSelfDestructDefault)) {
51
+            // TRANSLATOR: In-chat warning message
52
+            std::string notice = formatMessage("Received secret file {}, displaying anyway", fileInfo.description);
53
+            notice = makeNoticeWithSender(chat, messageInfo, notice.c_str(), account.purpleAccount);
54
+            showMessageText(account, chat, messageInfo, !fileInfo.caption.empty() ? fileInfo.caption.c_str() : nullptr,
55
+                            notice.c_str());
56
+        } else {
57
+            // TRANSLATOR: In-chat warning message
58
+            std::string notice = formatMessage("Ignoring secret file ({})", fileInfo.description);
59
+            notice = makeNoticeWithSender(chat, messageInfo, notice.c_str(), account.purpleAccount);
60
+            showMessageText(account, chat, messageInfo, !fileInfo.caption.empty() ? fileInfo.caption.c_str() : nullptr,
61
+                            notice.c_str());
62
+            return;
63
+        }
64
     }
65
 
66
     switch (message.content_->get_id()) {
67
--- tdlib-purple.cpp
68
+++ tdlib-purple.cpp
69
@@ -1020,6 +1020,11 @@ static void tgprpl_init (PurplePlugin *plugin)
70
     prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, opt);
71
 #endif
72
 
73
+    // TRANSLATOR: Account settings, key (boolean)
74
+    opt = purple_account_option_bool_new(_("Show self-destructing messages anyway"), AccountOptions::ShowSelfDestruct,
75
+                                         AccountOptions::ShowSelfDestructDefault);
76
+    prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, opt);
77
+
78
     if (canDisableReadReceipts()) {
79
         opt = purple_account_option_bool_new ("Send read receipts",
80
                                               AccountOptions::ReadReceipts,

Return to bug 278263