Skip to content

Commit

Permalink
additional comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen committed Aug 16, 2024
1 parent bc3736c commit c43a8fe
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/utils/records.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,13 @@ export class Records {
return filter.published === false;
}

/**
* Checks whether or not the incoming records query filter should build an unpublished recipient MessageStore filter.
*
* @param filter The incoming RecordsFilter to evaluate against.
* @param recipient The recipient to check against the filter, typically the query/subscribe message author.
* @returns {boolean} True if the filter contains the recipient, or if the recipient filter is undefined/empty.
*/
static shouldBuildUnpublishedRecipientFilter(filter: RecordsFilter, recipient: string): boolean {
const { recipient: recipientFilter } = filter;

Expand All @@ -528,6 +535,13 @@ export class Records {
recipientFilter === undefined || recipientFilter === recipient;
}

/**
* Checks whether or not the incoming records query filter should build an unpublished author MessageStore filter.
*
* @param filter The incoming RecordsFilter to evaluate against.
* @param author The author to check against the filter, typically the query/subscribe message author.
* @returns {boolean} True if the filter contains the author, or if the author filter is undefined/empty.
*/
static shouldBuildUnpublishedAuthorFilter(filter: RecordsFilter, author: string): boolean {
const { author: authorFilter } = filter;

Expand Down

0 comments on commit c43a8fe

Please sign in to comment.