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