A bugfix related to muted buffers

This commit is contained in:
Manuel Cortez 2015-03-01 20:02:00 -06:00
parent 1f64b80f9d
commit 1b0e8e47fa

View File

@ -898,7 +898,7 @@ class Controller(object):
def manage_home_timelines(self, data, user):
buffer = self.search_buffer("home_timeline", user)
play_sound = "tweet_received.ogg"
if "home_timeline" in buffer.session.settings["other_buffers"]["muted_buffers"]: return
if "home_timeline" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
self.notify(buffer.session, play_sound=play_sound)
buffer.add_new_item(data)
@ -906,7 +906,7 @@ class Controller(object):
buffer = self.search_buffer("mentions", user)
play_sound = "mention_received.ogg"
message = _(u"New mention")
if "mentions" in buffer.session.settings["other_buffers"]["muted_buffers"]: return
if "mentions" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
self.notify(buffer.session, play_sound=play_sound, message=message)
buffer.add_new_item(data)
@ -914,35 +914,35 @@ class Controller(object):
buffer = self.search_buffer("direct_messages", user)
play_sound = "dm_received.ogg"
message = _(u"New direct message")
if "direct_messages" in buffer.session.settings["other_buffers"]["muted_buffers"]: return
if "direct_messages" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
self.notify(buffer.session, play_sound=play_sound, message=message)
buffer.add_new_item(data)
def manage_sent_dm(self, data, user):
buffer = self.search_buffer("sent_direct_messages", user)
play_sound = "dm_sent.ogg"
if "sent_direct_messages" in buffer.session.settings["other_buffers"]["muted_buffers"]: return
if "sent_direct_messages" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
self.notify(buffer.session, play_sound=play_sound)
buffer.add_new_item(data)
def manage_sent_tweets(self, data, user):
buffer = self.search_buffer("sent_tweets", user)
play_sound = "tweet_send.ogg"
if "sent_tweets" in buffer.session.settings["other_buffers"]["muted_buffers"]: return
if "sent_tweets" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
self.notify(buffer.session, play_sound=play_sound)
buffer.add_new_item(data)
def manage_events(self, data, user):
buffer = self.search_buffer("events", user)
play_sound = "new_event.ogg"
if "events" in buffer.session.settings["other_buffers"]["muted_buffers"]: return
if "events" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
self.notify(buffer.session, play_sound=play_sound)
buffer.add_new_item(data)
def manage_followers(self, data, user):
buffer = self.search_buffer("followers", user)
play_sound = "update_followers.ogg"
if "followers" in buffer.session.settings["other_buffers"]["muted_buffers"]: return
if "followers" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
self.notify(buffer.session, play_sound=play_sound)
buffer.add_new_item(data)
pub.sendMessage("restart-streams", streams=["main_stream"], session=buffer.session)
@ -958,7 +958,7 @@ class Controller(object):
def manage_favourite(self, data, user):
buffer = self.search_buffer("favourites", user)
play_sound = "favourite.ogg"
if "favourites" in buffer.session.settings["other_buffers"]["muted_buffers"]: return
if "favourites" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
self.notify(buffer.session, play_sound=play_sound)
buffer.add_new_item(data)
@ -977,13 +977,10 @@ class Controller(object):
def manage_item_in_timeline(self, data, user, who):
buffer = self.search_buffer("%s-timeline" % (who,), user)
play_sound = "tweet_timeline.ogg"
if "%s-timeline" % (who,) in buffer.session.settings["other_buffers"]["muted_buffers"]: return
if "%s-timeline" % (who,) not in buffer.session.settings["other_buffers"]["muted_buffers"]:
self.notify(buffer.session, play_sound=play_sound)
buffer.add_new_item(data)
def editing_keystroke(self, action, parentDialog):
print "i've pressed"
def start_buffers(self, session):
log.debug("starting buffers... Session %s" % (session.session_id,))
for i in self.buffers: