conversations.find()
Retrieves a full Conversation object with all of its relationships.
To save network requests, in some cases not all the information about a conversation is fetched. For example, in a group conversation, not all the members of the group are pre-loaded, and when viewing such a conversation, some users may have name as Loading...
. In order to ensure all extra information of a group is loaded, such as the counter party and all the group members, client.conversations.find
needs to be called.
Definition
client.conversations.find(conversationId: string,options: ?Object):Promise<itemsAdded,Error>
Parameters
Name | Type | Description |
---|---|---|
conversationId | string |Conversation | A conversation ID |
Returns
The function returns a Promise
that resolves with a fully-loaded Conversation model.
Examples
const conversation = await client.conversations.find(someGroupConversation.id);const group = conversation.counterParty;console.log('group conversation ', group.name);group.members.forEach(function (member) {console.log('member', member.displayName);});