Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
d000eeac
Commit
d000eeac
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Remove from xmpp muc filtered words using unignore command
parent
227ef343
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-unignore
+24
-2
24 additions, 2 deletions
src/freedombone-unignore
with
24 additions
and
2 deletions
src/freedombone-unignore
+
24
−
2
View file @
d000eeac
...
...
@@ -6,8 +6,8 @@
#
# Freedom in the Cloud
#
# Removes an ignore rule for either an email address
#
or text in the subject line
# Removes an ignore rule for either an email address
or text in the
#
subject line or from xmpp MUC filtered words
#
# License
# =======
...
...
@@ -32,6 +32,7 @@ PROJECT_NAME='freedombone'
export
TEXTDOMAIN
=
${
PROJECT_NAME
}
-unignore
export
TEXTDOMAINDIR
=
"/usr/share/locale"
XMPP_CONFIG
=
/etc/prosody/prosody.cfg.lua
MYUSERNAME
=
$USER
EMAIL_ADDRESS
=
SUBJECT_TEXT
=
...
...
@@ -96,6 +97,27 @@ if [ "$ALL_TEXT" ]; then
if
grep
-q
"Ignore rule for words '
$ALL_TEXT
'"
"
$PM
"
;
then
sed
-i
"/# Ignore rule for words '
$ALL_TEXT
'/,/# End of ignore words rule/d"
"
$PM
"
fi
if
[
-f
"
$XMPP_CONFIG
"
]
;
then
if
grep
-q
'filter_words ='
"
$XMPP_CONFIG
"
;
then
if
!
grep
-q
'filter_words = {}'
"
$XMPP_CONFIG
"
;
then
curr_filter_words
=
$(
grep
'filter_words ='
"
$XMPP_CONFIG
"
)
if
[
"
$curr_filter_words
"
]
;
then
if
[[
"
$curr_filter_words
"
==
*
",
\"
${
ALL_TEXT
}
\"
"
*
]]
;
then
sed
-i
"s|,
\"
${
ALL_TEXT
}
\"
||g"
"
$XMPP_CONFIG
"
else
if
[[
"
$curr_filter_words
"
==
*
"
\"
${
ALL_TEXT
}
\"
,"
*
]]
;
then
sed
-i
"s|
\"
${
ALL_TEXT
}
\"
,||g"
"
$XMPP_CONFIG
"
else
if
[[
"
$curr_filter_words
"
==
*
"
\"
${
ALL_TEXT
}
\"
"
*
]]
;
then
sed
-i
"s|
\"
${
ALL_TEXT
}
\"
||g"
"
$XMPP_CONFIG
"
fi
fi
fi
fi
fi
fi
fi
fi
# unignore an email address
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment