=> af5966cedf4822f11846c6088bb941b6ed7fae37
[1mdiff --git a/50_bubble.py b/50_bubble.py[m [1mindex 815cfef..78ce645 100644[m [1m--- a/50_bubble.py[m [1m+++ b/50_bubble.py[m [36m@@ -92,6 +92,13 @@[m [mBubble is open source:[m self.c_user = None # User associated with the context subspace, if any[m self.token = None[m [m [32m+[m[32m def set_user(self, user):[m [32m+[m[32m self.user = user[m [32m+[m[32m if user:[m [32m+[m[32m if user.flags & User.ASCII_ICONS_FLAG:[m [32m+[m[32m self.CHECKS = [ '[_]', '[x]' ][m [32m+[m[32m # TODO: Add more of these.[m [32m+[m def is_editable(self, post: Post):[m return self.user.role == User.ADMIN or post.user == self.user.id[m [m [36m@@ -315,7 +322,7 @@[m [mBubble is open source:[m [m if req.identity:[m # Find the user account.[m [31m- session.user = db.get_user(identity=req.identity)[m [32m+[m[32m session.set_user(db.get_user(identity=req.identity))[m if session.user is None:[m if req.path == self.path + 'register':[m if not session.bubble.user_register:[m [1mdiff --git a/model.py b/model.py[m [1mindex 70a2afd..8f2ece0 100644[m [1m--- a/model.py[m [1m+++ b/model.py[m [36m@@ -152,6 +152,7 @@[m [mclass User:[m [m # Flags:[m HOME_FOLLOWED_FEED_FLAG = 0x1[m [32m+[m[32m ASCII_ICONS_FLAG = 0x2[m [m def __init__(self, id, name, info, url, avatar, role, flags, notif, email, email_inter, \[m password, ts_password, ts_created, ts_active, sort_post, sort_cmt):[m [1mdiff --git a/settings.py b/settings.py[m [1mindex bba523d..ba87bd4 100644[m [1m--- a/settings.py[m [1m+++ b/settings.py[m [36m@@ -192,6 +192,10 @@[m [mdef make_settings_page(session):[m User.SORT_COMMENT_NEWEST))[m return 30, '/settings'[m [m [32m+[m[32m elif req.path == session.path + 'settings/ascii':[m [32m+[m[32m db.update_user(session.user, flags=(session.user.flags ^ User.ASCII_ICONS_FLAG))[m [32m+[m[32m return 30, '/settings'[m [32m+[m elif req.path == session.path + 'settings/notif':[m notif = session.user.notif[m [m [36m@@ -395,11 +399,13 @@[m [mdef make_settings_page(session):[m SORT_POST = { 'r': '🕑 Most recent', 'h': '🔥 Hotness' }[m SORT_COMMENT = { 'o': '⬇ Oldest first', 'n': '⬆ Newest first' }[m HOME_FEED = [ 'All Posts', 'Followed' ][m [32m+[m[32m ICON_MODE = [ 'Unicode/Emoji' , 'ASCII' ][m user_space = db.get_subspace(owner=session.user.id)[m [m page += f'=> /settings/homefeed Home feed: {HOME_FEED[nonzero(session.user.flags & User.HOME_FOLLOWED_FEED_FLAG)]}\n'[m page += f'=> /settings/sort-feed Sort posts: {SORT_POST[session.user.sort_post]}\n'[m page += f'=> /settings/sort-cmt Sort comments: {SORT_COMMENT[session.user.sort_cmt]}\n'[m [32m+[m[32m page += f'=> /settings/ascii Display icons as: {ICON_MODE[nonzero(session.user.flags & User.ASCII_ICONS_FLAG)]}\n'[m [m page += f'\n=> /settings/omit-all {session.CHECKS[nonzero(user_space.flags & Subspace.OMIT_FROM_ALL_FLAG)]} ' + \[m f'Omit u/{session.user.name} from All Posts\n'[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).