Browse Source

changed function name to be more self-explanatory

master
silberengel 7 months ago
parent
commit
8fc3c59fd0
  1. 8
      src/lib/utils/subscription_search.ts

8
src/lib/utils/subscription_search.ts

@ -54,7 +54,7 @@ const PRIORITIZED_EVENT_KINDS = new Set([
* 3. Events from community members * 3. Events from community members
* 4. All other events * 4. All other events
*/ */
async function prioritizeSubscriptionEvents( async function prioritizeSearchEvents(
events: NDKEvent[], events: NDKEvent[],
targetPubkey?: string, targetPubkey?: string,
maxResults: number = SEARCH_LIMITS.GENERAL_CONTENT, maxResults: number = SEARCH_LIMITS.GENERAL_CONTENT,
@ -1238,7 +1238,7 @@ async function processContentEoseResults(
// AI-NOTE: 2025-01-24 - Apply prioritization to first-order events for d-tag searches // AI-NOTE: 2025-01-24 - Apply prioritization to first-order events for d-tag searches
// For d-tag searches, we don't have a specific target pubkey, so we only prioritize by event kind // For d-tag searches, we don't have a specific target pubkey, so we only prioritize by event kind
const prioritizedEvents = await prioritizeSubscriptionEvents( const prioritizedEvents = await prioritizeSearchEvents(
dedupedEvents, dedupedEvents,
undefined, // No specific target pubkey for d-tag searches undefined, // No specific target pubkey for d-tag searches
SEARCH_LIMITS.GENERAL_CONTENT, SEARCH_LIMITS.GENERAL_CONTENT,
@ -1283,7 +1283,7 @@ async function processTTagEoseResults(searchState: any, ndk?: NDK): Promise<Sear
// AI-NOTE: 2025-01-24 - Apply prioritization to t-tag search results // AI-NOTE: 2025-01-24 - Apply prioritization to t-tag search results
// For t-tag searches, we don't have a specific target pubkey, so we only prioritize by event kind // For t-tag searches, we don't have a specific target pubkey, so we only prioritize by event kind
const prioritizedEvents = await prioritizeSubscriptionEvents( const prioritizedEvents = await prioritizeSearchEvents(
searchState.tTagEvents, searchState.tTagEvents,
undefined, // No specific target pubkey for t-tag searches undefined, // No specific target pubkey for t-tag searches
SEARCH_LIMITS.GENERAL_CONTENT, SEARCH_LIMITS.GENERAL_CONTENT,
@ -1480,7 +1480,7 @@ async function performSecondOrderSearchInBackground(
// AI-NOTE: 2025-01-24 - Apply prioritization to second-order search results with timeout // AI-NOTE: 2025-01-24 - Apply prioritization to second-order search results with timeout
// Prioritize events from the target pubkey and specific event kinds // Prioritize events from the target pubkey and specific event kinds
const prioritizationPromise = prioritizeSubscriptionEvents( const prioritizationPromise = prioritizeSearchEvents(
deduplicatedSecondOrder, deduplicatedSecondOrder,
targetPubkey, targetPubkey,
SEARCH_LIMITS.SECOND_ORDER_RESULTS, SEARCH_LIMITS.SECOND_ORDER_RESULTS,

Loading…
Cancel
Save