@azure/communication-react 1.3.3-alpha-202209020015.0 → 1.3.3-alpha-202209030014.0

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.
@@ -192,7 +192,7 @@ const fromFlatCommunicationIdentifier = (id) => {
192
192
  // Copyright (c) Microsoft Corporation.
193
193
  // Licensed under the MIT license.
194
194
  // GENERATED FILE. DO NOT EDIT MANUALLY.
195
- var telemetryVersion = '1.3.3-alpha-202209020015.0';
195
+ var telemetryVersion = '1.3.3-alpha-202209030014.0';
196
196
 
197
197
  // Copyright (c) Microsoft Corporation.
198
198
  /**
@@ -8757,6 +8757,10 @@ const MINIMUM_TYPING_INTERVAL_IN_MILLISECONDS = 8000;
8757
8757
  * @private
8758
8758
  */
8759
8759
  const PARTICIPANTS_THRESHOLD = 20;
8760
+ /**
8761
+ * @private
8762
+ */
8763
+ const MINUTE_IN_MS = 1000 * 60;
8760
8764
  /**
8761
8765
  * @private
8762
8766
  *
@@ -8800,6 +8804,7 @@ const compareMessages = (firstMessage, secondMessage) => {
8800
8804
  const updateMessagesWithAttached = (chatMessagesWithStatus) => {
8801
8805
  chatMessagesWithStatus.sort(compareMessages);
8802
8806
  chatMessagesWithStatus.forEach((message, index, messages) => {
8807
+ var _a, _b;
8803
8808
  if (message.messageType !== 'chat') {
8804
8809
  return;
8805
8810
  }
@@ -8814,9 +8819,15 @@ const updateMessagesWithAttached = (chatMessagesWithStatus) => {
8814
8819
  const nextMessage = index === messages.length - 1 ? undefined : messages[index + 1];
8815
8820
  const previousSenderId = (previousMessage === null || previousMessage === void 0 ? void 0 : previousMessage.messageType) === 'chat' ? previousMessage.senderId : undefined;
8816
8821
  const nextSenderId = (nextMessage === null || nextMessage === void 0 ? void 0 : nextMessage.messageType) === 'chat' ? nextMessage.senderId : undefined;
8822
+ const timediff = new Date((_a = message === null || message === void 0 ? void 0 : message.createdOn) !== null && _a !== void 0 ? _a : '').getTime() - new Date((_b = previousMessage === null || previousMessage === void 0 ? void 0 : previousMessage.createdOn) !== null && _b !== void 0 ? _b : '').getTime();
8823
+ const diffMins = Math.round(timediff / MINUTE_IN_MS); // minutes
8817
8824
  if (previousSenderId !== message.senderId) {
8818
8825
  attached = message.senderId === nextSenderId ? 'top' : false;
8819
8826
  }
8827
+ else if (diffMins && diffMins >= 5) {
8828
+ // if there are more than or equal to 5 mins time gap between messages do not attach and show time stamp
8829
+ attached = false;
8830
+ }
8820
8831
  else {
8821
8832
  attached = message.senderId === nextSenderId ? true : 'bottom';
8822
8833
  }
@@ -19231,6 +19242,7 @@ const CallWithChatScreen = (props) => {
19231
19242
  setCurrentPage(newState.page);
19232
19243
  setCurrentCallState((_a = newState.call) === null || _a === void 0 ? void 0 : _a.state);
19233
19244
  };
19245
+ updateCallWithChatPage(callWithChatAdapter.getState());
19234
19246
  callWithChatAdapter.onStateChange(updateCallWithChatPage);
19235
19247
  return () => {
19236
19248
  callWithChatAdapter.offStateChange(updateCallWithChatPage);