sceyt-chat-react-uikit 1.7.2-beta.10 → 1.7.2-beta.11
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.js +61 -18
- package/index.modern.js +61 -18
- package/package.json +1 -1
- package/types/index.d.ts +2 -2
package/index.js
CHANGED
|
@@ -10688,6 +10688,34 @@ var messageSlice = createSlice({
|
|
|
10688
10688
|
}
|
|
10689
10689
|
state.messageMarkers[channelId][messageId][deliveryStatus] = [].concat(messageMarkers);
|
|
10690
10690
|
},
|
|
10691
|
+
updateMessagesMarkers: function updateMessagesMarkers(state, action) {
|
|
10692
|
+
var _marker$user;
|
|
10693
|
+
var _action$payload13 = action.payload,
|
|
10694
|
+
channelId = _action$payload13.channelId,
|
|
10695
|
+
deliveryStatus = _action$payload13.deliveryStatus,
|
|
10696
|
+
marker = _action$payload13.marker;
|
|
10697
|
+
var userId = (_marker$user = marker.user) === null || _marker$user === void 0 ? void 0 : _marker$user.id;
|
|
10698
|
+
var messageIds = marker.messageIds;
|
|
10699
|
+
for (var _iterator = _createForOfIteratorHelperLoose(messageIds), _step; !(_step = _iterator()).done;) {
|
|
10700
|
+
var messageId = _step.value;
|
|
10701
|
+
if (!state.messageMarkers[channelId]) {
|
|
10702
|
+
state.messageMarkers[channelId] = {};
|
|
10703
|
+
}
|
|
10704
|
+
if (!state.messageMarkers[channelId][messageId]) {
|
|
10705
|
+
state.messageMarkers[channelId][messageId] = {};
|
|
10706
|
+
}
|
|
10707
|
+
if (!state.messageMarkers[channelId][messageId][deliveryStatus]) {
|
|
10708
|
+
state.messageMarkers[channelId][messageId][deliveryStatus] = [];
|
|
10709
|
+
}
|
|
10710
|
+
var isUserMarkered = state.messageMarkers[channelId][messageId][deliveryStatus].some(function (marker) {
|
|
10711
|
+
var _marker$user2;
|
|
10712
|
+
return ((_marker$user2 = marker.user) === null || _marker$user2 === void 0 ? void 0 : _marker$user2.id) === userId;
|
|
10713
|
+
});
|
|
10714
|
+
if (!isUserMarkered) {
|
|
10715
|
+
state.messageMarkers[channelId][messageId][deliveryStatus].push(marker);
|
|
10716
|
+
}
|
|
10717
|
+
}
|
|
10718
|
+
},
|
|
10691
10719
|
setMessagesMarkersLoadingState: function setMessagesMarkersLoadingState(state, action) {
|
|
10692
10720
|
state.messagesMarkersLoadingState = action.payload.state;
|
|
10693
10721
|
}
|
|
@@ -10743,7 +10771,8 @@ var _messageSlice$actions = messageSlice.actions,
|
|
|
10743
10771
|
setOGMetadata = _messageSlice$actions.setOGMetadata,
|
|
10744
10772
|
updateOGMetadata = _messageSlice$actions.updateOGMetadata,
|
|
10745
10773
|
setMessageMarkers = _messageSlice$actions.setMessageMarkers,
|
|
10746
|
-
setMessagesMarkersLoadingState = _messageSlice$actions.setMessagesMarkersLoadingState
|
|
10774
|
+
setMessagesMarkersLoadingState = _messageSlice$actions.setMessagesMarkersLoadingState,
|
|
10775
|
+
updateMessagesMarkers = _messageSlice$actions.updateMessagesMarkers;
|
|
10747
10776
|
var MessageReducer = messageSlice.reducer;
|
|
10748
10777
|
|
|
10749
10778
|
var initialState$2 = {
|
|
@@ -11991,6 +12020,13 @@ function setMessageMarkersAC(channelId, messageId, messageMarkers, deliveryStatu
|
|
|
11991
12020
|
deliveryStatus: deliveryStatus
|
|
11992
12021
|
});
|
|
11993
12022
|
}
|
|
12023
|
+
function updateMessagesMarkersAC(channelId, deliveryStatus, marker) {
|
|
12024
|
+
return updateMessagesMarkers({
|
|
12025
|
+
channelId: channelId,
|
|
12026
|
+
deliveryStatus: deliveryStatus,
|
|
12027
|
+
marker: marker
|
|
12028
|
+
});
|
|
12029
|
+
}
|
|
11994
12030
|
function setMessagesMarkersLoadingStateAC(state) {
|
|
11995
12031
|
return setMessagesMarkersLoadingState({
|
|
11996
12032
|
state: state
|
|
@@ -14270,6 +14306,8 @@ function watchForEvents() {
|
|
|
14270
14306
|
name: markerList.name,
|
|
14271
14307
|
markersMap: markersMap
|
|
14272
14308
|
});
|
|
14309
|
+
_context.n = 71;
|
|
14310
|
+
return effects.put(updateMessagesMarkersAC(channelId, markerList.name, markerList));
|
|
14273
14311
|
case 71:
|
|
14274
14312
|
return _context.a(3, 142);
|
|
14275
14313
|
case 72:
|
|
@@ -15723,7 +15761,7 @@ function markMessagesRead(action) {
|
|
|
15723
15761
|
deliveryStatus: MESSAGE_DELIVERY_STATUS.READ,
|
|
15724
15762
|
userMarkers: [{
|
|
15725
15763
|
user: messageListMarker.user,
|
|
15726
|
-
createdAt: messageListMarker.
|
|
15764
|
+
createdAt: messageListMarker.createdAt,
|
|
15727
15765
|
messageId: messageId,
|
|
15728
15766
|
name: MESSAGE_DELIVERY_STATUS.READ
|
|
15729
15767
|
}]
|
|
@@ -17316,7 +17354,7 @@ var handleUploadAttachments = function handleUploadAttachments(attachments, mess
|
|
|
17316
17354
|
}, thumbnailMetas.duration ? {
|
|
17317
17355
|
dur: thumbnailMetas.duration
|
|
17318
17356
|
} : {})));
|
|
17319
|
-
var attachmentBuilder = channel.
|
|
17357
|
+
var attachmentBuilder = channel.createdAttachmentBuilder(uri, attachment.type);
|
|
17320
17358
|
var attachmentToSend = attachmentBuilder.setName(attachment.name).setMetadata(attachmentMeta).setFileSize(fileSize || attachment.size).setUpload(false).create();
|
|
17321
17359
|
return attachmentToSend;
|
|
17322
17360
|
}
|
|
@@ -17476,7 +17514,7 @@ function sendMessage(action) {
|
|
|
17476
17514
|
if (attachment.cachedUrl) {
|
|
17477
17515
|
uri = attachment.cachedUrl;
|
|
17478
17516
|
}
|
|
17479
|
-
attachmentBuilder = channel.
|
|
17517
|
+
attachmentBuilder = channel.createdAttachmentBuilder(uri || attachment.data, attachment.type);
|
|
17480
17518
|
messageAttachment = attachmentBuilder.setName(attachment.name).setMetadata(attachment.metadata).setUpload(customUploader ? false : attachment.upload).setFileSize(attachment.size).create();
|
|
17481
17519
|
if (!customUploader) {
|
|
17482
17520
|
handleUpdateUploadProgress = function handleUpdateUploadProgress(percent) {
|
|
@@ -17624,7 +17662,7 @@ function sendMessage(action) {
|
|
|
17624
17662
|
case 3:
|
|
17625
17663
|
linkAttachmentToSend = null;
|
|
17626
17664
|
if (_i === 0 && linkAttachment) {
|
|
17627
|
-
linkAttachmentBuilder = channel.
|
|
17665
|
+
linkAttachmentBuilder = channel.createdAttachmentBuilder(linkAttachment.data, linkAttachment.type);
|
|
17628
17666
|
linkAttachmentToSend = linkAttachmentBuilder.setName(linkAttachment.name).setUpload(linkAttachment.upload).create();
|
|
17629
17667
|
}
|
|
17630
17668
|
if (linkAttachmentToSend) {
|
|
@@ -17832,7 +17870,7 @@ function sendTextMessage(action) {
|
|
|
17832
17870
|
}) : [];
|
|
17833
17871
|
attachments = message.attachments;
|
|
17834
17872
|
if (message.attachments && message.attachments.length) {
|
|
17835
|
-
attachmentBuilder = channel.
|
|
17873
|
+
attachmentBuilder = channel.createdAttachmentBuilder(attachments[0].data, attachments[0].type);
|
|
17836
17874
|
att = attachmentBuilder.setName('').setUpload(attachments[0].upload).create();
|
|
17837
17875
|
attachments = [att];
|
|
17838
17876
|
}
|
|
@@ -18014,7 +18052,7 @@ function forwardMessage(action) {
|
|
|
18014
18052
|
break;
|
|
18015
18053
|
}
|
|
18016
18054
|
if (message.attachments && message.attachments.length) {
|
|
18017
|
-
attachmentBuilder = channel.
|
|
18055
|
+
attachmentBuilder = channel.createdAttachmentBuilder(attachments[0].url, attachments[0].type);
|
|
18018
18056
|
att = attachmentBuilder.setName(attachments[0].name).setMetadata(attachments[0].metadata).setFileSize(attachments[0].size).setUpload(false).create();
|
|
18019
18057
|
attachments = [att];
|
|
18020
18058
|
}
|
|
@@ -18300,7 +18338,7 @@ function resendMessage(action) {
|
|
|
18300
18338
|
} : {})));
|
|
18301
18339
|
}
|
|
18302
18340
|
log.info('attachmentMeta ... ', attachmentMeta);
|
|
18303
|
-
attachmentBuilder = channel.
|
|
18341
|
+
attachmentBuilder = channel.createdAttachmentBuilder(uri, messageAttachment.type);
|
|
18304
18342
|
attachmentToSend = attachmentBuilder.setName(messageAttachment.name).setMetadata(attachmentMeta).setFileSize(fileSize).setUpload(false).create();
|
|
18305
18343
|
log.info('attachmentToSend ... ', attachmentToSend);
|
|
18306
18344
|
attachmentToSend.tid = messageAttachment.tid;
|
|
@@ -18559,7 +18597,7 @@ function editMessage(action) {
|
|
|
18559
18597
|
});
|
|
18560
18598
|
linkAttachmentsToSend = [];
|
|
18561
18599
|
linkAttachments.forEach(function (linkAttachment) {
|
|
18562
|
-
var linkAttachmentBuilder = channel.
|
|
18600
|
+
var linkAttachmentBuilder = channel.createdAttachmentBuilder(linkAttachment.data, linkAttachment.type);
|
|
18563
18601
|
var linkAttachmentToSend = linkAttachmentBuilder.setName(linkAttachment.name).setUpload(linkAttachment.upload).create();
|
|
18564
18602
|
linkAttachmentsToSend.push(linkAttachmentToSend);
|
|
18565
18603
|
});
|
|
@@ -19537,7 +19575,6 @@ function getMessageMarkers(action) {
|
|
|
19537
19575
|
return effects.call(messageMarkerListQuery.loadNext);
|
|
19538
19576
|
case 3:
|
|
19539
19577
|
messageMarkers = _context18.v;
|
|
19540
|
-
console.log('messageMarkers', messageMarkers);
|
|
19541
19578
|
_context18.n = 4;
|
|
19542
19579
|
return effects.put(setMessageMarkersAC(channelId, messageId, messageMarkers.markers, deliveryStatus));
|
|
19543
19580
|
case 4:
|
|
@@ -32390,7 +32427,8 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32390
32427
|
tabsStyles = _ref$tabsStyles === void 0 ? {} : _ref$tabsStyles,
|
|
32391
32428
|
_ref$listItemStyles = _ref.listItemStyles,
|
|
32392
32429
|
listItemStyles = _ref$listItemStyles === void 0 ? {} : _ref$listItemStyles,
|
|
32393
|
-
handleOpenUserProfile = _ref.handleOpenUserProfile
|
|
32430
|
+
handleOpenUserProfile = _ref.handleOpenUserProfile,
|
|
32431
|
+
contacts = _ref.contacts;
|
|
32394
32432
|
var _useColor = useColors(),
|
|
32395
32433
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
32396
32434
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -32431,6 +32469,9 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32431
32469
|
var _useState7 = React.useState(false),
|
|
32432
32470
|
flipLocked = _useState7[0],
|
|
32433
32471
|
setFlipLocked = _useState7[1];
|
|
32472
|
+
var getFromContacts = React.useMemo(function () {
|
|
32473
|
+
return getShowOnlyContactUsers();
|
|
32474
|
+
}, []);
|
|
32434
32475
|
var activeMarkers = React.useMemo(function () {
|
|
32435
32476
|
var list = markers && markers[activeTab] || [];
|
|
32436
32477
|
return Array.isArray(list) ? [].concat(list).sort(sortByDateDesc) : [];
|
|
@@ -32465,9 +32506,11 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32465
32506
|
}
|
|
32466
32507
|
});
|
|
32467
32508
|
var renderRow = function renderRow(marker) {
|
|
32468
|
-
var
|
|
32509
|
+
var _marker$user;
|
|
32510
|
+
var contact = contacts[((_marker$user = marker.user) === null || _marker$user === void 0 ? void 0 : _marker$user.id) || ''];
|
|
32511
|
+
var displayName = makeUsername(contact, marker.user, getFromContacts);
|
|
32469
32512
|
var avatarUrl = marker.user ? marker.user.avatarUrl : '';
|
|
32470
|
-
var dateVal = marker.createdAt || marker.
|
|
32513
|
+
var dateVal = marker.createdAt || marker.createdAt;
|
|
32471
32514
|
var dateFormat = dateVal ? formatDate(new Date(dateVal)) : '';
|
|
32472
32515
|
var node = /*#__PURE__*/React__default.createElement(Row$1, {
|
|
32473
32516
|
backgroundHover: listItemStyles.hoverBackground || backgroundHovered,
|
|
@@ -32694,17 +32737,17 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32694
32737
|
ref: listRef,
|
|
32695
32738
|
maxHeight: listMaxHeightPx
|
|
32696
32739
|
}, activeMarkers.map(function (marker) {
|
|
32697
|
-
var _marker$
|
|
32740
|
+
var _marker$user2;
|
|
32698
32741
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
32699
|
-
key: (((_marker$
|
|
32742
|
+
key: (((_marker$user2 = marker.user) === null || _marker$user2 === void 0 ? void 0 : _marker$user2.id) || 'deleted') + "-" + (marker.createdAt || '')
|
|
32700
32743
|
}, renderRow(marker));
|
|
32701
32744
|
}), !activeMarkers.length && messagesMarkersLoadingState !== LOADING_STATE.LOADING && (/*#__PURE__*/React__default.createElement(Empty, {
|
|
32702
32745
|
color: textSecondary
|
|
32703
32746
|
}, "No results"))))));
|
|
32704
32747
|
};
|
|
32705
32748
|
function sortByDateDesc(a, b) {
|
|
32706
|
-
var aDate = a.createdAt || a.
|
|
32707
|
-
var bDate = b.createdAt || b.
|
|
32749
|
+
var aDate = a.createdAt || a.createdAt;
|
|
32750
|
+
var bDate = b.createdAt || b.createdAt;
|
|
32708
32751
|
var aTime = aDate ? new Date(aDate).getTime() : 0;
|
|
32709
32752
|
var bTime = bDate ? new Date(bDate).getTime() : 0;
|
|
32710
32753
|
return bTime - aTime;
|
|
@@ -32998,7 +33041,6 @@ var Message$1 = function Message(_ref) {
|
|
|
32998
33041
|
setInfoPopupOpen(!infoPopupOpen);
|
|
32999
33042
|
setMessageActionsShow(false);
|
|
33000
33043
|
};
|
|
33001
|
-
console.log('infoPopupOpen', infoPopupOpen);
|
|
33002
33044
|
var handleReplyMessage = function handleReplyMessage(threadReply) {
|
|
33003
33045
|
if (threadReply) ; else {
|
|
33004
33046
|
dispatch(setMessageForReplyAC(message));
|
|
@@ -33491,6 +33533,7 @@ var Message$1 = function Message(_ref) {
|
|
|
33491
33533
|
message: message,
|
|
33492
33534
|
togglePopup: handleToggleInfoMessagePopupOpen
|
|
33493
33535
|
}, showInfoMessageProps, {
|
|
33536
|
+
contacts: contactsMap,
|
|
33494
33537
|
handleOpenUserProfile: handleOpenUserProfile
|
|
33495
33538
|
}))));
|
|
33496
33539
|
};
|
package/index.modern.js
CHANGED
|
@@ -10686,6 +10686,34 @@ var messageSlice = createSlice({
|
|
|
10686
10686
|
}
|
|
10687
10687
|
state.messageMarkers[channelId][messageId][deliveryStatus] = [].concat(messageMarkers);
|
|
10688
10688
|
},
|
|
10689
|
+
updateMessagesMarkers: function updateMessagesMarkers(state, action) {
|
|
10690
|
+
var _marker$user;
|
|
10691
|
+
var _action$payload13 = action.payload,
|
|
10692
|
+
channelId = _action$payload13.channelId,
|
|
10693
|
+
deliveryStatus = _action$payload13.deliveryStatus,
|
|
10694
|
+
marker = _action$payload13.marker;
|
|
10695
|
+
var userId = (_marker$user = marker.user) === null || _marker$user === void 0 ? void 0 : _marker$user.id;
|
|
10696
|
+
var messageIds = marker.messageIds;
|
|
10697
|
+
for (var _iterator = _createForOfIteratorHelperLoose(messageIds), _step; !(_step = _iterator()).done;) {
|
|
10698
|
+
var messageId = _step.value;
|
|
10699
|
+
if (!state.messageMarkers[channelId]) {
|
|
10700
|
+
state.messageMarkers[channelId] = {};
|
|
10701
|
+
}
|
|
10702
|
+
if (!state.messageMarkers[channelId][messageId]) {
|
|
10703
|
+
state.messageMarkers[channelId][messageId] = {};
|
|
10704
|
+
}
|
|
10705
|
+
if (!state.messageMarkers[channelId][messageId][deliveryStatus]) {
|
|
10706
|
+
state.messageMarkers[channelId][messageId][deliveryStatus] = [];
|
|
10707
|
+
}
|
|
10708
|
+
var isUserMarkered = state.messageMarkers[channelId][messageId][deliveryStatus].some(function (marker) {
|
|
10709
|
+
var _marker$user2;
|
|
10710
|
+
return ((_marker$user2 = marker.user) === null || _marker$user2 === void 0 ? void 0 : _marker$user2.id) === userId;
|
|
10711
|
+
});
|
|
10712
|
+
if (!isUserMarkered) {
|
|
10713
|
+
state.messageMarkers[channelId][messageId][deliveryStatus].push(marker);
|
|
10714
|
+
}
|
|
10715
|
+
}
|
|
10716
|
+
},
|
|
10689
10717
|
setMessagesMarkersLoadingState: function setMessagesMarkersLoadingState(state, action) {
|
|
10690
10718
|
state.messagesMarkersLoadingState = action.payload.state;
|
|
10691
10719
|
}
|
|
@@ -10741,7 +10769,8 @@ var _messageSlice$actions = messageSlice.actions,
|
|
|
10741
10769
|
setOGMetadata = _messageSlice$actions.setOGMetadata,
|
|
10742
10770
|
updateOGMetadata = _messageSlice$actions.updateOGMetadata,
|
|
10743
10771
|
setMessageMarkers = _messageSlice$actions.setMessageMarkers,
|
|
10744
|
-
setMessagesMarkersLoadingState = _messageSlice$actions.setMessagesMarkersLoadingState
|
|
10772
|
+
setMessagesMarkersLoadingState = _messageSlice$actions.setMessagesMarkersLoadingState,
|
|
10773
|
+
updateMessagesMarkers = _messageSlice$actions.updateMessagesMarkers;
|
|
10745
10774
|
var MessageReducer = messageSlice.reducer;
|
|
10746
10775
|
|
|
10747
10776
|
var initialState$2 = {
|
|
@@ -11989,6 +12018,13 @@ function setMessageMarkersAC(channelId, messageId, messageMarkers, deliveryStatu
|
|
|
11989
12018
|
deliveryStatus: deliveryStatus
|
|
11990
12019
|
});
|
|
11991
12020
|
}
|
|
12021
|
+
function updateMessagesMarkersAC(channelId, deliveryStatus, marker) {
|
|
12022
|
+
return updateMessagesMarkers({
|
|
12023
|
+
channelId: channelId,
|
|
12024
|
+
deliveryStatus: deliveryStatus,
|
|
12025
|
+
marker: marker
|
|
12026
|
+
});
|
|
12027
|
+
}
|
|
11992
12028
|
function setMessagesMarkersLoadingStateAC(state) {
|
|
11993
12029
|
return setMessagesMarkersLoadingState({
|
|
11994
12030
|
state: state
|
|
@@ -14268,6 +14304,8 @@ function watchForEvents() {
|
|
|
14268
14304
|
name: markerList.name,
|
|
14269
14305
|
markersMap: markersMap
|
|
14270
14306
|
});
|
|
14307
|
+
_context.n = 71;
|
|
14308
|
+
return put(updateMessagesMarkersAC(channelId, markerList.name, markerList));
|
|
14271
14309
|
case 71:
|
|
14272
14310
|
return _context.a(3, 142);
|
|
14273
14311
|
case 72:
|
|
@@ -15721,7 +15759,7 @@ function markMessagesRead(action) {
|
|
|
15721
15759
|
deliveryStatus: MESSAGE_DELIVERY_STATUS.READ,
|
|
15722
15760
|
userMarkers: [{
|
|
15723
15761
|
user: messageListMarker.user,
|
|
15724
|
-
createdAt: messageListMarker.
|
|
15762
|
+
createdAt: messageListMarker.createdAt,
|
|
15725
15763
|
messageId: messageId,
|
|
15726
15764
|
name: MESSAGE_DELIVERY_STATUS.READ
|
|
15727
15765
|
}]
|
|
@@ -17314,7 +17352,7 @@ var handleUploadAttachments = function handleUploadAttachments(attachments, mess
|
|
|
17314
17352
|
}, thumbnailMetas.duration ? {
|
|
17315
17353
|
dur: thumbnailMetas.duration
|
|
17316
17354
|
} : {})));
|
|
17317
|
-
var attachmentBuilder = channel.
|
|
17355
|
+
var attachmentBuilder = channel.createdAttachmentBuilder(uri, attachment.type);
|
|
17318
17356
|
var attachmentToSend = attachmentBuilder.setName(attachment.name).setMetadata(attachmentMeta).setFileSize(fileSize || attachment.size).setUpload(false).create();
|
|
17319
17357
|
return attachmentToSend;
|
|
17320
17358
|
}
|
|
@@ -17474,7 +17512,7 @@ function sendMessage(action) {
|
|
|
17474
17512
|
if (attachment.cachedUrl) {
|
|
17475
17513
|
uri = attachment.cachedUrl;
|
|
17476
17514
|
}
|
|
17477
|
-
attachmentBuilder = channel.
|
|
17515
|
+
attachmentBuilder = channel.createdAttachmentBuilder(uri || attachment.data, attachment.type);
|
|
17478
17516
|
messageAttachment = attachmentBuilder.setName(attachment.name).setMetadata(attachment.metadata).setUpload(customUploader ? false : attachment.upload).setFileSize(attachment.size).create();
|
|
17479
17517
|
if (!customUploader) {
|
|
17480
17518
|
handleUpdateUploadProgress = function handleUpdateUploadProgress(percent) {
|
|
@@ -17622,7 +17660,7 @@ function sendMessage(action) {
|
|
|
17622
17660
|
case 3:
|
|
17623
17661
|
linkAttachmentToSend = null;
|
|
17624
17662
|
if (_i === 0 && linkAttachment) {
|
|
17625
|
-
linkAttachmentBuilder = channel.
|
|
17663
|
+
linkAttachmentBuilder = channel.createdAttachmentBuilder(linkAttachment.data, linkAttachment.type);
|
|
17626
17664
|
linkAttachmentToSend = linkAttachmentBuilder.setName(linkAttachment.name).setUpload(linkAttachment.upload).create();
|
|
17627
17665
|
}
|
|
17628
17666
|
if (linkAttachmentToSend) {
|
|
@@ -17830,7 +17868,7 @@ function sendTextMessage(action) {
|
|
|
17830
17868
|
}) : [];
|
|
17831
17869
|
attachments = message.attachments;
|
|
17832
17870
|
if (message.attachments && message.attachments.length) {
|
|
17833
|
-
attachmentBuilder = channel.
|
|
17871
|
+
attachmentBuilder = channel.createdAttachmentBuilder(attachments[0].data, attachments[0].type);
|
|
17834
17872
|
att = attachmentBuilder.setName('').setUpload(attachments[0].upload).create();
|
|
17835
17873
|
attachments = [att];
|
|
17836
17874
|
}
|
|
@@ -18012,7 +18050,7 @@ function forwardMessage(action) {
|
|
|
18012
18050
|
break;
|
|
18013
18051
|
}
|
|
18014
18052
|
if (message.attachments && message.attachments.length) {
|
|
18015
|
-
attachmentBuilder = channel.
|
|
18053
|
+
attachmentBuilder = channel.createdAttachmentBuilder(attachments[0].url, attachments[0].type);
|
|
18016
18054
|
att = attachmentBuilder.setName(attachments[0].name).setMetadata(attachments[0].metadata).setFileSize(attachments[0].size).setUpload(false).create();
|
|
18017
18055
|
attachments = [att];
|
|
18018
18056
|
}
|
|
@@ -18298,7 +18336,7 @@ function resendMessage(action) {
|
|
|
18298
18336
|
} : {})));
|
|
18299
18337
|
}
|
|
18300
18338
|
log.info('attachmentMeta ... ', attachmentMeta);
|
|
18301
|
-
attachmentBuilder = channel.
|
|
18339
|
+
attachmentBuilder = channel.createdAttachmentBuilder(uri, messageAttachment.type);
|
|
18302
18340
|
attachmentToSend = attachmentBuilder.setName(messageAttachment.name).setMetadata(attachmentMeta).setFileSize(fileSize).setUpload(false).create();
|
|
18303
18341
|
log.info('attachmentToSend ... ', attachmentToSend);
|
|
18304
18342
|
attachmentToSend.tid = messageAttachment.tid;
|
|
@@ -18557,7 +18595,7 @@ function editMessage(action) {
|
|
|
18557
18595
|
});
|
|
18558
18596
|
linkAttachmentsToSend = [];
|
|
18559
18597
|
linkAttachments.forEach(function (linkAttachment) {
|
|
18560
|
-
var linkAttachmentBuilder = channel.
|
|
18598
|
+
var linkAttachmentBuilder = channel.createdAttachmentBuilder(linkAttachment.data, linkAttachment.type);
|
|
18561
18599
|
var linkAttachmentToSend = linkAttachmentBuilder.setName(linkAttachment.name).setUpload(linkAttachment.upload).create();
|
|
18562
18600
|
linkAttachmentsToSend.push(linkAttachmentToSend);
|
|
18563
18601
|
});
|
|
@@ -19535,7 +19573,6 @@ function getMessageMarkers(action) {
|
|
|
19535
19573
|
return call(messageMarkerListQuery.loadNext);
|
|
19536
19574
|
case 3:
|
|
19537
19575
|
messageMarkers = _context18.v;
|
|
19538
|
-
console.log('messageMarkers', messageMarkers);
|
|
19539
19576
|
_context18.n = 4;
|
|
19540
19577
|
return put(setMessageMarkersAC(channelId, messageId, messageMarkers.markers, deliveryStatus));
|
|
19541
19578
|
case 4:
|
|
@@ -32388,7 +32425,8 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32388
32425
|
tabsStyles = _ref$tabsStyles === void 0 ? {} : _ref$tabsStyles,
|
|
32389
32426
|
_ref$listItemStyles = _ref.listItemStyles,
|
|
32390
32427
|
listItemStyles = _ref$listItemStyles === void 0 ? {} : _ref$listItemStyles,
|
|
32391
|
-
handleOpenUserProfile = _ref.handleOpenUserProfile
|
|
32428
|
+
handleOpenUserProfile = _ref.handleOpenUserProfile,
|
|
32429
|
+
contacts = _ref.contacts;
|
|
32392
32430
|
var _useColor = useColors(),
|
|
32393
32431
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
32394
32432
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -32429,6 +32467,9 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32429
32467
|
var _useState7 = useState(false),
|
|
32430
32468
|
flipLocked = _useState7[0],
|
|
32431
32469
|
setFlipLocked = _useState7[1];
|
|
32470
|
+
var getFromContacts = useMemo(function () {
|
|
32471
|
+
return getShowOnlyContactUsers();
|
|
32472
|
+
}, []);
|
|
32432
32473
|
var activeMarkers = useMemo(function () {
|
|
32433
32474
|
var list = markers && markers[activeTab] || [];
|
|
32434
32475
|
return Array.isArray(list) ? [].concat(list).sort(sortByDateDesc) : [];
|
|
@@ -32463,9 +32504,11 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32463
32504
|
}
|
|
32464
32505
|
});
|
|
32465
32506
|
var renderRow = function renderRow(marker) {
|
|
32466
|
-
var
|
|
32507
|
+
var _marker$user;
|
|
32508
|
+
var contact = contacts[((_marker$user = marker.user) === null || _marker$user === void 0 ? void 0 : _marker$user.id) || ''];
|
|
32509
|
+
var displayName = makeUsername(contact, marker.user, getFromContacts);
|
|
32467
32510
|
var avatarUrl = marker.user ? marker.user.avatarUrl : '';
|
|
32468
|
-
var dateVal = marker.createdAt || marker.
|
|
32511
|
+
var dateVal = marker.createdAt || marker.createdAt;
|
|
32469
32512
|
var dateFormat = dateVal ? formatDate(new Date(dateVal)) : '';
|
|
32470
32513
|
var node = /*#__PURE__*/React__default.createElement(Row$1, {
|
|
32471
32514
|
backgroundHover: listItemStyles.hoverBackground || backgroundHovered,
|
|
@@ -32692,17 +32735,17 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32692
32735
|
ref: listRef,
|
|
32693
32736
|
maxHeight: listMaxHeightPx
|
|
32694
32737
|
}, activeMarkers.map(function (marker) {
|
|
32695
|
-
var _marker$
|
|
32738
|
+
var _marker$user2;
|
|
32696
32739
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
32697
|
-
key: (((_marker$
|
|
32740
|
+
key: (((_marker$user2 = marker.user) === null || _marker$user2 === void 0 ? void 0 : _marker$user2.id) || 'deleted') + "-" + (marker.createdAt || '')
|
|
32698
32741
|
}, renderRow(marker));
|
|
32699
32742
|
}), !activeMarkers.length && messagesMarkersLoadingState !== LOADING_STATE.LOADING && (/*#__PURE__*/React__default.createElement(Empty, {
|
|
32700
32743
|
color: textSecondary
|
|
32701
32744
|
}, "No results"))))));
|
|
32702
32745
|
};
|
|
32703
32746
|
function sortByDateDesc(a, b) {
|
|
32704
|
-
var aDate = a.createdAt || a.
|
|
32705
|
-
var bDate = b.createdAt || b.
|
|
32747
|
+
var aDate = a.createdAt || a.createdAt;
|
|
32748
|
+
var bDate = b.createdAt || b.createdAt;
|
|
32706
32749
|
var aTime = aDate ? new Date(aDate).getTime() : 0;
|
|
32707
32750
|
var bTime = bDate ? new Date(bDate).getTime() : 0;
|
|
32708
32751
|
return bTime - aTime;
|
|
@@ -32996,7 +33039,6 @@ var Message$1 = function Message(_ref) {
|
|
|
32996
33039
|
setInfoPopupOpen(!infoPopupOpen);
|
|
32997
33040
|
setMessageActionsShow(false);
|
|
32998
33041
|
};
|
|
32999
|
-
console.log('infoPopupOpen', infoPopupOpen);
|
|
33000
33042
|
var handleReplyMessage = function handleReplyMessage(threadReply) {
|
|
33001
33043
|
if (threadReply) ; else {
|
|
33002
33044
|
dispatch(setMessageForReplyAC(message));
|
|
@@ -33489,6 +33531,7 @@ var Message$1 = function Message(_ref) {
|
|
|
33489
33531
|
message: message,
|
|
33490
33532
|
togglePopup: handleToggleInfoMessagePopupOpen
|
|
33491
33533
|
}, showInfoMessageProps, {
|
|
33534
|
+
contacts: contactsMap,
|
|
33492
33535
|
handleOpenUserProfile: handleOpenUserProfile
|
|
33493
33536
|
}))));
|
|
33494
33537
|
};
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -188,7 +188,7 @@ export interface IChannel {
|
|
|
188
188
|
reaction: any;
|
|
189
189
|
}>;
|
|
190
190
|
createMessageBuilder: () => any;
|
|
191
|
-
|
|
191
|
+
createdAttachmentBuilder: (url: string, type: string) => AttachmentBuilder;
|
|
192
192
|
createThread: (messageId: string) => IChannel;
|
|
193
193
|
getMessagesById: (messageIds: string[]) => Promise<IMessage[]>;
|
|
194
194
|
}
|
|
@@ -200,7 +200,7 @@ export interface IMarker {
|
|
|
200
200
|
messageIds: string[];
|
|
201
201
|
user: IUser | null;
|
|
202
202
|
name: string;
|
|
203
|
-
|
|
203
|
+
createdAt: Date;
|
|
204
204
|
}
|
|
205
205
|
export interface IRole {
|
|
206
206
|
name: string;
|