diff --git a/daemon.py b/daemon.py index caa6db0cf..b3f03e6b5 100644 --- a/daemon.py +++ b/daemon.py @@ -9318,6 +9318,7 @@ class PubServer(BaseHTTPRequestHandler): return timelinePath = \ '/users/' + nickname + '/' + self.server.defaultTimeline + showPublishAsIcon = self.server.showPublishAsIcon msg = htmlNewswireMobile(self.server.baseDir, nickname, self.server.domain, @@ -9326,7 +9327,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.translate, self.server.newswire, self.server.positiveVoting, - timelinePath).encode('utf-8') + timelinePath, + showPublishAsIcon).encode('utf-8') self._set_headers('text/html', len(msg), cookie, callingDomain) self._write(msg) self.server.GETbusy = False @@ -11982,7 +11984,8 @@ def loadTokens(baseDir: str, tokensDict: {}, tokensLookup: {}) -> None: tokensLookup[token] = nickname -def runDaemon(maxFollowers: int, +def runDaemon(showPublishAsIcon: bool, + maxFollowers: int, allowNewsFollowers: bool, maxNewsPosts: int, maxMirroredArticles: int, @@ -12137,6 +12140,10 @@ def runDaemon(maxFollowers: int, # maximum number of followers per account httpd.maxFollowers = maxFollowers + # whether to show an icon for publish on the + # newswire, or a 'Publish' button + httpd.showPublishAsIcon = showPublishAsIcon + if registration == 'open': httpd.registration = True else: diff --git a/epicyon.py b/epicyon.py index 4477a419d..f2c2e97e0 100644 --- a/epicyon.py +++ b/epicyon.py @@ -209,6 +209,12 @@ parser.add_argument("--repliesEnabled", "--commentsEnabled", type=str2bool, nargs='?', const=True, default=True, help="Enable replies to a post") +parser.add_argument("--showPublishAsIcon", + dest='showPublishAsIcon', + type=str2bool, nargs='?', + const=True, default=True, + help="Whether to show newswire publish " + + "as an icon or a button") parser.add_argument("--allowNewsFollowers", dest='allowNewsFollowers', type=str2bool, nargs='?', @@ -1985,6 +1991,11 @@ allowNewsFollowers = \ if allowNewsFollowers is not None: args.allowNewsFollowers = bool(allowNewsFollowers) +showPublishAsIcon = \ + getConfigParam(baseDir, 'showPublishAsIcon') +if showPublishAsIcon is not None: + args.showPublishAsIcon = bool(showPublishAsIcon) + YTDomain = getConfigParam(baseDir, 'youtubedomain') if YTDomain: if '://' in YTDomain: @@ -1998,7 +2009,8 @@ if setTheme(baseDir, themeName, domain): print('Theme set to ' + themeName) if __name__ == "__main__": - runDaemon(args.maxFollowers, + runDaemon(args.showPublishAsIcon, + args.maxFollowers, args.allowNewsFollowers, args.maxNewsPosts, args.maxMirroredArticles, diff --git a/manualapprove.py b/manualapprove.py index 5bb3c3be8..e06f3d26a 100644 --- a/manualapprove.py +++ b/manualapprove.py @@ -131,7 +131,7 @@ def manualApproveFollowRequest(session, baseDir: str, with open(approveFollowsFilename, 'r') as approvefile: for handleOfFollowRequester in approvefile: # is this the approved follow? - if handleOfFollowRequester.startswith(approveHandle): + if handleOfFollowRequester.startswith(approveHandleFull): handleOfFollowRequester = \ handleOfFollowRequester.replace('\n', '').replace('\r', '') port2 = port diff --git a/tests.py b/tests.py index 3aab23de8..dd72ef8d1 100644 --- a/tests.py +++ b/tests.py @@ -290,7 +290,7 @@ def createServerAlice(path: str, domain: str, port: int, onionDomain = None i2pDomain = None print('Server running: Alice') - runDaemon(10, False, 0, 100, 1024, 5, False, + runDaemon(True, 10, False, 0, 100, 1024, 5, False, 0, False, 1, False, False, False, 5, True, True, 'en', __version__, "instanceId", False, path, domain, @@ -354,7 +354,7 @@ def createServerBob(path: str, domain: str, port: int, onionDomain = None i2pDomain = None print('Server running: Bob') - runDaemon(10, False, 0, 100, 1024, 5, False, 0, + runDaemon(True, 10, False, 0, 100, 1024, 5, False, 0, False, 1, False, False, False, 5, True, True, 'en', __version__, "instanceId", False, path, domain, @@ -392,7 +392,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [], onionDomain = None i2pDomain = None print('Server running: Eve') - runDaemon(10, False, 0, 100, 1024, 5, False, 0, + runDaemon(True, 10, False, 0, 100, 1024, 5, False, 0, False, 1, False, False, False, 5, True, True, 'en', __version__, "instanceId", False, path, domain, diff --git a/webinterface.py b/webinterface.py index 85ef78da5..0d6e5cc38 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5850,7 +5850,8 @@ def htmlNewswireMobile(baseDir: str, nickname: str, httpPrefix: str, translate: {}, newswire: {}, positiveVoting: bool, - timelinePath: str) -> str: + timelinePath: str, + showPublishAsIcon: bool) -> str: """Shows the mobile version of the newswire right column """ htmlStr = '' @@ -5886,7 +5887,7 @@ def htmlNewswireMobile(baseDir: str, nickname: str, iconsDir, moderator, editor, newswire, positiveVoting, True, timelinePath, True, - True) + showPublishAsIcon) htmlStr += htmlFooter() return htmlStr