Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ConversationFilter

Allows you to filter conversations down to a specific subset.

Use with Inbox.setFeedFilter or pass InboxOptions.feedFilter to Session.createInbox.

Hierarchy

Index

Properties

Optional access

Only select conversations that the current user as specific access to.

Must be an 2-element array of [operator, operand] structure. Valid operators are:

  • "=="
  • "!="
  • "oneOf"
  • "!oneOf".

The operand must be either a string (one of "ReadWrite", "Read" or "None") or an array of strings (for the oneOf operators).

Example:

// to remove conversations that the user has no access to anymore, do:
{ access: ["!=", "None"] }

Optional custom

custom: undefined | object

Only select conversations that have particular custom fields set to particular values.

Every key must correspond to a key in the custom conversation data that you set (by passing custom to ConversationBuilder.setAttributes). It is not necessary for all conversations to have these keys.

Each value must be one of the following:

  • A string, equal to "exists" or "!exists"
  • A 2-element array of [operator, operand] structure. The operand must be either a string or an array of strings (for the oneOf operators). Valid operators are:
    • "=="
    • "!="
    • "oneOf"
    • "!oneOf".

Examples, assuming you have set a category custom field on your conversations:

// only show conversations that have no category set:
{ custom: { category: "!exists" } }

// only show conversations of category "shoes"
{ custom: { category: ["==", "shoes"] } }

// only show conversations either category "shoes" or "sandals"
{ custom: { category: ["oneOf", ["shoes", "sandals"] ] } }

// only show conversations about shoes that are marked visible.
// this assumes you also have a custom field called `visibility`
{ custom: { category: ["==", "shoes"], visibility: ["==", "visible" ] } }

Optional hasUnreadMessages

hasUnreadMessages: undefined | true | false

Set this field to only select conversations that have, or don't have any, unread messages.

Generated using TypeDoc