Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit fee2920

Browse files
Change auto-delete to make it opt-in
1 parent 4eef44b commit fee2920

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

lib/depject/page/html/render/settings.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ exports.create = function (api) {
3535
const fontSize = api.settings.obs.get('patchwork.fontSize', '')
3636
const fontFamily = api.settings.obs.get('patchwork.fontFamily', '')
3737
const includeParticipating = api.settings.obs.get('patchwork.includeParticipating', false)
38+
const autoDeleteBlocked = api.settings.obs.get('patchwork.autoDeleteBlocked', false)
3839

3940
// const filterFollowing = api.settings.obs.get('filters.following')
4041
// const filterSubscriptions = api.settings.obs.get('filters.subscriptions')
@@ -108,6 +109,14 @@ exports.create = function (api) {
108109
checkbox(includeParticipating, {
109110
label: i18n('Include "Participating" tab in navigation bar')
110111
})
112+
]),
113+
114+
h('h2', i18n('Blocking')),
115+
116+
h('div', [
117+
checkbox(autoDeleteBlocked, {
118+
label: i18n('Automatically delete messages from blocked authors. This is irreversible and will cause problems with clients that share the database but do not support deleted messages. Enable at your own risk!')
119+
})
111120
])
112121
]),
113122

lib/main-window.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ module.exports = function (config) {
6060
var latestUpdate = LatestUpdate()
6161
var subscribedChannels = api.channel.obs.subscribed(id)
6262
var includeParticipating = api.settings.obs.get('patchwork.includeParticipating', false)
63+
var autoDeleteBlocked = api.settings.obs.get('patchwork.autoDeleteBlocked', false)
6364

6465
// prompt to setup profile on first use
6566
onceTrue(api.sbot.obs.connection, (ssb) => {
@@ -77,6 +78,7 @@ module.exports = function (config) {
7778
const currentlyDeleting = {}
7879

7980
watch(api.contact.obs.blocking(id), (blocking) => {
81+
if (autoDeleteBlocked() !== true) return
8082
if (blocking.length === 0) return
8183

8284
if (ssb.del == null) return

locales/en.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,5 +308,8 @@
308308
" replied but is blocked by ": " replied but is blocked by ",
309309
"Content of a blocked user": "Content of a blocked user",
310310
"el": "el",
311-
"eo": "eo"
312-
}
311+
"eo": "eo",
312+
"zh-TW": "zh-TW",
313+
"Blocking": "Blocking",
314+
"Automatically delete messages from blocked authors. This is irreversible and will cause problems with clients that share the database but do not support deleted messages. Enable at your own risk!": "Automatically delete messages from blocked authors. This is irreversible and will cause problems with clients that share the database but do not support deleted messages. Enable at your own risk!"
315+
}

0 commit comments

Comments
 (0)