Suggestions

close search

StringeeConversation class

Represents a conversation.


Properties


idString?

It's the unique identification of the conversation on Stringee system.

localIdString?

It's the unique identification of the conversation on local database.

nameString?

It's name of the conversation.

isGroupbool

Whether the conversation is a group chat:

creatorString?

It's the unique identification of the participant create the conversation.

totalUnreadint?

It's number of unread messages in the conversation.

updatedAtint?

It's last time when update the conversation.

createdAtint?

It's time when create the conversation.

lastMsgStringeeMessage?

It's last message of the conversation.

pinnedMsgIdString?

It's pined message's id.

participantsList<StringeeUser>?

It's list of participants.

customDataString?

It's custom data of the conversation.

lastTimeNewMsgint?

It is the time of the last new message which you received in the conversation.

lastMsgSeqReceivedint?

It is the sequence of the last new message which you received in the conversation.

channelTypeChannelType?

It's channel type of the conversation.

endedbool?

Whether the conversation is ended:

lastSequenceint?

It's the sequence of the last message in the conversation.


Methods


sendMessage(StringeeMessage message)Map<dynamic, dynamic>

Send a message.

getMessages(List msgIds)Map<dynamic, dynamic>

Get list of messages of conversation by message's id. If successful return a list of StringeeMessage in callBack['body'].

getLocalMessages(int count)Map<dynamic, dynamic>

Get list of local messages of conversation by message's id. If successful return a list of StringeeMessage in callBack['body'].

getLastMessages(int count, {bool? loadDeletedMsg, bool? loadDeletedMsgContent, bool? loadAll})Map<dynamic, dynamic>

Get list of last messages of conversation by message's id. If successful return a list of StringeeMessage in callBack['body'].

getMessagesAfter(int count, int sequence, {bool? loadDeletedMsg, bool? loadDeletedMsgContent, bool? loadAll})Map<dynamic, dynamic>

Get list of messages which have sequence smaller than seq. If successful return a list of StringeeMessage in callBack['body'].

getMessagesBefore(int count, int sequence, {bool? loadDeletedMsg, bool? loadDeletedMsgContent, bool? loadAll})Map<dynamic, dynamic>

Get list of messages which have sequence greater than seq. If successful return a list of StringeeMessage in callBack['body'].

getAttachmentMessages(int count, int start, MsgType msgType)Map<dynamic, dynamic>

Get list of attachment messages by attachment type. If successful return a list of StringeeMessage in callBack['body'].

updateConversation(String name, {String? avatar})Map<dynamic, dynamic>

Update conversation name, avatar.

setRole(String userId, UserRole role)Map<dynamic, dynamic>

Set role for participant in the conversation.

deleteMessages(List msgIds)Map<dynamic, dynamic>

Delete messages by message's id.

revokeMessages(List msgIds, bool isDeleted)Map<dynamic, dynamic>

Revoke messages by message's id.

markAsRead()Map<dynamic, dynamic>

Mark the conversation's messages as read.

rateChat(Rating rating, {String? comment})Map<dynamic, dynamic>

Rate the the support conversation.

transferTo(String userId, String customerId, String customerName)Map<dynamic, dynamic>

Transfer the support conversation to userId.

continueChatting()Map<dynamic, dynamic>

Continue the support conversation.

sendChatTranscript(String email, String domain)Map<dynamic, dynamic>

Send chat transcript.

endChat()Map<dynamic, dynamic>

End the support conversation.

beginTyping()Map<dynamic, dynamic>

Send begin typing.

endTyping()Map<dynamic, dynamic>

Send end typing.

delete()Map<dynamic, dynamic>

Delete the conversation.

addParticipants(List<StringeeUser> participants)Map<dynamic, dynamic>

Add participants to conversation. If successful return a list of added StringeeUser in callBack['body'].

removeParticipants(List<StringeeUser> participants)Map<dynamic, dynamic>

Remove participants from conversation. If successful return a list of removed StringeeUser in callBack['body'].