Skip to content

Commit

Permalink
Add option to block delivery receipts (#793)
Browse files Browse the repository at this point in the history
Fixes #699
  • Loading branch information
JoniVR authored and sindresorhus committed Feb 20, 2019
1 parent d909b20 commit 6ad22f4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const defaults = {
flashWindowOnMessage: true,
block: {
chatSeen: false,
typingIndicator: false
typingIndicator: false,
deliveryReceipt: false
},
emojiStyle: 'facebook-3-0' as EmojiStyle,
confirmImagePaste: true,
Expand Down
4 changes: 4 additions & 0 deletions source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ function initRequestsFiltering(): void {
urls: [
`*://*.${domain}/*typ.php*`, // Type indicator blocker
`*://*.${domain}/*change_read_status.php*`, // Seen indicator blocker
`*://*.${domain}/*delivery_receipts*`, // Delivery receipts indicator blocker
`*://*.${domain}/*unread_threads*`, // Delivery receipts indicator blocker
'*://*.fbcdn.net/images/emoji.php/v9/*', // Emoji
'*://*.facebook.com/images/emoji.php/v9/*' // Emoji
]
Expand All @@ -181,6 +183,8 @@ function initRequestsFiltering(): void {
callback({cancel: config.get('block.typingIndicator')});
} else if (url.includes('change_read_status.php')) {
callback({cancel: config.get('block.chatSeen')});
} else if (url.includes('delivery_receipts') || url.includes('unread_threads')) {
callback({cancel: config.get('block.deliveryReceipt')});
}
});
}
Expand Down
8 changes: 8 additions & 0 deletions source/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ Press Command/Ctrl+R in Caprine to see your changes.
config.set('block.typingIndicator', item.checked);
}
},
{
type: 'checkbox',
label: 'Block Delivery Receipts',
checked: config.get('block.deliveryReceipt'),
click(item) {
config.set('block.deliveryReceipt', item.checked);
}
},
{
label: 'Hardware Acceleration',
type: 'checkbox',
Expand Down

0 comments on commit 6ad22f4

Please sign in to comment.