MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / current_scope

Function current_scope

Scripts/ButSystem.py:1177–1187  ·  view source on GitHub ↗

Return a presence scope based on the host used to reach the app. This keeps 'online' accurate per generated link (local vs cloudflared vs tor), so users are only shown online if they're actually active on the same link.

()

Source from the content-addressed store, hash-verified

1175# ---------------------------
1176# Appearance preference helpers
1177# ---------------------------
1178
1179def get_user_prefs(username: Optional[str]) -> Dict[str, str]:
1180 """Return saved UI preferences for a user (accent + font).
1181
1182 Falls back to DEFAULT_PREFS if nothing is saved yet.
1183 """
1184 prefs = dict(DEFAULT_PREFS)
1185 if not username:
1186 return prefs
1187 try:
1188 conn = db_connect()
1189 row = conn.execute(
1190 "SELECT accent_key, font_key, ui_theme_key FROM user_prefs WHERE username=?",

Callers 8

loginFunction · 0.70
two_factorFunction · 0.70
group_chatFunction · 0.70
api_presenceFunction · 0.70
story_reactFunction · 0.70
story_mediaFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected