chore: rebrand to Dark Wisp (com.darkwisp.app)

- Rename package com.wisp.app -> com.darkwisp.app
- Set applicationId/namespace to com.darkwisp.app
- Reset version to 1.0.0 (versionCode 1) as a new app
- Update display name to Dark Wisp / Dark Wisp Debug
- Update NIP-89 client tag to "Dark Wisp"
- Rebrand user-facing strings across all locales and README
- rootProject.name -> dark-wisp-android
This commit is contained in:
Barry Deen
2026-06-10 10:36:58 -04:00
parent 9a6b100e3a
commit 80f9e42cc6
252 changed files with 1891 additions and 1891 deletions
+16 -16
View File
@@ -1,6 +1,6 @@
# Wisp
# Dark Wisp
A minimal, performant Android client for the [Nostr](https://nostr.com) protocol. Built with Kotlin and Jetpack Compose (Material 3), Wisp prioritizes decentralization, intelligent relay routing, strong privacy, and a clean native experience.
A minimal, performant Android client for the [Nostr](https://nostr.com) protocol. Built with Kotlin and Jetpack Compose (Material 3), Dark Wisp prioritizes decentralization, intelligent relay routing, strong privacy, and a clean native experience.
> **Status:** v1.0.0 — stable, actively developed.
@@ -8,7 +8,7 @@ A minimal, performant Android client for the [Nostr](https://nostr.com) protocol
## Table of Contents
- [Why Wisp](#why-wisp)
- [Why Dark Wisp](#why-dark-wisp)
- [Key Features](#key-features)
- [Architecture](#architecture)
- [Supported NIPs](#supported-nips)
@@ -20,11 +20,11 @@ A minimal, performant Android client for the [Nostr](https://nostr.com) protocol
---
## Why Wisp
## Why Dark Wisp
Most Nostr clients treat relays as interchangeable dumb pipes and lean on a small handful of "mega-relays." Wisp takes a different approach — it implements the full outbox/inbox relay model with reliability scoring, routes messages based on where users actually publish and read, and is built so that decentralization is the default path, not an opt-in.
Most Nostr clients treat relays as interchangeable dumb pipes and lean on a small handful of "mega-relays." Dark Wisp takes a different approach — it implements the full outbox/inbox relay model with reliability scoring, routes messages based on where users actually publish and read, and is built so that decentralization is the default path, not an opt-in.
The result is faster event delivery, less wasted bandwidth, and a client that actively reinforces the architecture Nostr was designed for. Wisp is built to be fast, lightweight, and respectful of both your device and the relay network.
The result is faster event delivery, less wasted bandwidth, and a client that actively reinforces the architecture Nostr was designed for. Dark Wisp is built to be fast, lightweight, and respectful of both your device and the relay network.
---
@@ -32,7 +32,7 @@ The result is faster event delivery, less wasted bandwidth, and a client that ac
### Intelligent Outbox/Inbox Relay Routing
Wisp implements a full NIP-65 outbox/inbox model with relay scoring:
Dark Wisp implements a full NIP-65 outbox/inbox model with relay scoring:
- **Outbox reads** — fetches a user's posts from their *write relays* (where they actually publish), not from a hardcoded list
- **Inbox writes** — delivers replies, reactions, and mentions to the recipient's *read relays* so they actually see them
@@ -49,7 +49,7 @@ Wisp implements a full NIP-65 outbox/inbox model with relay scoring:
- **NIP-04 fallback** — legacy encrypted DMs still read for backward compatibility
- **Dedicated DM relays** — publish DMs to a separate relay set (NIP-51 kind 10050) from your public posts
- **Encrypted media** — optional encrypted image attachments in DMs
- **Optional Amber / NIP-55 remote signer** — keep your `nsec` in a dedicated signer app and never hand it to Wisp at all
- **Optional Amber / NIP-55 remote signer** — keep your `nsec` in a dedicated signer app and never hand it to Dark Wisp at all
### Lightning & Zaps
@@ -114,7 +114,7 @@ A built-in non-custodial Lightning wallet powered by [Breez SDK (Spark)](https:/
- **Multiple accounts** with per-account encrypted storage
- **EncryptedSharedPreferences** (AES256-GCM) for private keys — `nsec` never touches plain SharedPreferences
- **Biometric authentication** for key access
- **NIP-55 remote signing** — delegate all signing/encryption to Amber (or another signer app) via Android intents, so Wisp never holds the key
- **NIP-55 remote signing** — delegate all signing/encryption to Amber (or another signer app) via Android intents, so Dark Wisp never holds the key
- **NIP-19 bech32** — npub, nsec, note, nevent, nprofile encode/decode, with `nostr:` URI rendering in post content
- **NIP-05 DNS verification** with result caching
- **QR code display** for sharing keys and profiles
@@ -136,7 +136,7 @@ A built-in non-custodial Lightning wallet powered by [Breez SDK (Spark)](https:/
## Architecture
Wisp follows an MVVM architecture with clear layer separation:
Dark Wisp follows an MVVM architecture with clear layer separation:
```
┌──────────────────────────────────────────────────────┐
@@ -179,7 +179,7 @@ Wisp follows an MVVM architecture with clear layer separation:
### Project Structure
```
app/src/main/kotlin/com/wisp/app/
app/src/main/kotlin/com/darkwisp/app/
├── nostr/ # Protocol implementations (NipXX.kt objects)
├── relay/ # WebSocket relay, pool, outbox router, scoring
├── repo/ # Data repositories, caches, and persistence wrappers
@@ -248,7 +248,7 @@ APK downloads are available on the [Releases](../../releases) page.
1. **Create, import, or pair a signer** — generate a fresh keypair, paste your `nsec`, or connect Amber for remote signing
2. **Set up your profile** — the onboarding flow walks you through name, picture, and bio
3. **Pick some interests** — topic/interest selection seeds your first follow suggestions
4. **Follow some people** — Wisp suggests popular accounts to get your feed started
4. **Follow some people** Dark Wisp suggests popular accounts to get your feed started
5. **Configure relays** — your relay list is published as a NIP-65 event so other outbox-aware clients can find you
---
@@ -265,8 +265,8 @@ APK downloads are available on the [Releases](../../releases) page.
```bash
# Clone the repository
git clone https://github.com/barrydeen/wisp.git
cd wisp
git clone https://github.com/barrydeen/dark-wisp-android.git
cd dark-wisp-android
# Build debug APK
./gradlew assembleDebug
@@ -284,7 +284,7 @@ Release builds use R8 minification; keep rules live in `app/proguard-rules.pro`
## Contributing
Contributions are welcome. Wisp is open source and community help makes it better.
Contributions are welcome. Dark Wisp is open source and community help makes it better.
### How to Contribute
@@ -349,7 +349,7 @@ Contributions are welcome. Wisp is open source and community help makes it bette
## License
Wisp is released under the [MIT License](LICENSE).
Dark Wisp is released under the [MIT License](LICENSE).
```
MIT License
+5 -5
View File
@@ -12,16 +12,16 @@ android {
val baseApplicationId = rootProject.extra["baseApplicationId"] as String
val debugApplicationIdSuffix = rootProject.extra["debugApplicationIdSuffix"] as String
namespace = "com.wisp.app"
namespace = "com.darkwisp.app"
compileSdk = 35
defaultConfig {
applicationId = baseApplicationId
minSdk = 26
targetSdk = 35
versionCode = 79
versionName = "1.0.5"
resValue("string", "app_name", "Wisp")
versionCode = 1
versionName = "1.0.0"
resValue("string", "app_name", "Dark Wisp")
ndk {
abiFilters += "arm64-v8a"
@@ -40,7 +40,7 @@ android {
buildTypes {
debug {
applicationIdSuffix = debugApplicationIdSuffix
resValue("string", "app_name", "Wisp Debug")
resValue("string", "app_name", "Dark Wisp Debug")
}
release {
+1 -1
View File
@@ -54,7 +54,7 @@
# ObjectBox
-keep class io.objectbox.** { *; }
-dontwarn io.objectbox.**
-keep class com.wisp.app.db.** { *; }
-keep class com.darkwisp.app.db.** { *; }
# Breez SDK Spark (UniFFI bindings)
-keep class breez_sdk_spark.** { *; }
@@ -1,11 +1,11 @@
package com.wisp.app
package com.darkwisp.app
import android.content.Context
import android.os.Build
import com.wisp.app.nostr.ClientMessage
import com.wisp.app.nostr.Nip17
import com.wisp.app.relay.RelayPool
import com.wisp.app.repo.KeyRepository
import com.darkwisp.app.nostr.ClientMessage
import com.darkwisp.app.nostr.Nip17
import com.darkwisp.app.relay.RelayPool
import com.darkwisp.app.repo.KeyRepository
import java.io.File
import java.text.SimpleDateFormat
import java.util.Date
@@ -1,4 +1,4 @@
package com.wisp.app
package com.darkwisp.app
import android.content.Context
import android.content.Intent
@@ -17,12 +17,12 @@ import androidx.compose.runtime.setValue
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.remember
import androidx.compose.ui.graphics.Color
import com.wisp.app.repo.InterfacePreferences
import com.wisp.app.repo.LocaleRepository
import com.wisp.app.ui.component.LocalMediaSettings
import com.wisp.app.ui.component.MediaSettings
import com.wisp.app.ui.component.PipController
import com.wisp.app.ui.theme.WispTheme
import com.darkwisp.app.repo.InterfacePreferences
import com.darkwisp.app.repo.LocaleRepository
import com.darkwisp.app.ui.component.LocalMediaSettings
import com.darkwisp.app.ui.component.MediaSettings
import com.darkwisp.app.ui.component.PipController
import com.darkwisp.app.ui.theme.WispTheme
class MainActivity : FragmentActivity() {
var deepLinkUri = mutableStateOf<String?>(null)
@@ -1,4 +1,4 @@
package com.wisp.app
package com.darkwisp.app
import android.os.SystemClock
import androidx.activity.compose.BackHandler
@@ -9,7 +9,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.unit.dp
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import com.wisp.app.ui.screen.BroadcastStatusBar
import com.darkwisp.app.ui.screen.BroadcastStatusBar
import androidx.activity.ComponentActivity
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
@@ -36,97 +36,97 @@ import android.app.Activity
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.runtime.collectAsState
import com.wisp.app.nostr.Nip10
import com.wisp.app.nostr.Nip19
import com.wisp.app.nostr.NostrUriData
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.nostr.ProfileData
import com.wisp.app.nostr.LocalSigner
import com.wisp.app.nostr.RemoteSigner
import com.wisp.app.nostr.SignerIntentBridge
import com.wisp.app.nostr.SignResult
import com.wisp.app.repo.SigningMode
import com.darkwisp.app.nostr.Nip10
import com.darkwisp.app.nostr.Nip19
import com.darkwisp.app.nostr.NostrUriData
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.ProfileData
import com.darkwisp.app.nostr.LocalSigner
import com.darkwisp.app.nostr.RemoteSigner
import com.darkwisp.app.nostr.SignerIntentBridge
import com.darkwisp.app.nostr.SignResult
import com.darkwisp.app.repo.SigningMode
import android.content.Context
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.rememberUpdatedState
import com.wisp.app.ui.component.HapticHelper
import com.wisp.app.ui.component.NotifBlipSound
import com.wisp.app.ui.component.BottomTab
import com.wisp.app.ui.component.WispBottomBar
import com.wisp.app.ui.component.ZapDialog
import com.wisp.app.ui.component.pendingEmojiReactCallback
import com.wisp.app.ui.component.AuthApprovalDialog
import com.wisp.app.ui.screen.BlossomServersScreen
import com.wisp.app.ui.screen.AuthScreen
import com.wisp.app.ui.screen.SplashScreen
import com.wisp.app.ui.screen.ComposeScreen
import com.wisp.app.ui.screen.ContactPickerScreen
import com.wisp.app.ui.screen.DmConversationScreen
import com.wisp.app.ui.screen.DmListScreen
import com.wisp.app.ui.screen.DraftsScreen
import com.wisp.app.ui.screen.FeedScreen
import com.wisp.app.ui.screen.ProfileEditScreen
import com.wisp.app.ui.screen.RelayScreen
import com.wisp.app.ui.screen.ThreadScreen
import com.wisp.app.ui.screen.NotificationsScreen
import com.wisp.app.ui.screen.SafetyScreen
import com.wisp.app.ui.screen.UserProfileScreen
import com.wisp.app.ui.screen.ConsoleScreen
import com.wisp.app.ui.screen.RelayHealthScreen
import com.wisp.app.ui.screen.CustomEmojiScreen
import com.wisp.app.ui.screen.SearchScreen
import com.wisp.app.ui.screen.SocialGraphScreen
import com.wisp.app.ui.screen.BookmarkSetScreen
import com.wisp.app.ui.screen.ArticleScreen
import com.wisp.app.ui.screen.BookmarksScreen
import com.wisp.app.ui.screen.HashtagFeedScreen
import com.wisp.app.ui.screen.KeysScreen
import com.wisp.app.ui.screen.ListScreen
import com.wisp.app.ui.screen.LiveStreamScreen
import com.wisp.app.ui.screen.ExistingUserOnboardingScreen
import com.wisp.app.ui.screen.LoadingScreen
import com.wisp.app.ui.screen.ListsHubScreen
import com.wisp.app.ui.screen.InterfaceScreen
import com.wisp.app.ui.screen.PowSettingsScreen
import com.wisp.app.ui.screen.OnboardingScreen
import com.wisp.app.ui.component.AddNoteToListDialog
import com.wisp.app.ui.component.CrashReportDialog
import com.darkwisp.app.ui.component.HapticHelper
import com.darkwisp.app.ui.component.NotifBlipSound
import com.darkwisp.app.ui.component.BottomTab
import com.darkwisp.app.ui.component.WispBottomBar
import com.darkwisp.app.ui.component.ZapDialog
import com.darkwisp.app.ui.component.pendingEmojiReactCallback
import com.darkwisp.app.ui.component.AuthApprovalDialog
import com.darkwisp.app.ui.screen.BlossomServersScreen
import com.darkwisp.app.ui.screen.AuthScreen
import com.darkwisp.app.ui.screen.SplashScreen
import com.darkwisp.app.ui.screen.ComposeScreen
import com.darkwisp.app.ui.screen.ContactPickerScreen
import com.darkwisp.app.ui.screen.DmConversationScreen
import com.darkwisp.app.ui.screen.DmListScreen
import com.darkwisp.app.ui.screen.DraftsScreen
import com.darkwisp.app.ui.screen.FeedScreen
import com.darkwisp.app.ui.screen.ProfileEditScreen
import com.darkwisp.app.ui.screen.RelayScreen
import com.darkwisp.app.ui.screen.ThreadScreen
import com.darkwisp.app.ui.screen.NotificationsScreen
import com.darkwisp.app.ui.screen.SafetyScreen
import com.darkwisp.app.ui.screen.UserProfileScreen
import com.darkwisp.app.ui.screen.ConsoleScreen
import com.darkwisp.app.ui.screen.RelayHealthScreen
import com.darkwisp.app.ui.screen.CustomEmojiScreen
import com.darkwisp.app.ui.screen.SearchScreen
import com.darkwisp.app.ui.screen.SocialGraphScreen
import com.darkwisp.app.ui.screen.BookmarkSetScreen
import com.darkwisp.app.ui.screen.ArticleScreen
import com.darkwisp.app.ui.screen.BookmarksScreen
import com.darkwisp.app.ui.screen.HashtagFeedScreen
import com.darkwisp.app.ui.screen.KeysScreen
import com.darkwisp.app.ui.screen.ListScreen
import com.darkwisp.app.ui.screen.LiveStreamScreen
import com.darkwisp.app.ui.screen.ExistingUserOnboardingScreen
import com.darkwisp.app.ui.screen.LoadingScreen
import com.darkwisp.app.ui.screen.ListsHubScreen
import com.darkwisp.app.ui.screen.InterfaceScreen
import com.darkwisp.app.ui.screen.PowSettingsScreen
import com.darkwisp.app.ui.screen.OnboardingScreen
import com.darkwisp.app.ui.component.AddNoteToListDialog
import com.darkwisp.app.ui.component.CrashReportDialog
import androidx.media3.exoplayer.ExoPlayer
import com.wisp.app.ui.component.FloatingAudioPlayer
import com.wisp.app.ui.component.FloatingVideoPlayer
import com.wisp.app.ui.component.PipController
import com.wisp.app.ui.component.FullScreenVideoPlayer
import com.wisp.app.ui.component.FullScreenVideoState
import com.wisp.app.ui.screen.OnboardingSuggestionsScreen
import com.wisp.app.ui.screen.OnboardingTopicsScreen
import com.wisp.app.ui.screen.OnboardingFirstPostScreen
import com.wisp.app.ui.screen.RelayDetailScreen
import com.wisp.app.ui.screen.WalletScreen
import com.wisp.app.viewmodel.BlossomServersViewModel
import com.wisp.app.viewmodel.ArticleViewModel
import com.wisp.app.viewmodel.AuthViewModel
import com.wisp.app.viewmodel.ComposeViewModel
import com.wisp.app.viewmodel.DmConversationViewModel
import com.wisp.app.viewmodel.DmListViewModel
import com.wisp.app.viewmodel.FeedType
import com.wisp.app.viewmodel.FeedViewModel
import com.wisp.app.viewmodel.ProfileViewModel
import com.wisp.app.viewmodel.RelayViewModel
import com.wisp.app.viewmodel.ThreadViewModel
import com.wisp.app.viewmodel.UserProfileViewModel
import com.wisp.app.nostr.Nip88
import com.wisp.app.viewmodel.NotificationFilter
import com.wisp.app.viewmodel.NotificationsViewModel
import com.wisp.app.viewmodel.ConsoleViewModel
import com.wisp.app.viewmodel.RelayHealthViewModel
import com.wisp.app.viewmodel.DraftsViewModel
import com.wisp.app.viewmodel.SearchViewModel
import com.wisp.app.viewmodel.HashtagFeedViewModel
import com.wisp.app.viewmodel.OnboardingViewModel
import com.wisp.app.viewmodel.PowStatus
import com.wisp.app.viewmodel.SplashViewModel
import com.wisp.app.viewmodel.LiveStreamViewModel
import com.wisp.app.viewmodel.WalletViewModel
import com.darkwisp.app.ui.component.FloatingAudioPlayer
import com.darkwisp.app.ui.component.FloatingVideoPlayer
import com.darkwisp.app.ui.component.PipController
import com.darkwisp.app.ui.component.FullScreenVideoPlayer
import com.darkwisp.app.ui.component.FullScreenVideoState
import com.darkwisp.app.ui.screen.OnboardingSuggestionsScreen
import com.darkwisp.app.ui.screen.OnboardingTopicsScreen
import com.darkwisp.app.ui.screen.OnboardingFirstPostScreen
import com.darkwisp.app.ui.screen.RelayDetailScreen
import com.darkwisp.app.ui.screen.WalletScreen
import com.darkwisp.app.viewmodel.BlossomServersViewModel
import com.darkwisp.app.viewmodel.ArticleViewModel
import com.darkwisp.app.viewmodel.AuthViewModel
import com.darkwisp.app.viewmodel.ComposeViewModel
import com.darkwisp.app.viewmodel.DmConversationViewModel
import com.darkwisp.app.viewmodel.DmListViewModel
import com.darkwisp.app.viewmodel.FeedType
import com.darkwisp.app.viewmodel.FeedViewModel
import com.darkwisp.app.viewmodel.ProfileViewModel
import com.darkwisp.app.viewmodel.RelayViewModel
import com.darkwisp.app.viewmodel.ThreadViewModel
import com.darkwisp.app.viewmodel.UserProfileViewModel
import com.darkwisp.app.nostr.Nip88
import com.darkwisp.app.viewmodel.NotificationFilter
import com.darkwisp.app.viewmodel.NotificationsViewModel
import com.darkwisp.app.viewmodel.ConsoleViewModel
import com.darkwisp.app.viewmodel.RelayHealthViewModel
import com.darkwisp.app.viewmodel.DraftsViewModel
import com.darkwisp.app.viewmodel.SearchViewModel
import com.darkwisp.app.viewmodel.HashtagFeedViewModel
import com.darkwisp.app.viewmodel.OnboardingViewModel
import com.darkwisp.app.viewmodel.PowStatus
import com.darkwisp.app.viewmodel.SplashViewModel
import com.darkwisp.app.viewmodel.LiveStreamViewModel
import com.darkwisp.app.viewmodel.WalletViewModel
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
@@ -203,7 +203,7 @@ fun WispNavHost(
val relayViewModel: RelayViewModel = viewModel()
val profileViewModel: ProfileViewModel = viewModel()
val dmListViewModel: DmListViewModel = viewModel()
val groupListViewModel: com.wisp.app.viewmodel.GroupListViewModel = viewModel()
val groupListViewModel: com.darkwisp.app.viewmodel.GroupListViewModel = viewModel()
val blossomServersViewModel: BlossomServersViewModel = viewModel()
val appContext = LocalContext.current.applicationContext
val walletViewModel: WalletViewModel = viewModel(
@@ -228,7 +228,7 @@ fun WispNavHost(
val consoleViewModel: ConsoleViewModel = viewModel()
val relayHealthViewModel: RelayHealthViewModel = viewModel()
val onboardingViewModel: OnboardingViewModel = viewModel()
val topicOnboardingViewModel: com.wisp.app.viewmodel.TopicOnboardingViewModel = viewModel()
val topicOnboardingViewModel: com.darkwisp.app.viewmodel.TopicOnboardingViewModel = viewModel()
val splashViewModel: SplashViewModel = viewModel()
relayViewModel.relayPool = feedViewModel.relayPool
@@ -407,11 +407,11 @@ fun WispNavHost(
val hideBottomBarRoutes = nonAppRoutes + Routes.DM_CONVERSATION + Routes.DM_CONVERSATION_GROUP + Routes.CONTACT_PICKER + Routes.GROUP_ROOM + Routes.GROUP_DETAIL + Routes.LIVE_STREAM
val socialGraphDiscoveryState by feedViewModel.extendedNetworkRepo.discoveryState.collectAsState()
val socialGraphComputing = currentRoute == Routes.SOCIAL_GRAPH && (
socialGraphDiscoveryState is com.wisp.app.repo.DiscoveryState.FetchingFollowLists ||
socialGraphDiscoveryState is com.wisp.app.repo.DiscoveryState.BuildingGraph ||
socialGraphDiscoveryState is com.wisp.app.repo.DiscoveryState.ComputingNetwork ||
socialGraphDiscoveryState is com.wisp.app.repo.DiscoveryState.Filtering ||
socialGraphDiscoveryState is com.wisp.app.repo.DiscoveryState.FetchingRelayLists)
socialGraphDiscoveryState is com.darkwisp.app.repo.DiscoveryState.FetchingFollowLists ||
socialGraphDiscoveryState is com.darkwisp.app.repo.DiscoveryState.BuildingGraph ||
socialGraphDiscoveryState is com.darkwisp.app.repo.DiscoveryState.ComputingNetwork ||
socialGraphDiscoveryState is com.darkwisp.app.repo.DiscoveryState.Filtering ||
socialGraphDiscoveryState is com.darkwisp.app.repo.DiscoveryState.FetchingRelayLists)
val showBottomBar by remember(currentRoute, socialGraphComputing) {
derivedStateOf { currentRoute != null && currentRoute !in hideBottomBarRoutes && !socialGraphComputing }
}
@@ -800,7 +800,7 @@ fun WispNavHost(
accounts = accounts,
onSwitchAccount = onSwitchAccount,
onAddAccount = onAddAccount,
hasEmbeddedWallet = walletViewModel.walletMode.collectAsState().value == com.wisp.app.repo.WalletMode.SPARK,
hasEmbeddedWallet = walletViewModel.walletMode.collectAsState().value == com.darkwisp.app.repo.WalletMode.SPARK,
onLogout = {
feedViewModel.clearSigner()
feedViewModel.resetForAccountSwitch()
@@ -819,7 +819,7 @@ fun WispNavHost(
}
} else {
// Full logout — reset UI preferences and refresh in-memory theme state
com.wisp.app.repo.InterfacePreferences(context).reset()
com.darkwisp.app.repo.InterfacePreferences(context).reset()
onInterfaceChanged()
navController.navigate(Routes.SPLASH) {
popUpTo(0) { inclusive = true }
@@ -1157,12 +1157,12 @@ fun WispNavHost(
onAddEmojiSet = { pk, dTag -> feedViewModel.addSetToEmojiList(pk, dTag) },
onRemoveEmojiSet = { pk, dTag -> feedViewModel.removeSetFromEmojiList(pk, dTag) },
isEmojiSetAdded = { pk, dTag ->
val ref = com.wisp.app.nostr.Nip30.buildSetReference(pk, dTag)
val ref = com.darkwisp.app.nostr.Nip30.buildSetReference(pk, dTag)
feedViewModel.customEmojiRepo.userEmojiList.value?.setReferences?.contains(ref) ?: false
}
)
if (showProfileEmojiLibrary) {
com.wisp.app.ui.component.EmojiLibrarySheet(
com.darkwisp.app.ui.component.EmojiLibrarySheet(
currentEmojis = profileUnicodeEmojis,
customEmojiMap = profileResolvedEmojis,
onAddEmojis = { emojis ->
@@ -1273,7 +1273,7 @@ fun WispNavHost(
onAddEmojiSet = { pubkey, dTag -> feedViewModel.addSetToEmojiList(pubkey, dTag) },
onRemoveEmojiSet = { pubkey, dTag -> feedViewModel.removeSetFromEmojiList(pubkey, dTag) },
isEmojiSetAdded = { pubkey, dTag ->
val ref = com.wisp.app.nostr.Nip30.buildSetReference(pubkey, dTag)
val ref = com.darkwisp.app.nostr.Nip30.buildSetReference(pubkey, dTag)
feedViewModel.customEmojiRepo.userEmojiList.value?.setReferences?.contains(ref) ?: false
},
nip05Repo = feedViewModel.nip05Repo
@@ -1375,12 +1375,12 @@ fun WispNavHost(
isWalletConnected = feedViewModel.activeWalletProvider.hasConnection(),
onGoToWallet = { navController.navigate(Routes.WALLET) },
noteActions = remember {
com.wisp.app.ui.component.NoteActions(
com.darkwisp.app.ui.component.NoteActions(
nip05Repo = feedViewModel.nip05Repo,
onAddEmojiSet = { pk, dTag -> feedViewModel.addSetToEmojiList(pk, dTag) },
onRemoveEmojiSet = { pk, dTag -> feedViewModel.removeSetFromEmojiList(pk, dTag) },
isEmojiSetAdded = { pk, dTag ->
val ref = com.wisp.app.nostr.Nip30.buildSetReference(pk, dTag)
val ref = com.darkwisp.app.nostr.Nip30.buildSetReference(pk, dTag)
feedViewModel.customEmojiRepo.userEmojiList.value?.setReferences?.contains(ref) ?: false
},
resolvedEmojisProvider = { feedViewModel.customEmojiRepo.resolvedEmojis.value },
@@ -1396,7 +1396,7 @@ fun WispNavHost(
if (showDmEmojiLibrary) {
val dmSheetUnicodeEmojis by feedViewModel.customEmojiRepo.unicodeEmojis.collectAsState()
val dmSheetResolvedEmojis by feedViewModel.customEmojiRepo.resolvedEmojis.collectAsState()
com.wisp.app.ui.component.EmojiLibrarySheet(
com.darkwisp.app.ui.component.EmojiLibrarySheet(
currentEmojis = dmSheetUnicodeEmojis,
customEmojiMap = dmSheetResolvedEmojis,
onAddEmojis = { emojis ->
@@ -1462,12 +1462,12 @@ fun WispNavHost(
isWalletConnected = feedViewModel.activeWalletProvider.hasConnection(),
onGoToWallet = { navController.navigate(Routes.WALLET) },
noteActions = remember {
com.wisp.app.ui.component.NoteActions(
com.darkwisp.app.ui.component.NoteActions(
nip05Repo = feedViewModel.nip05Repo,
onAddEmojiSet = { pk, dTag -> feedViewModel.addSetToEmojiList(pk, dTag) },
onRemoveEmojiSet = { pk, dTag -> feedViewModel.removeSetFromEmojiList(pk, dTag) },
isEmojiSetAdded = { pk, dTag ->
val ref = com.wisp.app.nostr.Nip30.buildSetReference(pk, dTag)
val ref = com.darkwisp.app.nostr.Nip30.buildSetReference(pk, dTag)
feedViewModel.customEmojiRepo.userEmojiList.value?.setReferences?.contains(ref) ?: false
},
resolvedEmojisProvider = { feedViewModel.customEmojiRepo.resolvedEmojis.value },
@@ -1483,7 +1483,7 @@ fun WispNavHost(
if (showDmGroupEmojiLibrary) {
val dmGroupSheetUnicodeEmojis by feedViewModel.customEmojiRepo.unicodeEmojis.collectAsState()
val dmGroupSheetResolvedEmojis by feedViewModel.customEmojiRepo.resolvedEmojis.collectAsState()
com.wisp.app.ui.component.EmojiLibrarySheet(
com.darkwisp.app.ui.component.EmojiLibrarySheet(
currentEmojis = dmGroupSheetUnicodeEmojis,
customEmojiMap = dmGroupSheetResolvedEmojis,
onAddEmojis = { emojis ->
@@ -1516,7 +1516,7 @@ fun WispNavHost(
android.util.Base64.decode(encodedRelay, android.util.Base64.URL_SAFE),
Charsets.UTF_8
)
val groupRoomViewModel: com.wisp.app.viewmodel.GroupRoomViewModel = viewModel()
val groupRoomViewModel: com.darkwisp.app.viewmodel.GroupRoomViewModel = viewModel()
// Pre-compute from current repo state so the first composition doesn't flash
// the join screen for groups the user has already joined.
val initialRoom = remember(relayUrl, groupId) {
@@ -1542,7 +1542,7 @@ fun WispNavHost(
val groupRoomContext = LocalContext.current
val groupRoomUploadScope = rememberCoroutineScope()
var groupRoomUploadProgress by remember { mutableStateOf<String?>(null) }
var groupRoomZapTarget by remember { mutableStateOf<com.wisp.app.nostr.NostrEvent?>(null) }
var groupRoomZapTarget by remember { mutableStateOf<com.darkwisp.app.nostr.NostrEvent?>(null) }
var groupRoomZapInitialSats by remember { mutableStateOf<Int?>(null) }
var showGroupRoomEmojiLibrary by remember { mutableStateOf(false) }
val groupRoomResolvedEmojis by feedViewModel.customEmojiRepo.resolvedEmojis.collectAsState()
@@ -1607,7 +1607,7 @@ fun WispNavHost(
}
}
}
com.wisp.app.ui.screen.GroupRoomScreen(
com.darkwisp.app.ui.screen.GroupRoomScreen(
viewModel = groupRoomViewModel,
initialRoom = initialRoom,
scrollToMessageId = scrollToMessageId,
@@ -1649,40 +1649,40 @@ fun WispNavHost(
myPubkey = feedViewModel.getUserPubkey(),
onZap = { msgId, senderPubkey ->
groupRoomZapInitialSats = null
groupRoomZapTarget = com.wisp.app.nostr.NostrEvent(
groupRoomZapTarget = com.darkwisp.app.nostr.NostrEvent(
id = msgId,
pubkey = senderPubkey,
created_at = 0L,
kind = com.wisp.app.nostr.Nip29.KIND_CHAT_MESSAGE,
kind = com.darkwisp.app.nostr.Nip29.KIND_CHAT_MESSAGE,
tags = listOf(listOf("h", groupId)),
content = "",
sig = ""
)
feedViewModel.relayPool.sendToRelayOrEphemeral(
relayUrl,
com.wisp.app.nostr.ClientMessage.req(
com.darkwisp.app.nostr.ClientMessage.req(
subscriptionId = "zap-rcpt-grp-${msgId.take(12)}",
filter = com.wisp.app.nostr.Filter(kinds = listOf(9735), eTags = listOf(msgId))
filter = com.darkwisp.app.nostr.Filter(kinds = listOf(9735), eTags = listOf(msgId))
),
skipBadCheck = true
)
},
onZapPreset = { msgId, senderPubkey, sats ->
groupRoomZapInitialSats = sats
groupRoomZapTarget = com.wisp.app.nostr.NostrEvent(
groupRoomZapTarget = com.darkwisp.app.nostr.NostrEvent(
id = msgId,
pubkey = senderPubkey,
created_at = 0L,
kind = com.wisp.app.nostr.Nip29.KIND_CHAT_MESSAGE,
kind = com.darkwisp.app.nostr.Nip29.KIND_CHAT_MESSAGE,
tags = listOf(listOf("h", groupId)),
content = "",
sig = ""
)
feedViewModel.relayPool.sendToRelayOrEphemeral(
relayUrl,
com.wisp.app.nostr.ClientMessage.req(
com.darkwisp.app.nostr.ClientMessage.req(
subscriptionId = "zap-rcpt-grp-${msgId.take(12)}",
filter = com.wisp.app.nostr.Filter(kinds = listOf(9735), eTags = listOf(msgId))
filter = com.darkwisp.app.nostr.Filter(kinds = listOf(9735), eTags = listOf(msgId))
),
skipBadCheck = true
)
@@ -1697,13 +1697,13 @@ fun WispNavHost(
onBlockAuthor = { pubkey -> feedViewModel.blockUser(pubkey) },
isFollowing = { pubkey -> feedViewModel.contactRepo.isFollowing(pubkey) },
noteActions = remember {
com.wisp.app.ui.component.NoteActions(
com.darkwisp.app.ui.component.NoteActions(
nip05Repo = feedViewModel.nip05Repo,
onNoteClick = { eventId -> navController.navigate("thread/$eventId") },
onAddEmojiSet = { pk, dTag -> feedViewModel.addSetToEmojiList(pk, dTag) },
onRemoveEmojiSet = { pk, dTag -> feedViewModel.removeSetFromEmojiList(pk, dTag) },
isEmojiSetAdded = { pk, dTag ->
val ref = com.wisp.app.nostr.Nip30.buildSetReference(pk, dTag)
val ref = com.darkwisp.app.nostr.Nip30.buildSetReference(pk, dTag)
feedViewModel.customEmojiRepo.userEmojiList.value?.setReferences?.contains(ref) ?: false
},
resolvedEmojisProvider = { feedViewModel.customEmojiRepo.resolvedEmojis.value },
@@ -1716,7 +1716,7 @@ fun WispNavHost(
if (showGroupRoomEmojiLibrary) {
val groupRoomSheetUnicodeEmojis by feedViewModel.customEmojiRepo.unicodeEmojis.collectAsState()
val groupRoomSheetResolvedEmojis by feedViewModel.customEmojiRepo.resolvedEmojis.collectAsState()
com.wisp.app.ui.component.EmojiLibrarySheet(
com.darkwisp.app.ui.component.EmojiLibrarySheet(
currentEmojis = groupRoomSheetUnicodeEmojis,
customEmojiMap = groupRoomSheetResolvedEmojis,
onAddEmojis = { emojis ->
@@ -1767,7 +1767,7 @@ fun WispNavHost(
} catch (_: Exception) { callback("") }
}
}
com.wisp.app.ui.screen.GroupDetailScreen(
com.darkwisp.app.ui.screen.GroupDetailScreen(
groupId = groupId,
relayUrl = relayUrl,
groupListViewModel = groupListViewModel,
@@ -1949,13 +1949,13 @@ fun WispNavHost(
onAddEmojiSet = { pubkey, dTag -> feedViewModel.addSetToEmojiList(pubkey, dTag) },
onRemoveEmojiSet = { pubkey, dTag -> feedViewModel.removeSetFromEmojiList(pubkey, dTag) },
isEmojiSetAdded = { pubkey, dTag ->
val ref = com.wisp.app.nostr.Nip30.buildSetReference(pubkey, dTag)
val ref = com.darkwisp.app.nostr.Nip30.buildSetReference(pubkey, dTag)
feedViewModel.customEmojiRepo.userEmojiList.value?.setReferences?.contains(ref) ?: false
}
)
if (showThreadEmojiLibrary) {
com.wisp.app.ui.component.EmojiLibrarySheet(
com.darkwisp.app.ui.component.EmojiLibrarySheet(
currentEmojis = threadUnicodeEmojis,
customEmojiMap = threadResolvedEmojis,
onAddEmojis = { emojis ->
@@ -2028,7 +2028,7 @@ fun WispNavHost(
}
val hashtagNoteActions = remember {
com.wisp.app.ui.component.NoteActions(
com.darkwisp.app.ui.component.NoteActions(
onReply = { event ->
replyTarget = event
quoteTarget = null
@@ -2078,7 +2078,7 @@ fun WispNavHost(
onAddEmojiSet = { pubkey, dTag -> feedViewModel.addSetToEmojiList(pubkey, dTag) },
onRemoveEmojiSet = { pubkey, dTag -> feedViewModel.removeSetFromEmojiList(pubkey, dTag) },
isEmojiSetAdded = { pubkey, dTag ->
val ref = com.wisp.app.nostr.Nip30.buildSetReference(pubkey, dTag)
val ref = com.darkwisp.app.nostr.Nip30.buildSetReference(pubkey, dTag)
feedViewModel.customEmojiRepo.userEmojiList.value?.setReferences?.contains(ref) ?: false
},
resolvedEmojisProvider = { feedViewModel.customEmojiRepo.resolvedEmojis.value },
@@ -2179,7 +2179,7 @@ fun WispNavHost(
}
val setFeedNoteActions = remember {
com.wisp.app.ui.component.NoteActions(
com.darkwisp.app.ui.component.NoteActions(
onReply = { event ->
replyTarget = event
quoteTarget = null
@@ -2229,7 +2229,7 @@ fun WispNavHost(
onAddEmojiSet = { pubkey, dTag -> feedViewModel.addSetToEmojiList(pubkey, dTag) },
onRemoveEmojiSet = { pubkey, dTag -> feedViewModel.removeSetFromEmojiList(pubkey, dTag) },
isEmojiSetAdded = { pubkey, dTag ->
val ref = com.wisp.app.nostr.Nip30.buildSetReference(pubkey, dTag)
val ref = com.darkwisp.app.nostr.Nip30.buildSetReference(pubkey, dTag)
feedViewModel.customEmojiRepo.userEmojiList.value?.setReferences?.contains(ref) ?: false
},
resolvedEmojisProvider = { feedViewModel.customEmojiRepo.resolvedEmojis.value },
@@ -2298,7 +2298,7 @@ fun WispNavHost(
relayHintStore = feedViewModel.relayHintStore
)
}
var articleZapTarget by remember { mutableStateOf<com.wisp.app.nostr.NostrEvent?>(null) }
var articleZapTarget by remember { mutableStateOf<com.darkwisp.app.nostr.NostrEvent?>(null) }
val articleZapInProgress by feedViewModel.zapInProgress.collectAsState()
var articleZapAnimatingIds by remember { mutableStateOf(emptySet<String>()) }
val isNwcConnected = feedViewModel.activeWalletProvider.hasConnection()
@@ -2343,7 +2343,7 @@ fun WispNavHost(
}
val articleNoteActions = remember {
com.wisp.app.ui.component.NoteActions(
com.darkwisp.app.ui.component.NoteActions(
onReply = { event ->
replyTarget = event
quoteTarget = null
@@ -2388,7 +2388,7 @@ fun WispNavHost(
onAddEmojiSet = { pubkey, dTag -> feedViewModel.addSetToEmojiList(pubkey, dTag) },
onRemoveEmojiSet = { pubkey, dTag -> feedViewModel.removeSetFromEmojiList(pubkey, dTag) },
isEmojiSetAdded = { pubkey, dTag ->
val ref = com.wisp.app.nostr.Nip30.buildSetReference(pubkey, dTag)
val ref = com.darkwisp.app.nostr.Nip30.buildSetReference(pubkey, dTag)
feedViewModel.customEmojiRepo.userEmojiList.value?.setReferences?.contains(ref) ?: false
},
resolvedEmojisProvider = { feedViewModel.customEmojiRepo.resolvedEmojis.value },
@@ -2433,7 +2433,7 @@ fun WispNavHost(
)
if (showArticleEmojiLibrary) {
com.wisp.app.ui.component.EmojiLibrarySheet(
com.darkwisp.app.ui.component.EmojiLibrarySheet(
currentEmojis = articleUnicodeEmojis,
customEmojiMap = articleResolvedEmojis,
onAddEmojis = { emojis ->
@@ -2547,7 +2547,7 @@ fun WispNavHost(
}
val streamActivityEventId = remember(hostPubkey, dTag) {
feedViewModel.eventRepo.findAddressableEvent(
com.wisp.app.nostr.Nip53.KIND_LIVE_ACTIVITY, hostPubkey, dTag
com.darkwisp.app.nostr.Nip53.KIND_LIVE_ACTIVITY, hostPubkey, dTag
)?.id
}
LiveStreamScreen(
@@ -2580,13 +2580,13 @@ fun WispNavHost(
// is in the p-tag with role "Host", so override the recipient.
// Per NIP-57, use "a" tag (not "e") for parameterized replaceable events.
val activityEvent = feedViewModel.eventRepo.findAddressableEvent(
com.wisp.app.nostr.Nip53.KIND_LIVE_ACTIVITY, hostPubkey, dTag
com.darkwisp.app.nostr.Nip53.KIND_LIVE_ACTIVITY, hostPubkey, dTag
)
if (activityEvent != null) {
liveZapTarget = activityEvent
val activity = liveStreamViewModel.activity.value
liveZapRecipientOverride = activity?.streamerPubkey ?: activity?.hostPubkey
liveZapATag = com.wisp.app.nostr.Nip53.aTagValue(hostPubkey, dTag)
liveZapATag = com.darkwisp.app.nostr.Nip53.aTagValue(hostPubkey, dTag)
}
},
streamZapTotal = liveStreamZapTotal,
@@ -2623,7 +2623,7 @@ fun WispNavHost(
composable(Routes.INTERFACE_SETTINGS) {
val context = LocalContext.current
val app = context.applicationContext as android.app.Application
val interfacePrefs = remember { com.wisp.app.repo.InterfacePreferences(context) }
val interfacePrefs = remember { com.darkwisp.app.repo.InterfacePreferences(context) }
InterfaceScreen(
application = app,
interfacePrefs = interfacePrefs,
@@ -3050,7 +3050,7 @@ fun WispNavHost(
}
val notifReplyScope = rememberCoroutineScope()
val notifInterfacePrefs = remember { com.wisp.app.repo.InterfacePreferences(context) }
val notifInterfacePrefs = remember { com.darkwisp.app.repo.InterfacePreferences(context) }
var notifZapTarget by remember { mutableStateOf<NostrEvent?>(null) }
data class NotifDmZapInfo(val peerPubkey: String, val rumorId: String, val senderPubkey: String)
var notifDmZapTarget by remember { mutableStateOf<NotifDmZapInfo?>(null) }
@@ -3145,9 +3145,9 @@ fun WispNavHost(
val signer = activeSigner ?: return@NotificationsScreen
notifReplyScope.launch {
val hint = feedViewModel.outboxRouter?.getRelayHint(replyToEvent.pubkey) ?: ""
val tags = com.wisp.app.nostr.Nip10.buildReplyTags(replyToEvent, hint) +
com.wisp.app.nostr.Nip30.buildEmojiTagsForContent(content, notifResolvedEmojis) +
if (notifInterfacePrefs.isClientTagEnabled()) listOf(listOf("client", "Wisp")) else emptyList()
val tags = com.darkwisp.app.nostr.Nip10.buildReplyTags(replyToEvent, hint) +
com.darkwisp.app.nostr.Nip30.buildEmojiTagsForContent(content, notifResolvedEmojis) +
if (notifInterfacePrefs.isClientTagEnabled()) listOf(listOf("client", "Dark Wisp")) else emptyList()
if (feedViewModel.powPrefs.isNotePowEnabled()) {
feedViewModel.powManager.submitNote(
@@ -3158,7 +3158,7 @@ fun WispNavHost(
replyToPubkey = replyToEvent.pubkey,
onPublished = {
feedViewModel.eventRepo.addReplyCount(replyToEvent.id, "pow-pending")
val rootId = com.wisp.app.nostr.Nip10.getRootId(replyToEvent)
val rootId = com.darkwisp.app.nostr.Nip10.getRootId(replyToEvent)
if (rootId != null && rootId != replyToEvent.id) {
feedViewModel.eventRepo.addReplyCount(rootId, "pow-pending")
}
@@ -3166,7 +3166,7 @@ fun WispNavHost(
)
} else {
val event = signer.signEvent(kind = 1, content = content, tags = tags)
val msg = com.wisp.app.nostr.ClientMessage.event(event)
val msg = com.darkwisp.app.nostr.ClientMessage.event(event)
if (feedViewModel.outboxRouter != null) {
feedViewModel.outboxRouter!!.publishToInbox(msg, replyToEvent.pubkey)
} else {
@@ -3174,7 +3174,7 @@ fun WispNavHost(
}
feedViewModel.eventRepo.cacheEvent(event)
feedViewModel.eventRepo.addReplyCount(replyToEvent.id, event.id)
val rootId = com.wisp.app.nostr.Nip10.getRootId(replyToEvent)
val rootId = com.darkwisp.app.nostr.Nip10.getRootId(replyToEvent)
if (rootId != null && rootId != replyToEvent.id) {
feedViewModel.eventRepo.addReplyCount(rootId, event.id)
}
@@ -3265,13 +3265,13 @@ fun WispNavHost(
onAddEmojiSet = { pk, dTag -> feedViewModel.addSetToEmojiList(pk, dTag) },
onRemoveEmojiSet = { pk, dTag -> feedViewModel.removeSetFromEmojiList(pk, dTag) },
isEmojiSetAdded = { pk, dTag ->
val ref = com.wisp.app.nostr.Nip30.buildSetReference(pk, dTag)
val ref = com.darkwisp.app.nostr.Nip30.buildSetReference(pk, dTag)
feedViewModel.customEmojiRepo.userEmojiList.value?.setReferences?.contains(ref) ?: false
}
)
if (showNotifEmojiLibrary) {
com.wisp.app.ui.component.EmojiLibrarySheet(
com.darkwisp.app.ui.component.EmojiLibrarySheet(
currentEmojis = notifUnicodeEmojis,
customEmojiMap = notifResolvedEmojis,
onAddEmojis = { emojis ->
@@ -1,4 +1,4 @@
package com.wisp.app
package com.darkwisp.app
import android.app.Application
import coil3.ImageLoader
@@ -8,11 +8,11 @@ import coil3.memory.MemoryCache
import coil3.video.VideoFrameDecoder
import coil3.network.okhttp.OkHttpNetworkFetcherFactory
import coil3.request.crossfade
import com.wisp.app.db.WispObjectBox
import com.wisp.app.relay.HttpClientFactory
import com.wisp.app.repo.DiagnosticLogger
import com.wisp.app.repo.ExchangeRateRepository
import com.wisp.app.repo.ZapSender
import com.darkwisp.app.db.WispObjectBox
import com.darkwisp.app.relay.HttpClientFactory
import com.darkwisp.app.repo.DiagnosticLogger
import com.darkwisp.app.repo.ExchangeRateRepository
import com.darkwisp.app.repo.ZapSender
class WispApp : Application(), SingletonImageLoader.Factory {
@@ -1,4 +1,4 @@
package com.wisp.app.db
package com.darkwisp.app.db
import io.objectbox.annotation.Entity
import io.objectbox.annotation.Id
@@ -1,10 +1,10 @@
package com.wisp.app.db
package com.darkwisp.app.db
import android.util.Log
import com.wisp.app.nostr.DmMessage
import com.wisp.app.nostr.DmReaction
import com.wisp.app.nostr.DmZap
import com.wisp.app.nostr.EncryptedMedia
import com.darkwisp.app.nostr.DmMessage
import com.darkwisp.app.nostr.DmReaction
import com.darkwisp.app.nostr.DmZap
import com.darkwisp.app.nostr.EncryptedMedia
import io.objectbox.Box
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -1,4 +1,4 @@
package com.wisp.app.db
package com.darkwisp.app.db
import io.objectbox.annotation.Entity
import io.objectbox.annotation.Id
@@ -1,7 +1,7 @@
package com.wisp.app.db
package com.darkwisp.app.db
import android.util.Log
import com.wisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.NostrEvent
import io.objectbox.Box
import io.objectbox.query.QueryBuilder.StringOrder
import kotlinx.coroutines.CoroutineScope
@@ -1,4 +1,4 @@
package com.wisp.app.db
package com.darkwisp.app.db
import io.objectbox.annotation.Entity
import io.objectbox.annotation.Id
@@ -1,4 +1,4 @@
package com.wisp.app.db
package com.darkwisp.app.db
import io.objectbox.annotation.Entity
import io.objectbox.annotation.Id
@@ -1,9 +1,9 @@
package com.wisp.app.db
package com.darkwisp.app.db
import android.util.Log
import com.wisp.app.nostr.Nip29
import com.wisp.app.repo.GroupMessage
import com.wisp.app.repo.GroupRoom
import com.darkwisp.app.nostr.Nip29
import com.darkwisp.app.repo.GroupMessage
import com.darkwisp.app.repo.GroupRoom
import io.objectbox.Box
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -1,4 +1,4 @@
package com.wisp.app.db
package com.darkwisp.app.db
import android.content.Context
import io.objectbox.BoxStore
@@ -1,4 +1,4 @@
package com.wisp.app.ml
package com.darkwisp.app.ml
import java.io.BufferedReader
import java.io.InputStream
@@ -1,4 +1,4 @@
package com.wisp.app.ml
package com.darkwisp.app.ml
object MurmurHash3 {
private const val C1 = 0xcc9e2d51.toInt()
@@ -1,4 +1,4 @@
package com.wisp.app.ml
package com.darkwisp.app.ml
import kotlin.math.exp
@@ -1,4 +1,4 @@
package com.wisp.app.ml
package com.darkwisp.app.ml
import kotlin.math.sqrt
@@ -1,4 +1,4 @@
package com.wisp.app.ml
package com.darkwisp.app.ml
import java.text.Normalizer
@@ -1,4 +1,4 @@
package com.wisp.app.ml
package com.darkwisp.app.ml
import android.content.Context
import java.io.InputStream
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import android.util.Base64
import java.security.MessageDigest
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Bolt11 {
private val bech32Charset = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonPrimitive
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
data class DmReaction(
val authorPubkey: String,
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import java.security.MessageDigest
import java.security.SecureRandom
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import fr.acinq.secp256k1.Secp256k1
import java.security.SecureRandom
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Nip02 {
data class FollowEntry(
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import android.util.Base64
import javax.crypto.Cipher
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Nip09 {
fun buildDeletionTags(eventId: String, kind: Int): List<List<String>> {
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Nip10 {
/**
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
@@ -36,7 +36,7 @@ data class RelayInfo(
object Nip11 {
private val json = Json { ignoreUnknownKeys = true }
private val httpClient
get() = com.wisp.app.relay.HttpClientFactory.getGeneralClient()
get() = com.darkwisp.app.relay.HttpClientFactory.getGeneralClient()
suspend fun fetchRelayInfo(url: String, httpClient: OkHttpClient? = null): RelayInfo? {
val client = httpClient ?: this.httpClient
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.coroutines.ensureActive
import kotlin.coroutines.coroutineContext
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonPrimitive
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Nip18 {
fun buildRepostTags(event: NostrEvent, relayUrl: String = ""): List<List<String>> {
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
sealed class NostrUriData {
data class NoteRef(val eventId: String, val relays: List<String> = emptyList(), val author: String? = null) : NostrUriData()
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Nip25 {
fun buildReactionTags(targetEvent: NostrEvent): List<List<String>> {
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Nip29 {
const val KIND_CHAT_MESSAGE = 9
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
data class CustomEmoji(val shortcode: String, val url: String)
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonPrimitive
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import android.util.Base64
import org.bouncycastle.crypto.engines.ChaCha7539Engine
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonNull
@@ -1,6 +1,6 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import com.wisp.app.relay.RelayConfig
import com.darkwisp.app.relay.RelayConfig
import kotlinx.serialization.json.JsonPrimitive
import kotlinx.serialization.json.buildJsonArray
import kotlinx.serialization.json.jsonArray
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Nip53 {
const val KIND_LIVE_ACTIVITY = 30311
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
@@ -1,6 +1,6 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import com.wisp.app.relay.RelayConfig
import com.darkwisp.app.relay.RelayConfig
object Nip65 {
fun parseRelayList(event: NostrEvent): List<RelayConfig> {
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Nip68 {
const val KIND_PICTURE = 20
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
/**
* NIP-69 / Kind 6969: Zap Polls
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Nip71 {
const val KIND_VIDEO_HORIZONTAL = 21
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import java.security.MessageDigest
@@ -41,7 +41,7 @@ object Nip78 {
val tags = listOf(
listOf("d", dTag),
listOf("client", "wisp"),
listOf("client", "Dark Wisp"),
listOf("encryption", "nip44")
)
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
object Nip88 {
const val KIND_POLL = 1068
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import android.content.ContentResolver
import android.content.Context
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
enum class NotificationType { REACTION, ZAP, REPOST, REPLY, QUOTE, MENTION, VOTE, DM, DM_REACTION, DM_ZAP, PROFILE_ZAP }
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonArray
@@ -1,4 +1,4 @@
package com.wisp.app.nostr
package com.darkwisp.app.nostr
import android.content.Intent
import android.util.Log
@@ -1,4 +1,4 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import android.content.Context
import android.net.ConnectivityManager
@@ -1,4 +1,4 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
data class ConsoleLogEntry(
val timestamp: Long = System.currentTimeMillis(),
@@ -1,4 +1,4 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import android.content.Context
import androidx.media3.datasource.okhttp.OkHttpDataSource
@@ -1,14 +1,14 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import android.util.Log
import com.wisp.app.nostr.ClientMessage
import com.wisp.app.nostr.Filter
import com.wisp.app.repo.RelayListRepository
import com.darkwisp.app.nostr.ClientMessage
import com.darkwisp.app.nostr.Filter
import com.darkwisp.app.repo.RelayListRepository
class OutboxRouter(
private val relayPool: RelayPool,
private val relayListRepo: RelayListRepository,
private val relayHintStore: com.wisp.app.repo.RelayHintStore? = null,
private val relayHintStore: com.darkwisp.app.repo.RelayHintStore? = null,
private val relayScoreBoard: RelayScoreBoard? = null
) {
companion object {
@@ -392,7 +392,7 @@ class OutboxRouter(
*/
fun requestRelayListsAndProfiles(
pubkeys: List<String>,
profileRepo: com.wisp.app.repo.ProfileRepository,
profileRepo: com.darkwisp.app.repo.ProfileRepository,
subId: String = "relay-lists"
): String? {
val missingRelayLists = relayListRepo.getMissingPubkeys(pubkeys)
@@ -1,7 +1,7 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import android.util.Log
import com.wisp.app.nostr.RelayMessage
import com.darkwisp.app.nostr.RelayMessage
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
@@ -1,4 +1,4 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import kotlinx.serialization.Serializable
@@ -1,4 +1,4 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import android.content.Context
import android.content.SharedPreferences
@@ -1,4 +1,4 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import android.content.Context
import android.util.Log
@@ -1,13 +1,13 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import android.content.SharedPreferences
import android.util.Log
import android.util.LruCache
import com.wisp.app.nostr.ClientMessage
import com.wisp.app.repo.DiagnosticLogger
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.nostr.RelayMessage
import com.wisp.app.nostr.RelayMessage.Auth
import com.darkwisp.app.nostr.ClientMessage
import com.darkwisp.app.repo.DiagnosticLogger
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.RelayMessage
import com.darkwisp.app.nostr.RelayMessage.Auth
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
@@ -1,13 +1,13 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import android.util.Log
import com.wisp.app.nostr.ClientMessage
import com.wisp.app.nostr.Filter
import com.wisp.app.nostr.Keys
import com.wisp.app.nostr.Nip11
import com.wisp.app.nostr.Nip65
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.nostr.RelayMessage
import com.darkwisp.app.nostr.ClientMessage
import com.darkwisp.app.nostr.Filter
import com.darkwisp.app.nostr.Keys
import com.darkwisp.app.nostr.Nip11
import com.darkwisp.app.nostr.Nip65
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.RelayMessage
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
@@ -1,10 +1,10 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import android.content.Context
import android.content.SharedPreferences
import android.util.Log
import com.wisp.app.repo.ContactRepository
import com.wisp.app.repo.RelayListRepository
import com.darkwisp.app.repo.ContactRepository
import com.darkwisp.app.repo.RelayListRepository
data class ScoredRelay(val url: String, val coverCount: Int, val authors: Set<String>)
@@ -1,4 +1,4 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.first
@@ -1,4 +1,4 @@
package com.wisp.app.relay
package com.darkwisp.app.relay
import java.util.concurrent.ConcurrentHashMap
@@ -1,11 +1,11 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import com.wisp.app.nostr.Blossom
import com.wisp.app.nostr.EncryptedMedia
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.nostr.NostrSigner
import com.darkwisp.app.nostr.Blossom
import com.darkwisp.app.nostr.EncryptedMedia
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.NostrSigner
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
@@ -35,7 +35,7 @@ class BlossomRepository(private val context: Context, pubkeyHex: String? = null)
}
private val httpClient
get() = com.wisp.app.relay.HttpClientFactory.createHttpClient(
get() = com.darkwisp.app.relay.HttpClientFactory.createHttpClient(
connectTimeoutSeconds = 30,
readTimeoutSeconds = 60,
writeTimeoutSeconds = 60
@@ -1,9 +1,9 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import com.wisp.app.nostr.Nip51
import com.wisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.Nip51
import com.darkwisp.app.nostr.NostrEvent
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
@@ -1,10 +1,10 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import com.wisp.app.nostr.BookmarkSet
import com.wisp.app.nostr.Nip51
import com.wisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.BookmarkSet
import com.darkwisp.app.nostr.Nip51
import com.darkwisp.app.nostr.NostrEvent
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.serialization.Serializable
@@ -1,9 +1,9 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import com.wisp.app.nostr.Nip02
import com.wisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.Nip02
import com.darkwisp.app.nostr.NostrEvent
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.serialization.Serializable
@@ -1,13 +1,13 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import android.util.LruCache
import com.wisp.app.nostr.CustomEmoji
import com.wisp.app.nostr.EmojiSet
import com.wisp.app.nostr.Nip30
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.nostr.UserEmojiList
import com.darkwisp.app.nostr.CustomEmoji
import com.darkwisp.app.nostr.EmojiSet
import com.darkwisp.app.nostr.Nip30
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.UserEmojiList
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import org.json.JSONArray
@@ -1,8 +1,8 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import com.wisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.NostrEvent
class DeletedEventsRepository(private val context: Context, pubkeyHex: String? = null) {
private var prefs: SharedPreferences =
@@ -1,4 +1,4 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.util.Log
@@ -1,17 +1,17 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import android.util.LruCache
import com.wisp.app.db.DmPersistence
import com.wisp.app.nostr.DmConversation
import com.wisp.app.nostr.DmMessage
import com.wisp.app.nostr.DmReaction
import com.wisp.app.nostr.DmZap
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.nostr.wipe
import com.wisp.app.nostr.FlatNotificationItem
import com.wisp.app.nostr.NotificationType
import com.darkwisp.app.db.DmPersistence
import com.darkwisp.app.nostr.DmConversation
import com.darkwisp.app.nostr.DmMessage
import com.darkwisp.app.nostr.DmReaction
import com.darkwisp.app.nostr.DmZap
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.wipe
import com.darkwisp.app.nostr.FlatNotificationItem
import com.darkwisp.app.nostr.NotificationType
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
@@ -1,17 +1,17 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.util.Log
import android.util.LruCache
import com.wisp.app.nostr.Nip09
import com.wisp.app.nostr.Nip10
import com.wisp.app.nostr.Nip30
import com.wisp.app.nostr.Bolt11
import com.wisp.app.nostr.Nip57
import com.wisp.app.nostr.Nip69
import com.wisp.app.nostr.Nip88
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.nostr.NostrEvent.Companion.fromJson
import com.wisp.app.nostr.ProfileData
import com.darkwisp.app.nostr.Nip09
import com.darkwisp.app.nostr.Nip10
import com.darkwisp.app.nostr.Nip30
import com.darkwisp.app.nostr.Bolt11
import com.darkwisp.app.nostr.Nip57
import com.darkwisp.app.nostr.Nip69
import com.darkwisp.app.nostr.Nip88
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.NostrEvent.Companion.fromJson
import com.darkwisp.app.nostr.ProfileData
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
@@ -22,7 +22,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import com.wisp.app.db.EventPersistence
import com.darkwisp.app.db.EventPersistence
import java.util.concurrent.ConcurrentHashMap
data class ZapDetail(
@@ -1,8 +1,8 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.util.Log
import com.wisp.app.relay.HttpClientFactory
import com.darkwisp.app.relay.HttpClientFactory
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
@@ -1,16 +1,16 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import android.util.Log
import com.wisp.app.nostr.ClientMessage
import com.wisp.app.nostr.Filter
import com.wisp.app.nostr.Nip02
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.relay.RelayConfig
import com.wisp.app.relay.RelayPool
import com.wisp.app.relay.RelayScoreBoard
import com.wisp.app.relay.SubscriptionManager
import com.darkwisp.app.nostr.ClientMessage
import com.darkwisp.app.nostr.Filter
import com.darkwisp.app.nostr.Nip02
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.relay.RelayConfig
import com.darkwisp.app.relay.RelayPool
import com.darkwisp.app.relay.RelayScoreBoard
import com.darkwisp.app.relay.SubscriptionManager
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.coroutineScope
@@ -177,7 +177,7 @@ class ExtendedNetworkRepository(
val coverageTarget = (firstDegree.size * 0.7).toInt()
coroutineScope {
val collectorJob = launch {
relayPool.relayEvents.collect { relayEvent: com.wisp.app.relay.RelayEvent ->
relayPool.relayEvents.collect { relayEvent: com.darkwisp.app.relay.RelayEvent ->
if (relayEvent.subscriptionId == subId && relayEvent.event.kind == 3) {
pendingFollowLists[relayEvent.event.pubkey] = relayEvent.event
_discoveryState.value = DiscoveryState.FetchingFollowLists(
@@ -305,7 +305,7 @@ class ExtendedNetworkRepository(
// Dedicated collector for relay list events — same bypass as follow lists
val rlCollected = java.util.concurrent.atomic.AtomicInteger(0)
val collectorJob = launch {
relayPool.relayEvents.collect { relayEvent: com.wisp.app.relay.RelayEvent ->
relayPool.relayEvents.collect { relayEvent: com.darkwisp.app.relay.RelayEvent ->
if (relayEvent.subscriptionId.startsWith("extnet-rl-") && relayEvent.event.kind == 10002) {
relayListRepo.updateFromEvent(relayEvent.event)
val count = rlCollected.incrementAndGet()
@@ -1,4 +1,4 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import kotlinx.coroutines.flow.MutableStateFlow
@@ -1,9 +1,9 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import com.wisp.app.db.GroupPersistence
import com.wisp.app.db.WispObjectBox
import com.wisp.app.nostr.Nip29
import com.darkwisp.app.db.GroupPersistence
import com.darkwisp.app.db.WispObjectBox
import com.darkwisp.app.nostr.Nip29
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import java.util.concurrent.ConcurrentHashMap
@@ -1,10 +1,10 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import com.wisp.app.nostr.InterestSet
import com.wisp.app.nostr.Nip51
import com.wisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.InterestSet
import com.darkwisp.app.nostr.Nip51
import com.darkwisp.app.nostr.NostrEvent
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.serialization.Serializable
@@ -1,4 +1,4 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
@@ -1,15 +1,15 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKey
import com.wisp.app.nostr.Keys
import com.wisp.app.nostr.Nip19
import com.wisp.app.nostr.hexToByteArray
import com.wisp.app.nostr.toHex
import com.wisp.app.relay.LocalRelayConfig
import com.wisp.app.relay.RelayConfig
import com.darkwisp.app.nostr.Keys
import com.darkwisp.app.nostr.Nip19
import com.darkwisp.app.nostr.hexToByteArray
import com.darkwisp.app.nostr.toHex
import com.darkwisp.app.relay.LocalRelayConfig
import com.darkwisp.app.relay.RelayConfig
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.serialization.Serializable
@@ -1,10 +1,10 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import com.wisp.app.nostr.FollowSet
import com.wisp.app.nostr.Nip51
import com.wisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.FollowSet
import com.darkwisp.app.nostr.Nip51
import com.darkwisp.app.nostr.NostrEvent
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.serialization.Serializable
@@ -1,8 +1,8 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import com.wisp.app.nostr.Nip53
import com.wisp.app.nostr.Nip57
import com.wisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.Nip53
import com.darkwisp.app.nostr.Nip57
import com.darkwisp.app.nostr.NostrEvent
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import java.util.concurrent.ConcurrentHashMap
@@ -107,7 +107,7 @@ class LiveStreamRepository {
val replyToId = event.tags.firstOrNull {
it.size >= 2 && it[0] == "e" && (it.size < 4 || it[3] == "reply")
}?.get(1)
val emojiTags = com.wisp.app.nostr.Nip30.parseEmojiTags(event.tags)
val emojiTags = com.darkwisp.app.nostr.Nip30.parseEmojiTags(event.tags)
val msg = LiveChatMessage(
id = event.id,
senderPubkey = event.pubkey,
@@ -1,4 +1,4 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.app.Application
import android.os.Build
@@ -1,8 +1,8 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import com.wisp.app.db.EventPersistence
import com.wisp.app.nostr.ProfileData
import com.wisp.app.relay.RelayPool
import com.darkwisp.app.db.EventPersistence
import com.darkwisp.app.nostr.ProfileData
import com.darkwisp.app.relay.RelayPool
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
@@ -1,12 +1,12 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import com.wisp.app.nostr.ClientMessage
import com.wisp.app.nostr.Filter
import com.wisp.app.nostr.Nip19
import com.wisp.app.nostr.NostrUriData
import com.wisp.app.relay.OutboxRouter
import com.wisp.app.relay.RelayPool
import com.wisp.app.relay.SubscriptionManager
import com.darkwisp.app.nostr.ClientMessage
import com.darkwisp.app.nostr.Filter
import com.darkwisp.app.nostr.Nip19
import com.darkwisp.app.nostr.NostrUriData
import com.darkwisp.app.relay.OutboxRouter
import com.darkwisp.app.relay.RelayPool
import com.darkwisp.app.relay.SubscriptionManager
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
@@ -234,14 +234,14 @@ class MetadataFetcher(
if (!fetchedPollVotes.add(pollEventId)) return
}
val subId = "qpoll-${pollVoteBatchCounter++}"
val filter = Filter(kinds = listOf(com.wisp.app.nostr.Nip88.KIND_POLL_RESPONSE), eTags = listOf(pollEventId))
val filter = Filter(kinds = listOf(com.darkwisp.app.nostr.Nip88.KIND_POLL_RESPONSE), eTags = listOf(pollEventId))
val msg = ClientMessage.req(subId, filter)
relayPool.sendToAllRelays(msg)
// Also try poll-specified relays
val pollEvent = eventRepo.getEvent(pollEventId)
if (pollEvent != null) {
val sentUrls = relayPool.getReadRelayUrls().toSet() + relayPool.getWriteRelayUrls().toSet()
for (url in com.wisp.app.nostr.Nip88.parsePollRelays(pollEvent)) {
for (url in com.darkwisp.app.nostr.Nip88.parsePollRelays(pollEvent)) {
if (url !in sentUrls) relayPool.sendToRelayOrEphemeral(url, msg)
}
}
@@ -267,7 +267,7 @@ class MetadataFetcher(
val pollEvent = eventRepo.getEvent(pollEventId)
if (pollEvent != null) {
val sentUrls = relayPool.getReadRelayUrls().toSet() + relayPool.getWriteRelayUrls().toSet()
for (url in com.wisp.app.nostr.Nip69.parseZapPollRelays(pollEvent)) {
for (url in com.darkwisp.app.nostr.Nip69.parseZapPollRelays(pollEvent)) {
if (url !in sentUrls) relayPool.sendToRelayOrEphemeral(url, msg)
}
}
@@ -306,7 +306,7 @@ class MetadataFetcher(
}
}
fun fetchQuotedEvents(event: com.wisp.app.nostr.NostrEvent) {
fun fetchQuotedEvents(event: com.darkwisp.app.nostr.NostrEvent) {
event.tags.filter { it.size >= 2 && it[0] == "q" }
.forEach { tag ->
val id = tag[1].lowercase()
@@ -1,11 +1,11 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import com.wisp.app.nostr.MuteList
import com.wisp.app.nostr.Nip51
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.nostr.NostrSigner
import com.darkwisp.app.nostr.MuteList
import com.darkwisp.app.nostr.Nip51
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.NostrSigner
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
@@ -1,7 +1,7 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import com.wisp.app.nostr.Nip05
import com.wisp.app.nostr.Nip05Result
import com.darkwisp.app.nostr.Nip05
import com.darkwisp.app.nostr.Nip05Result
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
@@ -30,7 +30,7 @@ class Nip05Repository {
val version: StateFlow<Int> = _version
private val httpClient
get() = com.wisp.app.relay.HttpClientFactory.getNip05Client()
get() = com.darkwisp.app.relay.HttpClientFactory.getNip05Client()
fun clear() {
statusCache.clear()
@@ -1,19 +1,19 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import android.util.LruCache
import com.wisp.app.nostr.Nip10
import com.wisp.app.nostr.Nip30
import com.wisp.app.nostr.Nip57
import com.wisp.app.nostr.Nip69
import com.wisp.app.nostr.Nip88
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.nostr.FlatNotificationItem
import com.wisp.app.nostr.NotificationGroup
import com.wisp.app.nostr.NotificationSummary
import com.wisp.app.nostr.NotificationType
import com.wisp.app.nostr.ZapEntry
import com.darkwisp.app.nostr.Nip10
import com.darkwisp.app.nostr.Nip30
import com.darkwisp.app.nostr.Nip57
import com.darkwisp.app.nostr.Nip69
import com.darkwisp.app.nostr.Nip88
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.FlatNotificationItem
import com.darkwisp.app.nostr.NotificationGroup
import com.darkwisp.app.nostr.NotificationSummary
import com.darkwisp.app.nostr.NotificationType
import com.darkwisp.app.nostr.ZapEntry
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
@@ -32,11 +32,11 @@ class NotificationRepository(
private val muteRepo: MuteRepository? = null,
private val eventRepo: EventRepository? = null
) {
var spamClassifier: com.wisp.app.ml.NSpamClassifier? = null
var spamClassifier: com.darkwisp.app.ml.NSpamClassifier? = null
var spamAuthorCache: SpamAuthorCache? = null
var safetyPrefs: SafetyPreferences? = null
var contactRepo: ContactRepository? = null
var extendedNetworkRepo: com.wisp.app.repo.ExtendedNetworkRepository? = null
var extendedNetworkRepo: com.darkwisp.app.repo.ExtendedNetworkRepository? = null
@Volatile private var currentPubkeyHex: String? = pubkeyHex
@@ -706,7 +706,7 @@ class NotificationRepository(
val notes = repo.getCachedEventsByAuthor(event.pubkey, 1, 10)
if (notes.isNotEmpty()) {
val inputs = notes.map { e ->
com.wisp.app.ml.NoteInput(e.content, e.tags, e.created_at)
com.darkwisp.app.ml.NoteInput(e.content, e.tags, e.created_at)
}
val score = classifier.score(inputs)
if (score != null) {
@@ -1,17 +1,17 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.util.Log
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKey
import com.wisp.app.nostr.ClientMessage
import com.wisp.app.nostr.Filter
import com.wisp.app.nostr.Nip47
import com.wisp.app.nostr.RelayMessage
import com.wisp.app.nostr.toHex
import com.wisp.app.relay.Relay
import com.wisp.app.relay.RelayConfig
import com.wisp.app.relay.RelayPool
import com.darkwisp.app.nostr.ClientMessage
import com.darkwisp.app.nostr.Filter
import com.darkwisp.app.nostr.Nip47
import com.darkwisp.app.nostr.RelayMessage
import com.darkwisp.app.nostr.toHex
import com.darkwisp.app.relay.Relay
import com.darkwisp.app.relay.RelayConfig
import com.darkwisp.app.relay.RelayPool
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -202,7 +202,7 @@ class NwcRepository(private val context: Context, private val relayPool: RelayPo
emitStatus("Encryption: ${if (enc == Nip47.NwcEncryption.NIP44) "NIP-44" else "NIP-04"}")
}
private fun handleResponse(event: com.wisp.app.nostr.NostrEvent) {
private fun handleResponse(event: com.darkwisp.app.nostr.NostrEvent) {
val conn = connection ?: return
try {
val response = Nip47.parseResponse(conn, event)
@@ -1,9 +1,9 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import com.wisp.app.nostr.Nip51
import com.wisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.Nip51
import com.darkwisp.app.nostr.NostrEvent
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
@@ -1,4 +1,4 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
@@ -1,11 +1,11 @@
package com.wisp.app.repo
package com.darkwisp.app.repo
import android.content.Context
import android.content.SharedPreferences
import android.util.LruCache
import android.util.Log
import com.wisp.app.nostr.NostrEvent
import com.wisp.app.nostr.ProfileData
import com.darkwisp.app.nostr.NostrEvent
import com.darkwisp.app.nostr.ProfileData
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import java.io.File

Some files were not shown because too many files have changed in this diff Show More