@onyx-p/imlib-web 2.0.9 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +51 -27
- package/index.umd.js +51 -27
- package/package.json +1 -1
- package/types/index.d.ts +1 -1
package/index.esm.js
CHANGED
@@ -9516,7 +9516,7 @@ var CmdIds;
|
|
9516
9516
|
CmdIds[CmdIds["GetRemoteMessages"] = 1610682419] = "GetRemoteMessages";
|
9517
9517
|
CmdIds[CmdIds["GetSuperGroupRemoteMessages"] = 1610776956] = "GetSuperGroupRemoteMessages";
|
9518
9518
|
CmdIds[CmdIds["DeleteChatMessages"] = 1610682381] = "DeleteChatMessages";
|
9519
|
-
CmdIds[CmdIds["ClearChatHistoryMessage"] =
|
9519
|
+
CmdIds[CmdIds["ClearChatHistoryMessage"] = 1610682421] = "ClearChatHistoryMessage";
|
9520
9520
|
CmdIds[CmdIds["GetDialogList"] = 1610711096] = "GetDialogList";
|
9521
9521
|
CmdIds[CmdIds["GetBriefDialogList"] = 1610682399] = "GetBriefDialogList";
|
9522
9522
|
CmdIds[CmdIds["UpdatePrivateChatMuteConfig"] = 1610682379] = "UpdatePrivateChatMuteConfig";
|
@@ -15446,9 +15446,10 @@ const CleanHistoryMessageReq = $root$2.CleanHistoryMessageReq = (() => {
|
|
15446
15446
|
* Properties of a CleanHistoryMessageReq.
|
15447
15447
|
* @exports ICleanHistoryMessageReq
|
15448
15448
|
* @interface ICleanHistoryMessageReq
|
15449
|
-
* @property {
|
15450
|
-
* @property {
|
15451
|
-
* @property {Long
|
15449
|
+
* @property {string|null} [destId] CleanHistoryMessageReq destId
|
15450
|
+
* @property {Long|null} [msgId] CleanHistoryMessageReq msgId
|
15451
|
+
* @property {Array.<Long>|null} [msgIdList] CleanHistoryMessageReq msgIdList
|
15452
|
+
* @property {Array.<string>|null} [destIdList] CleanHistoryMessageReq destIdList
|
15452
15453
|
*/
|
15453
15454
|
|
15454
15455
|
/**
|
@@ -15460,32 +15461,42 @@ const CleanHistoryMessageReq = $root$2.CleanHistoryMessageReq = (() => {
|
|
15460
15461
|
* @param {ICleanHistoryMessageReq=} [properties] Properties to set
|
15461
15462
|
*/
|
15462
15463
|
function CleanHistoryMessageReq(properties) {
|
15464
|
+
this.msgIdList = [];
|
15465
|
+
this.destIdList = [];
|
15463
15466
|
if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
15464
15467
|
}
|
15465
15468
|
|
15466
15469
|
/**
|
15467
15470
|
* CleanHistoryMessageReq destId.
|
15468
|
-
* @member {
|
15471
|
+
* @member {string} destId
|
15469
15472
|
* @memberof CleanHistoryMessageReq
|
15470
15473
|
* @instance
|
15471
15474
|
*/
|
15472
|
-
CleanHistoryMessageReq.prototype.destId =
|
15475
|
+
CleanHistoryMessageReq.prototype.destId = "";
|
15473
15476
|
|
15474
15477
|
/**
|
15475
|
-
* CleanHistoryMessageReq
|
15476
|
-
* @member {
|
15478
|
+
* CleanHistoryMessageReq msgId.
|
15479
|
+
* @member {Long} msgId
|
15480
|
+
* @memberof CleanHistoryMessageReq
|
15481
|
+
* @instance
|
15482
|
+
*/
|
15483
|
+
CleanHistoryMessageReq.prototype.msgId = $util$2.Long ? $util$2.Long.fromBits(0, 0, false) : 0;
|
15484
|
+
|
15485
|
+
/**
|
15486
|
+
* CleanHistoryMessageReq msgIdList.
|
15487
|
+
* @member {Array.<Long>} msgIdList
|
15477
15488
|
* @memberof CleanHistoryMessageReq
|
15478
15489
|
* @instance
|
15479
15490
|
*/
|
15480
|
-
CleanHistoryMessageReq.prototype.
|
15491
|
+
CleanHistoryMessageReq.prototype.msgIdList = $util$2.emptyArray;
|
15481
15492
|
|
15482
15493
|
/**
|
15483
|
-
* CleanHistoryMessageReq
|
15484
|
-
* @member {
|
15494
|
+
* CleanHistoryMessageReq destIdList.
|
15495
|
+
* @member {Array.<string>} destIdList
|
15485
15496
|
* @memberof CleanHistoryMessageReq
|
15486
15497
|
* @instance
|
15487
15498
|
*/
|
15488
|
-
CleanHistoryMessageReq.prototype.
|
15499
|
+
CleanHistoryMessageReq.prototype.destIdList = $util$2.emptyArray;
|
15489
15500
|
|
15490
15501
|
/**
|
15491
15502
|
* Encodes the specified CleanHistoryMessageReq message. Does not implicitly {@link CleanHistoryMessageReq.verify|verify} messages.
|
@@ -15498,9 +15509,14 @@ const CleanHistoryMessageReq = $root$2.CleanHistoryMessageReq = (() => {
|
|
15498
15509
|
*/
|
15499
15510
|
CleanHistoryMessageReq.encode = function encode(message, writer) {
|
15500
15511
|
if (!writer) writer = $Writer$2.create();
|
15501
|
-
if (message.destId != null && Object.hasOwnProperty.call(message, "destId")) writer.uint32(/* id 1, wireType
|
15502
|
-
if (message.
|
15503
|
-
if (message.
|
15512
|
+
if (message.destId != null && Object.hasOwnProperty.call(message, "destId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.destId);
|
15513
|
+
if (message.msgId != null && Object.hasOwnProperty.call(message, "msgId")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.msgId);
|
15514
|
+
if (message.msgIdList != null && message.msgIdList.length) {
|
15515
|
+
writer.uint32(/* id 3, wireType 2 =*/26).fork();
|
15516
|
+
for (let i = 0; i < message.msgIdList.length; ++i) writer.int64(message.msgIdList[i]);
|
15517
|
+
writer.ldelim();
|
15518
|
+
}
|
15519
|
+
if (message.destIdList != null && message.destIdList.length) for (let i = 0; i < message.destIdList.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).string(message.destIdList[i]);
|
15504
15520
|
return writer;
|
15505
15521
|
};
|
15506
15522
|
|
@@ -15524,17 +15540,27 @@ const CleanHistoryMessageReq = $root$2.CleanHistoryMessageReq = (() => {
|
|
15524
15540
|
switch (tag >>> 3) {
|
15525
15541
|
case 1:
|
15526
15542
|
{
|
15527
|
-
message.destId = reader.
|
15543
|
+
message.destId = reader.string();
|
15528
15544
|
break;
|
15529
15545
|
}
|
15530
15546
|
case 2:
|
15531
15547
|
{
|
15532
|
-
message.
|
15548
|
+
message.msgId = reader.int64();
|
15533
15549
|
break;
|
15534
15550
|
}
|
15535
15551
|
case 3:
|
15536
15552
|
{
|
15537
|
-
message.
|
15553
|
+
if (!(message.msgIdList && message.msgIdList.length)) message.msgIdList = [];
|
15554
|
+
if ((tag & 7) === 2) {
|
15555
|
+
let end2 = reader.uint32() + reader.pos;
|
15556
|
+
while (reader.pos < end2) message.msgIdList.push(reader.int64());
|
15557
|
+
} else message.msgIdList.push(reader.int64());
|
15558
|
+
break;
|
15559
|
+
}
|
15560
|
+
case 4:
|
15561
|
+
{
|
15562
|
+
if (!(message.destIdList && message.destIdList.length)) message.destIdList = [];
|
15563
|
+
message.destIdList.push(reader.string());
|
15538
15564
|
break;
|
15539
15565
|
}
|
15540
15566
|
default:
|
@@ -19247,11 +19273,9 @@ const deleteMessages$1 = (dialogId, messageUIds) => {
|
|
19247
19273
|
});
|
19248
19274
|
return reqPromise;
|
19249
19275
|
};
|
19250
|
-
const clearHistoryMessage =
|
19276
|
+
const clearHistoryMessage = dialogId => {
|
19251
19277
|
return webSocketServer.send(CmdIds$1.ClearChatHistoryMessage, {
|
19252
|
-
destId:
|
19253
|
-
type: extractConversationType(dialogId) == ConversationType.GROUP ? 1 : 0,
|
19254
|
-
msgTime: Long.fromNumber(timestamp)
|
19278
|
+
destId: dialogId
|
19255
19279
|
}, {
|
19256
19280
|
encoder: CleanHistoryMessageReq,
|
19257
19281
|
decoder: BaseResp
|
@@ -20278,6 +20302,7 @@ class ConversationManager {
|
|
20278
20302
|
}
|
20279
20303
|
remove(conOpt) {
|
20280
20304
|
this.store.remove(conOpt);
|
20305
|
+
this.localConversationSet.delete(this.getConversationKey(conOpt));
|
20281
20306
|
}
|
20282
20307
|
clearHistoryMessages(conOpt) {
|
20283
20308
|
this.clearUnreadCount(conOpt);
|
@@ -29170,10 +29195,10 @@ class IMClient extends EventEmitter {
|
|
29170
29195
|
MessageCache$1.get()?.removeMessagesByUId(list.map(e => e.messageUId));
|
29171
29196
|
return deleteMessages$1(getFullDialogId(conversation), list.map(e => e.messageUId)).then(result => result.code);
|
29172
29197
|
}
|
29173
|
-
async deleteRemoteMessageByTimestamp(conversation
|
29198
|
+
async deleteRemoteMessageByTimestamp(conversation) {
|
29174
29199
|
MessageCache$1.get()?.clearConversationCache(conversation);
|
29175
29200
|
ConversationManager$1.get().clearHistoryMessages(conversation);
|
29176
|
-
return clearHistoryMessage(getFullDialogId(conversation)
|
29201
|
+
return clearHistoryMessage(getFullDialogId(conversation)).then(result => result.code);
|
29177
29202
|
}
|
29178
29203
|
async getConversationList(count, conversationType, startTime, order) {
|
29179
29204
|
const params = {
|
@@ -30573,12 +30598,11 @@ const deleteMessages = async (conversation, messages) => {
|
|
30573
30598
|
code: ErrorCode.SUCCESS
|
30574
30599
|
};
|
30575
30600
|
};
|
30576
|
-
const clearHistoryMessages = async
|
30577
|
-
assert('timestamp', timestamp, val => AssertRules.NUMBER(val) && val >= 0, true);
|
30601
|
+
const clearHistoryMessages = async conversation => {
|
30578
30602
|
assert('conversation', conversation, AssertRules.CONVERSATION);
|
30579
30603
|
const paramsStr = 'conversationType:' + conversation.conversationType + ',targetId:' + conversation.targetId;
|
30580
30604
|
logger.debug('clear message ->' + paramsStr);
|
30581
|
-
const code = await imClient.deleteRemoteMessageByTimestamp(conversation
|
30605
|
+
const code = await imClient.deleteRemoteMessageByTimestamp(conversation);
|
30582
30606
|
if (code !== ErrorCode.SUCCESS) {
|
30583
30607
|
logger.warn('clear message ->' + code + ':' + ErrorDesc(code) + ',' + paramsStr);
|
30584
30608
|
return {
|
package/index.umd.js
CHANGED
@@ -9522,7 +9522,7 @@
|
|
9522
9522
|
CmdIds[CmdIds["GetRemoteMessages"] = 1610682419] = "GetRemoteMessages";
|
9523
9523
|
CmdIds[CmdIds["GetSuperGroupRemoteMessages"] = 1610776956] = "GetSuperGroupRemoteMessages";
|
9524
9524
|
CmdIds[CmdIds["DeleteChatMessages"] = 1610682381] = "DeleteChatMessages";
|
9525
|
-
CmdIds[CmdIds["ClearChatHistoryMessage"] =
|
9525
|
+
CmdIds[CmdIds["ClearChatHistoryMessage"] = 1610682421] = "ClearChatHistoryMessage";
|
9526
9526
|
CmdIds[CmdIds["GetDialogList"] = 1610711096] = "GetDialogList";
|
9527
9527
|
CmdIds[CmdIds["GetBriefDialogList"] = 1610682399] = "GetBriefDialogList";
|
9528
9528
|
CmdIds[CmdIds["UpdatePrivateChatMuteConfig"] = 1610682379] = "UpdatePrivateChatMuteConfig";
|
@@ -15452,9 +15452,10 @@
|
|
15452
15452
|
* Properties of a CleanHistoryMessageReq.
|
15453
15453
|
* @exports ICleanHistoryMessageReq
|
15454
15454
|
* @interface ICleanHistoryMessageReq
|
15455
|
-
* @property {
|
15456
|
-
* @property {
|
15457
|
-
* @property {Long
|
15455
|
+
* @property {string|null} [destId] CleanHistoryMessageReq destId
|
15456
|
+
* @property {Long|null} [msgId] CleanHistoryMessageReq msgId
|
15457
|
+
* @property {Array.<Long>|null} [msgIdList] CleanHistoryMessageReq msgIdList
|
15458
|
+
* @property {Array.<string>|null} [destIdList] CleanHistoryMessageReq destIdList
|
15458
15459
|
*/
|
15459
15460
|
|
15460
15461
|
/**
|
@@ -15466,32 +15467,42 @@
|
|
15466
15467
|
* @param {ICleanHistoryMessageReq=} [properties] Properties to set
|
15467
15468
|
*/
|
15468
15469
|
function CleanHistoryMessageReq(properties) {
|
15470
|
+
this.msgIdList = [];
|
15471
|
+
this.destIdList = [];
|
15469
15472
|
if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
15470
15473
|
}
|
15471
15474
|
|
15472
15475
|
/**
|
15473
15476
|
* CleanHistoryMessageReq destId.
|
15474
|
-
* @member {
|
15477
|
+
* @member {string} destId
|
15475
15478
|
* @memberof CleanHistoryMessageReq
|
15476
15479
|
* @instance
|
15477
15480
|
*/
|
15478
|
-
CleanHistoryMessageReq.prototype.destId =
|
15481
|
+
CleanHistoryMessageReq.prototype.destId = "";
|
15479
15482
|
|
15480
15483
|
/**
|
15481
|
-
* CleanHistoryMessageReq
|
15482
|
-
* @member {
|
15484
|
+
* CleanHistoryMessageReq msgId.
|
15485
|
+
* @member {Long} msgId
|
15486
|
+
* @memberof CleanHistoryMessageReq
|
15487
|
+
* @instance
|
15488
|
+
*/
|
15489
|
+
CleanHistoryMessageReq.prototype.msgId = $util$2.Long ? $util$2.Long.fromBits(0, 0, false) : 0;
|
15490
|
+
|
15491
|
+
/**
|
15492
|
+
* CleanHistoryMessageReq msgIdList.
|
15493
|
+
* @member {Array.<Long>} msgIdList
|
15483
15494
|
* @memberof CleanHistoryMessageReq
|
15484
15495
|
* @instance
|
15485
15496
|
*/
|
15486
|
-
CleanHistoryMessageReq.prototype.
|
15497
|
+
CleanHistoryMessageReq.prototype.msgIdList = $util$2.emptyArray;
|
15487
15498
|
|
15488
15499
|
/**
|
15489
|
-
* CleanHistoryMessageReq
|
15490
|
-
* @member {
|
15500
|
+
* CleanHistoryMessageReq destIdList.
|
15501
|
+
* @member {Array.<string>} destIdList
|
15491
15502
|
* @memberof CleanHistoryMessageReq
|
15492
15503
|
* @instance
|
15493
15504
|
*/
|
15494
|
-
CleanHistoryMessageReq.prototype.
|
15505
|
+
CleanHistoryMessageReq.prototype.destIdList = $util$2.emptyArray;
|
15495
15506
|
|
15496
15507
|
/**
|
15497
15508
|
* Encodes the specified CleanHistoryMessageReq message. Does not implicitly {@link CleanHistoryMessageReq.verify|verify} messages.
|
@@ -15504,9 +15515,14 @@
|
|
15504
15515
|
*/
|
15505
15516
|
CleanHistoryMessageReq.encode = function encode(message, writer) {
|
15506
15517
|
if (!writer) writer = $Writer$2.create();
|
15507
|
-
if (message.destId != null && Object.hasOwnProperty.call(message, "destId")) writer.uint32(/* id 1, wireType
|
15508
|
-
if (message.
|
15509
|
-
if (message.
|
15518
|
+
if (message.destId != null && Object.hasOwnProperty.call(message, "destId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.destId);
|
15519
|
+
if (message.msgId != null && Object.hasOwnProperty.call(message, "msgId")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.msgId);
|
15520
|
+
if (message.msgIdList != null && message.msgIdList.length) {
|
15521
|
+
writer.uint32(/* id 3, wireType 2 =*/26).fork();
|
15522
|
+
for (let i = 0; i < message.msgIdList.length; ++i) writer.int64(message.msgIdList[i]);
|
15523
|
+
writer.ldelim();
|
15524
|
+
}
|
15525
|
+
if (message.destIdList != null && message.destIdList.length) for (let i = 0; i < message.destIdList.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).string(message.destIdList[i]);
|
15510
15526
|
return writer;
|
15511
15527
|
};
|
15512
15528
|
|
@@ -15530,17 +15546,27 @@
|
|
15530
15546
|
switch (tag >>> 3) {
|
15531
15547
|
case 1:
|
15532
15548
|
{
|
15533
|
-
message.destId = reader.
|
15549
|
+
message.destId = reader.string();
|
15534
15550
|
break;
|
15535
15551
|
}
|
15536
15552
|
case 2:
|
15537
15553
|
{
|
15538
|
-
message.
|
15554
|
+
message.msgId = reader.int64();
|
15539
15555
|
break;
|
15540
15556
|
}
|
15541
15557
|
case 3:
|
15542
15558
|
{
|
15543
|
-
message.
|
15559
|
+
if (!(message.msgIdList && message.msgIdList.length)) message.msgIdList = [];
|
15560
|
+
if ((tag & 7) === 2) {
|
15561
|
+
let end2 = reader.uint32() + reader.pos;
|
15562
|
+
while (reader.pos < end2) message.msgIdList.push(reader.int64());
|
15563
|
+
} else message.msgIdList.push(reader.int64());
|
15564
|
+
break;
|
15565
|
+
}
|
15566
|
+
case 4:
|
15567
|
+
{
|
15568
|
+
if (!(message.destIdList && message.destIdList.length)) message.destIdList = [];
|
15569
|
+
message.destIdList.push(reader.string());
|
15544
15570
|
break;
|
15545
15571
|
}
|
15546
15572
|
default:
|
@@ -19253,11 +19279,9 @@
|
|
19253
19279
|
});
|
19254
19280
|
return reqPromise;
|
19255
19281
|
};
|
19256
|
-
const clearHistoryMessage =
|
19282
|
+
const clearHistoryMessage = dialogId => {
|
19257
19283
|
return webSocketServer.send(CmdIds$1.ClearChatHistoryMessage, {
|
19258
|
-
destId:
|
19259
|
-
type: extractConversationType(dialogId) == exports.ConversationType.GROUP ? 1 : 0,
|
19260
|
-
msgTime: Long.fromNumber(timestamp)
|
19284
|
+
destId: dialogId
|
19261
19285
|
}, {
|
19262
19286
|
encoder: CleanHistoryMessageReq,
|
19263
19287
|
decoder: BaseResp
|
@@ -20284,6 +20308,7 @@
|
|
20284
20308
|
}
|
20285
20309
|
remove(conOpt) {
|
20286
20310
|
this.store.remove(conOpt);
|
20311
|
+
this.localConversationSet.delete(this.getConversationKey(conOpt));
|
20287
20312
|
}
|
20288
20313
|
clearHistoryMessages(conOpt) {
|
20289
20314
|
this.clearUnreadCount(conOpt);
|
@@ -29176,10 +29201,10 @@
|
|
29176
29201
|
MessageCache$1.get()?.removeMessagesByUId(list.map(e => e.messageUId));
|
29177
29202
|
return deleteMessages$1(getFullDialogId(conversation), list.map(e => e.messageUId)).then(result => result.code);
|
29178
29203
|
}
|
29179
|
-
async deleteRemoteMessageByTimestamp(conversation
|
29204
|
+
async deleteRemoteMessageByTimestamp(conversation) {
|
29180
29205
|
MessageCache$1.get()?.clearConversationCache(conversation);
|
29181
29206
|
ConversationManager$1.get().clearHistoryMessages(conversation);
|
29182
|
-
return clearHistoryMessage(getFullDialogId(conversation)
|
29207
|
+
return clearHistoryMessage(getFullDialogId(conversation)).then(result => result.code);
|
29183
29208
|
}
|
29184
29209
|
async getConversationList(count, conversationType, startTime, order) {
|
29185
29210
|
const params = {
|
@@ -30579,12 +30604,11 @@
|
|
30579
30604
|
code: exports.ErrorCode.SUCCESS
|
30580
30605
|
};
|
30581
30606
|
};
|
30582
|
-
const clearHistoryMessages = async
|
30583
|
-
assert('timestamp', timestamp, val => AssertRules.NUMBER(val) && val >= 0, true);
|
30607
|
+
const clearHistoryMessages = async conversation => {
|
30584
30608
|
assert('conversation', conversation, AssertRules.CONVERSATION);
|
30585
30609
|
const paramsStr = 'conversationType:' + conversation.conversationType + ',targetId:' + conversation.targetId;
|
30586
30610
|
logger.debug('clear message ->' + paramsStr);
|
30587
|
-
const code = await imClient.deleteRemoteMessageByTimestamp(conversation
|
30611
|
+
const code = await imClient.deleteRemoteMessageByTimestamp(conversation);
|
30588
30612
|
if (code !== exports.ErrorCode.SUCCESS) {
|
30589
30613
|
logger.warn('clear message ->' + code + ':' + ErrorDesc(code) + ',' + paramsStr);
|
30590
30614
|
return {
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
@@ -222,7 +222,7 @@ export declare const deleteMessages: (conversation: IConversationOption, message
|
|
222
222
|
* @param conversation 会话
|
223
223
|
* @param timestamp 清除时间点, 该时间之前的消息将被清除
|
224
224
|
*/
|
225
|
-
export declare const clearHistoryMessages: (conversation: IConversationOption
|
225
|
+
export declare const clearHistoryMessages: (conversation: IConversationOption) => IPromiseResult<void>;
|
226
226
|
export declare const parseChatRecordMsgDetails: (conversation: IConversationOption, detailItems: IChatRecordMsgDetail[]) => IReceivedMessage[];
|
227
227
|
/**
|
228
228
|
* 发送已读回执
|