replace more unused lambda parameters with _
This commit is contained in:
@@ -128,7 +128,7 @@ fun debugState(context: Context) {
|
|||||||
"Private Chats $key: " +
|
"Private Chats $key: " +
|
||||||
room.rooms.size() +
|
room.rooms.size() +
|
||||||
" / " +
|
" / " +
|
||||||
room.rooms.sumOf { key, value -> value.messages.size }
|
room.rooms.sumOf { _, value -> value.messages.size }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.d(
|
Log.d(
|
||||||
|
|||||||
@@ -1046,7 +1046,7 @@ class Account(
|
|||||||
client
|
client
|
||||||
.fetchFirst(
|
.fetchFirst(
|
||||||
filters =
|
filters =
|
||||||
note.relays.associateWith { relay ->
|
note.relays.associateWith { _ ->
|
||||||
listOf(
|
listOf(
|
||||||
Filter(
|
Filter(
|
||||||
kinds = listOf(host.kind),
|
kinds = listOf(host.kind),
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ fun RenderHashTagIconsPreview() {
|
|||||||
RenderRegular(
|
RenderRegular(
|
||||||
"Testing rendering of hashtags: #flowerstr #Bitcoin, #nostr, #lightning, #zap, #amethyst, #cashu, #plebs, #coffee, #skullofsatoshi, #grownostr, #footstr, #tunestr, #weed, #mate, #gamestr, #gamechain",
|
"Testing rendering of hashtags: #flowerstr #Bitcoin, #nostr, #lightning, #zap, #amethyst, #cashu, #plebs, #coffee, #skullofsatoshi, #grownostr, #footstr, #tunestr, #weed, #mate, #gamestr, #gamechain",
|
||||||
EmptyTagList,
|
EmptyTagList,
|
||||||
) { paragraph, state, spaceWidth, modifier ->
|
) { paragraph, _, spaceWidth, modifier ->
|
||||||
RenderTextParagraph(paragraph, spaceWidth, modifier) { word ->
|
RenderTextParagraph(paragraph, spaceWidth, modifier) { word ->
|
||||||
when (word) {
|
when (word) {
|
||||||
is HashTagSegment -> HashTag(word, EmptyNav())
|
is HashTagSegment -> HashTag(word, EmptyNav())
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ fun kindStart(kind: Int) = kindStart(kind, START_KEY)
|
|||||||
|
|
||||||
fun kindEnd(kind: Int) = kindEnd(kind, END_KEY)
|
fun kindEnd(kind: Int) = kindEnd(kind, END_KEY)
|
||||||
|
|
||||||
val ACCEPT_ALL_FILTER = CacheCollectors.BiFilter<Address, AddressableNote> { key, note -> true }
|
val ACCEPT_ALL_FILTER = CacheCollectors.BiFilter<Address, AddressableNote> { _, _ -> true }
|
||||||
|
|
||||||
fun LargeSoftCache<Address, AddressableNote>.filter(
|
fun LargeSoftCache<Address, AddressableNote>.filter(
|
||||||
kind: Int,
|
kind: Int,
|
||||||
|
|||||||
@@ -1173,7 +1173,7 @@ object LocalCache : ILocalCache, ICacheProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
notes.forEach { key, note ->
|
notes.forEach { _, note ->
|
||||||
val noteEvent = note.event
|
val noteEvent = note.event
|
||||||
if (noteEvent is AddressableEvent && noteEvent.addressTag() in addressSet) {
|
if (noteEvent is AddressableEvent && noteEvent.addressTag() in addressSet) {
|
||||||
if (noteEvent.pubKey == event.pubKey && noteEvent.createdAt <= event.createdAt) {
|
if (noteEvent.pubKey == event.pubKey && noteEvent.createdAt <= event.createdAt) {
|
||||||
@@ -2485,7 +2485,7 @@ object LocalCache : ILocalCache, ICacheProvider {
|
|||||||
val event = newNote.event as Event
|
val event = newNote.event as Event
|
||||||
|
|
||||||
val observableBiConsumer =
|
val observableBiConsumer =
|
||||||
java.util.function.BiConsumer<Observable, Observable> { t, u ->
|
java.util.function.BiConsumer<Observable, Observable> { _, u ->
|
||||||
u.new(event, newNote)
|
u.new(event, newNote)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2495,7 +2495,7 @@ object LocalCache : ILocalCache, ICacheProvider {
|
|||||||
|
|
||||||
private fun refreshDeletedNoteObservers(newNote: Note) {
|
private fun refreshDeletedNoteObservers(newNote: Note) {
|
||||||
val observableBiConsumer =
|
val observableBiConsumer =
|
||||||
java.util.function.BiConsumer<Observable, Observable> { t, u ->
|
java.util.function.BiConsumer<Observable, Observable> { _, u ->
|
||||||
u.remove(newNote)
|
u.remove(newNote)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class ParticipantListBuilder {
|
|||||||
it.replyTo?.forEach { addFollowsThatDirectlyParticipateOnToSet(it, followingSet, mySet) }
|
it.replyTo?.forEach { addFollowsThatDirectlyParticipateOnToSet(it, followingSet, mySet) }
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalCache.getPublicChatChannelIfExists(baseNote.idHex)?.notes?.forEach { key, it ->
|
LocalCache.getPublicChatChannelIfExists(baseNote.idHex)?.notes?.forEach { _, it ->
|
||||||
addFollowsThatDirectlyParticipateOnToSet(it, followingSet, mySet)
|
addFollowsThatDirectlyParticipateOnToSet(it, followingSet, mySet)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -59,19 +59,19 @@ fun HorizontalLinearProgressIndicatorPreview() {
|
|||||||
HorizontalLinearProgressIndicator(
|
HorizontalLinearProgressIndicator(
|
||||||
currentPositionProgress = { 0.00f },
|
currentPositionProgress = { 0.00f },
|
||||||
bufferedPositionProgress = { 0.10f },
|
bufferedPositionProgress = { 0.10f },
|
||||||
onLayoutWidthChanged = { widthPx -> },
|
onLayoutWidthChanged = { _ -> },
|
||||||
onSeek = {},
|
onSeek = {},
|
||||||
)
|
)
|
||||||
HorizontalLinearProgressIndicator(
|
HorizontalLinearProgressIndicator(
|
||||||
currentPositionProgress = { 0.10f },
|
currentPositionProgress = { 0.10f },
|
||||||
bufferedPositionProgress = { 0.20f },
|
bufferedPositionProgress = { 0.20f },
|
||||||
onLayoutWidthChanged = { widthPx -> },
|
onLayoutWidthChanged = { _ -> },
|
||||||
onSeek = {},
|
onSeek = {},
|
||||||
)
|
)
|
||||||
HorizontalLinearProgressIndicator(
|
HorizontalLinearProgressIndicator(
|
||||||
currentPositionProgress = { 1.00f },
|
currentPositionProgress = { 1.00f },
|
||||||
bufferedPositionProgress = { 1.00f },
|
bufferedPositionProgress = { 1.00f },
|
||||||
onLayoutWidthChanged = { widthPx -> },
|
onLayoutWidthChanged = { _ -> },
|
||||||
onSeek = {},
|
onSeek = {},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ fun pickRelaysToLoadUsers(
|
|||||||
hasTried: EOSEAccountFast<User>,
|
hasTried: EOSEAccountFast<User>,
|
||||||
): Map<NormalizedRelayUrl, Set<HexKey>> =
|
): Map<NormalizedRelayUrl, Set<HexKey>> =
|
||||||
mapOfSet {
|
mapOfSet {
|
||||||
users.forEachIndexed { idx, key ->
|
users.forEachIndexed { _, key ->
|
||||||
val tried = (hasTried.since(key)?.keys ?: emptySet()) + cannotConnectRelays
|
val tried = (hasTried.since(key)?.keys ?: emptySet()) + cannotConnectRelays
|
||||||
|
|
||||||
val outbox = key.authorRelayList()?.writeRelaysNorm()
|
val outbox = key.authorRelayList()?.writeRelaysNorm()
|
||||||
|
|||||||
+1
-1
@@ -348,7 +348,7 @@ fun observeNoteReferences(
|
|||||||
note.flow().zaps.stateFlow,
|
note.flow().zaps.stateFlow,
|
||||||
note.flow().boosts.stateFlow,
|
note.flow().boosts.stateFlow,
|
||||||
note.flow().reactions.stateFlow,
|
note.flow().reactions.stateFlow,
|
||||||
) { zapState, boostState, reactionState ->
|
) { zapState, _, _ ->
|
||||||
zapState.note.hasZapsBoostsOrReactions()
|
zapState.note.hasZapsBoostsOrReactions()
|
||||||
}.distinctUntilChanged()
|
}.distinctUntilChanged()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ class FrameStat {
|
|||||||
|
|
||||||
fun reset() {
|
fun reset() {
|
||||||
eventCount.set(0)
|
eventCount.set(0)
|
||||||
kinds.forEach { key, value -> value.reset() }
|
kinds.forEach { _, value -> value.reset() }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun log() {
|
fun log() {
|
||||||
|
|||||||
+2
-2
@@ -63,8 +63,8 @@ class KindGroup(
|
|||||||
fun reset() {
|
fun reset() {
|
||||||
count.set(0)
|
count.set(0)
|
||||||
memory.set(0)
|
memory.set(0)
|
||||||
subs.forEach { key, value -> value.set(0) }
|
subs.forEach { _, value -> value.set(0) }
|
||||||
relays.forEach { key, value -> value.set(0) }
|
relays.forEach { _, value -> value.set(0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun printSubs() = subs.joinToString(", ") { key, value -> if (value.get() > 0) "$key ($value)" else "" }
|
fun printSubs() = subs.joinToString(", ") { key, value -> if (value.get() > 0) "$key ($value)" else "" }
|
||||||
|
|||||||
+4
-4
@@ -103,10 +103,10 @@ fun AllMediaBody(blossomServersViewModel: BlossomServersViewModel) {
|
|||||||
}
|
}
|
||||||
itemsIndexed(
|
itemsIndexed(
|
||||||
it,
|
it,
|
||||||
key = { index: Int, server: ServerName ->
|
key = { _: Int, server: ServerName ->
|
||||||
"Proposed" + server.baseUrl
|
"Proposed" + server.baseUrl
|
||||||
},
|
},
|
||||||
) { index, server ->
|
) { _, server ->
|
||||||
MediaServerEntry(
|
MediaServerEntry(
|
||||||
serverEntry = server,
|
serverEntry = server,
|
||||||
isAmethystDefault = true,
|
isAmethystDefault = true,
|
||||||
@@ -143,10 +143,10 @@ fun LazyListScope.renderMediaServerList(
|
|||||||
} else {
|
} else {
|
||||||
itemsIndexed(
|
itemsIndexed(
|
||||||
mediaServersState,
|
mediaServersState,
|
||||||
key = { index: Int, server: ServerName ->
|
key = { _: Int, server: ServerName ->
|
||||||
keyType + server.baseUrl
|
keyType + server.baseUrl
|
||||||
},
|
},
|
||||||
) { index, entry ->
|
) { _, entry ->
|
||||||
MediaServerEntry(
|
MediaServerEntry(
|
||||||
serverEntry = entry,
|
serverEntry = entry,
|
||||||
onAddOrDelete = {
|
onAddOrDelete = {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class CallActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
// Launcher for requesting call permissions when accepting from notification
|
// Launcher for requesting call permissions when accepting from notification
|
||||||
private val permissionLauncher =
|
private val permissionLauncher =
|
||||||
registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { results ->
|
registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { _ ->
|
||||||
if (hasCallPermissions(this, isVideo = pendingAcceptIsVideo)) {
|
if (hasCallPermissions(this, isVideo = pendingAcceptIsVideo)) {
|
||||||
acceptCall()
|
acceptCall()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ fun rememberCallWithPermission(
|
|||||||
val launcher =
|
val launcher =
|
||||||
rememberLauncherForActivityResult(
|
rememberLauncherForActivityResult(
|
||||||
ActivityResultContracts.RequestMultiplePermissions(),
|
ActivityResultContracts.RequestMultiplePermissions(),
|
||||||
) { results ->
|
) { _ ->
|
||||||
// Bluetooth is optional — proceed if core permissions are granted
|
// Bluetooth is optional — proceed if core permissions are granted
|
||||||
if (hasCallPermissions(context, isVideo)) onCall()
|
if (hasCallPermissions(context, isVideo)) onCall()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,8 +130,8 @@ fun CashuPreviewPreview() {
|
|||||||
ThemeComparisonColumn {
|
ThemeComparisonColumn {
|
||||||
CashuPreviewNew(
|
CashuPreviewNew(
|
||||||
token = CashuToken("token", "mint", 32400, listOf()),
|
token = CashuToken("token", "mint", 32400, listOf()),
|
||||||
melt = { token, context, onDone -> },
|
melt = { _, _, _ -> },
|
||||||
toast = { title, message -> },
|
toast = { _, _ -> },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ fun RenderStrangeNamePreview() {
|
|||||||
RenderRegular(
|
RenderRegular(
|
||||||
"If you want to FreeFrom Official \uD80C\uDD66 stream or download the music from nostr:npub1sctag667a7np6p6ety2up94pnwwxhd2ep8n8afr2gtr47cwd4ewsvdmmjm at wss://relay.damus.io can you here",
|
"If you want to FreeFrom Official \uD80C\uDD66 stream or download the music from nostr:npub1sctag667a7np6p6ety2up94pnwwxhd2ep8n8afr2gtr47cwd4ewsvdmmjm at wss://relay.damus.io can you here",
|
||||||
EmptyTagList,
|
EmptyTagList,
|
||||||
) { paragraph, state, spaceWidth, modifier ->
|
) { paragraph, _, spaceWidth, modifier ->
|
||||||
RenderTextParagraph(paragraph, spaceWidth, modifier) { word ->
|
RenderTextParagraph(paragraph, spaceWidth, modifier) { word ->
|
||||||
when (word) {
|
when (word) {
|
||||||
is BechSegment -> {
|
is BechSegment -> {
|
||||||
|
|||||||
@@ -616,7 +616,7 @@ fun ZapVote(
|
|||||||
zappingProgress = 0f
|
zappingProgress = 0f
|
||||||
},
|
},
|
||||||
onChangeAmount = { wantsToZap = false },
|
onChangeAmount = { wantsToZap = false },
|
||||||
onError = { title, message, user ->
|
onError = { title, message, _ ->
|
||||||
showErrorMessageDialog = StringToastMsg(title, message)
|
showErrorMessageDialog = StringToastMsg(title, message)
|
||||||
zappingProgress = 0f
|
zappingProgress = 0f
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@ fun Notifying(
|
|||||||
modifier = Modifier.align(CenterVertically),
|
modifier = Modifier.align(CenterVertically),
|
||||||
)
|
)
|
||||||
|
|
||||||
mentions.forEachIndexed { idx, user ->
|
mentions.forEachIndexed { _, user ->
|
||||||
Button(
|
Button(
|
||||||
shape = ButtonBorder,
|
shape = ButtonBorder,
|
||||||
colors =
|
colors =
|
||||||
|
|||||||
+4
-4
@@ -232,7 +232,7 @@ private fun BubblePreview() {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
detailRow = { Text(RELAYS_AND_ACTIONS_TEXT) },
|
detailRow = { Text(RELAYS_AND_ACTIONS_TEXT) },
|
||||||
) { bgColor ->
|
) { _ ->
|
||||||
Text("This is my note")
|
Text("This is my note")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ private fun BubblePreview() {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
detailRow = { Text(RELAYS_AND_ACTIONS_TEXT) },
|
detailRow = { Text(RELAYS_AND_ACTIONS_TEXT) },
|
||||||
) { bgColor ->
|
) { _ ->
|
||||||
Text("This is a very long long loong note")
|
Text("This is a very long long loong note")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ private fun BubblePreview() {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
detailRow = { Text(RELAYS_AND_ACTIONS_TEXT) },
|
detailRow = { Text(RELAYS_AND_ACTIONS_TEXT) },
|
||||||
) { bgColor ->
|
) { _ ->
|
||||||
Text("This is a draft note")
|
Text("This is a draft note")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ private fun BubblePreview() {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
detailRow = { Text(RELAYS_AND_ACTIONS_TEXT) },
|
detailRow = { Text(RELAYS_AND_ACTIONS_TEXT) },
|
||||||
) { bgColor ->
|
) { _ ->
|
||||||
Text("Short note")
|
Text("Short note")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -287,7 +287,7 @@ fun GroupDMScreenContent(
|
|||||||
selectedFiles,
|
selectedFiles,
|
||||||
accountViewModel.account.settings.defaultFileServer,
|
accountViewModel.account.settings.defaultFileServer,
|
||||||
isUploading = uploading.mediaUploadTracker.isUploading,
|
isUploading = uploading.mediaUploadTracker.isUploading,
|
||||||
onAdd = { alt, server, sensitiveContent, mediaQuality, _, _, _ ->
|
onAdd = { _, server, _, _, _, _, _ ->
|
||||||
postViewModel.uploadAndHold(
|
postViewModel.uploadAndHold(
|
||||||
accountViewModel.toastManager::toast,
|
accountViewModel.toastManager::toast,
|
||||||
context,
|
context,
|
||||||
|
|||||||
+1
-1
@@ -126,7 +126,7 @@ fun PrivateMessageEditFieldRow(
|
|||||||
}
|
}
|
||||||
|
|
||||||
channelScreenModel.uploadState?.let { uploading ->
|
channelScreenModel.uploadState?.let { uploading ->
|
||||||
uploading.multiOrchestrator?.let { selectedFiles ->
|
uploading.multiOrchestrator?.let { _ ->
|
||||||
RoomChatFileUploadDialog(
|
RoomChatFileUploadDialog(
|
||||||
channelScreenModel = channelScreenModel,
|
channelScreenModel = channelScreenModel,
|
||||||
state = uploading,
|
state = uploading,
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ class ChannelFeedFilter(
|
|||||||
override fun changesFlow() = channel.changesFlow()
|
override fun changesFlow() = channel.changesFlow()
|
||||||
|
|
||||||
// returns the last Note of each user.
|
// returns the last Note of each user.
|
||||||
override fun feed(): List<Note> = sort(channel.notes.filterIntoSet { key, it -> isChatEvent(it) && account.isAcceptable(it) })
|
override fun feed(): List<Note> = sort(channel.notes.filterIntoSet { _, it -> isChatEvent(it) && account.isAcceptable(it) })
|
||||||
|
|
||||||
override fun applyFilter(newItems: Set<Note>): Set<Note> =
|
override fun applyFilter(newItems: Set<Note>): Set<Note> =
|
||||||
newItems
|
newItems
|
||||||
|
|||||||
+1
-1
@@ -220,7 +220,7 @@ private fun ChannelMetadataScaffold(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
itemsIndexed(feedState, key = { _, item -> "ChatRelays" + item.relay }) { index, item ->
|
itemsIndexed(feedState, key = { _, item -> "ChatRelays" + item.relay }) { _, item ->
|
||||||
BasicRelaySetupInfoDialog(
|
BasicRelaySetupInfoDialog(
|
||||||
item,
|
item,
|
||||||
onDelete = { postViewModel.deleteHomeRelay(item) },
|
onDelete = { postViewModel.deleteHomeRelay(item) },
|
||||||
|
|||||||
+1
-1
@@ -81,7 +81,7 @@ fun EditFieldRow(
|
|||||||
}
|
}
|
||||||
|
|
||||||
channelScreenModel.uploadState?.let { uploading ->
|
channelScreenModel.uploadState?.let { uploading ->
|
||||||
uploading.multiOrchestrator?.let { selectedFiles ->
|
uploading.multiOrchestrator?.let { _ ->
|
||||||
ChannelFileUploadDialog(
|
ChannelFileUploadDialog(
|
||||||
channelScreenModel = channelScreenModel,
|
channelScreenModel = channelScreenModel,
|
||||||
state = uploading,
|
state = uploading,
|
||||||
|
|||||||
+2
-2
@@ -60,7 +60,7 @@ class ChatroomListKnownFeedFilter(
|
|||||||
LocalCache
|
LocalCache
|
||||||
.getOrCreatePublicChatChannel(it.eventId)
|
.getOrCreatePublicChatChannel(it.eventId)
|
||||||
.notes
|
.notes
|
||||||
.filter { key, it -> account.isAcceptable(it) && it.event != null }
|
.filter { _, it -> account.isAcceptable(it) && it.event != null }
|
||||||
.sortedWith(DefaultFeedOrder)
|
.sortedWith(DefaultFeedOrder)
|
||||||
.firstOrNull()
|
.firstOrNull()
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ class ChatroomListKnownFeedFilter(
|
|||||||
LocalCache
|
LocalCache
|
||||||
.getOrCreateEphemeralChannel(it)
|
.getOrCreateEphemeralChannel(it)
|
||||||
.notes
|
.notes
|
||||||
.filter { key, it -> account.isAcceptable(it) && it.event != null }
|
.filter { _, it -> account.isAcceptable(it) && it.event != null }
|
||||||
.sortedWith(DefaultFeedOrder)
|
.sortedWith(DefaultFeedOrder)
|
||||||
.firstOrNull()
|
.firstOrNull()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -345,7 +345,7 @@ fun ChessGameScreen(
|
|||||||
modifier = Modifier.padding(paddingValues),
|
modifier = Modifier.padding(paddingValues),
|
||||||
gameState = gameState,
|
gameState = gameState,
|
||||||
opponentName = opponentDisplayName,
|
opponentName = opponentDisplayName,
|
||||||
onMoveMade = { from, to, san ->
|
onMoveMade = { from, to, _ ->
|
||||||
chessViewModel.publishMove(gameId, from, to)
|
chessViewModel.publishMove(gameId, from, to)
|
||||||
},
|
},
|
||||||
onResign = { chessViewModel.resign(gameId) },
|
onResign = { chessViewModel.resign(gameId) },
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ fun ChannelCardCompose(
|
|||||||
showHiddenWarning = false,
|
showHiddenWarning = false,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
nav = nav,
|
nav = nav,
|
||||||
) { canPreview ->
|
) { _ ->
|
||||||
NormalChannelCard(
|
NormalChannelCard(
|
||||||
baseNote = baseNote,
|
baseNote = baseNote,
|
||||||
routeForLastRead = routeForLastRead,
|
routeForLastRead = routeForLastRead,
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ open class DiscoverLiveFeedFilter(
|
|||||||
|
|
||||||
override fun feed(): List<Note> {
|
override fun feed(): List<Note> {
|
||||||
val allChannelNotes = LocalCache.liveChatChannels.mapNotNull { _, channel -> LocalCache.getAddressableNoteIfExists(channel.address) }
|
val allChannelNotes = LocalCache.liveChatChannels.mapNotNull { _, channel -> LocalCache.getAddressableNoteIfExists(channel.address) }
|
||||||
val allMessageNotes = LocalCache.liveChatChannels.map { _, channel -> channel.notes.filter { key, it -> it.event is LiveActivitiesEvent } }.flatten()
|
val allMessageNotes = LocalCache.liveChatChannels.map { _, channel -> channel.notes.filter { _, it -> it.event is LiveActivitiesEvent } }.flatten()
|
||||||
|
|
||||||
val notes = innerApplyFilter(allChannelNotes + allMessageNotes)
|
val notes = innerApplyFilter(allChannelNotes + allMessageNotes)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@ open class NIP90ContentDiscoveryResponseFilter(
|
|||||||
|
|
||||||
latestNote =
|
latestNote =
|
||||||
LocalCache.notes.maxOrNullOf(
|
LocalCache.notes.maxOrNullOf(
|
||||||
filter = { idHex: String, note: Note ->
|
filter = { _: String, note: Note ->
|
||||||
acceptableEvent(note)
|
acceptableEvent(note)
|
||||||
},
|
},
|
||||||
comparator = CreatedAtComparator,
|
comparator = CreatedAtComparator,
|
||||||
|
|||||||
+5
-5
@@ -65,10 +65,10 @@ class HomeLiveFilter(
|
|||||||
val fifteenMinsAgo = limitTime()
|
val fifteenMinsAgo = limitTime()
|
||||||
|
|
||||||
val list =
|
val list =
|
||||||
LocalCache.ephemeralChannels.filter { id, channel ->
|
LocalCache.ephemeralChannels.filter { _, channel ->
|
||||||
shouldIncludeChannel(channel, filterParams, fifteenMinsAgo)
|
shouldIncludeChannel(channel, filterParams, fifteenMinsAgo)
|
||||||
} +
|
} +
|
||||||
LocalCache.liveChatChannels.filter { id, channel ->
|
LocalCache.liveChatChannels.filter { _, channel ->
|
||||||
shouldIncludeChannel(channel, filterParams, fifteenMinsAgo)
|
shouldIncludeChannel(channel, filterParams, fifteenMinsAgo)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ class HomeLiveFilter(
|
|||||||
timeLimit: Long,
|
timeLimit: Long,
|
||||||
): Boolean =
|
): Boolean =
|
||||||
channel.notes
|
channel.notes
|
||||||
.filter { key, value ->
|
.filter { _, value ->
|
||||||
acceptableChatEvent(value, filterParams, timeLimit)
|
acceptableChatEvent(value, filterParams, timeLimit)
|
||||||
}.isNotEmpty()
|
}.isNotEmpty()
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ class HomeLiveFilter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return channel.notes
|
return channel.notes
|
||||||
.filter { key, value ->
|
.filter { _, value ->
|
||||||
acceptableChatEvent(value, filterParams, timeLimit)
|
acceptableChatEvent(value, filterParams, timeLimit)
|
||||||
}.isNotEmpty()
|
}.isNotEmpty()
|
||||||
}
|
}
|
||||||
@@ -275,7 +275,7 @@ class HomeLiveFilter(
|
|||||||
): Int {
|
): Int {
|
||||||
var count = 0
|
var count = 0
|
||||||
|
|
||||||
channel.notes.forEach { key, value ->
|
channel.notes.forEach { _, value ->
|
||||||
val author = value.author
|
val author = value.author
|
||||||
if (author != null) {
|
if (author != null) {
|
||||||
if (followingSet == null || author.pubkeyHex in followingSet) {
|
if (followingSet == null || author.pubkeyHex in followingSet) {
|
||||||
|
|||||||
+1
-1
@@ -310,7 +310,7 @@ private fun PeopleListViewPreview() {
|
|||||||
Column {
|
Column {
|
||||||
PeopleListView(
|
PeopleListView(
|
||||||
memberList = persistentListOf(user1, user2, user3),
|
memberList = persistentListOf(user1, user2, user3),
|
||||||
onDeleteUser = { user -> },
|
onDeleteUser = { _ -> },
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
nav = EmptyNav(),
|
nav = EmptyNav(),
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -333,7 +333,7 @@ fun FollowPackViewPreview() {
|
|||||||
Column {
|
Column {
|
||||||
PeopleListView(
|
PeopleListView(
|
||||||
memberList = persistentListOf(user1, user2, user3),
|
memberList = persistentListOf(user1, user2, user3),
|
||||||
onDeleteUser = { user -> },
|
onDeleteUser = { _ -> },
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
nav = EmptyNav(),
|
nav = EmptyNav(),
|
||||||
)
|
)
|
||||||
|
|||||||
+5
-5
@@ -127,7 +127,7 @@ private fun PeopleListItemPreview() {
|
|||||||
peopleList = samplePeopleList1,
|
peopleList = samplePeopleList1,
|
||||||
onClick = {},
|
onClick = {},
|
||||||
onEditMetadata = {},
|
onEditMetadata = {},
|
||||||
onClone = { newName, newDesc -> },
|
onClone = { _, _ -> },
|
||||||
onDelete = {},
|
onDelete = {},
|
||||||
)
|
)
|
||||||
PeopleListItem(
|
PeopleListItem(
|
||||||
@@ -135,7 +135,7 @@ private fun PeopleListItemPreview() {
|
|||||||
peopleList = samplePeopleList2,
|
peopleList = samplePeopleList2,
|
||||||
onClick = {},
|
onClick = {},
|
||||||
onEditMetadata = {},
|
onEditMetadata = {},
|
||||||
onClone = { newName, newDesc -> },
|
onClone = { _, _ -> },
|
||||||
onDelete = {},
|
onDelete = {},
|
||||||
)
|
)
|
||||||
PeopleListItem(
|
PeopleListItem(
|
||||||
@@ -143,7 +143,7 @@ private fun PeopleListItemPreview() {
|
|||||||
peopleList = samplePeopleList3,
|
peopleList = samplePeopleList3,
|
||||||
onClick = {},
|
onClick = {},
|
||||||
onEditMetadata = {},
|
onEditMetadata = {},
|
||||||
onClone = { newName, newDesc -> },
|
onClone = { _, _ -> },
|
||||||
onDelete = {},
|
onDelete = {},
|
||||||
)
|
)
|
||||||
PeopleListItem(
|
PeopleListItem(
|
||||||
@@ -151,7 +151,7 @@ private fun PeopleListItemPreview() {
|
|||||||
peopleList = samplePeopleList4,
|
peopleList = samplePeopleList4,
|
||||||
onClick = {},
|
onClick = {},
|
||||||
onEditMetadata = {},
|
onEditMetadata = {},
|
||||||
onClone = { newName, newDesc -> },
|
onClone = { _, _ -> },
|
||||||
onDelete = {},
|
onDelete = {},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -341,7 +341,7 @@ private fun ListOptionsMenu(
|
|||||||
onCloneDescChange = {
|
onCloneDescChange = {
|
||||||
optionalCloneDescription.value = it
|
optionalCloneDescription.value = it
|
||||||
},
|
},
|
||||||
onCloneCreate = { name, description ->
|
onCloneCreate = { _, _ ->
|
||||||
onListClone(optionalCloneName.value, optionalCloneDescription.value)
|
onListClone(optionalCloneName.value, optionalCloneDescription.value)
|
||||||
},
|
},
|
||||||
onDismiss = { isCopyDialogOpen.value = false },
|
onDismiss = { isCopyDialogOpen.value = false },
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ class LiveStreamsFeedFilter(
|
|||||||
|
|
||||||
override fun feed(): List<Note> {
|
override fun feed(): List<Note> {
|
||||||
val allChannelNotes = LocalCache.liveChatChannels.mapNotNull { _, channel -> LocalCache.getAddressableNoteIfExists(channel.address) }
|
val allChannelNotes = LocalCache.liveChatChannels.mapNotNull { _, channel -> LocalCache.getAddressableNoteIfExists(channel.address) }
|
||||||
val allMessageNotes = LocalCache.liveChatChannels.map { _, channel -> channel.notes.filter { key, it -> it.event is LiveActivitiesEvent } }.flatten()
|
val allMessageNotes = LocalCache.liveChatChannels.map { _, channel -> channel.notes.filter { _, it -> it.event is LiveActivitiesEvent } }.flatten()
|
||||||
|
|
||||||
val notes = innerApplyFilter(allChannelNotes + allMessageNotes)
|
val notes = innerApplyFilter(allChannelNotes + allMessageNotes)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ fun GalleryCardCompose(
|
|||||||
showHiddenWarning = true,
|
showHiddenWarning = true,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
nav = nav,
|
nav = nav,
|
||||||
) { canPreview ->
|
) { _ ->
|
||||||
val galleryEvent = baseNote.event
|
val galleryEvent = baseNote.event
|
||||||
|
|
||||||
val redirectToEventId =
|
val redirectToEventId =
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ fun TabFollowedTags(
|
|||||||
val items by observeUserTagFollows(baseUser, accountViewModel)
|
val items by observeUserTagFollows(baseUser, accountViewModel)
|
||||||
|
|
||||||
LazyColumn(Modifier.fillMaxSize()) {
|
LazyColumn(Modifier.fillMaxSize()) {
|
||||||
itemsIndexed(items) { index, hashtag ->
|
itemsIndexed(items) { _, hashtag ->
|
||||||
HashtagHeader(
|
HashtagHeader(
|
||||||
tag = hashtag,
|
tag = hashtag,
|
||||||
account = accountViewModel,
|
account = accountViewModel,
|
||||||
|
|||||||
+2
-2
@@ -80,7 +80,7 @@ abstract class BasicRelaySetupInfoModel : ViewModel() {
|
|||||||
onInfo = {
|
onInfo = {
|
||||||
togglePaidRelay(item, it.limitation?.payment_required ?: false)
|
togglePaidRelay(item, it.limitation?.payment_required ?: false)
|
||||||
},
|
},
|
||||||
onError = { url, errorCode, exceptionMessage -> },
|
onError = { _, _, _ -> },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ abstract class BasicRelaySetupInfoModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun deleteAll() {
|
fun deleteAll() {
|
||||||
_relays.update { relays -> emptyList() }
|
_relays.update { _ -> emptyList() }
|
||||||
hasModified = true
|
hasModified = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ fun LazyListScope.renderConnectedItems(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
itemsIndexed(feedState, key = { _, item -> "Connected" + item.relay.url }) { index, item ->
|
itemsIndexed(feedState, key = { _, item -> "Connected" + item.relay.url }) { _, item ->
|
||||||
BasicRelaySetupInfoDialog(
|
BasicRelaySetupInfoDialog(
|
||||||
item,
|
item,
|
||||||
onDelete = null,
|
onDelete = null,
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@ class ConnectedRelayListViewModel : BasicRelaySetupInfoModel() {
|
|||||||
val reqs = Amethyst.instance.client.activeRequests(it)
|
val reqs = Amethyst.instance.client.activeRequests(it)
|
||||||
|
|
||||||
val users = mutableSetOf<HexKey>()
|
val users = mutableSetOf<HexKey>()
|
||||||
reqs.forEach { id, filters ->
|
reqs.forEach { _, filters ->
|
||||||
filters.forEach { filter ->
|
filters.forEach { filter ->
|
||||||
val isReportFilter = filter.kinds?.size == 1 && filter.kinds?.firstOrNull() == ReportEvent.KIND
|
val isReportFilter = filter.kinds?.size == 1 && filter.kinds?.firstOrNull() == ReportEvent.KIND
|
||||||
if (!isReportFilter) {
|
if (!isReportFilter) {
|
||||||
|
|||||||
+4
-4
@@ -107,7 +107,7 @@ class Nip65RelayListViewModel : ViewModel() {
|
|||||||
onInfo = {
|
onInfo = {
|
||||||
toggleHomePaidRelay(item, it.limitation?.payment_required ?: false)
|
toggleHomePaidRelay(item, it.limitation?.payment_required ?: false)
|
||||||
},
|
},
|
||||||
onError = { url, errorCode, exceptionMessage -> },
|
onError = { _, _, _ -> },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ class Nip65RelayListViewModel : ViewModel() {
|
|||||||
onInfo = {
|
onInfo = {
|
||||||
toggleNotifPaidRelay(item, it.limitation?.payment_required ?: false)
|
toggleNotifPaidRelay(item, it.limitation?.payment_required ?: false)
|
||||||
},
|
},
|
||||||
onError = { url, errorCode, exceptionMessage -> },
|
onError = { _, _, _ -> },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,7 @@ class Nip65RelayListViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun deleteHomeAll() {
|
fun deleteHomeAll() {
|
||||||
_homeRelays.update { relays -> emptyList() }
|
_homeRelays.update { _ -> emptyList() }
|
||||||
hasModified = true
|
hasModified = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ class Nip65RelayListViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun deleteNotifAll() {
|
fun deleteNotifAll() {
|
||||||
_notificationRelays.update { relays -> emptyList() }
|
_notificationRelays.update { _ -> emptyList() }
|
||||||
hasModified = true
|
hasModified = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user