Now user action events are announced in the events buffer

This commit is contained in:
Manuel Cortez 2015-03-19 05:31:19 -06:00
parent a0f5a3c134
commit a592f747f8
2 changed files with 4 additions and 6 deletions

View File

@ -1012,15 +1012,16 @@ class Controller(object):
if "followers" not in buffer.session.settings["other_buffers"]["muted_buffers"]: if "followers" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
self.notify(buffer.session, play_sound=play_sound) self.notify(buffer.session, play_sound=play_sound)
buffer.add_new_item(data) buffer.add_new_item(data)
pub.sendMessage("restart-streams", streams=["main_stream"], session=buffer.session)
def manage_friend(self, data, user): def manage_friend(self, data, user):
buffer = self.search_buffer("friends", user) buffer = self.search_buffer("friends", user)
buffer.add_new_item(data) buffer.add_new_item(data)
pub.sendMessage("restart-streams", streams=["main_stream"], session=buffer.session)
def manage_unfollowing(self, item, user): def manage_unfollowing(self, item, user):
buffer = self.search_buffer("friends", user) buffer = self.search_buffer("friends", user)
buffer.remove_item(item) buffer.remove_item(item)
pub.sendMessage("restart-streams", streams=["main_stream"], session=buffer.session)
def manage_favourite(self, data, user): def manage_favourite(self, data, user):
buffer = self.search_buffer("favourites", user) buffer = self.search_buffer("favourites", user)
@ -1036,10 +1037,12 @@ class Controller(object):
def manage_blocked_user(self, data, user): def manage_blocked_user(self, data, user):
buffer = self.search_buffer("blocked", user) buffer = self.search_buffer("blocked", user)
buffer.add_new_item(data) buffer.add_new_item(data)
pub.sendMessage("restart-streams", streams=["main_stream"], session=buffer.session)
def manage_unblocked_user(self, item, user): def manage_unblocked_user(self, item, user):
buffer = self.search_buffer("blocked", user) buffer = self.search_buffer("blocked", user)
buffer.remove_item(item) buffer.remove_item(item)
pub.sendMessage("restart-streams", streams=["main_stream"], session=buffer.session)
def manage_item_in_timeline(self, data, user, who): def manage_item_in_timeline(self, data, user, who):
buffer = self.search_buffer("%s-timeline" % (who,), user) buffer = self.search_buffer("%s-timeline" % (who,), user)

View File

@ -24,7 +24,6 @@ class userActionsController(object):
def follow(self, user): def follow(self, user):
try: try:
self.session.twitter.twitter.create_friendship(screen_name=user ) self.session.twitter.twitter.create_friendship(screen_name=user )
pub.sendMessage("restart-streams", streams=["main_stream"], session=self.session)
except TwythonError as err: except TwythonError as err:
output.speak("Error %s: %s" % (err.error_code, err.msg), True) output.speak("Error %s: %s" % (err.error_code, err.msg), True)
@ -37,14 +36,12 @@ class userActionsController(object):
def mute(self, user): def mute(self, user):
try: try:
id = self.session.twitter.twitter.create_mute(screen_name=user ) id = self.session.twitter.twitter.create_mute(screen_name=user )
pub.sendMessage("restart-streams", streams=["main_stream"], session=self.session)
except TwythonError as err: except TwythonError as err:
output.speak("Error %s: %s" % (err.error_code, err.msg), True) output.speak("Error %s: %s" % (err.error_code, err.msg), True)
def unmute(self, user): def unmute(self, user):
try: try:
id = self.session.twitter.twitter.destroy_mute(screen_name=user ) id = self.session.twitter.twitter.destroy_mute(screen_name=user )
pub.sendMessage("restart-streams", streams=["main_stream"], session=self.session)
except TwythonError as err: except TwythonError as err:
output.speak("Error %s: %s" % (err.error_code, err.msg), True) output.speak("Error %s: %s" % (err.error_code, err.msg), True)
@ -57,14 +54,12 @@ class userActionsController(object):
def block(self, user): def block(self, user):
try: try:
id = self.session.twitter.twitter.create_block(screen_name=user ) id = self.session.twitter.twitter.create_block(screen_name=user )
pub.sendMessage("restart-streams", streams=["main_stream"], session=self.session)
except TwythonError as err: except TwythonError as err:
output.speak("Error %s: %s" % (err.error_code, err.msg), True) output.speak("Error %s: %s" % (err.error_code, err.msg), True)
def unblock(self, user): def unblock(self, user):
try: try:
id = self.session.twitter.twitter.destroy_block(screen_name=user ) id = self.session.twitter.twitter.destroy_block(screen_name=user )
pub.sendMessage("restart-streams", streams=["main_stream"], session=self.session)
except TwythonError as err: except TwythonError as err:
output.speak("Error %s: %s" % (err.error_code, err.msg), True) output.speak("Error %s: %s" % (err.error_code, err.msg), True)