Retro Bulletin Board Systems on atproto. Web app and TUI.
atbbs.xyz
python
tui
atproto
bbs
1"""TUI utilities — delegates to core."""
2
3from core.util import format_datetime_local as format_datetime
4
5
6def require_session(screen) -> dict | None:
7 """Return the user session if logged in and not banned, else notify and return None."""
8 session = screen.app.user_session
9 if not session:
10 screen.notify("You must be logged in to do that.", severity="error")
11 return None
12 if screen.bbs.site.is_banned(session["did"]):
13 screen.notify("You have been banned from this BBS.", severity="error")
14 return None
15 return session