@onyx-p/imlib-web 1.6.5 → 1.6.6

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 CHANGED
@@ -17473,7 +17473,7 @@ const GetNewSettingDialogListResp = $root$1.GetNewSettingDialogListResp = (() =>
17473
17473
  };
17474
17474
  return GetNewSettingDialogListResp;
17475
17475
  })();
17476
- $root$1.NewMessageNotificationResp = (() => {
17476
+ const NewMessageNotificationResp = $root$1.NewMessageNotificationResp = (() => {
17477
17477
  /**
17478
17478
  * Properties of a NewMessageNotificationResp.
17479
17479
  * @exports INewMessageNotificationResp
@@ -19836,14 +19836,14 @@ class MessageLoader {
19836
19836
  this.cancelRetryTask();
19837
19837
  this.pullingMsg = true;
19838
19838
  const inboxTime = this.letterbox.getInboxOffset();
19839
- this.pullOfflineFinished || logger.info(`pullMsg -> time: ${inboxTime}`);
19839
+ logger.info(`pullMsg -> time: ${inboxTime}`);
19840
19840
  this.latestSyncTimestamp = Date.now();
19841
19841
  const {
19842
19842
  code,
19843
19843
  data
19844
19844
  } = await getNewMessages(inboxTime, 60);
19845
19845
  if (code !== ErrorCode.SUCCESS) {
19846
- this.pullOfflineFinished || logger.warn('pullMsg failed -> code:', code);
19846
+ logger.warn('pullMsg failed -> code:', code);
19847
19847
  this.pullingMsg = false;
19848
19848
  this.try2RePullMsg();
19849
19849
  return;
@@ -19890,7 +19890,7 @@ class MessageLoader {
19890
19890
  this.serverMsgSeqno = seqno;
19891
19891
  }
19892
19892
  const isFinished = this.serverMsgSeqno.lessThanOrEqual(offset);
19893
- this.pullOfflineFinished || logger.info(`pullMsg success -> syncTime: ${offset}, finished: ${isFinished}`);
19893
+ logger.info(`pullMsg success -> syncTime: ${offset}, finished: ${isFinished}`);
19894
19894
  this.letterbox?.setInboxOffset(offset);
19895
19895
  this.pullingMsg = false;
19896
19896
  if (isFinished && !this.pullOfflineFinished) {
@@ -20125,6 +20125,8 @@ class LibLoader {
20125
20125
  messageListener(cmdId, body) {
20126
20126
  if (cmdId === CmdIds$1.NewMessagePush) {
20127
20127
  console.log('messageListener: new message push');
20128
+ const newMsgNotiResp = NewMessageNotificationResp.decode(body);
20129
+ this.messageLoader?.syncMsg(newMsgNotiResp.seqno);
20128
20130
  } else if (cmdId === CmdIds$1.DialogChangedPush) {
20129
20131
  ConversationManager$1.get().syncConversationStatus();
20130
20132
  } else {
package/index.umd.js CHANGED
@@ -17479,7 +17479,7 @@
17479
17479
  };
17480
17480
  return GetNewSettingDialogListResp;
17481
17481
  })();
17482
- $root$1.NewMessageNotificationResp = (() => {
17482
+ const NewMessageNotificationResp = $root$1.NewMessageNotificationResp = (() => {
17483
17483
  /**
17484
17484
  * Properties of a NewMessageNotificationResp.
17485
17485
  * @exports INewMessageNotificationResp
@@ -19842,14 +19842,14 @@
19842
19842
  this.cancelRetryTask();
19843
19843
  this.pullingMsg = true;
19844
19844
  const inboxTime = this.letterbox.getInboxOffset();
19845
- this.pullOfflineFinished || logger.info(`pullMsg -> time: ${inboxTime}`);
19845
+ logger.info(`pullMsg -> time: ${inboxTime}`);
19846
19846
  this.latestSyncTimestamp = Date.now();
19847
19847
  const {
19848
19848
  code,
19849
19849
  data
19850
19850
  } = await getNewMessages(inboxTime, 60);
19851
19851
  if (code !== exports.ErrorCode.SUCCESS) {
19852
- this.pullOfflineFinished || logger.warn('pullMsg failed -> code:', code);
19852
+ logger.warn('pullMsg failed -> code:', code);
19853
19853
  this.pullingMsg = false;
19854
19854
  this.try2RePullMsg();
19855
19855
  return;
@@ -19896,7 +19896,7 @@
19896
19896
  this.serverMsgSeqno = seqno;
19897
19897
  }
19898
19898
  const isFinished = this.serverMsgSeqno.lessThanOrEqual(offset);
19899
- this.pullOfflineFinished || logger.info(`pullMsg success -> syncTime: ${offset}, finished: ${isFinished}`);
19899
+ logger.info(`pullMsg success -> syncTime: ${offset}, finished: ${isFinished}`);
19900
19900
  this.letterbox?.setInboxOffset(offset);
19901
19901
  this.pullingMsg = false;
19902
19902
  if (isFinished && !this.pullOfflineFinished) {
@@ -20131,6 +20131,8 @@
20131
20131
  messageListener(cmdId, body) {
20132
20132
  if (cmdId === CmdIds$1.NewMessagePush) {
20133
20133
  console.log('messageListener: new message push');
20134
+ const newMsgNotiResp = NewMessageNotificationResp.decode(body);
20135
+ this.messageLoader?.syncMsg(newMsgNotiResp.seqno);
20134
20136
  } else if (cmdId === CmdIds$1.DialogChangedPush) {
20135
20137
  ConversationManager$1.get().syncConversationStatus();
20136
20138
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onyx-p/imlib-web",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.esm.js",
6
6
  "types": "types/index.d.ts",