Rev1899, Add followed feed number to site info

This commit is contained in:
shortcutme 2017-02-14 19:03:17 +01:00
parent 94485ed78c
commit 179ee2d2a4
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 10 additions and 1 deletions

View file

@ -7,6 +7,15 @@ from Db import DbQuery
@PluginManager.registerTo("UiWebsocket")
class UiWebsocketPlugin(object):
def formatSiteInfo(self, site, create_user=True):
site_info = super(UiWebsocketPlugin, self).formatSiteInfo(site, create_user=True)
feed_following = self.user.sites[site.address].get("follow", None)
if feed_following == None:
site_info["feed_following"] = None
else:
site_info["feed_following"] = len(feed_following)
return site_info
def actionFeedFollow(self, to, feeds):
self.user.setFeedFollow(self.site.address, feeds)
self.user.save()

View file

@ -10,7 +10,7 @@ class Config(object):
def __init__(self, argv):
self.version = "0.5.2"
self.rev = 1896
self.rev = 1899
self.argv = argv
self.action = None
self.config_file = "zeronet.conf"