From c5246e73cac4c989ba334cc80e6de665709b3c2d Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Wed, 9 Jan 2019 17:24:00 -0600 Subject: [PATCH] Retrieve wallposts when displaying them for updating likes, reposts and view info --- src/presenters/postDisplayer.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/presenters/postDisplayer.py b/src/presenters/postDisplayer.py index e8b0a0c..77a236b 100644 --- a/src/presenters/postDisplayer.py +++ b/src/presenters/postDisplayer.py @@ -105,6 +105,15 @@ class displayPostPresenter(base.basePresenter): title = _("Post from {0}").format(from_,) self.send_message("set_title", value=title) message = "" + # Retrieve again the post, so we'll make sure to get the most up to date information. + # And we add a counter for views. + post = self.session.vk.client.wall.getById(posts="{owner_id}_{post_id}".format(owner_id=self.post[self.user_identifier], post_id=self.post[self.post_identifier])) + self.post = post[0] + if "owner_id" not in self.post: + self.user_identifier = "from_id" + else: + self.user_identifier = "owner_id" + self.post_identifier = "id" message = get_message(self.post) if "copy_history" in self.post: nm = "\n"