Chat SDK for Android v1.2.1
agora java chat SDK
Public Member Functions | List of all members
io.agora.chat.FetchMessageOption Class Reference

Inherits io.agora.chat.EMBase< T >.

Public Member Functions

 FetchMessageOption ()
 
void setIsSave (boolean save)
 
void setDirection (Conversation.SearchDirection direction)
 
void setFrom (String from)
 
void setMsgTypes (List< ChatMessage.Type > msgTypes)
 
void setStartTime (long startTime)
 
void setEndTime (long endTime)
 

Detailed Description

The parameter configuration class for pulling historical messages from the server.

Constructor & Destructor Documentation

◆ FetchMessageOption()

io.agora.chat.FetchMessageOption.FetchMessageOption ( )

The constructor.

Member Function Documentation

◆ setDirection()

void io.agora.chat.FetchMessageOption.setDirection ( Conversation.SearchDirection  direction)

Sets the message search direction.

Parameters
directionThe message search direction. See Conversation.SearchDirection.
  • (Default) UP: Messages are retrieved in the descending order of the Unix timestamp included in them.
    • DOWN: Messages are retrieved in the ascending order of the Unix timestamp included in them.

◆ setEndTime()

void io.agora.chat.FetchMessageOption.setEndTime ( long  endTime)

Sets the end time for message query.

Parameters
endTimeThe end time for message query. The time is a UNIX time stamp in milliseconds. The default value is -1, indicating that this parameter is ignored during message query.
  • If the start time is set to a specific time spot and the end time uses the default value -1, the SDK returns messages that are sent and received in the period that is from the start time to the current time.
  • If the start time uses the default value -1 and the end time is set to a specific time spot, the SDK returns messages that are sent and received in the period that is from the timestamp of the first message to the current time.

◆ setFrom()

void io.agora.chat.FetchMessageOption.setFrom ( String  from)

Sets the message sender in the group conversation.

Parameters
fromThe user ID of the message sender in the group conversation.

◆ setIsSave()

void io.agora.chat.FetchMessageOption.setIsSave ( boolean  save)

Sets whether the retrieved messages are saved to the database.

Parameters
saveWhether to save the retrieved messages to the database:
  • true: Yes.
  • (Default)false: No.

◆ setMsgTypes()

void io.agora.chat.FetchMessageOption.setMsgTypes ( List< ChatMessage.Type >  msgTypes)

Sets the types of message for query.

Parameters
msgTypesThe list of message types for query. See ChatStatisticsManager.SearchMessageType. You can set several message types. The default value is null, indicating that all types of messages are retrieved.

◆ setStartTime()

void io.agora.chat.FetchMessageOption.setStartTime ( long  startTime)

Sets the start time for message query.

Parameters
startTimeThe start time for message query. The time is a UNIX time stamp in milliseconds. The default value is -1, indicating that this parameter is ignored during message query.
  • If the start time is set to a specific time spot and the end time uses the default value -1, the SDK returns messages that are sent and received in the period that is from the start time to the current time.
  • If the start time uses the default value -1 and the end time is set to a specific time spot, the SDK returns messages that are sent and received in the period that is from the timestamp of the first message to the current time.

The documentation for this class was generated from the following file: