public class Conversation
extends StringeeObject
Represents a Conversation.
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. |
Conversation()
Construct a new Conversation.
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 Message.Type.
long getLastMsgSeqReceived()
Return last msg sequence received.
Message.State getLastMsgState()
Return last msg Message.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.ChannelType.
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.
Parameters | |
---|---|
listener |
The StatusListener instance. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
void deleteMessages(StringeeClient client, List<Message> messages, StatusListener listener)
Delete messages.
Parameters | |
---|---|
client |
The StringeeClient instance |
messages |
List of messages |
listener |
The StatusListener instance. |
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. |
void endChat(StringeeClient client, StatusListener listener)
End a live chat.
Parameters | |
---|---|
client |
The StringeeClient instance |
listener |
The StatusListener instance. |
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. |
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. |
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. |
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. |
void beginTyping(StringeeClient client, StatusListener listener)
Send begin typing event.
Parameters | |
---|---|
client |
The StringeeClient instance |
listener |
The StatusListener instance. |
void endTyping(StringeeClient client, StatusListener listener)
Send end typing event.
Parameters | |
---|---|
client |
The StringeeClient instance |
listener |
The StatusListener instance. |
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. |