sceyt-chat-react-uikit 1.7.5 → 1.7.6-beta.10
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/components/Message/OGMetadata/index.d.ts +2 -2
- package/index.js +899 -722
- package/index.modern.js +899 -722
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -8956,7 +8956,7 @@ var EditorTheme = {
|
|
|
8956
8956
|
}
|
|
8957
8957
|
};
|
|
8958
8958
|
var isMessageUnsupported = function isMessageUnsupported(message) {
|
|
8959
|
-
return (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.TEXT && (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.MEDIA && (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.FILE && (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.LINK && (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.POLL && (message === null || message === void 0 ? void 0 : message.type)
|
|
8959
|
+
return (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.TEXT && (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.MEDIA && (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.FILE && (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.LINK && (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.POLL && !((message === null || message === void 0 ? void 0 : message.type) === exports.MESSAGE_TYPE.DELETED && message.state === MESSAGE_STATUS.DELETE) && (message === null || message === void 0 ? void 0 : message.type) !== exports.MESSAGE_TYPE.SYSTEM;
|
|
8960
8960
|
};
|
|
8961
8961
|
var deleteVoteFromPollDetails = function deleteVoteFromPollDetails(votes, deletedVote) {
|
|
8962
8962
|
var newVotes = [];
|
|
@@ -9102,15 +9102,6 @@ var query = {
|
|
|
9102
9102
|
ReactionsQuery: null,
|
|
9103
9103
|
PollVotesQueries: {}
|
|
9104
9104
|
};
|
|
9105
|
-
var unreadScrollTo = {
|
|
9106
|
-
isScrolled: true
|
|
9107
|
-
};
|
|
9108
|
-
function getUnreadScrollTo() {
|
|
9109
|
-
return unreadScrollTo.isScrolled;
|
|
9110
|
-
}
|
|
9111
|
-
function setUnreadScrollTo(state) {
|
|
9112
|
-
unreadScrollTo.isScrolled = state;
|
|
9113
|
-
}
|
|
9114
9105
|
function getUploadImageIcon() {
|
|
9115
9106
|
return UploadImageIcon;
|
|
9116
9107
|
}
|
|
@@ -10315,6 +10306,11 @@ function showScrollToNewMessageButtonAC(state) {
|
|
|
10315
10306
|
state: state
|
|
10316
10307
|
});
|
|
10317
10308
|
}
|
|
10309
|
+
function setUnreadScrollToAC(state) {
|
|
10310
|
+
return setUnreadScrollTo({
|
|
10311
|
+
state: state
|
|
10312
|
+
});
|
|
10313
|
+
}
|
|
10318
10314
|
function loadMoreMessagesAC(channelId, limit, direction, messageId, hasNext) {
|
|
10319
10315
|
return {
|
|
10320
10316
|
type: LOAD_MORE_MESSAGES,
|
|
@@ -10647,6 +10643,51 @@ var MESSAGE_LOAD_DIRECTION = {
|
|
|
10647
10643
|
PREV: 'prev',
|
|
10648
10644
|
NEXT: 'next'
|
|
10649
10645
|
};
|
|
10646
|
+
var shouldSkipDeliveryStatusUpdate = function shouldSkipDeliveryStatusUpdate(markerName, currentDeliveryStatus) {
|
|
10647
|
+
if (markerName === MESSAGE_DELIVERY_STATUS.SENT && (currentDeliveryStatus === MESSAGE_DELIVERY_STATUS.SENT || currentDeliveryStatus === MESSAGE_DELIVERY_STATUS.DELIVERED || currentDeliveryStatus === MESSAGE_DELIVERY_STATUS.READ || currentDeliveryStatus === MESSAGE_DELIVERY_STATUS.PLAYED)) {
|
|
10648
|
+
return true;
|
|
10649
|
+
}
|
|
10650
|
+
if (markerName === MESSAGE_DELIVERY_STATUS.DELIVERED && (currentDeliveryStatus === MESSAGE_DELIVERY_STATUS.DELIVERED || currentDeliveryStatus === MESSAGE_DELIVERY_STATUS.READ || currentDeliveryStatus === MESSAGE_DELIVERY_STATUS.PLAYED)) {
|
|
10651
|
+
return true;
|
|
10652
|
+
}
|
|
10653
|
+
if (markerName === MESSAGE_DELIVERY_STATUS.READ && (currentDeliveryStatus === MESSAGE_DELIVERY_STATUS.READ || currentDeliveryStatus === MESSAGE_DELIVERY_STATUS.PLAYED)) {
|
|
10654
|
+
return true;
|
|
10655
|
+
}
|
|
10656
|
+
if (markerName === MESSAGE_DELIVERY_STATUS.PLAYED && currentDeliveryStatus === MESSAGE_DELIVERY_STATUS.PLAYED) {
|
|
10657
|
+
return true;
|
|
10658
|
+
}
|
|
10659
|
+
return false;
|
|
10660
|
+
};
|
|
10661
|
+
var updateMessageDeliveryStatusAndMarkers = function updateMessageDeliveryStatusAndMarkers(message, markerName) {
|
|
10662
|
+
var _message$markerTotals;
|
|
10663
|
+
if (shouldSkipDeliveryStatusUpdate(markerName, message.deliveryStatus)) {
|
|
10664
|
+
return {
|
|
10665
|
+
markerTotals: message.markerTotals,
|
|
10666
|
+
deliveryStatus: message.deliveryStatus
|
|
10667
|
+
};
|
|
10668
|
+
}
|
|
10669
|
+
var markerInMarkersTotal = message === null || message === void 0 ? void 0 : (_message$markerTotals = message.markerTotals) === null || _message$markerTotals === void 0 ? void 0 : _message$markerTotals.find(function (marker) {
|
|
10670
|
+
return marker.name === markerName;
|
|
10671
|
+
});
|
|
10672
|
+
if (!markerInMarkersTotal) {
|
|
10673
|
+
return {
|
|
10674
|
+
markerTotals: [].concat(message.markerTotals || [], [{
|
|
10675
|
+
name: markerName,
|
|
10676
|
+
count: 1
|
|
10677
|
+
}]),
|
|
10678
|
+
deliveryStatus: markerName
|
|
10679
|
+
};
|
|
10680
|
+
} else {
|
|
10681
|
+
return {
|
|
10682
|
+
markerTotals: message.markerTotals.map(function (marker) {
|
|
10683
|
+
return marker.name === markerName ? _extends({}, marker, {
|
|
10684
|
+
count: marker.count + 1
|
|
10685
|
+
}) : marker;
|
|
10686
|
+
}),
|
|
10687
|
+
deliveryStatus: markerName
|
|
10688
|
+
};
|
|
10689
|
+
}
|
|
10690
|
+
};
|
|
10650
10691
|
var sendMessageHandler;
|
|
10651
10692
|
var setSendMessageHandler = function setSendMessageHandler(handler) {
|
|
10652
10693
|
sendMessageHandler = handler;
|
|
@@ -10678,7 +10719,8 @@ var updateMessageOnAllMessages = function updateMessageOnAllMessages(messageId,
|
|
|
10678
10719
|
if (updatedParams.state === MESSAGE_STATUS.DELETE) {
|
|
10679
10720
|
return _extends({}, updatedParams);
|
|
10680
10721
|
}
|
|
10681
|
-
var
|
|
10722
|
+
var statusUpdatedMessage = updateMessageDeliveryStatusAndMarkers(message, updatedParams.deliveryStatus);
|
|
10723
|
+
var updatedMessage = _extends({}, message, updatedParams, statusUpdatedMessage);
|
|
10682
10724
|
if (voteDetails) {
|
|
10683
10725
|
updatedMessage = _extends({}, updatedMessage, {
|
|
10684
10726
|
pollDetails: handleVoteDetails(voteDetails, updatedMessage)
|
|
@@ -10689,6 +10731,15 @@ var updateMessageOnAllMessages = function updateMessageOnAllMessages(messageId,
|
|
|
10689
10731
|
return message;
|
|
10690
10732
|
});
|
|
10691
10733
|
};
|
|
10734
|
+
var updateMessageStatusOnAllMessages = function updateMessageStatusOnAllMessages(name, markersMap) {
|
|
10735
|
+
activeChannelAllMessages = activeChannelAllMessages.map(function (message) {
|
|
10736
|
+
if (markersMap[message.id]) {
|
|
10737
|
+
var statusUpdatedMessage = updateMessageDeliveryStatusAndMarkers(message, name);
|
|
10738
|
+
return _extends({}, message, statusUpdatedMessage);
|
|
10739
|
+
}
|
|
10740
|
+
return message;
|
|
10741
|
+
});
|
|
10742
|
+
};
|
|
10692
10743
|
var removeMessageFromAllMessages = function removeMessageFromAllMessages(messageId) {
|
|
10693
10744
|
activeChannelAllMessages = [].concat(activeChannelAllMessages).filter(function (msg) {
|
|
10694
10745
|
return !(msg.id === messageId || msg.tid === messageId);
|
|
@@ -10696,12 +10747,11 @@ var removeMessageFromAllMessages = function removeMessageFromAllMessages(message
|
|
|
10696
10747
|
};
|
|
10697
10748
|
var updateMarkersOnAllMessages = function updateMarkersOnAllMessages(markersMap, name) {
|
|
10698
10749
|
activeChannelAllMessages = activeChannelAllMessages.map(function (message) {
|
|
10699
|
-
if (markersMap[message.id]
|
|
10700
|
-
return
|
|
10701
|
-
deliveryStatus: name
|
|
10702
|
-
});
|
|
10750
|
+
if (!markersMap[message.id]) {
|
|
10751
|
+
return message;
|
|
10703
10752
|
}
|
|
10704
|
-
|
|
10753
|
+
var statusUpdatedMessage = updateMessageDeliveryStatusAndMarkers(message, name);
|
|
10754
|
+
return _extends({}, message, statusUpdatedMessage);
|
|
10705
10755
|
});
|
|
10706
10756
|
};
|
|
10707
10757
|
var getAllMessages = function getAllMessages() {
|
|
@@ -10757,17 +10807,18 @@ var getFromAllMessagesByMessageId = function getFromAllMessagesByMessageId(messa
|
|
|
10757
10807
|
return messagesForAdd;
|
|
10758
10808
|
};
|
|
10759
10809
|
function setMessagesToMap(channelId, messages) {
|
|
10760
|
-
messagesMap[channelId]
|
|
10810
|
+
if (!messagesMap[channelId]) {
|
|
10811
|
+
messagesMap[channelId] = {};
|
|
10812
|
+
}
|
|
10813
|
+
messages.forEach(function (msg) {
|
|
10814
|
+
messagesMap[channelId][msg.id] = msg;
|
|
10815
|
+
});
|
|
10761
10816
|
}
|
|
10762
10817
|
function addMessageToMap(channelId, message) {
|
|
10763
|
-
if (messagesMap[channelId]
|
|
10764
|
-
messagesMap[channelId]
|
|
10765
|
-
}
|
|
10766
|
-
if (messagesMap[channelId]) {
|
|
10767
|
-
messagesMap[channelId].push(message);
|
|
10768
|
-
} else {
|
|
10769
|
-
messagesMap[channelId] = [message];
|
|
10818
|
+
if (!messagesMap[channelId]) {
|
|
10819
|
+
messagesMap[channelId] = {};
|
|
10770
10820
|
}
|
|
10821
|
+
messagesMap[channelId][message.id] = message;
|
|
10771
10822
|
if (message.deliveryStatus === MESSAGE_DELIVERY_STATUS.PENDING) {
|
|
10772
10823
|
setPendingMessage(channelId, message);
|
|
10773
10824
|
}
|
|
@@ -10779,7 +10830,8 @@ function updateMessageOnMap(channelId, updatedMessage, voteDetails) {
|
|
|
10779
10830
|
var _pendingMessagesMap$c;
|
|
10780
10831
|
var updatedPendingMessages = (_pendingMessagesMap$c = pendingMessagesMap[channelId]) === null || _pendingMessagesMap$c === void 0 ? void 0 : _pendingMessagesMap$c.map(function (msg) {
|
|
10781
10832
|
if (msg.tid === updatedMessage.messageId) {
|
|
10782
|
-
|
|
10833
|
+
var statusUpdatedMessage = updateMessageDeliveryStatusAndMarkers(msg, updatedMessage.params.deliveryStatus);
|
|
10834
|
+
return _extends({}, msg, updatedMessage.params, statusUpdatedMessage);
|
|
10783
10835
|
}
|
|
10784
10836
|
return msg;
|
|
10785
10837
|
});
|
|
@@ -10793,15 +10845,16 @@ function updateMessageOnMap(channelId, updatedMessage, voteDetails) {
|
|
|
10793
10845
|
var updatedMessageData = null;
|
|
10794
10846
|
if (messagesMap[channelId]) {
|
|
10795
10847
|
var messagesList = [];
|
|
10796
|
-
for (var
|
|
10797
|
-
var mes =
|
|
10848
|
+
for (var _i = 0, _Object$values = Object.values(messagesMap[channelId] || {}); _i < _Object$values.length; _i++) {
|
|
10849
|
+
var mes = _Object$values[_i];
|
|
10798
10850
|
if (mes.tid === updatedMessage.messageId || mes.id === updatedMessage.messageId) {
|
|
10799
10851
|
if (updatedMessage.params.state === MESSAGE_STATUS.DELETE) {
|
|
10800
10852
|
updatedMessageData = _extends({}, updatedMessage.params);
|
|
10801
10853
|
messagesList.push(_extends({}, mes, updatedMessageData));
|
|
10802
10854
|
continue;
|
|
10803
10855
|
} else {
|
|
10804
|
-
|
|
10856
|
+
var statusUpdatedMessage = updateMessageDeliveryStatusAndMarkers(mes, updatedMessage.params.deliveryStatus);
|
|
10857
|
+
updatedMessageData = _extends({}, mes, updatedMessage.params, statusUpdatedMessage);
|
|
10805
10858
|
var voteDetailsData = void 0;
|
|
10806
10859
|
if (voteDetails) {
|
|
10807
10860
|
voteDetailsData = handleVoteDetails(voteDetails, updatedMessageData);
|
|
@@ -10815,28 +10868,29 @@ function updateMessageOnMap(channelId, updatedMessage, voteDetails) {
|
|
|
10815
10868
|
}
|
|
10816
10869
|
messagesList.push(mes);
|
|
10817
10870
|
}
|
|
10818
|
-
|
|
10871
|
+
messagesList.forEach(function (msg) {
|
|
10872
|
+
if (!messagesMap[channelId]) {
|
|
10873
|
+
messagesMap[channelId] = {};
|
|
10874
|
+
}
|
|
10875
|
+
messagesMap[channelId][msg.id] = msg;
|
|
10876
|
+
});
|
|
10819
10877
|
}
|
|
10820
10878
|
return updatedMessageData;
|
|
10821
10879
|
}
|
|
10822
10880
|
function addReactionToMessageOnMap(channelId, message, reaction, isSelf) {
|
|
10823
10881
|
if (messagesMap[channelId]) {
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
slfReactions = [reaction];
|
|
10832
|
-
}
|
|
10833
|
-
}
|
|
10834
|
-
return _extends({}, msg, {
|
|
10835
|
-
userReactions: slfReactions,
|
|
10836
|
-
reactionTotals: message.reactionTotals
|
|
10837
|
-
});
|
|
10882
|
+
var messageShouldBeUpdated = messagesMap[channelId][message.id];
|
|
10883
|
+
var slfReactions = [].concat(messageShouldBeUpdated.userReactions);
|
|
10884
|
+
if (isSelf) {
|
|
10885
|
+
if (slfReactions) {
|
|
10886
|
+
slfReactions.push(reaction);
|
|
10887
|
+
} else {
|
|
10888
|
+
slfReactions = [reaction];
|
|
10838
10889
|
}
|
|
10839
|
-
|
|
10890
|
+
}
|
|
10891
|
+
messagesMap[channelId][message.id] = _extends({}, messageShouldBeUpdated, {
|
|
10892
|
+
userReactions: slfReactions,
|
|
10893
|
+
reactionTotals: message.reactionTotals
|
|
10840
10894
|
});
|
|
10841
10895
|
}
|
|
10842
10896
|
}
|
|
@@ -10861,20 +10915,16 @@ var addReactionOnAllMessages = function addReactionOnAllMessages(message, reacti
|
|
|
10861
10915
|
};
|
|
10862
10916
|
function removeReactionToMessageOnMap(channelId, message, reaction, isSelf) {
|
|
10863
10917
|
if (messagesMap[channelId]) {
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
|
|
10874
|
-
userReactions: userReactions
|
|
10875
|
-
});
|
|
10876
|
-
}
|
|
10877
|
-
return msg;
|
|
10918
|
+
var messageShouldBeUpdated = messagesMap[channelId][message.id];
|
|
10919
|
+
var userReactions = messageShouldBeUpdated.userReactions;
|
|
10920
|
+
if (isSelf) {
|
|
10921
|
+
userReactions = messageShouldBeUpdated.userReactions.filter(function (selfReaction) {
|
|
10922
|
+
return selfReaction.key !== reaction.key;
|
|
10923
|
+
});
|
|
10924
|
+
}
|
|
10925
|
+
messagesMap[channelId][message.id] = _extends({}, messageShouldBeUpdated, {
|
|
10926
|
+
reactionTotals: message.reactionTotals,
|
|
10927
|
+
userReactions: userReactions
|
|
10878
10928
|
});
|
|
10879
10929
|
}
|
|
10880
10930
|
}
|
|
@@ -10897,15 +10947,18 @@ var removeReactionOnAllMessages = function removeReactionOnAllMessages(message,
|
|
|
10897
10947
|
};
|
|
10898
10948
|
function updateMessageStatusOnMap(channelId, newMarkers) {
|
|
10899
10949
|
if (messagesMap[channelId] && newMarkers && newMarkers.markersMap) {
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10950
|
+
var messageIds = [];
|
|
10951
|
+
Object.keys(newMarkers.markersMap).forEach(function (messageId) {
|
|
10952
|
+
if (newMarkers.markersMap[messageId]) {
|
|
10953
|
+
messageIds.push(messageId);
|
|
10954
|
+
}
|
|
10955
|
+
});
|
|
10956
|
+
messageIds.forEach(function (messageId) {
|
|
10957
|
+
var messageShouldBeUpdated = messagesMap[channelId][messageId];
|
|
10958
|
+
if (messageShouldBeUpdated) {
|
|
10959
|
+
var statusUpdatedMessage = updateMessageDeliveryStatusAndMarkers(messageShouldBeUpdated, newMarkers.name);
|
|
10960
|
+
messagesMap[channelId][messageId] = _extends({}, messageShouldBeUpdated, statusUpdatedMessage);
|
|
10907
10961
|
}
|
|
10908
|
-
return mes;
|
|
10909
10962
|
});
|
|
10910
10963
|
}
|
|
10911
10964
|
}
|
|
@@ -10916,9 +10969,7 @@ function removeMessagesFromMap(channelId) {
|
|
|
10916
10969
|
delete messagesMap[channelId];
|
|
10917
10970
|
}
|
|
10918
10971
|
function removeMessageFromMap(channelId, messageId) {
|
|
10919
|
-
messagesMap[channelId]
|
|
10920
|
-
return !(msg.id === messageId || msg.tid === messageId);
|
|
10921
|
-
});
|
|
10972
|
+
delete messagesMap[channelId][messageId];
|
|
10922
10973
|
store.dispatch(removePendingMessageAC(channelId, messageId));
|
|
10923
10974
|
}
|
|
10924
10975
|
function updatePendingMessageOnMap(channelId, messageId, updatedMessage) {
|
|
@@ -11126,7 +11177,8 @@ var initialState$1 = {
|
|
|
11126
11177
|
pollVotesLoadingState: {},
|
|
11127
11178
|
pollVotesInitialCount: null,
|
|
11128
11179
|
pendingPollActions: {},
|
|
11129
|
-
pendingMessagesMap: {}
|
|
11180
|
+
pendingMessagesMap: {},
|
|
11181
|
+
unreadScrollTo: true
|
|
11130
11182
|
};
|
|
11131
11183
|
var messageSlice = createSlice({
|
|
11132
11184
|
name: 'messages',
|
|
@@ -11160,6 +11212,9 @@ var messageSlice = createSlice({
|
|
|
11160
11212
|
setShowScrollToNewMessageButton: function setShowScrollToNewMessageButton(state, action) {
|
|
11161
11213
|
state.showScrollToNewMessageButton = action.payload.state;
|
|
11162
11214
|
},
|
|
11215
|
+
setUnreadScrollTo: function setUnreadScrollTo(state, action) {
|
|
11216
|
+
state.unreadScrollTo = action.payload.state;
|
|
11217
|
+
},
|
|
11163
11218
|
setMessages: function setMessages(state, action) {
|
|
11164
11219
|
state.activeChannelMessages = action.payload.messages;
|
|
11165
11220
|
},
|
|
@@ -11220,8 +11275,18 @@ var messageSlice = createSlice({
|
|
|
11220
11275
|
markersMap = _action$payload2.markersMap;
|
|
11221
11276
|
var markerName = name;
|
|
11222
11277
|
for (var index = 0; index < state.activeChannelMessages.length; index++) {
|
|
11223
|
-
if (markersMap[state.activeChannelMessages[index].id]
|
|
11224
|
-
|
|
11278
|
+
if (!markersMap[state.activeChannelMessages[index].id]) {
|
|
11279
|
+
continue;
|
|
11280
|
+
}
|
|
11281
|
+
if (state.activeChannelMessages[index].state !== 'Deleted') {
|
|
11282
|
+
var message = state.activeChannelMessages[index];
|
|
11283
|
+
var _updateMessageDeliver = updateMessageDeliveryStatusAndMarkers(message, markerName),
|
|
11284
|
+
markerTotals = _updateMessageDeliver.markerTotals,
|
|
11285
|
+
deliveryStatus = _updateMessageDeliver.deliveryStatus;
|
|
11286
|
+
state.activeChannelMessages[index] = _extends({}, message, {
|
|
11287
|
+
markerTotals: markerTotals,
|
|
11288
|
+
deliveryStatus: deliveryStatus
|
|
11289
|
+
});
|
|
11225
11290
|
}
|
|
11226
11291
|
}
|
|
11227
11292
|
},
|
|
@@ -11238,10 +11303,15 @@ var messageSlice = createSlice({
|
|
|
11238
11303
|
if (params.state === MESSAGE_STATUS.DELETE) {
|
|
11239
11304
|
return _extends({}, params);
|
|
11240
11305
|
} else {
|
|
11241
|
-
var
|
|
11306
|
+
var statusUpdatedMessage = null;
|
|
11307
|
+
if (params !== null && params !== void 0 && params.deliveryStatus) {
|
|
11308
|
+
statusUpdatedMessage = updateMessageDeliveryStatusAndMarkers(message, params.deliveryStatus);
|
|
11309
|
+
}
|
|
11310
|
+
var messageOldData = _extends({}, message, params, statusUpdatedMessage);
|
|
11311
|
+
var messageData = _extends({}, messageOldData);
|
|
11242
11312
|
if (voteDetails) {
|
|
11243
|
-
messageData = _extends({},
|
|
11244
|
-
pollDetails: handleVoteDetails(voteDetails,
|
|
11313
|
+
messageData = _extends({}, messageOldData, {
|
|
11314
|
+
pollDetails: handleVoteDetails(voteDetails, messageOldData)
|
|
11245
11315
|
});
|
|
11246
11316
|
}
|
|
11247
11317
|
if (messageData.deliveryStatus !== MESSAGE_DELIVERY_STATUS.PENDING) {
|
|
@@ -11685,6 +11755,7 @@ var _messageSlice$actions = messageSlice.actions,
|
|
|
11685
11755
|
setScrollToMentionedMessage = _messageSlice$actions.setScrollToMentionedMessage,
|
|
11686
11756
|
setScrollToNewMessage = _messageSlice$actions.setScrollToNewMessage,
|
|
11687
11757
|
setShowScrollToNewMessageButton = _messageSlice$actions.setShowScrollToNewMessageButton,
|
|
11758
|
+
setUnreadScrollTo = _messageSlice$actions.setUnreadScrollTo,
|
|
11688
11759
|
setMessages = _messageSlice$actions.setMessages,
|
|
11689
11760
|
addMessages = _messageSlice$actions.addMessages,
|
|
11690
11761
|
updateMessagesStatus = _messageSlice$actions.updateMessagesStatus,
|
|
@@ -14009,8 +14080,8 @@ function updateActiveChannelMembersRemove(removedMembers) {
|
|
|
14009
14080
|
var _marked$1 = /*#__PURE__*/_regenerator().m(watchForEvents);
|
|
14010
14081
|
function watchForEvents() {
|
|
14011
14082
|
var SceytChatClient, channelListener, connectionListener, usersTimeout, chan, _loop;
|
|
14012
|
-
return _regenerator().w(function (
|
|
14013
|
-
while (1) switch (
|
|
14083
|
+
return _regenerator().w(function (_context2) {
|
|
14084
|
+
while (1) switch (_context2.n) {
|
|
14014
14085
|
case 0:
|
|
14015
14086
|
SceytChatClient = getClient();
|
|
14016
14087
|
channelListener = new SceytChatClient.ChannelListener();
|
|
@@ -14408,46 +14479,46 @@ function watchForEvents() {
|
|
|
14408
14479
|
SceytChatClient.removeConnectionListener('CONNECTION_EVENTS');
|
|
14409
14480
|
};
|
|
14410
14481
|
});
|
|
14411
|
-
_loop = /*#__PURE__*/_regenerator().m(function
|
|
14412
|
-
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, activeChannelMessages, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _pollDetailsData$chan, _pollDetailsData$chan2, _channel1, pollDetails,
|
|
14413
|
-
return _regenerator().w(function (
|
|
14414
|
-
while (1) switch (
|
|
14482
|
+
_loop = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
14483
|
+
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, activeChannelMessages, _iterator, _step, messageId, isPendingMessage, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _pollDetailsData$chan, _pollDetailsData$chan2, _channel1, pollDetails, _messageId, pollDetailsData, _activeChannelId0, addedVotes, deletedVotes, objs, _iterator2, _step2, vote, _iterator3, _step3, _vote, _i, _objs, obj, _store$getState$Messa, key, hasNext, _i2, _objs2, _obj, _pollDetailsData$chan3, _channel10, _pollDetails, _messageId2, _pollDetailsData, _activeChannelId1, _deletedVotes, _objs3, _iterator4, _step4, _vote2, _i3, _objs4, _obj2, _i4, _objs5, _obj3, _pollDetailsData2$cha, _channel11, _pollDetails2, _messageId3, _activeChannelId10, _pollDetailsData2, retractedVotes, _objs6, _iterator5, _step5, _vote4, _i5, _objs7, _obj4, _iterator6, _step6, _vote3, _channel12, _messageId4, _activeChannelId11, _obj5, _channel13, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId12, _channelUpdateParams, _channel14, _updatedChannel, _channel15, _activeChannelId13, channelExist, _channel16, _channel17, _channel18, _channel19, _channel20, _channel21, _channel22, _groupName5, _channel23, _groupName6, _channel24, members, _activeChannelId14, i, _channel25, _channel26, _channelId2, from, name, status, _t, _t2;
|
|
14484
|
+
return _regenerator().w(function (_context) {
|
|
14485
|
+
while (1) switch (_context.p = _context.n) {
|
|
14415
14486
|
case 0:
|
|
14416
|
-
|
|
14417
|
-
|
|
14487
|
+
_context.p = 0;
|
|
14488
|
+
_context.n = 1;
|
|
14418
14489
|
return effects.take(chan);
|
|
14419
14490
|
case 1:
|
|
14420
|
-
_yield$take =
|
|
14491
|
+
_yield$take = _context.v;
|
|
14421
14492
|
type = _yield$take.type;
|
|
14422
14493
|
args = _yield$take.args;
|
|
14423
14494
|
_t = type;
|
|
14424
|
-
|
|
14495
|
+
_context.n = _t === CHANNEL_EVENT_TYPES.CREATE ? 2 : _t === CHANNEL_EVENT_TYPES.JOIN ? 7 : _t === CHANNEL_EVENT_TYPES.LEAVE ? 9 : _t === CHANNEL_EVENT_TYPES.BLOCK ? 22 : _t === CHANNEL_EVENT_TYPES.UNBLOCK ? 24 : _t === CHANNEL_EVENT_TYPES.KICK_MEMBERS ? 25 : _t === CHANNEL_EVENT_TYPES.ADD_MEMBERS ? 36 : _t === CHANNEL_EVENT_TYPES.UPDATE_CHANNEL ? 46 : _t === CHANNEL_EVENT_TYPES.MESSAGE ? 51 : _t === CHANNEL_EVENT_TYPES.MESSAGE_MARKERS_RECEIVED ? 68 : _t === CHANNEL_EVENT_TYPES.DELETE ? 81 : _t === CHANNEL_EVENT_TYPES.DELETE_MESSAGE ? 83 : _t === CHANNEL_EVENT_TYPES.EDIT_MESSAGE ? 88 : _t === CHANNEL_EVENT_TYPES.REACTION_ADDED ? 93 : _t === CHANNEL_EVENT_TYPES.POLL_ADDED ? 101 : _t === CHANNEL_EVENT_TYPES.POLL_DELETED ? 111 : _t === CHANNEL_EVENT_TYPES.POLL_RETRACTED ? 119 : _t === CHANNEL_EVENT_TYPES.POLL_CLOSED ? 127 : _t === CHANNEL_EVENT_TYPES.REACTION_DELETED ? 131 : _t === CHANNEL_EVENT_TYPES.UNREAD_MESSAGES_INFO ? 136 : _t === CHANNEL_EVENT_TYPES.CLEAR_HISTORY ? 139 : _t === CHANNEL_EVENT_TYPES.MUTE ? 145 : _t === CHANNEL_EVENT_TYPES.UNMUTE ? 147 : _t === CHANNEL_EVENT_TYPES.PINED ? 149 : _t === CHANNEL_EVENT_TYPES.UNPINED ? 151 : _t === CHANNEL_EVENT_TYPES.HIDE ? 153 : _t === CHANNEL_EVENT_TYPES.UNHIDE ? 155 : _t === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_UNREAD ? 157 : _t === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_READ ? 160 : _t === CHANNEL_EVENT_TYPES.CHANGE_ROLE ? 163 : _t === CHANNEL_EVENT_TYPES.FROZEN ? 170 : _t === CHANNEL_EVENT_TYPES.UNFROZEN ? 171 : _t === CHANNEL_EVENT_TYPES.CHANNEL_EVENT ? 172 : _t === CONNECTION_EVENT_TYPES.CONNECTION_STATUS_CHANGED ? 181 : 184;
|
|
14425
14496
|
break;
|
|
14426
14497
|
case 2:
|
|
14427
14498
|
createdChannel = args.createdChannel;
|
|
14428
14499
|
log.info('CHANNEL_EVENT_CREATE ... ', createdChannel);
|
|
14429
14500
|
channelFilterTypes = getChannelTypesFilter();
|
|
14430
14501
|
if (!(channelFilterTypes !== null && channelFilterTypes !== void 0 && channelFilterTypes.length ? channelFilterTypes.includes(createdChannel.type) : true)) {
|
|
14431
|
-
|
|
14502
|
+
_context.n = 6;
|
|
14432
14503
|
break;
|
|
14433
14504
|
}
|
|
14434
14505
|
getFromContacts = getShowOnlyContactUsers();
|
|
14435
14506
|
channelExists = checkChannelExists(createdChannel.id);
|
|
14436
14507
|
if (channelExists) {
|
|
14437
|
-
|
|
14508
|
+
_context.n = 5;
|
|
14438
14509
|
break;
|
|
14439
14510
|
}
|
|
14440
14511
|
if (!getFromContacts) {
|
|
14441
|
-
|
|
14512
|
+
_context.n = 3;
|
|
14442
14513
|
break;
|
|
14443
14514
|
}
|
|
14444
|
-
|
|
14515
|
+
_context.n = 3;
|
|
14445
14516
|
return effects.put(getContactsAC());
|
|
14446
14517
|
case 3:
|
|
14447
|
-
|
|
14518
|
+
_context.n = 4;
|
|
14448
14519
|
return effects.call(setChannelInMap, createdChannel);
|
|
14449
14520
|
case 4:
|
|
14450
|
-
|
|
14521
|
+
_context.n = 5;
|
|
14451
14522
|
return effects.put(setChannelToAddAC(JSON.parse(JSON.stringify(createdChannel))));
|
|
14452
14523
|
case 5:
|
|
14453
14524
|
_chan = getChannelFromAllChannels(createdChannel.id);
|
|
@@ -14455,73 +14526,73 @@ function watchForEvents() {
|
|
|
14455
14526
|
addChannelToAllChannels(createdChannel);
|
|
14456
14527
|
}
|
|
14457
14528
|
case 6:
|
|
14458
|
-
return
|
|
14529
|
+
return _context.a(3, 185);
|
|
14459
14530
|
case 7:
|
|
14460
14531
|
channel = args.channel;
|
|
14461
14532
|
log.info('channel JOIN ... . ', channel);
|
|
14462
|
-
|
|
14533
|
+
_context.n = 8;
|
|
14463
14534
|
return effects.call(getActiveChannelId);
|
|
14464
14535
|
case 8:
|
|
14465
14536
|
_chan2 = getChannelFromAllChannels(channel.id);
|
|
14466
14537
|
if (!_chan2) {
|
|
14467
14538
|
addChannelToAllChannels(channel);
|
|
14468
14539
|
}
|
|
14469
|
-
return
|
|
14540
|
+
return _context.a(3, 185);
|
|
14470
14541
|
case 9:
|
|
14471
14542
|
_channel = args.channel, member = args.member;
|
|
14472
14543
|
log.info('channel LEAVE ... ', _channel, member);
|
|
14473
14544
|
_channelExists = checkChannelExists(_channel.id);
|
|
14474
|
-
|
|
14545
|
+
_context.n = 10;
|
|
14475
14546
|
return effects.call(getActiveChannelId);
|
|
14476
14547
|
case 10:
|
|
14477
|
-
_activeChannelId =
|
|
14548
|
+
_activeChannelId = _context.v;
|
|
14478
14549
|
if (!(member.id === SceytChatClient.user.id)) {
|
|
14479
|
-
|
|
14550
|
+
_context.n = 15;
|
|
14480
14551
|
break;
|
|
14481
14552
|
}
|
|
14482
|
-
|
|
14553
|
+
_context.n = 11;
|
|
14483
14554
|
return effects.put(switchChannelActionAC(null));
|
|
14484
14555
|
case 11:
|
|
14485
|
-
|
|
14556
|
+
_context.n = 12;
|
|
14486
14557
|
return effects.put(removeChannelAC(_channel.id));
|
|
14487
14558
|
case 12:
|
|
14488
14559
|
removeChannelFromMap(_channel.id);
|
|
14489
14560
|
deleteChannelFromAllChannels(_channel.id);
|
|
14490
|
-
|
|
14561
|
+
_context.n = 13;
|
|
14491
14562
|
return effects.put(setChannelToRemoveAC(_channel));
|
|
14492
14563
|
case 13:
|
|
14493
|
-
|
|
14564
|
+
_context.n = 14;
|
|
14494
14565
|
return effects.put(removeChannelCachesAC(_channel.id));
|
|
14495
14566
|
case 14:
|
|
14496
|
-
|
|
14567
|
+
_context.n = 21;
|
|
14497
14568
|
break;
|
|
14498
14569
|
case 15:
|
|
14499
14570
|
groupName = getChannelGroupName(_channel);
|
|
14500
14571
|
if (!_channelExists) {
|
|
14501
|
-
|
|
14572
|
+
_context.n = 19;
|
|
14502
14573
|
break;
|
|
14503
14574
|
}
|
|
14504
14575
|
updateChannelData = {};
|
|
14505
14576
|
if (!(_activeChannelId === _channel.id)) {
|
|
14506
|
-
|
|
14577
|
+
_context.n = 18;
|
|
14507
14578
|
break;
|
|
14508
14579
|
}
|
|
14509
|
-
|
|
14580
|
+
_context.n = 16;
|
|
14510
14581
|
return effects.put(removeMemberFromListAC([member]));
|
|
14511
14582
|
case 16:
|
|
14512
|
-
|
|
14583
|
+
_context.n = 17;
|
|
14513
14584
|
return effects.call(updateActiveChannelMembersRemove, [member]) || {};
|
|
14514
14585
|
case 17:
|
|
14515
|
-
updateChannelData =
|
|
14586
|
+
updateChannelData = _context.v;
|
|
14516
14587
|
case 18:
|
|
14517
|
-
|
|
14588
|
+
_context.n = 19;
|
|
14518
14589
|
return effects.put(updateChannelDataAC(_channel.id, _extends({
|
|
14519
14590
|
memberCount: _channel.memberCount,
|
|
14520
14591
|
muted: _channel.muted,
|
|
14521
14592
|
mutedTill: _channel.mutedTill
|
|
14522
14593
|
}, updateChannelData)));
|
|
14523
14594
|
case 19:
|
|
14524
|
-
|
|
14595
|
+
_context.n = 20;
|
|
14525
14596
|
return effects.put(updateSearchedChannelDataAC(_channel.id, {
|
|
14526
14597
|
memberCount: _channel.memberCount,
|
|
14527
14598
|
muted: _channel.muted,
|
|
@@ -14534,80 +14605,80 @@ function watchForEvents() {
|
|
|
14534
14605
|
mutedTill: _channel.mutedTill
|
|
14535
14606
|
});
|
|
14536
14607
|
case 21:
|
|
14537
|
-
return
|
|
14608
|
+
return _context.a(3, 185);
|
|
14538
14609
|
case 22:
|
|
14539
14610
|
log.info('channel BLOCK ... ');
|
|
14540
14611
|
_channel2 = args.channel;
|
|
14541
14612
|
_channelExists2 = checkChannelExists(_channel2.id);
|
|
14542
14613
|
if (!_channelExists2) {
|
|
14543
|
-
|
|
14614
|
+
_context.n = 23;
|
|
14544
14615
|
break;
|
|
14545
14616
|
}
|
|
14546
|
-
|
|
14617
|
+
_context.n = 23;
|
|
14547
14618
|
return effects.put(removeChannelAC(_channel2.id));
|
|
14548
14619
|
case 23:
|
|
14549
|
-
return
|
|
14620
|
+
return _context.a(3, 185);
|
|
14550
14621
|
case 24:
|
|
14551
14622
|
log.info('channel UNBLOCK ... ');
|
|
14552
|
-
return
|
|
14623
|
+
return _context.a(3, 185);
|
|
14553
14624
|
case 25:
|
|
14554
14625
|
_channel3 = args.channel, removedMembers = args.removedMembers;
|
|
14555
14626
|
log.info('channel KICK_MEMBERS ... ', removedMembers);
|
|
14556
|
-
|
|
14627
|
+
_context.n = 26;
|
|
14557
14628
|
return effects.call(getActiveChannelId);
|
|
14558
14629
|
case 26:
|
|
14559
|
-
_activeChannelId2 =
|
|
14630
|
+
_activeChannelId2 = _context.v;
|
|
14560
14631
|
_channelExists3 = checkChannelExists(_channel3.id);
|
|
14561
14632
|
if (!_channelExists3) {
|
|
14562
|
-
|
|
14633
|
+
_context.n = 35;
|
|
14563
14634
|
break;
|
|
14564
14635
|
}
|
|
14565
14636
|
if (!removedMembers.find(function (mem) {
|
|
14566
14637
|
return mem.id === SceytChatClient.user.id;
|
|
14567
14638
|
})) {
|
|
14568
|
-
|
|
14639
|
+
_context.n = 30;
|
|
14569
14640
|
break;
|
|
14570
14641
|
}
|
|
14571
14642
|
removeChannelFromMap(_channel3.id);
|
|
14572
|
-
|
|
14643
|
+
_context.n = 27;
|
|
14573
14644
|
return effects.put(removeChannelAC(_channel3.id));
|
|
14574
14645
|
case 27:
|
|
14575
|
-
|
|
14646
|
+
_context.n = 28;
|
|
14576
14647
|
return effects.call(getLastChannelFromMap);
|
|
14577
14648
|
case 28:
|
|
14578
|
-
activeChannel =
|
|
14649
|
+
activeChannel = _context.v;
|
|
14579
14650
|
if (!activeChannel) {
|
|
14580
|
-
|
|
14651
|
+
_context.n = 29;
|
|
14581
14652
|
break;
|
|
14582
14653
|
}
|
|
14583
|
-
|
|
14654
|
+
_context.n = 29;
|
|
14584
14655
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
14585
14656
|
case 29:
|
|
14586
|
-
|
|
14657
|
+
_context.n = 35;
|
|
14587
14658
|
break;
|
|
14588
14659
|
case 30:
|
|
14589
14660
|
_updateChannelData = {};
|
|
14590
14661
|
if (!(_activeChannelId2 === _channel3.id)) {
|
|
14591
|
-
|
|
14662
|
+
_context.n = 33;
|
|
14592
14663
|
break;
|
|
14593
14664
|
}
|
|
14594
|
-
|
|
14665
|
+
_context.n = 31;
|
|
14595
14666
|
return effects.put(removeMemberFromListAC(removedMembers));
|
|
14596
14667
|
case 31:
|
|
14597
|
-
|
|
14668
|
+
_context.n = 32;
|
|
14598
14669
|
return effects.call(updateActiveChannelMembersRemove, removedMembers) || {};
|
|
14599
14670
|
case 32:
|
|
14600
|
-
_updateChannelData =
|
|
14671
|
+
_updateChannelData = _context.v;
|
|
14601
14672
|
case 33:
|
|
14602
14673
|
_groupName = getChannelGroupName(_channel3);
|
|
14603
|
-
|
|
14674
|
+
_context.n = 34;
|
|
14604
14675
|
return effects.put(updateSearchedChannelDataAC(_channel3.id, {
|
|
14605
14676
|
memberCount: _channel3.memberCount,
|
|
14606
14677
|
muted: _channel3.muted,
|
|
14607
14678
|
mutedTill: _channel3.mutedTill
|
|
14608
14679
|
}, _groupName));
|
|
14609
14680
|
case 34:
|
|
14610
|
-
|
|
14681
|
+
_context.n = 35;
|
|
14611
14682
|
return effects.put(updateChannelDataAC(_channel3.id, _extends({
|
|
14612
14683
|
memberCount: _channel3.memberCount,
|
|
14613
14684
|
muted: _channel3.muted,
|
|
@@ -14619,50 +14690,50 @@ function watchForEvents() {
|
|
|
14619
14690
|
muted: _channel3.muted,
|
|
14620
14691
|
mutedTill: _channel3.mutedTill
|
|
14621
14692
|
});
|
|
14622
|
-
return
|
|
14693
|
+
return _context.a(3, 185);
|
|
14623
14694
|
case 36:
|
|
14624
14695
|
_channel4 = args.channel, addedMembers = args.addedMembers;
|
|
14625
14696
|
log.info('channel ADD_MEMBERS ... ', addedMembers);
|
|
14626
|
-
|
|
14697
|
+
_context.n = 37;
|
|
14627
14698
|
return effects.call(getActiveChannelId);
|
|
14628
14699
|
case 37:
|
|
14629
|
-
_activeChannelId3 =
|
|
14700
|
+
_activeChannelId3 = _context.v;
|
|
14630
14701
|
_channelExists4 = checkChannelExists(_channel4.id);
|
|
14631
14702
|
if (!_channelExists4) {
|
|
14632
|
-
|
|
14703
|
+
_context.n = 42;
|
|
14633
14704
|
break;
|
|
14634
14705
|
}
|
|
14635
14706
|
_updateChannelData2 = {};
|
|
14636
14707
|
if (!(_activeChannelId3 === _channel4.id)) {
|
|
14637
|
-
|
|
14708
|
+
_context.n = 40;
|
|
14638
14709
|
break;
|
|
14639
14710
|
}
|
|
14640
|
-
|
|
14711
|
+
_context.n = 38;
|
|
14641
14712
|
return effects.put(addMembersToListAC(addedMembers));
|
|
14642
14713
|
case 38:
|
|
14643
|
-
|
|
14714
|
+
_context.n = 39;
|
|
14644
14715
|
return effects.call(updateActiveChannelMembersAdd, addedMembers) || {};
|
|
14645
14716
|
case 39:
|
|
14646
|
-
_updateChannelData2 =
|
|
14717
|
+
_updateChannelData2 = _context.v;
|
|
14647
14718
|
case 40:
|
|
14648
|
-
|
|
14719
|
+
_context.n = 41;
|
|
14649
14720
|
return effects.put(updateChannelDataAC(_channel4.id, _extends({
|
|
14650
14721
|
memberCount: _channel4.memberCount,
|
|
14651
14722
|
muted: _channel4.muted,
|
|
14652
14723
|
mutedTill: _channel4.mutedTill
|
|
14653
14724
|
}, _updateChannelData2)));
|
|
14654
14725
|
case 41:
|
|
14655
|
-
|
|
14726
|
+
_context.n = 44;
|
|
14656
14727
|
break;
|
|
14657
14728
|
case 42:
|
|
14658
|
-
|
|
14729
|
+
_context.n = 43;
|
|
14659
14730
|
return effects.call(setChannelInMap, _channel4);
|
|
14660
14731
|
case 43:
|
|
14661
|
-
|
|
14732
|
+
_context.n = 44;
|
|
14662
14733
|
return effects.put(setAddedToChannelAC(JSON.parse(JSON.stringify(_channel4))));
|
|
14663
14734
|
case 44:
|
|
14664
14735
|
_groupName2 = getChannelGroupName(_channel4);
|
|
14665
|
-
|
|
14736
|
+
_context.n = 45;
|
|
14666
14737
|
return effects.put(updateSearchedChannelDataAC(_channel4.id, {
|
|
14667
14738
|
memberCount: _channel4.memberCount,
|
|
14668
14739
|
muted: _channel4.muted,
|
|
@@ -14674,17 +14745,17 @@ function watchForEvents() {
|
|
|
14674
14745
|
muted: _channel4.muted,
|
|
14675
14746
|
mutedTill: _channel4.mutedTill
|
|
14676
14747
|
});
|
|
14677
|
-
return
|
|
14748
|
+
return _context.a(3, 185);
|
|
14678
14749
|
case 46:
|
|
14679
14750
|
log.info('channel UPDATE_CHANNEL ... ');
|
|
14680
14751
|
updatedChannel = args.updatedChannel;
|
|
14681
14752
|
_channelExists5 = checkChannelExists(updatedChannel.id);
|
|
14682
14753
|
subject = updatedChannel.subject, avatarUrl = updatedChannel.avatarUrl, muted = updatedChannel.muted, mutedTill = updatedChannel.mutedTill, metadata = updatedChannel.metadata;
|
|
14683
14754
|
if (!_channelExists5) {
|
|
14684
|
-
|
|
14755
|
+
_context.n = 49;
|
|
14685
14756
|
break;
|
|
14686
14757
|
}
|
|
14687
|
-
|
|
14758
|
+
_context.n = 47;
|
|
14688
14759
|
return effects.put(updateChannelDataAC(updatedChannel.id, {
|
|
14689
14760
|
subject: subject,
|
|
14690
14761
|
avatarUrl: avatarUrl,
|
|
@@ -14692,21 +14763,21 @@ function watchForEvents() {
|
|
|
14692
14763
|
mutedTill: mutedTill
|
|
14693
14764
|
}));
|
|
14694
14765
|
case 47:
|
|
14695
|
-
|
|
14766
|
+
_context.n = 48;
|
|
14696
14767
|
return effects.call(getActiveChannelId);
|
|
14697
14768
|
case 48:
|
|
14698
|
-
_activeChannelId4 =
|
|
14769
|
+
_activeChannelId4 = _context.v;
|
|
14699
14770
|
if (!(_activeChannelId4 === updatedChannel.id)) {
|
|
14700
|
-
|
|
14771
|
+
_context.n = 49;
|
|
14701
14772
|
break;
|
|
14702
14773
|
}
|
|
14703
|
-
|
|
14774
|
+
_context.n = 49;
|
|
14704
14775
|
return effects.put(setActiveChannelAC(_extends({}, updatedChannel, {
|
|
14705
14776
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
14706
14777
|
})));
|
|
14707
14778
|
case 49:
|
|
14708
14779
|
_groupName3 = getChannelGroupName(updatedChannel);
|
|
14709
|
-
|
|
14780
|
+
_context.n = 50;
|
|
14710
14781
|
return effects.put(updateSearchedChannelDataAC(updatedChannel.id, {
|
|
14711
14782
|
subject: subject,
|
|
14712
14783
|
avatarUrl: avatarUrl,
|
|
@@ -14721,67 +14792,65 @@ function watchForEvents() {
|
|
|
14721
14792
|
mutedTill: mutedTill,
|
|
14722
14793
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
14723
14794
|
});
|
|
14724
|
-
return
|
|
14795
|
+
return _context.a(3, 185);
|
|
14725
14796
|
case 51:
|
|
14726
14797
|
_channel5 = args.channel, message = args.message;
|
|
14727
14798
|
log.info('channel MESSAGE ... id : ', message.id, ', channel.id: ', _channel5.id);
|
|
14728
14799
|
messageToHandle = handleNewMessages ? handleNewMessages(message, _channel5) : message;
|
|
14729
14800
|
_channelFilterTypes = getChannelTypesFilter();
|
|
14730
14801
|
if (!(messageToHandle && _channel5 && (_channelFilterTypes !== null && _channelFilterTypes !== void 0 && _channelFilterTypes.length ? _channelFilterTypes.includes(_channel5.type) : true))) {
|
|
14731
|
-
|
|
14802
|
+
_context.n = 67;
|
|
14732
14803
|
break;
|
|
14733
14804
|
}
|
|
14734
14805
|
_channel5.metadata = isJSON(_channel5.metadata) ? JSON.parse(_channel5.metadata) : _channel5.metadata;
|
|
14735
|
-
|
|
14806
|
+
_context.n = 52;
|
|
14736
14807
|
return effects.call(getActiveChannelId);
|
|
14737
14808
|
case 52:
|
|
14738
|
-
_activeChannelId5 =
|
|
14809
|
+
_activeChannelId5 = _context.v;
|
|
14739
14810
|
_channelExists6 = checkChannelExists(_channel5.id);
|
|
14740
14811
|
channelForAdd = JSON.parse(JSON.stringify(_channel5));
|
|
14741
|
-
|
|
14812
|
+
_context.n = 53;
|
|
14742
14813
|
return effects.put(addChannelAC(channelForAdd));
|
|
14743
14814
|
case 53:
|
|
14744
14815
|
if (_channelExists6) {
|
|
14745
|
-
|
|
14816
|
+
_context.n = 55;
|
|
14746
14817
|
break;
|
|
14747
14818
|
}
|
|
14748
|
-
|
|
14819
|
+
_context.n = 54;
|
|
14749
14820
|
return effects.call(setChannelInMap, _channel5);
|
|
14750
14821
|
case 54:
|
|
14751
|
-
|
|
14822
|
+
_context.n = 56;
|
|
14752
14823
|
break;
|
|
14753
14824
|
case 55:
|
|
14754
14825
|
if (message.repliedInThread) {
|
|
14755
|
-
|
|
14826
|
+
_context.n = 56;
|
|
14756
14827
|
break;
|
|
14757
14828
|
}
|
|
14758
|
-
|
|
14829
|
+
_context.n = 56;
|
|
14759
14830
|
return effects.put(updateChannelLastMessageAC(message, channelForAdd));
|
|
14760
14831
|
case 56:
|
|
14761
14832
|
if (!(_channel5.id === _activeChannelId5)) {
|
|
14762
|
-
|
|
14833
|
+
_context.n = 58;
|
|
14763
14834
|
break;
|
|
14764
14835
|
}
|
|
14765
14836
|
if (getHasNextCached()) {
|
|
14766
|
-
|
|
14837
|
+
_context.n = 57;
|
|
14767
14838
|
break;
|
|
14768
14839
|
}
|
|
14769
|
-
|
|
14840
|
+
_context.n = 57;
|
|
14770
14841
|
return effects.put(addMessageAC(message));
|
|
14771
14842
|
case 57:
|
|
14772
14843
|
addAllMessages([message], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
14773
14844
|
hasNextMessage = store.getState().MessageReducer.messagesHasNext;
|
|
14774
14845
|
if (!(!getHasNextCached() && !hasNextMessage)) {
|
|
14775
|
-
|
|
14846
|
+
_context.n = 58;
|
|
14776
14847
|
break;
|
|
14777
14848
|
}
|
|
14778
|
-
|
|
14849
|
+
_context.n = 58;
|
|
14779
14850
|
return effects.put(scrollToNewMessageAC(true, false, true));
|
|
14780
14851
|
case 58:
|
|
14781
|
-
|
|
14782
|
-
|
|
14783
|
-
}
|
|
14784
|
-
_context2.n = 59;
|
|
14852
|
+
addMessageToMap(_channel5.id, message);
|
|
14853
|
+
_context.n = 59;
|
|
14785
14854
|
return effects.put(updateChannelDataAC(_channel5.id, {
|
|
14786
14855
|
messageCount: channelForAdd.messageCount,
|
|
14787
14856
|
unread: channelForAdd.unread,
|
|
@@ -14799,7 +14868,7 @@ function watchForEvents() {
|
|
|
14799
14868
|
}));
|
|
14800
14869
|
case 59:
|
|
14801
14870
|
_groupName4 = getChannelGroupName(_channel5);
|
|
14802
|
-
|
|
14871
|
+
_context.n = 60;
|
|
14803
14872
|
return effects.put(updateSearchedChannelDataAC(_channel5.id, {
|
|
14804
14873
|
messageCount: channelForAdd.messageCount,
|
|
14805
14874
|
unread: channelForAdd.unread,
|
|
@@ -14818,25 +14887,25 @@ function watchForEvents() {
|
|
|
14818
14887
|
case 60:
|
|
14819
14888
|
showNotifications = getShowNotifications();
|
|
14820
14889
|
if (!(showNotifications && !message.silent && message.user.id !== SceytChatClient.user.id && !_channel5.muted)) {
|
|
14821
|
-
|
|
14890
|
+
_context.n = 63;
|
|
14822
14891
|
break;
|
|
14823
14892
|
}
|
|
14824
14893
|
if (!(Notification.permission === 'granted')) {
|
|
14825
|
-
|
|
14894
|
+
_context.n = 63;
|
|
14826
14895
|
break;
|
|
14827
14896
|
}
|
|
14828
|
-
|
|
14897
|
+
_context.n = 61;
|
|
14829
14898
|
return effects.select(browserTabIsActiveSelector);
|
|
14830
14899
|
case 61:
|
|
14831
|
-
tabIsActive =
|
|
14900
|
+
tabIsActive = _context.v;
|
|
14832
14901
|
if (!(document.visibilityState !== 'visible' || !tabIsActive || _channel5.id !== _activeChannelId5)) {
|
|
14833
|
-
|
|
14902
|
+
_context.n = 63;
|
|
14834
14903
|
break;
|
|
14835
14904
|
}
|
|
14836
|
-
|
|
14905
|
+
_context.n = 62;
|
|
14837
14906
|
return effects.select(contactsMapSelector);
|
|
14838
14907
|
case 62:
|
|
14839
|
-
contactsMap =
|
|
14908
|
+
contactsMap = _context.v;
|
|
14840
14909
|
_getFromContacts = getShowOnlyContactUsers();
|
|
14841
14910
|
state = store.getState();
|
|
14842
14911
|
theme = state.ThemeReducer.theme || 'light';
|
|
@@ -14857,16 +14926,16 @@ function watchForEvents() {
|
|
|
14857
14926
|
}) : undefined);
|
|
14858
14927
|
case 63:
|
|
14859
14928
|
if (!(message.repliedInThread && message.parentMessage.id)) {
|
|
14860
|
-
|
|
14929
|
+
_context.n = 65;
|
|
14861
14930
|
break;
|
|
14862
14931
|
}
|
|
14863
|
-
|
|
14932
|
+
_context.n = 64;
|
|
14864
14933
|
return effects.put(markMessagesAsDeliveredAC(message.parentMessage.id, [message.id]));
|
|
14865
14934
|
case 64:
|
|
14866
|
-
|
|
14935
|
+
_context.n = 66;
|
|
14867
14936
|
break;
|
|
14868
14937
|
case 65:
|
|
14869
|
-
|
|
14938
|
+
_context.n = 66;
|
|
14870
14939
|
return effects.put(markMessagesAsDeliveredAC(_channel5.id, [message.id]));
|
|
14871
14940
|
case 66:
|
|
14872
14941
|
updateChannelOnAllChannels(_channel5.id, {
|
|
@@ -14886,157 +14955,157 @@ function watchForEvents() {
|
|
|
14886
14955
|
});
|
|
14887
14956
|
updateChannelLastMessageOnAllChannels(_channel5.id, _channel5.lastMessage);
|
|
14888
14957
|
case 67:
|
|
14889
|
-
return
|
|
14958
|
+
return _context.a(3, 185);
|
|
14890
14959
|
case 68:
|
|
14891
14960
|
channelId = args.channelId, markerList = args.markerList;
|
|
14892
|
-
|
|
14961
|
+
_context.n = 69;
|
|
14893
14962
|
return effects.call(getChannelFromMap, channelId);
|
|
14894
14963
|
case 69:
|
|
14895
|
-
_channel6 =
|
|
14964
|
+
_channel6 = _context.v;
|
|
14896
14965
|
log.info('channel MESSAGE_MARKERS_RECEIVED ... channel: ', _channel6, 'markers list: ', markerList);
|
|
14897
14966
|
if (!_channel6) {
|
|
14898
|
-
|
|
14967
|
+
_context.n = 80;
|
|
14899
14968
|
break;
|
|
14900
14969
|
}
|
|
14901
|
-
|
|
14970
|
+
_context.n = 70;
|
|
14902
14971
|
return effects.call(getActiveChannelId);
|
|
14903
14972
|
case 70:
|
|
14904
|
-
_activeChannelId6 =
|
|
14973
|
+
_activeChannelId6 = _context.v;
|
|
14905
14974
|
updateLastMessage = false;
|
|
14906
14975
|
markersMap = {};
|
|
14907
14976
|
activeChannelMessages = getMessagesFromMap(_activeChannelId6);
|
|
14908
|
-
markerList.messageIds
|
|
14909
|
-
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14918
|
-
|
|
14919
|
-
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14923
|
-
|
|
14924
|
-
|
|
14925
|
-
|
|
14926
|
-
|
|
14927
|
-
|
|
14928
|
-
|
|
14929
|
-
|
|
14930
|
-
|
|
14931
|
-
|
|
14932
|
-
|
|
14933
|
-
|
|
14934
|
-
|
|
14935
|
-
|
|
14936
|
-
|
|
14937
|
-
|
|
14938
|
-
|
|
14939
|
-
|
|
14940
|
-
|
|
14941
|
-
|
|
14942
|
-
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
14946
|
-
}));
|
|
14977
|
+
_iterator = _createForOfIteratorHelperLoose(markerList.messageIds);
|
|
14978
|
+
case 71:
|
|
14979
|
+
if ((_step = _iterator()).done) {
|
|
14980
|
+
_context.n = 76;
|
|
14981
|
+
break;
|
|
14982
|
+
}
|
|
14983
|
+
messageId = _step.value;
|
|
14984
|
+
if (!(activeChannelMessages !== null && activeChannelMessages !== void 0 && activeChannelMessages[messageId])) {
|
|
14985
|
+
_context.n = 73;
|
|
14986
|
+
break;
|
|
14987
|
+
}
|
|
14988
|
+
_context.n = 72;
|
|
14989
|
+
return effects.put(removePendingMessageAC(channelId, messageId));
|
|
14990
|
+
case 72:
|
|
14991
|
+
_context.n = 74;
|
|
14992
|
+
break;
|
|
14993
|
+
case 73:
|
|
14994
|
+
isPendingMessage = getMessageFromPendingMessagesMap(_activeChannelId6, messageId);
|
|
14995
|
+
if (isPendingMessage) {
|
|
14996
|
+
updatePendingMessageOnMap(_activeChannelId6, messageId, {
|
|
14997
|
+
deliveryStatus: markerList.name
|
|
14998
|
+
});
|
|
14999
|
+
}
|
|
15000
|
+
case 74:
|
|
15001
|
+
markersMap[messageId] = true;
|
|
15002
|
+
if (_channel6) {
|
|
15003
|
+
if (_channel6.lastMessage && messageId === _channel6.lastMessage.id && _channel6.lastMessage.deliveryStatus !== MESSAGE_DELIVERY_STATUS.READ) {
|
|
15004
|
+
updateLastMessage = true;
|
|
15005
|
+
}
|
|
15006
|
+
}
|
|
15007
|
+
updateChannelOnAllChannels(channelId, {}, {
|
|
15008
|
+
id: messageId,
|
|
15009
|
+
deliveryStatus: markerList.name
|
|
15010
|
+
});
|
|
15011
|
+
case 75:
|
|
15012
|
+
_context.n = 71;
|
|
15013
|
+
break;
|
|
15014
|
+
case 76:
|
|
14947
15015
|
if (!updateLastMessage) {
|
|
14948
|
-
|
|
15016
|
+
_context.n = 77;
|
|
14949
15017
|
break;
|
|
14950
15018
|
}
|
|
14951
15019
|
lastMessage = _extends({}, _channel6.lastMessage, {
|
|
14952
15020
|
deliveryStatus: markerList.name
|
|
14953
15021
|
});
|
|
14954
15022
|
updateChannelLastMessageOnAllChannels(_channel6.id, lastMessage);
|
|
14955
|
-
|
|
15023
|
+
_context.n = 77;
|
|
14956
15024
|
return effects.put(updateChannelLastMessageStatusAC(lastMessage, _channel6));
|
|
14957
|
-
case
|
|
15025
|
+
case 77:
|
|
14958
15026
|
if (!(_activeChannelId6 === channelId)) {
|
|
14959
|
-
|
|
15027
|
+
_context.n = 79;
|
|
14960
15028
|
break;
|
|
14961
15029
|
}
|
|
14962
|
-
|
|
15030
|
+
_context.n = 78;
|
|
14963
15031
|
return effects.put(updateMessagesStatusAC(markerList.name, markersMap));
|
|
14964
|
-
case
|
|
15032
|
+
case 78:
|
|
14965
15033
|
updateMarkersOnAllMessages(markersMap, markerList.name);
|
|
14966
|
-
case
|
|
15034
|
+
case 79:
|
|
14967
15035
|
updateMessageStatusOnMap(_channel6.id, {
|
|
14968
15036
|
name: markerList.name,
|
|
14969
15037
|
markersMap: markersMap
|
|
14970
15038
|
});
|
|
14971
|
-
|
|
15039
|
+
updateMessageStatusOnAllMessages(markerList.name, markersMap);
|
|
15040
|
+
_context.n = 80;
|
|
14972
15041
|
return effects.put(updateMessagesMarkersAC(channelId, markerList.name, markerList));
|
|
14973
|
-
case
|
|
14974
|
-
return
|
|
14975
|
-
case
|
|
15042
|
+
case 80:
|
|
15043
|
+
return _context.a(3, 185);
|
|
15044
|
+
case 81:
|
|
14976
15045
|
_channelId = args.channelId;
|
|
14977
15046
|
log.info('channel DELETE ... ');
|
|
14978
15047
|
_channel7 = getChannelFromMap(_channelId);
|
|
14979
|
-
|
|
15048
|
+
_context.n = 82;
|
|
14980
15049
|
return effects.put(setChannelToRemoveAC(_channel7));
|
|
14981
|
-
case
|
|
15050
|
+
case 82:
|
|
14982
15051
|
deleteChannelFromAllChannels(_channelId);
|
|
14983
|
-
return
|
|
14984
|
-
case
|
|
15052
|
+
return _context.a(3, 185);
|
|
15053
|
+
case 83:
|
|
14985
15054
|
_channel8 = args.channel, deletedMessage = args.deletedMessage;
|
|
14986
|
-
|
|
15055
|
+
_context.n = 84;
|
|
14987
15056
|
return effects.call(getActiveChannelId);
|
|
14988
|
-
case
|
|
14989
|
-
_activeChannelId7 =
|
|
15057
|
+
case 84:
|
|
15058
|
+
_activeChannelId7 = _context.v;
|
|
14990
15059
|
log.info('channel DELETE_MESSAGE ... ');
|
|
14991
15060
|
_channelExists7 = checkChannelExists(_channel8.id);
|
|
14992
15061
|
if (!(_channel8.id === _activeChannelId7)) {
|
|
14993
|
-
|
|
15062
|
+
_context.n = 85;
|
|
14994
15063
|
break;
|
|
14995
15064
|
}
|
|
14996
15065
|
updateMessageOnAllMessages(deletedMessage.id, deletedMessage);
|
|
14997
|
-
|
|
15066
|
+
_context.n = 85;
|
|
14998
15067
|
return effects.put(updateMessageAC(deletedMessage.id, deletedMessage));
|
|
14999
|
-
case
|
|
15068
|
+
case 85:
|
|
15000
15069
|
updateMessageOnMap(_channel8.id, {
|
|
15001
15070
|
messageId: deletedMessage.id,
|
|
15002
15071
|
params: deletedMessage
|
|
15003
15072
|
});
|
|
15004
15073
|
if (!_channelExists7) {
|
|
15005
|
-
|
|
15074
|
+
_context.n = 87;
|
|
15006
15075
|
break;
|
|
15007
15076
|
}
|
|
15008
|
-
|
|
15077
|
+
_context.n = 86;
|
|
15009
15078
|
return effects.put(updateChannelDataAC(_channel8.id, {
|
|
15010
15079
|
newMessageCount: _channel8.newMessageCount,
|
|
15011
15080
|
muted: _channel8.muted,
|
|
15012
15081
|
mutedTill: _channel8.mutedTill
|
|
15013
15082
|
}));
|
|
15014
|
-
case
|
|
15083
|
+
case 86:
|
|
15015
15084
|
if (!(_channel8.lastMessage.id === deletedMessage.id)) {
|
|
15016
|
-
|
|
15085
|
+
_context.n = 87;
|
|
15017
15086
|
break;
|
|
15018
15087
|
}
|
|
15019
|
-
|
|
15088
|
+
_context.n = 87;
|
|
15020
15089
|
return effects.put(updateChannelLastMessageAC(deletedMessage, _channel8));
|
|
15021
|
-
case
|
|
15090
|
+
case 87:
|
|
15022
15091
|
updateChannelOnAllChannels(_channel8.id, {
|
|
15023
15092
|
newMessageCount: _channel8.newMessageCount,
|
|
15024
15093
|
muted: _channel8.muted,
|
|
15025
15094
|
mutedTill: _channel8.mutedTill
|
|
15026
15095
|
}, deletedMessage);
|
|
15027
|
-
return
|
|
15028
|
-
case
|
|
15096
|
+
return _context.a(3, 185);
|
|
15097
|
+
case 88:
|
|
15029
15098
|
_channel9 = args.channel, _message = args.message;
|
|
15030
|
-
|
|
15099
|
+
_context.n = 89;
|
|
15031
15100
|
return effects.call(getActiveChannelId);
|
|
15032
|
-
case
|
|
15033
|
-
_activeChannelId8 =
|
|
15101
|
+
case 89:
|
|
15102
|
+
_activeChannelId8 = _context.v;
|
|
15034
15103
|
_channelExists8 = checkChannelExists(_channel9.id);
|
|
15035
15104
|
if (!(_channel9.id === _activeChannelId8)) {
|
|
15036
|
-
|
|
15105
|
+
_context.n = 91;
|
|
15037
15106
|
break;
|
|
15038
15107
|
}
|
|
15039
|
-
|
|
15108
|
+
_context.n = 90;
|
|
15040
15109
|
return effects.put(updateMessageAC(_message.id, {
|
|
15041
15110
|
body: _message.body,
|
|
15042
15111
|
state: _message.state,
|
|
@@ -15045,7 +15114,7 @@ function watchForEvents() {
|
|
|
15045
15114
|
mentionedUsers: _message.mentionedUsers,
|
|
15046
15115
|
updatedAt: _message.updatedAt
|
|
15047
15116
|
}));
|
|
15048
|
-
case
|
|
15117
|
+
case 90:
|
|
15049
15118
|
updateMessageOnAllMessages(_message.id, {
|
|
15050
15119
|
body: _message.body,
|
|
15051
15120
|
state: _message.state,
|
|
@@ -15054,18 +15123,18 @@ function watchForEvents() {
|
|
|
15054
15123
|
mentionedUsers: _message.mentionedUsers,
|
|
15055
15124
|
updatedAt: _message.updatedAt
|
|
15056
15125
|
});
|
|
15057
|
-
case
|
|
15126
|
+
case 91:
|
|
15058
15127
|
if (!_channelExists8) {
|
|
15059
|
-
|
|
15128
|
+
_context.n = 92;
|
|
15060
15129
|
break;
|
|
15061
15130
|
}
|
|
15062
15131
|
if (!(_channel9.lastMessage.id === _message.id)) {
|
|
15063
|
-
|
|
15132
|
+
_context.n = 92;
|
|
15064
15133
|
break;
|
|
15065
15134
|
}
|
|
15066
|
-
|
|
15135
|
+
_context.n = 92;
|
|
15067
15136
|
return effects.put(updateChannelLastMessageAC(_message, _channel9));
|
|
15068
|
-
case
|
|
15137
|
+
case 92:
|
|
15069
15138
|
if (checkChannelExistsOnMessagesMap(_channel9.id)) {
|
|
15070
15139
|
updateMessageOnMap(_channel9.id, {
|
|
15071
15140
|
messageId: _message.id,
|
|
@@ -15073,39 +15142,39 @@ function watchForEvents() {
|
|
|
15073
15142
|
});
|
|
15074
15143
|
}
|
|
15075
15144
|
updateChannelOnAllChannels(_channel9.id, {}, _message);
|
|
15076
|
-
return
|
|
15077
|
-
case
|
|
15145
|
+
return _context.a(3, 185);
|
|
15146
|
+
case 93:
|
|
15078
15147
|
_channel0 = args.channel, user = args.user, _message2 = args.message, reaction = args.reaction;
|
|
15079
15148
|
isSelf = user.id === SceytChatClient.user.id;
|
|
15080
|
-
|
|
15149
|
+
_context.n = 94;
|
|
15081
15150
|
return effects.call(getActiveChannelId);
|
|
15082
|
-
case
|
|
15083
|
-
_activeChannelId9 =
|
|
15151
|
+
case 94:
|
|
15152
|
+
_activeChannelId9 = _context.v;
|
|
15084
15153
|
if (!(_channel0.id === _activeChannelId9)) {
|
|
15085
|
-
|
|
15154
|
+
_context.n = 96;
|
|
15086
15155
|
break;
|
|
15087
15156
|
}
|
|
15088
|
-
|
|
15157
|
+
_context.n = 95;
|
|
15089
15158
|
return effects.put(addReactionToMessageAC(_message2, reaction, isSelf));
|
|
15090
|
-
case
|
|
15159
|
+
case 95:
|
|
15091
15160
|
addReactionOnAllMessages(_message2, reaction, true);
|
|
15092
|
-
case
|
|
15161
|
+
case 96:
|
|
15093
15162
|
if (!(_message2.user.id === SceytChatClient.user.id)) {
|
|
15094
|
-
|
|
15163
|
+
_context.n = 100;
|
|
15095
15164
|
break;
|
|
15096
15165
|
}
|
|
15097
15166
|
if (!(!isSelf && Notification.permission === 'granted')) {
|
|
15098
|
-
|
|
15167
|
+
_context.n = 98;
|
|
15099
15168
|
break;
|
|
15100
15169
|
}
|
|
15101
15170
|
if (!(document.visibilityState !== 'visible' || _channel0.id !== _activeChannelId9)) {
|
|
15102
|
-
|
|
15171
|
+
_context.n = 98;
|
|
15103
15172
|
break;
|
|
15104
15173
|
}
|
|
15105
|
-
|
|
15174
|
+
_context.n = 97;
|
|
15106
15175
|
return effects.select(contactsMapSelector);
|
|
15107
|
-
case
|
|
15108
|
-
_contactsMap =
|
|
15176
|
+
case 97:
|
|
15177
|
+
_contactsMap = _context.v;
|
|
15109
15178
|
_getFromContacts2 = getShowOnlyContactUsers();
|
|
15110
15179
|
_state = store.getState();
|
|
15111
15180
|
_theme = _state.ThemeReducer.theme || 'light';
|
|
@@ -15124,9 +15193,9 @@ function watchForEvents() {
|
|
|
15124
15193
|
setNotification(_messageBody, reaction.user, _channel0, reaction.key, _message2.attachments && _message2.attachments.length ? _message2.attachments.find(function (att) {
|
|
15125
15194
|
return att.type !== attachmentTypes.link;
|
|
15126
15195
|
}) : undefined);
|
|
15127
|
-
case
|
|
15196
|
+
case 98:
|
|
15128
15197
|
if (!(_channel0.newReactions && _channel0.newReactions.length)) {
|
|
15129
|
-
|
|
15198
|
+
_context.n = 99;
|
|
15130
15199
|
break;
|
|
15131
15200
|
}
|
|
15132
15201
|
channelUpdateParams = {
|
|
@@ -15136,9 +15205,9 @@ function watchForEvents() {
|
|
|
15136
15205
|
muted: _channel0.muted,
|
|
15137
15206
|
mutedTill: _channel0.mutedTill
|
|
15138
15207
|
};
|
|
15139
|
-
|
|
15208
|
+
_context.n = 99;
|
|
15140
15209
|
return effects.put(updateChannelDataAC(_channel0.id, channelUpdateParams));
|
|
15141
|
-
case
|
|
15210
|
+
case 99:
|
|
15142
15211
|
updateChannelOnAllChannels(_channel0.id, {
|
|
15143
15212
|
userMessageReactions: _channel0.newReactions,
|
|
15144
15213
|
lastReactedMessage: _message2,
|
|
@@ -15146,31 +15215,31 @@ function watchForEvents() {
|
|
|
15146
15215
|
muted: _channel0.muted,
|
|
15147
15216
|
mutedTill: _channel0.mutedTill
|
|
15148
15217
|
});
|
|
15149
|
-
case
|
|
15218
|
+
case 100:
|
|
15150
15219
|
if (checkChannelExistsOnMessagesMap(_channel0.id)) {
|
|
15151
15220
|
addReactionToMessageOnMap(_channel0.id, _message2, reaction, true);
|
|
15152
15221
|
}
|
|
15153
|
-
return
|
|
15154
|
-
case
|
|
15155
|
-
_channel1 = args.channel, pollDetails = args.pollDetails,
|
|
15222
|
+
return _context.a(3, 185);
|
|
15223
|
+
case 101:
|
|
15224
|
+
_channel1 = args.channel, pollDetails = args.pollDetails, _messageId = args.messageId;
|
|
15156
15225
|
pollDetailsData = pollDetails;
|
|
15157
|
-
|
|
15226
|
+
_context.n = 102;
|
|
15158
15227
|
return effects.call(getActiveChannelId);
|
|
15159
|
-
case
|
|
15160
|
-
_activeChannelId0 =
|
|
15228
|
+
case 102:
|
|
15229
|
+
_activeChannelId0 = _context.v;
|
|
15161
15230
|
addedVotes = (pollDetailsData === null || pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan = pollDetailsData.changedVotes) === null || _pollDetailsData$chan === void 0 ? void 0 : _pollDetailsData$chan.addedVotes) || [];
|
|
15162
15231
|
deletedVotes = (pollDetailsData === null || pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan2 = pollDetailsData.changedVotes) === null || _pollDetailsData$chan2 === void 0 ? void 0 : _pollDetailsData$chan2.removedVotes) || [];
|
|
15163
15232
|
objs = [];
|
|
15164
|
-
for (
|
|
15165
|
-
vote =
|
|
15233
|
+
for (_iterator2 = _createForOfIteratorHelperLoose(deletedVotes); !(_step2 = _iterator2()).done;) {
|
|
15234
|
+
vote = _step2.value;
|
|
15166
15235
|
objs.push({
|
|
15167
15236
|
type: vote.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15168
15237
|
vote: vote,
|
|
15169
15238
|
incrementVotesPerOptionCount: -((deletedVotes === null || deletedVotes === void 0 ? void 0 : deletedVotes.length) || 0)
|
|
15170
15239
|
});
|
|
15171
15240
|
}
|
|
15172
|
-
for (
|
|
15173
|
-
_vote =
|
|
15241
|
+
for (_iterator3 = _createForOfIteratorHelperLoose(addedVotes); !(_step3 = _iterator3()).done;) {
|
|
15242
|
+
_vote = _step3.value;
|
|
15174
15243
|
objs.push({
|
|
15175
15244
|
type: _vote.user.id === SceytChatClient.user.id ? 'addOwn' : 'add',
|
|
15176
15245
|
vote: _vote,
|
|
@@ -15178,44 +15247,44 @@ function watchForEvents() {
|
|
|
15178
15247
|
});
|
|
15179
15248
|
}
|
|
15180
15249
|
_i = 0, _objs = objs;
|
|
15181
|
-
case
|
|
15250
|
+
case 103:
|
|
15182
15251
|
if (!(_i < _objs.length)) {
|
|
15183
|
-
|
|
15252
|
+
_context.n = 107;
|
|
15184
15253
|
break;
|
|
15185
15254
|
}
|
|
15186
15255
|
obj = _objs[_i];
|
|
15187
15256
|
if (!(pollDetailsData !== null && pollDetailsData !== void 0 && pollDetailsData.id && obj.vote)) {
|
|
15188
|
-
|
|
15257
|
+
_context.n = 106;
|
|
15189
15258
|
break;
|
|
15190
15259
|
}
|
|
15191
15260
|
key = pollDetailsData.id + "_" + obj.vote.optionId;
|
|
15192
15261
|
hasNext = ((_store$getState$Messa = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa === void 0 ? void 0 : _store$getState$Messa[key]) || false;
|
|
15193
15262
|
if (!(obj.type === 'addOwn')) {
|
|
15194
|
-
|
|
15263
|
+
_context.n = 105;
|
|
15195
15264
|
break;
|
|
15196
15265
|
}
|
|
15197
|
-
|
|
15266
|
+
_context.n = 104;
|
|
15198
15267
|
return effects.put(addPollVotesToListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote], hasNext, undefined));
|
|
15199
|
-
case
|
|
15200
|
-
|
|
15268
|
+
case 104:
|
|
15269
|
+
_context.n = 106;
|
|
15201
15270
|
break;
|
|
15202
|
-
case
|
|
15203
|
-
|
|
15204
|
-
return effects.put(deletePollVotesFromListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote],
|
|
15205
|
-
case
|
|
15271
|
+
case 105:
|
|
15272
|
+
_context.n = 106;
|
|
15273
|
+
return effects.put(deletePollVotesFromListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote], _messageId));
|
|
15274
|
+
case 106:
|
|
15206
15275
|
_i++;
|
|
15207
|
-
|
|
15276
|
+
_context.n = 103;
|
|
15208
15277
|
break;
|
|
15209
|
-
case
|
|
15278
|
+
case 107:
|
|
15210
15279
|
_i2 = 0, _objs2 = objs;
|
|
15211
|
-
case
|
|
15280
|
+
case 108:
|
|
15212
15281
|
if (!(_i2 < _objs2.length)) {
|
|
15213
|
-
|
|
15282
|
+
_context.n = 110;
|
|
15214
15283
|
break;
|
|
15215
15284
|
}
|
|
15216
15285
|
_obj = _objs2[_i2];
|
|
15217
15286
|
updateMessageOnMap(_channel1.id, {
|
|
15218
|
-
messageId:
|
|
15287
|
+
messageId: _messageId,
|
|
15219
15288
|
params: {}
|
|
15220
15289
|
}, {
|
|
15221
15290
|
type: _obj.type,
|
|
@@ -15223,29 +15292,29 @@ function watchForEvents() {
|
|
|
15223
15292
|
incrementVotesPerOptionCount: _obj.incrementVotesPerOptionCount
|
|
15224
15293
|
});
|
|
15225
15294
|
if (!(_channel1.id === _activeChannelId0)) {
|
|
15226
|
-
|
|
15295
|
+
_context.n = 109;
|
|
15227
15296
|
break;
|
|
15228
15297
|
}
|
|
15229
|
-
updateMessageOnAllMessages(
|
|
15230
|
-
|
|
15231
|
-
return effects.put(updateMessageAC(
|
|
15232
|
-
case
|
|
15298
|
+
updateMessageOnAllMessages(_messageId, {}, _obj);
|
|
15299
|
+
_context.n = 109;
|
|
15300
|
+
return effects.put(updateMessageAC(_messageId, {}, undefined, _obj));
|
|
15301
|
+
case 109:
|
|
15233
15302
|
_i2++;
|
|
15234
|
-
|
|
15303
|
+
_context.n = 108;
|
|
15235
15304
|
break;
|
|
15236
|
-
case
|
|
15237
|
-
return
|
|
15238
|
-
case
|
|
15239
|
-
_channel10 = args.channel, _pollDetails = args.pollDetails,
|
|
15305
|
+
case 110:
|
|
15306
|
+
return _context.a(3, 185);
|
|
15307
|
+
case 111:
|
|
15308
|
+
_channel10 = args.channel, _pollDetails = args.pollDetails, _messageId2 = args.messageId;
|
|
15240
15309
|
_pollDetailsData = _pollDetails;
|
|
15241
|
-
|
|
15310
|
+
_context.n = 112;
|
|
15242
15311
|
return effects.call(getActiveChannelId);
|
|
15243
|
-
case
|
|
15244
|
-
_activeChannelId1 =
|
|
15312
|
+
case 112:
|
|
15313
|
+
_activeChannelId1 = _context.v;
|
|
15245
15314
|
_deletedVotes = (_pollDetailsData === null || _pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan3 = _pollDetailsData.changedVotes) === null || _pollDetailsData$chan3 === void 0 ? void 0 : _pollDetailsData$chan3.removedVotes) || [];
|
|
15246
15315
|
_objs3 = [];
|
|
15247
|
-
for (
|
|
15248
|
-
_vote2 =
|
|
15316
|
+
for (_iterator4 = _createForOfIteratorHelperLoose(_deletedVotes); !(_step4 = _iterator4()).done;) {
|
|
15317
|
+
_vote2 = _step4.value;
|
|
15249
15318
|
_objs3.push({
|
|
15250
15319
|
type: _vote2.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15251
15320
|
vote: _vote2,
|
|
@@ -15253,58 +15322,58 @@ function watchForEvents() {
|
|
|
15253
15322
|
});
|
|
15254
15323
|
}
|
|
15255
15324
|
_i3 = 0, _objs4 = _objs3;
|
|
15256
|
-
case
|
|
15325
|
+
case 113:
|
|
15257
15326
|
if (!(_i3 < _objs4.length)) {
|
|
15258
|
-
|
|
15327
|
+
_context.n = 115;
|
|
15259
15328
|
break;
|
|
15260
15329
|
}
|
|
15261
15330
|
_obj2 = _objs4[_i3];
|
|
15262
15331
|
if (!(_pollDetailsData !== null && _pollDetailsData !== void 0 && _pollDetailsData.id && _obj2.vote)) {
|
|
15263
|
-
|
|
15332
|
+
_context.n = 114;
|
|
15264
15333
|
break;
|
|
15265
15334
|
}
|
|
15266
|
-
|
|
15267
|
-
return effects.put(deletePollVotesFromListAC(_pollDetailsData.id, _obj2.vote.optionId, [_obj2.vote],
|
|
15268
|
-
case
|
|
15335
|
+
_context.n = 114;
|
|
15336
|
+
return effects.put(deletePollVotesFromListAC(_pollDetailsData.id, _obj2.vote.optionId, [_obj2.vote], _messageId2));
|
|
15337
|
+
case 114:
|
|
15269
15338
|
_i3++;
|
|
15270
|
-
|
|
15339
|
+
_context.n = 113;
|
|
15271
15340
|
break;
|
|
15272
|
-
case
|
|
15341
|
+
case 115:
|
|
15273
15342
|
_i4 = 0, _objs5 = _objs3;
|
|
15274
|
-
case
|
|
15343
|
+
case 116:
|
|
15275
15344
|
if (!(_i4 < _objs5.length)) {
|
|
15276
|
-
|
|
15345
|
+
_context.n = 118;
|
|
15277
15346
|
break;
|
|
15278
15347
|
}
|
|
15279
15348
|
_obj3 = _objs5[_i4];
|
|
15280
15349
|
updateMessageOnMap(_channel10.id, {
|
|
15281
|
-
messageId:
|
|
15350
|
+
messageId: _messageId2,
|
|
15282
15351
|
params: {}
|
|
15283
15352
|
}, _obj3);
|
|
15284
15353
|
if (!(_channel10.id === _activeChannelId1)) {
|
|
15285
|
-
|
|
15354
|
+
_context.n = 117;
|
|
15286
15355
|
break;
|
|
15287
15356
|
}
|
|
15288
|
-
updateMessageOnAllMessages(
|
|
15289
|
-
|
|
15290
|
-
return effects.put(updateMessageAC(
|
|
15291
|
-
case
|
|
15357
|
+
updateMessageOnAllMessages(_messageId2, {}, _obj3);
|
|
15358
|
+
_context.n = 117;
|
|
15359
|
+
return effects.put(updateMessageAC(_messageId2, {}, undefined, _obj3));
|
|
15360
|
+
case 117:
|
|
15292
15361
|
_i4++;
|
|
15293
|
-
|
|
15362
|
+
_context.n = 116;
|
|
15294
15363
|
break;
|
|
15295
|
-
case
|
|
15296
|
-
return
|
|
15297
|
-
case
|
|
15298
|
-
_channel11 = args.channel, _pollDetails2 = args.pollDetails,
|
|
15299
|
-
|
|
15364
|
+
case 118:
|
|
15365
|
+
return _context.a(3, 185);
|
|
15366
|
+
case 119:
|
|
15367
|
+
_channel11 = args.channel, _pollDetails2 = args.pollDetails, _messageId3 = args.messageId;
|
|
15368
|
+
_context.n = 120;
|
|
15300
15369
|
return effects.call(getActiveChannelId);
|
|
15301
|
-
case
|
|
15302
|
-
_activeChannelId10 =
|
|
15370
|
+
case 120:
|
|
15371
|
+
_activeChannelId10 = _context.v;
|
|
15303
15372
|
_pollDetailsData2 = _pollDetails2;
|
|
15304
15373
|
retractedVotes = (_pollDetailsData2 === null || _pollDetailsData2 === void 0 ? void 0 : (_pollDetailsData2$cha = _pollDetailsData2.changedVotes) === null || _pollDetailsData2$cha === void 0 ? void 0 : _pollDetailsData2$cha.removedVotes) || [];
|
|
15305
15374
|
_objs6 = [];
|
|
15306
|
-
for (
|
|
15307
|
-
_vote4 =
|
|
15375
|
+
for (_iterator5 = _createForOfIteratorHelperLoose(retractedVotes); !(_step5 = _iterator5()).done;) {
|
|
15376
|
+
_vote4 = _step5.value;
|
|
15308
15377
|
_objs6.push({
|
|
15309
15378
|
type: _vote4.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15310
15379
|
vote: _vote4,
|
|
@@ -15312,109 +15381,109 @@ function watchForEvents() {
|
|
|
15312
15381
|
});
|
|
15313
15382
|
}
|
|
15314
15383
|
_i5 = 0, _objs7 = _objs6;
|
|
15315
|
-
case
|
|
15384
|
+
case 121:
|
|
15316
15385
|
if (!(_i5 < _objs7.length)) {
|
|
15317
|
-
|
|
15386
|
+
_context.n = 126;
|
|
15318
15387
|
break;
|
|
15319
15388
|
}
|
|
15320
15389
|
_obj4 = _objs7[_i5];
|
|
15321
15390
|
updateMessageOnMap(_channel11.id, {
|
|
15322
|
-
messageId:
|
|
15391
|
+
messageId: _messageId3,
|
|
15323
15392
|
params: {}
|
|
15324
15393
|
}, _obj4);
|
|
15325
15394
|
if (!(_pollDetailsData2 !== null && _pollDetailsData2 !== void 0 && _pollDetailsData2.id && retractedVotes.length > 0)) {
|
|
15326
|
-
|
|
15395
|
+
_context.n = 124;
|
|
15327
15396
|
break;
|
|
15328
15397
|
}
|
|
15329
|
-
|
|
15330
|
-
case
|
|
15331
|
-
if ((
|
|
15332
|
-
|
|
15398
|
+
_iterator6 = _createForOfIteratorHelperLoose(retractedVotes);
|
|
15399
|
+
case 122:
|
|
15400
|
+
if ((_step6 = _iterator6()).done) {
|
|
15401
|
+
_context.n = 124;
|
|
15333
15402
|
break;
|
|
15334
15403
|
}
|
|
15335
|
-
_vote3 =
|
|
15336
|
-
|
|
15337
|
-
return effects.put(deletePollVotesFromListAC(_pollDetailsData2.id, _vote3.optionId, [_vote3],
|
|
15338
|
-
case
|
|
15339
|
-
|
|
15404
|
+
_vote3 = _step6.value;
|
|
15405
|
+
_context.n = 123;
|
|
15406
|
+
return effects.put(deletePollVotesFromListAC(_pollDetailsData2.id, _vote3.optionId, [_vote3], _messageId3));
|
|
15407
|
+
case 123:
|
|
15408
|
+
_context.n = 122;
|
|
15340
15409
|
break;
|
|
15341
|
-
case
|
|
15410
|
+
case 124:
|
|
15342
15411
|
if (!(_channel11.id === _activeChannelId10)) {
|
|
15343
|
-
|
|
15412
|
+
_context.n = 125;
|
|
15344
15413
|
break;
|
|
15345
15414
|
}
|
|
15346
|
-
updateMessageOnAllMessages(
|
|
15347
|
-
|
|
15348
|
-
return effects.put(updateMessageAC(
|
|
15349
|
-
case
|
|
15415
|
+
updateMessageOnAllMessages(_messageId3, {}, _obj4);
|
|
15416
|
+
_context.n = 125;
|
|
15417
|
+
return effects.put(updateMessageAC(_messageId3, {}, undefined, _obj4));
|
|
15418
|
+
case 125:
|
|
15350
15419
|
_i5++;
|
|
15351
|
-
|
|
15420
|
+
_context.n = 121;
|
|
15352
15421
|
break;
|
|
15353
|
-
case
|
|
15354
|
-
return
|
|
15355
|
-
case
|
|
15356
|
-
_channel12 = args.channel,
|
|
15357
|
-
|
|
15422
|
+
case 126:
|
|
15423
|
+
return _context.a(3, 185);
|
|
15424
|
+
case 127:
|
|
15425
|
+
_channel12 = args.channel, _messageId4 = args.messageId;
|
|
15426
|
+
_context.n = 128;
|
|
15358
15427
|
return effects.call(getActiveChannelId);
|
|
15359
|
-
case
|
|
15360
|
-
_activeChannelId11 =
|
|
15428
|
+
case 128:
|
|
15429
|
+
_activeChannelId11 = _context.v;
|
|
15361
15430
|
_obj5 = {
|
|
15362
15431
|
type: 'close',
|
|
15363
15432
|
incrementVotesPerOptionCount: 0
|
|
15364
15433
|
};
|
|
15365
15434
|
updateMessageOnMap(_channel12.id, {
|
|
15366
|
-
messageId:
|
|
15435
|
+
messageId: _messageId4,
|
|
15367
15436
|
params: {}
|
|
15368
15437
|
}, _obj5);
|
|
15369
15438
|
if (!(_channel12.id === _activeChannelId11)) {
|
|
15370
|
-
|
|
15439
|
+
_context.n = 130;
|
|
15371
15440
|
break;
|
|
15372
15441
|
}
|
|
15373
|
-
updateMessageOnAllMessages(
|
|
15374
|
-
|
|
15375
|
-
return effects.put(updateMessageAC(
|
|
15376
|
-
case
|
|
15377
|
-
return
|
|
15378
|
-
case
|
|
15379
|
-
return
|
|
15380
|
-
case
|
|
15442
|
+
updateMessageOnAllMessages(_messageId4, {}, _obj5);
|
|
15443
|
+
_context.n = 129;
|
|
15444
|
+
return effects.put(updateMessageAC(_messageId4, {}, undefined, _obj5));
|
|
15445
|
+
case 129:
|
|
15446
|
+
return _context.a(3, 185);
|
|
15447
|
+
case 130:
|
|
15448
|
+
return _context.a(3, 185);
|
|
15449
|
+
case 131:
|
|
15381
15450
|
_channel13 = args.channel, _user = args.user, _message3 = args.message, _reaction = args.reaction;
|
|
15382
15451
|
log.info('channel REACTION_DELETED ... ', _channel13);
|
|
15383
15452
|
channelFromMap = getChannelFromMap(_channel13.id);
|
|
15384
15453
|
_isSelf = _user.id === SceytChatClient.user.id;
|
|
15385
|
-
|
|
15454
|
+
_context.n = 132;
|
|
15386
15455
|
return effects.call(getActiveChannelId);
|
|
15387
|
-
case
|
|
15388
|
-
_activeChannelId12 =
|
|
15456
|
+
case 132:
|
|
15457
|
+
_activeChannelId12 = _context.v;
|
|
15389
15458
|
if (!(_channel13.id === _activeChannelId12)) {
|
|
15390
|
-
|
|
15459
|
+
_context.n = 134;
|
|
15391
15460
|
break;
|
|
15392
15461
|
}
|
|
15393
|
-
|
|
15462
|
+
_context.n = 133;
|
|
15394
15463
|
return effects.put(deleteReactionFromMessageAC(_message3, _reaction, _isSelf));
|
|
15395
|
-
case
|
|
15464
|
+
case 133:
|
|
15396
15465
|
removeReactionOnAllMessages(_message3, _reaction, true);
|
|
15397
|
-
case
|
|
15466
|
+
case 134:
|
|
15398
15467
|
_channelUpdateParams = JSON.parse(JSON.stringify(_channel13));
|
|
15399
15468
|
if (channelFromMap && channelFromMap.lastReactedMessage && channelFromMap.lastReactedMessage.id === _message3.id) {
|
|
15400
15469
|
_channelUpdateParams.lastReactedMessage = null;
|
|
15401
15470
|
}
|
|
15402
|
-
|
|
15471
|
+
_context.n = 135;
|
|
15403
15472
|
return effects.put(updateChannelDataAC(_channel13.id, _channelUpdateParams));
|
|
15404
|
-
case
|
|
15473
|
+
case 135:
|
|
15405
15474
|
updateChannelOnAllChannels(_channel13.id, _channelUpdateParams);
|
|
15406
15475
|
if (checkChannelExistsOnMessagesMap(_channel13.id)) {
|
|
15407
15476
|
removeReactionToMessageOnMap(_channel13.id, _message3, _reaction, true);
|
|
15408
15477
|
}
|
|
15409
|
-
return
|
|
15410
|
-
case
|
|
15478
|
+
return _context.a(3, 185);
|
|
15479
|
+
case 136:
|
|
15411
15480
|
_channel14 = args.channel;
|
|
15412
15481
|
if (!_channel14) {
|
|
15413
|
-
|
|
15482
|
+
_context.n = 138;
|
|
15414
15483
|
break;
|
|
15415
15484
|
}
|
|
15416
15485
|
_updatedChannel = JSON.parse(JSON.stringify(_channel14));
|
|
15417
|
-
|
|
15486
|
+
_context.n = 137;
|
|
15418
15487
|
return effects.put(updateChannelDataAC(_channel14.id, {
|
|
15419
15488
|
lastMessage: _channel14.lastMessage,
|
|
15420
15489
|
newMessageCount: _channel14.newMessageCount,
|
|
@@ -15427,36 +15496,36 @@ function watchForEvents() {
|
|
|
15427
15496
|
lastDisplayedMessageId: _channel14.lastDisplayedMessageId,
|
|
15428
15497
|
messageRetentionPeriod: _channel14.messageRetentionPeriod
|
|
15429
15498
|
}));
|
|
15430
|
-
case
|
|
15499
|
+
case 137:
|
|
15431
15500
|
updateChannelOnAllChannels(_channel14.id, _updatedChannel);
|
|
15432
|
-
case
|
|
15433
|
-
return
|
|
15434
|
-
case
|
|
15501
|
+
case 138:
|
|
15502
|
+
return _context.a(3, 185);
|
|
15503
|
+
case 139:
|
|
15435
15504
|
_channel15 = args.channel;
|
|
15436
15505
|
log.info('CLEAR_HISTORY: ', _channel15);
|
|
15437
|
-
|
|
15506
|
+
_context.n = 140;
|
|
15438
15507
|
return effects.call(getActiveChannelId);
|
|
15439
|
-
case
|
|
15440
|
-
_activeChannelId13 =
|
|
15441
|
-
|
|
15508
|
+
case 140:
|
|
15509
|
+
_activeChannelId13 = _context.v;
|
|
15510
|
+
_context.n = 141;
|
|
15442
15511
|
return effects.call(checkChannelExists, _channel15.id);
|
|
15443
|
-
case
|
|
15444
|
-
channelExist =
|
|
15512
|
+
case 141:
|
|
15513
|
+
channelExist = _context.v;
|
|
15445
15514
|
if (!(_channel15.id === _activeChannelId13)) {
|
|
15446
|
-
|
|
15515
|
+
_context.n = 143;
|
|
15447
15516
|
break;
|
|
15448
15517
|
}
|
|
15449
|
-
|
|
15518
|
+
_context.n = 142;
|
|
15450
15519
|
return effects.put(clearMessagesAC());
|
|
15451
|
-
case
|
|
15520
|
+
case 142:
|
|
15452
15521
|
removeAllMessages();
|
|
15453
|
-
case
|
|
15522
|
+
case 143:
|
|
15454
15523
|
removeMessagesFromMap(_channel15.id);
|
|
15455
15524
|
if (!channelExist) {
|
|
15456
|
-
|
|
15525
|
+
_context.n = 144;
|
|
15457
15526
|
break;
|
|
15458
15527
|
}
|
|
15459
|
-
|
|
15528
|
+
_context.n = 144;
|
|
15460
15529
|
return effects.put(updateChannelDataAC(_channel15.id, {
|
|
15461
15530
|
lastMessage: null,
|
|
15462
15531
|
newMessageCount: 0,
|
|
@@ -15464,7 +15533,7 @@ function watchForEvents() {
|
|
|
15464
15533
|
muted: _channel15.muted,
|
|
15465
15534
|
mutedTill: _channel15.mutedTill
|
|
15466
15535
|
}));
|
|
15467
|
-
case
|
|
15536
|
+
case 144:
|
|
15468
15537
|
updateChannelOnAllChannels(_channel15.id, {
|
|
15469
15538
|
lastMessage: null,
|
|
15470
15539
|
newMessageCount: 0,
|
|
@@ -15472,173 +15541,173 @@ function watchForEvents() {
|
|
|
15472
15541
|
muted: _channel15.muted,
|
|
15473
15542
|
mutedTill: _channel15.mutedTill
|
|
15474
15543
|
});
|
|
15475
|
-
return
|
|
15476
|
-
case
|
|
15544
|
+
return _context.a(3, 185);
|
|
15545
|
+
case 145:
|
|
15477
15546
|
_channel16 = args.channel;
|
|
15478
15547
|
log.info('channel MUTE ... ');
|
|
15479
|
-
|
|
15548
|
+
_context.n = 146;
|
|
15480
15549
|
return effects.put(updateChannelDataAC(_channel16.id, {
|
|
15481
15550
|
muted: _channel16.muted,
|
|
15482
15551
|
mutedTill: _channel16.mutedTill
|
|
15483
15552
|
}));
|
|
15484
|
-
case
|
|
15553
|
+
case 146:
|
|
15485
15554
|
updateChannelOnAllChannels(_channel16.id, {
|
|
15486
15555
|
muted: _channel16.muted,
|
|
15487
15556
|
mutedTill: _channel16.mutedTill
|
|
15488
15557
|
});
|
|
15489
|
-
return
|
|
15490
|
-
case
|
|
15558
|
+
return _context.a(3, 185);
|
|
15559
|
+
case 147:
|
|
15491
15560
|
_channel17 = args.channel;
|
|
15492
15561
|
log.info('channel UNMUTE ... ');
|
|
15493
|
-
|
|
15562
|
+
_context.n = 148;
|
|
15494
15563
|
return effects.put(updateChannelDataAC(_channel17.id, {
|
|
15495
15564
|
muted: _channel17.muted,
|
|
15496
15565
|
mutedTill: _channel17.mutedTill
|
|
15497
15566
|
}));
|
|
15498
|
-
case
|
|
15567
|
+
case 148:
|
|
15499
15568
|
updateChannelOnAllChannels(_channel17.id, {
|
|
15500
15569
|
muted: _channel17.muted,
|
|
15501
15570
|
mutedTill: _channel17.mutedTill
|
|
15502
15571
|
});
|
|
15503
|
-
return
|
|
15504
|
-
case
|
|
15572
|
+
return _context.a(3, 185);
|
|
15573
|
+
case 149:
|
|
15505
15574
|
_channel18 = args.channel;
|
|
15506
15575
|
log.info('channel PINED ... ');
|
|
15507
|
-
|
|
15576
|
+
_context.n = 150;
|
|
15508
15577
|
return effects.put(updateChannelDataAC(_channel18.id, {
|
|
15509
15578
|
pinnedAt: _channel18.pinnedAt
|
|
15510
15579
|
}, true));
|
|
15511
|
-
case
|
|
15580
|
+
case 150:
|
|
15512
15581
|
updateChannelOnAllChannels(_channel18.id, {
|
|
15513
15582
|
pinnedAt: _channel18.pinnedAt
|
|
15514
15583
|
});
|
|
15515
|
-
return
|
|
15516
|
-
case
|
|
15584
|
+
return _context.a(3, 185);
|
|
15585
|
+
case 151:
|
|
15517
15586
|
_channel19 = args.channel;
|
|
15518
15587
|
log.info('channel UNPINED ... ');
|
|
15519
|
-
|
|
15588
|
+
_context.n = 152;
|
|
15520
15589
|
return effects.put(updateChannelDataAC(_channel19.id, {
|
|
15521
15590
|
pinnedAt: _channel19.pinnedAt
|
|
15522
15591
|
}, false, true));
|
|
15523
|
-
case
|
|
15592
|
+
case 152:
|
|
15524
15593
|
updateChannelOnAllChannels(_channel19.id, {
|
|
15525
15594
|
pinnedAt: _channel19.pinnedAt
|
|
15526
15595
|
});
|
|
15527
|
-
return
|
|
15528
|
-
case
|
|
15596
|
+
return _context.a(3, 185);
|
|
15597
|
+
case 153:
|
|
15529
15598
|
_channel20 = args.channel;
|
|
15530
15599
|
log.info('channel HIDE ... ');
|
|
15531
|
-
|
|
15600
|
+
_context.n = 154;
|
|
15532
15601
|
return effects.put(setChannelToHideAC(_channel20));
|
|
15533
|
-
case
|
|
15534
|
-
return
|
|
15535
|
-
case
|
|
15602
|
+
case 154:
|
|
15603
|
+
return _context.a(3, 185);
|
|
15604
|
+
case 155:
|
|
15536
15605
|
_channel21 = args.channel;
|
|
15537
15606
|
log.info('channel UNHIDE ... ');
|
|
15538
|
-
|
|
15607
|
+
_context.n = 156;
|
|
15539
15608
|
return effects.put(setChannelToUnHideAC(_channel21));
|
|
15540
|
-
case
|
|
15541
|
-
return
|
|
15542
|
-
case
|
|
15609
|
+
case 156:
|
|
15610
|
+
return _context.a(3, 185);
|
|
15611
|
+
case 157:
|
|
15543
15612
|
_channel22 = args.channel;
|
|
15544
|
-
|
|
15613
|
+
_context.n = 158;
|
|
15545
15614
|
return effects.put(updateChannelDataAC(_channel22.id, {
|
|
15546
15615
|
unread: _channel22.unread,
|
|
15547
15616
|
muted: _channel22.muted,
|
|
15548
15617
|
mutedTill: _channel22.mutedTill
|
|
15549
15618
|
}));
|
|
15550
|
-
case
|
|
15619
|
+
case 158:
|
|
15551
15620
|
_groupName5 = getChannelGroupName(_channel22);
|
|
15552
|
-
|
|
15621
|
+
_context.n = 159;
|
|
15553
15622
|
return effects.put(updateSearchedChannelDataAC(_channel22.id, {
|
|
15554
15623
|
unread: _channel22.unread
|
|
15555
15624
|
}, _groupName5));
|
|
15556
|
-
case
|
|
15625
|
+
case 159:
|
|
15557
15626
|
updateChannelOnAllChannels(_channel22.id, {
|
|
15558
15627
|
unread: _channel22.unread
|
|
15559
15628
|
});
|
|
15560
|
-
return
|
|
15561
|
-
case
|
|
15629
|
+
return _context.a(3, 185);
|
|
15630
|
+
case 160:
|
|
15562
15631
|
_channel23 = args.channel;
|
|
15563
|
-
|
|
15632
|
+
_context.n = 161;
|
|
15564
15633
|
return effects.put(updateChannelDataAC(_channel23.id, {
|
|
15565
15634
|
unread: _channel23.unread,
|
|
15566
15635
|
muted: _channel23.muted,
|
|
15567
15636
|
mutedTill: _channel23.mutedTill
|
|
15568
15637
|
}));
|
|
15569
|
-
case
|
|
15638
|
+
case 161:
|
|
15570
15639
|
_groupName6 = getChannelGroupName(_channel23);
|
|
15571
|
-
|
|
15640
|
+
_context.n = 162;
|
|
15572
15641
|
return effects.put(updateSearchedChannelDataAC(_channel23.id, {
|
|
15573
15642
|
unread: _channel23.unread
|
|
15574
15643
|
}, _groupName6));
|
|
15575
|
-
case
|
|
15644
|
+
case 162:
|
|
15576
15645
|
updateChannelOnAllChannels(_channel23.id, {
|
|
15577
15646
|
unread: _channel23.unread
|
|
15578
15647
|
});
|
|
15579
|
-
return
|
|
15580
|
-
case
|
|
15648
|
+
return _context.a(3, 185);
|
|
15649
|
+
case 163:
|
|
15581
15650
|
_channel24 = args.channel, members = args.members;
|
|
15582
15651
|
log.info('channel CHANGE_ROLE channel ... ', _channel24);
|
|
15583
15652
|
log.info('channel CHANGE_ROLE member ... ', members);
|
|
15584
|
-
|
|
15653
|
+
_context.n = 164;
|
|
15585
15654
|
return effects.call(getActiveChannelId);
|
|
15586
|
-
case
|
|
15587
|
-
_activeChannelId14 =
|
|
15655
|
+
case 164:
|
|
15656
|
+
_activeChannelId14 = _context.v;
|
|
15588
15657
|
if (!(_channel24.id === _activeChannelId14)) {
|
|
15589
|
-
|
|
15658
|
+
_context.n = 165;
|
|
15590
15659
|
break;
|
|
15591
15660
|
}
|
|
15592
|
-
|
|
15661
|
+
_context.n = 165;
|
|
15593
15662
|
return effects.put(updateMembersAC(members));
|
|
15594
|
-
case
|
|
15663
|
+
case 165:
|
|
15595
15664
|
i = 0;
|
|
15596
|
-
case
|
|
15665
|
+
case 166:
|
|
15597
15666
|
if (!(i < members.length)) {
|
|
15598
|
-
|
|
15667
|
+
_context.n = 169;
|
|
15599
15668
|
break;
|
|
15600
15669
|
}
|
|
15601
15670
|
if (!(members[i].id === SceytChatClient.user.id)) {
|
|
15602
|
-
|
|
15671
|
+
_context.n = 168;
|
|
15603
15672
|
break;
|
|
15604
15673
|
}
|
|
15605
|
-
|
|
15674
|
+
_context.n = 167;
|
|
15606
15675
|
return effects.put(updateChannelDataAC(_channel24.id, {
|
|
15607
15676
|
userRole: members[i].role,
|
|
15608
15677
|
muted: _channel24.muted,
|
|
15609
15678
|
mutedTill: _channel24.mutedTill
|
|
15610
15679
|
}));
|
|
15611
|
-
case
|
|
15680
|
+
case 167:
|
|
15612
15681
|
updateChannelOnAllChannels(_channel24.id, {
|
|
15613
15682
|
userRole: members[i].role,
|
|
15614
15683
|
muted: _channel24.muted,
|
|
15615
15684
|
mutedTill: _channel24.mutedTill
|
|
15616
15685
|
});
|
|
15617
|
-
case
|
|
15686
|
+
case 168:
|
|
15618
15687
|
i++;
|
|
15619
|
-
|
|
15688
|
+
_context.n = 166;
|
|
15620
15689
|
break;
|
|
15621
|
-
case
|
|
15622
|
-
return
|
|
15623
|
-
case
|
|
15690
|
+
case 169:
|
|
15691
|
+
return _context.a(3, 185);
|
|
15692
|
+
case 170:
|
|
15624
15693
|
_channel25 = args.channel;
|
|
15625
15694
|
log.info('channel frozen channel ... ', _channel25);
|
|
15626
|
-
return
|
|
15627
|
-
case
|
|
15695
|
+
return _context.a(3, 185);
|
|
15696
|
+
case 171:
|
|
15628
15697
|
_channel26 = args.channel;
|
|
15629
15698
|
log.info('channel unfrozen channel ... ', _channel26);
|
|
15630
|
-
return
|
|
15631
|
-
case
|
|
15699
|
+
return _context.a(3, 185);
|
|
15700
|
+
case 172:
|
|
15632
15701
|
_channelId2 = args.channelId, from = args.from, name = args.name;
|
|
15633
15702
|
log.info('channel event received >>>... . . . . . ', args);
|
|
15634
15703
|
if (!(from.id === SceytChatClient.user.id)) {
|
|
15635
|
-
|
|
15704
|
+
_context.n = 173;
|
|
15636
15705
|
break;
|
|
15637
15706
|
}
|
|
15638
|
-
return
|
|
15639
|
-
case
|
|
15707
|
+
return _context.a(3, 185);
|
|
15708
|
+
case 173:
|
|
15640
15709
|
if (!(name === 'start_typing')) {
|
|
15641
|
-
|
|
15710
|
+
_context.n = 175;
|
|
15642
15711
|
break;
|
|
15643
15712
|
}
|
|
15644
15713
|
if (!usersTimeout[_channelId2]) {
|
|
@@ -15650,27 +15719,27 @@ function watchForEvents() {
|
|
|
15650
15719
|
usersTimeout[_channelId2][from.id] = setTimeout(function () {
|
|
15651
15720
|
channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_typing');
|
|
15652
15721
|
}, 5000);
|
|
15653
|
-
|
|
15722
|
+
_context.n = 174;
|
|
15654
15723
|
return effects.put(switchTypingIndicatorAC(true, _channelId2, from));
|
|
15655
|
-
case
|
|
15656
|
-
|
|
15724
|
+
case 174:
|
|
15725
|
+
_context.n = 180;
|
|
15657
15726
|
break;
|
|
15658
|
-
case
|
|
15727
|
+
case 175:
|
|
15659
15728
|
if (!(name === 'stop_typing')) {
|
|
15660
|
-
|
|
15729
|
+
_context.n = 177;
|
|
15661
15730
|
break;
|
|
15662
15731
|
}
|
|
15663
15732
|
if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
|
|
15664
15733
|
clearTimeout(usersTimeout[_channelId2][from.id]);
|
|
15665
15734
|
}
|
|
15666
|
-
|
|
15735
|
+
_context.n = 176;
|
|
15667
15736
|
return effects.put(switchTypingIndicatorAC(false, _channelId2, from));
|
|
15668
|
-
case
|
|
15669
|
-
|
|
15737
|
+
case 176:
|
|
15738
|
+
_context.n = 180;
|
|
15670
15739
|
break;
|
|
15671
|
-
case
|
|
15740
|
+
case 177:
|
|
15672
15741
|
if (!(name === 'start_recording')) {
|
|
15673
|
-
|
|
15742
|
+
_context.n = 179;
|
|
15674
15743
|
break;
|
|
15675
15744
|
}
|
|
15676
15745
|
if (!usersTimeout[_channelId2]) {
|
|
@@ -15682,58 +15751,58 @@ function watchForEvents() {
|
|
|
15682
15751
|
usersTimeout[_channelId2][from.id] = setTimeout(function () {
|
|
15683
15752
|
channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_recording');
|
|
15684
15753
|
}, 5000);
|
|
15685
|
-
|
|
15754
|
+
_context.n = 178;
|
|
15686
15755
|
return effects.put(switchRecordingIndicatorAC(true, _channelId2, from));
|
|
15687
|
-
case
|
|
15688
|
-
|
|
15756
|
+
case 178:
|
|
15757
|
+
_context.n = 180;
|
|
15689
15758
|
break;
|
|
15690
|
-
case
|
|
15759
|
+
case 179:
|
|
15691
15760
|
if (!(name === 'stop_recording')) {
|
|
15692
|
-
|
|
15761
|
+
_context.n = 180;
|
|
15693
15762
|
break;
|
|
15694
15763
|
}
|
|
15695
15764
|
if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
|
|
15696
15765
|
clearTimeout(usersTimeout[_channelId2][from.id]);
|
|
15697
15766
|
}
|
|
15698
|
-
|
|
15767
|
+
_context.n = 180;
|
|
15699
15768
|
return effects.put(switchRecordingIndicatorAC(false, _channelId2, from));
|
|
15700
|
-
case
|
|
15701
|
-
return
|
|
15702
|
-
case
|
|
15769
|
+
case 180:
|
|
15770
|
+
return _context.a(3, 185);
|
|
15771
|
+
case 181:
|
|
15703
15772
|
status = args.status;
|
|
15704
15773
|
log.info('connection status changed . . . . . ', status);
|
|
15705
|
-
|
|
15774
|
+
_context.n = 182;
|
|
15706
15775
|
return effects.put(setConnectionStatusAC(status));
|
|
15707
|
-
case
|
|
15776
|
+
case 182:
|
|
15708
15777
|
if (!(status === CONNECTION_STATUS.CONNECTED)) {
|
|
15709
|
-
|
|
15778
|
+
_context.n = 183;
|
|
15710
15779
|
break;
|
|
15711
15780
|
}
|
|
15712
|
-
|
|
15781
|
+
_context.n = 183;
|
|
15713
15782
|
return effects.put(getRolesAC());
|
|
15714
|
-
case
|
|
15715
|
-
return
|
|
15716
|
-
case
|
|
15783
|
+
case 183:
|
|
15784
|
+
return _context.a(3, 185);
|
|
15785
|
+
case 184:
|
|
15717
15786
|
log.warn('UNHANDLED EVENT FROM REDUX-SAGA EVENT-CHANNEL');
|
|
15718
|
-
case
|
|
15719
|
-
|
|
15787
|
+
case 185:
|
|
15788
|
+
_context.n = 187;
|
|
15720
15789
|
break;
|
|
15721
|
-
case
|
|
15722
|
-
|
|
15723
|
-
_t2 =
|
|
15790
|
+
case 186:
|
|
15791
|
+
_context.p = 186;
|
|
15792
|
+
_t2 = _context.v;
|
|
15724
15793
|
log.error('Error in watchForEvents:', _t2);
|
|
15725
|
-
case
|
|
15726
|
-
return
|
|
15794
|
+
case 187:
|
|
15795
|
+
return _context.a(2);
|
|
15727
15796
|
}
|
|
15728
|
-
},
|
|
15797
|
+
}, _callee, null, [[0, 186]]);
|
|
15729
15798
|
});
|
|
15730
15799
|
case 1:
|
|
15731
|
-
return
|
|
15800
|
+
return _context2.d(_regeneratorValues(_loop()), 2);
|
|
15732
15801
|
case 2:
|
|
15733
|
-
|
|
15802
|
+
_context2.n = 1;
|
|
15734
15803
|
break;
|
|
15735
15804
|
case 3:
|
|
15736
|
-
return
|
|
15805
|
+
return _context2.a(2);
|
|
15737
15806
|
}
|
|
15738
15807
|
}, _marked$1);
|
|
15739
15808
|
}
|
|
@@ -16591,7 +16660,7 @@ function channelsForForwardLoadMore(action) {
|
|
|
16591
16660
|
channelQueryForward.limit = limit;
|
|
16592
16661
|
}
|
|
16593
16662
|
_context8.n = 1;
|
|
16594
|
-
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
16663
|
+
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING, true));
|
|
16595
16664
|
case 1:
|
|
16596
16665
|
_context8.n = 2;
|
|
16597
16666
|
return effects.call(channelQueryForward.loadNextPage);
|
|
@@ -16614,7 +16683,7 @@ function channelsForForwardLoadMore(action) {
|
|
|
16614
16683
|
return effects.put(addChannelsForForwardAC(mappedChannels));
|
|
16615
16684
|
case 5:
|
|
16616
16685
|
_context8.n = 6;
|
|
16617
|
-
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
16686
|
+
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED, true));
|
|
16618
16687
|
case 6:
|
|
16619
16688
|
_context8.n = 8;
|
|
16620
16689
|
break;
|
|
@@ -16836,7 +16905,7 @@ function switchChannel(action) {
|
|
|
16836
16905
|
}
|
|
16837
16906
|
currentActiveChannel = getChannelFromMap(getActiveChannelId());
|
|
16838
16907
|
_context10.n = 11;
|
|
16839
|
-
return effects.
|
|
16908
|
+
return effects.put(setUnreadScrollToAC(true));
|
|
16840
16909
|
case 11:
|
|
16841
16910
|
_context10.n = 12;
|
|
16842
16911
|
return effects.call(setActiveChannelId, channel && channel.id);
|
|
@@ -18480,6 +18549,9 @@ var pendingPollActionsSelector = function pendingPollActionsSelector(store) {
|
|
|
18480
18549
|
var pendingMessagesMapSelector = function pendingMessagesMapSelector(store) {
|
|
18481
18550
|
return store.MessageReducer.pendingMessagesMap;
|
|
18482
18551
|
};
|
|
18552
|
+
var unreadScrollToSelector = function unreadScrollToSelector(store) {
|
|
18553
|
+
return store.MessageReducer.unreadScrollTo;
|
|
18554
|
+
};
|
|
18483
18555
|
|
|
18484
18556
|
var getFrame = function getFrame(videoSrc, time) {
|
|
18485
18557
|
try {
|
|
@@ -19047,7 +19119,7 @@ function sendMessage(action) {
|
|
|
19047
19119
|
}, _marked$3, null, [[1, 18]]);
|
|
19048
19120
|
}
|
|
19049
19121
|
function sendTextMessage(action) {
|
|
19050
|
-
var payload, message, connectionState, channelId, channel, sendMessageTid, activeChannelId, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t3;
|
|
19122
|
+
var payload, message, connectionState, channelId, channel, sendMessageTid, activeChannelId, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, _messageResponse, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t3;
|
|
19051
19123
|
return _regenerator().w(function (_context4) {
|
|
19052
19124
|
while (1) switch (_context4.p = _context4.n) {
|
|
19053
19125
|
case 0:
|
|
@@ -19160,6 +19232,7 @@ function sendTextMessage(action) {
|
|
|
19160
19232
|
parentMessage: messageResponse.parentMessage,
|
|
19161
19233
|
repliedInThread: messageResponse.repliedInThread,
|
|
19162
19234
|
createdAt: messageResponse.createdAt,
|
|
19235
|
+
pollDetails: (_messageResponse = messageResponse) === null || _messageResponse === void 0 ? void 0 : _messageResponse.pollDetails,
|
|
19163
19236
|
channelId: channel.id
|
|
19164
19237
|
};
|
|
19165
19238
|
if (!(activeChannelId === channel.id)) {
|
|
@@ -19200,15 +19273,12 @@ function sendTextMessage(action) {
|
|
|
19200
19273
|
throw new Error('Connection required to send message');
|
|
19201
19274
|
case 17:
|
|
19202
19275
|
_context4.n = 18;
|
|
19203
|
-
return effects.put(getMessagesAC(channel, true, channel.lastMessage.id, undefined, undefined, false));
|
|
19204
|
-
case 18:
|
|
19205
|
-
_context4.n = 19;
|
|
19206
19276
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19207
|
-
case
|
|
19208
|
-
_context4.n =
|
|
19277
|
+
case 18:
|
|
19278
|
+
_context4.n = 21;
|
|
19209
19279
|
break;
|
|
19210
|
-
case
|
|
19211
|
-
_context4.p =
|
|
19280
|
+
case 19:
|
|
19281
|
+
_context4.p = 19;
|
|
19212
19282
|
_t3 = _context4.v;
|
|
19213
19283
|
log.error('error on send text message ... ', _t3);
|
|
19214
19284
|
updateMessageOnMap(channel.id, {
|
|
@@ -19218,23 +19288,23 @@ function sendTextMessage(action) {
|
|
|
19218
19288
|
}
|
|
19219
19289
|
});
|
|
19220
19290
|
if (!(activeChannelId === channel.id)) {
|
|
19221
|
-
_context4.n =
|
|
19291
|
+
_context4.n = 20;
|
|
19222
19292
|
break;
|
|
19223
19293
|
}
|
|
19224
19294
|
updateMessageOnAllMessages(sendMessageTid, {
|
|
19225
19295
|
state: MESSAGE_STATUS.FAILED
|
|
19226
19296
|
});
|
|
19227
|
-
_context4.n =
|
|
19297
|
+
_context4.n = 20;
|
|
19228
19298
|
return effects.put(updateMessageAC(sendMessageTid, {
|
|
19229
19299
|
state: MESSAGE_STATUS.FAILED
|
|
19230
19300
|
}));
|
|
19231
|
-
case
|
|
19232
|
-
_context4.n =
|
|
19301
|
+
case 20:
|
|
19302
|
+
_context4.n = 21;
|
|
19233
19303
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19234
|
-
case
|
|
19304
|
+
case 21:
|
|
19235
19305
|
return _context4.a(2);
|
|
19236
19306
|
}
|
|
19237
|
-
}, _marked2$2, null, [[3,
|
|
19307
|
+
}, _marked2$2, null, [[3, 19]]);
|
|
19238
19308
|
}
|
|
19239
19309
|
function forwardMessage(action) {
|
|
19240
19310
|
var payload, message, channelId, connectionState, isForward, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, pollDetails, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t4;
|
|
@@ -19440,7 +19510,7 @@ function forwardMessage(action) {
|
|
|
19440
19510
|
}, _marked3$1, null, [[0, 20]]);
|
|
19441
19511
|
}
|
|
19442
19512
|
function resendMessage(action) {
|
|
19443
|
-
var payload, message, connectionState, channelId, channel, customUploader, attachmentCompilation, messageAttachment, messageCopy, handleUploadProgress, uri, filePath, handleUpdateLocalPath, pendingAttachment, thumbnailMetas, fileSize, meta, attachmentMeta, attachmentBuilder, attachmentToSend, messageResponse, messageUpdateData, fileType, messageToUpdate, _messageCopy2,
|
|
19513
|
+
var payload, message, connectionState, channelId, channel, customUploader, attachmentCompilation, messageAttachment, messageCopy, handleUploadProgress, uri, filePath, handleUpdateLocalPath, pendingAttachment, thumbnailMetas, fileSize, meta, attachmentMeta, attachmentBuilder, attachmentToSend, messageResponse, messageUpdateData, fileType, messageToUpdate, _messageCopy2, _messageResponse2, _messageUpdateData, isInActiveChannel, activeChannelId, _messageToUpdate, _t5, _t6;
|
|
19444
19514
|
return _regenerator().w(function (_context6) {
|
|
19445
19515
|
while (1) switch (_context6.p = _context6.n) {
|
|
19446
19516
|
case 0:
|
|
@@ -19693,29 +19763,27 @@ function resendMessage(action) {
|
|
|
19693
19763
|
_context6.n = 27;
|
|
19694
19764
|
return effects.call(channel.sendMessage, _messageCopy2);
|
|
19695
19765
|
case 27:
|
|
19696
|
-
|
|
19766
|
+
_messageResponse2 = _context6.v;
|
|
19697
19767
|
_context6.n = 28;
|
|
19698
19768
|
return effects.put(removePendingMessageAC(channel.id, _messageCopy2.tid || _messageCopy2.id));
|
|
19699
19769
|
case 28:
|
|
19700
19770
|
_messageUpdateData = {
|
|
19701
|
-
id:
|
|
19702
|
-
body:
|
|
19703
|
-
type:
|
|
19704
|
-
state:
|
|
19705
|
-
displayCount:
|
|
19706
|
-
deliveryStatus:
|
|
19771
|
+
id: _messageResponse2.id,
|
|
19772
|
+
body: _messageResponse2.body,
|
|
19773
|
+
type: _messageResponse2.type,
|
|
19774
|
+
state: _messageResponse2.state,
|
|
19775
|
+
displayCount: _messageResponse2.displayCount,
|
|
19776
|
+
deliveryStatus: _messageResponse2.deliveryStatus,
|
|
19707
19777
|
attachments: [],
|
|
19708
|
-
mentionedUsers:
|
|
19709
|
-
metadata:
|
|
19710
|
-
parentMessage:
|
|
19711
|
-
repliedInThread:
|
|
19712
|
-
bodyAttributes:
|
|
19713
|
-
createdAt:
|
|
19778
|
+
mentionedUsers: _messageResponse2.mentionedUsers,
|
|
19779
|
+
metadata: _messageResponse2.metadata,
|
|
19780
|
+
parentMessage: _messageResponse2.parentMessage,
|
|
19781
|
+
repliedInThread: _messageResponse2.repliedInThread,
|
|
19782
|
+
bodyAttributes: _messageResponse2.bodyAttributes,
|
|
19783
|
+
createdAt: _messageResponse2.createdAt,
|
|
19714
19784
|
channelId: channel.id
|
|
19715
19785
|
};
|
|
19716
|
-
isInActiveChannel =
|
|
19717
|
-
return message.id === _messageCopy2.tid;
|
|
19718
|
-
});
|
|
19786
|
+
isInActiveChannel = getMessagesFromMap(channelId)[_messageCopy2.tid];
|
|
19719
19787
|
if (!isInActiveChannel) {
|
|
19720
19788
|
_context6.n = 29;
|
|
19721
19789
|
break;
|
|
@@ -19736,7 +19804,7 @@ function resendMessage(action) {
|
|
|
19736
19804
|
break;
|
|
19737
19805
|
}
|
|
19738
19806
|
_context6.n = 31;
|
|
19739
|
-
return effects.put(updateMessageAC(_messageCopy2.tid, JSON.parse(JSON.stringify(
|
|
19807
|
+
return effects.put(updateMessageAC(_messageCopy2.tid, JSON.parse(JSON.stringify(_messageResponse2))));
|
|
19740
19808
|
case 31:
|
|
19741
19809
|
updateMessageOnMap(channel.id, {
|
|
19742
19810
|
messageId: _messageCopy2.tid,
|
|
@@ -19745,7 +19813,7 @@ function resendMessage(action) {
|
|
|
19745
19813
|
updateMessageOnAllMessages(_messageCopy2.tid, _messageUpdateData);
|
|
19746
19814
|
case 32:
|
|
19747
19815
|
updateChannelOnAllChannels(channel.id, channel);
|
|
19748
|
-
_messageToUpdate = JSON.parse(JSON.stringify(
|
|
19816
|
+
_messageToUpdate = JSON.parse(JSON.stringify(_messageResponse2));
|
|
19749
19817
|
updateChannelLastMessageOnAllChannels(channel.id, _messageToUpdate);
|
|
19750
19818
|
_context6.n = 33;
|
|
19751
19819
|
return effects.put(updateChannelLastMessageAC(_messageToUpdate, {
|
|
@@ -19906,7 +19974,7 @@ function editMessage(action) {
|
|
|
19906
19974
|
}, _marked6$1, null, [[0, 5]]);
|
|
19907
19975
|
}
|
|
19908
19976
|
function getMessagesQuery(action) {
|
|
19909
|
-
var _action$payload, channel, loadWithLastMessage, messageId, limit, withDeliveredMessages, highlight, behavior, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, allMessages, havLastMessage, secondResult, sentMessages, messagesMap, filteredSentMessages, _allMessages, messageIndex, maxLengthPart, _secondResult, thirdResult, _secondResult2, _thirdResult, _secondResult3, _secondResult4, updatedMessages, pendingMessages, _messagesMap, filteredPendingMessages, _t9;
|
|
19977
|
+
var _action$payload, channel, loadWithLastMessage, messageId, limit, withDeliveredMessages, highlight, behavior, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, allMessages, havLastMessage, secondResult, sentMessages, messagesMap, filteredSentMessages, _allMessages, messageIndex, maxLengthPart, _secondResult, thirdResult, _secondResult2, _thirdResult, _secondResult3, _Object$values, previousAllMessages, _secondResult4, updatedMessages, lastMessageId, _allMessages2, setMappedAllMessages, allMessagesAfterLastMessage, pendingMessages, _messagesMap, filteredPendingMessages, _t9;
|
|
19910
19978
|
return _regenerator().w(function (_context9) {
|
|
19911
19979
|
while (1) switch (_context9.p = _context9.n) {
|
|
19912
19980
|
case 0:
|
|
@@ -19928,7 +19996,9 @@ function getMessagesQuery(action) {
|
|
|
19928
19996
|
case 2:
|
|
19929
19997
|
messageQuery = _context9.v;
|
|
19930
19998
|
query.messageQuery = messageQuery;
|
|
19931
|
-
cachedMessages = getMessagesFromMap(channel.id)
|
|
19999
|
+
cachedMessages = Object.values(getMessagesFromMap(channel.id) || {}).sort(function (a, b) {
|
|
20000
|
+
return Number(a.id) - Number(b.id);
|
|
20001
|
+
});
|
|
19932
20002
|
result = {
|
|
19933
20003
|
messages: [],
|
|
19934
20004
|
hasNext: false
|
|
@@ -20150,6 +20220,7 @@ function getMessagesQuery(action) {
|
|
|
20150
20220
|
_context9.n = 46;
|
|
20151
20221
|
break;
|
|
20152
20222
|
case 39:
|
|
20223
|
+
previousAllMessages = getAllMessages();
|
|
20153
20224
|
setMessagesToMap(channel.id, []);
|
|
20154
20225
|
setAllMessages([]);
|
|
20155
20226
|
if (!(cachedMessages && cachedMessages.length)) {
|
|
@@ -20187,13 +20258,30 @@ function getMessagesQuery(action) {
|
|
|
20187
20258
|
updateMessageOnAllMessages(msg.id, updatedMessage || msg);
|
|
20188
20259
|
updatedMessages.push(updatedMessage || msg);
|
|
20189
20260
|
});
|
|
20261
|
+
lastMessageId = updatedMessages[updatedMessages.length - 1].id;
|
|
20262
|
+
_allMessages2 = getAllMessages();
|
|
20263
|
+
setMappedAllMessages = {};
|
|
20264
|
+
previousAllMessages.forEach(function (msg) {
|
|
20265
|
+
if (msg.channelId === channel.id) {
|
|
20266
|
+
setMappedAllMessages[msg.id] = msg;
|
|
20267
|
+
}
|
|
20268
|
+
});
|
|
20269
|
+
_allMessages2.forEach(function (msg) {
|
|
20270
|
+
if (msg.channelId === channel.id) {
|
|
20271
|
+
setMappedAllMessages[msg.id] = msg;
|
|
20272
|
+
}
|
|
20273
|
+
});
|
|
20274
|
+
allMessagesAfterLastMessage = (_Object$values = Object.values(setMappedAllMessages || {})) === null || _Object$values === void 0 ? void 0 : _Object$values.filter(function (msg) {
|
|
20275
|
+
return msg.id > lastMessageId;
|
|
20276
|
+
});
|
|
20277
|
+
updatedMessages = [].concat(updatedMessages, allMessagesAfterLastMessage || []);
|
|
20190
20278
|
setMessagesToMap(channel.id, updatedMessages);
|
|
20191
|
-
setAllMessages(
|
|
20279
|
+
setAllMessages(updatedMessages);
|
|
20192
20280
|
_context9.n = 44;
|
|
20193
20281
|
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(updatedMessages))));
|
|
20194
20282
|
case 44:
|
|
20195
20283
|
_context9.n = 45;
|
|
20196
|
-
return effects.put(setMessagesHasPrevAC(
|
|
20284
|
+
return effects.put(setMessagesHasPrevAC(true));
|
|
20197
20285
|
case 45:
|
|
20198
20286
|
_context9.n = 46;
|
|
20199
20287
|
return effects.put(setMessagesHasNextAC(false));
|
|
@@ -20342,6 +20430,7 @@ function loadMoreMessages(action) {
|
|
|
20342
20430
|
result = _context1.v;
|
|
20343
20431
|
if (result.messages.length) {
|
|
20344
20432
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.PREV);
|
|
20433
|
+
setMessagesToMap(channelId, result.messages);
|
|
20345
20434
|
}
|
|
20346
20435
|
_context1.n = 5;
|
|
20347
20436
|
return effects.put(setMessagesHasPrevAC(result.hasNext));
|
|
@@ -20369,6 +20458,7 @@ function loadMoreMessages(action) {
|
|
|
20369
20458
|
result = _context1.v;
|
|
20370
20459
|
if (result.messages.length) {
|
|
20371
20460
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.NEXT);
|
|
20461
|
+
setMessagesToMap(channelId, result.messages);
|
|
20372
20462
|
}
|
|
20373
20463
|
_context1.n = 9;
|
|
20374
20464
|
return effects.put(setMessagesHasNextAC(result.hasNext));
|
|
@@ -20981,7 +21071,7 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
|
20981
21071
|
}, _marked18$1);
|
|
20982
21072
|
}
|
|
20983
21073
|
function addPollVote(action) {
|
|
20984
|
-
var payload, channelId, pollId, optionId, _message4, isResend, sceytChatClient, _user$presence2, connectionState, user, vote, pendingAction, conflictCheck, channel,
|
|
21074
|
+
var payload, channelId, pollId, optionId, _message4, isResend, sceytChatClient, _user$presence2, connectionState, user, vote, pendingAction, conflictCheck, channel, _Object$values2, _store$getState$Messa, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj, _t19;
|
|
20985
21075
|
return _regenerator().w(function (_context21) {
|
|
20986
21076
|
while (1) switch (_context21.p = _context21.n) {
|
|
20987
21077
|
case 0:
|
|
@@ -21040,7 +21130,7 @@ function addPollVote(action) {
|
|
|
21040
21130
|
_context21.n = 3;
|
|
21041
21131
|
break;
|
|
21042
21132
|
}
|
|
21043
|
-
currentMessage = ((
|
|
21133
|
+
currentMessage = ((_Object$values2 = Object.values(getMessagesFromMap(channelId) || {})) === null || _Object$values2 === void 0 ? void 0 : _Object$values2.find(function (msg) {
|
|
21044
21134
|
return msg.id === _message4.id || msg.tid === _message4.id;
|
|
21045
21135
|
})) || _message4;
|
|
21046
21136
|
hasNext = ((_store$getState$Messa = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa === void 0 ? void 0 : _store$getState$Messa[pollId]) || false;
|
|
@@ -21182,7 +21272,7 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
|
|
|
21182
21272
|
}, _marked21$1);
|
|
21183
21273
|
}
|
|
21184
21274
|
function deletePollVote(action) {
|
|
21185
|
-
var payload, channelId, pollId, optionId, _message5, isResend, sceytChatClient, _message5$pollDetails, _message5$pollDetails2, _message5$pollDetails3, connectionState, vote, pendingAction, conflictCheck, channel,
|
|
21275
|
+
var payload, channelId, pollId, optionId, _message5, isResend, sceytChatClient, _message5$pollDetails, _message5$pollDetails2, _message5$pollDetails3, connectionState, vote, pendingAction, conflictCheck, channel, _Object$values3, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj, _t20;
|
|
21186
21276
|
return _regenerator().w(function (_context24) {
|
|
21187
21277
|
while (1) switch (_context24.p = _context24.n) {
|
|
21188
21278
|
case 0:
|
|
@@ -21228,7 +21318,7 @@ function deletePollVote(action) {
|
|
|
21228
21318
|
_context24.n = 4;
|
|
21229
21319
|
break;
|
|
21230
21320
|
}
|
|
21231
|
-
currentMessage = ((
|
|
21321
|
+
currentMessage = ((_Object$values3 = Object.values(getMessagesFromMap(channelId) || {})) === null || _Object$values3 === void 0 ? void 0 : _Object$values3.find(function (msg) {
|
|
21232
21322
|
return msg.id === _message5.id || msg.tid === _message5.id;
|
|
21233
21323
|
})) || _message5;
|
|
21234
21324
|
_context24.n = 3;
|
|
@@ -23876,7 +23966,7 @@ var ChannelMessageText = function ChannelMessageText(_ref2) {
|
|
|
23876
23966
|
return mem === user.id ? ' You' : " " + systemMessageUserName(mem, contactsMap && contactsMap[mem], lastMessage.mentionedUsers);
|
|
23877
23967
|
})) + " " + (lastMessageMetas && lastMessageMetas.m && lastMessageMetas.m.length > 5 ? "and " + (lastMessageMetas.m.length - 5) + " more" : '') : lastMessage.body === 'RM' ? " removed " + (lastMessageMetas && lastMessageMetas.m && lastMessageMetas.m.slice(0, 5).map(function (mem) {
|
|
23878
23968
|
return mem === user.id ? ' You' : " " + systemMessageUserName(mem, contactsMap && contactsMap[mem], lastMessage.mentionedUsers);
|
|
23879
|
-
})) + " " + (lastMessageMetas && lastMessageMetas.m && lastMessageMetas.m.length > 5 ? "and " + (lastMessageMetas.m.length - 5) + " more" : '') : lastMessage.body === 'LG' ? 'Left this group' : lastMessage.body === 'JL' ? '
|
|
23969
|
+
})) + " " + (lastMessageMetas && lastMessageMetas.m && lastMessageMetas.m.length > 5 ? "and " + (lastMessageMetas.m.length - 5) + " more" : '') : lastMessage.body === 'LG' ? 'Left this group' : lastMessage.body === 'JL' ? 'joined via invite link' : '') : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(LastMessageDescription, {
|
|
23880
23970
|
poll: (lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.pollDetails) && (lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.type) === exports.MESSAGE_TYPE.POLL
|
|
23881
23971
|
}, channel.lastReactedMessage && (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Reacted", /*#__PURE__*/React__default.createElement(ReactionItem, null, channel.newReactions && channel.newReactions[0] && channel.newReactions[0].key), "to", ' "')), LastMessageAttachments({
|
|
23882
23972
|
lastMessage: lastMessage
|
|
@@ -26180,7 +26270,7 @@ var UserNumber = styled__default.h4(_templateObject6$5 || (_templateObject6$5 =
|
|
|
26180
26270
|
|
|
26181
26271
|
var _templateObject$i, _templateObject2$g, _templateObject3$c, _templateObject4$a, _templateObject5$7, _templateObject6$6, _templateObject7$5, _templateObject8$5, _templateObject9$4, _templateObject0$3;
|
|
26182
26272
|
var ChannelList = function ChannelList(_ref) {
|
|
26183
|
-
var _activeChannel$member,
|
|
26273
|
+
var _activeChannel$member, _searchedChannels$cha, _searchedChannels$cha2, _searchedChannels$con, _searchedChannels$cha3, _searchedChannels$cha4, _searchedChannels$cha5, _searchedChannels$cha6;
|
|
26184
26274
|
var className = _ref.className,
|
|
26185
26275
|
selectedChannelBackground = _ref.selectedChannelBackground,
|
|
26186
26276
|
selectedChannelLeftBorder = _ref.selectedChannelLeftBorder,
|
|
@@ -26479,7 +26569,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
26479
26569
|
backgroundColor: backgroundColor || background
|
|
26480
26570
|
}, /*#__PURE__*/React__default.createElement(ChannelListHeader, {
|
|
26481
26571
|
withCustomList: !!List,
|
|
26482
|
-
maxWidth:
|
|
26572
|
+
maxWidth: '100%',
|
|
26483
26573
|
borderColor: borderColor,
|
|
26484
26574
|
padding: searchChannelsPadding
|
|
26485
26575
|
}, Profile, showSearch && searchChannelsPosition === 'inline' ? (/*#__PURE__*/React__default.createElement(ChannelSearch, {
|
|
@@ -26831,7 +26921,7 @@ var NoData = styled__default.div(_templateObject8$5 || (_templateObject8$5 = _ta
|
|
|
26831
26921
|
});
|
|
26832
26922
|
var LoadingWrapper = styled__default.div(_templateObject9$4 || (_templateObject9$4 = _taggedTemplateLiteralLoose(["\n position: absolute;\n left: calc(50% - 20px);\n top: calc(50% - 20px);\n"])));
|
|
26833
26923
|
var ChannelListHeader = styled__default.div(_templateObject0$3 || (_templateObject0$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n max-width: ", ";\n padding: ", ";\n box-sizing: border-box;\n padding-left: ", ";\n border-right: ", ";\n"])), function (props) {
|
|
26834
|
-
return props.maxWidth ? props.maxWidth
|
|
26924
|
+
return props.maxWidth ? "" + props.maxWidth : 'inherit';
|
|
26835
26925
|
}, function (props) {
|
|
26836
26926
|
return props.padding || '12px';
|
|
26837
26927
|
}, function (props) {
|
|
@@ -27866,7 +27956,7 @@ function ForwardMessagePopup(_ref) {
|
|
|
27866
27956
|
if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100) {
|
|
27867
27957
|
if (channelsLoading === LOADING_STATE.LOADED && channelsHasNext && !loadingRef.current) {
|
|
27868
27958
|
loadingRef.current = true;
|
|
27869
|
-
dispatch(loadMoreChannelsForForward(
|
|
27959
|
+
dispatch(loadMoreChannelsForForward(20));
|
|
27870
27960
|
var timeout = setTimeout(function () {
|
|
27871
27961
|
loadingRef.current = false;
|
|
27872
27962
|
clearTimeout(timeout);
|
|
@@ -30146,7 +30236,7 @@ var VideoPreview = /*#__PURE__*/React.memo(function VideoPreview(_ref) {
|
|
|
30146
30236
|
preload: 'auto',
|
|
30147
30237
|
id: 'video',
|
|
30148
30238
|
src: file.attachmentUrl || videoUrl
|
|
30149
|
-
}), videoCurrentTime && !isRepliedMessage && (/*#__PURE__*/React__default.createElement(VideoControls, null, !isPreview && !!videoCurrentTime && !isRepliedMessage && !uploading && !isDetailsView && (
|
|
30239
|
+
}), videoCurrentTime && !isRepliedMessage && (!isDetailsView || !loading) && (/*#__PURE__*/React__default.createElement(VideoControls, null, !isPreview && !!videoCurrentTime && !isRepliedMessage && !uploading && !isDetailsView && (
|
|
30150
30240
|
/*#__PURE__*/
|
|
30151
30241
|
React__default.createElement(VideoPlayButton, null, /*#__PURE__*/React__default.createElement(SvgPlayVideo, null))), /*#__PURE__*/React__default.createElement(VideoTime, {
|
|
30152
30242
|
isDetailsView: isDetailsView,
|
|
@@ -34577,7 +34667,7 @@ var PollMessage = function PollMessage(_ref) {
|
|
|
34577
34667
|
color: textPrimary
|
|
34578
34668
|
}, poll.name), /*#__PURE__*/React__default.createElement(SubTitle$1, {
|
|
34579
34669
|
color: textSecondary
|
|
34580
|
-
}, poll.
|
|
34670
|
+
}, poll.anonymous ? 'Anonymous poll · ' : '', poll.allowMultipleVotes ? 'Multiple Votes' : 'Single Vote'), /*#__PURE__*/React__default.createElement(Options, null, (poll.options || []).map(function (opt) {
|
|
34581
34671
|
var votes = votesPerOption[opt.id] || 0;
|
|
34582
34672
|
var pct = maxVotes > 0 ? Math.round(votes / maxVotes * 100) : 0;
|
|
34583
34673
|
var selected = ownVotedOptionIds.has(opt.id);
|
|
@@ -34654,11 +34744,11 @@ var PollMessage = function PollMessage(_ref) {
|
|
|
34654
34744
|
messageId: message.id
|
|
34655
34745
|
})));
|
|
34656
34746
|
};
|
|
34657
|
-
var Container$h = styled__default.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n min-width: 250px;\n"])));
|
|
34658
|
-
var Question$1 = styled__default.div(_templateObject2$z || (_templateObject2$z = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.4px;\n"])), function (p) {
|
|
34747
|
+
var Container$h = styled__default.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n min-width: 250px;\n width: 100%;\n"])));
|
|
34748
|
+
var Question$1 = styled__default.div(_templateObject2$z || (_templateObject2$z = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.4px;\n word-break: break-word;\n"])), function (p) {
|
|
34659
34749
|
return p.color;
|
|
34660
34750
|
});
|
|
34661
|
-
var SubTitle$1 = styled__default.div(_templateObject3$t || (_templateObject3$t = _taggedTemplateLiteralLoose(["\n color: ", ";\n margin: 4px 0 6px 0;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n letter-spacing: -0.08px;\n"])), function (p) {
|
|
34751
|
+
var SubTitle$1 = styled__default.div(_templateObject3$t || (_templateObject3$t = _taggedTemplateLiteralLoose(["\n color: ", ";\n margin: 4px 0 6px 0;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n letter-spacing: -0.08px;\n word-break: break-word;\n"])), function (p) {
|
|
34662
34752
|
return p.color;
|
|
34663
34753
|
});
|
|
34664
34754
|
var Options = styled__default.div(_templateObject4$p || (_templateObject4$p = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n margin-top: 4px;\n"])));
|
|
@@ -34679,7 +34769,7 @@ var EmptyCircle = styled__default.span(_templateObject8$f || (_templateObject8$f
|
|
|
34679
34769
|
var StyledCheck = styled__default(SvgFilledCheckbox)(_templateObject9$d || (_templateObject9$d = _taggedTemplateLiteralLoose(["\n color: ", ";\n width: 18.5px;\n height: 18.5px;\n"])), function (p) {
|
|
34680
34770
|
return p.color;
|
|
34681
34771
|
});
|
|
34682
|
-
var Title$2 = styled__default.div(_templateObject0$c || (_templateObject0$c = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n color: ", ";\n margin-right: auto;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n max-width: calc(100% - 80px);\n"])), function (p) {
|
|
34772
|
+
var Title$2 = styled__default.div(_templateObject0$c || (_templateObject0$c = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n color: ", ";\n margin-right: auto;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n max-width: calc(100% - 80px);\n word-break: break-word;\n"])), function (p) {
|
|
34683
34773
|
return p.color;
|
|
34684
34774
|
});
|
|
34685
34775
|
var Votes = styled__default.span(_templateObject1$9 || (_templateObject1$9 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n margin-left: 4px;\n"])), function (p) {
|
|
@@ -34749,7 +34839,8 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34749
34839
|
var _useColor = useColors(),
|
|
34750
34840
|
incomingMessageBackgroundX = _useColor[THEME_COLORS.INCOMING_MESSAGE_BACKGROUND_X],
|
|
34751
34841
|
outgoingMessageBackgroundX = _useColor[THEME_COLORS.OUTGOING_MESSAGE_BACKGROUND_X],
|
|
34752
|
-
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY]
|
|
34842
|
+
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
|
|
34843
|
+
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY];
|
|
34753
34844
|
var attachment = React.useMemo(function () {
|
|
34754
34845
|
return attachments.find(function (attachment) {
|
|
34755
34846
|
return attachment.type === attachmentTypes.link;
|
|
@@ -34875,7 +34966,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34875
34966
|
}
|
|
34876
34967
|
}, []);
|
|
34877
34968
|
React.useEffect(function () {
|
|
34878
|
-
if (attachment !== null && attachment !== void 0 && attachment.id && attachment !== null && attachment !== void 0 && attachment.url && !
|
|
34969
|
+
if (attachment !== null && attachment !== void 0 && attachment.id && attachment !== null && attachment !== void 0 && attachment.url && !(oGMetadata !== null && oGMetadata !== void 0 && oGMetadata[attachment === null || attachment === void 0 ? void 0 : attachment.url])) {
|
|
34879
34970
|
setShouldAnimate(true);
|
|
34880
34971
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
34881
34972
|
if (url) {
|
|
@@ -34883,6 +34974,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34883
34974
|
try {
|
|
34884
34975
|
if (cachedMetadata) {
|
|
34885
34976
|
handleMetadata(cachedMetadata);
|
|
34977
|
+
setMetadataLoaded(true);
|
|
34886
34978
|
}
|
|
34887
34979
|
ogMetadataQueryBuilder(url);
|
|
34888
34980
|
return Promise.resolve();
|
|
@@ -34895,7 +34987,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34895
34987
|
});
|
|
34896
34988
|
}
|
|
34897
34989
|
}
|
|
34898
|
-
}, [attachment,
|
|
34990
|
+
}, [attachment, oGMetadata === null || oGMetadata === void 0 ? void 0 : oGMetadata[attachment === null || attachment === void 0 ? void 0 : attachment.url]]);
|
|
34899
34991
|
var ogUrl = React.useMemo(function () {
|
|
34900
34992
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
34901
34993
|
var urlObj = validateUrl(url);
|
|
@@ -34930,18 +35022,23 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34930
35022
|
link: 4
|
|
34931
35023
|
};
|
|
34932
35024
|
}, [order]);
|
|
35025
|
+
var MIN_IMAGE_HEIGHT = 180;
|
|
35026
|
+
var MAX_IMAGE_HEIGHT = 400;
|
|
35027
|
+
var showImage = React.useMemo(function () {
|
|
35028
|
+
return hasImage && calculatedImageHeight >= MIN_IMAGE_HEIGHT && calculatedImageHeight <= MAX_IMAGE_HEIGHT;
|
|
35029
|
+
}, [hasImage, calculatedImageHeight]);
|
|
34933
35030
|
React.useEffect(function () {
|
|
34934
35031
|
if (metadataLoaded || oGMetadata !== null && oGMetadata !== void 0 && oGMetadata[attachment === null || attachment === void 0 ? void 0 : attachment.url]) {
|
|
34935
|
-
if (
|
|
34936
|
-
metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, true,
|
|
35032
|
+
if (oGMetadata !== null && oGMetadata !== void 0 && oGMetadata[attachment === null || attachment === void 0 ? void 0 : attachment.url] && metadataGetSuccessCallback && metadata) {
|
|
35033
|
+
metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, true, showImage, metadata);
|
|
34937
35034
|
} else {
|
|
34938
|
-
metadataGetSuccessCallback === null || metadataGetSuccessCallback === void 0 ? void 0 : metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, false, false);
|
|
35035
|
+
metadataGetSuccessCallback === null || metadataGetSuccessCallback === void 0 ? void 0 : metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, false, false, metadata);
|
|
34939
35036
|
}
|
|
34940
35037
|
}
|
|
34941
|
-
}, [
|
|
35038
|
+
}, [metadataLoaded, oGMetadata, attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata]);
|
|
34942
35039
|
var elements = React.useMemo(function () {
|
|
34943
|
-
var _resolvedOrder$image, _metadata$og11, _metadata$og11$image, _metadata$og11$image$, _resolvedOrder$title, _metadata$og12, _metadata$og13, _resolvedOrder$descri, _metadata$og14, _metadata$og15, _resolvedOrder$link;
|
|
34944
|
-
return [
|
|
35040
|
+
var _resolvedOrder$image, _metadata$og11, _metadata$og11$image, _metadata$og11$image$, _resolvedOrder$title, _metadata$og12, _metadata$og13, _metadata$og13$title, _resolvedOrder$descri, _metadata$og14, _metadata$og15, _metadata$og15$descri, _resolvedOrder$link;
|
|
35041
|
+
return [showImage ? {
|
|
34945
35042
|
key: 'image',
|
|
34946
35043
|
order: (_resolvedOrder$image = resolvedOrder === null || resolvedOrder === void 0 ? void 0 : resolvedOrder.image) != null ? _resolvedOrder$image : 1,
|
|
34947
35044
|
render: (/*#__PURE__*/React__default.createElement(ImageContainer, {
|
|
@@ -34962,8 +35059,9 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34962
35059
|
render: ogShowTitle && (metadata === null || metadata === void 0 ? void 0 : (_metadata$og12 = metadata.og) === null || _metadata$og12 === void 0 ? void 0 : _metadata$og12.title) && (/*#__PURE__*/React__default.createElement(Title$3, {
|
|
34963
35060
|
maxWidth: maxWidth,
|
|
34964
35061
|
shouldAnimate: shouldAnimate,
|
|
34965
|
-
padding: infoPadding
|
|
34966
|
-
|
|
35062
|
+
padding: infoPadding,
|
|
35063
|
+
color: textPrimary
|
|
35064
|
+
}, /*#__PURE__*/React__default.createElement("span", null, metadata === null || metadata === void 0 ? void 0 : (_metadata$og13 = metadata.og) === null || _metadata$og13 === void 0 ? void 0 : (_metadata$og13$title = _metadata$og13.title) === null || _metadata$og13$title === void 0 ? void 0 : _metadata$og13$title.trim())))
|
|
34967
35065
|
}, {
|
|
34968
35066
|
key: 'description',
|
|
34969
35067
|
order: (_resolvedOrder$descri = resolvedOrder === null || resolvedOrder === void 0 ? void 0 : resolvedOrder.description) != null ? _resolvedOrder$descri : 3,
|
|
@@ -34972,7 +35070,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34972
35070
|
shouldAnimate: shouldAnimate,
|
|
34973
35071
|
color: textSecondary,
|
|
34974
35072
|
padding: infoPadding
|
|
34975
|
-
}, metadata === null || metadata === void 0 ? void 0 : (_metadata$og15 = metadata.og) === null || _metadata$og15 === void 0 ? void 0 : _metadata$og15.description))
|
|
35073
|
+
}, metadata === null || metadata === void 0 ? void 0 : (_metadata$og15 = metadata.og) === null || _metadata$og15 === void 0 ? void 0 : (_metadata$og15$descri = _metadata$og15.description) === null || _metadata$og15$descri === void 0 ? void 0 : _metadata$og15$descri.trim()))
|
|
34976
35074
|
}, {
|
|
34977
35075
|
key: 'link',
|
|
34978
35076
|
order: (_resolvedOrder$link = resolvedOrder === null || resolvedOrder === void 0 ? void 0 : resolvedOrder.link) != null ? _resolvedOrder$link : 4,
|
|
@@ -35030,7 +35128,8 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
35030
35128
|
borderRadius: ogContainerBorderRadius,
|
|
35031
35129
|
padding: ogContainerPadding,
|
|
35032
35130
|
className: ogContainerClassName,
|
|
35033
|
-
containerMargin: ogContainerMargin
|
|
35131
|
+
containerMargin: ogContainerMargin,
|
|
35132
|
+
maxWidth: maxWidth
|
|
35034
35133
|
}, isInviteLink ? {
|
|
35035
35134
|
as: 'div',
|
|
35036
35135
|
onClick: function onClick() {
|
|
@@ -35044,84 +35143,90 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
35044
35143
|
}), content);
|
|
35045
35144
|
};
|
|
35046
35145
|
var sharedKeyframes = "\n @keyframes fadeInSlideUp {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes expandHeight {\n from {\n max-height: 0;\n opacity: 0;\n }\n to {\n max-height: 1000px;\n opacity: 1;\n }\n }\n";
|
|
35047
|
-
var OGMetadataContainer = styled__default.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteralLoose(["\n min-width: inherit;\n max-width:
|
|
35048
|
-
var
|
|
35049
|
-
|
|
35050
|
-
bgColor = _ref2.bgColor;
|
|
35051
|
-
return showBackground ? customBg != null ? customBg : bgColor : 'transparent';
|
|
35146
|
+
var OGMetadataContainer = styled__default.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteralLoose(["\n min-width: inherit;\n max-width: ", ";\n width: 100%;\n display: grid;\n grid-template-columns: 1fr;\n border-radius: 8px;\n background-color: ", ";\n border-radius: ", ";\n margin: ", ";\n // margin-bottom: ", ";\n padding: ", ";\n text-decoration: none;\n // color: inherit;\n &:hover {\n opacity: 0.9;\n cursor: pointer;\n }\n"])), function (_ref2) {
|
|
35147
|
+
var maxWidth = _ref2.maxWidth;
|
|
35148
|
+
return maxWidth ? maxWidth + "px" : 'inherit';
|
|
35052
35149
|
}, function (_ref3) {
|
|
35053
|
-
var
|
|
35054
|
-
|
|
35150
|
+
var showBackground = _ref3.showBackground,
|
|
35151
|
+
customBg = _ref3.customBg,
|
|
35152
|
+
bgColor = _ref3.bgColor;
|
|
35153
|
+
return showBackground ? customBg != null ? customBg : bgColor : 'transparent';
|
|
35055
35154
|
}, function (_ref4) {
|
|
35056
|
-
var
|
|
35057
|
-
return
|
|
35155
|
+
var borderRadius = _ref4.borderRadius;
|
|
35156
|
+
return borderRadius !== undefined ? borderRadius : '8px';
|
|
35058
35157
|
}, function (_ref5) {
|
|
35059
|
-
var
|
|
35060
|
-
return
|
|
35158
|
+
var containerMargin = _ref5.containerMargin;
|
|
35159
|
+
return containerMargin != null ? containerMargin : '0.8rem auto 0';
|
|
35061
35160
|
}, function (_ref6) {
|
|
35062
|
-
var
|
|
35161
|
+
var showOGMetadata = _ref6.showOGMetadata;
|
|
35162
|
+
return showOGMetadata ? '0.4rem' : '0';
|
|
35163
|
+
}, function (_ref7) {
|
|
35164
|
+
var padding = _ref7.padding;
|
|
35063
35165
|
return padding != null ? padding : '0';
|
|
35064
35166
|
});
|
|
35065
|
-
var ImageContainer = styled__default.div(_templateObject2$A || (_templateObject2$A = _taggedTemplateLiteralLoose(["\n ", "\n width: 100%;\n height: ", ";\n opacity: ", ";\n margin: 0 auto;\n overflow: hidden;\n ", "\n"])), sharedKeyframes, function (
|
|
35066
|
-
var containerHeight =
|
|
35167
|
+
var ImageContainer = styled__default.div(_templateObject2$A || (_templateObject2$A = _taggedTemplateLiteralLoose(["\n ", "\n width: 100%;\n height: ", ";\n opacity: ", ";\n margin: 0 auto;\n border-radius: 8px 8px 0 0;\n overflow: hidden;\n ", "\n"])), sharedKeyframes, function (_ref8) {
|
|
35168
|
+
var containerHeight = _ref8.containerHeight;
|
|
35067
35169
|
return containerHeight ? containerHeight + "px" : '0px';
|
|
35068
|
-
}, function (_ref8) {
|
|
35069
|
-
var showOGMetadata = _ref8.showOGMetadata,
|
|
35070
|
-
containerHeight = _ref8.containerHeight;
|
|
35071
|
-
return showOGMetadata && containerHeight ? 1 : 0;
|
|
35072
35170
|
}, function (_ref9) {
|
|
35073
|
-
var
|
|
35074
|
-
showOGMetadata = _ref9.showOGMetadata,
|
|
35171
|
+
var showOGMetadata = _ref9.showOGMetadata,
|
|
35075
35172
|
containerHeight = _ref9.containerHeight;
|
|
35173
|
+
return showOGMetadata && containerHeight ? 1 : 0;
|
|
35174
|
+
}, function (_ref0) {
|
|
35175
|
+
var shouldAnimate = _ref0.shouldAnimate,
|
|
35176
|
+
showOGMetadata = _ref0.showOGMetadata,
|
|
35177
|
+
containerHeight = _ref0.containerHeight;
|
|
35076
35178
|
return shouldAnimate && showOGMetadata && containerHeight && "\n animation: expandHeight 0.3s ease-out forwards;\n ";
|
|
35077
35179
|
});
|
|
35078
|
-
var OGText = styled__default.div(_templateObject3$u || (_templateObject3$u = _taggedTemplateLiteralLoose(["\n ", "\n display: flex;\n flex-direction: column;\n gap: 0;\n ", "\n ", ";\n"])), sharedKeyframes, function (
|
|
35079
|
-
var shouldAnimate =
|
|
35180
|
+
var OGText = styled__default.div(_templateObject3$u || (_templateObject3$u = _taggedTemplateLiteralLoose(["\n ", "\n display: flex;\n flex-direction: column;\n gap: 0;\n ", "\n ", ";\n"])), sharedKeyframes, function (_ref1) {
|
|
35181
|
+
var shouldAnimate = _ref1.shouldAnimate;
|
|
35080
35182
|
return shouldAnimate && "\n animation: fadeInSlideUp 0.3s ease-out forwards;\n ";
|
|
35081
|
-
}, function (
|
|
35082
|
-
var margin =
|
|
35183
|
+
}, function (_ref10) {
|
|
35184
|
+
var margin = _ref10.margin;
|
|
35083
35185
|
return margin ? '12px' : '0';
|
|
35084
35186
|
});
|
|
35085
|
-
var Title$3 = styled__default.p(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n ", "\n font-weight:
|
|
35086
|
-
var
|
|
35187
|
+
var Title$3 = styled__default.p(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n ", "\n // font-family: Inter;\n font-weight: 500;\n font-size: 14px;\n line-height: 18px;\n letter-spacing: 0px;\n color: ", ";\n margin: 4px 0 0 0;\n padding: ", ";\n box-sizing: border-box;\n ", "\n ", "\n"])), sharedKeyframes, function (_ref11) {
|
|
35188
|
+
var color = _ref11.color;
|
|
35189
|
+
return color;
|
|
35190
|
+
}, function (_ref12) {
|
|
35191
|
+
var padding = _ref12.padding;
|
|
35087
35192
|
return padding != null ? padding : '0';
|
|
35088
|
-
}, function (
|
|
35089
|
-
var maxWidth =
|
|
35193
|
+
}, function (_ref13) {
|
|
35194
|
+
var maxWidth = _ref13.maxWidth;
|
|
35090
35195
|
return maxWidth && "\n max-width: " + maxWidth + "px;\n ";
|
|
35091
|
-
}, function (
|
|
35092
|
-
var shouldAnimate =
|
|
35196
|
+
}, function (_ref14) {
|
|
35197
|
+
var shouldAnimate = _ref14.shouldAnimate;
|
|
35093
35198
|
return shouldAnimate && "\n animation: fadeInSlideUp 0.3s ease-out 0.1s backwards;\n ";
|
|
35094
35199
|
});
|
|
35095
|
-
var Desc = styled__default.p(_templateObject5$l || (_templateObject5$l = _taggedTemplateLiteralLoose(["\n ", "\n font-weight: normal;\n font-size: 13px;\n line-height: 16px;\n margin:
|
|
35096
|
-
var padding =
|
|
35200
|
+
var Desc = styled__default.p(_templateObject5$l || (_templateObject5$l = _taggedTemplateLiteralLoose(["\n ", "\n font-weight: normal;\n font-size: 13px;\n line-height: 16px;\n margin: 4px 0 4px 0;\n padding: ", ";\n color: ", ";\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n box-sizing: border-box;\n ", "\n ", "\n"])), sharedKeyframes, function (_ref15) {
|
|
35201
|
+
var padding = _ref15.padding;
|
|
35097
35202
|
return padding != null ? padding : '0';
|
|
35098
|
-
}, function (
|
|
35099
|
-
var color =
|
|
35203
|
+
}, function (_ref16) {
|
|
35204
|
+
var color = _ref16.color;
|
|
35100
35205
|
return color;
|
|
35101
|
-
}, function (
|
|
35102
|
-
var maxWidth =
|
|
35206
|
+
}, function (_ref17) {
|
|
35207
|
+
var maxWidth = _ref17.maxWidth;
|
|
35103
35208
|
return maxWidth && "\n max-width: " + maxWidth + "px;\n ";
|
|
35104
|
-
}, function (
|
|
35105
|
-
var shouldAnimate =
|
|
35209
|
+
}, function (_ref18) {
|
|
35210
|
+
var shouldAnimate = _ref18.shouldAnimate;
|
|
35106
35211
|
return shouldAnimate && "\n animation: fadeInSlideUp 0.3s ease-out 0.2s backwards;\n ";
|
|
35107
35212
|
});
|
|
35108
|
-
var Url = styled__default.p(_templateObject6$j || (_templateObject6$j = _taggedTemplateLiteralLoose(["\n ", "\n font-weight: normal;\n font-size: 13px;\n line-height: 16px;\n margin: 0 0 12px 0;\n padding: ", ";\n color: gray;\n box-sizing: border-box;\n ", "\n ", "\n"])), sharedKeyframes, function (
|
|
35109
|
-
var padding =
|
|
35213
|
+
var Url = styled__default.p(_templateObject6$j || (_templateObject6$j = _taggedTemplateLiteralLoose(["\n ", "\n font-weight: normal;\n font-size: 13px;\n line-height: 16px;\n margin: 0 0 12px 0;\n padding: ", ";\n color: gray;\n box-sizing: border-box;\n ", "\n ", "\n"])), sharedKeyframes, function (_ref19) {
|
|
35214
|
+
var padding = _ref19.padding;
|
|
35110
35215
|
return padding != null ? padding : '0';
|
|
35111
|
-
}, function (
|
|
35112
|
-
var maxWidth =
|
|
35216
|
+
}, function (_ref20) {
|
|
35217
|
+
var maxWidth = _ref20.maxWidth;
|
|
35113
35218
|
return maxWidth && "\n max-width: " + maxWidth + "px;\n ";
|
|
35114
|
-
}, function (
|
|
35115
|
-
var shouldAnimate =
|
|
35219
|
+
}, function (_ref21) {
|
|
35220
|
+
var shouldAnimate = _ref21.shouldAnimate;
|
|
35116
35221
|
return shouldAnimate && "\n animation: fadeInSlideUp 0.3s ease-out 0.3s backwards;\n ";
|
|
35117
35222
|
});
|
|
35118
|
-
var Img = styled__default.img(_templateObject7$h || (_templateObject7$h = _taggedTemplateLiteralLoose(["\n ", "\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n border-radius: inherit;\n ", "\n"])), sharedKeyframes, function (
|
|
35119
|
-
var shouldAnimate =
|
|
35223
|
+
var Img = styled__default.img(_templateObject7$h || (_templateObject7$h = _taggedTemplateLiteralLoose(["\n ", "\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n // object-fit: cover;\n // object-position: center;\n // image-rendering: auto;\n border-radius: inherit;\n ", "\n"])), sharedKeyframes, function (_ref22) {
|
|
35224
|
+
var shouldAnimate = _ref22.shouldAnimate;
|
|
35120
35225
|
return shouldAnimate && "\n animation: fadeIn 0.4s ease-out forwards;\n ";
|
|
35121
35226
|
});
|
|
35122
|
-
var OGRow = styled__default.div(_templateObject8$g || (_templateObject8$g = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n"])));
|
|
35227
|
+
var OGRow = styled__default.div(_templateObject8$g || (_templateObject8$g = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n padding: 0;\n"])));
|
|
35123
35228
|
var OGTextWrapper = styled__default.div(_templateObject9$e || (_templateObject9$e = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n"])));
|
|
35124
|
-
var FaviconContainer = styled__default.div(_templateObject0$d || (_templateObject0$d = _taggedTemplateLiteralLoose(["\n width: 52px;\n height: 52px;\n border-radius: 8px;\n overflow: hidden;\n margin:
|
|
35229
|
+
var FaviconContainer = styled__default.div(_templateObject0$d || (_templateObject0$d = _taggedTemplateLiteralLoose(["\n width: 52px;\n height: 52px;\n border-radius: 8px;\n overflow: hidden;\n margin: 8px;\n flex: 0 0 52px;\n"])));
|
|
35125
35230
|
var FaviconImg = styled__default.img(_templateObject1$a || (_templateObject1$a = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n"])));
|
|
35126
35231
|
|
|
35127
35232
|
var _templateObject$G, _templateObject2$B, _templateObject3$v, _templateObject4$r, _templateObject5$m;
|
|
@@ -35350,6 +35455,41 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35350
35455
|
var selectionIsActive = React.useMemo(function () {
|
|
35351
35456
|
return selectedMessagesMap && selectedMessagesMap.size > 0;
|
|
35352
35457
|
}, [selectedMessagesMap]);
|
|
35458
|
+
var hasLongLinkAttachmentUrl = React.useMemo(function () {
|
|
35459
|
+
if (!linkAttachment || !linkAttachment.url) return false;
|
|
35460
|
+
return linkAttachment.url.length > 100;
|
|
35461
|
+
}, [linkAttachment]);
|
|
35462
|
+
var oGMetadata = useSelector(function (state) {
|
|
35463
|
+
return state.MessageReducer.oGMetadata;
|
|
35464
|
+
});
|
|
35465
|
+
var linkMetadata = React.useMemo(function () {
|
|
35466
|
+
if (!(linkAttachment !== null && linkAttachment !== void 0 && linkAttachment.url)) return null;
|
|
35467
|
+
return (oGMetadata === null || oGMetadata === void 0 ? void 0 : oGMetadata[linkAttachment.url]) || null;
|
|
35468
|
+
}, [oGMetadata, linkAttachment === null || linkAttachment === void 0 ? void 0 : linkAttachment.url]);
|
|
35469
|
+
var ogMetadataContainerWidth = React.useMemo(function () {
|
|
35470
|
+
var _linkMetadata$og, _linkMetadata$og$imag, _linkMetadata$og$imag2, _linkMetadata$og2, _linkMetadata$og3, _linkMetadata$og3$fav;
|
|
35471
|
+
if (!linkMetadata || !linkAttachment) return (ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxWidth) || 400;
|
|
35472
|
+
if (hasLongLinkAttachmentUrl) {
|
|
35473
|
+
return 400;
|
|
35474
|
+
}
|
|
35475
|
+
var hasImage = (linkMetadata === null || linkMetadata === void 0 ? void 0 : (_linkMetadata$og = linkMetadata.og) === null || _linkMetadata$og === void 0 ? void 0 : (_linkMetadata$og$imag = _linkMetadata$og.image) === null || _linkMetadata$og$imag === void 0 ? void 0 : (_linkMetadata$og$imag2 = _linkMetadata$og$imag[0]) === null || _linkMetadata$og$imag2 === void 0 ? void 0 : _linkMetadata$og$imag2.url) && (linkMetadata === null || linkMetadata === void 0 ? void 0 : linkMetadata.imageWidth) && (linkMetadata === null || linkMetadata === void 0 ? void 0 : linkMetadata.imageHeight);
|
|
35476
|
+
var imageWidth = linkMetadata === null || linkMetadata === void 0 ? void 0 : linkMetadata.imageWidth;
|
|
35477
|
+
var imageHeight = linkMetadata === null || linkMetadata === void 0 ? void 0 : linkMetadata.imageHeight;
|
|
35478
|
+
var calculatedImageHeight = imageWidth && imageHeight ? imageHeight / (imageWidth / ((ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxWidth) || 400)) : 0;
|
|
35479
|
+
var showImage = hasImage && calculatedImageHeight >= 180 && calculatedImageHeight <= 400;
|
|
35480
|
+
var hasDescription = linkMetadata === null || linkMetadata === void 0 ? void 0 : (_linkMetadata$og2 = linkMetadata.og) === null || _linkMetadata$og2 === void 0 ? void 0 : _linkMetadata$og2.description;
|
|
35481
|
+
var hasFavicon = (ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.ogShowFavicon) && (linkMetadata === null || linkMetadata === void 0 ? void 0 : linkMetadata.faviconLoaded) && (linkMetadata === null || linkMetadata === void 0 ? void 0 : (_linkMetadata$og3 = linkMetadata.og) === null || _linkMetadata$og3 === void 0 ? void 0 : (_linkMetadata$og3$fav = _linkMetadata$og3.favicon) === null || _linkMetadata$og3$fav === void 0 ? void 0 : _linkMetadata$og3$fav.url);
|
|
35482
|
+
if (showImage) {
|
|
35483
|
+
return 400;
|
|
35484
|
+
}
|
|
35485
|
+
if (hasDescription && hasFavicon) {
|
|
35486
|
+
return 336;
|
|
35487
|
+
}
|
|
35488
|
+
if (hasDescription) {
|
|
35489
|
+
return 356;
|
|
35490
|
+
}
|
|
35491
|
+
return (ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxWidth) || 400;
|
|
35492
|
+
}, [linkMetadata, linkAttachment, ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxWidth, ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.ogShowFavicon, hasLongLinkAttachmentUrl]);
|
|
35353
35493
|
var handleRemoveFailedAttachment = function handleRemoveFailedAttachment(attachmentId) {
|
|
35354
35494
|
log.info('remove attachment .. ', attachmentId);
|
|
35355
35495
|
};
|
|
@@ -35367,7 +35507,10 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35367
35507
|
},
|
|
35368
35508
|
borderRadius: borderRadius,
|
|
35369
35509
|
withAttachments: notLinkAttachment,
|
|
35370
|
-
|
|
35510
|
+
hasLinkAttachment: !!linkAttachment,
|
|
35511
|
+
hasLongLinkAttachmentUrl: hasLongLinkAttachmentUrl,
|
|
35512
|
+
attachmentWidth: withAttachments ? mediaAttachment ? attachmentMetas && getSendAttachmentsAsSeparateMessages() && attachmentMetas.szw && calculateRenderedImageWidth(attachmentMetas.szw, attachmentMetas.szh, mediaAttachment.type === attachmentTypes.image ? imageAttachmentMaxWidth : videoAttachmentMaxWidth, mediaAttachment.type === attachmentTypes.image ? imageAttachmentMaxHeight : videoAttachmentMaxHeight)[0] || 400 : message.attachments[0].type === attachmentTypes.voice ? 254 : message.attachments[0].type === attachmentTypes.file ? fileAttachmentsBoxWidth : undefined : undefined,
|
|
35513
|
+
ogMetadataMaxWidth: ogMetadataContainerWidth,
|
|
35371
35514
|
noBody: !message.body && !withAttachments,
|
|
35372
35515
|
onMouseEnter: handleMouseEnter,
|
|
35373
35516
|
onMouseLeave: handleMouseLeave
|
|
@@ -35523,7 +35666,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35523
35666
|
unsupportedMessage: unsupportedMessage,
|
|
35524
35667
|
unsupportedMessageColor: textSecondary
|
|
35525
35668
|
}, ogContainerFirst && linkAttachment && !mediaAttachment && !withMediaAttachment && !fileAttachment && (/*#__PURE__*/React__default.createElement(OGMetadata, {
|
|
35526
|
-
maxWidth:
|
|
35669
|
+
maxWidth: ogMetadataContainerWidth,
|
|
35527
35670
|
maxHeight: ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxHeight,
|
|
35528
35671
|
attachments: [linkAttachment],
|
|
35529
35672
|
state: message.state,
|
|
@@ -35562,7 +35705,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35562
35705
|
}))), !withAttachments && message.state === MESSAGE_STATUS.DELETE ? (/*#__PURE__*/React__default.createElement(MessageStatusDeleted$1, {
|
|
35563
35706
|
color: textSecondary
|
|
35564
35707
|
}, " Message was deleted. ")) : '', !ogContainerFirst && linkAttachment && !mediaAttachment && !withMediaAttachment && !fileAttachment && (/*#__PURE__*/React__default.createElement(OGMetadata, {
|
|
35565
|
-
maxWidth:
|
|
35708
|
+
maxWidth: ogMetadataContainerWidth,
|
|
35566
35709
|
maxHeight: ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxHeight,
|
|
35567
35710
|
attachments: [linkAttachment],
|
|
35568
35711
|
state: message.state,
|
|
@@ -35584,7 +35727,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35584
35727
|
ogContainerBackground: ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.ogContainerBackground,
|
|
35585
35728
|
infoPadding: ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.infoPadding,
|
|
35586
35729
|
isInviteLink: ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.isInviteLink
|
|
35587
|
-
})), messageStatusAndTimePosition === 'onMessage' && !notLinkAttachment && (messageStatusVisible || messageTimeVisible) ? (/*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
35730
|
+
})), messageStatusAndTimePosition === 'onMessage' && !notLinkAttachment && !!linkAttachment && (messageStatusVisible || messageTimeVisible) ? (/*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
35588
35731
|
message: message,
|
|
35589
35732
|
showMessageTimeAndStatusOnlyOnHover: showMessageTimeAndStatusOnlyOnHover,
|
|
35590
35733
|
messageStatusDisplayingType: messageStatusDisplayingType,
|
|
@@ -35600,25 +35743,31 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35600
35743
|
messageStatusVisible: !!messageStatusVisible,
|
|
35601
35744
|
leftMargin: true,
|
|
35602
35745
|
messageTimeColorOnAttachment: messageTimeColorOnAttachment || textSecondary
|
|
35603
|
-
})) : null), notLinkAttachment && messageStatusAndTimePosition === 'onMessage' && (messageStatusVisible || messageTimeVisible) && (
|
|
35604
|
-
message
|
|
35605
|
-
|
|
35606
|
-
|
|
35607
|
-
|
|
35608
|
-
|
|
35609
|
-
|
|
35610
|
-
|
|
35611
|
-
|
|
35612
|
-
|
|
35613
|
-
|
|
35614
|
-
|
|
35615
|
-
|
|
35616
|
-
|
|
35617
|
-
|
|
35618
|
-
|
|
35619
|
-
|
|
35620
|
-
|
|
35621
|
-
|
|
35746
|
+
})) : null), notLinkAttachment && messageStatusAndTimePosition === 'onMessage' && (messageStatusVisible || messageTimeVisible) && function () {
|
|
35747
|
+
var nonLinkAttachment = message.attachments.find(function (a) {
|
|
35748
|
+
return a.type !== attachmentTypes.link;
|
|
35749
|
+
});
|
|
35750
|
+
var attachmentType = nonLinkAttachment === null || nonLinkAttachment === void 0 ? void 0 : nonLinkAttachment.type;
|
|
35751
|
+
return /*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
35752
|
+
message: message,
|
|
35753
|
+
showMessageTimeAndStatusOnlyOnHover: showMessageTimeAndStatusOnlyOnHover,
|
|
35754
|
+
messageStatusDisplayingType: messageStatusDisplayingType,
|
|
35755
|
+
messageStatusSize: messageStatusSize,
|
|
35756
|
+
messageStatusColor: attachmentType === 'voice' ? textSecondary : attachmentType === 'image' || attachmentType === 'video' ? textOnPrimary : messageStateColor || textSecondary,
|
|
35757
|
+
messageReadStatusColor: messageReadStatusColor,
|
|
35758
|
+
messageStateFontSize: messageStateFontSize,
|
|
35759
|
+
messageStateColor: messageStateColor,
|
|
35760
|
+
messageTimeFontSize: messageTimeFontSize,
|
|
35761
|
+
messageTimeColor: messageTimeColor,
|
|
35762
|
+
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight,
|
|
35763
|
+
messageTimeVisible: !!messageTimeVisible,
|
|
35764
|
+
messageStatusVisible: !!messageStatusVisible,
|
|
35765
|
+
withAttachment: withAttachments,
|
|
35766
|
+
leftMargin: true,
|
|
35767
|
+
fileAttachment: withAttachments && (attachmentType === 'file' || attachmentType === 'voice'),
|
|
35768
|
+
messageTimeColorOnAttachment: attachmentType === 'voice' ? textSecondary : attachmentType === 'image' || attachmentType === 'video' ? textOnPrimary : textSecondary
|
|
35769
|
+
});
|
|
35770
|
+
}(), withAttachments && message.attachments.map(function (attachment) {
|
|
35622
35771
|
return /*#__PURE__*/React__default.createElement(Attachment$1, {
|
|
35623
35772
|
key: attachment.tid || attachment.url,
|
|
35624
35773
|
handleMediaItemClick: selectionIsActive ? undefined : handleMediaItemClick,
|
|
@@ -35691,7 +35840,7 @@ var MessageStatusDeleted$1 = styled__default.span(_templateObject2$B || (_templa
|
|
|
35691
35840
|
}, function (props) {
|
|
35692
35841
|
return props.fontSize;
|
|
35693
35842
|
});
|
|
35694
|
-
var MessageBodyContainer = styled__default.div(_templateObject3$v || (_templateObject3$v = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: ", ";\n //display: inline-block;\n border-radius: ", ";\n direction: ", ";\n max-width: ", ";\n width:
|
|
35843
|
+
var MessageBodyContainer = styled__default.div(_templateObject3$v || (_templateObject3$v = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: ", ";\n //display: inline-block;\n border-radius: ", ";\n direction: ", ";\n max-width: ", ";\n width: ", ";\n overflow-wrap: break-word;\n word-break: break-word;\n\n ", "\n padding: ", ";\n //direction: ", ";\n //overflow: ", ";\n transition: all 0.3s;\n transform-origin: right;\n"])), function (props) {
|
|
35695
35844
|
var _props$outgoingMessag, _props$incomingMessag;
|
|
35696
35845
|
return props.isSelfMessage ? (_props$outgoingMessag = props.outgoingMessageStyles) === null || _props$outgoingMessag === void 0 ? void 0 : _props$outgoingMessag.background : (_props$incomingMessag = props.incomingMessageStyles) === null || _props$incomingMessag === void 0 ? void 0 : _props$incomingMessag.background;
|
|
35697
35846
|
}, function (props) {
|
|
@@ -35699,10 +35848,14 @@ var MessageBodyContainer = styled__default.div(_templateObject3$v || (_templateO
|
|
|
35699
35848
|
}, function (props) {
|
|
35700
35849
|
return props.rtlDirection ? 'initial' : '';
|
|
35701
35850
|
}, function (props) {
|
|
35702
|
-
return props.withAttachments ? props.attachmentWidth && props.attachmentWidth <
|
|
35851
|
+
return props.hasLinkAttachment && !props.withAttachments ? props.ogMetadataMaxWidth ? props.ogMetadataMaxWidth + "px" : '416px' : props.hasLongLinkAttachmentUrl && !props.withAttachments ? '400px' : props.withAttachments ? props.attachmentWidth && props.attachmentWidth < 400 ? props.attachmentWidth < 165 ? props.isReplyMessage ? '210px' : '165px' : props.attachmentWidth + "px" : '400px' : '100%';
|
|
35852
|
+
}, function (props) {
|
|
35853
|
+
return props.hasLinkAttachment && !props.withAttachments && props.ogMetadataMaxWidth ? props.ogMetadataMaxWidth + "px" : props.hasLongLinkAttachmentUrl && !props.withAttachments ? '416px' : 'max-content';
|
|
35854
|
+
}, function (props) {
|
|
35855
|
+
return props.hasLongLinkAttachmentUrl && "\n & a {\n overflow-wrap: anywhere;\n word-break: break-all;\n white-space: normal;\n max-width: " + (props.withAttachments ? '400px' : props.hasLinkAttachment && props.ogMetadataMaxWidth ? props.ogMetadataMaxWidth + "px" : '416px') + ";\n }\n ";
|
|
35703
35856
|
}, function (props) {
|
|
35704
35857
|
var _props$outgoingMessag2, _props$incomingMessag2;
|
|
35705
|
-
return props.withAttachments ? props.isReplyMessage ? '1px 0 0 ' : '0' : props.isSelfMessage ? ((_props$outgoingMessag2 = props.outgoingMessageStyles) === null || _props$outgoingMessag2 === void 0 ? void 0 : _props$outgoingMessag2.background) === 'inherit' ? '0' : '8px 12px' : ((_props$incomingMessag2 = props.incomingMessageStyles) === null || _props$incomingMessag2 === void 0 ? void 0 : _props$incomingMessag2.background) === 'inherit' ? ' 0' : '8px 12px';
|
|
35858
|
+
return props.withAttachments ? props.isReplyMessage ? '1px 0 0 ' : '0' : props.hasLinkAttachment ? '8px' : props.isSelfMessage ? ((_props$outgoingMessag2 = props.outgoingMessageStyles) === null || _props$outgoingMessag2 === void 0 ? void 0 : _props$outgoingMessag2.background) === 'inherit' ? '0' : '8px 12px' : ((_props$incomingMessag2 = props.incomingMessageStyles) === null || _props$incomingMessag2 === void 0 ? void 0 : _props$incomingMessag2.background) === 'inherit' ? ' 0' : '8px 12px';
|
|
35706
35859
|
}, function (props) {
|
|
35707
35860
|
return props.isSelfMessage ? 'initial' : '';
|
|
35708
35861
|
}, function (props) {
|
|
@@ -36369,6 +36522,7 @@ var Message$1 = function Message(_ref) {
|
|
|
36369
36522
|
reactionsPopupHorizontalPosition = _useState10[0],
|
|
36370
36523
|
setReactionsPopupHorizontalPosition = _useState10[1];
|
|
36371
36524
|
var scrollToNewMessage = useSelector(scrollToNewMessageSelector, reactRedux.shallowEqual);
|
|
36525
|
+
var unreadScrollTo = useSelector(unreadScrollToSelector, reactRedux.shallowEqual);
|
|
36372
36526
|
var messageItemRef = React.useRef();
|
|
36373
36527
|
var isVisible = useOnScreen(messageItemRef);
|
|
36374
36528
|
var reactionsCount = message.reactionTotals && message.reactionTotals.reduce(function (prevValue, currentValue) {
|
|
@@ -36522,20 +36676,20 @@ var Message$1 = function Message(_ref) {
|
|
|
36522
36676
|
setFrequentlyEmojisOpen(false);
|
|
36523
36677
|
};
|
|
36524
36678
|
var handleSendReadMarker = function handleSendReadMarker() {
|
|
36525
|
-
if (isVisible && message.incoming && !(message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
|
|
36526
|
-
return marker.name === MESSAGE_DELIVERY_STATUS.READ;
|
|
36527
|
-
})) && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
36528
|
-
dispatch(markMessagesAsReadAC(channel.id, [message.id]));
|
|
36529
|
-
}
|
|
36530
36679
|
if (!message.userMarkers.find(function (marker) {
|
|
36531
36680
|
return marker.name === MESSAGE_DELIVERY_STATUS.DELIVERED;
|
|
36532
36681
|
})) {
|
|
36533
36682
|
if (message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
|
|
36534
36683
|
return marker.name === MESSAGE_DELIVERY_STATUS.READ;
|
|
36535
|
-
})) {
|
|
36684
|
+
}) && message.incoming && !unreadScrollTo) {
|
|
36536
36685
|
dispatch(markMessagesAsDeliveredAC(channel.id, [message.id]));
|
|
36537
36686
|
}
|
|
36538
36687
|
}
|
|
36688
|
+
if (isVisible && message.incoming && !(message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
|
|
36689
|
+
return marker.name === MESSAGE_DELIVERY_STATUS.READ;
|
|
36690
|
+
})) && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED && !unreadScrollTo) {
|
|
36691
|
+
dispatch(markMessagesAsReadAC(channel.id, [message.id]));
|
|
36692
|
+
}
|
|
36539
36693
|
};
|
|
36540
36694
|
var handleForwardMessage = function handleForwardMessage(channelIds) {
|
|
36541
36695
|
if (channelIds && channelIds.length) {
|
|
@@ -37271,6 +37425,9 @@ var MessageList = function MessageList(_ref2) {
|
|
|
37271
37425
|
var dispatch = useDispatch();
|
|
37272
37426
|
var theme = useSelector(themeSelector);
|
|
37273
37427
|
var channel = useSelector(activeChannelSelector);
|
|
37428
|
+
var _useState = React.useState(false),
|
|
37429
|
+
scrollIntoView = _useState[0],
|
|
37430
|
+
setScrollIntoView = _useState[1];
|
|
37274
37431
|
var contactsMap = useSelector(contactsMapSelector, reactRedux.shallowEqual);
|
|
37275
37432
|
var connectionStatus = useSelector(connectionStatusSelector, reactRedux.shallowEqual);
|
|
37276
37433
|
var openedMessageMenuId = useSelector(openedMessageMenuSelector, reactRedux.shallowEqual);
|
|
@@ -37289,43 +37446,44 @@ var MessageList = function MessageList(_ref2) {
|
|
|
37289
37446
|
var pollPendingPollActions = useSelector(pendingPollActionsSelector, reactRedux.shallowEqual);
|
|
37290
37447
|
var pendingMessagesMap = useSelector(pendingMessagesMapSelector, reactRedux.shallowEqual);
|
|
37291
37448
|
var showScrollToNewMessageButton = useSelector(showScrollToNewMessageButtonSelector, reactRedux.shallowEqual);
|
|
37449
|
+
var unreadScrollTo = useSelector(unreadScrollToSelector, reactRedux.shallowEqual);
|
|
37292
37450
|
var messages = useSelector(activeChannelMessagesSelector, reactRedux.shallowEqual) || [];
|
|
37293
|
-
var
|
|
37294
|
-
unreadMessageId =
|
|
37295
|
-
setUnreadMessageId =
|
|
37296
|
-
var _useState2 = React.useState(null),
|
|
37297
|
-
mediaFile = _useState2[0],
|
|
37298
|
-
setMediaFile = _useState2[1];
|
|
37451
|
+
var _useState2 = React.useState(''),
|
|
37452
|
+
unreadMessageId = _useState2[0],
|
|
37453
|
+
setUnreadMessageId = _useState2[1];
|
|
37299
37454
|
var _useState3 = React.useState(null),
|
|
37300
|
-
|
|
37301
|
-
|
|
37455
|
+
mediaFile = _useState3[0],
|
|
37456
|
+
setMediaFile = _useState3[1];
|
|
37302
37457
|
var _useState4 = React.useState(null),
|
|
37303
|
-
|
|
37304
|
-
|
|
37305
|
-
var _useState5 = React.useState(
|
|
37306
|
-
|
|
37307
|
-
|
|
37458
|
+
isDragging = _useState4[0],
|
|
37459
|
+
setIsDragging = _useState4[1];
|
|
37460
|
+
var _useState5 = React.useState(null),
|
|
37461
|
+
showTopDate = _useState5[0],
|
|
37462
|
+
setShowTopDate = _useState5[1];
|
|
37308
37463
|
var _useState6 = React.useState(false),
|
|
37309
|
-
|
|
37310
|
-
|
|
37464
|
+
stopScrolling = _useState6[0],
|
|
37465
|
+
setStopScrolling = _useState6[1];
|
|
37466
|
+
var _useState7 = React.useState(false),
|
|
37467
|
+
isScrolling = _useState7[0],
|
|
37468
|
+
setIsScrolling = _useState7[1];
|
|
37311
37469
|
var hideTopDateTimeout = React.useRef(null);
|
|
37312
|
-
var
|
|
37313
|
-
lastVisibleMessageId =
|
|
37314
|
-
_setLastVisibleMessageId =
|
|
37315
|
-
var
|
|
37316
|
-
scrollToReply =
|
|
37317
|
-
setScrollToReply =
|
|
37318
|
-
var
|
|
37319
|
-
previousScrollTop =
|
|
37320
|
-
setPreviousScrollTop =
|
|
37321
|
-
var
|
|
37322
|
-
shouldPreserveScroll =
|
|
37323
|
-
setShouldPreserveScroll =
|
|
37470
|
+
var _useState8 = React.useState(''),
|
|
37471
|
+
lastVisibleMessageId = _useState8[0],
|
|
37472
|
+
_setLastVisibleMessageId = _useState8[1];
|
|
37473
|
+
var _useState9 = React.useState(null),
|
|
37474
|
+
scrollToReply = _useState9[0],
|
|
37475
|
+
setScrollToReply = _useState9[1];
|
|
37476
|
+
var _useState0 = React.useState(0),
|
|
37477
|
+
previousScrollTop = _useState0[0],
|
|
37478
|
+
setPreviousScrollTop = _useState0[1];
|
|
37479
|
+
var _useState1 = React.useState(false),
|
|
37480
|
+
shouldPreserveScroll = _useState1[0],
|
|
37481
|
+
setShouldPreserveScroll = _useState1[1];
|
|
37324
37482
|
var messageForReply = {};
|
|
37325
37483
|
var attachmentsSelected = false;
|
|
37326
|
-
var
|
|
37327
|
-
topDateLabel =
|
|
37328
|
-
setTopDateLabel =
|
|
37484
|
+
var _useState10 = React.useState(''),
|
|
37485
|
+
topDateLabel = _useState10[0],
|
|
37486
|
+
setTopDateLabel = _useState10[1];
|
|
37329
37487
|
var scrollRef = React.useRef(null);
|
|
37330
37488
|
var loadFromServerRef = React.useRef(false);
|
|
37331
37489
|
var loadDirectionRef = React.useRef('');
|
|
@@ -37620,6 +37778,9 @@ var MessageList = function MessageList(_ref2) {
|
|
|
37620
37778
|
behavior: 'smooth'
|
|
37621
37779
|
});
|
|
37622
37780
|
}
|
|
37781
|
+
setTimeout(function () {
|
|
37782
|
+
dispatch(scrollToNewMessageAC(false, false, false));
|
|
37783
|
+
}, 800);
|
|
37623
37784
|
} else {
|
|
37624
37785
|
nextDisableRef.current = true;
|
|
37625
37786
|
prevDisableRef.current = true;
|
|
@@ -37630,6 +37791,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
37630
37791
|
dispatch(showScrollToNewMessageButtonAC(false));
|
|
37631
37792
|
setTimeout(function () {
|
|
37632
37793
|
prevDisableRef.current = false;
|
|
37794
|
+
dispatch(scrollToNewMessageAC(false, false, false));
|
|
37633
37795
|
}, 800);
|
|
37634
37796
|
}
|
|
37635
37797
|
}
|
|
@@ -37814,6 +37976,8 @@ var MessageList = function MessageList(_ref2) {
|
|
|
37814
37976
|
};
|
|
37815
37977
|
}, [messagesLoading, messages, lastVisibleMessageId]);
|
|
37816
37978
|
React.useEffect(function () {
|
|
37979
|
+
var interval = null;
|
|
37980
|
+
log.info('connection status is changed.. .... ', connectionStatus, 'channel ... ', channel);
|
|
37817
37981
|
if (connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
37818
37982
|
Object.keys(pendingMessagesMap).forEach(function (key) {
|
|
37819
37983
|
pendingMessagesMap[key].forEach(function (msg) {
|
|
@@ -37823,37 +37987,50 @@ var MessageList = function MessageList(_ref2) {
|
|
|
37823
37987
|
if (Object.keys(pollPendingPollActions).length > 0) {
|
|
37824
37988
|
dispatch(resendPendingPollActionsAC(connectionStatus));
|
|
37825
37989
|
}
|
|
37990
|
+
var count = 0;
|
|
37991
|
+
interval = setInterval(function () {
|
|
37992
|
+
if (count > 20) {
|
|
37993
|
+
clearInterval(interval);
|
|
37994
|
+
}
|
|
37995
|
+
count++;
|
|
37996
|
+
if (channel.id && Object.keys(pollPendingPollActions).length === 0 && Object.keys(pendingMessagesMap).length === 0) {
|
|
37997
|
+
clearInterval(interval);
|
|
37998
|
+
loadingRef.current = false;
|
|
37999
|
+
prevDisableRef.current = false;
|
|
38000
|
+
nextDisableRef.current = false;
|
|
38001
|
+
clearMessagesMap();
|
|
38002
|
+
removeAllMessages();
|
|
38003
|
+
dispatch(getMessagesAC(channel));
|
|
38004
|
+
}
|
|
38005
|
+
}, 100);
|
|
37826
38006
|
}
|
|
37827
|
-
|
|
37828
|
-
|
|
37829
|
-
|
|
37830
|
-
if (connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
37831
|
-
if (channel.id && Object.keys(pollPendingPollActions).length === 0 && Object.keys(pendingMessagesMap).length === 0) {
|
|
37832
|
-
loadingRef.current = false;
|
|
37833
|
-
prevDisableRef.current = false;
|
|
37834
|
-
nextDisableRef.current = false;
|
|
37835
|
-
clearMessagesMap();
|
|
37836
|
-
removeAllMessages();
|
|
37837
|
-
dispatch(getMessagesAC(channel));
|
|
38007
|
+
return function () {
|
|
38008
|
+
if (interval) {
|
|
38009
|
+
clearInterval(interval);
|
|
37838
38010
|
}
|
|
37839
|
-
}
|
|
37840
|
-
}, [connectionStatus
|
|
38011
|
+
};
|
|
38012
|
+
}, [connectionStatus]);
|
|
37841
38013
|
React.useEffect(function () {
|
|
37842
|
-
var unreadScrollTo = getUnreadScrollTo();
|
|
37843
38014
|
if (channel.newMessageCount && channel.newMessageCount > 0 && unreadScrollTo) {
|
|
37844
|
-
|
|
37845
|
-
|
|
38015
|
+
var scrollElement = document.getElementById('scrollableDiv');
|
|
38016
|
+
if (scrollElement) {
|
|
38017
|
+
scrollElement.style.scrollBehavior = 'inherit';
|
|
37846
38018
|
}
|
|
38019
|
+
setScrollIntoView(true);
|
|
37847
38020
|
var lastReadMessageNode = document.getElementById(channel.lastDisplayedMessageId);
|
|
37848
|
-
if (lastReadMessageNode) {
|
|
37849
|
-
|
|
37850
|
-
|
|
37851
|
-
|
|
37852
|
-
|
|
37853
|
-
|
|
38021
|
+
if (lastReadMessageNode && scrollElement) {
|
|
38022
|
+
dispatch(scrollToNewMessageAC(false));
|
|
38023
|
+
scrollElement.scrollTo({
|
|
38024
|
+
top: lastReadMessageNode.offsetTop - 200,
|
|
38025
|
+
behavior: 'auto'
|
|
38026
|
+
});
|
|
38027
|
+
setTimeout(function () {
|
|
38028
|
+
dispatch(setUnreadScrollToAC(false));
|
|
38029
|
+
setScrollIntoView(false);
|
|
38030
|
+
}, 100);
|
|
37854
38031
|
}
|
|
37855
38032
|
}
|
|
37856
|
-
}, [channel.id, channel.newMessageCount, channel.lastDisplayedMessageId]);
|
|
38033
|
+
}, [channel.id, channel.newMessageCount, scrollRef.current, unreadScrollTo, channel.lastDisplayedMessageId, scrollIntoView, messages.length]);
|
|
37857
38034
|
React.useEffect(function () {
|
|
37858
38035
|
return function () {
|
|
37859
38036
|
if (hideTopDateTimeout.current) {
|
|
@@ -44896,7 +45073,7 @@ var Media = function Media(_ref) {
|
|
|
44896
45073
|
})));
|
|
44897
45074
|
};
|
|
44898
45075
|
var Container$o = styled__default.div(_templateObject$V || (_templateObject$V = _taggedTemplateLiteralLoose(["\n padding: 6px 4px;\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n transition: all 0.2s;\n align-items: flex-start;\n display: flex;\n flex-wrap: wrap;\n"])));
|
|
44899
|
-
var MediaItem = styled__default.div(_templateObject2$Q || (_templateObject2$Q = _taggedTemplateLiteralLoose(["\n width: calc(33.3333% - 4px);\n
|
|
45076
|
+
var MediaItem = styled__default.div(_templateObject2$Q || (_templateObject2$Q = _taggedTemplateLiteralLoose(["\n width: calc(33.3333% - 4px);\n aspect-ratio: 1/1;\n box-sizing: border-box;\n //border: 1px solid #ccc;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n overflow: hidden;\n margin: 2px;\n"])));
|
|
44900
45077
|
|
|
44901
45078
|
var _rect$3, _path$1u;
|
|
44902
45079
|
function _extends$1y() {
|