TIMMsgFindByMsgLocatorList
Introduction
Find Message by locator
Find message by message locator, used for locating revoked message and so on.
Once locator locates one message
Parameter details
| Parameter name | Parameter type | Required | Description |
|---|---|---|---|
| msgFindByMsgLocatorListParams | MsgFindByMsgLocatorListParams | yes | Param about locator |
Returned template
Promise<commonResult<Array<Json_value_msg>>>
{
code: TIMResult | TIMErrCode;
desc?: string | undefined;
json_param?: Array<Json_value_msg> | undefined;
json_params?: Array<Json_value_msg> | undefined;
user_data?: string | undefined;
}
Return value details
| name | type | description |
|---|---|---|
| code | TIMResult | TIMErrCode | Request result: Error codes. 0 means success. |
| desc | string | undefined | The description of the error. It will be empty if success. |
| json_param | Array< Json_value_msg > | undefined | Return value of calling API |
| json_params | Array< Json_value_msg > | undefined | Return value of calling API. Compatible field, which is returned in some cases. |
| user_data | string | undefined | ImSDK is responsible for transporting user-defined data without any processing |
Code example
import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
import { MsgFindByMsgLocatorListParams, Json_msg_locator } from "im_electron_sdk/dist/interfaces";
let convId = ''
let convType = 0
let locator: Json_msg_locator = {
message_locator_is_revoked: false,
message_locator_time: 0,
message_locator_seq: 0,
message_locator_is_self: false,
message_locator_rand: 0,
message_locator_unique_id: 0
}
let param: MsgFindByMsgLocatorListParams = {
conv_id: convId,
conv_type: convType,
params: [locator],
user_data: ''
}
const { code } = await timRenderInstance.TIMMsgFindByMsgLocatorList(param);
if (code == 0) {
// success
}