From 410e68f048c30715b696989e1bc864f48309eb37 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 13 Oct 2020 21:42:07 +0100 Subject: [PATCH] Set instance type before theme change --- daemon.py | 104 +++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/daemon.py b/daemon.py index b5433878b..1b10c4b5c 100644 --- a/daemon.py +++ b/daemon.py @@ -3355,6 +3355,58 @@ class PubServer(BaseHTTPRequestHandler): "mediaInstance", self.server.mediaInstance) + # change news instance status + if fields.get('newsInstance'): + self.server.newsInstance = False + self.server.defaultTimeline = 'inbox' + if fields['newsInstance'] == 'on': + self.server.newsInstance = True + self.server.blogsInstance = False + self.server.mediaInstance = False + self.server.defaultTimeline = 'tlnews' + setConfigParam(baseDir, + "mediaInstance", + self.server.mediaInstance) + setConfigParam(baseDir, + "blogsInstance", + self.server.blogsInstance) + setConfigParam(baseDir, + "newsInstance", + self.server.newsInstance) + else: + if self.server.newsInstance: + self.server.newsInstance = False + self.server.defaultTimeline = 'inbox' + setConfigParam(baseDir, + "newsInstance", + self.server.mediaInstance) + + # change blog instance status + if fields.get('blogsInstance'): + self.server.blogsInstance = False + self.server.defaultTimeline = 'inbox' + if fields['blogsInstance'] == 'on': + self.server.blogsInstance = True + self.server.mediaInstance = False + self.server.newsInstance = False + self.server.defaultTimeline = 'tlblogs' + setConfigParam(baseDir, + "blogsInstance", + self.server.blogsInstance) + setConfigParam(baseDir, + "mediaInstance", + self.server.mediaInstance) + setConfigParam(baseDir, + "newsInstance", + self.server.newsInstance) + else: + if self.server.blogsInstance: + self.server.blogsInstance = False + self.server.defaultTimeline = 'inbox' + setConfigParam(baseDir, + "blogsInstance", + self.server.blogsInstance) + # change theme if fields.get('themeDropdown'): setTheme(baseDir, @@ -3715,58 +3767,6 @@ class PubServer(BaseHTTPRequestHandler): if currTheme: setTheme(baseDir, currTheme, domain) - # change news instance status - if fields.get('newsInstance'): - self.server.newsInstance = False - self.server.defaultTimeline = 'inbox' - if fields['newsInstance'] == 'on': - self.server.newsInstance = True - self.server.blogsInstance = False - self.server.mediaInstance = False - self.server.defaultTimeline = 'tlnews' - setConfigParam(baseDir, - "mediaInstance", - self.server.mediaInstance) - setConfigParam(baseDir, - "blogsInstance", - self.server.blogsInstance) - setConfigParam(baseDir, - "newsInstance", - self.server.newsInstance) - else: - if self.server.newsInstance: - self.server.newsInstance = False - self.server.defaultTimeline = 'inbox' - setConfigParam(baseDir, - "newsInstance", - self.server.mediaInstance) - - # change blog instance status - if fields.get('blogsInstance'): - self.server.blogsInstance = False - self.server.defaultTimeline = 'inbox' - if fields['blogsInstance'] == 'on': - self.server.blogsInstance = True - self.server.mediaInstance = False - self.server.newsInstance = False - self.server.defaultTimeline = 'tlblogs' - setConfigParam(baseDir, - "blogsInstance", - self.server.blogsInstance) - setConfigParam(baseDir, - "mediaInstance", - self.server.mediaInstance) - setConfigParam(baseDir, - "newsInstance", - self.server.newsInstance) - else: - if self.server.blogsInstance: - self.server.blogsInstance = False - self.server.defaultTimeline = 'inbox' - setConfigParam(baseDir, - "blogsInstance", - self.server.blogsInstance) - # only receive DMs from accounts you follow followDMsFilename = \ baseDir + '/accounts/' + \