-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathSignal-Desktop-persistent-messages.patch
124 lines (117 loc) · 4.13 KB
/
Signal-Desktop-persistent-messages.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
diff --git a/package.json b/package.json
index e2b8606..bbd3656 100644
--- a/package.json
+++ b/package.json
@@ -455,7 +455,7 @@
"StartupWMClass": "Signal"
},
"target": [
- "deb"
+ "rpm"
],
"icon": "build/icons/png",
"publish": []
diff --git a/ts/background.ts b/ts/background.ts
index cdc9091..6162d52 100644
--- a/ts/background.ts
+++ b/ts/background.ts
@@ -289,17 +289,7 @@ export async function startApp(): Promise<void> {
wait: 500,
maxSize: 100,
processBatch: async deliveryReceipts => {
- const groups = groupBy(deliveryReceipts, 'conversationId');
- await Promise.all(
- Object.keys(groups).map(async conversationId => {
- await conversationJobQueue.add({
- type: conversationQueueJobEnum.enum.Receipts,
- conversationId,
- receiptsType: ReceiptType.Delivery,
- receipts: groups[conversationId],
- });
- })
- );
+ log.info('Skipping delivery receipt:', deliveryReceipts);
},
});
diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx
index ae47cec..8856c64 100644
--- a/ts/components/conversation/Message.tsx
+++ b/ts/components/conversation/Message.tsx
@@ -2849,7 +2849,8 @@ export class Message extends React.PureComponent<Props, State> {
const { expired, expiring, isTargeted, imageBroken } = this.state;
if (expired) {
- return null;
+ // Avoid deleting expired messages from UX
+ //return null;
}
if (isSticker && (imageBroken || !attachments || !attachments.length)) {
@@ -2942,7 +2943,7 @@ export class Message extends React.PureComponent<Props, State> {
shouldCollapseAbove && 'module-message--collapsed-above',
shouldCollapseBelow && 'module-message--collapsed-below',
isTargeted ? 'module-message--targeted' : null,
- expiring ? 'module-message--expired' : null
+ //expiring ? 'module-message--expired' : null
)}
data-testid={timestamp}
tabIndex={0}
diff --git a/ts/models/messages.ts b/ts/models/messages.ts
index 7dbfb4c..f0f2630 100644
--- a/ts/models/messages.ts
+++ b/ts/models/messages.ts
@@ -2551,6 +2551,24 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
>,
shouldPersist = true
): Promise<void> {
+
+ // Add a marker to tell message has been deleted
+ this.set({
+ body: `❌ Deleted ❌ ${this.get('body')}`,
+ });
+
+ // Save the modifyed message to DB
+ if (shouldPersist) {
+ await window.Signal.Data.saveMessage(this.attributes, {
+ ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(),
+ });
+ }
+ // Update last message on conv
+ this.getConversation()?.updateLastMessage();
+
+ // Return function before doing something else (delete content, etc.)
+ return;
+
if (this.deletingForEveryone || this.get('deletedForEveryone')) {
return;
}
diff --git a/ts/services/expiringMessagesDeletion.ts b/ts/services/expiringMessagesDeletion.ts
index f868705..96abe64 100644
--- a/ts/services/expiringMessagesDeletion.ts
+++ b/ts/services/expiringMessagesDeletion.ts
@@ -24,6 +24,8 @@ class ExpiringMessagesDeletionService {
}
private async destroyExpiredMessages() {
+ // Avoid deleting expired messages from DB
+ return;
try {
window.SignalContext.log.info(
'destroyExpiredMessages: Loading messages...'
@@ -79,6 +81,8 @@ class ExpiringMessagesDeletionService {
}
private async checkExpiringMessages() {
+ // Avoid deleting expired messages from DB
+ return;
window.SignalContext.log.info(
'checkExpiringMessages: checking for expiring messages'
);
diff --git a/ts/util/sendReceipts.ts b/ts/util/sendReceipts.ts
index 7a03d44..3b25b62 100644
--- a/ts/util/sendReceipts.ts
+++ b/ts/util/sendReceipts.ts
@@ -55,6 +55,9 @@ export async function sendReceipts({
return;
}
+ // do not send read-receipts
+ return;
+
log.info(`Starting receipt send of type ${type}`);
const receiptsBySenderId: Map<string, Array<Receipt>> = receipts.reduce(