Return a set of usernames considered online in the given scope.
(scope: str)
| 1227 | return f"\n:root{{--accent:{a['accent']};--accent-hover:{a['hover']};--app-font:{f['stack']};}}\n" |
| 1228 | |
| 1229 | |
| 1230 | # --------------------------- |
| 1231 | # Notifications helpers |
| 1232 | # --------------------------- |
| 1233 | |
| 1234 | def dm_unread_counts(me: str) -> Tuple[int, Dict[str, int]]: |
| 1235 | """Return (total_unread, {sender: count}).""" |
| 1236 | if not me: |
| 1237 | return 0, {} |
| 1238 | conn = db_connect() |
| 1239 | rows = conn.execute(""" |
| 1240 | SELECT sender, COUNT(*) AS c |
| 1241 | FROM dm_messages |
| 1242 | WHERE recipient=? AND read_at IS NULL AND (deleted_at IS NULL OR deleted_at='') |
| 1243 | GROUP BY sender |
| 1244 | """, (me,)).fetchall() |
no test coverage detected