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