Forum: search, muting members, archived topics, the public threads in the sitemap
- Search (/forum/kereses, the magnifier in the forum bar): thread titles
and posts the viewer may read, Hungarian stems and word beginnings
without accents ("alvas" finds "alvásban"), one result per thread with
the matching words marked.
- Muting a member (post menu, profile; the list in the settings): their
threads leave the lists, their posts fold up, their replies and mentions
no longer count or send e-mails. They are not told.
- The admin archives a topic (Moderálás → Témák): it stays readable but
takes no new threads or replies, and folds away on the front page.
- The public topics and threads are in the sitemap; the forum's own pages
are kept from robots.
- A reply e-mail goes to the one answered, also on the second level.
- Migration 0043 also prepares charts attached to a forum question.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -78,6 +78,7 @@ async fn reply_mails(
|
||||
WHERE m.email_replies = 'instant' AND m.user_id <> $1 AND {OFFLINE} \
|
||||
AND m.user_id IN (SELECT author_id FROM forum.threads WHERE id = $2 \
|
||||
UNION SELECT author_id FROM forum.posts WHERE id = $3) \
|
||||
AND NOT EXISTS (SELECT 1 FROM forum.mutes mu WHERE mu.user_id = m.user_id AND mu.muted_id = $1) \
|
||||
AND NOT EXISTS (SELECT 1 FROM email_outbox e \
|
||||
WHERE e.user_id = m.user_id AND e.template = 'forum_reply' \
|
||||
AND e.payload->>'thread_id' = $2::text AND e.created_at > now() - interval '1 hour')"
|
||||
@@ -226,12 +227,14 @@ pub async fn after_mention(state: &AppState, thread_id: i64, post_id: i64, autho
|
||||
"SELECT m.user_id, u.email, u.locale, m.nickname, m.email_token \
|
||||
FROM forum.members m JOIN users u ON u.id = m.user_id \
|
||||
WHERE m.user_id = ANY($1) AND m.email_mentions = 'instant' AND {OFFLINE} \
|
||||
AND NOT EXISTS (SELECT 1 FROM forum.mutes mu WHERE mu.user_id = m.user_id AND mu.muted_id = $3) \
|
||||
AND NOT EXISTS (SELECT 1 FROM email_outbox e WHERE e.user_id = m.user_id \
|
||||
AND e.template IN ('forum_mention', 'forum_reply') \
|
||||
AND e.payload->>'thread_id' = $2::text AND e.created_at > now() - interval '1 hour')"
|
||||
))
|
||||
.bind(users)
|
||||
.bind(thread_id)
|
||||
.bind(author)
|
||||
.fetch_all(&state.db)
|
||||
.await?;
|
||||
if recipients.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user