From b832e36c7d57bfb8ec548643b68523233c404aa2 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Thu, 23 Nov 2017 05:13:44 -0600 Subject: [PATCH] Prevent filtering in some buffers #102 --- src/controller/mainController.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 854d4aae..3a25ed6b 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -490,6 +490,10 @@ class Controller(object): if not hasattr(page.buffer, "list"): output.speak(_(u"No session is currently in focus. Focus a session with the next or previous session shortcut."), True) return + # Let's prevent filtering of some buffers (people buffers, direct messages, events and sent items). + if (page.name == "direct_messages" or page.name =="sent_direct_messages" or page.name == "sent_tweets" or page.name == "events") or page.type == "people": + output.speak(_(u"Filters cannot be applied on this buffer")) + return new_filter = filterController.filter(page) def seekLeft(self, *args, **kwargs):