sceyt-chat-react-uikit 1.8.5-beta.6 → 1.8.5-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +873 -775
- package/index.modern.js +873 -775
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -9410,6 +9410,18 @@ function removeChannelFromMap(channelId) {
|
|
|
9410
9410
|
function checkChannelExists(channelId) {
|
|
9411
9411
|
return !!channelsMap[channelId];
|
|
9412
9412
|
}
|
|
9413
|
+
function getPendingLastMessages() {
|
|
9414
|
+
var result = {};
|
|
9415
|
+
for (var _i = 0, _Object$keys = Object.keys(channelsMap); _i < _Object$keys.length; _i++) {
|
|
9416
|
+
var _channelsMap$channelI;
|
|
9417
|
+
var channelId = _Object$keys[_i];
|
|
9418
|
+
var lastMessage = (_channelsMap$channelI = channelsMap[channelId]) === null || _channelsMap$channelI === void 0 ? void 0 : _channelsMap$channelI.lastMessage;
|
|
9419
|
+
if (lastMessage && !lastMessage.id) {
|
|
9420
|
+
result[channelId] = lastMessage;
|
|
9421
|
+
}
|
|
9422
|
+
}
|
|
9423
|
+
return result;
|
|
9424
|
+
}
|
|
9413
9425
|
function destroyChannelsMap() {
|
|
9414
9426
|
channelsMap = {};
|
|
9415
9427
|
allChannels = [];
|
|
@@ -9509,7 +9521,7 @@ function updateChannelLastMessageOnAllChannels(channelId, message) {
|
|
|
9509
9521
|
return chan.id === channelId;
|
|
9510
9522
|
});
|
|
9511
9523
|
if ((message === null || message === void 0 ? void 0 : message.state) === 'Deleted' || (message === null || message === void 0 ? void 0 : message.state) === 'Edited') {
|
|
9512
|
-
var _updateChannel, _channelsMap$
|
|
9524
|
+
var _updateChannel, _channelsMap$channelI2, _channelsMap$channelI3, _allChannelsMap$chann, _allChannelsMap$chann2;
|
|
9513
9525
|
if (((_updateChannel = updateChannel) === null || _updateChannel === void 0 ? void 0 : _updateChannel.lastMessage.id) === message.id) {
|
|
9514
9526
|
allChannels = allChannels.map(function (chan) {
|
|
9515
9527
|
if (chan.id === channelId) {
|
|
@@ -9526,7 +9538,7 @@ function updateChannelLastMessageOnAllChannels(channelId, message) {
|
|
|
9526
9538
|
return chan;
|
|
9527
9539
|
});
|
|
9528
9540
|
}
|
|
9529
|
-
if (((_channelsMap$
|
|
9541
|
+
if (((_channelsMap$channelI2 = channelsMap[channelId]) === null || _channelsMap$channelI2 === void 0 ? void 0 : (_channelsMap$channelI3 = _channelsMap$channelI2.lastMessage) === null || _channelsMap$channelI3 === void 0 ? void 0 : _channelsMap$channelI3.id) === message.id) {
|
|
9530
9542
|
channelsMap[channelId] = _extends({}, channelsMap[channelId], {
|
|
9531
9543
|
lastMessage: message
|
|
9532
9544
|
});
|
|
@@ -11857,7 +11869,10 @@ var shouldReplaceLastMessage = function shouldReplaceLastMessage(currentLastMess
|
|
|
11857
11869
|
return true;
|
|
11858
11870
|
}
|
|
11859
11871
|
if (!currentLastMessage.id) {
|
|
11860
|
-
|
|
11872
|
+
if (messagesShareReference(currentLastMessage, nextLastMessage)) {
|
|
11873
|
+
return true;
|
|
11874
|
+
}
|
|
11875
|
+
return false;
|
|
11861
11876
|
}
|
|
11862
11877
|
if (sourceMessage && getMessageLocalRef(currentLastMessage) === getMessageLocalRef(sourceMessage)) {
|
|
11863
11878
|
return true;
|
|
@@ -11959,10 +11974,37 @@ function addMessageToMap(channelId, message) {
|
|
|
11959
11974
|
if (!messagesMap[channelId]) {
|
|
11960
11975
|
messagesMap[channelId] = {};
|
|
11961
11976
|
}
|
|
11962
|
-
|
|
11963
|
-
|
|
11977
|
+
var channelMessages = messagesMap[channelId];
|
|
11978
|
+
var existingById = message.id ? channelMessages[message.id] : undefined;
|
|
11979
|
+
var existingByTid = message.tid ? channelMessages[message.tid] : undefined;
|
|
11980
|
+
var existing = existingById || existingByTid || Object.values(channelMessages).find(function (m) {
|
|
11981
|
+
return message.id && m.id === message.id || message.tid && m.tid === message.tid;
|
|
11982
|
+
});
|
|
11983
|
+
if (existing) {
|
|
11984
|
+
var merged = _extends({}, existing, {
|
|
11985
|
+
id: message.id,
|
|
11986
|
+
deliveryStatus: message.deliveryStatus,
|
|
11987
|
+
state: MESSAGE_STATUS.UNMODIFIED
|
|
11988
|
+
});
|
|
11989
|
+
if (existing.tid && channelMessages[existing.tid] && existing.tid !== (existing.id || existing.tid)) {
|
|
11990
|
+
delete channelMessages[existing.tid];
|
|
11991
|
+
}
|
|
11992
|
+
channelMessages[existing.id || existing.tid] = merged;
|
|
11993
|
+
return;
|
|
11994
|
+
}
|
|
11995
|
+
channelMessages[message.id || message.tid] = message;
|
|
11996
|
+
}
|
|
11997
|
+
function checkIsItSentAlready(messageId, channelId) {
|
|
11998
|
+
if (messagesMap[channelId]) {
|
|
11999
|
+
var messages = Object.values(messagesMap[channelId] || {});
|
|
12000
|
+
var message = messages.find(function (m) {
|
|
12001
|
+
return m.tid === messageId || m.id === messageId;
|
|
12002
|
+
});
|
|
12003
|
+
if ((message === null || message === void 0 ? void 0 : message.deliveryStatus) === MESSAGE_DELIVERY_STATUS.SENT || (message === null || message === void 0 ? void 0 : message.deliveryStatus) === MESSAGE_DELIVERY_STATUS.DELIVERED || (message === null || message === void 0 ? void 0 : message.deliveryStatus) === MESSAGE_DELIVERY_STATUS.READ || (message === null || message === void 0 ? void 0 : message.deliveryStatus) === MESSAGE_DELIVERY_STATUS.PLAYED || (message === null || message === void 0 ? void 0 : message.deliveryStatus) === MESSAGE_DELIVERY_STATUS.OPENED) {
|
|
12004
|
+
return true;
|
|
12005
|
+
}
|
|
11964
12006
|
}
|
|
11965
|
-
|
|
12007
|
+
return false;
|
|
11966
12008
|
}
|
|
11967
12009
|
function updateMessageOnMap(channelId, updatedMessage, voteDetails) {
|
|
11968
12010
|
var updatedMessageData = null;
|
|
@@ -15725,8 +15767,8 @@ var getResolvedChannelLastMessage = function getResolvedChannelLastMessage(chann
|
|
|
15725
15767
|
return storedChannel !== null && storedChannel !== void 0 && (_storedChannel$lastMe2 = storedChannel.lastMessage) !== null && _storedChannel$lastMe2 !== void 0 && _storedChannel$lastMe2.id ? storedChannel.lastMessage : null;
|
|
15726
15768
|
};
|
|
15727
15769
|
function handleChannelMessageEvent(args, SceytChatClient) {
|
|
15728
|
-
var _storedChannel$
|
|
15729
|
-
var channel, message, messageToHandle, channelFilterTypes, activeChannelId, channelExists, channelForAdd, storedChannel, candidateLastMessage, resolvedLastMessage, shouldUpdateLastMessage,
|
|
15770
|
+
var _storedChannel$lastMe3, _storedChannel$lastMe4, _store$getState$Messa, _storedChannel$lastMe9, _message$parentMessag;
|
|
15771
|
+
var channel, message, messageToHandle, channelFilterTypes, activeChannelId, channelExists, channelForAdd, storedChannel, candidateLastMessage, resolvedLastMessage, shouldUpdateLastMessage, lastMessageIsInActiveWindow, isSameLastMessage, resolvedLastMessageUpdate, _storedChannel$lastMe7, lastMessageIsVisible, messagesHasNext, existingMessage, channelDataUpdate, groupName, 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;
|
|
15730
15772
|
return _regenerator().w(function (_context) {
|
|
15731
15773
|
while (1) switch (_context.n) {
|
|
15732
15774
|
case 0:
|
|
@@ -15748,6 +15790,16 @@ function handleChannelMessageEvent(args, SceytChatClient) {
|
|
|
15748
15790
|
candidateLastMessage = channelForAdd.lastMessage || message;
|
|
15749
15791
|
resolvedLastMessage = message.repliedInThread ? (storedChannel === null || storedChannel === void 0 ? void 0 : storedChannel.lastMessage) || null : getResolvedChannelLastMessage(channel.id, candidateLastMessage, message);
|
|
15750
15792
|
shouldUpdateLastMessage = lastMessageNeedsUpdate(storedChannel === null || storedChannel === void 0 ? void 0 : storedChannel.lastMessage, resolvedLastMessage);
|
|
15793
|
+
lastMessageIsInActiveWindow = storedChannel !== null && storedChannel !== void 0 && (_storedChannel$lastMe3 = storedChannel.lastMessage) !== null && _storedChannel$lastMe3 !== void 0 && _storedChannel$lastMe3.id || storedChannel !== null && storedChannel !== void 0 && (_storedChannel$lastMe4 = storedChannel.lastMessage) !== null && _storedChannel$lastMe4 !== void 0 && _storedChannel$lastMe4.tid ? (_store$getState$Messa = store.getState().MessageReducer.activeChannelMessages) === null || _store$getState$Messa === void 0 ? void 0 : _store$getState$Messa.some(function (m) {
|
|
15794
|
+
var _storedChannel$lastMe5, _storedChannel$lastMe6;
|
|
15795
|
+
return m.id === ((_storedChannel$lastMe5 = storedChannel.lastMessage) === null || _storedChannel$lastMe5 === void 0 ? void 0 : _storedChannel$lastMe5.id) || (storedChannel === null || storedChannel === void 0 ? void 0 : (_storedChannel$lastMe6 = storedChannel.lastMessage) === null || _storedChannel$lastMe6 === void 0 ? void 0 : _storedChannel$lastMe6.tid) === m.tid;
|
|
15796
|
+
}) : false;
|
|
15797
|
+
isSameLastMessage = (storedChannel === null || storedChannel === void 0 ? void 0 : storedChannel.lastMessage) && resolvedLastMessage && (resolvedLastMessage.id && storedChannel.lastMessage.id === resolvedLastMessage.id || resolvedLastMessage.tid && storedChannel.lastMessage.tid === resolvedLastMessage.tid);
|
|
15798
|
+
resolvedLastMessageUpdate = isSameLastMessage ? _extends({}, storedChannel.lastMessage, {
|
|
15799
|
+
id: message.id,
|
|
15800
|
+
deliveryStatus: message.deliveryStatus,
|
|
15801
|
+
state: MESSAGE_STATUS.UNMODIFIED
|
|
15802
|
+
}) : resolvedLastMessage;
|
|
15751
15803
|
_context.n = 2;
|
|
15752
15804
|
return effects.put(addChannelAC(channelForAdd));
|
|
15753
15805
|
case 2:
|
|
@@ -15764,35 +15816,48 @@ function handleChannelMessageEvent(args, SceytChatClient) {
|
|
|
15764
15816
|
break;
|
|
15765
15817
|
}
|
|
15766
15818
|
_context.n = 4;
|
|
15767
|
-
return effects.put(updateChannelLastMessageAC(
|
|
15819
|
+
return effects.put(updateChannelLastMessageAC(resolvedLastMessageUpdate, channelForAdd));
|
|
15768
15820
|
case 4:
|
|
15769
15821
|
if (!(channel.id === activeChannelId)) {
|
|
15770
|
-
_context.n =
|
|
15822
|
+
_context.n = 9;
|
|
15771
15823
|
break;
|
|
15772
15824
|
}
|
|
15773
|
-
lastMessageIsVisible = storedChannel !== null && storedChannel !== void 0 && (_storedChannel$
|
|
15774
|
-
var _storedChannel$
|
|
15775
|
-
return visibleMessage.id === ((_storedChannel$
|
|
15825
|
+
lastMessageIsVisible = storedChannel !== null && storedChannel !== void 0 && (_storedChannel$lastMe7 = storedChannel.lastMessage) !== null && _storedChannel$lastMe7 !== void 0 && _storedChannel$lastMe7.id ? Object.values(getVisibleMessagesMap()).some(function (visibleMessage) {
|
|
15826
|
+
var _storedChannel$lastMe8;
|
|
15827
|
+
return visibleMessage.id === ((_storedChannel$lastMe8 = storedChannel.lastMessage) === null || _storedChannel$lastMe8 === void 0 ? void 0 : _storedChannel$lastMe8.id);
|
|
15776
15828
|
}) : false;
|
|
15777
15829
|
messagesHasNext = store.getState().MessageReducer.messagesHasNext;
|
|
15778
|
-
lastMessageIsInActiveWindow = storedChannel !== null && storedChannel !== void 0 && (_storedChannel$lastMe5 = storedChannel.lastMessage) !== null && _storedChannel$lastMe5 !== void 0 && _storedChannel$lastMe5.id ? store.getState().MessageReducer.activeChannelMessages.some(function (m) {
|
|
15779
|
-
var _storedChannel$lastMe6;
|
|
15780
|
-
return m.id === ((_storedChannel$lastMe6 = storedChannel.lastMessage) === null || _storedChannel$lastMe6 === void 0 ? void 0 : _storedChannel$lastMe6.id);
|
|
15781
|
-
}) : false;
|
|
15782
15830
|
if (!(!messagesHasNext && lastMessageIsInActiveWindow)) {
|
|
15783
|
-
_context.n =
|
|
15831
|
+
_context.n = 9;
|
|
15832
|
+
break;
|
|
15833
|
+
}
|
|
15834
|
+
existingMessage = store.getState().MessageReducer.activeChannelMessages.find(function (m) {
|
|
15835
|
+
return message.id && m.id === message.id || message.tid && m.tid === message.tid;
|
|
15836
|
+
});
|
|
15837
|
+
if (!existingMessage) {
|
|
15838
|
+
_context.n = 6;
|
|
15784
15839
|
break;
|
|
15785
15840
|
}
|
|
15786
15841
|
_context.n = 5;
|
|
15787
|
-
return effects.put(
|
|
15842
|
+
return effects.put(updateMessageAC(existingMessage.id || existingMessage.tid, _extends({}, existingMessage, {
|
|
15843
|
+
id: message.id,
|
|
15844
|
+
deliveryStatus: message.deliveryStatus,
|
|
15845
|
+
state: MESSAGE_STATUS.UNMODIFIED
|
|
15846
|
+
})));
|
|
15788
15847
|
case 5:
|
|
15789
|
-
_context.n =
|
|
15790
|
-
|
|
15848
|
+
_context.n = 7;
|
|
15849
|
+
break;
|
|
15791
15850
|
case 6:
|
|
15851
|
+
_context.n = 7;
|
|
15852
|
+
return effects.put(addMessagesAC([message], 'next'));
|
|
15853
|
+
case 7:
|
|
15854
|
+
_context.n = 8;
|
|
15855
|
+
return effects.put(loadOGMetadataForLinkAC([message], true));
|
|
15856
|
+
case 8:
|
|
15792
15857
|
if (lastMessageIsVisible) {
|
|
15793
15858
|
navigateToLatest(true);
|
|
15794
15859
|
}
|
|
15795
|
-
case
|
|
15860
|
+
case 9:
|
|
15796
15861
|
addMessageToMap(channel.id, message);
|
|
15797
15862
|
channelDataUpdate = _extends({
|
|
15798
15863
|
messageCount: channelForAdd.messageCount,
|
|
@@ -15807,39 +15872,39 @@ function handleChannelMessageEvent(args, SceytChatClient) {
|
|
|
15807
15872
|
newReactions: channelForAdd.newReactions,
|
|
15808
15873
|
userMessageReactions: [],
|
|
15809
15874
|
lastReactedMessage: null
|
|
15810
|
-
}, shouldUpdateLastMessage &&
|
|
15811
|
-
lastMessage:
|
|
15875
|
+
}, shouldUpdateLastMessage && resolvedLastMessageUpdate ? {
|
|
15876
|
+
lastMessage: resolvedLastMessageUpdate
|
|
15812
15877
|
} : {});
|
|
15813
|
-
if (storedChannel !== null && storedChannel !== void 0 && (_storedChannel$
|
|
15878
|
+
if (storedChannel !== null && storedChannel !== void 0 && (_storedChannel$lastMe9 = storedChannel.lastMessage) !== null && _storedChannel$lastMe9 !== void 0 && _storedChannel$lastMe9.id) {
|
|
15814
15879
|
appendMessageToLatestSegment(channel.id, message.id, storedChannel.lastMessage.id);
|
|
15815
15880
|
}
|
|
15816
|
-
_context.n =
|
|
15881
|
+
_context.n = 10;
|
|
15817
15882
|
return effects.put(updateChannelDataAC(channel.id, channelDataUpdate));
|
|
15818
|
-
case
|
|
15883
|
+
case 10:
|
|
15819
15884
|
groupName = getChannelGroupName(channel);
|
|
15820
|
-
_context.n =
|
|
15885
|
+
_context.n = 11;
|
|
15821
15886
|
return effects.put(updateSearchedChannelDataAC(channel.id, channelDataUpdate, groupName));
|
|
15822
|
-
case
|
|
15887
|
+
case 11:
|
|
15823
15888
|
showNotifications = getShowNotifications();
|
|
15824
15889
|
if (!(showNotifications && !message.silent && message.user.id !== SceytChatClient.user.id && !channel.muted)) {
|
|
15825
|
-
_context.n =
|
|
15890
|
+
_context.n = 14;
|
|
15826
15891
|
break;
|
|
15827
15892
|
}
|
|
15828
15893
|
if (!(Notification.permission === 'granted')) {
|
|
15829
|
-
_context.n =
|
|
15894
|
+
_context.n = 14;
|
|
15830
15895
|
break;
|
|
15831
15896
|
}
|
|
15832
|
-
_context.n =
|
|
15897
|
+
_context.n = 12;
|
|
15833
15898
|
return effects.select(browserTabIsActiveSelector);
|
|
15834
|
-
case
|
|
15899
|
+
case 12:
|
|
15835
15900
|
tabIsActive = _context.v;
|
|
15836
15901
|
if (!(document.visibilityState !== 'visible' || !tabIsActive || channel.id !== activeChannelId)) {
|
|
15837
|
-
_context.n =
|
|
15902
|
+
_context.n = 14;
|
|
15838
15903
|
break;
|
|
15839
15904
|
}
|
|
15840
|
-
_context.n =
|
|
15905
|
+
_context.n = 13;
|
|
15841
15906
|
return effects.select(contactsMapSelector);
|
|
15842
|
-
case
|
|
15907
|
+
case 13:
|
|
15843
15908
|
contactsMap = _context.v;
|
|
15844
15909
|
getFromContacts = getShowOnlyContactUsers();
|
|
15845
15910
|
state = store.getState();
|
|
@@ -15859,25 +15924,25 @@ function handleChannelMessageEvent(args, SceytChatClient) {
|
|
|
15859
15924
|
setNotification((message === null || message === void 0 ? void 0 : message.type) === exports.MESSAGE_TYPE.VIEW_ONCE ? "Self-destructing" : messageBody, message.user, channel, undefined, message.attachments && message.attachments.length ? message.attachments.find(function (att) {
|
|
15860
15925
|
return att.type !== attachmentTypes.link;
|
|
15861
15926
|
}) : undefined);
|
|
15862
|
-
case
|
|
15927
|
+
case 14:
|
|
15863
15928
|
if (!(message.repliedInThread && (_message$parentMessag = message.parentMessage) !== null && _message$parentMessag !== void 0 && _message$parentMessag.id)) {
|
|
15864
|
-
_context.n =
|
|
15929
|
+
_context.n = 16;
|
|
15865
15930
|
break;
|
|
15866
15931
|
}
|
|
15867
|
-
_context.n = 13;
|
|
15868
|
-
return effects.put(markMessagesAsDeliveredAC(message.parentMessage.id, [message.id]));
|
|
15869
|
-
case 13:
|
|
15870
15932
|
_context.n = 15;
|
|
15933
|
+
return effects.put(markMessagesAsDeliveredAC(message.parentMessage.id, [message.id]));
|
|
15934
|
+
case 15:
|
|
15935
|
+
_context.n = 17;
|
|
15871
15936
|
break;
|
|
15872
|
-
case
|
|
15873
|
-
_context.n =
|
|
15937
|
+
case 16:
|
|
15938
|
+
_context.n = 17;
|
|
15874
15939
|
return effects.put(markMessagesAsDeliveredAC(channel.id, [message.id]));
|
|
15875
|
-
case
|
|
15940
|
+
case 17:
|
|
15876
15941
|
updateChannelOnAllChannels(channel.id, channelDataUpdate);
|
|
15877
15942
|
if (shouldUpdateLastMessage) {
|
|
15878
|
-
updateChannelLastMessageOnAllChannels(channel.id,
|
|
15943
|
+
updateChannelLastMessageOnAllChannels(channel.id, resolvedLastMessageUpdate);
|
|
15879
15944
|
}
|
|
15880
|
-
case
|
|
15945
|
+
case 18:
|
|
15881
15946
|
return _context.a(2);
|
|
15882
15947
|
}
|
|
15883
15948
|
}, _marked$1);
|
|
@@ -16324,7 +16389,7 @@ function watchForEvents() {
|
|
|
16324
16389
|
};
|
|
16325
16390
|
});
|
|
16326
16391
|
_loop = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
16327
|
-
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, joinedMember, _chan2, customLoadMembersFunctions, joinMembersEvent, membersList, updateChannelData, _channel, member, _channelExists, activeChannelId, groupName, _updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId, _channelExists3, activeChannel, _updateChannelData2, _groupName, _channel4, addedMembers, _activeChannelId2, _channelExists4, _updateChannelData3, _customLoadMembersFunctions, addMembersEvent, _membersList, _groupName2, onUpdateChannel, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _channel5, fields, _activeChannelId3, _groupName3, channelId, markerList, _channel6, _markerList$user, isOwnMarker, _activeChannelId4, updateLastMessage, markersMap, _iterator, _step, messageId, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId5, _channelExists6, _channel9, message, _activeChannelId6, _channelExists7, _channel0, user, _message, reaction, isSelf, _activeChannelId7, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelUpdateParams, _pollDetailsData$chan, _pollDetailsData$chan2, _channel1, pollDetails, _messageId, pollDetailsData, _activeChannelId8, addedVotes, deletedVotes, objs, _iterator2, _step2, vote, _iterator3, _step3, _vote, _i, _objs, obj, _store$getState$
|
|
16392
|
+
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, joinedMember, _chan2, customLoadMembersFunctions, joinMembersEvent, membersList, updateChannelData, _channel, member, _channelExists, activeChannelId, groupName, _updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId, _channelExists3, activeChannel, _updateChannelData2, _groupName, _channel4, addedMembers, _activeChannelId2, _channelExists4, _updateChannelData3, _customLoadMembersFunctions, addMembersEvent, _membersList, _groupName2, onUpdateChannel, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _channel5, fields, _activeChannelId3, _groupName3, channelId, markerList, _channel6, _markerList$user, isOwnMarker, _activeChannelId4, updateLastMessage, markersMap, _iterator, _step, messageId, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId5, _channelExists6, _channel9, message, _activeChannelId6, _channelExists7, _channel0, user, _message, reaction, isSelf, _activeChannelId7, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelUpdateParams, _pollDetailsData$chan, _pollDetailsData$chan2, _channel1, pollDetails, _messageId, pollDetailsData, _activeChannelId8, addedVotes, deletedVotes, objs, _iterator2, _step2, vote, _iterator3, _step3, _vote, _i, _objs, obj, _store$getState$Messa2, key, hasNext, _i2, _objs2, _obj, _pollDetailsData$chan3, _channel10, _pollDetails, _messageId2, _pollDetailsData, _activeChannelId9, _deletedVotes, _objs3, _iterator4, _step4, _vote2, _i3, _objs4, _obj2, _i4, _objs5, _obj3, _pollDetailsData2$cha, _channel11, _pollDetails2, _messageId3, _activeChannelId0, _pollDetailsData2, retractedVotes, _objs6, _iterator5, _step5, _vote4, _i5, _objs7, _obj4, _iterator6, _step6, _vote3, _channel12, _messageId4, _activeChannelId1, _obj5, _channel13, _user, _message2, _reaction, channelFromMap, _isSelf, _activeChannelId10, _channelUpdateParams, _channel14, _activeChannelId11, channelExist, _channel15, _channel16, _channel17, _channel18, _channel19, _channel20, _channel21, _groupName4, _channel22, _groupName5, _channel23, members, _activeChannelId12, _customLoadMembersFunctions2, updateMembersEvent, _membersList2, i, _channel24, _channel25, _channelId2, from, name, status, _t, _t2, _t3, _t4;
|
|
16328
16393
|
return _regenerator().w(function (_context3) {
|
|
16329
16394
|
while (1) switch (_context3.p = _context3.n) {
|
|
16330
16395
|
case 0:
|
|
@@ -17011,7 +17076,7 @@ function watchForEvents() {
|
|
|
17011
17076
|
break;
|
|
17012
17077
|
}
|
|
17013
17078
|
key = pollDetailsData.id + "_" + obj.vote.optionId;
|
|
17014
|
-
hasNext = ((_store$getState$
|
|
17079
|
+
hasNext = ((_store$getState$Messa2 = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa2 === void 0 ? void 0 : _store$getState$Messa2[key]) || false;
|
|
17015
17080
|
if (!(obj.type === 'addOwn')) {
|
|
17016
17081
|
_context3.n = 95;
|
|
17017
17082
|
break;
|
|
@@ -17845,15 +17910,15 @@ function createChannel(action) {
|
|
|
17845
17910
|
}, _marked$2, null, [[0, 18]]);
|
|
17846
17911
|
}
|
|
17847
17912
|
function getChannels(action) {
|
|
17848
|
-
var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys, _Object$keys2, _mappedChannels2, channelMessageMap, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, _connectionStatus, allChannelsData, allChannelList, _t2, _t3, _t4;
|
|
17849
|
-
return _regenerator().w(function (
|
|
17850
|
-
while (1) switch (
|
|
17913
|
+
var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, pendingLastMessages, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _loop, _i, _Object$keys, _Object$keys2, _Object$keys3, _mappedChannels2, channelMessageMap, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, _connectionStatus, allChannelsData, allChannelList, _t2, _t3, _t4;
|
|
17914
|
+
return _regenerator().w(function (_context3) {
|
|
17915
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
17851
17916
|
case 0:
|
|
17852
17917
|
log.info(new Date().toISOString() + " [getChannels] start get channels");
|
|
17853
|
-
|
|
17918
|
+
_context3.p = 1;
|
|
17854
17919
|
payload = action.payload;
|
|
17855
17920
|
params = payload.params;
|
|
17856
|
-
|
|
17921
|
+
_context3.n = 2;
|
|
17857
17922
|
return effects.call(deletePendingDeleteChannels);
|
|
17858
17923
|
case 2:
|
|
17859
17924
|
log.info(new Date().toISOString() + " [getChannels] input params: " + JSON.stringify(params));
|
|
@@ -17861,13 +17926,13 @@ function getChannels(action) {
|
|
|
17861
17926
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
17862
17927
|
log.info(new Date().toISOString() + " [getChannels] connection status: " + connectionStatus);
|
|
17863
17928
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
17864
|
-
|
|
17929
|
+
_context3.n = 3;
|
|
17865
17930
|
break;
|
|
17866
17931
|
}
|
|
17867
17932
|
log.warn(new Date().toISOString() + " [getChannels] connection not ready, aborting. Status: " + connectionStatus);
|
|
17868
|
-
return
|
|
17933
|
+
return _context3.a(2);
|
|
17869
17934
|
case 3:
|
|
17870
|
-
|
|
17935
|
+
_context3.n = 4;
|
|
17871
17936
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
17872
17937
|
case 4:
|
|
17873
17938
|
channelQueryBuilder = new SceytChatClient.ChannelListQueryBuilder();
|
|
@@ -17892,65 +17957,102 @@ function getChannels(action) {
|
|
|
17892
17957
|
limit = params.limit || 50;
|
|
17893
17958
|
log.info(new Date().toISOString() + " [getChannels] query limit: " + limit);
|
|
17894
17959
|
channelQueryBuilder.limit(limit);
|
|
17895
|
-
|
|
17960
|
+
_context3.n = 5;
|
|
17896
17961
|
return effects.call(channelQueryBuilder.build);
|
|
17897
17962
|
case 5:
|
|
17898
|
-
channelQuery =
|
|
17963
|
+
channelQuery = _context3.v;
|
|
17899
17964
|
log.info(new Date().toISOString() + " [getChannels] query built successfully");
|
|
17900
|
-
|
|
17965
|
+
_context3.n = 6;
|
|
17901
17966
|
return effects.call(channelQuery.loadNextPage);
|
|
17902
17967
|
case 6:
|
|
17903
|
-
channelsData =
|
|
17968
|
+
channelsData = _context3.v;
|
|
17904
17969
|
channelList = channelsData.channels;
|
|
17905
17970
|
log.info(new Date().toISOString() + " [getChannels] channelsData received: " + JSON.stringify({
|
|
17906
17971
|
channelsCount: (channelList === null || channelList === void 0 ? void 0 : channelList.length) || 0,
|
|
17907
17972
|
hasNext: channelsData.hasNext
|
|
17908
17973
|
}));
|
|
17909
|
-
|
|
17974
|
+
_context3.n = 7;
|
|
17910
17975
|
return effects.put(channelHasNextAC(channelsData.hasNext));
|
|
17911
17976
|
case 7:
|
|
17912
|
-
|
|
17977
|
+
_context3.n = 8;
|
|
17913
17978
|
return effects.call(getActiveChannelId);
|
|
17914
17979
|
case 8:
|
|
17915
|
-
channelId =
|
|
17980
|
+
channelId = _context3.v;
|
|
17916
17981
|
log.info(new Date().toISOString() + " [getChannels] active channelId: " + channelId);
|
|
17917
17982
|
if (!channelId) {
|
|
17918
|
-
|
|
17983
|
+
_context3.n = 10;
|
|
17919
17984
|
break;
|
|
17920
17985
|
}
|
|
17921
|
-
|
|
17986
|
+
_context3.n = 9;
|
|
17922
17987
|
return effects.call(getChannelFromMap, channelId);
|
|
17923
17988
|
case 9:
|
|
17924
|
-
_t2 =
|
|
17925
|
-
|
|
17989
|
+
_t2 = _context3.v;
|
|
17990
|
+
_context3.n = 11;
|
|
17926
17991
|
break;
|
|
17927
17992
|
case 10:
|
|
17928
17993
|
_t2 = null;
|
|
17929
17994
|
case 11:
|
|
17930
17995
|
activeChannel = _t2;
|
|
17931
17996
|
log.info(new Date().toISOString() + " [getChannels] activeChannel from map: " + (activeChannel ? (_activeChannel = activeChannel) === null || _activeChannel === void 0 ? void 0 : _activeChannel.id : 'null'));
|
|
17932
|
-
|
|
17997
|
+
pendingLastMessages = getPendingLastMessages();
|
|
17998
|
+
_context3.n = 12;
|
|
17933
17999
|
return effects.call(destroyChannelsMap);
|
|
17934
18000
|
case 12:
|
|
17935
18001
|
log.info(new Date().toISOString() + " [getChannels] channels map destroyed");
|
|
17936
|
-
|
|
18002
|
+
_context3.n = 13;
|
|
17937
18003
|
return effects.call(setChannelsInMap, channelList);
|
|
17938
18004
|
case 13:
|
|
17939
|
-
_yield$call =
|
|
18005
|
+
_yield$call = _context3.v;
|
|
17940
18006
|
mappedChannels = _yield$call.channels;
|
|
17941
18007
|
channelsForUpdateLastReactionMessage = _yield$call.channelsForUpdateLastReactionMessage;
|
|
18008
|
+
_loop = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
18009
|
+
var channelId, pendingLastMessage, mappedChannel, mapEntry;
|
|
18010
|
+
return _regenerator().w(function (_context2) {
|
|
18011
|
+
while (1) switch (_context2.n) {
|
|
18012
|
+
case 0:
|
|
18013
|
+
channelId = _Object$keys[_i];
|
|
18014
|
+
pendingLastMessage = pendingLastMessages[channelId];
|
|
18015
|
+
mappedChannel = mappedChannels.find(function (ch) {
|
|
18016
|
+
return ch.id === channelId;
|
|
18017
|
+
});
|
|
18018
|
+
if (mappedChannel) {
|
|
18019
|
+
mappedChannel.lastMessage = pendingLastMessage;
|
|
18020
|
+
}
|
|
18021
|
+
mapEntry = getChannelFromMap(channelId);
|
|
18022
|
+
if (mapEntry) {
|
|
18023
|
+
setChannelInMap(_extends({}, mapEntry, {
|
|
18024
|
+
lastMessage: pendingLastMessage
|
|
18025
|
+
}));
|
|
18026
|
+
}
|
|
18027
|
+
case 1:
|
|
18028
|
+
return _context2.a(2);
|
|
18029
|
+
}
|
|
18030
|
+
}, _callee);
|
|
18031
|
+
});
|
|
18032
|
+
_i = 0, _Object$keys = Object.keys(pendingLastMessages);
|
|
18033
|
+
case 14:
|
|
18034
|
+
if (!(_i < _Object$keys.length)) {
|
|
18035
|
+
_context3.n = 16;
|
|
18036
|
+
break;
|
|
18037
|
+
}
|
|
18038
|
+
return _context3.d(_regeneratorValues(_loop()), 15);
|
|
18039
|
+
case 15:
|
|
18040
|
+
_i++;
|
|
18041
|
+
_context3.n = 14;
|
|
18042
|
+
break;
|
|
18043
|
+
case 16:
|
|
17942
18044
|
log.info(new Date().toISOString() + " [getChannels] setChannelsInMap result: " + JSON.stringify({
|
|
17943
18045
|
mappedChannelsCount: ((_mappedChannels = mappedChannels) === null || _mappedChannels === void 0 ? void 0 : _mappedChannels.length) || 0,
|
|
17944
18046
|
channelsForUpdateLastReactionMessageCount: (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length) || 0
|
|
17945
18047
|
}));
|
|
17946
18048
|
log.info(new Date().toISOString() + " channelsForUpdateLastReactionMessage: " + (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length));
|
|
17947
18049
|
if (!(channelsForUpdateLastReactionMessage !== null && channelsForUpdateLastReactionMessage !== void 0 && channelsForUpdateLastReactionMessage.length)) {
|
|
17948
|
-
|
|
18050
|
+
_context3.n = 18;
|
|
17949
18051
|
break;
|
|
17950
18052
|
}
|
|
17951
18053
|
log.info(new Date().toISOString() + " [getChannels] processing channels for\n reaction message update: " + (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length));
|
|
17952
18054
|
channelMessageMap = {};
|
|
17953
|
-
|
|
18055
|
+
_context3.n = 17;
|
|
17954
18056
|
return effects.call(function () {
|
|
17955
18057
|
try {
|
|
17956
18058
|
return Promise.resolve(Promise.all(channelsForUpdateLastReactionMessage.map(function (channel) {
|
|
@@ -17973,8 +18075,8 @@ function getChannels(action) {
|
|
|
17973
18075
|
return Promise.reject(e);
|
|
17974
18076
|
}
|
|
17975
18077
|
});
|
|
17976
|
-
case
|
|
17977
|
-
log.info(new Date().toISOString() + " [getChannels] reaction messages fetched: " + (channelMessageMap ? (_Object$
|
|
18078
|
+
case 17:
|
|
18079
|
+
log.info(new Date().toISOString() + " [getChannels] reaction messages fetched: " + (channelMessageMap ? (_Object$keys2 = Object.keys(channelMessageMap)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length : 0), channelMessageMap ? (_Object$keys3 = Object.keys(channelMessageMap)) === null || _Object$keys3 === void 0 ? void 0 : _Object$keys3.length : 0);
|
|
17978
18080
|
mappedChannels = mappedChannels.map(function (channel) {
|
|
17979
18081
|
if (channelMessageMap[channel === null || channel === void 0 ? void 0 : channel.id]) {
|
|
17980
18082
|
channel.lastReactedMessage = channelMessageMap[channel === null || channel === void 0 ? void 0 : channel.id];
|
|
@@ -17982,31 +18084,31 @@ function getChannels(action) {
|
|
|
17982
18084
|
return channel;
|
|
17983
18085
|
});
|
|
17984
18086
|
log.info(new Date().toISOString() + " [getChannels] mappedChannels updated with reaction messages, final count: " + (((_mappedChannels2 = mappedChannels) === null || _mappedChannels2 === void 0 ? void 0 : _mappedChannels2.length) || 0));
|
|
17985
|
-
case
|
|
18087
|
+
case 18:
|
|
17986
18088
|
log.info(new Date().toISOString() + " [getChannels] setting channels in state, count: " + (((_mappedChannels3 = mappedChannels) === null || _mappedChannels3 === void 0 ? void 0 : _mappedChannels3.length) || 0));
|
|
17987
|
-
|
|
18089
|
+
_context3.n = 19;
|
|
17988
18090
|
return effects.put(setChannelsAC(mappedChannels));
|
|
17989
|
-
case
|
|
18091
|
+
case 19:
|
|
17990
18092
|
if (!channelId) {
|
|
17991
18093
|
activeChannel = channelList[0];
|
|
17992
18094
|
log.info(new Date().toISOString() + " [getChannels] no active channelId, setting first channel as active: " + ((_activeChannel2 = activeChannel) === null || _activeChannel2 === void 0 ? void 0 : _activeChannel2.id));
|
|
17993
18095
|
}
|
|
17994
18096
|
query.channelQuery = channelQuery;
|
|
17995
18097
|
if (!(activeChannel && getAutoSelectFitsChannel())) {
|
|
17996
|
-
|
|
18098
|
+
_context3.n = 20;
|
|
17997
18099
|
break;
|
|
17998
18100
|
}
|
|
17999
18101
|
log.info(new Date().toISOString() + " [getChannels] auto-selecting channel: " + ((_activeChannel3 = activeChannel) === null || _activeChannel3 === void 0 ? void 0 : _activeChannel3.id));
|
|
18000
|
-
|
|
18102
|
+
_context3.n = 20;
|
|
18001
18103
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
18002
|
-
case
|
|
18003
|
-
|
|
18104
|
+
case 20:
|
|
18105
|
+
_context3.n = 21;
|
|
18004
18106
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18005
|
-
case
|
|
18107
|
+
case 21:
|
|
18006
18108
|
hiddenList = store.getState().ChannelReducer.hideChannelList;
|
|
18007
18109
|
log.info(new Date().toISOString() + " [getChannels] hiddenList state: " + hiddenList);
|
|
18008
18110
|
if (hiddenList) {
|
|
18009
|
-
|
|
18111
|
+
_context3.n = 32;
|
|
18010
18112
|
break;
|
|
18011
18113
|
}
|
|
18012
18114
|
log.info(new Date().toISOString() + " [getChannels] starting all channels query (hiddenList is false)");
|
|
@@ -18021,37 +18123,37 @@ function getChannels(action) {
|
|
|
18021
18123
|
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery memberCount: " + (params === null || params === void 0 ? void 0 : params.memberCount));
|
|
18022
18124
|
}
|
|
18023
18125
|
allChannelsQueryBuilder.limit(50);
|
|
18024
|
-
|
|
18126
|
+
_context3.n = 22;
|
|
18025
18127
|
return effects.call(allChannelsQueryBuilder.build);
|
|
18026
|
-
case
|
|
18027
|
-
allChannelsQuery =
|
|
18128
|
+
case 22:
|
|
18129
|
+
allChannelsQuery = _context3.v;
|
|
18028
18130
|
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery built");
|
|
18029
18131
|
hasNext = true;
|
|
18030
18132
|
totalAllChannelsAdded = 0;
|
|
18031
18133
|
i = 0;
|
|
18032
|
-
case
|
|
18134
|
+
case 23:
|
|
18033
18135
|
if (!(i <= 4)) {
|
|
18034
|
-
|
|
18136
|
+
_context3.n = 31;
|
|
18035
18137
|
break;
|
|
18036
18138
|
}
|
|
18037
18139
|
if (!hasNext) {
|
|
18038
|
-
|
|
18140
|
+
_context3.n = 29;
|
|
18039
18141
|
break;
|
|
18040
18142
|
}
|
|
18041
|
-
|
|
18143
|
+
_context3.p = 24;
|
|
18042
18144
|
_connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
18043
18145
|
if (!(_connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
18044
|
-
|
|
18146
|
+
_context3.n = 25;
|
|
18045
18147
|
break;
|
|
18046
18148
|
}
|
|
18047
18149
|
log.warn(new Date().toISOString() + " [getChannels] connection not ready, aborting. Status: " + _connectionStatus);
|
|
18048
|
-
return
|
|
18049
|
-
case
|
|
18150
|
+
return _context3.a(3, 31);
|
|
18151
|
+
case 25:
|
|
18050
18152
|
log.info(new Date().toISOString() + " [getChannels] loading all channels page: " + (i + 1));
|
|
18051
|
-
|
|
18153
|
+
_context3.n = 26;
|
|
18052
18154
|
return effects.call(allChannelsQuery.loadNextPage);
|
|
18053
|
-
case
|
|
18054
|
-
allChannelsData =
|
|
18155
|
+
case 26:
|
|
18156
|
+
allChannelsData = _context3.v;
|
|
18055
18157
|
hasNext = allChannelsData.hasNext;
|
|
18056
18158
|
allChannelList = allChannelsData.channels;
|
|
18057
18159
|
log.info(new Date().toISOString() + " [getChannels] all channels page: " + (i + 1), i + 1, 'loaded:', JSON.stringify({
|
|
@@ -18061,63 +18163,63 @@ function getChannels(action) {
|
|
|
18061
18163
|
addChannelsToAllChannels(allChannelList);
|
|
18062
18164
|
totalAllChannelsAdded += (allChannelList === null || allChannelList === void 0 ? void 0 : allChannelList.length) || 0;
|
|
18063
18165
|
log.info(new Date().toISOString() + " [getChannels] total all channels added so far: " + totalAllChannelsAdded);
|
|
18064
|
-
|
|
18166
|
+
_context3.n = 28;
|
|
18065
18167
|
break;
|
|
18066
|
-
case
|
|
18067
|
-
|
|
18068
|
-
_t3 =
|
|
18168
|
+
case 27:
|
|
18169
|
+
_context3.p = 27;
|
|
18170
|
+
_t3 = _context3.v;
|
|
18069
18171
|
log.error(_t3, "Error on get all channels page: " + (i + 1));
|
|
18070
|
-
return
|
|
18071
|
-
case
|
|
18072
|
-
|
|
18172
|
+
return _context3.a(3, 31);
|
|
18173
|
+
case 28:
|
|
18174
|
+
_context3.n = 30;
|
|
18073
18175
|
break;
|
|
18074
|
-
case
|
|
18176
|
+
case 29:
|
|
18075
18177
|
log.info(new Date().toISOString() + " [getChannels] no more pages available, stopping at iteration: " + i);
|
|
18076
|
-
case
|
|
18178
|
+
case 30:
|
|
18077
18179
|
i++;
|
|
18078
|
-
|
|
18180
|
+
_context3.n = 23;
|
|
18079
18181
|
break;
|
|
18080
|
-
case
|
|
18182
|
+
case 31:
|
|
18081
18183
|
log.info(new Date().toISOString() + " [getChannels] all channels query completed, total channels added: " + totalAllChannelsAdded);
|
|
18082
|
-
|
|
18184
|
+
_context3.n = 33;
|
|
18083
18185
|
break;
|
|
18084
|
-
case
|
|
18186
|
+
case 32:
|
|
18085
18187
|
log.info(new Date().toISOString() + " [getChannels] skipping all channels query (hiddenList is true)");
|
|
18086
|
-
case
|
|
18188
|
+
case 33:
|
|
18087
18189
|
log.info(new Date().toISOString() + " [getChannels] completed successfully. Final mapped channels count: " + (((_mappedChannels4 = mappedChannels) === null || _mappedChannels4 === void 0 ? void 0 : _mappedChannels4.length) || 0));
|
|
18088
|
-
|
|
18190
|
+
_context3.n = 35;
|
|
18089
18191
|
break;
|
|
18090
|
-
case
|
|
18091
|
-
|
|
18092
|
-
_t4 =
|
|
18192
|
+
case 34:
|
|
18193
|
+
_context3.p = 34;
|
|
18194
|
+
_t4 = _context3.v;
|
|
18093
18195
|
log.error(new Date().toISOString() + " [getChannels] error occurred: " + JSON.stringify(_t4), 'Error on get channels');
|
|
18094
18196
|
log.error(new Date().toISOString() + " [getChannels] error details: " + JSON.stringify({
|
|
18095
18197
|
message: _t4.message,
|
|
18096
18198
|
code: _t4.code,
|
|
18097
18199
|
stack: _t4.stack
|
|
18098
18200
|
}));
|
|
18099
|
-
case
|
|
18100
|
-
return
|
|
18201
|
+
case 35:
|
|
18202
|
+
return _context3.a(2);
|
|
18101
18203
|
}
|
|
18102
|
-
}, _marked2$2, null, [[
|
|
18204
|
+
}, _marked2$2, null, [[24, 27], [1, 34]]);
|
|
18103
18205
|
}
|
|
18104
18206
|
function searchChannels(action) {
|
|
18105
18207
|
var payload, params, contactsMap, SceytChatClient, getFromContacts, searchBy, _params$filter2, _types2, channelQueryBuilder, channelTypesFilter, types, allChannels, publicChannels, chatsGroups, contactsList, contactsWithChannelsMap, lowerCaseSearchBy, handleChannels, channelsMap, _iterator, _step, channel, channelQuery, channelsData, _iterator2, _step2, _channel, channelsToAdd, _t5;
|
|
18106
|
-
return _regenerator().w(function (
|
|
18107
|
-
while (1) switch (
|
|
18208
|
+
return _regenerator().w(function (_context4) {
|
|
18209
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
18108
18210
|
case 0:
|
|
18109
|
-
|
|
18211
|
+
_context4.p = 0;
|
|
18110
18212
|
payload = action.payload;
|
|
18111
18213
|
params = payload.params, contactsMap = payload.contactsMap;
|
|
18112
18214
|
log.info('search channel payload: ', payload);
|
|
18113
18215
|
SceytChatClient = getClient();
|
|
18114
18216
|
getFromContacts = getShowOnlyContactUsers();
|
|
18115
|
-
|
|
18217
|
+
_context4.n = 1;
|
|
18116
18218
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18117
18219
|
case 1:
|
|
18118
18220
|
searchBy = params.search;
|
|
18119
18221
|
if (!searchBy) {
|
|
18120
|
-
|
|
18222
|
+
_context4.n = 6;
|
|
18121
18223
|
break;
|
|
18122
18224
|
}
|
|
18123
18225
|
channelQueryBuilder = new SceytChatClient.ChannelListQueryBuilder();
|
|
@@ -18183,14 +18285,14 @@ function searchChannels(action) {
|
|
|
18183
18285
|
}
|
|
18184
18286
|
});
|
|
18185
18287
|
}
|
|
18186
|
-
|
|
18288
|
+
_context4.n = 2;
|
|
18187
18289
|
return effects.put(setSearchedChannelsAC({
|
|
18188
18290
|
chats_groups: JSON.parse(JSON.stringify(chatsGroups)),
|
|
18189
18291
|
channels: JSON.parse(JSON.stringify(publicChannels)),
|
|
18190
18292
|
contacts: JSON.parse(JSON.stringify(contactsList))
|
|
18191
18293
|
}));
|
|
18192
18294
|
case 2:
|
|
18193
|
-
|
|
18295
|
+
_context4.n = 3;
|
|
18194
18296
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18195
18297
|
case 3:
|
|
18196
18298
|
channelQueryBuilder.query(lowerCaseSearchBy);
|
|
@@ -18198,14 +18300,14 @@ function searchChannels(action) {
|
|
|
18198
18300
|
channelQueryBuilder.order('lastMessage');
|
|
18199
18301
|
channelQueryBuilder.filterKey(['subject']);
|
|
18200
18302
|
channelQueryBuilder.searchOperator('contains');
|
|
18201
|
-
|
|
18303
|
+
_context4.n = 4;
|
|
18202
18304
|
return effects.call(channelQueryBuilder.build);
|
|
18203
18305
|
case 4:
|
|
18204
|
-
channelQuery =
|
|
18205
|
-
|
|
18306
|
+
channelQuery = _context4.v;
|
|
18307
|
+
_context4.n = 5;
|
|
18206
18308
|
return effects.call(channelQuery.loadNextPage);
|
|
18207
18309
|
case 5:
|
|
18208
|
-
channelsData =
|
|
18310
|
+
channelsData = _context4.v;
|
|
18209
18311
|
for (_iterator2 = _createForOfIteratorHelperLoose(channelsData.channels); !(_step2 = _iterator2()).done;) {
|
|
18210
18312
|
_channel = _step2.value;
|
|
18211
18313
|
channelsMap[_channel.id] = _channel;
|
|
@@ -18216,32 +18318,32 @@ function searchChannels(action) {
|
|
|
18216
18318
|
channelsToAdd = channelsData.channels.filter(function (channel) {
|
|
18217
18319
|
return channel.type === DEFAULT_CHANNEL_TYPE.PUBLIC || channel.type === DEFAULT_CHANNEL_TYPE.BROADCAST;
|
|
18218
18320
|
});
|
|
18219
|
-
|
|
18321
|
+
_context4.n = 6;
|
|
18220
18322
|
return effects.put(setSearchedChannelsAC({
|
|
18221
18323
|
chats_groups: JSON.parse(JSON.stringify(chatsGroups)),
|
|
18222
18324
|
channels: JSON.parse(JSON.stringify(channelsToAdd)),
|
|
18223
18325
|
contacts: JSON.parse(JSON.stringify(contactsList))
|
|
18224
18326
|
}));
|
|
18225
18327
|
case 6:
|
|
18226
|
-
|
|
18328
|
+
_context4.n = 8;
|
|
18227
18329
|
break;
|
|
18228
18330
|
case 7:
|
|
18229
|
-
|
|
18230
|
-
_t5 =
|
|
18331
|
+
_context4.p = 7;
|
|
18332
|
+
_t5 = _context4.v;
|
|
18231
18333
|
log.error(_t5, 'Error on get channels');
|
|
18232
18334
|
case 8:
|
|
18233
|
-
return
|
|
18335
|
+
return _context4.a(2);
|
|
18234
18336
|
}
|
|
18235
18337
|
}, _marked3$1, null, [[0, 7]]);
|
|
18236
18338
|
}
|
|
18237
18339
|
function getChannelsForForward() {
|
|
18238
18340
|
var _SceytChatClient, channelQueryBuilder, channelTypesFilter, channelQuery, channelsData, channelsToAdd, _yield$call2, mappedChannels, _t6;
|
|
18239
|
-
return _regenerator().w(function (
|
|
18240
|
-
while (1) switch (
|
|
18341
|
+
return _regenerator().w(function (_context5) {
|
|
18342
|
+
while (1) switch (_context5.p = _context5.n) {
|
|
18241
18343
|
case 0:
|
|
18242
|
-
|
|
18344
|
+
_context5.p = 0;
|
|
18243
18345
|
_SceytChatClient = getClient();
|
|
18244
|
-
|
|
18346
|
+
_context5.n = 1;
|
|
18245
18347
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING, true));
|
|
18246
18348
|
case 1:
|
|
18247
18349
|
channelQueryBuilder = new _SceytChatClient.ChannelListQueryBuilder();
|
|
@@ -18251,15 +18353,15 @@ function getChannelsForForward() {
|
|
|
18251
18353
|
channelQueryBuilder.types(channelTypesFilter);
|
|
18252
18354
|
}
|
|
18253
18355
|
channelQueryBuilder.limit(20);
|
|
18254
|
-
|
|
18356
|
+
_context5.n = 2;
|
|
18255
18357
|
return effects.call(channelQueryBuilder.build);
|
|
18256
18358
|
case 2:
|
|
18257
|
-
channelQuery =
|
|
18258
|
-
|
|
18359
|
+
channelQuery = _context5.v;
|
|
18360
|
+
_context5.n = 3;
|
|
18259
18361
|
return effects.call(channelQuery.loadNextPage);
|
|
18260
18362
|
case 3:
|
|
18261
|
-
channelsData =
|
|
18262
|
-
|
|
18363
|
+
channelsData = _context5.v;
|
|
18364
|
+
_context5.n = 4;
|
|
18263
18365
|
return effects.put(channelHasNextAC(channelsData.hasNext, true));
|
|
18264
18366
|
case 4:
|
|
18265
18367
|
channelsToAdd = channelsData.channels.filter(function (channel) {
|
|
@@ -18269,45 +18371,45 @@ function getChannelsForForward() {
|
|
|
18269
18371
|
return member.id && member.id !== _SceytChatClient.user.id;
|
|
18270
18372
|
}) : true;
|
|
18271
18373
|
});
|
|
18272
|
-
|
|
18374
|
+
_context5.n = 5;
|
|
18273
18375
|
return effects.call(setChannelsInMap, channelsToAdd);
|
|
18274
18376
|
case 5:
|
|
18275
|
-
_yield$call2 =
|
|
18377
|
+
_yield$call2 = _context5.v;
|
|
18276
18378
|
mappedChannels = _yield$call2.channels;
|
|
18277
|
-
|
|
18379
|
+
_context5.n = 6;
|
|
18278
18380
|
return effects.put(setChannelsForForwardAC(mappedChannels));
|
|
18279
18381
|
case 6:
|
|
18280
18382
|
query.channelQueryForward = channelQuery;
|
|
18281
|
-
|
|
18383
|
+
_context5.n = 7;
|
|
18282
18384
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED, true));
|
|
18283
18385
|
case 7:
|
|
18284
|
-
|
|
18386
|
+
_context5.n = 9;
|
|
18285
18387
|
break;
|
|
18286
18388
|
case 8:
|
|
18287
|
-
|
|
18288
|
-
_t6 =
|
|
18389
|
+
_context5.p = 8;
|
|
18390
|
+
_t6 = _context5.v;
|
|
18289
18391
|
log.error(_t6, 'Error on get for forward channels');
|
|
18290
18392
|
case 9:
|
|
18291
|
-
return
|
|
18393
|
+
return _context5.a(2);
|
|
18292
18394
|
}
|
|
18293
18395
|
}, _marked4, null, [[0, 8]]);
|
|
18294
18396
|
}
|
|
18295
18397
|
function searchChannelsForForward(action) {
|
|
18296
18398
|
var payload, params, _contactsMap, _SceytChatClient2, _getFromContacts, searchBy, _params$filter3, _types3, channelQueryBuilder, channelTypesFilter, types, allChannels, _publicChannels, _chatsGroups, contactsList, _contactsWithChannelsMap, _lowerCaseSearchBy, handleChannels, channelsMap, _iterator3, _step3, channel, channelQuery, channelsData, _iterator4, _step4, _channel2, channelsToAdd, _t7;
|
|
18297
|
-
return _regenerator().w(function (
|
|
18298
|
-
while (1) switch (
|
|
18399
|
+
return _regenerator().w(function (_context6) {
|
|
18400
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
18299
18401
|
case 0:
|
|
18300
|
-
|
|
18402
|
+
_context6.p = 0;
|
|
18301
18403
|
payload = action.payload;
|
|
18302
18404
|
params = payload.params, _contactsMap = payload.contactsMap;
|
|
18303
18405
|
_SceytChatClient2 = getClient();
|
|
18304
18406
|
_getFromContacts = getShowOnlyContactUsers();
|
|
18305
|
-
|
|
18407
|
+
_context6.n = 1;
|
|
18306
18408
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING, true));
|
|
18307
18409
|
case 1:
|
|
18308
18410
|
searchBy = params.search;
|
|
18309
18411
|
if (!searchBy) {
|
|
18310
|
-
|
|
18412
|
+
_context6.n = 6;
|
|
18311
18413
|
break;
|
|
18312
18414
|
}
|
|
18313
18415
|
channelQueryBuilder = new _SceytChatClient2.ChannelListQueryBuilder();
|
|
@@ -18370,14 +18472,14 @@ function searchChannelsForForward(action) {
|
|
|
18370
18472
|
}
|
|
18371
18473
|
});
|
|
18372
18474
|
}
|
|
18373
|
-
|
|
18475
|
+
_context6.n = 2;
|
|
18374
18476
|
return effects.put(setSearchedChannelsForForwardAC({
|
|
18375
18477
|
chats_groups: JSON.parse(JSON.stringify(_chatsGroups)),
|
|
18376
18478
|
channels: JSON.parse(JSON.stringify(_publicChannels)),
|
|
18377
18479
|
contacts: JSON.parse(JSON.stringify(contactsList))
|
|
18378
18480
|
}));
|
|
18379
18481
|
case 2:
|
|
18380
|
-
|
|
18482
|
+
_context6.n = 3;
|
|
18381
18483
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED, true));
|
|
18382
18484
|
case 3:
|
|
18383
18485
|
channelQueryBuilder.query(_lowerCaseSearchBy);
|
|
@@ -18385,14 +18487,14 @@ function searchChannelsForForward(action) {
|
|
|
18385
18487
|
channelQueryBuilder.order('lastMessage');
|
|
18386
18488
|
channelQueryBuilder.filterKey(['subject']);
|
|
18387
18489
|
channelQueryBuilder.searchOperator('contains');
|
|
18388
|
-
|
|
18490
|
+
_context6.n = 4;
|
|
18389
18491
|
return effects.call(channelQueryBuilder.build);
|
|
18390
18492
|
case 4:
|
|
18391
|
-
channelQuery =
|
|
18392
|
-
|
|
18493
|
+
channelQuery = _context6.v;
|
|
18494
|
+
_context6.n = 5;
|
|
18393
18495
|
return effects.call(channelQuery.loadNextPage);
|
|
18394
18496
|
case 5:
|
|
18395
|
-
channelsData =
|
|
18497
|
+
channelsData = _context6.v;
|
|
18396
18498
|
for (_iterator4 = _createForOfIteratorHelperLoose(channelsData.channels); !(_step4 = _iterator4()).done;) {
|
|
18397
18499
|
_channel2 = _step4.value;
|
|
18398
18500
|
channelsMap[_channel2.id] = _channel2;
|
|
@@ -18403,31 +18505,31 @@ function searchChannelsForForward(action) {
|
|
|
18403
18505
|
channelsToAdd = channelsData.channels.filter(function (channel) {
|
|
18404
18506
|
return channel.type === DEFAULT_CHANNEL_TYPE.PUBLIC || channel.type === DEFAULT_CHANNEL_TYPE.BROADCAST;
|
|
18405
18507
|
});
|
|
18406
|
-
|
|
18508
|
+
_context6.n = 6;
|
|
18407
18509
|
return effects.put(setSearchedChannelsForForwardAC({
|
|
18408
18510
|
chats_groups: JSON.parse(JSON.stringify(_chatsGroups)),
|
|
18409
18511
|
channels: JSON.parse(JSON.stringify(channelsToAdd)),
|
|
18410
18512
|
contacts: JSON.parse(JSON.stringify(contactsList))
|
|
18411
18513
|
}));
|
|
18412
18514
|
case 6:
|
|
18413
|
-
|
|
18515
|
+
_context6.n = 8;
|
|
18414
18516
|
break;
|
|
18415
18517
|
case 7:
|
|
18416
|
-
|
|
18417
|
-
_t7 =
|
|
18518
|
+
_context6.p = 7;
|
|
18519
|
+
_t7 = _context6.v;
|
|
18418
18520
|
log.error(_t7, 'Error on get channels');
|
|
18419
18521
|
case 8:
|
|
18420
|
-
return
|
|
18522
|
+
return _context6.a(2);
|
|
18421
18523
|
}
|
|
18422
18524
|
}, _marked5, null, [[0, 7]]);
|
|
18423
18525
|
}
|
|
18424
18526
|
function channelsLoadMore(action) {
|
|
18425
|
-
var _mappedChannels5, _mappedChannels7, _mappedChannels8, payload, limit, channelQuery, channelsData, channelList, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, _Object$
|
|
18426
|
-
return _regenerator().w(function (
|
|
18427
|
-
while (1) switch (
|
|
18527
|
+
var _mappedChannels5, _mappedChannels7, _mappedChannels8, payload, limit, channelQuery, channelsData, channelList, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys4, _mappedChannels6, channelMessageMap, _t8;
|
|
18528
|
+
return _regenerator().w(function (_context7) {
|
|
18529
|
+
while (1) switch (_context7.p = _context7.n) {
|
|
18428
18530
|
case 0:
|
|
18429
18531
|
log.info(new Date().toISOString() + " [channelsLoadMore] start load more channels");
|
|
18430
|
-
|
|
18532
|
+
_context7.p = 1;
|
|
18431
18533
|
payload = action.payload;
|
|
18432
18534
|
limit = payload.limit;
|
|
18433
18535
|
log.info(new Date().toISOString() + " [channelsLoadMore] input payload:", JSON.stringify({
|
|
@@ -18436,11 +18538,11 @@ function channelsLoadMore(action) {
|
|
|
18436
18538
|
channelQuery = query.channelQuery;
|
|
18437
18539
|
log.info(new Date().toISOString() + " [channelsLoadMore] channelQuery exists:", !!channelQuery);
|
|
18438
18540
|
if (channelQuery) {
|
|
18439
|
-
|
|
18541
|
+
_context7.n = 2;
|
|
18440
18542
|
break;
|
|
18441
18543
|
}
|
|
18442
18544
|
log.error(new Date().toISOString() + " [channelsLoadMore] channelQuery is null or undefined, cannot load more");
|
|
18443
|
-
return
|
|
18545
|
+
return _context7.a(2);
|
|
18444
18546
|
case 2:
|
|
18445
18547
|
if (limit) {
|
|
18446
18548
|
log.info(new Date().toISOString() + " [channelsLoadMore] setting query limit to:", limit);
|
|
@@ -18448,27 +18550,27 @@ function channelsLoadMore(action) {
|
|
|
18448
18550
|
} else {
|
|
18449
18551
|
log.info(new Date().toISOString() + " [channelsLoadMore] no limit provided, using existing query limit");
|
|
18450
18552
|
}
|
|
18451
|
-
|
|
18553
|
+
_context7.n = 3;
|
|
18452
18554
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18453
18555
|
case 3:
|
|
18454
18556
|
log.info(new Date().toISOString() + " [channelsLoadMore] loading next page...");
|
|
18455
|
-
|
|
18557
|
+
_context7.n = 4;
|
|
18456
18558
|
return effects.call(channelQuery.loadNextPage);
|
|
18457
18559
|
case 4:
|
|
18458
|
-
channelsData =
|
|
18560
|
+
channelsData = _context7.v;
|
|
18459
18561
|
channelList = channelsData.channels;
|
|
18460
18562
|
log.info(new Date().toISOString() + " [channelsLoadMore] channelsData received:", JSON.stringify({
|
|
18461
18563
|
channelsCount: (channelList === null || channelList === void 0 ? void 0 : channelList.length) || 0,
|
|
18462
18564
|
hasNext: channelsData.hasNext
|
|
18463
18565
|
}));
|
|
18464
|
-
|
|
18566
|
+
_context7.n = 5;
|
|
18465
18567
|
return effects.put(channelHasNextAC(channelsData.hasNext));
|
|
18466
18568
|
case 5:
|
|
18467
18569
|
log.info(new Date().toISOString() + " [channelsLoadMore] hasNext set to:", channelsData.hasNext);
|
|
18468
|
-
|
|
18570
|
+
_context7.n = 6;
|
|
18469
18571
|
return effects.call(setChannelsInMap, channelsData.channels);
|
|
18470
18572
|
case 6:
|
|
18471
|
-
_yield$call3 =
|
|
18573
|
+
_yield$call3 = _context7.v;
|
|
18472
18574
|
mappedChannels = _yield$call3.channels;
|
|
18473
18575
|
channelsForUpdateLastReactionMessage = _yield$call3.channelsForUpdateLastReactionMessage;
|
|
18474
18576
|
log.info(new Date().toISOString() + " [channelsLoadMore] setChannelsInMap result:", JSON.stringify({
|
|
@@ -18476,12 +18578,12 @@ function channelsLoadMore(action) {
|
|
|
18476
18578
|
channelsForUpdateLastReactionMessageCount: (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length) || 0
|
|
18477
18579
|
}));
|
|
18478
18580
|
if (!(channelsForUpdateLastReactionMessage !== null && channelsForUpdateLastReactionMessage !== void 0 && channelsForUpdateLastReactionMessage.length)) {
|
|
18479
|
-
|
|
18581
|
+
_context7.n = 8;
|
|
18480
18582
|
break;
|
|
18481
18583
|
}
|
|
18482
18584
|
log.info(new Date().toISOString() + " [channelsLoadMore] processing channels for reaction message update:", channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length);
|
|
18483
18585
|
channelMessageMap = {};
|
|
18484
|
-
|
|
18586
|
+
_context7.n = 7;
|
|
18485
18587
|
return effects.call(function () {
|
|
18486
18588
|
try {
|
|
18487
18589
|
return Promise.resolve(Promise.all(channelsForUpdateLastReactionMessage.map(function (channel) {
|
|
@@ -18505,7 +18607,7 @@ function channelsLoadMore(action) {
|
|
|
18505
18607
|
}
|
|
18506
18608
|
});
|
|
18507
18609
|
case 7:
|
|
18508
|
-
log.info(new Date().toISOString() + " [channelsLoadMore] reaction messages fetched:", channelMessageMap ? (_Object$
|
|
18610
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] reaction messages fetched:", channelMessageMap ? (_Object$keys4 = Object.keys(channelMessageMap)) === null || _Object$keys4 === void 0 ? void 0 : _Object$keys4.length : 0);
|
|
18509
18611
|
mappedChannels = mappedChannels.map(function (channel) {
|
|
18510
18612
|
if (channelMessageMap[channel.id]) {
|
|
18511
18613
|
channel.lastReactedMessage = channelMessageMap[channel.id];
|
|
@@ -18513,24 +18615,24 @@ function channelsLoadMore(action) {
|
|
|
18513
18615
|
return channel;
|
|
18514
18616
|
});
|
|
18515
18617
|
log.info(new Date().toISOString() + " [channelsLoadMore] mappedChannels updated with reaction messages, final count:", ((_mappedChannels6 = mappedChannels) === null || _mappedChannels6 === void 0 ? void 0 : _mappedChannels6.length) || 0);
|
|
18516
|
-
|
|
18618
|
+
_context7.n = 9;
|
|
18517
18619
|
break;
|
|
18518
18620
|
case 8:
|
|
18519
18621
|
log.info(new Date().toISOString() + " [channelsLoadMore] no channels need reaction message update");
|
|
18520
18622
|
case 9:
|
|
18521
18623
|
log.info(new Date().toISOString() + " [channelsLoadMore] adding channels to state, count:", ((_mappedChannels7 = mappedChannels) === null || _mappedChannels7 === void 0 ? void 0 : _mappedChannels7.length) || 0);
|
|
18522
|
-
|
|
18624
|
+
_context7.n = 10;
|
|
18523
18625
|
return effects.put(addChannelsAC(mappedChannels));
|
|
18524
18626
|
case 10:
|
|
18525
|
-
|
|
18627
|
+
_context7.n = 11;
|
|
18526
18628
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18527
18629
|
case 11:
|
|
18528
18630
|
log.info(new Date().toISOString() + " [channelsLoadMore] completed successfully. Total channels added:", ((_mappedChannels8 = mappedChannels) === null || _mappedChannels8 === void 0 ? void 0 : _mappedChannels8.length) || 0);
|
|
18529
|
-
|
|
18631
|
+
_context7.n = 13;
|
|
18530
18632
|
break;
|
|
18531
18633
|
case 12:
|
|
18532
|
-
|
|
18533
|
-
_t8 =
|
|
18634
|
+
_context7.p = 12;
|
|
18635
|
+
_t8 = _context7.v;
|
|
18534
18636
|
log.error(new Date().toISOString() + " [channelsLoadMore] error occurred:", _t8);
|
|
18535
18637
|
log.error(new Date().toISOString() + " [channelsLoadMore] error details:", JSON.stringify({
|
|
18536
18638
|
message: _t8 === null || _t8 === void 0 ? void 0 : _t8.message,
|
|
@@ -18538,16 +18640,16 @@ function channelsLoadMore(action) {
|
|
|
18538
18640
|
stack: _t8 === null || _t8 === void 0 ? void 0 : _t8.stack
|
|
18539
18641
|
}));
|
|
18540
18642
|
case 13:
|
|
18541
|
-
return
|
|
18643
|
+
return _context7.a(2);
|
|
18542
18644
|
}
|
|
18543
18645
|
}, _marked6, null, [[1, 12]]);
|
|
18544
18646
|
}
|
|
18545
18647
|
function getChannelMentions(action) {
|
|
18546
18648
|
var payload, channelId, _SceytChatClient3, mentionsQueryBuilder, mentionsQuery, mentions, _t9;
|
|
18547
|
-
return _regenerator().w(function (
|
|
18548
|
-
while (1) switch (
|
|
18649
|
+
return _regenerator().w(function (_context8) {
|
|
18650
|
+
while (1) switch (_context8.p = _context8.n) {
|
|
18549
18651
|
case 0:
|
|
18550
|
-
|
|
18652
|
+
_context8.p = 0;
|
|
18551
18653
|
payload = action.payload;
|
|
18552
18654
|
channelId = payload.channelId;
|
|
18553
18655
|
_SceytChatClient3 = getClient();
|
|
@@ -18555,36 +18657,36 @@ function getChannelMentions(action) {
|
|
|
18555
18657
|
mentionsQueryBuilder.setChannelId(channelId);
|
|
18556
18658
|
mentionsQueryBuilder.limit(10);
|
|
18557
18659
|
mentionsQueryBuilder.setDirection(queryDirection.NEXT);
|
|
18558
|
-
|
|
18660
|
+
_context8.n = 1;
|
|
18559
18661
|
return effects.call(mentionsQueryBuilder.build);
|
|
18560
18662
|
case 1:
|
|
18561
|
-
mentionsQuery =
|
|
18562
|
-
|
|
18663
|
+
mentionsQuery = _context8.v;
|
|
18664
|
+
_context8.n = 2;
|
|
18563
18665
|
return effects.call(mentionsQuery.loadNext);
|
|
18564
18666
|
case 2:
|
|
18565
|
-
mentions =
|
|
18566
|
-
|
|
18667
|
+
mentions = _context8.v;
|
|
18668
|
+
_context8.n = 3;
|
|
18567
18669
|
return effects.put(updateChannelDataAC(channelId, {
|
|
18568
18670
|
mentionsIds: mentions.mentions
|
|
18569
18671
|
}));
|
|
18570
18672
|
case 3:
|
|
18571
|
-
|
|
18673
|
+
_context8.n = 5;
|
|
18572
18674
|
break;
|
|
18573
18675
|
case 4:
|
|
18574
|
-
|
|
18575
|
-
_t9 =
|
|
18676
|
+
_context8.p = 4;
|
|
18677
|
+
_t9 = _context8.v;
|
|
18576
18678
|
log.error(_t9, 'Error in get channel mentions');
|
|
18577
18679
|
case 5:
|
|
18578
|
-
return
|
|
18680
|
+
return _context8.a(2);
|
|
18579
18681
|
}
|
|
18580
18682
|
}, _marked7, null, [[0, 4]]);
|
|
18581
18683
|
}
|
|
18582
18684
|
function channelsForForwardLoadMore(action) {
|
|
18583
18685
|
var payload, limit, _SceytChatClient4, channelQueryForward, channelsData, channelsToAdd, _yield$call4, mappedChannels, _t0;
|
|
18584
|
-
return _regenerator().w(function (
|
|
18585
|
-
while (1) switch (
|
|
18686
|
+
return _regenerator().w(function (_context9) {
|
|
18687
|
+
while (1) switch (_context9.p = _context9.n) {
|
|
18586
18688
|
case 0:
|
|
18587
|
-
|
|
18689
|
+
_context9.p = 0;
|
|
18588
18690
|
payload = action.payload;
|
|
18589
18691
|
limit = payload.limit;
|
|
18590
18692
|
_SceytChatClient4 = getClient();
|
|
@@ -18592,14 +18694,14 @@ function channelsForForwardLoadMore(action) {
|
|
|
18592
18694
|
if (limit) {
|
|
18593
18695
|
channelQueryForward.limit = limit;
|
|
18594
18696
|
}
|
|
18595
|
-
|
|
18697
|
+
_context9.n = 1;
|
|
18596
18698
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING, true));
|
|
18597
18699
|
case 1:
|
|
18598
|
-
|
|
18700
|
+
_context9.n = 2;
|
|
18599
18701
|
return effects.call(channelQueryForward.loadNextPage);
|
|
18600
18702
|
case 2:
|
|
18601
|
-
channelsData =
|
|
18602
|
-
|
|
18703
|
+
channelsData = _context9.v;
|
|
18704
|
+
_context9.n = 3;
|
|
18603
18705
|
return effects.put(channelHasNextAC(channelsData.hasNext, true));
|
|
18604
18706
|
case 3:
|
|
18605
18707
|
channelsToAdd = channelsData.channels.filter(function (channel) {
|
|
@@ -18607,47 +18709,47 @@ function channelsForForwardLoadMore(action) {
|
|
|
18607
18709
|
return member.id && member.id !== _SceytChatClient4.user.id;
|
|
18608
18710
|
}) : true;
|
|
18609
18711
|
});
|
|
18610
|
-
|
|
18712
|
+
_context9.n = 4;
|
|
18611
18713
|
return effects.call(setChannelsInMap, channelsToAdd);
|
|
18612
18714
|
case 4:
|
|
18613
|
-
_yield$call4 =
|
|
18715
|
+
_yield$call4 = _context9.v;
|
|
18614
18716
|
mappedChannels = _yield$call4.channels;
|
|
18615
|
-
|
|
18717
|
+
_context9.n = 5;
|
|
18616
18718
|
return effects.put(addChannelsForForwardAC(mappedChannels));
|
|
18617
18719
|
case 5:
|
|
18618
|
-
|
|
18720
|
+
_context9.n = 6;
|
|
18619
18721
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED, true));
|
|
18620
18722
|
case 6:
|
|
18621
|
-
|
|
18723
|
+
_context9.n = 8;
|
|
18622
18724
|
break;
|
|
18623
18725
|
case 7:
|
|
18624
|
-
|
|
18625
|
-
_t0 =
|
|
18726
|
+
_context9.p = 7;
|
|
18727
|
+
_t0 = _context9.v;
|
|
18626
18728
|
log.error(_t0, 'Error in load more channels for forward');
|
|
18627
18729
|
case 8:
|
|
18628
|
-
return
|
|
18730
|
+
return _context9.a(2);
|
|
18629
18731
|
}
|
|
18630
18732
|
}, _marked8, null, [[0, 7]]);
|
|
18631
18733
|
}
|
|
18632
18734
|
function markMessagesRead(action) {
|
|
18633
18735
|
var payload, channelId, messageIds, connectionStatus, channel, messageListMarker, _iterator5, _step5, messageId, updateParams, _t1;
|
|
18634
|
-
return _regenerator().w(function (
|
|
18635
|
-
while (1) switch (
|
|
18736
|
+
return _regenerator().w(function (_context0) {
|
|
18737
|
+
while (1) switch (_context0.p = _context0.n) {
|
|
18636
18738
|
case 0:
|
|
18637
18739
|
payload = action.payload;
|
|
18638
18740
|
channelId = payload.channelId, messageIds = payload.messageIds;
|
|
18639
18741
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
18640
18742
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
18641
|
-
|
|
18743
|
+
_context0.n = 1;
|
|
18642
18744
|
break;
|
|
18643
18745
|
}
|
|
18644
|
-
return
|
|
18746
|
+
return _context0.a(2);
|
|
18645
18747
|
case 1:
|
|
18646
|
-
|
|
18748
|
+
_context0.n = 2;
|
|
18647
18749
|
return effects.call(getChannelFromMap, channelId);
|
|
18648
18750
|
case 2:
|
|
18649
|
-
channel =
|
|
18650
|
-
|
|
18751
|
+
channel = _context0.v;
|
|
18752
|
+
_context0.p = 3;
|
|
18651
18753
|
if (!channel) {
|
|
18652
18754
|
channel = getChannelFromAllChannels(channelId);
|
|
18653
18755
|
if (channel) {
|
|
@@ -18655,15 +18757,15 @@ function markMessagesRead(action) {
|
|
|
18655
18757
|
}
|
|
18656
18758
|
}
|
|
18657
18759
|
if (!channel) {
|
|
18658
|
-
|
|
18760
|
+
_context0.n = 9;
|
|
18659
18761
|
break;
|
|
18660
18762
|
}
|
|
18661
18763
|
console.log('Mark Messages As Read', messageIds);
|
|
18662
|
-
|
|
18764
|
+
_context0.n = 4;
|
|
18663
18765
|
return effects.call(channel.markMessagesAsDisplayed, messageIds);
|
|
18664
18766
|
case 4:
|
|
18665
|
-
messageListMarker =
|
|
18666
|
-
|
|
18767
|
+
messageListMarker = _context0.v;
|
|
18768
|
+
_context0.n = 5;
|
|
18667
18769
|
return effects.put(updateChannelDataAC(channel.id, {
|
|
18668
18770
|
lastReadMessageId: channel.lastDisplayedMessageId
|
|
18669
18771
|
}));
|
|
@@ -18674,7 +18776,7 @@ function markMessagesRead(action) {
|
|
|
18674
18776
|
_iterator5 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
18675
18777
|
case 6:
|
|
18676
18778
|
if ((_step5 = _iterator5()).done) {
|
|
18677
|
-
|
|
18779
|
+
_context0.n = 9;
|
|
18678
18780
|
break;
|
|
18679
18781
|
}
|
|
18680
18782
|
messageId = _step5.value;
|
|
@@ -18687,7 +18789,7 @@ function markMessagesRead(action) {
|
|
|
18687
18789
|
name: MESSAGE_DELIVERY_STATUS.READ
|
|
18688
18790
|
}]
|
|
18689
18791
|
};
|
|
18690
|
-
|
|
18792
|
+
_context0.n = 7;
|
|
18691
18793
|
return effects.put(updateMessageAC(messageId, updateParams));
|
|
18692
18794
|
case 7:
|
|
18693
18795
|
updateMessageOnMap(channel.id, {
|
|
@@ -18695,39 +18797,39 @@ function markMessagesRead(action) {
|
|
|
18695
18797
|
params: updateParams
|
|
18696
18798
|
});
|
|
18697
18799
|
case 8:
|
|
18698
|
-
|
|
18800
|
+
_context0.n = 6;
|
|
18699
18801
|
break;
|
|
18700
18802
|
case 9:
|
|
18701
|
-
|
|
18803
|
+
_context0.n = 11;
|
|
18702
18804
|
break;
|
|
18703
18805
|
case 10:
|
|
18704
|
-
|
|
18705
|
-
_t1 =
|
|
18806
|
+
_context0.p = 10;
|
|
18807
|
+
_t1 = _context0.v;
|
|
18706
18808
|
log.error(_t1, 'Error on mark messages read');
|
|
18707
18809
|
case 11:
|
|
18708
|
-
return
|
|
18810
|
+
return _context0.a(2);
|
|
18709
18811
|
}
|
|
18710
18812
|
}, _marked9, null, [[3, 10]]);
|
|
18711
18813
|
}
|
|
18712
18814
|
function markVoiceMessageAsPlayed(action) {
|
|
18713
18815
|
var payload, channelId, messageIds, connectionStatus, channel, messageListMarker, _iterator6, _step6, messageId, updateParams, _t10;
|
|
18714
|
-
return _regenerator().w(function (
|
|
18715
|
-
while (1) switch (
|
|
18816
|
+
return _regenerator().w(function (_context1) {
|
|
18817
|
+
while (1) switch (_context1.p = _context1.n) {
|
|
18716
18818
|
case 0:
|
|
18717
18819
|
payload = action.payload;
|
|
18718
18820
|
channelId = payload.channelId, messageIds = payload.messageIds;
|
|
18719
18821
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
18720
18822
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
18721
|
-
|
|
18823
|
+
_context1.n = 1;
|
|
18722
18824
|
break;
|
|
18723
18825
|
}
|
|
18724
|
-
return
|
|
18826
|
+
return _context1.a(2);
|
|
18725
18827
|
case 1:
|
|
18726
|
-
|
|
18727
|
-
|
|
18828
|
+
_context1.p = 1;
|
|
18829
|
+
_context1.n = 2;
|
|
18728
18830
|
return effects.call(getChannelFromMap, channelId);
|
|
18729
18831
|
case 2:
|
|
18730
|
-
channel =
|
|
18832
|
+
channel = _context1.v;
|
|
18731
18833
|
if (!channel) {
|
|
18732
18834
|
channel = getChannelFromAllChannels(channelId);
|
|
18733
18835
|
if (channel) {
|
|
@@ -18735,17 +18837,17 @@ function markVoiceMessageAsPlayed(action) {
|
|
|
18735
18837
|
}
|
|
18736
18838
|
}
|
|
18737
18839
|
if (!channel) {
|
|
18738
|
-
|
|
18840
|
+
_context1.n = 7;
|
|
18739
18841
|
break;
|
|
18740
18842
|
}
|
|
18741
|
-
|
|
18843
|
+
_context1.n = 3;
|
|
18742
18844
|
return effects.call(channel.markVoiceMessagesAsPlayed, messageIds);
|
|
18743
18845
|
case 3:
|
|
18744
|
-
messageListMarker =
|
|
18846
|
+
messageListMarker = _context1.v;
|
|
18745
18847
|
_iterator6 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
18746
18848
|
case 4:
|
|
18747
18849
|
if ((_step6 = _iterator6()).done) {
|
|
18748
|
-
|
|
18850
|
+
_context1.n = 7;
|
|
18749
18851
|
break;
|
|
18750
18852
|
}
|
|
18751
18853
|
messageId = _step6.value;
|
|
@@ -18758,7 +18860,7 @@ function markVoiceMessageAsPlayed(action) {
|
|
|
18758
18860
|
name: MESSAGE_DELIVERY_STATUS.PLAYED
|
|
18759
18861
|
}]
|
|
18760
18862
|
};
|
|
18761
|
-
|
|
18863
|
+
_context1.n = 5;
|
|
18762
18864
|
return effects.put(updateMessageAC(messageId, updateParams));
|
|
18763
18865
|
case 5:
|
|
18764
18866
|
updateMessageOnMap(channel.id, {
|
|
@@ -18766,38 +18868,38 @@ function markVoiceMessageAsPlayed(action) {
|
|
|
18766
18868
|
params: updateParams
|
|
18767
18869
|
});
|
|
18768
18870
|
case 6:
|
|
18769
|
-
|
|
18871
|
+
_context1.n = 4;
|
|
18770
18872
|
break;
|
|
18771
18873
|
case 7:
|
|
18772
|
-
|
|
18874
|
+
_context1.n = 9;
|
|
18773
18875
|
break;
|
|
18774
18876
|
case 8:
|
|
18775
|
-
|
|
18776
|
-
_t10 =
|
|
18877
|
+
_context1.p = 8;
|
|
18878
|
+
_t10 = _context1.v;
|
|
18777
18879
|
log.error(_t10, 'Error on mark voice messages read');
|
|
18778
18880
|
case 9:
|
|
18779
|
-
return
|
|
18881
|
+
return _context1.a(2);
|
|
18780
18882
|
}
|
|
18781
18883
|
}, _marked0, null, [[1, 8]]);
|
|
18782
18884
|
}
|
|
18783
18885
|
function updateMessageAsOpened(action) {
|
|
18784
18886
|
var payload, channelId, messageListMarker, connectionStatus, channel, _iterator7, _step7, messageId, updateParams;
|
|
18785
|
-
return _regenerator().w(function (
|
|
18786
|
-
while (1) switch (
|
|
18887
|
+
return _regenerator().w(function (_context10) {
|
|
18888
|
+
while (1) switch (_context10.n) {
|
|
18787
18889
|
case 0:
|
|
18788
18890
|
payload = action.payload;
|
|
18789
18891
|
channelId = payload.channelId, messageListMarker = payload.messageListMarker;
|
|
18790
18892
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
18791
18893
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
18792
|
-
|
|
18894
|
+
_context10.n = 1;
|
|
18793
18895
|
break;
|
|
18794
18896
|
}
|
|
18795
|
-
return
|
|
18897
|
+
return _context10.a(2);
|
|
18796
18898
|
case 1:
|
|
18797
|
-
|
|
18899
|
+
_context10.n = 2;
|
|
18798
18900
|
return effects.call(getChannelFromMap, channelId);
|
|
18799
18901
|
case 2:
|
|
18800
|
-
channel =
|
|
18902
|
+
channel = _context10.v;
|
|
18801
18903
|
if (!channel) {
|
|
18802
18904
|
channel = getChannelFromAllChannels(channelId);
|
|
18803
18905
|
if (channel) {
|
|
@@ -18805,13 +18907,13 @@ function updateMessageAsOpened(action) {
|
|
|
18805
18907
|
}
|
|
18806
18908
|
}
|
|
18807
18909
|
if (!channel) {
|
|
18808
|
-
|
|
18910
|
+
_context10.n = 6;
|
|
18809
18911
|
break;
|
|
18810
18912
|
}
|
|
18811
18913
|
_iterator7 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
18812
18914
|
case 3:
|
|
18813
18915
|
if ((_step7 = _iterator7()).done) {
|
|
18814
|
-
|
|
18916
|
+
_context10.n = 6;
|
|
18815
18917
|
break;
|
|
18816
18918
|
}
|
|
18817
18919
|
messageId = _step7.value;
|
|
@@ -18824,7 +18926,7 @@ function updateMessageAsOpened(action) {
|
|
|
18824
18926
|
name: MESSAGE_DELIVERY_STATUS.OPENED
|
|
18825
18927
|
}]
|
|
18826
18928
|
};
|
|
18827
|
-
|
|
18929
|
+
_context10.n = 4;
|
|
18828
18930
|
return effects.put(updateMessageAC(messageId, updateParams));
|
|
18829
18931
|
case 4:
|
|
18830
18932
|
updateMessageOnMap(channel.id, {
|
|
@@ -18832,32 +18934,32 @@ function updateMessageAsOpened(action) {
|
|
|
18832
18934
|
params: updateParams
|
|
18833
18935
|
});
|
|
18834
18936
|
case 5:
|
|
18835
|
-
|
|
18937
|
+
_context10.n = 3;
|
|
18836
18938
|
break;
|
|
18837
18939
|
case 6:
|
|
18838
|
-
return
|
|
18940
|
+
return _context10.a(2);
|
|
18839
18941
|
}
|
|
18840
18942
|
}, _marked1);
|
|
18841
18943
|
}
|
|
18842
18944
|
function markMessageAsOpened(action) {
|
|
18843
18945
|
var payload, channelId, messageIds, shouldUpdateMessage, connectionStatus, channel, messageListMarker, _t11;
|
|
18844
|
-
return _regenerator().w(function (
|
|
18845
|
-
while (1) switch (
|
|
18946
|
+
return _regenerator().w(function (_context11) {
|
|
18947
|
+
while (1) switch (_context11.p = _context11.n) {
|
|
18846
18948
|
case 0:
|
|
18847
18949
|
payload = action.payload;
|
|
18848
18950
|
channelId = payload.channelId, messageIds = payload.messageIds, shouldUpdateMessage = payload.shouldUpdateMessage;
|
|
18849
18951
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
18850
18952
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
18851
|
-
|
|
18953
|
+
_context11.n = 1;
|
|
18852
18954
|
break;
|
|
18853
18955
|
}
|
|
18854
|
-
return
|
|
18956
|
+
return _context11.a(2);
|
|
18855
18957
|
case 1:
|
|
18856
|
-
|
|
18857
|
-
|
|
18958
|
+
_context11.p = 1;
|
|
18959
|
+
_context11.n = 2;
|
|
18858
18960
|
return effects.call(getChannelFromMap, channelId);
|
|
18859
18961
|
case 2:
|
|
18860
|
-
channel =
|
|
18962
|
+
channel = _context11.v;
|
|
18861
18963
|
if (!channel) {
|
|
18862
18964
|
channel = getChannelFromAllChannels(channelId);
|
|
18863
18965
|
if (channel) {
|
|
@@ -18865,50 +18967,50 @@ function markMessageAsOpened(action) {
|
|
|
18865
18967
|
}
|
|
18866
18968
|
}
|
|
18867
18969
|
if (!channel) {
|
|
18868
|
-
|
|
18970
|
+
_context11.n = 4;
|
|
18869
18971
|
break;
|
|
18870
18972
|
}
|
|
18871
|
-
|
|
18973
|
+
_context11.n = 3;
|
|
18872
18974
|
return effects.call(channel.markMessagesAsOpened, messageIds);
|
|
18873
18975
|
case 3:
|
|
18874
|
-
messageListMarker =
|
|
18976
|
+
messageListMarker = _context11.v;
|
|
18875
18977
|
if (!shouldUpdateMessage) {
|
|
18876
|
-
|
|
18978
|
+
_context11.n = 4;
|
|
18877
18979
|
break;
|
|
18878
18980
|
}
|
|
18879
|
-
|
|
18981
|
+
_context11.n = 4;
|
|
18880
18982
|
return effects.put(updateMessageAsOpenedAC(channelId, messageListMarker));
|
|
18881
18983
|
case 4:
|
|
18882
|
-
|
|
18984
|
+
_context11.n = 6;
|
|
18883
18985
|
break;
|
|
18884
18986
|
case 5:
|
|
18885
|
-
|
|
18886
|
-
_t11 =
|
|
18987
|
+
_context11.p = 5;
|
|
18988
|
+
_t11 = _context11.v;
|
|
18887
18989
|
log.error(_t11, 'Error on mark message as opened');
|
|
18888
18990
|
case 6:
|
|
18889
|
-
return
|
|
18991
|
+
return _context11.a(2);
|
|
18890
18992
|
}
|
|
18891
18993
|
}, _marked10, null, [[1, 5]]);
|
|
18892
18994
|
}
|
|
18893
18995
|
function markMessagesDelivered(action) {
|
|
18894
18996
|
var payload, channelId, messageIds, connectionStatus, channel, messageListMarker, _iterator8, _step8, messageId, updateParams, _t12;
|
|
18895
|
-
return _regenerator().w(function (
|
|
18896
|
-
while (1) switch (
|
|
18997
|
+
return _regenerator().w(function (_context12) {
|
|
18998
|
+
while (1) switch (_context12.p = _context12.n) {
|
|
18897
18999
|
case 0:
|
|
18898
19000
|
payload = action.payload;
|
|
18899
19001
|
channelId = payload.channelId, messageIds = payload.messageIds;
|
|
18900
19002
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
18901
19003
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
18902
|
-
|
|
19004
|
+
_context12.n = 1;
|
|
18903
19005
|
break;
|
|
18904
19006
|
}
|
|
18905
|
-
return
|
|
19007
|
+
return _context12.a(2);
|
|
18906
19008
|
case 1:
|
|
18907
|
-
|
|
18908
|
-
|
|
19009
|
+
_context12.p = 1;
|
|
19010
|
+
_context12.n = 2;
|
|
18909
19011
|
return effects.call(getChannelFromMap, channelId);
|
|
18910
19012
|
case 2:
|
|
18911
|
-
channel =
|
|
19013
|
+
channel = _context12.v;
|
|
18912
19014
|
if (!channel) {
|
|
18913
19015
|
channel = getChannelFromAllChannels(channelId);
|
|
18914
19016
|
if (channel) {
|
|
@@ -18916,17 +19018,17 @@ function markMessagesDelivered(action) {
|
|
|
18916
19018
|
}
|
|
18917
19019
|
}
|
|
18918
19020
|
if (!channel) {
|
|
18919
|
-
|
|
19021
|
+
_context12.n = 7;
|
|
18920
19022
|
break;
|
|
18921
19023
|
}
|
|
18922
|
-
|
|
19024
|
+
_context12.n = 3;
|
|
18923
19025
|
return effects.call(channel.markMessagesAsReceived, messageIds);
|
|
18924
19026
|
case 3:
|
|
18925
|
-
messageListMarker =
|
|
19027
|
+
messageListMarker = _context12.v;
|
|
18926
19028
|
_iterator8 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
18927
19029
|
case 4:
|
|
18928
19030
|
if ((_step8 = _iterator8()).done) {
|
|
18929
|
-
|
|
19031
|
+
_context12.n = 7;
|
|
18930
19032
|
break;
|
|
18931
19033
|
}
|
|
18932
19034
|
messageId = _step8.value;
|
|
@@ -18939,7 +19041,7 @@ function markMessagesDelivered(action) {
|
|
|
18939
19041
|
name: MESSAGE_DELIVERY_STATUS.DELIVERED
|
|
18940
19042
|
}]
|
|
18941
19043
|
};
|
|
18942
|
-
|
|
19044
|
+
_context12.n = 5;
|
|
18943
19045
|
return effects.put(updateMessageAC(messageId, updateParams));
|
|
18944
19046
|
case 5:
|
|
18945
19047
|
updateMessageOnMap(channel.id, {
|
|
@@ -18947,203 +19049,203 @@ function markMessagesDelivered(action) {
|
|
|
18947
19049
|
params: updateParams
|
|
18948
19050
|
});
|
|
18949
19051
|
case 6:
|
|
18950
|
-
|
|
19052
|
+
_context12.n = 4;
|
|
18951
19053
|
break;
|
|
18952
19054
|
case 7:
|
|
18953
|
-
|
|
19055
|
+
_context12.n = 9;
|
|
18954
19056
|
break;
|
|
18955
19057
|
case 8:
|
|
18956
|
-
|
|
18957
|
-
_t12 =
|
|
19058
|
+
_context12.p = 8;
|
|
19059
|
+
_t12 = _context12.v;
|
|
18958
19060
|
log.error(_t12, 'Error on mark messages delivered');
|
|
18959
19061
|
case 9:
|
|
18960
|
-
return
|
|
19062
|
+
return _context12.a(2);
|
|
18961
19063
|
}
|
|
18962
19064
|
}, _marked11, null, [[1, 8]]);
|
|
18963
19065
|
}
|
|
18964
19066
|
function switchChannel(action) {
|
|
18965
19067
|
var payload, channel, updateActiveChannel, channelToSwitch, existingChannel, addChannel, _SceytChatClient5, fetchedChannel, channelFromMap, currentActiveChannel, _t13;
|
|
18966
|
-
return _regenerator().w(function (
|
|
18967
|
-
while (1) switch (
|
|
19068
|
+
return _regenerator().w(function (_context13) {
|
|
19069
|
+
while (1) switch (_context13.p = _context13.n) {
|
|
18968
19070
|
case 0:
|
|
18969
|
-
|
|
19071
|
+
_context13.p = 0;
|
|
18970
19072
|
payload = action.payload;
|
|
18971
19073
|
channel = payload.channel, updateActiveChannel = payload.updateActiveChannel;
|
|
18972
19074
|
channelToSwitch = channel;
|
|
18973
19075
|
if (!(!(channel !== null && channel !== void 0 && channel.id) && updateActiveChannel)) {
|
|
18974
|
-
|
|
19076
|
+
_context13.n = 3;
|
|
18975
19077
|
break;
|
|
18976
19078
|
}
|
|
18977
|
-
|
|
19079
|
+
_context13.n = 1;
|
|
18978
19080
|
return effects.call(setActiveChannelId, '');
|
|
18979
19081
|
case 1:
|
|
18980
|
-
|
|
19082
|
+
_context13.n = 2;
|
|
18981
19083
|
return effects.put(setActiveChannelAC({}));
|
|
18982
19084
|
case 2:
|
|
18983
|
-
return
|
|
19085
|
+
return _context13.a(2);
|
|
18984
19086
|
case 3:
|
|
18985
19087
|
existingChannel = checkChannelExists(channel.id);
|
|
18986
19088
|
if (existingChannel) {
|
|
18987
|
-
|
|
19089
|
+
_context13.n = 9;
|
|
18988
19090
|
break;
|
|
18989
19091
|
}
|
|
18990
19092
|
addChannel = getChannelFromAllChannels(channel.id);
|
|
18991
19093
|
if (!addChannel) {
|
|
18992
|
-
|
|
19094
|
+
_context13.n = 5;
|
|
18993
19095
|
break;
|
|
18994
19096
|
}
|
|
18995
19097
|
setChannelInMap(addChannel);
|
|
18996
|
-
|
|
19098
|
+
_context13.n = 4;
|
|
18997
19099
|
return effects.put(addChannelAC(JSON.parse(JSON.stringify(addChannel))));
|
|
18998
19100
|
case 4:
|
|
18999
19101
|
channelToSwitch = _extends({}, channelToSwitch, addChannel);
|
|
19000
|
-
|
|
19102
|
+
_context13.n = 8;
|
|
19001
19103
|
break;
|
|
19002
19104
|
case 5:
|
|
19003
19105
|
_SceytChatClient5 = getClient();
|
|
19004
|
-
|
|
19106
|
+
_context13.n = 6;
|
|
19005
19107
|
return effects.call(_SceytChatClient5.getChannel, channel.id);
|
|
19006
19108
|
case 6:
|
|
19007
|
-
fetchedChannel =
|
|
19109
|
+
fetchedChannel = _context13.v;
|
|
19008
19110
|
addChannelToAllChannels(fetchedChannel);
|
|
19009
19111
|
setChannelInMap(fetchedChannel);
|
|
19010
|
-
|
|
19112
|
+
_context13.n = 7;
|
|
19011
19113
|
return effects.put(addChannelAC(JSON.parse(JSON.stringify(fetchedChannel))));
|
|
19012
19114
|
case 7:
|
|
19013
19115
|
channelToSwitch = _extends({}, channelToSwitch, fetchedChannel);
|
|
19014
19116
|
case 8:
|
|
19015
|
-
|
|
19117
|
+
_context13.n = 10;
|
|
19016
19118
|
break;
|
|
19017
19119
|
case 9:
|
|
19018
19120
|
channelFromMap = getChannelFromMap(channel.id);
|
|
19019
19121
|
channelToSwitch = _extends({}, channelToSwitch, channelFromMap);
|
|
19020
19122
|
case 10:
|
|
19021
19123
|
if (!updateActiveChannel) {
|
|
19022
|
-
|
|
19124
|
+
_context13.n = 14;
|
|
19023
19125
|
break;
|
|
19024
19126
|
}
|
|
19025
19127
|
currentActiveChannel = getChannelFromMap(getActiveChannelId());
|
|
19026
|
-
|
|
19128
|
+
_context13.n = 11;
|
|
19027
19129
|
return effects.put(setUnreadScrollToAC(true));
|
|
19028
19130
|
case 11:
|
|
19029
19131
|
removeAllMessages();
|
|
19030
|
-
|
|
19132
|
+
_context13.n = 12;
|
|
19031
19133
|
return effects.put(setMessagesHasPrevAC(true));
|
|
19032
19134
|
case 12:
|
|
19033
|
-
|
|
19135
|
+
_context13.n = 13;
|
|
19034
19136
|
return effects.call(setActiveChannelId, channel && channel.id);
|
|
19035
19137
|
case 13:
|
|
19036
19138
|
if (channel.isLinkedChannel) {
|
|
19037
19139
|
channelToSwitch.linkedFrom = currentActiveChannel;
|
|
19038
19140
|
}
|
|
19039
|
-
|
|
19141
|
+
_context13.n = 14;
|
|
19040
19142
|
return effects.put(setActiveChannelAC(_extends({}, channelToSwitch)));
|
|
19041
19143
|
case 14:
|
|
19042
|
-
|
|
19144
|
+
_context13.n = 16;
|
|
19043
19145
|
break;
|
|
19044
19146
|
case 15:
|
|
19045
|
-
|
|
19046
|
-
_t13 =
|
|
19147
|
+
_context13.p = 15;
|
|
19148
|
+
_t13 = _context13.v;
|
|
19047
19149
|
log.error('error in switch channel', _t13);
|
|
19048
19150
|
case 16:
|
|
19049
|
-
return
|
|
19151
|
+
return _context13.a(2);
|
|
19050
19152
|
}
|
|
19051
19153
|
}, _marked12, null, [[0, 15]]);
|
|
19052
19154
|
}
|
|
19053
19155
|
function notificationsTurnOff(action) {
|
|
19054
19156
|
var expireTime, activeChannelId, channel, updatedChannel, _t14;
|
|
19055
|
-
return _regenerator().w(function (
|
|
19056
|
-
while (1) switch (
|
|
19157
|
+
return _regenerator().w(function (_context14) {
|
|
19158
|
+
while (1) switch (_context14.p = _context14.n) {
|
|
19057
19159
|
case 0:
|
|
19058
19160
|
expireTime = action.payload.expireTime;
|
|
19059
|
-
|
|
19161
|
+
_context14.n = 1;
|
|
19060
19162
|
return effects.call(getActiveChannelId);
|
|
19061
19163
|
case 1:
|
|
19062
|
-
activeChannelId =
|
|
19063
|
-
|
|
19164
|
+
activeChannelId = _context14.v;
|
|
19165
|
+
_context14.n = 2;
|
|
19064
19166
|
return effects.call(getChannelFromMap, activeChannelId);
|
|
19065
19167
|
case 2:
|
|
19066
|
-
channel =
|
|
19067
|
-
|
|
19068
|
-
|
|
19168
|
+
channel = _context14.v;
|
|
19169
|
+
_context14.p = 3;
|
|
19170
|
+
_context14.n = 4;
|
|
19069
19171
|
return effects.call(channel.mute, expireTime);
|
|
19070
19172
|
case 4:
|
|
19071
|
-
updatedChannel =
|
|
19173
|
+
updatedChannel = _context14.v;
|
|
19072
19174
|
updateChannelOnAllChannels(channel.id, {
|
|
19073
19175
|
muted: updatedChannel.muted,
|
|
19074
19176
|
mutedTill: updatedChannel.mutedTill
|
|
19075
19177
|
});
|
|
19076
|
-
|
|
19178
|
+
_context14.n = 5;
|
|
19077
19179
|
return effects.put(updateChannelDataAC(updatedChannel.id, {
|
|
19078
19180
|
muted: updatedChannel.muted,
|
|
19079
19181
|
mutedTill: updatedChannel.mutedTill
|
|
19080
19182
|
}));
|
|
19081
19183
|
case 5:
|
|
19082
|
-
|
|
19184
|
+
_context14.n = 7;
|
|
19083
19185
|
break;
|
|
19084
19186
|
case 6:
|
|
19085
|
-
|
|
19086
|
-
_t14 =
|
|
19187
|
+
_context14.p = 6;
|
|
19188
|
+
_t14 = _context14.v;
|
|
19087
19189
|
log.error('ERROR turn off notifications', _t14.message);
|
|
19088
19190
|
case 7:
|
|
19089
|
-
return
|
|
19191
|
+
return _context14.a(2);
|
|
19090
19192
|
}
|
|
19091
19193
|
}, _marked13, null, [[3, 6]]);
|
|
19092
19194
|
}
|
|
19093
19195
|
function notificationsTurnOn() {
|
|
19094
19196
|
var activeChannelId, channel, updatedChannel, _t15;
|
|
19095
|
-
return _regenerator().w(function (
|
|
19096
|
-
while (1) switch (
|
|
19197
|
+
return _regenerator().w(function (_context15) {
|
|
19198
|
+
while (1) switch (_context15.p = _context15.n) {
|
|
19097
19199
|
case 0:
|
|
19098
|
-
|
|
19200
|
+
_context15.n = 1;
|
|
19099
19201
|
return effects.call(getActiveChannelId);
|
|
19100
19202
|
case 1:
|
|
19101
|
-
activeChannelId =
|
|
19102
|
-
|
|
19203
|
+
activeChannelId = _context15.v;
|
|
19204
|
+
_context15.n = 2;
|
|
19103
19205
|
return effects.call(getChannelFromMap, activeChannelId);
|
|
19104
19206
|
case 2:
|
|
19105
|
-
channel =
|
|
19106
|
-
|
|
19107
|
-
|
|
19207
|
+
channel = _context15.v;
|
|
19208
|
+
_context15.p = 3;
|
|
19209
|
+
_context15.n = 4;
|
|
19108
19210
|
return effects.call(channel.unmute);
|
|
19109
19211
|
case 4:
|
|
19110
|
-
updatedChannel =
|
|
19212
|
+
updatedChannel = _context15.v;
|
|
19111
19213
|
updateChannelOnAllChannels(channel.id, {
|
|
19112
19214
|
muted: updatedChannel.muted,
|
|
19113
19215
|
mutedTill: updatedChannel.mutedTill
|
|
19114
19216
|
});
|
|
19115
|
-
|
|
19217
|
+
_context15.n = 5;
|
|
19116
19218
|
return effects.put(updateChannelDataAC(updatedChannel.id, {
|
|
19117
19219
|
muted: updatedChannel.muted,
|
|
19118
19220
|
mutedTill: updatedChannel.mutedTill
|
|
19119
19221
|
}));
|
|
19120
19222
|
case 5:
|
|
19121
|
-
|
|
19223
|
+
_context15.n = 7;
|
|
19122
19224
|
break;
|
|
19123
19225
|
case 6:
|
|
19124
|
-
|
|
19125
|
-
_t15 =
|
|
19226
|
+
_context15.p = 6;
|
|
19227
|
+
_t15 = _context15.v;
|
|
19126
19228
|
log.error('ERROR turn on notifications: ', _t15.message);
|
|
19127
19229
|
case 7:
|
|
19128
|
-
return
|
|
19230
|
+
return _context15.a(2);
|
|
19129
19231
|
}
|
|
19130
19232
|
}, _marked14, null, [[3, 6]]);
|
|
19131
19233
|
}
|
|
19132
19234
|
function markChannelAsRead(action) {
|
|
19133
19235
|
var channelId, channel, updateData, _t16;
|
|
19134
|
-
return _regenerator().w(function (
|
|
19135
|
-
while (1) switch (
|
|
19236
|
+
return _regenerator().w(function (_context16) {
|
|
19237
|
+
while (1) switch (_context16.p = _context16.n) {
|
|
19136
19238
|
case 0:
|
|
19137
|
-
|
|
19239
|
+
_context16.p = 0;
|
|
19138
19240
|
channelId = action.payload.channelId;
|
|
19139
|
-
|
|
19241
|
+
_context16.n = 1;
|
|
19140
19242
|
return effects.call(getChannelFromMap, channelId);
|
|
19141
19243
|
case 1:
|
|
19142
|
-
channel =
|
|
19244
|
+
channel = _context16.v;
|
|
19143
19245
|
if (!channel) {
|
|
19144
19246
|
channel = getChannelFromAllChannels(channelId);
|
|
19145
19247
|
}
|
|
19146
|
-
|
|
19248
|
+
_context16.n = 2;
|
|
19147
19249
|
return effects.call(channel.markAsRead);
|
|
19148
19250
|
case 2:
|
|
19149
19251
|
updateData = {
|
|
@@ -19152,374 +19254,374 @@ function markChannelAsRead(action) {
|
|
|
19152
19254
|
newMentionCount: 0
|
|
19153
19255
|
};
|
|
19154
19256
|
updateChannelOnAllChannels(channel.id, updateData);
|
|
19155
|
-
|
|
19257
|
+
_context16.n = 3;
|
|
19156
19258
|
return effects.put(updateChannelDataAC(channel.id, updateData));
|
|
19157
19259
|
case 3:
|
|
19158
|
-
|
|
19260
|
+
_context16.n = 5;
|
|
19159
19261
|
break;
|
|
19160
19262
|
case 4:
|
|
19161
|
-
|
|
19162
|
-
_t16 =
|
|
19263
|
+
_context16.p = 4;
|
|
19264
|
+
_t16 = _context16.v;
|
|
19163
19265
|
log.error(_t16, 'Error in set channel unread');
|
|
19164
19266
|
case 5:
|
|
19165
|
-
return
|
|
19267
|
+
return _context16.a(2);
|
|
19166
19268
|
}
|
|
19167
19269
|
}, _marked15, null, [[0, 4]]);
|
|
19168
19270
|
}
|
|
19169
19271
|
function markChannelAsUnRead(action) {
|
|
19170
19272
|
var channelId, channel, _t17;
|
|
19171
|
-
return _regenerator().w(function (
|
|
19172
|
-
while (1) switch (
|
|
19273
|
+
return _regenerator().w(function (_context17) {
|
|
19274
|
+
while (1) switch (_context17.p = _context17.n) {
|
|
19173
19275
|
case 0:
|
|
19174
|
-
|
|
19276
|
+
_context17.p = 0;
|
|
19175
19277
|
channelId = action.payload.channelId;
|
|
19176
|
-
|
|
19278
|
+
_context17.n = 1;
|
|
19177
19279
|
return effects.call(getChannelFromMap, channelId);
|
|
19178
19280
|
case 1:
|
|
19179
|
-
channel =
|
|
19281
|
+
channel = _context17.v;
|
|
19180
19282
|
if (!channel) {
|
|
19181
19283
|
channel = getChannelFromAllChannels(channelId);
|
|
19182
19284
|
}
|
|
19183
|
-
|
|
19285
|
+
_context17.n = 2;
|
|
19184
19286
|
return effects.call(channel.markAsUnRead);
|
|
19185
19287
|
case 2:
|
|
19186
19288
|
updateChannelOnAllChannels(channel.id, {
|
|
19187
19289
|
unread: true
|
|
19188
19290
|
});
|
|
19189
|
-
|
|
19291
|
+
_context17.n = 3;
|
|
19190
19292
|
return effects.put(updateChannelDataAC(channel.id, {
|
|
19191
19293
|
unread: true
|
|
19192
19294
|
}));
|
|
19193
19295
|
case 3:
|
|
19194
|
-
|
|
19296
|
+
_context17.n = 5;
|
|
19195
19297
|
break;
|
|
19196
19298
|
case 4:
|
|
19197
|
-
|
|
19198
|
-
_t17 =
|
|
19299
|
+
_context17.p = 4;
|
|
19300
|
+
_t17 = _context17.v;
|
|
19199
19301
|
log.error(_t17, 'Error in set channel unread');
|
|
19200
19302
|
case 5:
|
|
19201
|
-
return
|
|
19303
|
+
return _context17.a(2);
|
|
19202
19304
|
}
|
|
19203
19305
|
}, _marked16, null, [[0, 4]]);
|
|
19204
19306
|
}
|
|
19205
19307
|
function pinChannel(action) {
|
|
19206
19308
|
var channelId, channel, updatedChannel, _t18;
|
|
19207
|
-
return _regenerator().w(function (
|
|
19208
|
-
while (1) switch (
|
|
19309
|
+
return _regenerator().w(function (_context18) {
|
|
19310
|
+
while (1) switch (_context18.p = _context18.n) {
|
|
19209
19311
|
case 0:
|
|
19210
|
-
|
|
19312
|
+
_context18.p = 0;
|
|
19211
19313
|
channelId = action.payload.channelId;
|
|
19212
|
-
|
|
19314
|
+
_context18.n = 1;
|
|
19213
19315
|
return effects.call(getChannelFromMap, channelId);
|
|
19214
19316
|
case 1:
|
|
19215
|
-
channel =
|
|
19317
|
+
channel = _context18.v;
|
|
19216
19318
|
if (!channel) {
|
|
19217
19319
|
channel = getChannelFromAllChannels(channelId);
|
|
19218
19320
|
}
|
|
19219
|
-
|
|
19321
|
+
_context18.n = 2;
|
|
19220
19322
|
return effects.call(channel.pin);
|
|
19221
19323
|
case 2:
|
|
19222
|
-
updatedChannel =
|
|
19324
|
+
updatedChannel = _context18.v;
|
|
19223
19325
|
updateChannelOnAllChannels(channel.id, {
|
|
19224
19326
|
pinnedAt: updatedChannel.pinnedAt
|
|
19225
19327
|
});
|
|
19226
|
-
|
|
19328
|
+
_context18.n = 3;
|
|
19227
19329
|
return effects.put(updateChannelDataAC(updatedChannel.id, {
|
|
19228
19330
|
pinnedAt: updatedChannel.pinnedAt
|
|
19229
19331
|
}, true));
|
|
19230
19332
|
case 3:
|
|
19231
|
-
|
|
19333
|
+
_context18.n = 5;
|
|
19232
19334
|
break;
|
|
19233
19335
|
case 4:
|
|
19234
|
-
|
|
19235
|
-
_t18 =
|
|
19336
|
+
_context18.p = 4;
|
|
19337
|
+
_t18 = _context18.v;
|
|
19236
19338
|
log.error(_t18, 'Error in pinChannel');
|
|
19237
19339
|
case 5:
|
|
19238
|
-
return
|
|
19340
|
+
return _context18.a(2);
|
|
19239
19341
|
}
|
|
19240
19342
|
}, _marked17, null, [[0, 4]]);
|
|
19241
19343
|
}
|
|
19242
19344
|
function unpinChannel(action) {
|
|
19243
19345
|
var channelId, channel, updatedChannel, _t19;
|
|
19244
|
-
return _regenerator().w(function (
|
|
19245
|
-
while (1) switch (
|
|
19346
|
+
return _regenerator().w(function (_context19) {
|
|
19347
|
+
while (1) switch (_context19.p = _context19.n) {
|
|
19246
19348
|
case 0:
|
|
19247
|
-
|
|
19349
|
+
_context19.p = 0;
|
|
19248
19350
|
channelId = action.payload.channelId;
|
|
19249
|
-
|
|
19351
|
+
_context19.n = 1;
|
|
19250
19352
|
return effects.call(getChannelFromMap, channelId);
|
|
19251
19353
|
case 1:
|
|
19252
|
-
channel =
|
|
19354
|
+
channel = _context19.v;
|
|
19253
19355
|
if (!channel) {
|
|
19254
19356
|
channel = getChannelFromAllChannels(channelId);
|
|
19255
19357
|
}
|
|
19256
|
-
|
|
19358
|
+
_context19.n = 2;
|
|
19257
19359
|
return effects.call(channel.unpin);
|
|
19258
19360
|
case 2:
|
|
19259
|
-
updatedChannel =
|
|
19361
|
+
updatedChannel = _context19.v;
|
|
19260
19362
|
updateChannelOnAllChannels(channel.id, {
|
|
19261
19363
|
pinnedAt: updatedChannel.pinnedAt
|
|
19262
19364
|
});
|
|
19263
|
-
|
|
19365
|
+
_context19.n = 3;
|
|
19264
19366
|
return effects.put(updateChannelDataAC(updatedChannel.id, {
|
|
19265
19367
|
pinnedAt: updatedChannel.pinnedAt
|
|
19266
19368
|
}, false, true));
|
|
19267
19369
|
case 3:
|
|
19268
|
-
|
|
19370
|
+
_context19.n = 5;
|
|
19269
19371
|
break;
|
|
19270
19372
|
case 4:
|
|
19271
|
-
|
|
19272
|
-
_t19 =
|
|
19373
|
+
_context19.p = 4;
|
|
19374
|
+
_t19 = _context19.v;
|
|
19273
19375
|
log.error(_t19, 'Error in unpinChannel');
|
|
19274
19376
|
case 5:
|
|
19275
|
-
return
|
|
19377
|
+
return _context19.a(2);
|
|
19276
19378
|
}
|
|
19277
19379
|
}, _marked18, null, [[0, 4]]);
|
|
19278
19380
|
}
|
|
19279
19381
|
function removeChannelCaches(action) {
|
|
19280
19382
|
var payload, channelId, activeChannelId, activeChannel;
|
|
19281
|
-
return _regenerator().w(function (
|
|
19282
|
-
while (1) switch (
|
|
19383
|
+
return _regenerator().w(function (_context20) {
|
|
19384
|
+
while (1) switch (_context20.n) {
|
|
19283
19385
|
case 0:
|
|
19284
19386
|
payload = action.payload;
|
|
19285
19387
|
channelId = payload.channelId;
|
|
19286
|
-
|
|
19388
|
+
_context20.n = 1;
|
|
19287
19389
|
return effects.call(getActiveChannelId);
|
|
19288
19390
|
case 1:
|
|
19289
|
-
activeChannelId =
|
|
19391
|
+
activeChannelId = _context20.v;
|
|
19290
19392
|
removeChannelFromMap(channelId);
|
|
19291
19393
|
removeMessagesFromMap(channelId);
|
|
19292
19394
|
if (!(activeChannelId === channelId)) {
|
|
19293
|
-
|
|
19395
|
+
_context20.n = 3;
|
|
19294
19396
|
break;
|
|
19295
19397
|
}
|
|
19296
|
-
|
|
19398
|
+
_context20.n = 2;
|
|
19297
19399
|
return effects.call(getLastChannelFromMap);
|
|
19298
19400
|
case 2:
|
|
19299
|
-
activeChannel =
|
|
19401
|
+
activeChannel = _context20.v;
|
|
19300
19402
|
if (!activeChannel) {
|
|
19301
|
-
|
|
19403
|
+
_context20.n = 3;
|
|
19302
19404
|
break;
|
|
19303
19405
|
}
|
|
19304
|
-
|
|
19406
|
+
_context20.n = 3;
|
|
19305
19407
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
19306
19408
|
case 3:
|
|
19307
|
-
return
|
|
19409
|
+
return _context20.a(2);
|
|
19308
19410
|
}
|
|
19309
19411
|
}, _marked19);
|
|
19310
19412
|
}
|
|
19311
19413
|
function leaveChannel(action) {
|
|
19312
19414
|
var payload, channelId, channel, messageBuilder, messageToSend, _t20;
|
|
19313
|
-
return _regenerator().w(function (
|
|
19314
|
-
while (1) switch (
|
|
19415
|
+
return _regenerator().w(function (_context21) {
|
|
19416
|
+
while (1) switch (_context21.p = _context21.n) {
|
|
19315
19417
|
case 0:
|
|
19316
|
-
|
|
19418
|
+
_context21.p = 0;
|
|
19317
19419
|
payload = action.payload;
|
|
19318
19420
|
channelId = payload.channelId;
|
|
19319
|
-
|
|
19421
|
+
_context21.n = 1;
|
|
19320
19422
|
return effects.call(getChannelFromMap, channelId);
|
|
19321
19423
|
case 1:
|
|
19322
|
-
channel =
|
|
19424
|
+
channel = _context21.v;
|
|
19323
19425
|
if (!channel) {
|
|
19324
19426
|
channel = getChannelFromAllChannels(channelId);
|
|
19325
19427
|
}
|
|
19326
19428
|
if (!channel) {
|
|
19327
|
-
|
|
19429
|
+
_context21.n = 5;
|
|
19328
19430
|
break;
|
|
19329
19431
|
}
|
|
19330
19432
|
if (!(channel.type === DEFAULT_CHANNEL_TYPE.GROUP || channel.type === DEFAULT_CHANNEL_TYPE.PRIVATE)) {
|
|
19331
|
-
|
|
19433
|
+
_context21.n = 2;
|
|
19332
19434
|
break;
|
|
19333
19435
|
}
|
|
19334
19436
|
messageBuilder = channel.createMessageBuilder();
|
|
19335
19437
|
messageBuilder.setBody('LG').setType('system').setDisplayCount(0).setSilent(true);
|
|
19336
19438
|
messageToSend = messageBuilder.create();
|
|
19337
19439
|
log.info('send message for left');
|
|
19338
|
-
|
|
19440
|
+
_context21.n = 2;
|
|
19339
19441
|
return effects.call(channel.sendMessage, messageToSend);
|
|
19340
19442
|
case 2:
|
|
19341
19443
|
log.info('leave');
|
|
19342
|
-
|
|
19444
|
+
_context21.n = 3;
|
|
19343
19445
|
return effects.call(channel.leave);
|
|
19344
19446
|
case 3:
|
|
19345
|
-
|
|
19447
|
+
_context21.n = 4;
|
|
19346
19448
|
return effects.put(removeChannelAC(channelId));
|
|
19347
19449
|
case 4:
|
|
19348
19450
|
deleteChannelFromAllChannels(channelId);
|
|
19349
|
-
|
|
19451
|
+
_context21.n = 5;
|
|
19350
19452
|
return effects.put(removeChannelCachesAC(channelId));
|
|
19351
19453
|
case 5:
|
|
19352
|
-
|
|
19454
|
+
_context21.n = 7;
|
|
19353
19455
|
break;
|
|
19354
19456
|
case 6:
|
|
19355
|
-
|
|
19356
|
-
_t20 =
|
|
19457
|
+
_context21.p = 6;
|
|
19458
|
+
_t20 = _context21.v;
|
|
19357
19459
|
log.error('ERROR in leave channel - ', _t20.message);
|
|
19358
19460
|
case 7:
|
|
19359
|
-
return
|
|
19461
|
+
return _context21.a(2);
|
|
19360
19462
|
}
|
|
19361
19463
|
}, _marked20, null, [[0, 6]]);
|
|
19362
19464
|
}
|
|
19363
19465
|
function deletePendingDeleteChannels() {
|
|
19364
19466
|
var pendingDeleteChannels, _iterator9, _step9, channel, resendableError, _t21;
|
|
19365
|
-
return _regenerator().w(function (
|
|
19366
|
-
while (1) switch (
|
|
19467
|
+
return _regenerator().w(function (_context22) {
|
|
19468
|
+
while (1) switch (_context22.p = _context22.n) {
|
|
19367
19469
|
case 0:
|
|
19368
19470
|
pendingDeleteChannels = getPendingDeleteChannels();
|
|
19369
19471
|
_iterator9 = _createForOfIteratorHelperLoose(pendingDeleteChannels);
|
|
19370
19472
|
case 1:
|
|
19371
19473
|
if ((_step9 = _iterator9()).done) {
|
|
19372
|
-
|
|
19474
|
+
_context22.n = 9;
|
|
19373
19475
|
break;
|
|
19374
19476
|
}
|
|
19375
19477
|
channel = _step9.value;
|
|
19376
|
-
|
|
19377
|
-
|
|
19478
|
+
_context22.p = 2;
|
|
19479
|
+
_context22.n = 3;
|
|
19378
19480
|
return effects.call(channel["delete"]);
|
|
19379
19481
|
case 3:
|
|
19380
|
-
|
|
19482
|
+
_context22.n = 4;
|
|
19381
19483
|
return effects.put(setChannelToRemoveAC(channel));
|
|
19382
19484
|
case 4:
|
|
19383
|
-
|
|
19485
|
+
_context22.n = 5;
|
|
19384
19486
|
return effects.put(removeChannelAC(channel.id));
|
|
19385
19487
|
case 5:
|
|
19386
|
-
|
|
19488
|
+
_context22.n = 6;
|
|
19387
19489
|
return effects.put(removeChannelCachesAC(channel.id));
|
|
19388
19490
|
case 6:
|
|
19389
19491
|
removePendingDeleteChannel(channel.id);
|
|
19390
|
-
|
|
19492
|
+
_context22.n = 8;
|
|
19391
19493
|
break;
|
|
19392
19494
|
case 7:
|
|
19393
|
-
|
|
19394
|
-
_t21 =
|
|
19495
|
+
_context22.p = 7;
|
|
19496
|
+
_t21 = _context22.v;
|
|
19395
19497
|
resendableError = isResendableError(_t21 === null || _t21 === void 0 ? void 0 : _t21.type);
|
|
19396
19498
|
if (!resendableError) {
|
|
19397
19499
|
removePendingDeleteChannel(channel.id);
|
|
19398
19500
|
}
|
|
19399
19501
|
case 8:
|
|
19400
|
-
|
|
19502
|
+
_context22.n = 1;
|
|
19401
19503
|
break;
|
|
19402
19504
|
case 9:
|
|
19403
|
-
return
|
|
19505
|
+
return _context22.a(2);
|
|
19404
19506
|
}
|
|
19405
19507
|
}, _marked21, null, [[2, 7]]);
|
|
19406
19508
|
}
|
|
19407
19509
|
function deleteChannel(action) {
|
|
19408
19510
|
var payload, channelId, channel, activeChannelId, lastChannel, _t22;
|
|
19409
|
-
return _regenerator().w(function (
|
|
19410
|
-
while (1) switch (
|
|
19511
|
+
return _regenerator().w(function (_context23) {
|
|
19512
|
+
while (1) switch (_context23.p = _context23.n) {
|
|
19411
19513
|
case 0:
|
|
19412
|
-
|
|
19514
|
+
_context23.p = 0;
|
|
19413
19515
|
payload = action.payload;
|
|
19414
19516
|
channelId = payload.channelId;
|
|
19415
|
-
|
|
19517
|
+
_context23.n = 1;
|
|
19416
19518
|
return effects.call(getChannelFromMap, channelId);
|
|
19417
19519
|
case 1:
|
|
19418
|
-
channel =
|
|
19520
|
+
channel = _context23.v;
|
|
19419
19521
|
if (!channel) {
|
|
19420
19522
|
channel = getChannelFromAllChannels(channelId);
|
|
19421
19523
|
}
|
|
19422
19524
|
if (!(store.getState().UserReducer.connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
19423
|
-
|
|
19525
|
+
_context23.n = 5;
|
|
19424
19526
|
break;
|
|
19425
19527
|
}
|
|
19426
19528
|
setPendingDeleteChannel(channel);
|
|
19427
|
-
|
|
19529
|
+
_context23.n = 2;
|
|
19428
19530
|
return effects.call(getActiveChannelId);
|
|
19429
19531
|
case 2:
|
|
19430
|
-
activeChannelId =
|
|
19532
|
+
activeChannelId = _context23.v;
|
|
19431
19533
|
if (!(activeChannelId === channelId)) {
|
|
19432
|
-
|
|
19534
|
+
_context23.n = 4;
|
|
19433
19535
|
break;
|
|
19434
19536
|
}
|
|
19435
|
-
|
|
19537
|
+
_context23.n = 3;
|
|
19436
19538
|
return effects.call(getLastChannelFromMap, true);
|
|
19437
19539
|
case 3:
|
|
19438
|
-
lastChannel =
|
|
19439
|
-
|
|
19540
|
+
lastChannel = _context23.v;
|
|
19541
|
+
_context23.n = 4;
|
|
19440
19542
|
return effects.put(switchChannelActionAC(lastChannel || null));
|
|
19441
19543
|
case 4:
|
|
19442
|
-
return
|
|
19544
|
+
return _context23.a(2);
|
|
19443
19545
|
case 5:
|
|
19444
19546
|
if (!channel) {
|
|
19445
|
-
|
|
19547
|
+
_context23.n = 9;
|
|
19446
19548
|
break;
|
|
19447
19549
|
}
|
|
19448
|
-
|
|
19550
|
+
_context23.n = 6;
|
|
19449
19551
|
return effects.call(channel["delete"]);
|
|
19450
19552
|
case 6:
|
|
19451
|
-
|
|
19553
|
+
_context23.n = 7;
|
|
19452
19554
|
return effects.put(setChannelToRemoveAC(channel));
|
|
19453
19555
|
case 7:
|
|
19454
|
-
|
|
19556
|
+
_context23.n = 8;
|
|
19455
19557
|
return effects.put(removeChannelAC(channelId));
|
|
19456
19558
|
case 8:
|
|
19457
|
-
|
|
19559
|
+
_context23.n = 9;
|
|
19458
19560
|
return effects.put(removeChannelCachesAC(channelId));
|
|
19459
19561
|
case 9:
|
|
19460
|
-
|
|
19562
|
+
_context23.n = 11;
|
|
19461
19563
|
break;
|
|
19462
19564
|
case 10:
|
|
19463
|
-
|
|
19464
|
-
_t22 =
|
|
19565
|
+
_context23.p = 10;
|
|
19566
|
+
_t22 = _context23.v;
|
|
19465
19567
|
log.error('ERROR in delete channel', _t22);
|
|
19466
19568
|
case 11:
|
|
19467
|
-
return
|
|
19569
|
+
return _context23.a(2);
|
|
19468
19570
|
}
|
|
19469
19571
|
}, _marked22, null, [[0, 10]]);
|
|
19470
19572
|
}
|
|
19471
19573
|
function blockChannel(action) {
|
|
19472
19574
|
var payload, channelId, channel, _t23;
|
|
19473
|
-
return _regenerator().w(function (
|
|
19474
|
-
while (1) switch (
|
|
19575
|
+
return _regenerator().w(function (_context24) {
|
|
19576
|
+
while (1) switch (_context24.p = _context24.n) {
|
|
19475
19577
|
case 0:
|
|
19476
|
-
|
|
19578
|
+
_context24.p = 0;
|
|
19477
19579
|
payload = action.payload;
|
|
19478
19580
|
channelId = payload.channelId;
|
|
19479
|
-
|
|
19581
|
+
_context24.n = 1;
|
|
19480
19582
|
return effects.call(getChannelFromMap, channelId);
|
|
19481
19583
|
case 1:
|
|
19482
|
-
channel =
|
|
19584
|
+
channel = _context24.v;
|
|
19483
19585
|
if (!channel) {
|
|
19484
19586
|
channel = getChannelFromAllChannels(channelId);
|
|
19485
19587
|
}
|
|
19486
19588
|
if (!channel) {
|
|
19487
|
-
|
|
19589
|
+
_context24.n = 4;
|
|
19488
19590
|
break;
|
|
19489
19591
|
}
|
|
19490
|
-
|
|
19592
|
+
_context24.n = 2;
|
|
19491
19593
|
return effects.call(channel.block);
|
|
19492
19594
|
case 2:
|
|
19493
|
-
|
|
19595
|
+
_context24.n = 3;
|
|
19494
19596
|
return effects.put(removeChannelAC(channelId));
|
|
19495
19597
|
case 3:
|
|
19496
|
-
|
|
19598
|
+
_context24.n = 4;
|
|
19497
19599
|
return effects.put(removeChannelCachesAC(channelId));
|
|
19498
19600
|
case 4:
|
|
19499
|
-
|
|
19601
|
+
_context24.n = 6;
|
|
19500
19602
|
break;
|
|
19501
19603
|
case 5:
|
|
19502
|
-
|
|
19503
|
-
_t23 =
|
|
19604
|
+
_context24.p = 5;
|
|
19605
|
+
_t23 = _context24.v;
|
|
19504
19606
|
log.error('ERROR in block channel - ', _t23.message);
|
|
19505
19607
|
case 6:
|
|
19506
|
-
return
|
|
19608
|
+
return _context24.a(2);
|
|
19507
19609
|
}
|
|
19508
19610
|
}, _marked23, null, [[0, 5]]);
|
|
19509
19611
|
}
|
|
19510
19612
|
function updateChannel(action) {
|
|
19511
19613
|
var payload, channelId, config, _SceytChatClient6, channel, paramsToUpdate, fileToUpload, _yield$call5, subject, avatarUrl, metadata, onUpdateChannel, _channel3, _channel4, _channel5, fields, updatedChannel, _t24;
|
|
19512
|
-
return _regenerator().w(function (
|
|
19513
|
-
while (1) switch (
|
|
19614
|
+
return _regenerator().w(function (_context25) {
|
|
19615
|
+
while (1) switch (_context25.p = _context25.n) {
|
|
19514
19616
|
case 0:
|
|
19515
|
-
|
|
19617
|
+
_context25.p = 0;
|
|
19516
19618
|
payload = action.payload;
|
|
19517
19619
|
channelId = payload.channelId, config = payload.config;
|
|
19518
19620
|
_SceytChatClient6 = getClient();
|
|
19519
|
-
|
|
19621
|
+
_context25.n = 1;
|
|
19520
19622
|
return effects.call(getChannelFromMap, channelId);
|
|
19521
19623
|
case 1:
|
|
19522
|
-
channel =
|
|
19624
|
+
channel = _context25.v;
|
|
19523
19625
|
if (!channel) {
|
|
19524
19626
|
channel = getChannelFromAllChannels(channelId);
|
|
19525
19627
|
}
|
|
@@ -19530,7 +19632,7 @@ function updateChannel(action) {
|
|
|
19530
19632
|
avatarUrl: channel.avatarUrl
|
|
19531
19633
|
};
|
|
19532
19634
|
if (!config.avatar) {
|
|
19533
|
-
|
|
19635
|
+
_context25.n = 3;
|
|
19534
19636
|
break;
|
|
19535
19637
|
}
|
|
19536
19638
|
fileToUpload = {
|
|
@@ -19539,10 +19641,10 @@ function updateChannel(action) {
|
|
|
19539
19641
|
log.info('upload percent - ', progressPercent);
|
|
19540
19642
|
}
|
|
19541
19643
|
};
|
|
19542
|
-
|
|
19644
|
+
_context25.n = 2;
|
|
19543
19645
|
return effects.call(_SceytChatClient6.uploadFile, fileToUpload);
|
|
19544
19646
|
case 2:
|
|
19545
|
-
paramsToUpdate.avatarUrl =
|
|
19647
|
+
paramsToUpdate.avatarUrl = _context25.v;
|
|
19546
19648
|
case 3:
|
|
19547
19649
|
if (config.subject) {
|
|
19548
19650
|
paramsToUpdate.subject = config.subject;
|
|
@@ -19553,14 +19655,14 @@ function updateChannel(action) {
|
|
|
19553
19655
|
if (config.avatarUrl === '') {
|
|
19554
19656
|
paramsToUpdate.avatarUrl = '';
|
|
19555
19657
|
}
|
|
19556
|
-
|
|
19658
|
+
_context25.n = 4;
|
|
19557
19659
|
return effects.call(channel.update, paramsToUpdate);
|
|
19558
19660
|
case 4:
|
|
19559
|
-
_yield$call5 =
|
|
19661
|
+
_yield$call5 = _context25.v;
|
|
19560
19662
|
subject = _yield$call5.subject;
|
|
19561
19663
|
avatarUrl = _yield$call5.avatarUrl;
|
|
19562
19664
|
metadata = _yield$call5.metadata;
|
|
19563
|
-
|
|
19665
|
+
_context25.n = 5;
|
|
19564
19666
|
return effects.put(updateChannelDataAC(channelId, {
|
|
19565
19667
|
subject: subject,
|
|
19566
19668
|
avatarUrl: avatarUrl,
|
|
@@ -19574,7 +19676,7 @@ function updateChannel(action) {
|
|
|
19574
19676
|
});
|
|
19575
19677
|
onUpdateChannel = getOnUpdateChannel();
|
|
19576
19678
|
if (!onUpdateChannel) {
|
|
19577
|
-
|
|
19679
|
+
_context25.n = 7;
|
|
19578
19680
|
break;
|
|
19579
19681
|
}
|
|
19580
19682
|
fields = [];
|
|
@@ -19587,35 +19689,35 @@ function updateChannel(action) {
|
|
|
19587
19689
|
if (JSON.stringify((_channel5 = channel) === null || _channel5 === void 0 ? void 0 : _channel5.metadata) !== metadata) {
|
|
19588
19690
|
fields.push('metadata');
|
|
19589
19691
|
}
|
|
19590
|
-
|
|
19692
|
+
_context25.n = 6;
|
|
19591
19693
|
return effects.call(getChannelFromMap, channelId);
|
|
19592
19694
|
case 6:
|
|
19593
|
-
updatedChannel =
|
|
19695
|
+
updatedChannel = _context25.v;
|
|
19594
19696
|
onUpdateChannel(updatedChannel, fields);
|
|
19595
19697
|
case 7:
|
|
19596
|
-
|
|
19698
|
+
_context25.n = 9;
|
|
19597
19699
|
break;
|
|
19598
19700
|
case 8:
|
|
19599
|
-
|
|
19600
|
-
_t24 =
|
|
19701
|
+
_context25.p = 8;
|
|
19702
|
+
_t24 = _context25.v;
|
|
19601
19703
|
log.error('ERROR in update channel', _t24.message);
|
|
19602
19704
|
case 9:
|
|
19603
|
-
return
|
|
19705
|
+
return _context25.a(2);
|
|
19604
19706
|
}
|
|
19605
19707
|
}, _marked24, null, [[0, 8]]);
|
|
19606
19708
|
}
|
|
19607
19709
|
function checkUsersStatus() {
|
|
19608
19710
|
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData, _t25;
|
|
19609
|
-
return _regenerator().w(function (
|
|
19610
|
-
while (1) switch (
|
|
19711
|
+
return _regenerator().w(function (_context26) {
|
|
19712
|
+
while (1) switch (_context26.p = _context26.n) {
|
|
19611
19713
|
case 0:
|
|
19612
|
-
|
|
19714
|
+
_context26.p = 0;
|
|
19613
19715
|
_SceytChatClient7 = getClient();
|
|
19614
19716
|
usersForUpdate = Object.keys(usersMap);
|
|
19615
|
-
|
|
19717
|
+
_context26.n = 1;
|
|
19616
19718
|
return effects.call(_SceytChatClient7.getUsers, usersForUpdate);
|
|
19617
19719
|
case 1:
|
|
19618
|
-
updatedUsers =
|
|
19720
|
+
updatedUsers = _context26.v;
|
|
19619
19721
|
usersToUpdateMap = {};
|
|
19620
19722
|
update = false;
|
|
19621
19723
|
updatedUsers.forEach(function (updatedUser) {
|
|
@@ -19629,155 +19731,155 @@ function checkUsersStatus() {
|
|
|
19629
19731
|
}
|
|
19630
19732
|
});
|
|
19631
19733
|
if (!update) {
|
|
19632
|
-
|
|
19734
|
+
_context26.n = 5;
|
|
19633
19735
|
break;
|
|
19634
19736
|
}
|
|
19635
19737
|
updateData = JSON.parse(JSON.stringify(usersToUpdateMap));
|
|
19636
|
-
|
|
19738
|
+
_context26.n = 2;
|
|
19637
19739
|
return effects.put(updateMembersPresenceAC(updateData));
|
|
19638
19740
|
case 2:
|
|
19639
|
-
|
|
19741
|
+
_context26.n = 3;
|
|
19640
19742
|
return effects.put(updateUserStatusOnMapAC(updateData));
|
|
19641
19743
|
case 3:
|
|
19642
|
-
|
|
19744
|
+
_context26.n = 4;
|
|
19643
19745
|
return effects.put(updateUserStatusOnChannelAC(updateData));
|
|
19644
19746
|
case 4:
|
|
19645
19747
|
updateChannelMemberInAllChannels(Object.values(updateData));
|
|
19646
19748
|
case 5:
|
|
19647
|
-
|
|
19749
|
+
_context26.n = 7;
|
|
19648
19750
|
break;
|
|
19649
19751
|
case 6:
|
|
19650
|
-
|
|
19651
|
-
_t25 =
|
|
19752
|
+
_context26.p = 6;
|
|
19753
|
+
_t25 = _context26.v;
|
|
19652
19754
|
log.error('ERROR in check user status : ', _t25.message);
|
|
19653
19755
|
case 7:
|
|
19654
|
-
return
|
|
19756
|
+
return _context26.a(2);
|
|
19655
19757
|
}
|
|
19656
19758
|
}, _marked25, null, [[0, 6]]);
|
|
19657
19759
|
}
|
|
19658
19760
|
function sendTyping(action) {
|
|
19659
19761
|
var state, activeChannelId, channel, _t26;
|
|
19660
|
-
return _regenerator().w(function (
|
|
19661
|
-
while (1) switch (
|
|
19762
|
+
return _regenerator().w(function (_context27) {
|
|
19763
|
+
while (1) switch (_context27.p = _context27.n) {
|
|
19662
19764
|
case 0:
|
|
19663
19765
|
state = action.payload.state;
|
|
19664
|
-
|
|
19766
|
+
_context27.n = 1;
|
|
19665
19767
|
return effects.call(getActiveChannelId);
|
|
19666
19768
|
case 1:
|
|
19667
|
-
activeChannelId =
|
|
19668
|
-
|
|
19769
|
+
activeChannelId = _context27.v;
|
|
19770
|
+
_context27.n = 2;
|
|
19669
19771
|
return effects.call(getChannelFromMap, activeChannelId);
|
|
19670
19772
|
case 2:
|
|
19671
|
-
channel =
|
|
19672
|
-
|
|
19773
|
+
channel = _context27.v;
|
|
19774
|
+
_context27.p = 3;
|
|
19673
19775
|
if (!channel) {
|
|
19674
|
-
|
|
19776
|
+
_context27.n = 6;
|
|
19675
19777
|
break;
|
|
19676
19778
|
}
|
|
19677
19779
|
if (!state) {
|
|
19678
|
-
|
|
19780
|
+
_context27.n = 5;
|
|
19679
19781
|
break;
|
|
19680
19782
|
}
|
|
19681
|
-
|
|
19783
|
+
_context27.n = 4;
|
|
19682
19784
|
return effects.call(channel.startTyping);
|
|
19683
19785
|
case 4:
|
|
19684
|
-
|
|
19786
|
+
_context27.n = 6;
|
|
19685
19787
|
break;
|
|
19686
19788
|
case 5:
|
|
19687
|
-
|
|
19789
|
+
_context27.n = 6;
|
|
19688
19790
|
return effects.call(channel.stopTyping);
|
|
19689
19791
|
case 6:
|
|
19690
|
-
|
|
19792
|
+
_context27.n = 8;
|
|
19691
19793
|
break;
|
|
19692
19794
|
case 7:
|
|
19693
|
-
|
|
19694
|
-
_t26 =
|
|
19795
|
+
_context27.p = 7;
|
|
19796
|
+
_t26 = _context27.v;
|
|
19695
19797
|
log.error('ERROR in send typing', _t26);
|
|
19696
19798
|
case 8:
|
|
19697
|
-
return
|
|
19799
|
+
return _context27.a(2);
|
|
19698
19800
|
}
|
|
19699
19801
|
}, _marked26, null, [[3, 7]]);
|
|
19700
19802
|
}
|
|
19701
19803
|
function sendRecording(action) {
|
|
19702
19804
|
var _action$payload, state, channelId, channel, _t27;
|
|
19703
|
-
return _regenerator().w(function (
|
|
19704
|
-
while (1) switch (
|
|
19805
|
+
return _regenerator().w(function (_context28) {
|
|
19806
|
+
while (1) switch (_context28.p = _context28.n) {
|
|
19705
19807
|
case 0:
|
|
19706
19808
|
_action$payload = action.payload, state = _action$payload.state, channelId = _action$payload.channelId;
|
|
19707
|
-
|
|
19809
|
+
_context28.n = 1;
|
|
19708
19810
|
return effects.call(getChannelFromMap, channelId);
|
|
19709
19811
|
case 1:
|
|
19710
|
-
channel =
|
|
19711
|
-
|
|
19812
|
+
channel = _context28.v;
|
|
19813
|
+
_context28.p = 2;
|
|
19712
19814
|
if (!channel) {
|
|
19713
|
-
|
|
19815
|
+
_context28.n = 5;
|
|
19714
19816
|
break;
|
|
19715
19817
|
}
|
|
19716
19818
|
if (!(state && channel !== null && channel !== void 0 && channel.startRecording)) {
|
|
19717
|
-
|
|
19819
|
+
_context28.n = 4;
|
|
19718
19820
|
break;
|
|
19719
19821
|
}
|
|
19720
|
-
|
|
19822
|
+
_context28.n = 3;
|
|
19721
19823
|
return effects.call(channel.startRecording);
|
|
19722
19824
|
case 3:
|
|
19723
|
-
|
|
19825
|
+
_context28.n = 5;
|
|
19724
19826
|
break;
|
|
19725
19827
|
case 4:
|
|
19726
19828
|
if (!(channel !== null && channel !== void 0 && channel.stopRecording)) {
|
|
19727
|
-
|
|
19829
|
+
_context28.n = 5;
|
|
19728
19830
|
break;
|
|
19729
19831
|
}
|
|
19730
|
-
|
|
19832
|
+
_context28.n = 5;
|
|
19731
19833
|
return effects.call(channel.stopRecording);
|
|
19732
19834
|
case 5:
|
|
19733
|
-
|
|
19835
|
+
_context28.n = 7;
|
|
19734
19836
|
break;
|
|
19735
19837
|
case 6:
|
|
19736
|
-
|
|
19737
|
-
_t27 =
|
|
19838
|
+
_context28.p = 6;
|
|
19839
|
+
_t27 = _context28.v;
|
|
19738
19840
|
log.error('ERROR in send recording', _t27);
|
|
19739
19841
|
case 7:
|
|
19740
|
-
return
|
|
19842
|
+
return _context28.a(2);
|
|
19741
19843
|
}
|
|
19742
19844
|
}, _marked27, null, [[2, 6]]);
|
|
19743
19845
|
}
|
|
19744
19846
|
function clearHistory(action) {
|
|
19745
19847
|
var payload, channelId, channel, activeChannelId, groupName, _t28;
|
|
19746
|
-
return _regenerator().w(function (
|
|
19747
|
-
while (1) switch (
|
|
19848
|
+
return _regenerator().w(function (_context29) {
|
|
19849
|
+
while (1) switch (_context29.p = _context29.n) {
|
|
19748
19850
|
case 0:
|
|
19749
|
-
|
|
19851
|
+
_context29.p = 0;
|
|
19750
19852
|
payload = action.payload;
|
|
19751
19853
|
channelId = payload.channelId;
|
|
19752
|
-
|
|
19854
|
+
_context29.n = 1;
|
|
19753
19855
|
return effects.call(getChannelFromMap, channelId);
|
|
19754
19856
|
case 1:
|
|
19755
|
-
channel =
|
|
19857
|
+
channel = _context29.v;
|
|
19756
19858
|
if (!channel) {
|
|
19757
19859
|
channel = getChannelFromAllChannels(channelId);
|
|
19758
19860
|
}
|
|
19759
|
-
|
|
19861
|
+
_context29.n = 2;
|
|
19760
19862
|
return effects.call(getActiveChannelId);
|
|
19761
19863
|
case 2:
|
|
19762
|
-
activeChannelId =
|
|
19864
|
+
activeChannelId = _context29.v;
|
|
19763
19865
|
if (!channel) {
|
|
19764
|
-
|
|
19866
|
+
_context29.n = 7;
|
|
19765
19867
|
break;
|
|
19766
19868
|
}
|
|
19767
|
-
|
|
19869
|
+
_context29.n = 3;
|
|
19768
19870
|
return effects.call(channel.deleteAllMessages);
|
|
19769
19871
|
case 3:
|
|
19770
|
-
|
|
19872
|
+
_context29.n = 4;
|
|
19771
19873
|
return effects.put(clearMessagesAC());
|
|
19772
19874
|
case 4:
|
|
19773
19875
|
removeMessagesFromMap(channelId);
|
|
19774
19876
|
if (channelId === activeChannelId) {
|
|
19775
19877
|
removeAllMessages();
|
|
19776
19878
|
}
|
|
19777
|
-
|
|
19879
|
+
_context29.n = 5;
|
|
19778
19880
|
return effects.put(clearSelectedMessagesAC());
|
|
19779
19881
|
case 5:
|
|
19780
|
-
|
|
19882
|
+
_context29.n = 6;
|
|
19781
19883
|
return effects.put(updateChannelDataAC(channel.id, {
|
|
19782
19884
|
lastMessage: null,
|
|
19783
19885
|
newMessageCount: 0,
|
|
@@ -19790,64 +19892,64 @@ function clearHistory(action) {
|
|
|
19790
19892
|
newMentionCount: 0
|
|
19791
19893
|
});
|
|
19792
19894
|
groupName = getChannelGroupName(channel);
|
|
19793
|
-
|
|
19895
|
+
_context29.n = 7;
|
|
19794
19896
|
return effects.put(updateSearchedChannelDataAC(channel.id, {
|
|
19795
19897
|
lastMessage: null,
|
|
19796
19898
|
newMessageCount: 0,
|
|
19797
19899
|
newMentionCount: 0
|
|
19798
19900
|
}, groupName));
|
|
19799
19901
|
case 7:
|
|
19800
|
-
|
|
19902
|
+
_context29.n = 9;
|
|
19801
19903
|
break;
|
|
19802
19904
|
case 8:
|
|
19803
|
-
|
|
19804
|
-
_t28 =
|
|
19905
|
+
_context29.p = 8;
|
|
19906
|
+
_t28 = _context29.v;
|
|
19805
19907
|
log.error('ERROR in clear history', _t28);
|
|
19806
19908
|
case 9:
|
|
19807
|
-
return
|
|
19909
|
+
return _context29.a(2);
|
|
19808
19910
|
}
|
|
19809
19911
|
}, _marked28, null, [[0, 8]]);
|
|
19810
19912
|
}
|
|
19811
19913
|
function deleteAllMessages(action) {
|
|
19812
19914
|
var payload, channelId, channel, activeChannelId, groupName, _t29;
|
|
19813
|
-
return _regenerator().w(function (
|
|
19814
|
-
while (1) switch (
|
|
19915
|
+
return _regenerator().w(function (_context30) {
|
|
19916
|
+
while (1) switch (_context30.p = _context30.n) {
|
|
19815
19917
|
case 0:
|
|
19816
|
-
|
|
19918
|
+
_context30.p = 0;
|
|
19817
19919
|
payload = action.payload;
|
|
19818
19920
|
channelId = payload.channelId;
|
|
19819
|
-
|
|
19921
|
+
_context30.n = 1;
|
|
19820
19922
|
return effects.call(getChannelFromMap, channelId);
|
|
19821
19923
|
case 1:
|
|
19822
|
-
channel =
|
|
19924
|
+
channel = _context30.v;
|
|
19823
19925
|
if (!channel) {
|
|
19824
19926
|
channel = getChannelFromAllChannels(channelId);
|
|
19825
19927
|
}
|
|
19826
|
-
|
|
19928
|
+
_context30.n = 2;
|
|
19827
19929
|
return effects.call(getActiveChannelId);
|
|
19828
19930
|
case 2:
|
|
19829
|
-
activeChannelId =
|
|
19931
|
+
activeChannelId = _context30.v;
|
|
19830
19932
|
if (!channel) {
|
|
19831
|
-
|
|
19933
|
+
_context30.n = 8;
|
|
19832
19934
|
break;
|
|
19833
19935
|
}
|
|
19834
|
-
|
|
19936
|
+
_context30.n = 3;
|
|
19835
19937
|
return effects.call(channel.deleteAllMessages, true);
|
|
19836
19938
|
case 3:
|
|
19837
19939
|
removeMessagesFromMap(channelId);
|
|
19838
19940
|
if (!(channelId === activeChannelId)) {
|
|
19839
|
-
|
|
19941
|
+
_context30.n = 5;
|
|
19840
19942
|
break;
|
|
19841
19943
|
}
|
|
19842
|
-
|
|
19944
|
+
_context30.n = 4;
|
|
19843
19945
|
return effects.put(clearMessagesAC());
|
|
19844
19946
|
case 4:
|
|
19845
19947
|
removeAllMessages();
|
|
19846
19948
|
case 5:
|
|
19847
|
-
|
|
19949
|
+
_context30.n = 6;
|
|
19848
19950
|
return effects.put(clearSelectedMessagesAC());
|
|
19849
19951
|
case 6:
|
|
19850
|
-
|
|
19952
|
+
_context30.n = 7;
|
|
19851
19953
|
return effects.put(updateChannelDataAC(channel.id, {
|
|
19852
19954
|
lastMessage: null,
|
|
19853
19955
|
newMessageCount: 0,
|
|
@@ -19860,230 +19962,230 @@ function deleteAllMessages(action) {
|
|
|
19860
19962
|
newMentionCount: 0
|
|
19861
19963
|
});
|
|
19862
19964
|
groupName = getChannelGroupName(channel);
|
|
19863
|
-
|
|
19965
|
+
_context30.n = 8;
|
|
19864
19966
|
return effects.put(updateSearchedChannelDataAC(channel.id, {
|
|
19865
19967
|
lastMessage: null,
|
|
19866
19968
|
newMessageCount: 0,
|
|
19867
19969
|
newMentionCount: 0
|
|
19868
19970
|
}, groupName));
|
|
19869
19971
|
case 8:
|
|
19870
|
-
|
|
19972
|
+
_context30.n = 10;
|
|
19871
19973
|
break;
|
|
19872
19974
|
case 9:
|
|
19873
|
-
|
|
19874
|
-
_t29 =
|
|
19975
|
+
_context30.p = 9;
|
|
19976
|
+
_t29 = _context30.v;
|
|
19875
19977
|
log.error('ERROR in clear history', _t29);
|
|
19876
19978
|
case 10:
|
|
19877
|
-
return
|
|
19979
|
+
return _context30.a(2);
|
|
19878
19980
|
}
|
|
19879
19981
|
}, _marked29, null, [[0, 9]]);
|
|
19880
19982
|
}
|
|
19881
19983
|
function joinChannel(action) {
|
|
19882
19984
|
var payload, channelId, _SceytChatClient8, channel, joinedChannel, _t30;
|
|
19883
|
-
return _regenerator().w(function (
|
|
19884
|
-
while (1) switch (
|
|
19985
|
+
return _regenerator().w(function (_context31) {
|
|
19986
|
+
while (1) switch (_context31.p = _context31.n) {
|
|
19885
19987
|
case 0:
|
|
19886
|
-
|
|
19988
|
+
_context31.p = 0;
|
|
19887
19989
|
payload = action.payload;
|
|
19888
19990
|
channelId = payload.channelId;
|
|
19889
19991
|
_SceytChatClient8 = getClient();
|
|
19890
|
-
|
|
19992
|
+
_context31.n = 1;
|
|
19891
19993
|
return effects.call(getChannelFromMap, channelId);
|
|
19892
19994
|
case 1:
|
|
19893
|
-
channel =
|
|
19995
|
+
channel = _context31.v;
|
|
19894
19996
|
if (!channel) {
|
|
19895
19997
|
channel = getChannelFromAllChannels(channelId);
|
|
19896
19998
|
}
|
|
19897
19999
|
if (channel) {
|
|
19898
|
-
|
|
20000
|
+
_context31.n = 3;
|
|
19899
20001
|
break;
|
|
19900
20002
|
}
|
|
19901
|
-
|
|
20003
|
+
_context31.n = 2;
|
|
19902
20004
|
return effects.call(_SceytChatClient8.getChannel, channelId);
|
|
19903
20005
|
case 2:
|
|
19904
|
-
channel =
|
|
20006
|
+
channel = _context31.v;
|
|
19905
20007
|
case 3:
|
|
19906
|
-
|
|
20008
|
+
_context31.n = 4;
|
|
19907
20009
|
return effects.call(channel.join);
|
|
19908
20010
|
case 4:
|
|
19909
|
-
joinedChannel =
|
|
19910
|
-
|
|
20011
|
+
joinedChannel = _context31.v;
|
|
20012
|
+
_context31.n = 5;
|
|
19911
20013
|
return effects.put(setCloseSearchChannelsAC(true));
|
|
19912
20014
|
case 5:
|
|
19913
|
-
|
|
20015
|
+
_context31.n = 6;
|
|
19914
20016
|
return effects.put(setChannelToAddAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
19915
20017
|
case 6:
|
|
19916
|
-
|
|
20018
|
+
_context31.n = 7;
|
|
19917
20019
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
19918
20020
|
case 7:
|
|
19919
20021
|
addChannelToAllChannels(joinedChannel);
|
|
19920
|
-
|
|
20022
|
+
_context31.n = 8;
|
|
19921
20023
|
return effects.call(setActiveChannelId, joinedChannel.id);
|
|
19922
20024
|
case 8:
|
|
19923
|
-
|
|
20025
|
+
_context31.n = 10;
|
|
19924
20026
|
break;
|
|
19925
20027
|
case 9:
|
|
19926
|
-
|
|
19927
|
-
_t30 =
|
|
20028
|
+
_context31.p = 9;
|
|
20029
|
+
_t30 = _context31.v;
|
|
19928
20030
|
log.error(_t30, 'Error in join to channel');
|
|
19929
20031
|
case 10:
|
|
19930
|
-
return
|
|
20032
|
+
return _context31.a(2);
|
|
19931
20033
|
}
|
|
19932
20034
|
}, _marked30, null, [[0, 9]]);
|
|
19933
20035
|
}
|
|
19934
20036
|
function watchForChannelEvents() {
|
|
19935
|
-
return _regenerator().w(function (
|
|
19936
|
-
while (1) switch (
|
|
20037
|
+
return _regenerator().w(function (_context32) {
|
|
20038
|
+
while (1) switch (_context32.n) {
|
|
19937
20039
|
case 0:
|
|
19938
|
-
|
|
20040
|
+
_context32.n = 1;
|
|
19939
20041
|
return effects.call(watchForEvents);
|
|
19940
20042
|
case 1:
|
|
19941
|
-
return
|
|
20043
|
+
return _context32.a(2);
|
|
19942
20044
|
}
|
|
19943
20045
|
}, _marked31);
|
|
19944
20046
|
}
|
|
19945
20047
|
function createChannelInviteKey(action) {
|
|
19946
20048
|
var payload, channelId, _SceytChatClient9, channel, inviteKey, _t31;
|
|
19947
|
-
return _regenerator().w(function (
|
|
19948
|
-
while (1) switch (
|
|
20049
|
+
return _regenerator().w(function (_context33) {
|
|
20050
|
+
while (1) switch (_context33.p = _context33.n) {
|
|
19949
20051
|
case 0:
|
|
19950
|
-
|
|
20052
|
+
_context33.p = 0;
|
|
19951
20053
|
payload = action.payload;
|
|
19952
20054
|
channelId = payload.channelId;
|
|
19953
20055
|
_SceytChatClient9 = getClient();
|
|
19954
|
-
|
|
20056
|
+
_context33.n = 1;
|
|
19955
20057
|
return effects.call(getChannelFromMap, channelId);
|
|
19956
20058
|
case 1:
|
|
19957
|
-
channel =
|
|
20059
|
+
channel = _context33.v;
|
|
19958
20060
|
if (!channel) {
|
|
19959
20061
|
channel = getChannelFromAllChannels(channelId);
|
|
19960
20062
|
}
|
|
19961
20063
|
if (!channel) {
|
|
19962
|
-
|
|
20064
|
+
_context33.n = 3;
|
|
19963
20065
|
break;
|
|
19964
20066
|
}
|
|
19965
|
-
|
|
20067
|
+
_context33.n = 2;
|
|
19966
20068
|
return effects.call(_SceytChatClient9.createInviteKey, {
|
|
19967
20069
|
maxUses: 0,
|
|
19968
20070
|
expiresAt: 0,
|
|
19969
20071
|
accessPriorHistory: true
|
|
19970
20072
|
});
|
|
19971
20073
|
case 2:
|
|
19972
|
-
inviteKey =
|
|
19973
|
-
|
|
20074
|
+
inviteKey = _context33.v;
|
|
20075
|
+
_context33.n = 3;
|
|
19974
20076
|
return effects.put(setChannelInviteKeysAC(channelId, [inviteKey]));
|
|
19975
20077
|
case 3:
|
|
19976
|
-
|
|
20078
|
+
_context33.n = 5;
|
|
19977
20079
|
break;
|
|
19978
20080
|
case 4:
|
|
19979
|
-
|
|
19980
|
-
_t31 =
|
|
20081
|
+
_context33.p = 4;
|
|
20082
|
+
_t31 = _context33.v;
|
|
19981
20083
|
log.error('ERROR in create channel invite key', _t31);
|
|
19982
20084
|
case 5:
|
|
19983
|
-
return
|
|
20085
|
+
return _context33.a(2);
|
|
19984
20086
|
}
|
|
19985
20087
|
}, _marked32, null, [[0, 4]]);
|
|
19986
20088
|
}
|
|
19987
20089
|
function getChannelInviteKeys(action) {
|
|
19988
20090
|
var payload, channelId, channel, inviteKeys, _t32;
|
|
19989
|
-
return _regenerator().w(function (
|
|
19990
|
-
while (1) switch (
|
|
20091
|
+
return _regenerator().w(function (_context34) {
|
|
20092
|
+
while (1) switch (_context34.p = _context34.n) {
|
|
19991
20093
|
case 0:
|
|
19992
|
-
|
|
20094
|
+
_context34.p = 0;
|
|
19993
20095
|
payload = action.payload;
|
|
19994
20096
|
channelId = payload.channelId;
|
|
19995
|
-
|
|
20097
|
+
_context34.n = 1;
|
|
19996
20098
|
return effects.call(getChannelFromMap, channelId);
|
|
19997
20099
|
case 1:
|
|
19998
|
-
channel =
|
|
20100
|
+
channel = _context34.v;
|
|
19999
20101
|
if (!channel) {
|
|
20000
20102
|
channel = getChannelFromAllChannels(channelId);
|
|
20001
20103
|
}
|
|
20002
20104
|
if (!channel) {
|
|
20003
|
-
|
|
20105
|
+
_context34.n = 3;
|
|
20004
20106
|
break;
|
|
20005
20107
|
}
|
|
20006
|
-
|
|
20108
|
+
_context34.n = 2;
|
|
20007
20109
|
return effects.call(channel.getInviteKeys);
|
|
20008
20110
|
case 2:
|
|
20009
|
-
inviteKeys =
|
|
20010
|
-
|
|
20111
|
+
inviteKeys = _context34.v;
|
|
20112
|
+
_context34.n = 3;
|
|
20011
20113
|
return effects.put(setChannelInviteKeysAC(channelId, inviteKeys));
|
|
20012
20114
|
case 3:
|
|
20013
|
-
|
|
20115
|
+
_context34.n = 5;
|
|
20014
20116
|
break;
|
|
20015
20117
|
case 4:
|
|
20016
|
-
|
|
20017
|
-
_t32 =
|
|
20118
|
+
_context34.p = 4;
|
|
20119
|
+
_t32 = _context34.v;
|
|
20018
20120
|
log.error('ERROR in get channel invite keys', _t32);
|
|
20019
20121
|
case 5:
|
|
20020
|
-
return
|
|
20122
|
+
return _context34.a(2);
|
|
20021
20123
|
}
|
|
20022
20124
|
}, _marked33, null, [[0, 4]]);
|
|
20023
20125
|
}
|
|
20024
20126
|
function regenerateChannelInviteKey(action) {
|
|
20025
20127
|
var payload, channelId, key, deletePermanently, channel, inviteKey, _t33;
|
|
20026
|
-
return _regenerator().w(function (
|
|
20027
|
-
while (1) switch (
|
|
20128
|
+
return _regenerator().w(function (_context35) {
|
|
20129
|
+
while (1) switch (_context35.p = _context35.n) {
|
|
20028
20130
|
case 0:
|
|
20029
|
-
|
|
20131
|
+
_context35.p = 0;
|
|
20030
20132
|
payload = action.payload;
|
|
20031
20133
|
channelId = payload.channelId, key = payload.key, deletePermanently = payload.deletePermanently;
|
|
20032
|
-
|
|
20134
|
+
_context35.n = 1;
|
|
20033
20135
|
return effects.call(getChannelFromMap, channelId);
|
|
20034
20136
|
case 1:
|
|
20035
|
-
channel =
|
|
20137
|
+
channel = _context35.v;
|
|
20036
20138
|
if (!channel) {
|
|
20037
20139
|
channel = getChannelFromAllChannels(channelId);
|
|
20038
20140
|
}
|
|
20039
20141
|
if (!channel) {
|
|
20040
|
-
|
|
20142
|
+
_context35.n = 3;
|
|
20041
20143
|
break;
|
|
20042
20144
|
}
|
|
20043
|
-
|
|
20145
|
+
_context35.n = 2;
|
|
20044
20146
|
return effects.call(channel.regenerateInviteKey, {
|
|
20045
20147
|
key: key,
|
|
20046
20148
|
channelId: channelId,
|
|
20047
20149
|
deletePermanently: deletePermanently
|
|
20048
20150
|
});
|
|
20049
20151
|
case 2:
|
|
20050
|
-
inviteKey =
|
|
20051
|
-
|
|
20152
|
+
inviteKey = _context35.v;
|
|
20153
|
+
_context35.n = 3;
|
|
20052
20154
|
return effects.put(setChannelInviteKeysAC(channelId, [inviteKey]));
|
|
20053
20155
|
case 3:
|
|
20054
|
-
|
|
20156
|
+
_context35.n = 5;
|
|
20055
20157
|
break;
|
|
20056
20158
|
case 4:
|
|
20057
|
-
|
|
20058
|
-
_t33 =
|
|
20159
|
+
_context35.p = 4;
|
|
20160
|
+
_t33 = _context35.v;
|
|
20059
20161
|
log.error('ERROR in regenerate channel invite key', _t33);
|
|
20060
20162
|
case 5:
|
|
20061
|
-
return
|
|
20163
|
+
return _context35.a(2);
|
|
20062
20164
|
}
|
|
20063
20165
|
}, _marked34, null, [[0, 4]]);
|
|
20064
20166
|
}
|
|
20065
20167
|
function updateChannelInviteKey(action) {
|
|
20066
20168
|
var channelInviteKeys, channelId, payload, payloadChannelId, key, accessPriorHistory, expiresAt, maxUses, channel, copiedChannelInviteKeys, _t34;
|
|
20067
|
-
return _regenerator().w(function (
|
|
20068
|
-
while (1) switch (
|
|
20169
|
+
return _regenerator().w(function (_context36) {
|
|
20170
|
+
while (1) switch (_context36.p = _context36.n) {
|
|
20069
20171
|
case 0:
|
|
20070
20172
|
channelInviteKeys = [];
|
|
20071
20173
|
channelId = '';
|
|
20072
|
-
|
|
20174
|
+
_context36.p = 1;
|
|
20073
20175
|
payload = action.payload;
|
|
20074
20176
|
payloadChannelId = payload.channelId, key = payload.key, accessPriorHistory = payload.accessPriorHistory, expiresAt = payload.expiresAt, maxUses = payload.maxUses;
|
|
20075
20177
|
channelId = payloadChannelId;
|
|
20076
|
-
|
|
20178
|
+
_context36.n = 2;
|
|
20077
20179
|
return effects.call(getChannelFromMap, channelId);
|
|
20078
20180
|
case 2:
|
|
20079
|
-
channel =
|
|
20181
|
+
channel = _context36.v;
|
|
20080
20182
|
if (!channel) {
|
|
20081
20183
|
channel = getChannelFromAllChannels(channelId);
|
|
20082
20184
|
}
|
|
20083
20185
|
channelInviteKeys = store.getState().ChannelReducer.channelInviteKeys[channelId];
|
|
20084
20186
|
copiedChannelInviteKeys = JSON.parse(JSON.stringify(channelInviteKeys));
|
|
20085
20187
|
if (!copiedChannelInviteKeys) {
|
|
20086
|
-
|
|
20188
|
+
_context36.n = 3;
|
|
20087
20189
|
break;
|
|
20088
20190
|
}
|
|
20089
20191
|
copiedChannelInviteKeys.forEach(function (inviteKey) {
|
|
@@ -20093,14 +20195,14 @@ function updateChannelInviteKey(action) {
|
|
|
20093
20195
|
inviteKey.maxUses = maxUses;
|
|
20094
20196
|
}
|
|
20095
20197
|
});
|
|
20096
|
-
|
|
20198
|
+
_context36.n = 3;
|
|
20097
20199
|
return effects.put(setChannelInviteKeysAC(channelId, copiedChannelInviteKeys));
|
|
20098
20200
|
case 3:
|
|
20099
20201
|
if (!channel) {
|
|
20100
|
-
|
|
20202
|
+
_context36.n = 4;
|
|
20101
20203
|
break;
|
|
20102
20204
|
}
|
|
20103
|
-
|
|
20205
|
+
_context36.n = 4;
|
|
20104
20206
|
return effects.call(channel.updateInviteKey, {
|
|
20105
20207
|
key: key,
|
|
20106
20208
|
channelId: channelId,
|
|
@@ -20109,88 +20211,88 @@ function updateChannelInviteKey(action) {
|
|
|
20109
20211
|
accessPriorHistory: accessPriorHistory
|
|
20110
20212
|
});
|
|
20111
20213
|
case 4:
|
|
20112
|
-
|
|
20214
|
+
_context36.n = 6;
|
|
20113
20215
|
break;
|
|
20114
20216
|
case 5:
|
|
20115
|
-
|
|
20116
|
-
_t34 =
|
|
20217
|
+
_context36.p = 5;
|
|
20218
|
+
_t34 = _context36.v;
|
|
20117
20219
|
log.error('ERROR in update channel invite key', _t34);
|
|
20118
|
-
|
|
20220
|
+
_context36.n = 6;
|
|
20119
20221
|
return effects.put(setChannelInviteKeysAC(channelId, channelInviteKeys));
|
|
20120
20222
|
case 6:
|
|
20121
|
-
return
|
|
20223
|
+
return _context36.a(2);
|
|
20122
20224
|
}
|
|
20123
20225
|
}, _marked35, null, [[1, 5]]);
|
|
20124
20226
|
}
|
|
20125
20227
|
function getChannelByInviteKey(action) {
|
|
20126
20228
|
var _channel$, _channel$2, payload, key, _SceytChatClient0, channel, _t35;
|
|
20127
|
-
return _regenerator().w(function (
|
|
20128
|
-
while (1) switch (
|
|
20229
|
+
return _regenerator().w(function (_context37) {
|
|
20230
|
+
while (1) switch (_context37.p = _context37.n) {
|
|
20129
20231
|
case 0:
|
|
20130
|
-
|
|
20232
|
+
_context37.p = 0;
|
|
20131
20233
|
payload = action.payload;
|
|
20132
20234
|
key = payload.key;
|
|
20133
20235
|
_SceytChatClient0 = getClient();
|
|
20134
|
-
|
|
20236
|
+
_context37.n = 1;
|
|
20135
20237
|
return effects.call(_SceytChatClient0.Channel.getChannelByInviteKey, key);
|
|
20136
20238
|
case 1:
|
|
20137
|
-
channel =
|
|
20239
|
+
channel = _context37.v;
|
|
20138
20240
|
if (!(channel && channel.length > 0 && !((_channel$ = channel[0]) !== null && _channel$ !== void 0 && _channel$.role))) {
|
|
20139
|
-
|
|
20241
|
+
_context37.n = 3;
|
|
20140
20242
|
break;
|
|
20141
20243
|
}
|
|
20142
|
-
|
|
20244
|
+
_context37.n = 2;
|
|
20143
20245
|
return effects.put(setJoinableChannelAC(JSON.parse(JSON.stringify(channel[0]))));
|
|
20144
20246
|
case 2:
|
|
20145
20247
|
window.history.pushState({}, '', window.location.pathname + '?join=' + key);
|
|
20146
|
-
|
|
20248
|
+
_context37.n = 5;
|
|
20147
20249
|
break;
|
|
20148
20250
|
case 3:
|
|
20149
20251
|
if (!(channel && channel.length > 0 && (_channel$2 = channel[0]) !== null && _channel$2 !== void 0 && _channel$2.role)) {
|
|
20150
|
-
|
|
20252
|
+
_context37.n = 5;
|
|
20151
20253
|
break;
|
|
20152
20254
|
}
|
|
20153
|
-
|
|
20255
|
+
_context37.n = 4;
|
|
20154
20256
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(channel[0]))));
|
|
20155
20257
|
case 4:
|
|
20156
20258
|
window.history.pushState({}, '', window.location.pathname);
|
|
20157
20259
|
case 5:
|
|
20158
|
-
|
|
20260
|
+
_context37.n = 8;
|
|
20159
20261
|
break;
|
|
20160
20262
|
case 6:
|
|
20161
|
-
|
|
20162
|
-
_t35 =
|
|
20263
|
+
_context37.p = 6;
|
|
20264
|
+
_t35 = _context37.v;
|
|
20163
20265
|
if (!(_t35.code === 1109)) {
|
|
20164
|
-
|
|
20266
|
+
_context37.n = 7;
|
|
20165
20267
|
break;
|
|
20166
20268
|
}
|
|
20167
|
-
|
|
20269
|
+
_context37.n = 7;
|
|
20168
20270
|
return effects.put(setChannelInviteKeyAvailableAC(false));
|
|
20169
20271
|
case 7:
|
|
20170
20272
|
log.error('ERROR in get channel by invite key', _t35);
|
|
20171
20273
|
case 8:
|
|
20172
|
-
return
|
|
20274
|
+
return _context37.a(2);
|
|
20173
20275
|
}
|
|
20174
20276
|
}, _marked36, null, [[0, 6]]);
|
|
20175
20277
|
}
|
|
20176
20278
|
function joinChannelWithInviteKey(action) {
|
|
20177
20279
|
var payload, key, _SceytChatClient1, user, channel, messageToSend, _t36;
|
|
20178
|
-
return _regenerator().w(function (
|
|
20179
|
-
while (1) switch (
|
|
20280
|
+
return _regenerator().w(function (_context38) {
|
|
20281
|
+
while (1) switch (_context38.p = _context38.n) {
|
|
20180
20282
|
case 0:
|
|
20181
|
-
|
|
20283
|
+
_context38.p = 0;
|
|
20182
20284
|
payload = action.payload;
|
|
20183
20285
|
key = payload.key;
|
|
20184
20286
|
_SceytChatClient1 = getClient();
|
|
20185
20287
|
user = _SceytChatClient1.user;
|
|
20186
|
-
|
|
20288
|
+
_context38.n = 1;
|
|
20187
20289
|
return effects.call(_SceytChatClient1.Channel.joinChannelByInviteKey, key);
|
|
20188
20290
|
case 1:
|
|
20189
|
-
channel =
|
|
20190
|
-
|
|
20291
|
+
channel = _context38.v;
|
|
20292
|
+
_context38.n = 2;
|
|
20191
20293
|
return effects.put(setJoinableChannelAC(null));
|
|
20192
20294
|
case 2:
|
|
20193
|
-
|
|
20295
|
+
_context38.n = 3;
|
|
20194
20296
|
return effects.call(setChannelInMap, channel);
|
|
20195
20297
|
case 3:
|
|
20196
20298
|
messageToSend = {
|
|
@@ -20199,47 +20301,47 @@ function joinChannelWithInviteKey(action) {
|
|
|
20199
20301
|
attachments: [],
|
|
20200
20302
|
type: 'system'
|
|
20201
20303
|
};
|
|
20202
|
-
|
|
20304
|
+
_context38.n = 4;
|
|
20203
20305
|
return effects.put(sendTextMessageAC(messageToSend, channel === null || channel === void 0 ? void 0 : channel.id, CONNECTION_STATUS.CONNECTED));
|
|
20204
20306
|
case 4:
|
|
20205
|
-
|
|
20307
|
+
_context38.n = 5;
|
|
20206
20308
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(channel))));
|
|
20207
20309
|
case 5:
|
|
20208
20310
|
window.history.pushState({}, '', window.location.pathname);
|
|
20209
|
-
|
|
20311
|
+
_context38.n = 7;
|
|
20210
20312
|
break;
|
|
20211
20313
|
case 6:
|
|
20212
|
-
|
|
20213
|
-
_t36 =
|
|
20314
|
+
_context38.p = 6;
|
|
20315
|
+
_t36 = _context38.v;
|
|
20214
20316
|
log.error('ERROR in join channel with invite key', _t36);
|
|
20215
20317
|
case 7:
|
|
20216
|
-
return
|
|
20318
|
+
return _context38.a(2);
|
|
20217
20319
|
}
|
|
20218
20320
|
}, _marked37, null, [[0, 6]]);
|
|
20219
20321
|
}
|
|
20220
20322
|
function setMessageRetentionPeriod(action) {
|
|
20221
20323
|
var payload, channelId, periodInMilliseconds, channel, messageToSend, _t37;
|
|
20222
|
-
return _regenerator().w(function (
|
|
20223
|
-
while (1) switch (
|
|
20324
|
+
return _regenerator().w(function (_context39) {
|
|
20325
|
+
while (1) switch (_context39.p = _context39.n) {
|
|
20224
20326
|
case 0:
|
|
20225
|
-
|
|
20327
|
+
_context39.p = 0;
|
|
20226
20328
|
payload = action.payload;
|
|
20227
20329
|
channelId = payload.channelId, periodInMilliseconds = payload.periodInMilliseconds;
|
|
20228
|
-
|
|
20330
|
+
_context39.n = 1;
|
|
20229
20331
|
return effects.call(getChannelFromMap, channelId);
|
|
20230
20332
|
case 1:
|
|
20231
|
-
channel =
|
|
20333
|
+
channel = _context39.v;
|
|
20232
20334
|
if (!channel) {
|
|
20233
20335
|
channel = getChannelFromAllChannels(channelId);
|
|
20234
20336
|
}
|
|
20235
20337
|
if (!channel) {
|
|
20236
|
-
|
|
20338
|
+
_context39.n = 4;
|
|
20237
20339
|
break;
|
|
20238
20340
|
}
|
|
20239
|
-
|
|
20341
|
+
_context39.n = 2;
|
|
20240
20342
|
return effects.call(channel.setMessageRetentionPeriod, periodInMilliseconds);
|
|
20241
20343
|
case 2:
|
|
20242
|
-
|
|
20344
|
+
_context39.n = 3;
|
|
20243
20345
|
return effects.put(updateChannelDataAC(channelId, {
|
|
20244
20346
|
messageRetentionPeriod: periodInMilliseconds
|
|
20245
20347
|
}));
|
|
@@ -20256,32 +20358,32 @@ function setMessageRetentionPeriod(action) {
|
|
|
20256
20358
|
attachments: [],
|
|
20257
20359
|
type: 'system'
|
|
20258
20360
|
};
|
|
20259
|
-
|
|
20361
|
+
_context39.n = 4;
|
|
20260
20362
|
return effects.put(sendTextMessageAC(messageToSend, channelId, CONNECTION_STATUS.CONNECTED));
|
|
20261
20363
|
case 4:
|
|
20262
|
-
|
|
20364
|
+
_context39.n = 6;
|
|
20263
20365
|
break;
|
|
20264
20366
|
case 5:
|
|
20265
|
-
|
|
20266
|
-
_t37 =
|
|
20367
|
+
_context39.p = 5;
|
|
20368
|
+
_t37 = _context39.v;
|
|
20267
20369
|
log.error('ERROR in set message retention period', _t37);
|
|
20268
20370
|
case 6:
|
|
20269
|
-
return
|
|
20371
|
+
return _context39.a(2);
|
|
20270
20372
|
}
|
|
20271
20373
|
}, _marked38, null, [[0, 5]]);
|
|
20272
20374
|
}
|
|
20273
20375
|
function getChannelsWithUser(action) {
|
|
20274
20376
|
var payload, userId, _SceytChatClient10, channelsQueryBuilder, channelsQuery, channelsData, channels, _t38;
|
|
20275
|
-
return _regenerator().w(function (
|
|
20276
|
-
while (1) switch (
|
|
20377
|
+
return _regenerator().w(function (_context40) {
|
|
20378
|
+
while (1) switch (_context40.p = _context40.n) {
|
|
20277
20379
|
case 0:
|
|
20278
|
-
|
|
20380
|
+
_context40.n = 1;
|
|
20279
20381
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
20280
20382
|
case 1:
|
|
20281
|
-
|
|
20383
|
+
_context40.n = 2;
|
|
20282
20384
|
return effects.put(setMutualChannelsAC([]));
|
|
20283
20385
|
case 2:
|
|
20284
|
-
|
|
20386
|
+
_context40.p = 2;
|
|
20285
20387
|
payload = action.payload;
|
|
20286
20388
|
userId = payload.userId;
|
|
20287
20389
|
_SceytChatClient10 = getClient();
|
|
@@ -20290,235 +20392,235 @@ function getChannelsWithUser(action) {
|
|
|
20290
20392
|
channelsQueryBuilder.setMutualWithUserId(userId);
|
|
20291
20393
|
channelsQueryBuilder.types([DEFAULT_CHANNEL_TYPE.PRIVATE]);
|
|
20292
20394
|
channelsQueryBuilder.limit(15);
|
|
20293
|
-
|
|
20395
|
+
_context40.n = 3;
|
|
20294
20396
|
return effects.call(channelsQueryBuilder.build);
|
|
20295
20397
|
case 3:
|
|
20296
|
-
channelsQuery =
|
|
20398
|
+
channelsQuery = _context40.v;
|
|
20297
20399
|
query.mutualChannelsQuery = channelsQuery;
|
|
20298
|
-
|
|
20400
|
+
_context40.n = 4;
|
|
20299
20401
|
return effects.call(channelsQuery.loadNextPage);
|
|
20300
20402
|
case 4:
|
|
20301
|
-
channelsData =
|
|
20403
|
+
channelsData = _context40.v;
|
|
20302
20404
|
channels = channelsData.channels;
|
|
20303
20405
|
if (!channelsData.hasNext) {
|
|
20304
|
-
|
|
20406
|
+
_context40.n = 6;
|
|
20305
20407
|
break;
|
|
20306
20408
|
}
|
|
20307
|
-
|
|
20409
|
+
_context40.n = 5;
|
|
20308
20410
|
return effects.put(setMutualChannelsHasNextAC(true));
|
|
20309
20411
|
case 5:
|
|
20310
|
-
|
|
20412
|
+
_context40.n = 7;
|
|
20311
20413
|
break;
|
|
20312
20414
|
case 6:
|
|
20313
|
-
|
|
20415
|
+
_context40.n = 7;
|
|
20314
20416
|
return effects.put(setMutualChannelsHasNextAC(false));
|
|
20315
20417
|
case 7:
|
|
20316
|
-
|
|
20418
|
+
_context40.n = 8;
|
|
20317
20419
|
return effects.put(setMutualChannelsAC(channels));
|
|
20318
20420
|
case 8:
|
|
20319
|
-
|
|
20421
|
+
_context40.n = 10;
|
|
20320
20422
|
break;
|
|
20321
20423
|
case 9:
|
|
20322
|
-
|
|
20323
|
-
_t38 =
|
|
20424
|
+
_context40.p = 9;
|
|
20425
|
+
_t38 = _context40.v;
|
|
20324
20426
|
log.error('ERROR in get groups in common', _t38);
|
|
20325
20427
|
case 10:
|
|
20326
|
-
|
|
20327
|
-
|
|
20428
|
+
_context40.p = 10;
|
|
20429
|
+
_context40.n = 11;
|
|
20328
20430
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
20329
20431
|
case 11:
|
|
20330
|
-
return
|
|
20432
|
+
return _context40.f(10);
|
|
20331
20433
|
case 12:
|
|
20332
|
-
return
|
|
20434
|
+
return _context40.a(2);
|
|
20333
20435
|
}
|
|
20334
20436
|
}, _marked39, null, [[2, 9, 10, 12]]);
|
|
20335
20437
|
}
|
|
20336
20438
|
function loadMoreMutualChannels(action) {
|
|
20337
20439
|
var payload, limit, mutualChannelsQuery, channelsData, _t39;
|
|
20338
|
-
return _regenerator().w(function (
|
|
20339
|
-
while (1) switch (
|
|
20440
|
+
return _regenerator().w(function (_context41) {
|
|
20441
|
+
while (1) switch (_context41.p = _context41.n) {
|
|
20340
20442
|
case 0:
|
|
20341
|
-
|
|
20443
|
+
_context41.n = 1;
|
|
20342
20444
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
20343
20445
|
case 1:
|
|
20344
|
-
|
|
20446
|
+
_context41.p = 1;
|
|
20345
20447
|
payload = action.payload;
|
|
20346
20448
|
limit = payload.limit;
|
|
20347
20449
|
mutualChannelsQuery = query.mutualChannelsQuery;
|
|
20348
20450
|
if (mutualChannelsQuery) {
|
|
20349
|
-
|
|
20451
|
+
_context41.n = 2;
|
|
20350
20452
|
break;
|
|
20351
20453
|
}
|
|
20352
|
-
return
|
|
20454
|
+
return _context41.a(2);
|
|
20353
20455
|
case 2:
|
|
20354
20456
|
if (limit) {
|
|
20355
20457
|
mutualChannelsQuery.limit = limit;
|
|
20356
20458
|
}
|
|
20357
|
-
|
|
20459
|
+
_context41.n = 3;
|
|
20358
20460
|
return effects.call(mutualChannelsQuery.loadNextPage);
|
|
20359
20461
|
case 3:
|
|
20360
|
-
channelsData =
|
|
20462
|
+
channelsData = _context41.v;
|
|
20361
20463
|
if (!channelsData.hasNext) {
|
|
20362
|
-
|
|
20464
|
+
_context41.n = 5;
|
|
20363
20465
|
break;
|
|
20364
20466
|
}
|
|
20365
|
-
|
|
20467
|
+
_context41.n = 4;
|
|
20366
20468
|
return effects.put(setMutualChannelsHasNextAC(true));
|
|
20367
20469
|
case 4:
|
|
20368
|
-
|
|
20470
|
+
_context41.n = 6;
|
|
20369
20471
|
break;
|
|
20370
20472
|
case 5:
|
|
20371
|
-
|
|
20473
|
+
_context41.n = 6;
|
|
20372
20474
|
return effects.put(setMutualChannelsHasNextAC(false));
|
|
20373
20475
|
case 6:
|
|
20374
|
-
|
|
20476
|
+
_context41.n = 7;
|
|
20375
20477
|
return effects.put(setMutualChannelsAC(channelsData.channels));
|
|
20376
20478
|
case 7:
|
|
20377
|
-
|
|
20479
|
+
_context41.n = 9;
|
|
20378
20480
|
break;
|
|
20379
20481
|
case 8:
|
|
20380
|
-
|
|
20381
|
-
_t39 =
|
|
20482
|
+
_context41.p = 8;
|
|
20483
|
+
_t39 = _context41.v;
|
|
20382
20484
|
log.error('ERROR in load more mutual channels', _t39);
|
|
20383
20485
|
case 9:
|
|
20384
|
-
|
|
20385
|
-
|
|
20486
|
+
_context41.p = 9;
|
|
20487
|
+
_context41.n = 10;
|
|
20386
20488
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
20387
20489
|
case 10:
|
|
20388
|
-
return
|
|
20490
|
+
return _context41.f(9);
|
|
20389
20491
|
case 11:
|
|
20390
|
-
return
|
|
20492
|
+
return _context41.a(2);
|
|
20391
20493
|
}
|
|
20392
20494
|
}, _marked40, null, [[1, 8, 9, 11]]);
|
|
20393
20495
|
}
|
|
20394
20496
|
function ChannelsSaga() {
|
|
20395
|
-
return _regenerator().w(function (
|
|
20396
|
-
while (1) switch (
|
|
20497
|
+
return _regenerator().w(function (_context42) {
|
|
20498
|
+
while (1) switch (_context42.n) {
|
|
20397
20499
|
case 0:
|
|
20398
|
-
|
|
20500
|
+
_context42.n = 1;
|
|
20399
20501
|
return effects.takeLatest(CREATE_CHANNEL, createChannel);
|
|
20400
20502
|
case 1:
|
|
20401
|
-
|
|
20503
|
+
_context42.n = 2;
|
|
20402
20504
|
return effects.takeLatest(GET_CHANNELS, getChannels);
|
|
20403
20505
|
case 2:
|
|
20404
|
-
|
|
20506
|
+
_context42.n = 3;
|
|
20405
20507
|
return effects.takeLatest(SEARCH_CHANNELS, searchChannels);
|
|
20406
20508
|
case 3:
|
|
20407
|
-
|
|
20509
|
+
_context42.n = 4;
|
|
20408
20510
|
return effects.takeLatest(GET_CHANNELS_FOR_FORWARD, getChannelsForForward);
|
|
20409
20511
|
case 4:
|
|
20410
|
-
|
|
20512
|
+
_context42.n = 5;
|
|
20411
20513
|
return effects.takeLatest(SEARCH_CHANNELS_FOR_FORWARD, searchChannelsForForward);
|
|
20412
20514
|
case 5:
|
|
20413
|
-
|
|
20515
|
+
_context42.n = 6;
|
|
20414
20516
|
return effects.takeLatest(LOAD_MORE_CHANNEL, channelsLoadMore);
|
|
20415
20517
|
case 6:
|
|
20416
|
-
|
|
20518
|
+
_context42.n = 7;
|
|
20417
20519
|
return effects.takeLatest(LOAD_MORE_CHANNELS_FOR_FORWARD, channelsForForwardLoadMore);
|
|
20418
20520
|
case 7:
|
|
20419
|
-
|
|
20521
|
+
_context42.n = 8;
|
|
20420
20522
|
return effects.takeLatest(GET_CHANNELS_WITH_USER, getChannelsWithUser);
|
|
20421
20523
|
case 8:
|
|
20422
|
-
|
|
20524
|
+
_context42.n = 9;
|
|
20423
20525
|
return effects.takeLatest(LOAD_MORE_MUTUAL_CHANNELS, loadMoreMutualChannels);
|
|
20424
20526
|
case 9:
|
|
20425
|
-
|
|
20527
|
+
_context42.n = 10;
|
|
20426
20528
|
return effects.takeEvery(SWITCH_CHANNEL, switchChannel);
|
|
20427
20529
|
case 10:
|
|
20428
|
-
|
|
20530
|
+
_context42.n = 11;
|
|
20429
20531
|
return effects.takeLatest(LEAVE_CHANNEL, leaveChannel);
|
|
20430
20532
|
case 11:
|
|
20431
|
-
|
|
20533
|
+
_context42.n = 12;
|
|
20432
20534
|
return effects.takeLatest(DELETE_CHANNEL, deleteChannel);
|
|
20433
20535
|
case 12:
|
|
20434
|
-
|
|
20536
|
+
_context42.n = 13;
|
|
20435
20537
|
return effects.takeLatest(BLOCK_CHANNEL, blockChannel);
|
|
20436
20538
|
case 13:
|
|
20437
|
-
|
|
20539
|
+
_context42.n = 14;
|
|
20438
20540
|
return effects.takeLatest(UPDATE_CHANNEL, updateChannel);
|
|
20439
20541
|
case 14:
|
|
20440
|
-
|
|
20542
|
+
_context42.n = 15;
|
|
20441
20543
|
return effects.takeEvery(MARK_MESSAGES_AS_READ, markMessagesRead);
|
|
20442
20544
|
case 15:
|
|
20443
|
-
|
|
20545
|
+
_context42.n = 16;
|
|
20444
20546
|
return effects.takeLatest(MARK_MESSAGES_AS_DELIVERED, markMessagesDelivered);
|
|
20445
20547
|
case 16:
|
|
20446
|
-
|
|
20548
|
+
_context42.n = 17;
|
|
20447
20549
|
return effects.takeLatest(MARK_VOICE_MESSAGE_AS_PLAYED, markVoiceMessageAsPlayed);
|
|
20448
20550
|
case 17:
|
|
20449
|
-
|
|
20551
|
+
_context42.n = 18;
|
|
20450
20552
|
return effects.takeLatest(MARK_MESSAGE_AS_OPENED, markMessageAsOpened);
|
|
20451
20553
|
case 18:
|
|
20452
|
-
|
|
20554
|
+
_context42.n = 19;
|
|
20453
20555
|
return effects.takeLatest(UPDATE_MESSAGE_AS_OPENED, updateMessageAsOpened);
|
|
20454
20556
|
case 19:
|
|
20455
|
-
|
|
20557
|
+
_context42.n = 20;
|
|
20456
20558
|
return effects.takeLatest(WATCH_FOR_EVENTS, watchForChannelEvents);
|
|
20457
20559
|
case 20:
|
|
20458
|
-
|
|
20560
|
+
_context42.n = 21;
|
|
20459
20561
|
return effects.takeLatest(TURN_OFF_NOTIFICATION, notificationsTurnOff);
|
|
20460
20562
|
case 21:
|
|
20461
|
-
|
|
20563
|
+
_context42.n = 22;
|
|
20462
20564
|
return effects.takeLatest(TURN_ON_NOTIFICATION, notificationsTurnOn);
|
|
20463
20565
|
case 22:
|
|
20464
|
-
|
|
20566
|
+
_context42.n = 23;
|
|
20465
20567
|
return effects.takeLatest(MARK_CHANNEL_AS_READ, markChannelAsRead);
|
|
20466
20568
|
case 23:
|
|
20467
|
-
|
|
20569
|
+
_context42.n = 24;
|
|
20468
20570
|
return effects.takeLatest(MARK_CHANNEL_AS_UNREAD, markChannelAsUnRead);
|
|
20469
20571
|
case 24:
|
|
20470
|
-
|
|
20572
|
+
_context42.n = 25;
|
|
20471
20573
|
return effects.takeLatest(CHECK_USER_STATUS, checkUsersStatus);
|
|
20472
20574
|
case 25:
|
|
20473
|
-
|
|
20575
|
+
_context42.n = 26;
|
|
20474
20576
|
return effects.takeLatest(SEND_TYPING, sendTyping);
|
|
20475
20577
|
case 26:
|
|
20476
|
-
|
|
20578
|
+
_context42.n = 27;
|
|
20477
20579
|
return effects.takeLatest(SEND_RECORDING, sendRecording);
|
|
20478
20580
|
case 27:
|
|
20479
|
-
|
|
20581
|
+
_context42.n = 28;
|
|
20480
20582
|
return effects.takeLatest(PIN_CHANNEL, pinChannel);
|
|
20481
20583
|
case 28:
|
|
20482
|
-
|
|
20584
|
+
_context42.n = 29;
|
|
20483
20585
|
return effects.takeLatest(UNPIN_CHANNEL, unpinChannel);
|
|
20484
20586
|
case 29:
|
|
20485
|
-
|
|
20587
|
+
_context42.n = 30;
|
|
20486
20588
|
return effects.takeLatest(CLEAR_HISTORY, clearHistory);
|
|
20487
20589
|
case 30:
|
|
20488
|
-
|
|
20590
|
+
_context42.n = 31;
|
|
20489
20591
|
return effects.takeLatest(JOIN_TO_CHANNEL, joinChannel);
|
|
20490
20592
|
case 31:
|
|
20491
|
-
|
|
20593
|
+
_context42.n = 32;
|
|
20492
20594
|
return effects.takeLatest(DELETE_ALL_MESSAGES, deleteAllMessages);
|
|
20493
20595
|
case 32:
|
|
20494
|
-
|
|
20596
|
+
_context42.n = 33;
|
|
20495
20597
|
return effects.takeLatest(REMOVE_CHANNEL_CACHES, removeChannelCaches);
|
|
20496
20598
|
case 33:
|
|
20497
|
-
|
|
20599
|
+
_context42.n = 34;
|
|
20498
20600
|
return effects.takeLatest(GET_CHANNEL_MENTIONS, getChannelMentions);
|
|
20499
20601
|
case 34:
|
|
20500
|
-
|
|
20602
|
+
_context42.n = 35;
|
|
20501
20603
|
return effects.takeLatest(CREATE_CHANNEL_INVITE_KEY, createChannelInviteKey);
|
|
20502
20604
|
case 35:
|
|
20503
|
-
|
|
20605
|
+
_context42.n = 36;
|
|
20504
20606
|
return effects.takeLatest(UPDATE_CHANNEL_INVITE_KEY, updateChannelInviteKey);
|
|
20505
20607
|
case 36:
|
|
20506
|
-
|
|
20608
|
+
_context42.n = 37;
|
|
20507
20609
|
return effects.takeLatest(REGENERATE_CHANNEL_INVITE_KEY, regenerateChannelInviteKey);
|
|
20508
20610
|
case 37:
|
|
20509
|
-
|
|
20611
|
+
_context42.n = 38;
|
|
20510
20612
|
return effects.takeLatest(GET_CHANNEL_INVITE_KEYS, getChannelInviteKeys);
|
|
20511
20613
|
case 38:
|
|
20512
|
-
|
|
20614
|
+
_context42.n = 39;
|
|
20513
20615
|
return effects.takeLatest(GET_CHANNEL_BY_INVITE_KEY, getChannelByInviteKey);
|
|
20514
20616
|
case 39:
|
|
20515
|
-
|
|
20617
|
+
_context42.n = 40;
|
|
20516
20618
|
return effects.takeLatest(JOIN_TO_CHANNEL_WITH_INVITE_KEY, joinChannelWithInviteKey);
|
|
20517
20619
|
case 40:
|
|
20518
|
-
|
|
20620
|
+
_context42.n = 41;
|
|
20519
20621
|
return effects.takeLatest(SET_MESSAGE_RETENTION_PERIOD, setMessageRetentionPeriod);
|
|
20520
20622
|
case 41:
|
|
20521
|
-
return
|
|
20623
|
+
return _context42.a(2);
|
|
20522
20624
|
}
|
|
20523
20625
|
}, _marked41);
|
|
20524
20626
|
}
|
|
@@ -21551,11 +21653,6 @@ var addPendingMessage = function addPendingMessage(message, messageCopy, channel
|
|
|
21551
21653
|
var currentLastMessage = ((_getStoredChannel = getStoredChannel$1(channelId)) === null || _getStoredChannel === void 0 ? void 0 : _getStoredChannel.lastMessage) || null;
|
|
21552
21654
|
var nextLastMessage = messageToAdd;
|
|
21553
21655
|
if (nextLastMessage && lastMessageNeedsUpdate$1(currentLastMessage, nextLastMessage)) {
|
|
21554
|
-
if (getActiveChannelId() === channelId) {
|
|
21555
|
-
store.dispatch(updateChannelLastMessageAC(nextLastMessage, {
|
|
21556
|
-
id: channelId
|
|
21557
|
-
}));
|
|
21558
|
-
}
|
|
21559
21656
|
store.dispatch(updateChannelLastMessageAC(nextLastMessage, {
|
|
21560
21657
|
id: channelId
|
|
21561
21658
|
}));
|
|
@@ -21837,32 +21934,33 @@ var updateMessage$1 = function updateMessage(actionType, pending, channelId, scr
|
|
|
21837
21934
|
};
|
|
21838
21935
|
var syncFailedMessageState = /*#__PURE__*/_regenerator().m(function _callee2(channel, messageId, message, shouldKeepInMap) {
|
|
21839
21936
|
var _getStoredChannel5;
|
|
21840
|
-
var activeChannelId, failedMessage, resolvedLastMessage, channelUpdateParam;
|
|
21937
|
+
var shouldSkipUpdate, activeChannelId, failedMessage, resolvedLastMessage, channelUpdateParam;
|
|
21841
21938
|
return _regenerator().w(function (_context9) {
|
|
21842
21939
|
while (1) switch (_context9.n) {
|
|
21843
21940
|
case 0:
|
|
21941
|
+
shouldSkipUpdate = checkIsItSentAlready(messageId, channel.id);
|
|
21844
21942
|
if (shouldKeepInMap) {
|
|
21845
21943
|
updateMessageOnMap(channel.id, {
|
|
21846
21944
|
messageId: messageId,
|
|
21847
21945
|
params: {
|
|
21848
|
-
state: MESSAGE_STATUS.FAILED
|
|
21946
|
+
state: shouldSkipUpdate ? MESSAGE_STATUS.UNMODIFIED : MESSAGE_STATUS.FAILED
|
|
21849
21947
|
}
|
|
21850
21948
|
});
|
|
21851
|
-
} else {
|
|
21949
|
+
} else if (!shouldSkipUpdate) {
|
|
21852
21950
|
removeMessageFromMap(channel.id, messageId);
|
|
21853
21951
|
}
|
|
21854
21952
|
activeChannelId = getActiveChannelId();
|
|
21855
|
-
if (!(activeChannelId === channel.id)) {
|
|
21953
|
+
if (!(activeChannelId === channel.id && !shouldSkipUpdate)) {
|
|
21856
21954
|
_context9.n = 1;
|
|
21857
21955
|
break;
|
|
21858
21956
|
}
|
|
21859
21957
|
_context9.n = 1;
|
|
21860
21958
|
return effects.put(updateMessageAC(messageId, {
|
|
21861
|
-
state: MESSAGE_STATUS.FAILED
|
|
21959
|
+
state: shouldSkipUpdate ? MESSAGE_STATUS.UNMODIFIED : MESSAGE_STATUS.FAILED
|
|
21862
21960
|
}));
|
|
21863
21961
|
case 1:
|
|
21864
21962
|
failedMessage = _extends({}, message, {
|
|
21865
|
-
state: MESSAGE_STATUS.FAILED
|
|
21963
|
+
state: shouldSkipUpdate ? MESSAGE_STATUS.UNMODIFIED : MESSAGE_STATUS.FAILED
|
|
21866
21964
|
});
|
|
21867
21965
|
resolvedLastMessage = getResolvedChannelLastMessage$1(channel.id, failedMessage, message);
|
|
21868
21966
|
if (!lastMessageNeedsUpdate$1((_getStoredChannel5 = getStoredChannel$1(channel.id)) === null || _getStoredChannel5 === void 0 ? void 0 : _getStoredChannel5.lastMessage, resolvedLastMessage)) {
|