Suggestions

close search

Conversation

public class Conversation
extends StringeeObject



Represents a Conversation.



Summary


Public Constructors
Conversation()

Construct a new Conversation

Public methods
String getId()

Return conversation id.

String getName()

Return conversation name.

List<User> getParticipants()

Return list participants of conversation.

boolean isDistinct()

Check whether the conversation is a distinct conversation.

boolean isGroup()

Check whether the conversation is a group conversation.

long getCreateAt()

Return conversation create time in milliseconds.

long getUpdateAt()

Return conversation update time in milliseconds.

String getLastMsgSender()

Return last msg sender id

String getText()

Return last msg text

long getLastTimeNewMsg()

Return last msg update time in milliseconds.

int getLastMsgType()

Return last msg type.

long getLastMsgSeqReceived()

Return last msg sequence received.

int getLastMsgState()

Return last msg state.

String getLastMsgId()

Return last msg id.

String getLastMsg()

Return last msg in String.

int getTotalUnread()

Return number of unread msg.

String getCreator()

Return creator id.

int getState()

Return conversation state.

int getChannelType()

Return conversation channel type.

boolean isEnded()

Check whether the conversation is ended.

String getPinnedMsgId()

Return pinned msg id.

Message getLastMessage()

Return the last received message.

void delete(StatusListener listener)

Delete conversation.

void sendMessage(StringeeClient client, Message message, StatusListener listener)

Send message.

void getLocalMessages(StringeeClient client, int count, CallbackListener<List<Message>> listener)

Get messages saved in local database.

void getLastMessages(StringeeClient client, int count, CallbackListener<List<Message>> listener)

Get lastest messages from Stringee server.

void getLastMessages(StringeeClient client, int count, boolean loadDeletedMsg, boolean loadDeletedMsgContent, boolean loadAll, CallbackListener<List<Message>> listener)

Get lastest messages from Stringee server.

void getMessagesAfter(StringeeClient client, long seq, int count, CallbackListener<List<Message>> listener)

Get messages after seq from Stringee server.

void getMessagesAfter(StringeeClient client, long seq, int count, boolean loadDeletedMsg, boolean loadDeletedMsgContent, boolean loadAll, CallbackListener<List<Message>> listener)

Get messages after seq from Stringee server.

void getMessagesBefore(StringeeClient client, long seq, int count, CallbackListener<List<Message>> listener)

Get messages before seq from Stringee server.

void getMessagesBefore(StringeeClient client, long seq, int count, boolean loadDeletedMsg, boolean loadDeletedMsgContent, boolean loadAll, CallbackListener<List<Message>> listener)

Get messages before seq from Stringee server.

void addParticipants(StringeeClient client, List<User> participants, CallbackListener<List<User>> listener)

Add participants to conversation.

void removeParticipants(StringeeClient client, List<User> participants, CallbackListener<List<User>> listener)

Remove participants from conversation.

void deleteMessages(StringeeClient client, List<Message> messages, StatusListener listener)

Delete messages.

void updateConversation(StringeeClient client, String name, String avatar, StatusListener listenerr)

Update a conversation.

void endChat(StringeeClient client, StatusListener listener)

End a live chat.

void setAsAdmin(StringeeClient client, String userId, StatusListener listener)

Set user as admin of conversation.

void setAsMember(StringeeClient client, String userId, StatusListener listener)

Set user as admin of member.

void getMessages(StringeeClient client, String[] msgIds, CallbackListener<List<Message>> listener)

Get messages by id.

void transferTo(StringeeClient client, String userId, String customerId, String customerName, StatusListener listener)

Transfer conversation to other user.


Public constructors


Conversation

Conversation()

Construct a new Conversation.



Public methods


getId

String getId()

Return conversation id.



getName

String getName()

Return conversation name.



getParticipants

List<User> getParticipants()

Return list participants of conversation.



isDistinct

boolean isDistinct()

Check whether the conversation is a distinct conversation.



isGroup

boolean isGroup()

Check whether the conversation is a group conversation.



getCreateAt

long getCreateAt()

Return conversation create time in milliseconds.



getUpdateAt

long getUpdateAt()

Return conversation update time in milliseconds.



getLastMsgSender

String getLastMsgSender()

Return last msg sender id.



getText

String getText()

Return last msg text



getLastTimeNewMsg

long getLastTimeNewMsg()

Return last msg update time in milliseconds.



getLastMsgType

int getLastMsgType()

Return last msg type:
- 1 : TYPE_TEXT
- 2 : TYPE_PHOTO
- 3 : TYPE_VIDEO
- 4 : TYPE_AUDIO
- 5 : TYPE_FILE
- 6 : TYPE_LINK
- 7 : TYPE_CREATE_CONVERSATION
- 8 : TYPE_RENAME_CONVERSATION
- 9 : TYPE_LOCATION
- 10 : TYPE_CONTACT
- 11 : TYPE_STICKER
- 14 : TYPE_RATING
- 100 : TYPE_NOTIFICATION



getLastMsgSeqReceived

long getLastMsgSeqReceived()

Return last msg sequence received.



getLastMsgState

int getLastMsgState()

Return last msg state:
- 0 : INITIALIZE
- 1 : SENDING
- 2 : SENT
- 3 : DELIVERED
- 4 : READ



getLastMsgId

String getLastMsgId()

Return last msg id.



getLastMsg

String getLastMsg()

Return last msg in String.



getTotalUnread

int getTotalUnread()

Return number of unread msg.



