Skip to content
Merged
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
3 changes: 0 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,3 @@ kotlin {
}
}

ktorfit {
compilerPluginVersion.set("2.3.4")
}
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,7 @@ private fun RichTextScope.RenderNode(
context.builder.append(node.text())
}

else -> {
Unit
}
else -> {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ private fun DraftBoxItem(
enabled = item.status != UiDraftStatus.SENDING,
leadingContent = {
when (item.status) {
UiDraftStatus.DRAFT -> {
Unit
}
UiDraftStatus.DRAFT -> {}

UiDraftStatus.FAILED -> {
FAIcon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1513,13 +1513,9 @@ private fun mediaViewerPresenter(

fun shareMedia(data: UiMedia) {
when (data) {
is UiMedia.Audio -> {
Unit
}
is UiMedia.Audio -> {}

is UiMedia.Gif -> {
Unit
}
is UiMedia.Gif -> {}

is UiMedia.Image -> {
scope.launch {
Expand All @@ -1531,9 +1527,7 @@ private fun mediaViewerPresenter(
}
}

is UiMedia.Video -> {
Unit
}
is UiMedia.Video -> {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,7 @@ internal fun TranslationConfigScreen(onBack: () -> Unit) {
)
}

TranslateProviderOption.GoogleWeb -> {
Unit
}
TranslateProviderOption.GoogleWeb -> {}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {

dependencies {
compileOnly("com.android.tools.build:gradle:9.2.1")
compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.21")
compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin:2.4.0")
implementation("org.jlleitschuh.gradle:ktlint-gradle:14.2.0")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum class FlarePlatform {
}

class FlareMultiplatformLibraryPlugin : Plugin<Project> {
override fun apply(target: Project) = Unit
override fun apply(target: Project) {}
}

class FlareAndroidApplicationPlugin : Plugin<Project> {
Expand All @@ -56,6 +56,9 @@ class FlareRootConventionsPlugin : Plugin<Project> {
}
}
}
subproject.tasks.matching { it.name.startsWith("runKtlint") }.configureEach {
dependsOn(subproject.tasks.matching { it.name.startsWith("ksp") })
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ private fun ProfileHeaderSuccess(
isMe.onSuccess {
if (!it) {
when (followButtonState) {
is UiState.Error -> {
Unit
}
is UiState.Error -> {}

is UiState.Loading -> {
PlatformFilledTonalButton(
Expand Down Expand Up @@ -382,9 +380,7 @@ private fun ProfileHeaderSuccess(
}
}

null -> {
Unit
}
null -> {}
}
MatricesDisplay(
data = user.matrices,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,7 @@ internal fun TranslationDisplayBadge(
)
}

TranslationDisplayState.Translated -> {
Unit
}
TranslationDisplayState.Translated -> {}

TranslationDisplayState.Failed -> {
FAIcon(
Expand All @@ -720,9 +718,7 @@ internal fun TranslationDisplayBadge(
)
}

TranslationDisplayState.Hidden -> {
Unit
}
TranslationDisplayState.Hidden -> {}
}
}
}
Expand Down Expand Up @@ -942,9 +938,7 @@ internal fun StatusActions(
}

// nested group is not supported
is ActionMenu.Group -> {
Unit
}
is ActionMenu.Group -> {}

ActionMenu.Divider -> {
PlatformDropdownMenuDivider()
Expand Down Expand Up @@ -979,9 +973,7 @@ internal fun StatusActions(
}

// divider is only supported in group
ActionMenu.Divider -> {
Unit
}
ActionMenu.Divider -> {}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,7 @@ private fun UserContent(
)
}

else -> {
Unit
}
else -> {}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,7 @@ private fun RichTextScope.RenderNode(
context.builder.append(node.text())
}

else -> {
Unit
}
else -> {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ internal fun ProvideDesktopTimelineMediaActions(content: @Composable () -> Unit)
)
}

TimelineMediaMenuAction.ShareImage -> {
Unit
}
TimelineMediaMenuAction.ShareImage -> {}

TimelineMediaMenuAction.CopyLink -> {
Toolkit.getDefaultToolkit().systemClipboard.setContents(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ fun ComposeDialog(
onBack?.invoke()
}

ContentDialogButton.Close -> {
Unit
}
ContentDialogButton.Close -> {}
}
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,7 @@ private fun LazyStaggeredGridScope.compactCommentsPreviewItems(
}
}
}
onEmpty {
Unit
}
onEmpty {}
onError { error ->
item(span = StaggeredGridItemSpan.FullLine) {
SectionTitle("Comments")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ internal fun EditTabDialog(
}
}

ContentDialogButton.Secondary -> {
Unit
}
ContentDialogButton.Secondary -> {}

ContentDialogButton.Close -> {
onDismissRequest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2114,9 +2114,7 @@ internal fun SettingsScreen(
)
}

TranslateProviderOption.GoogleWeb -> {
Unit
}
TranslateProviderOption.GoogleWeb -> {}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ internal fun BlueskyReportStatusDialog(
}
}

ContentDialogButton.Secondary -> {
Unit
}
ContentDialogButton.Secondary -> {}

ContentDialogButton.Close -> {
onBack.invoke()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ internal fun DeleteStatusConfirmDialog(
onBack.invoke()
}

ContentDialogButton.Secondary -> {
Unit
}
ContentDialogButton.Secondary -> {}

ContentDialogButton.Close -> {
onBack.invoke()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ internal fun MastodonReportDialog(
onBack.invoke()
}

ContentDialogButton.Secondary -> {
Unit
}
ContentDialogButton.Secondary -> {}

ContentDialogButton.Close -> {
onBack.invoke()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ internal fun MisskeyReportDialog(
onBack()
}

ContentDialogButton.Secondary -> {
Unit
}
ContentDialogButton.Secondary -> {}

ContentDialogButton.Close -> {
onBack()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,7 @@ private suspend fun AgentToolSession.availableRelationUsers(): List<UiProfile> =

is AgentMessagePart.Actions,
is AgentMessagePart.Text,
-> {
Unit
}
-> {}
}
}
}.distinctBy { it.platformType to it.key }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import nl.adaptivity.xmlutil.serialization.XML

internal object RssService {
private val xml by lazy {
XML {
defaultPolicy {
XML.v1 {
policy {
autoPolymorphic = true
ignoreUnknownChildren()
}
Expand Down Expand Up @@ -158,8 +158,8 @@ private val HEADER_CHARSET_REGEX =
Regex("""(?:^|;)\s*charset\s*=\s*"?([^";\s]+)""", RegexOption.IGNORE_CASE)

private val RssServiceXml by lazy {
XML {
defaultPolicy {
XML.v1 {
policy {
Comment on lines +161 to +162

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve lenient repeated RSS element parsing

With feeds that repeat a known scalar RSS element, for example WordPress/podcast feeds with multiple <enclosure> tags, this XML.v1 policy inherits xmlutil 1.0's repeated-element checks and throws because Feed.Rss20.Item.enclosure is still a single value; the old defaultPolicy builder defaulted repeated elements to lenient handling, so those feeds kept parsing. Please either restore lenient repeated-element handling in this parser policy or model the remaining repeatable RSS fields as lists, otherwise one duplicate enclosure makes the entire RSS source fail to load.

Useful? React with 👍 / 👎.

autoPolymorphic = true
ignoreUnknownChildren()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ internal sealed interface Feed {
@XmlElement(true)
val lastBuildDate: String? = null,
@XmlElement(true)
val category: String? = null,
val category: List<String> = emptyList(),
@XmlElement(true)
val generator: String? = null,
@XmlElement(true)
Expand Down Expand Up @@ -347,7 +347,7 @@ internal sealed interface Feed {
@XmlElement(true)
val author: String? = null,
@XmlElement(true)
val category: String? = null,
val category: List<String> = emptyList(),
@XmlElement(true)
val comments: String? = null,
@XmlElement(true)
Expand All @@ -363,7 +363,7 @@ internal sealed interface Feed {
val source: Source? = null,
@XmlElement(true)
@XmlSerialName(value = "content", prefix = "media", namespace = "http://search.yahoo.com/mrss/")
val mediaContent: Media? = null,
val mediaContent: List<Media> = emptyList(),
)

@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ internal fun decodeOpml(opmlContent: String): Opml {
}

private val opmlXml =
XML {
defaultPolicy {
XML.v1 {
policy {
autoPolymorphic = true
ignoreUnknownChildren()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ internal fun Feed.Rss20.Item.render(
?.select("img")
?.firstOrNull()
?.attr("src")
?.takeIf { it.isNotEmpty() } ?: mediaContent?.url
?.takeIf { it.isNotEmpty() } ?: mediaContent.firstOrNull()?.url
return UiTimelineV2.Feed(
title = title,
description = descHtml?.text(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ public class ExportOPMLPresenter : PresenterBase<UiState<String>>() {
),
)

return XML {
indentString = " "
}.encodeToString(Opml.serializer(), opml)
return XML
.v1 {
indentString = " "
}.encodeToString(
Opml.serializer(),
opml,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ class FeedTest {
}

private val testXml =
XML {
defaultPolicy {
XML.v1 {
policy {
autoPolymorphic = true
ignoreUnknownChildren()
}
Expand Down
Loading
Loading