Suggestions

close search

StringeeConversation class

Represents a conversation.


Summary


Properties

id → String

name → String

isGroup → bool

creator → String

totalUnread → int

updatedAt → int

createdAt → int

text → Map<dynamic, dynamic>

lastMsg → StringeeMessage

pinnedMsgId → String

participants → List<StringeeUser>

Methods

delete() → result

Delete a conversation.

addParticipants(List<StringeeUser> participants) → result

Add participants to conversation.

removeParticipants(List<StringeeUser> participants) → result

Remove participants from conversation.

sendMessage(StringeeMessage message) → result

Send a message.

getMessages(List<String> msgIds) → result

Get list of messages of conversation by message's id.

getLocalMessages(int count) → result

Get list of local messages.

getLastMessages(int count) → result

Get list of lastest messages.

getMessagesAfter(int count, int seq) → result

Get list of messages which have sequence smaller than seq.

getMessagesBefore(int count, int seq) → result

Get list of messages which have sequence greater than seq.

updateConversation(String name) → result

Update conversation name.

setRole(String userId, UserRole role) → result

Set role for participant in conversation.

deleteMessages(List<String> msgIds) → result

Delete messages by message's id.

revokeMessages(List<String> msgIds, bool isDeleted) → result

Revoke messages by message's id.

markAsRead() → result

Mark a conversation's messages as read.

Properties


id → String
It's the unique identification of the conversation on Stringee system.
name → String
It's name of the conversation.
isGroup → bool
Whether the conversation is a group chat:
- true - is a group chat.
- false - is a chat 1-1.
creator → String
It's the unique identification of the participant create conversation.
totalUnread → int
It's number of unread messages in conversation.
updatedAt → int
It's last time when update conversation.
createdAt → int
It's time when create conversation.
text → Map<dynamic, dynamic>
It's last message's text.
lastMsg → StringeeMessage
It's last message of conversation.
pinnedMsgId → String
It's pined message's id.
participants → List<StringeeUser>
It's list of participants.

Methods


delete() → result
Delete a conversation.
addParticipants(List<StringeeUser> participants) → result
Add participants to conversation.
If success return List of added participants in result['body].
removeParticipants(List<StringeeUser> participants) → result
Remove participants from conversation.
If success return List of removed participants in result['body].
sendMessage(StringeeMessage message) → result
Send a message.
getMessages(List<String> msgIds) → result
Get list of messages of conversation by message's id.
If success return List of messages in result['body].
getLocalMessages(int count) → result
Get list of local messages of conversation by message's id.
If success return List of messages in result['body].
getLastMessages(int count) → result
Get list of last messages of conversation by message's id.
If success return List of messages in result['body].
getMessagesAfter(int count, int seq) → result
Get list of messages which have sequence smaller than seq.
If success return List of messages in result['body].
getMessagesBefore(int count, int seq) → result
Get list of messages which have sequence greater than seq.
If success return List of messages in result['body].
updateConversation(String name) → result
Update conversation name.
setRole(String userId, UserRole role) → result
Set role for participant in conversation.
deleteMessages(List<String> msgIds) → result
Delete messages by message's id..
revokeMessages(List<String> msgIds, bool isDeleted) → result
Revoke messages by message's id..
markAsRead() → result
Mark a conversation's messages as read.