Added reposts in API 5.45
This commit is contained in:
parent
2fe26beef9
commit
d9621f194b
@ -117,6 +117,7 @@ class Controller(object):
|
|||||||
player.player.play_all(audios)
|
player.player.play_all(audios)
|
||||||
|
|
||||||
def view_post(self, post_object, controller_):
|
def view_post(self, post_object, controller_):
|
||||||
|
print post_object
|
||||||
p = getattr(posts, controller_)(self.session, post_object)
|
p = getattr(posts, controller_)(self.session, post_object)
|
||||||
p.dialog.get_response()
|
p.dialog.get_response()
|
||||||
p.dialog.Destroy()
|
p.dialog.Destroy()
|
||||||
|
@ -50,18 +50,21 @@ def add_attachment(attachment):
|
|||||||
def add_text(status):
|
def add_text(status):
|
||||||
""" This shorts the text to 140 characters for displaying it in the list control."""
|
""" This shorts the text to 140 characters for displaying it in the list control."""
|
||||||
message = ""
|
message = ""
|
||||||
if status.has_key("text"):
|
if status.has_key("copy_history"):
|
||||||
if len(status["text"]) < 140:
|
txt = status["copy_history"][0]["text"]
|
||||||
message = utils.clean_text(status["text"])
|
else:
|
||||||
else:
|
txt = status["text"]
|
||||||
message = utils.clean_text(status["text"][:139])
|
if len(txt) < 140:
|
||||||
|
message = utils.clean_text(txt)
|
||||||
|
else:
|
||||||
|
message = utils.clean_text(txt[:139])
|
||||||
return message
|
return message
|
||||||
|
|
||||||
def compose_new(status, session):
|
def compose_new(status, session):
|
||||||
""" This method is used to compose an item of the news feed."""
|
""" This method is used to compose an item of the news feed."""
|
||||||
user = session.get_user_name(status["source_id"])
|
user = session.get_user_name(status["source_id"])
|
||||||
if status.has_key("copy_owner_id"):
|
if status.has_key("copy_history"):
|
||||||
user = _(u"{0} has shared the {1}'s post").format(user, session.get_user_name(status["copy_owner_id"]))
|
user = _(u"{0} has shared the {1}'s post").format(user, session.get_user_name(status["copy_history"][0]["owner_id"]))
|
||||||
message = ""
|
message = ""
|
||||||
original_date = arrow.get(status["date"])
|
original_date = arrow.get(status["date"])
|
||||||
created_at = original_date.humanize(locale=languageHandler.getLanguage())
|
created_at = original_date.humanize(locale=languageHandler.getLanguage())
|
||||||
|
Loading…
Reference in New Issue
Block a user