Skip to content

Commit

Permalink
compress appeal messages in mod timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Oct 25, 2024
1 parent 0d39e5c commit f7ad1d0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/api/src/main/ModTimeline.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ object ModTimeline:
case (head :: rest, n) => mergeOne(head, n).fold(head :: mergeMany(rest, n))(_ :: rest)

private def mergeOne(prev: Event, next: Event): Option[Event] = (prev, next) match
case (p: PublicLine, n: PublicLine) => PublicLine.merge(p, n)
case (p: PlayBans, n: PlayBans) => PlayBans(n.list ::: p.list).some
case _ => none
case (p: PublicLine, n: PublicLine) => PublicLine.merge(p, n)
case (p: PlayBans, n: PlayBans) => PlayBans(n.list ::: p.list).some
case (p: AppealMsg, n: AppealMsg) if p.by.is(n.by) => p.copy(text = s"${n.text}\n\n${p.text}").some
case _ => none

private def reportAtoms(report: Report): List[ReportNewAtom | PublicLine] =
report.atoms
Expand Down

0 comments on commit f7ad1d0

Please sign in to comment.