diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 02b8d154c..3a039d56e 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -6433,3 +6433,9 @@ div.markdown { font-size: 11px; } } + +@media (max-width: 768px) { + .download-video { + font-size: 10px; + } +} diff --git a/files/classes/user.py b/files/classes/user.py index 0149235c9..e855d91f5 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -1016,12 +1016,15 @@ class User(Base): Whether a user can strictly see this item. can_see_content is used where content of a thing can be hidden from view ''' + browser = g and g.browser # TODO: request state object to pass to models for purity if isinstance(other, (Submission, Comment)): if not cls.can_see(user, other.author): return False if user and user.id == other.author_id: return True if isinstance(other, Submission): if "!YOU!" in other.title and not user: return False - if not g.webview and other.author_id == AEVANN_ID and other.title.startswith('[ANDROID]'): + if browser != 'webview' and other.author_id == AEVANN_ID and other.title.startswith('[ANDROID]'): + return False + if browser != 'apple' and other.author_id == CARP_ID and other.title.startswith('[APPLE]'): return False if other.sub and not cls.can_see(user, other.subr): return False else: diff --git a/files/routes/allroutes.py b/files/routes/allroutes.py index 59bb74738..9091c7ff1 100644 --- a/files/routes/allroutes.py +++ b/files/routes/allroutes.py @@ -30,7 +30,14 @@ def before_request(): if not get_setting('bots') and request.headers.get("Authorization"): abort(403) - g.webview = '; wv) ' in ua + if '; wv) ' in ua: + g.browser = 'webview' + elif ' firefox/' in ua: + g.browser = 'firefox' + elif 'iphone' in ua or 'ipad' in ua or 'ipod' in ua or 'mac os' in ua: + g.browser = 'apple' + else: + g.browser = 'chromium' g.is_tor = request.headers.get("cf-ipcountry") == "T1" diff --git a/files/templates/app.html b/files/templates/app.html index c14d697e5..3d3cbd79e 100644 --- a/files/templates/app.html +++ b/files/templates/app.html @@ -4,15 +4,10 @@