summaryrefslogtreecommitdiff
path: root/poezio
diff options
context:
space:
mode:
authorLuke Marlin <luke.marlin@viacesi.fr>2016-10-13 18:46:03 +0200
committerLuke Marlin <luke.marlin@viacesi.Fr>2016-10-23 16:25:44 +0200
commit3c894ea558ef167d3332b07ea7929854b53b3ae5 (patch)
treea58c3bb0b9405231e12b5d5313743a610dda9b91 /poezio
parentb026bb190d9218578ee08460c8964968784a6dd5 (diff)
downloadpoezio-3c894ea558ef167d3332b07ea7929854b53b3ae5.tar.gz
poezio-3c894ea558ef167d3332b07ea7929854b53b3ae5.tar.bz2
poezio-3c894ea558ef167d3332b07ea7929854b53b3ae5.tar.xz
poezio-3c894ea558ef167d3332b07ea7929854b53b3ae5.zip
Added information_popup_type_filter that allow to
filter an entire type of messages such as 'roster' 'error' 'information' or 'debug'
Diffstat (limited to 'poezio')
-rw-r--r--poezio/config.py1
-rw-r--r--poezio/core/core.py6
2 files changed, 6 insertions, 1 deletions
diff --git a/poezio/config.py b/poezio/config.py
index f2002382..ade9f740 100644
--- a/poezio/config.py
+++ b/poezio/config.py
@@ -74,6 +74,7 @@ DEFAULT_CONFIG = {
'ignore_certificate': False,
'ignore_private': False,
'information_buffer_popup_on': 'error roster warning help info',
+ 'information_buffer_type_filter': '',
'jid': '',
'keyfile': '',
'lang': 'en',
diff --git a/poezio/core/core.py b/poezio/core/core.py
index f9d30cfe..d14130c6 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -1405,10 +1405,14 @@ class Core(object):
"""
Displays an informational message in the "Info" buffer
"""
+ filter_types = config.get('information_buffer_type_filter').split(':')
+ if typ.lower() in filter_types:
+ log.debug('Did not show the message:\n\t%s> %s \n\tdue to information_popup_type_filter configuration', typ, msg)
+ return False
filter_messages = config.get('filter_info_messages').split(':')
for words in filter_messages:
if words and words in msg:
- log.debug('Did not show the message:\n\t%s> %s', typ, msg)
+ log.debug('Did not show the message:\n\t%s> %s \n\tdue to filter_info_messages configuration', typ, msg)
return False
colors = get_theme().INFO_COLORS
color = colors.get(typ.lower(), colors.get('default', None))