Browse Source

add delete conversation

Paul 5 years ago
parent
commit
dd8a09b500

+ 15
- 2
package-lock.json View File

@@ -3837,6 +3837,11 @@
3837 3837
         "randomfill": "^1.0.3"
3838 3838
       }
3839 3839
     },
3840
+    "crypto-js": {
3841
+      "version": "3.1.9-1",
3842
+      "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz",
3843
+      "integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg="
3844
+    },
3840 3845
     "crypto-random-string": {
3841 3846
       "version": "1.0.0",
3842 3847
       "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz",
@@ -9932,8 +9937,7 @@
9932 9937
     "node-int64": {
9933 9938
       "version": "0.4.0",
9934 9939
       "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
9935
-      "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=",
9936
-      "dev": true
9940
+      "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs="
9937 9941
     },
9938 9942
     "node-libs-browser": {
9939 9943
       "version": "2.2.0",
@@ -13765,6 +13769,15 @@
13765 13769
         }
13766 13770
       }
13767 13771
     },
13772
+    "ts-linker-sdk": {
13773
+      "version": "1.0.6",
13774
+      "resolved": "https://registry.npmjs.org/ts-linker-sdk/-/ts-linker-sdk-1.0.6.tgz",
13775
+      "integrity": "sha512-j+uZETvbCHLWqOTJ0jLklrUedmlbRwXr4LBFlHQ6htfcZHLMQcOxjQg/NIt1oJNcmNO0fCz0q1qQaQSZW5wpmQ==",
13776
+      "requires": {
13777
+        "crypto-js": "^3.1.9-1",
13778
+        "node-int64": "^0.4.0"
13779
+      }
13780
+    },
13768 13781
     "ts-loader": {
13769 13782
       "version": "5.4.5",
13770 13783
       "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-5.4.5.tgz",

+ 5
- 0
packages/cts-api/dist/cjs/api/WsApi.js View File

@@ -124,6 +124,11 @@ var WsApi = (function (_super) {
124 124
             delete_message: deleteMessage
125 125
         });
126 126
     };
127
+    WsApi.prototype.markMessageRead = function (contactId) {
128
+        return this.request('/v1/mark/messages/read', {
129
+            contact: contactId
130
+        });
131
+    };
127 132
     WsApi.prototype.listGroups = function () {
128 133
         return this.sendGetCmdMsg('listGroups');
129 134
     };

+ 4
- 4
packages/cts-api/dist/index.js
File diff suppressed because it is too large
View File


+ 1
- 0
packages/cts-api/dist/types/api/WsApi.d.ts View File

@@ -15,6 +15,7 @@ export declare class WsApi extends WebSocketClient {
15 15
     addToBlackList(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
16 16
     removeBlackList(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
17 17
     deleteConversation(contactId: string, deleteMessage?: boolean): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
18
+    markMessageRead(contactId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
18 19
     listGroups(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
19 20
     queryGroupInfo(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
20 21
     queryRoomMember(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;

+ 7
- 0
packages/cts-api/src/api/WsApi.ts View File

@@ -82,6 +82,13 @@ export class WsApi extends WebSocketClient {
82 82
       delete_message: deleteMessage
83 83
     });
84 84
   }
85
+
86
+  // 标记会话消息为已读
87
+  markMessageRead(contactId: string) {
88
+    return this.request('/v1/mark/messages/read', {
89
+      contact: contactId
90
+    });
91
+  }
85 92
   /** @end 会话管理 */
86 93
 
87 94
   /** @start 群组管理 */