Added a buffer for displaying topics. Community buffers will keep group_info on them so we can check for group permissions and available post types

This commit is contained in:
Manuel Cortez 2019-01-31 16:46:26 -06:00
parent 9e3ff74b98
commit f09d1b5da1

View File

@ -481,6 +481,25 @@ class communityBuffer(feedBuffer):
print(self.group_info["counters"])
super(communityBuffer, self).get_items(*args, **kwargs)
class topicBuffer(feedBuffer):
def create_tab(self, parent):
self.tab = home.topicTab(parent)
self.connect_events()
self.tab.name = self.name
if hasattr(self, "can_post") and self.can_post == False and hasattr(self.tab, "post"):
self.tab.post.Enable(False)
def onFocus(self, *args, **kwargs):
pass
def open_post(self, *args, **kwargs):
""" Opens the currently focused post."""
post = self.get_post()
if post == None:
return
a = presenters.displayTopicPresenter(session=self.session, postObject=post, group_id=self.kwargs["group_id"], interactor=interactors.displayPostInteractor(), view=views.displayTopic())
class audioBuffer(feedBuffer):
""" this buffer was supposed to be used with audio elements
but is deprecated as VK removed its audio support for third party apps."""