Enforce a maximum of 20 users per scope (plus 1 admin = 21).
(username: str, is_admin_flag: bool, scope: str)
| 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() |
| 1245 | conn.close() |
| 1246 | by = {r["sender"]: int(r["c"]) for r in rows} if rows else {} |
| 1247 | return sum(by.values()), by |
| 1248 | |
| 1249 | # --------------------------- |
| 1250 | # Session key |
| 1251 | # --------------------------- |
| 1252 | |
| 1253 | def load_or_create_session_key() -> str: |
| 1254 | """load_or_create_session_key. |
| 1255 |
no test coverage detected