Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/controllers/ForumPost.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ final class ForumPost(env: Env) extends LilaController(env) with ForumController
given play.api.mvc.Request[?] = ctx.body
OptionFuResult(topicApi.show(categId, slug, page, ctx.me)) { case (categ, topic, posts) =>
if (topic.closed) fuccess(BadRequest("This topic is closed"))
else if (topic.isOld) fuccess(BadRequest("This topic is archived"))
else
categ.team.?? { env.team.cached.isLeader(_, me.id) } flatMap { inOwnTeam =>
forms
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ForumTopic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ final class ForumTopic(env: Env) extends LilaController(env) with ForumControlle
inOwnTeam <- ~(categ.team, ctx.me).mapN { case (teamId, me) =>
env.team.cached.isLeader(teamId, me.id)
}
form <- ctx.me.filter(_ => canWrite && topic.open && !topic.isOld) ?? { me =>
form <- ctx.me.filter(_ => canWrite && topic.open) ?? { me =>
forms.postWithCaptcha(me, inOwnTeam) map some
}
_ <- env.user.lightUserApi preloadMany posts.currentPageResults.flatMap(_.post.userId)
Expand Down
4 changes: 1 addition & 3 deletions app/views/forum/topic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ object topic:
),
pager,
div(cls := "forum-topic__actions")(
if (topic.isOld)
p(trans.thisTopicIsArchived())
else if (formWithCaptcha.isDefined)
if (formWithCaptcha.isDefined)
h2(id := "reply")(trans.replyToThisTopic())
else if (topic.closed) p(trans.thisTopicIsNowClosed())
else
Expand Down
8 changes: 5 additions & 3 deletions modules/forum/src/main/ForumPostApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ final class ForumPostApi(
else lila.hub.actorApi.shutup.RecordPublicForumMessage(me.id, post.text)
}
if (anonMod) logAnonPost(me.id, post, edit = false)
else if (!post.troll && !categ.quiet && !topic.isTooBig)
else if (!post.troll && !categ.quiet)
timeline ! Propagate(TimelinePost(me.id, topic.id, topic.name, post.id)).pipe {
_ toFollowersOf me.id toUsers topicUserIds exceptUser me.id withTeam categ.team
}
Expand Down Expand Up @@ -197,8 +197,10 @@ final class ForumPostApi(
"userId",
$doc(
"topicId" -> topic.id,
"number" $gt (newPostNumber - 10),
"createdAt" $gt nowInstant.minusDays(5)
"number" $gt (newPostNumber - 20)
// Could we filter solely on topic un/subscribe? That toggle is prominently displayed after clicking
// a (unwanted) timeline entry and the recent post window isn't the best indicator of interest.
// I'm thinking primarily of thoughtful, long running discussions (as if those were a thing).
),
ReadPreference.secondaryPreferred
)
Expand Down