diff --git a/src/controller/buffers.py b/src/controller/buffers.py index 7ba67ab..72eb217 100644 --- a/src/controller/buffers.py +++ b/src/controller/buffers.py @@ -70,7 +70,7 @@ class baseBuffer(object): if event != None: try: getattr(self, event)() - except KeyError: + except AttributeError: pass def volume_down(self): diff --git a/src/controller/posts.py b/src/controller/posts.py index f891b5b..a5e47f1 100644 --- a/src/controller/posts.py +++ b/src/controller/posts.py @@ -36,7 +36,10 @@ class postController(object): if self.post.has_key("type"): if self.post["type"] == "post": from_ = self.session.get_user_name(self.post["source_id"]) - title = _(u"Post from {0}").format(from_,) + if self.post.has_key("copy_owner_id"): + title = _(u"repost from {0}").format(from_,) + else: + title = _(u"Post from {0}").format(from_,) self.dialog.set_title(title) message = u"" if self.post.has_key("text"): diff --git a/src/sessionmanager/session.py b/src/sessionmanager/session.py index 1f80edd..444f336 100644 --- a/src/sessionmanager/session.py +++ b/src/sessionmanager/session.py @@ -59,6 +59,8 @@ def add_text(status): def compose_new(status, session): """ This method is used to compose an item of the news feed.""" user = session.get_user_name(status["source_id"]) + if status.has_key("copy_owner_id"): + user = _(u"{0} has shared the {1}'s post").format(user, session.get_user_name(status["copy_owner_id"])) message = "" original_date = arrow.get(status["date"]) created_at = original_date.humanize(locale=languageHandler.getLanguage()) @@ -69,7 +71,7 @@ def compose_new(status, session): if message == "": message = "no description available" elif status["type"] == "audio": - message = _(u"{0} has posted an audio: {1}").format(user, u", ".join(compose_audio(status["audio"][1], session)),) + message = _(u"{0} has added an audio: {1}").format(user, u", ".join(compose_audio(status["audio"][1], session)),) elif status["type"] == "friend": msg_users = u"" for i in status["friends"][1:]: @@ -84,7 +86,10 @@ def compose_status(status, session): message = "" original_date = arrow.get(status["date"]) created_at = original_date.humanize(locale=languageHandler.getLanguage()) - if status["post_type"] == "post": + if status.has_key("copy_owner_id"): + user = _(u"{0} has shared the {1}'s post").format(user, session.get_user_name(status["copy_owner_id"])) + print status.keys() + if status["post_type"] == "post" or status["post_type"] == "copy": message += add_text(status) if status.has_key("attachment") and len(status["attachment"]) > 0: message += add_attachment(status["attachment"])