Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trans progress in message #46

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/docs.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ toc_max_heading_level: 2

# clearConversationAndDeleteAllMsg

## 功能介绍
## Feature Introduction

:::info 说明
:::info Description

从本地和服务器删除指定会话中的消息,会话仍会保留。
Deletes messages from a specified conversation both locally and on the server, but retains the conversation.

:::

:::caution 注意
:::caution Note

**相关回调**:
**Related Callback**:
[onConversationChanged](/callback/onConversationChanged.mdx)

:::
Expand All @@ -34,7 +34,7 @@ values={[

<TabItem value="Flutter">

### 函数原型
### Function Prototype

```dart showLineNumbers
Future clearConversationAndDeleteAllMsg({
Expand All @@ -43,19 +43,19 @@ values={[
})
```

### 输入参数
### Input Parameters

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------------- | -------- | -------- | ------- |
| conversationID | String | 是 | 会话 ID |
| Parameter Name | Parameter Type | Mandatory | Description |
| --------------- | -------------- | --------- | ----------- |
| conversationID | String | Yes | Conversation ID |

### 返回结果
### Return Result

| 名称 | 类型 | 描述 |
| ---- | ---- | -------------------- |
| ~ | ~ | 无异常抛出则操作成功 |
| Name | Type | Description |
| ---- | ---- | ----------------------- |
| ~ | ~ | Operation successful if no exception is thrown |

### 代码示例
### Code Example

```dart showLineNumbers
await OpenIM.iMManager.conversationManager.clearConversationAndDeleteAllMsg(conversationID: conversationID);
Expand All @@ -66,7 +66,7 @@ values={[

<TabItem value="iOS">

### 函数原型
### Function Prototype

```swift showLineNumbers

Expand All @@ -76,20 +76,20 @@ values={[

```

### 输入参数
### Input Parameters

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------------- | -------- | -------- | ------- |
| conversationID | NSString | 是 | 会话 ID |
| Parameter Name | Parameter Type | Mandatory | Description |
| --------------- | -------------- | --------- | ----------- |
| conversationID | NSString | Yes | Conversation ID |

### 返回结果
### Return Result

| 名称 | 类型 | 描述 |
| --------- | ------------------------------------------------------ | -------- |
| onSuccess | OIMSuccessCallback | 成功返回 |
| onFailure | OIMFailureCallback | 失败返回 |
| Name | Type | Description |
| ---------- | ----------------- | ----------- |
| onSuccess | OIMSuccessCallback | Success return |
| onFailure | OIMFailureCallback | Failure return |

### 代码示例
### Code Example

```swift showLineNumbers

Expand All @@ -105,20 +105,21 @@ values={[
</TabItem>

<TabItem value="Android">
### 函数原型

### Function Prototype

```java showLineNumbers
public void clearConversationAndDeleteAllMsg(String conversationID, OnBase<String> callBack)
```

### 输入参数
### Input Parameters

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------------- | --------------------------------------- | -------- | -------- |
| conversationID | String | | 会话 ID |
| callBack | [OnBase](/callback/onBase.mdx) | 是 | 回调接口 |
| Parameter Name | Parameter Type | Mandatory | Description |
| --------------- | --------------------------------------- | --------- | -------------|
| conversationID | String | Yes | Conversation ID |
| callBack | [OnBase](/callback/onBase.mdx) | Yes | Callback interface |

### 代码示例
### Code Example

```java showLineNumbers
OpenIMClient.getInstance().messageManager.clearConversationAndDeleteAllMsg(conversationID,new OnBase<String>() {
Expand All @@ -138,67 +139,67 @@ public void clearConversationAndDeleteAllMsg(String conversationID, OnBase<Strin

<TabItem value="Web">

### 函数原型
### Function Prototype

```ts showLineNumbers
IMSDK.clearConversationAndDeleteAllMsg(conversationID: string, operationID?: string): Promise<WsResponse>
```

### 输入参数
### Input Parameters

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------------- | -------- | -------- | ------- |
| conversationID | string | 是 | 会话 ID |
| Parameter Name | Parameter Type | Mandatory | Description |
| --------------- | -------------- | --------- | ----------- |
| conversationID | string | Yes | Conversation ID |

### 返回结果
### Return Result

| 参数名称 | 参数类型 | 描述 |
| --------------- | ---------------------------------------------------- | ------------ |
| Promise.then() | Promise<[WsResponse](/class/response.mdx)\> | 调用成功回调 |
| Promise.catch() | Promise<[WsResponse](/class/response.mdx)\> | 调用失败回调 |
| Parameter Name | Parameter Type | Description |
| ---------------- | ----------------------------------------------- | ------------- |
| Promise.then() | Promise<[WsResponse](/class/response.mdx)\> | Success callback |
| Promise.catch() | Promise<[WsResponse](/class/response.mdx)\> | Failure callback |

### 代码示例
### Code Example

```js showLineNumbers
import { getSDK } from 'open-im-sdk-wasm';
const IMSDK = getSDK();

IMSDK.clearConversationAndDeleteAllMsg('conversationID')
.then(({ data }) => {
// 调用成功
// Call succeeded
})
.catch(({ errCode, errMsg }) => {
// 调用失败
// Call failed
});
```

</TabItem>

<TabItem value="uni-app">

### 函数原型
### Function Prototype

```ts showLineNumbers
IMSDK.asyncApi('clearConversationAndDeleteAllMsg', operationID: string, conversationID: string): Promise<void>
```

### 输入参数
### Input Parameters

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------------- | -------- | -------- | ------------------------------------------------------- |
| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
| conversationID | string | 是 | 会话 ID |
| Parameter Name | Parameter Type | Mandatory | Description |
| --------------- | -------------- | --------- | ------------------------------------------------ |
| operationID | string | Yes | Operation ID for issue tracking, suggested to use current time and random number |
| conversationID | string | Yes | Conversation ID |

### 返回结果
### Return Result

> 通过`openim-uniapp-polyfill`包将函数 Promise 化,调用时需要使用`then``catch`判断并处理成功和失败回调。
> Through the `openim-uniapp-polyfill` package, the function is made Promise-compatible, requiring the use of `then` and `catch` to determine and handle the success and failure callbacks respectively.

| 参数名称 | 参数类型 | 描述 |
| --------------- | ------------------------------------------------------- | ------------ |
| Promise.then() | Promise<void\> | 调用成功回调 |
| Promise.catch() | Promise<[CatchResponse](/class/response.mdx)\> | 调用失败回调 |
| Parameter Name | Parameter Type | Description |
| ---------------- | ----------------------------------------------- | ------------- |
| Promise.then() | Promise<void\> | Success callback |
| Promise.catch() | Promise<[CatchResponse](/class/response.mdx)\> | Failure callback |

### 代码示例
### Code Example

```js showLineNumbers
import IMSDK from 'openim-uniapp-polyfill';
Expand All @@ -209,13 +210,13 @@ IMSDK.asyncApi(
'conversationID'
)
.then(({ data }) => {
// 调用成功
// Call succeeded
})
.catch(({ errCode, errMsg }) => {
// 调用失败
// Call failed
});
```

</TabItem>

</Tabs>
</Tabs>
Loading
Loading