diff --git a/data/glade/roster_window.glade b/data/glade/roster_window.glade
index 625a713..d6b4c64 100644
--- a/data/glade/roster_window.glade
+++ b/data/glade/roster_window.glade
@@ -215,6 +215,17 @@
                       </widget>
                     </child>
                     <child>
+                      <widget class="GtkCheckMenuItem" id="show_only_active_contacts">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">_Show Only Active Contacts</property>
+                        <property name="use_underline">True</property>
+                        <property name="active">False</property>
+                        <signal name="activate" handler="on_show_only_active_contacts_activate"/>
+                        <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+                      </widget>
+                    </child>
+
+                    <child>
                       <widget class="GtkCheckMenuItem" id="show_transports_menuitem">
                         <property name="visible">True</property>
                         <property name="label" translatable="yes">Show Trans_ports</property>
diff --git a/src/common/config.py b/src/common/config.py
index 7f51d40..2e75d80 100644
--- a/src/common/config.py
+++ b/src/common/config.py
@@ -58,6 +58,7 @@ class Config:
 		'use_notif_daemon': [ opt_bool, True , _('Use D-Bus and Notification-Daemon to show notifications') ],
 		'ignore_unknown_contacts': [ opt_bool, False ],
 		'showoffline': [ opt_bool, False ],
+		'show_only_chat_and_online': [ opt_bool, False ],
 		'show_transports_group': [ opt_bool, True ],
 		'autoaway': [ opt_bool, True ],
 		'autoawaytime': [ opt_int, 5, _('Time in minutes, after which your status changes to away.') ],
diff --git a/src/common/contacts.py b/src/common/contacts.py
index 524b076..8714c81 100644
--- a/src/common/contacts.py
+++ b/src/common/contacts.py
@@ -70,8 +70,10 @@ class Contact:
 			return self.contact_name
 		return self.jid.split('@')[0]
 
-	def is_hidden_from_roster(self):
+	def is_hidden_from_roster(self, show_only_chat_and_online=False):
 		'''if contact should not be visible in roster'''
+		if show_only_chat_and_online and (self.show not in ('chat', 'online')):
+			return True
 		# XEP-0162: http://www.xmpp.org/extensions/xep-0162.html
 		if self.is_transport():
 			return False
diff --git a/src/roster_window.py b/src/roster_window.py
index 35f9e82..e0b7cee 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -260,8 +260,9 @@ class RosterWindow:
 		If add_children is True, we also add all children, even if they were not
 		already drawn'''
 		showOffline = gajim.config.get('showoffline')
+		showOnlyChatAndOnline = gajim.config.get('show_only_chat_and_online')
 		model = self.tree.get_model()
-		contact = gajim.contacts.get_first_contact_from_jid(account, jid)
+		contact = gajim.contacts.get_contact_with_highest_priority(account, jid)
 		nb_events = gajim.events.get_nb_roster_events(account, contact.jid)
 		# count events from all resources
 		for contact_ in gajim.contacts.get_contacts(account, jid):
@@ -286,7 +287,7 @@ class RosterWindow:
 			return
 
 		# XEP-0162
-		hide = contact.is_hidden_from_roster()
+		hide = contact.is_hidden_from_roster(showOnlyChatAndOnline)
 		if hide and contact.sub != 'from':
 			return
 		observer = contact.is_observer()
@@ -4520,6 +4521,11 @@ class RosterWindow:
 		gajim.config.set('showoffline', not gajim.config.get('showoffline'))
 		self.draw_roster()
 
+
+	def on_show_only_active_contacts_activate(self, widget):
+		gajim.config.set('show_only_chat_and_online', not gajim.config.get('show_only_chat_and_online'))
+		self.draw_roster()
+
 	def set_renderer_color(self, renderer, style, set_background = True):
 		'''set style for treeview cell, using PRELIGHT system color'''
 		if set_background:
