From 72b5db2d9ed1a365438c8d1724d0a268227fc854 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 8 Oct 2020 18:49:03 +0100 Subject: [PATCH] Newswire votes threshold --- daemon.py | 4 ++++ epicyon.py | 5 +++++ tests.py | 6 +++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index ebe93ad5..81cc167d 100644 --- a/daemon.py +++ b/daemon.py @@ -11356,6 +11356,7 @@ def loadTokens(baseDir: str, tokensDict: {}, tokensLookup: {}) -> None: def runDaemon(positiveVoting: bool, + newswireVotesThreshold: int, newsInstance: bool, blogsInstance: bool, mediaInstance: bool, @@ -11466,6 +11467,9 @@ def runDaemon(positiveVoting: bool, # on the newswire, whether moderators vote positively for items # or against them (veto) httpd.positiveVoting = positiveVoting + # number of votes needed to remove a newswire item from the news timeline + # or if positive voting is anabled to add the item to the news timeline + httpd.newswireVotesThreshold = newswireVotesThreshold if registration == 'open': httpd.registration = True diff --git a/epicyon.py b/epicyon.py index ea13307d..4c89797b 100644 --- a/epicyon.py +++ b/epicyon.py @@ -256,6 +256,10 @@ parser.add_argument('--archiveweeks', dest='archiveWeeks', type=str, parser.add_argument('--maxposts', dest='archiveMaxPosts', type=str, default=None, help='Maximum number of posts in in/outbox') +parser.add_argument('--minimumVotes', dest='minimumVotes', type=str, + default=None, + help='Minimum number of votes to remove or add' + + ' a newswire item') parser.add_argument('--message', dest='message', type=str, default=None, help='Message content') @@ -1916,6 +1920,7 @@ if setTheme(baseDir, themeName): if __name__ == "__main__": runDaemon(args.positivevoting, + args.minimumVotes, args.newsinstance, args.blogsinstance, args.mediainstance, args.maxRecentPosts, diff --git a/tests.py b/tests.py index 8a8989e0..0de1c0c6 100644 --- a/tests.py +++ b/tests.py @@ -287,7 +287,7 @@ def createServerAlice(path: str, domain: str, port: int, onionDomain = None i2pDomain = None print('Server running: Alice') - runDaemon(False, False, False, False, + runDaemon(False, 1, False, False, False, 5, True, True, 'en', __version__, "instanceId", False, path, domain, onionDomain, i2pDomain, None, port, port, @@ -350,7 +350,7 @@ def createServerBob(path: str, domain: str, port: int, onionDomain = None i2pDomain = None print('Server running: Bob') - runDaemon(False, False, False, False, + runDaemon(False, 1, False, False, False, 5, True, True, 'en', __version__, "instanceId", False, path, domain, onionDomain, i2pDomain, None, port, port, @@ -387,7 +387,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [], onionDomain = None i2pDomain = None print('Server running: Eve') - runDaemon(False, False, False, False, + runDaemon(False, 1, False, False, False, 5, True, True, 'en', __version__, "instanceId", False, path, domain, onionDomain, i2pDomain, None, port, port,