Querying Messages
To query for a list of all messages in a channel:
This method will return a LiveCollection of all messages in the specified channel. You can observe the LiveCollection in order to update your view whenever you receive new messages.
Since v1.3.0, messages can be organized in threads thanks to the parentId
property.
Querying messages
A popular request was to have a isDeleted boolean filter to avoid querying deleted messages to display in a chatroom. It is now available and can be used as:
The overall rule for the isDeleted
parameter is as following:
isDeleted = undefined
: both deleted and not deleted messages will be returnedisDeleted = true
: only deleted messages will be returnedisDeleted = false
: only non deleted messages will be returned
Get single message
You can use the getMessage
method to get a single comment. You need to pass the messageId
of the requested message as the parameter.
The method returns a liveobject
instance of a message model. It will throw an error if the passed messageId
is not valid.
Threaded Messages
A message can be the root for a thread. To query the children of a message thread, you can add the parentId
parameter in a message query, along with the filterByParentId
flag.
Last updated