From de7882e4cff04d7389c163d6c121ef1092b72eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Thu, 20 Aug 2015 17:32:27 -0500 Subject: [PATCH] Logout session improvements --- src/controller/mainController.py | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 025d23bb..9109f53d 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -375,26 +375,12 @@ class Controller(object): for i in session_.sessions: if session_.sessions[i].session_id == session_id: session = session_.sessions[i] user = session.db["user_name"] - self.destroy_buffer("home_timeline", user) - self.destroy_buffer("mentions", user) - self.destroy_buffer("direct_messages", user) - self.destroy_buffer("sent_direct_messages", user) - self.destroy_buffer("sent_tweets", user) - self.destroy_buffer("favourites", user) - self.destroy_buffer("followers", user) - self.destroy_buffer("friends", user) - self.destroy_buffer("blocked", user) - self.destroy_buffer("muted", user) - self.destroy_buffer("events", user) - self.destroy_buffer("timelines", user) - for i in session.settings["other_buffers"]["timelines"]: - self.destroy_buffer("%s-timeline" % (i,), user) - self.destroy_buffer("favs_timelines", user) - self.destroy_buffer("searches", user) - for i in session.settings["other_buffers"]["tweet_searches"]: - self.destroy_buffer("%s-searchterm" % (i,), user) - for i in session.settings["other_buffers"]["trending_topic_buffers"]: - self.destroy_buffer("%s_tt" % (i,), user) + delete_buffers = [] + for i in self.buffers: + if i.account == user and i.name != user: + delete_buffers.append(i.name) + for i in delete_buffers: + self.destroy_buffer(i, user) session.db = None def destroy_buffer(self, buffer_name, account):