searchLocalMessages method
Search messages
conversationID
Query based on conversation, pass null for global search
keywordList
Search keyword list, currently supports searching with a single keyword
keywordListMatchType
Keyword matching mode, 1 means AND, 2 means OR (currently unused)
senderUserIDList
List of UIDs for messages sent (currently unused)
messageTypeList
Message type list
searchTimePosition
Start time point for searching. Defaults to 0, meaning searching from now. UTC timestamp, in seconds
searchTimePeriod
Time range in the past from the start time point, in seconds. Defaults to 0, meaning no time range limitation. Pass 24x60x60 to represent the past day
pageIndex
Current page number
count
Number of messages per page
Implementation
Future<SearchResult> searchLocalMessages({
String? conversationID,
List<String> keywordList = const [],
int keywordListMatchType = 0,
List<String> senderUserIDList = const [],
List<int> messageTypeList = const [],
int searchTimePosition = 0,
int searchTimePeriod = 0,
int pageIndex = 1,
int count = 40,
String? operationID,
}) =>
_channel
.invokeMethod(
'searchLocalMessages',
_buildParam({
'filter': {
'conversationID': conversationID,
'keywordList': keywordList,
'keywordListMatchType': keywordListMatchType,
'senderUserIDList': senderUserIDList,
'messageTypeList': messageTypeList,
'searchTimePosition': searchTimePosition,
'searchTimePeriod': searchTimePeriod,
'pageIndex': pageIndex,
'count': count,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => SearchResult.fromJson(map)));