summaryrefslogtreecommitdiffstats
path: root/lib/gajim/settings-clean-sub-account-settings
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gajim/settings-clean-sub-account-settings')
-rwxr-xr-xlib/gajim/settings-clean-sub-account-settings8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gajim/settings-clean-sub-account-settings b/lib/gajim/settings-clean-sub-account-settings
new file mode 100755
index 0000000..43e9ca9
--- /dev/null
+++ b/lib/gajim/settings-clean-sub-account-settings
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -eu
+
+clean="$(jq \
+ 'del(.contact[], .group_chat[]) | .account.opened_chat_controls = ""' \
+ "${1}" | sed -n '1h; 1!H; ${ g; s/,\n */, /g; s/\n *//g; p; };')"
+printf '%s' "${clean}" 1>"${1}"