Handles reposts in wall buffer. Get extended information in buffer loading

This commit is contained in:
Manuel Cortez 2016-03-30 16:27:37 -06:00
parent 5905138c03
commit ef2afefd56
2 changed files with 5 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class Controller(object):
self.window.insert_buffer(home.tab, _(u"Home"), self.window.search("posts"))
self.repeatedUpdate = RepeatingTimer(180, self.update_all_buffers)
self.repeatedUpdate.start()
feed = buffers.feedBuffer(parent=self.window.tb, name="me_feed", composefunc="compose_status", session=self.session, endpoint="get", parent_endpoint="wall")
feed = buffers.feedBuffer(parent=self.window.tb, name="me_feed", composefunc="compose_status", session=self.session, endpoint="get", parent_endpoint="wall", extended=1)
self.buffers.append(feed)
self.window.insert_buffer(feed.tab, _(u"My wall"), self.window.search("posts"))
audios = buffers.empty(parent=self.window.tb, name="audios")

View File

@ -97,13 +97,14 @@ def compose_new(status, session):
composed_video = compose_video(status["video"]["items"][i], session)
prem += u"{0} - {1}, ".format(composed_video[0], composed_video[1])
message = _(u"{0} has added {1} videos: {2}").format(user, status["video"]["count"], prem)
else:
if status["type"] != "post": print status
return [user, message, created_at]
def compose_status(status, session):
user = session.get_user_name(status["from_id"])
if status.has_key("copy_history"):
user = _(u"{0} has shared the {1}'s post").format(user, session.get_user_name(status["copy_history"][0]["owner_id"]))
message = ""
original_date = arrow.get(status["date"])
created_at = original_date.humanize(locale=languageHandler.getLanguage())
@ -227,6 +228,8 @@ class vkSession(object):
if data != None:
if type(data) == dict:
num = self.order_buffer(name, data["items"], show_nextpage)
if data.has_key("profiles") and data.has_key("groups"):
self.process_usernames(data)
else:
num = self.order_buffer(name, data, show_nextpage)
return num