Handles reposts in wall buffer. Get extended information in buffer loading
This commit is contained in:
parent
5905138c03
commit
ef2afefd56
@ -50,7 +50,7 @@ class Controller(object):
|
|||||||
self.window.insert_buffer(home.tab, _(u"Home"), self.window.search("posts"))
|
self.window.insert_buffer(home.tab, _(u"Home"), self.window.search("posts"))
|
||||||
self.repeatedUpdate = RepeatingTimer(180, self.update_all_buffers)
|
self.repeatedUpdate = RepeatingTimer(180, self.update_all_buffers)
|
||||||
self.repeatedUpdate.start()
|
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.buffers.append(feed)
|
||||||
self.window.insert_buffer(feed.tab, _(u"My wall"), self.window.search("posts"))
|
self.window.insert_buffer(feed.tab, _(u"My wall"), self.window.search("posts"))
|
||||||
audios = buffers.empty(parent=self.window.tb, name="audios")
|
audios = buffers.empty(parent=self.window.tb, name="audios")
|
||||||
|
@ -97,13 +97,14 @@ def compose_new(status, session):
|
|||||||
composed_video = compose_video(status["video"]["items"][i], session)
|
composed_video = compose_video(status["video"]["items"][i], session)
|
||||||
prem += u"{0} - {1}, ".format(composed_video[0], composed_video[1])
|
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)
|
message = _(u"{0} has added {1} videos: {2}").format(user, status["video"]["count"], prem)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if status["type"] != "post": print status
|
if status["type"] != "post": print status
|
||||||
return [user, message, created_at]
|
return [user, message, created_at]
|
||||||
|
|
||||||
def compose_status(status, session):
|
def compose_status(status, session):
|
||||||
user = session.get_user_name(status["from_id"])
|
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 = ""
|
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())
|
||||||
@ -227,6 +228,8 @@ class vkSession(object):
|
|||||||
if data != None:
|
if data != None:
|
||||||
if type(data) == dict:
|
if type(data) == dict:
|
||||||
num = self.order_buffer(name, data["items"], show_nextpage)
|
num = self.order_buffer(name, data["items"], show_nextpage)
|
||||||
|
if data.has_key("profiles") and data.has_key("groups"):
|
||||||
|
self.process_usernames(data)
|
||||||
else:
|
else:
|
||||||
num = self.order_buffer(name, data, show_nextpage)
|
num = self.order_buffer(name, data, show_nextpage)
|
||||||
return num
|
return num
|
||||||
|
Loading…
Reference in New Issue
Block a user