getCreator

String getCreator()

Return creator id.



getState

int getState()

Return conversation state:
- 0 : STATE_DEFAULT
- 1 : STATE_LEFT



getChannelType

int getChannelType()

Return conversation channel type:
- 0 : NORMAL
- 1 : LIVECHAT
- 2 : FACEBOOK
- 3 : ZALO



isEnded

boolean isEnded()

Check whether the conversation is ended.



getPinnedMsgId

String getPinnedMsgId()

Return pinned msg id.



getLastMessage

Message getLastMessage()

Return the last received message.



delete

void delete(StatusListener listener)

Delete conversation.

Parameters
listener

The StatusListener instance.



sendMessage

void sendMessage(StringeeClient client, Message message, StatusListener listener)

Get all pending requests of live chat.

Parameters
client

The StringeeClient instance

message

The Message instance.

listener

The StatusListener instance.



getLocalMessages

void getLocalMessages(StringeeClient client, int count, CallbackListener<List<Message>> listener)

Get messages saved in local database.

Parameters
client

The StringeeClient instance

count

Number of messages

listener

The CallbackListener instance.



getLastMessages

void getLastMessages(StringeeClient client, int count, CallbackListener<List<Message>> listener)

Get lastest messages from Stringee server.

Parameters
client

The StringeeClient instance

count

Number of messages

listener

The CallbackListener instance.



getLastMessages

void getLastMessages(StringeeClient client, int count, boolean loadDeletedMsg, boolean loadDeletedMsgContent, boolean loadAll, CallbackListener<List<Message>> listener)

Get lastest messages from Stringee server.

Parameters
client

The StringeeClient instance

count

Number of messages

loadDeletedMsg

Is load deleted msg

loadDeletedMsgContent

Is load deleted msg content

loadAll

is load all

listener

The CallbackListener instance.



getMessagesAfter

void getMessagesAfter(StringeeClient client, long seq, int count, CallbackListener<List<Message>> listener)

Get messages after seq from Stringee server.

Parameters
client

The StringeeClient instance

seq

Sequence of messages

count

Number of messages

listener

The CallbackListener instance.



getMessagesAfter

void getMessagesAfter(StringeeClient client, long seq, int count, boolean loadDeletedMsg, boolean loadDeletedMsgContent, boolean loadAll, CallbackListener<List<Message>> listener)

Get messages after seq from Stringee server.

Parameters
client

The StringeeClient instance

seq

Sequence of messages

count

Number of messages

loadDeletedMsg

Is load deleted msg

loadDeletedMsgContent

Is load deleted msg content

loadAll

is load all

listener

The CallbackListener instance.



getMessagesBefore

void getMessagesBefore(StringeeClient client, long seq, int count, CallbackListener<List<Message>> listener)

Get messages before seq from Stringee server.

Parameters
client

The StringeeClient instance

seq

Sequence of messages

count

Number of messages

listener

The CallbackListener instance.



getMessagesBefore

void getMessagesBefore(StringeeClient client, long seq, int count, boolean loadDeletedMsg, boolean loadDeletedMsgContent, boolean loadAll, CallbackListener<List<Message>> listener)

Get messages before seq from Stringee server.

Parameters
client

The StringeeClient instance

seq

Sequence of messages

count

Number of messages

loadDeletedMsg

Is load deleted msg

loadDeletedMsgContent

Is load deleted msg content

loadAll

is load all

listener

The CallbackListener instance.



addParticipants

void addParticipants(StringeeClient client, List<User> participants, CallbackListener<List<User>> listener)

Add participants to conversation.

Parameters
client

The StringeeClient instance

participants

List of Users

listener

The CallbackListener instance.



removeParticipants

void removeParticipants(StringeeClient client, List<User> participants, CallbackListener<List<User>> listener)

Remove participants from conversation.

Parameters
client

The StringeeClient instance

participants

List of Users

listener

The CallbackListener instance.



deleteMessages

void deleteMessages(StringeeClient client, List<Message> messages, StatusListener listener)

Delete messages.

Parameters
client

The StringeeClient instance

messages

List of messages

listener

The StatusListener instance.



updateConversation

void updateConversation(StringeeClient client, String name, String avatar, StatusListener listener)

Update a conversation.

Parameters
client

The StringeeClient instance

name

New name of conversation

avatar

New avatar url of conversation

listener

The StatusListener instance.



endChat

void endChat(StringeeClient client, StatusListener listener)

End a live chat.

Parameters
client

The StringeeClient instance

listener

The StatusListener instance.



setAsAdmin

void setAsAdmin(StringeeClient client, String userId, StatusListener listener)

Set user as admin of conversation.

Parameters
client

The StringeeClient instance

userId

Id of user

listener

The StatusListener instance.



setAsMember

void setAsMember(StringeeClient client, String userId, StatusListener listener)

Set user as member of conversation.

Parameters
client

The StringeeClient instance

userId

Id of user

listener

The StatusListener instance.



getMessages

void getMessages(StringeeClient client, String[] msgIds, CallbackListener<List<Message>> listener)

Get messages by id.

Parameters
client

The StringeeClient instance

msgIds

List id of messages

listener

The CallbackListener instance.



transferTo

void transferTo(StringeeClient client, String userId, String customerId, String customerName, StatusListener listener)

Transfer conversation to other user.

Parameters
client

The StringeeClient instance

userId

Id of user

customerId

Id of customer

customerName

Id of customer

listener

The CallbackListener instance.