Suggestions

close search

Conversation

public class Conversation
extends StringeeObject



Represents a Conversation.



Summary


Nested classes
public enum Conversation.Type

Type of conversation.

public enum Conversation.ChannelType

Channel type of conversation.

public enum Conversation.State

State of conversation.

public static class ConversationOptions

Options for create conversation.

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.

Message.Type getLastMsgType()

Return last msg type.

long getLastMsgSeqReceived()

Return last msg sequence received.

Message.State 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.

Conversation.State getState()

Return conversation state.

Conversation.ChannelType 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.

void beginTyping(StringeeClient client, StatusListener listener)

Send begin typing event.

void endTyping(StringeeClient client, StatusListener listener)

Send end typing event.

void sendChatTranscriptTo(StringeeClient client, String email, String domain, StatusListener listener)

Send chat transcript.


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

Message.Type getLastMsgType()

Return last msg Message.Type.



getLastMsgSeqReceived

long getLastMsgSeqReceived()

Return last msg sequence received.



getLastMsgState

Message.State getLastMsgState()

Return last msg Message.State.



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

Conversation.State getState()

Return Conversation.State.



getChannelType

Conversation.ChannelType getChannelType()

Return Conversation.ChannelType.



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 StatusListener instance.

beginTyping

void beginTyping(StringeeClient client, StatusListener listener)

Send begin typing event.

Parameters
client

The StringeeClient instance

listener

The StatusListener instance.

endTyping

void endTyping(StringeeClient client, StatusListener listener)

Send end typing event.

Parameters
client

The StringeeClient instance

listener

The StatusListener instance.

sendChatTranscriptTo

void sendChatTranscriptTo(StringeeClient client, String email, String domain, StatusListener listener)

Send chat transcript.

Parameters
client

The StringeeClient instance

email

Email want to send

domain

Your domain want to show

listener

The StatusListener instance.