Skip to content

Commit

Permalink
fix: Subscribe with the right reply settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dluvian committed Jun 1, 2024
1 parent be51989 commit 84b1fc4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion app/src/main/java/com/dluvian/voyage/AppContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class AppContainer(context: Context) {

val nostrSubscriber = NostrSubscriber(
topicProvider = topicProvider,
friendProvider = friendProvider,
pubkeyProvider = accountManager,
subCreator = subCreator,
relayProvider = relayProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import com.dluvian.voyage.data.model.InboxFeedSetting
import com.dluvian.voyage.data.model.ProfileRootFeedSetting
import com.dluvian.voyage.data.model.ReplyFeedSetting
import com.dluvian.voyage.data.model.TopicFeedSetting
import com.dluvian.voyage.data.provider.FriendProvider
import com.dluvian.voyage.data.provider.RelayProvider
import com.dluvian.voyage.data.provider.TopicProvider
import com.dluvian.voyage.data.provider.WebOfTrustProvider
Expand All @@ -30,7 +29,6 @@ import java.util.concurrent.atomic.AtomicBoolean

class NostrSubscriber(
topicProvider: TopicProvider,
friendProvider: FriendProvider,
pubkeyProvider: IPubkeyProvider,
val subCreator: SubscriptionCreator,
private val relayProvider: RelayProvider,
Expand All @@ -54,28 +52,29 @@ class NostrSubscriber(
is HomeFeedSetting -> feedSubscriber.getHomeFeedSubscriptions(
until = until.toULong(),
since = since,
limit = (3 * limit).toULong() // We don't know if we receive enough root posts
limit = (4 * limit).toULong() // We don't know if we receive enough root posts
)

is ReplyFeedSetting -> feedSubscriber.getHomeFeedSubscriptions(
is TopicFeedSetting -> feedSubscriber.getTopicFeedSubscription(
topic = setting.topic,
until = until.toULong(),
since = since,
// Smaller than adjustedLimit, bc posts with topics tend to be root
limit = (2 * limit).toULong()
)

is TopicFeedSetting -> feedSubscriber.getTopicFeedSubscription(
topic = setting.topic,
is ReplyFeedSetting -> feedSubscriber.getProfileFeedSubscription(
pubkey = setting.pubkey,
until = until.toULong(),
since = since,
// Smaller than adjustedLimit, bc posts with topics tend to be root
limit = (2 * limit).toULong()
limit = (3 * limit).toULong()
)

is ProfileRootFeedSetting -> feedSubscriber.getProfileFeedSubscription(
pubkey = setting.pubkey,
until = until.toULong(),
since = since,
limit = (3 * limit).toULong()
limit = (4 * limit).toULong()
)

InboxFeedSetting -> feedSubscriber.getInboxFeedSubscription(
Expand Down

0 comments on commit 84b1fc4

Please sign in to comment.