forum : commentaires courts sous les réponses (un niveau, 500 caractères, liens cliquables)

- table comments + comment_reports (migration idempotente, IP purgée après un an)
- bouton « Commenter » dans la barre du message ; 3 derniers visibles, les autres repliés
- membres connectés (profils privés compris) ; visiteurs en lecture ; jamais dans le Bulletin
- hors limite VISITEUR_MAX et hors comptage des tris
- signalement (page Signalements), masquage modérateur, suppression par l'auteur

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cette révision appartient à :
Théo GastineletClaude Opus 5.5 a révisé 2026-11-06 16:29:27 +01:00
1 Parent 30c14d478f
révision c3760e2bf0
5 fichiers modifiés
+328 -6

Aucun fichier ne correspond à votre recherche

+10
Voir le fichier
@@ -163,6 +163,16 @@ def connecter(chemin=":memory:"):
" user_id INTEGER NOT NULL REFERENCES users(id), username TEXT NOT NULL,"
" jusqu_au TEXT NOT NULL DEFAULT (datetime('now')))")
con.execute("CREATE INDEX IF NOT EXISTS idx_usernames_anciens ON usernames_anciens(user_id, id)")
# Commentaires aux réponses (06/11/2026) : un seul niveau, texte simple ; ils ne comptent pas comme des messages
# (limite des visiteurs, tris). Tables à part : rien ne change pour posts et reports.
con.execute("CREATE TABLE IF NOT EXISTS comments (id INTEGER PRIMARY KEY,"
" post_id INTEGER NOT NULL REFERENCES posts(id), author_id INTEGER NOT NULL REFERENCES users(id),"
" body TEXT NOT NULL, created_at TEXT NOT NULL DEFAULT (datetime('now')),"
" hidden INTEGER NOT NULL DEFAULT 0, ip TEXT)")
con.execute("CREATE INDEX IF NOT EXISTS idx_comments_post ON comments(post_id, id)")
con.execute("CREATE TABLE IF NOT EXISTS comment_reports (id INTEGER PRIMARY KEY,"
" comment_id INTEGER NOT NULL REFERENCES comments(id), reporter_id INTEGER NOT NULL REFERENCES users(id),"
" reason TEXT NOT NULL, created_at TEXT NOT NULL DEFAULT (datetime('now')), UNIQUE (comment_id, reporter_id))")
con.execute("INSERT OR IGNORE INTO users(hub_id, display_name) VALUES (?, ?)", (SYSTEME, "vercors.me"))
if con.execute("SELECT 1 FROM topics WHERE fixed=1").fetchone() is None:
sid = con.execute("SELECT id FROM users WHERE hub_id=?", (SYSTEME,)).fetchone()[0]