sceyt-chat-react-uikit 1.7.9-beta.6 → 1.7.9-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1083 -964
- package/index.modern.js +1083 -964
- package/package.json +1 -1
package/index.modern.js
CHANGED
|
@@ -9059,6 +9059,7 @@ var autoSelectFitsChannel = false;
|
|
|
9059
9059
|
var allChannels = [];
|
|
9060
9060
|
var channelsMap = {};
|
|
9061
9061
|
var allChannelsMap = {};
|
|
9062
|
+
var pendingDeleteChannelMap = {};
|
|
9062
9063
|
var channelTypesMemberDisplayTextMap;
|
|
9063
9064
|
var defaultRolesByChannelTypesMap;
|
|
9064
9065
|
var activeChannelId = '';
|
|
@@ -9118,8 +9119,20 @@ function setChannelsInMap(channels) {
|
|
|
9118
9119
|
function getChannelFromMap(channelId) {
|
|
9119
9120
|
return channelsMap[channelId];
|
|
9120
9121
|
}
|
|
9121
|
-
function getLastChannelFromMap() {
|
|
9122
|
-
|
|
9122
|
+
function getLastChannelFromMap(deletePending) {
|
|
9123
|
+
if (deletePending === void 0) {
|
|
9124
|
+
deletePending = false;
|
|
9125
|
+
}
|
|
9126
|
+
var channels = Object.values(channelsMap);
|
|
9127
|
+
if (deletePending) {
|
|
9128
|
+
for (var _iterator = _createForOfIteratorHelperLoose(channels), _step; !(_step = _iterator()).done;) {
|
|
9129
|
+
var channel = _step.value;
|
|
9130
|
+
if (!getPendingDeleteChannel(channel.id)) {
|
|
9131
|
+
return channel;
|
|
9132
|
+
}
|
|
9133
|
+
}
|
|
9134
|
+
}
|
|
9135
|
+
return channels[0];
|
|
9123
9136
|
}
|
|
9124
9137
|
function removeChannelFromMap(channelId) {
|
|
9125
9138
|
delete channelsMap[channelId];
|
|
@@ -9327,6 +9340,18 @@ var sortChannelByLastMessage = function sortChannelByLastMessage(channels) {
|
|
|
9327
9340
|
}
|
|
9328
9341
|
});
|
|
9329
9342
|
};
|
|
9343
|
+
var setPendingDeleteChannel = function setPendingDeleteChannel(channel) {
|
|
9344
|
+
pendingDeleteChannelMap[channel === null || channel === void 0 ? void 0 : channel.id] = channel;
|
|
9345
|
+
};
|
|
9346
|
+
var getPendingDeleteChannel = function getPendingDeleteChannel(channelId) {
|
|
9347
|
+
return pendingDeleteChannelMap[channelId];
|
|
9348
|
+
};
|
|
9349
|
+
var getPendingDeleteChannels = function getPendingDeleteChannels() {
|
|
9350
|
+
return Object.values(pendingDeleteChannelMap);
|
|
9351
|
+
};
|
|
9352
|
+
var removePendingDeleteChannel = function removePendingDeleteChannel(channelId) {
|
|
9353
|
+
delete pendingDeleteChannelMap[channelId];
|
|
9354
|
+
};
|
|
9330
9355
|
|
|
9331
9356
|
var initialState = {
|
|
9332
9357
|
channelsLoadingState: null,
|
|
@@ -10821,6 +10846,11 @@ function updatePendingMessageAC(channelId, messageId, updatedMessage) {
|
|
|
10821
10846
|
updatedMessage: updatedMessage
|
|
10822
10847
|
});
|
|
10823
10848
|
}
|
|
10849
|
+
function setUnreadMessageIdAC(messageId) {
|
|
10850
|
+
return setUnreadMessageId({
|
|
10851
|
+
messageId: messageId
|
|
10852
|
+
});
|
|
10853
|
+
}
|
|
10824
10854
|
|
|
10825
10855
|
var MESSAGES_MAX_PAGE_COUNT = 80;
|
|
10826
10856
|
var MESSAGES_MAX_LENGTH = 50;
|
|
@@ -11341,6 +11371,31 @@ var setPendingPollAction = function setPendingPollAction(action) {
|
|
|
11341
11371
|
}
|
|
11342
11372
|
store.dispatch(setPendingPollActionsMapAC(messageId, action));
|
|
11343
11373
|
};
|
|
11374
|
+
var getCenterTwoMessages = function getCenterTwoMessages(messages) {
|
|
11375
|
+
var mid = Math.floor(messages.length / 2);
|
|
11376
|
+
if (messages.length % 2 === 0) {
|
|
11377
|
+
return {
|
|
11378
|
+
mid1: {
|
|
11379
|
+
messageId: messages[mid - 1].id,
|
|
11380
|
+
index: mid - 1
|
|
11381
|
+
},
|
|
11382
|
+
mid2: {
|
|
11383
|
+
messageId: messages[mid].id,
|
|
11384
|
+
index: mid
|
|
11385
|
+
}
|
|
11386
|
+
};
|
|
11387
|
+
}
|
|
11388
|
+
return {
|
|
11389
|
+
mid1: {
|
|
11390
|
+
messageId: messages[mid - 1].id,
|
|
11391
|
+
index: mid - 1
|
|
11392
|
+
},
|
|
11393
|
+
mid2: {
|
|
11394
|
+
messageId: messages[mid + 1].id,
|
|
11395
|
+
index: mid + 1
|
|
11396
|
+
}
|
|
11397
|
+
};
|
|
11398
|
+
};
|
|
11344
11399
|
|
|
11345
11400
|
var initialState$1 = {
|
|
11346
11401
|
messagesLoadingState: null,
|
|
@@ -11387,7 +11442,8 @@ var initialState$1 = {
|
|
|
11387
11442
|
pollVotesInitialCount: null,
|
|
11388
11443
|
pendingPollActions: {},
|
|
11389
11444
|
pendingMessagesMap: {},
|
|
11390
|
-
unreadScrollTo: true
|
|
11445
|
+
unreadScrollTo: true,
|
|
11446
|
+
unreadMessageId: ''
|
|
11391
11447
|
};
|
|
11392
11448
|
var messageSlice = createSlice({
|
|
11393
11449
|
name: 'messages',
|
|
@@ -11963,6 +12019,9 @@ var messageSlice = createSlice({
|
|
|
11963
12019
|
},
|
|
11964
12020
|
clearPendingMessagesMap: function clearPendingMessagesMap(state) {
|
|
11965
12021
|
state.pendingMessagesMap = {};
|
|
12022
|
+
},
|
|
12023
|
+
setUnreadMessageId: function setUnreadMessageId(state, action) {
|
|
12024
|
+
state.unreadMessageId = action.payload.messageId;
|
|
11966
12025
|
}
|
|
11967
12026
|
},
|
|
11968
12027
|
extraReducers: function extraReducers(builder) {
|
|
@@ -12027,7 +12086,8 @@ var _messageSlice$actions = messageSlice.actions,
|
|
|
12027
12086
|
setPendingMessage$1 = _messageSlice$actions.setPendingMessage,
|
|
12028
12087
|
removePendingMessage = _messageSlice$actions.removePendingMessage,
|
|
12029
12088
|
updatePendingMessage = _messageSlice$actions.updatePendingMessage,
|
|
12030
|
-
updatePendingPollAction = _messageSlice$actions.updatePendingPollAction
|
|
12089
|
+
updatePendingPollAction = _messageSlice$actions.updatePendingPollAction,
|
|
12090
|
+
setUnreadMessageId = _messageSlice$actions.setUnreadMessageId;
|
|
12031
12091
|
var MessageReducer = messageSlice.reducer;
|
|
12032
12092
|
|
|
12033
12093
|
var initialState$2 = {
|
|
@@ -16317,6 +16377,56 @@ function watchForEvents() {
|
|
|
16317
16377
|
}, _marked$1);
|
|
16318
16378
|
}
|
|
16319
16379
|
|
|
16380
|
+
var SDKErrorTypeEnum = {
|
|
16381
|
+
BadRequest: {
|
|
16382
|
+
value: 'BadRequest',
|
|
16383
|
+
isResendable: false
|
|
16384
|
+
},
|
|
16385
|
+
BadParam: {
|
|
16386
|
+
value: 'BadParam',
|
|
16387
|
+
isResendable: false
|
|
16388
|
+
},
|
|
16389
|
+
NotFound: {
|
|
16390
|
+
value: 'NotFound',
|
|
16391
|
+
isResendable: false
|
|
16392
|
+
},
|
|
16393
|
+
NotAllowed: {
|
|
16394
|
+
value: 'NotAllowed',
|
|
16395
|
+
isResendable: false
|
|
16396
|
+
},
|
|
16397
|
+
TooLargeRequest: {
|
|
16398
|
+
value: 'TooLargeRequest',
|
|
16399
|
+
isResendable: false
|
|
16400
|
+
},
|
|
16401
|
+
InternalError: {
|
|
16402
|
+
value: 'InternalError',
|
|
16403
|
+
isResendable: true
|
|
16404
|
+
},
|
|
16405
|
+
TooManyRequests: {
|
|
16406
|
+
value: 'TooManyRequests',
|
|
16407
|
+
isResendable: true
|
|
16408
|
+
},
|
|
16409
|
+
Authentication: {
|
|
16410
|
+
value: 'Authentication',
|
|
16411
|
+
isResendable: true
|
|
16412
|
+
}
|
|
16413
|
+
};
|
|
16414
|
+
var fromValue = function fromValue(value) {
|
|
16415
|
+
if (!value) return null;
|
|
16416
|
+
var entries = Object.values(SDKErrorTypeEnum);
|
|
16417
|
+
return entries.find(function (entry) {
|
|
16418
|
+
return entry.value === value;
|
|
16419
|
+
}) || null;
|
|
16420
|
+
};
|
|
16421
|
+
var isResendableError = function isResendableError(value) {
|
|
16422
|
+
var _errorType$isResendab;
|
|
16423
|
+
if (!value) {
|
|
16424
|
+
return true;
|
|
16425
|
+
}
|
|
16426
|
+
var errorType = fromValue(value);
|
|
16427
|
+
return (_errorType$isResendab = errorType === null || errorType === void 0 ? void 0 : errorType.isResendable) != null ? _errorType$isResendab : true;
|
|
16428
|
+
};
|
|
16429
|
+
|
|
16320
16430
|
var _marked$2 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
16321
16431
|
_marked2$1 = /*#__PURE__*/_regenerator().m(getChannels),
|
|
16322
16432
|
_marked3 = /*#__PURE__*/_regenerator().m(searchChannels),
|
|
@@ -16337,26 +16447,27 @@ var _marked$2 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
|
16337
16447
|
_marked16 = /*#__PURE__*/_regenerator().m(unpinChannel),
|
|
16338
16448
|
_marked17 = /*#__PURE__*/_regenerator().m(removeChannelCaches),
|
|
16339
16449
|
_marked18 = /*#__PURE__*/_regenerator().m(leaveChannel),
|
|
16340
|
-
_marked19 = /*#__PURE__*/_regenerator().m(
|
|
16341
|
-
_marked20 = /*#__PURE__*/_regenerator().m(
|
|
16342
|
-
_marked21 = /*#__PURE__*/_regenerator().m(
|
|
16343
|
-
_marked22 = /*#__PURE__*/_regenerator().m(
|
|
16344
|
-
_marked23 = /*#__PURE__*/_regenerator().m(
|
|
16345
|
-
_marked24 = /*#__PURE__*/_regenerator().m(
|
|
16346
|
-
_marked25 = /*#__PURE__*/_regenerator().m(
|
|
16347
|
-
_marked26 = /*#__PURE__*/_regenerator().m(
|
|
16348
|
-
_marked27 = /*#__PURE__*/_regenerator().m(
|
|
16349
|
-
_marked28 = /*#__PURE__*/_regenerator().m(
|
|
16350
|
-
_marked29 = /*#__PURE__*/_regenerator().m(
|
|
16351
|
-
_marked30 = /*#__PURE__*/_regenerator().m(
|
|
16352
|
-
_marked31 = /*#__PURE__*/_regenerator().m(
|
|
16353
|
-
_marked32 = /*#__PURE__*/_regenerator().m(
|
|
16354
|
-
_marked33 = /*#__PURE__*/_regenerator().m(
|
|
16355
|
-
_marked34 = /*#__PURE__*/_regenerator().m(
|
|
16356
|
-
_marked35 = /*#__PURE__*/_regenerator().m(
|
|
16357
|
-
_marked36 = /*#__PURE__*/_regenerator().m(
|
|
16358
|
-
_marked37 = /*#__PURE__*/_regenerator().m(
|
|
16359
|
-
_marked38 = /*#__PURE__*/_regenerator().m(
|
|
16450
|
+
_marked19 = /*#__PURE__*/_regenerator().m(deletePendingDeleteChannels),
|
|
16451
|
+
_marked20 = /*#__PURE__*/_regenerator().m(deleteChannel),
|
|
16452
|
+
_marked21 = /*#__PURE__*/_regenerator().m(blockChannel),
|
|
16453
|
+
_marked22 = /*#__PURE__*/_regenerator().m(updateChannel),
|
|
16454
|
+
_marked23 = /*#__PURE__*/_regenerator().m(checkUsersStatus),
|
|
16455
|
+
_marked24 = /*#__PURE__*/_regenerator().m(sendTyping),
|
|
16456
|
+
_marked25 = /*#__PURE__*/_regenerator().m(sendRecording),
|
|
16457
|
+
_marked26 = /*#__PURE__*/_regenerator().m(clearHistory),
|
|
16458
|
+
_marked27 = /*#__PURE__*/_regenerator().m(deleteAllMessages),
|
|
16459
|
+
_marked28 = /*#__PURE__*/_regenerator().m(joinChannel),
|
|
16460
|
+
_marked29 = /*#__PURE__*/_regenerator().m(watchForChannelEvents),
|
|
16461
|
+
_marked30 = /*#__PURE__*/_regenerator().m(createChannelInviteKey),
|
|
16462
|
+
_marked31 = /*#__PURE__*/_regenerator().m(getChannelInviteKeys),
|
|
16463
|
+
_marked32 = /*#__PURE__*/_regenerator().m(regenerateChannelInviteKey),
|
|
16464
|
+
_marked33 = /*#__PURE__*/_regenerator().m(updateChannelInviteKey),
|
|
16465
|
+
_marked34 = /*#__PURE__*/_regenerator().m(getChannelByInviteKey),
|
|
16466
|
+
_marked35 = /*#__PURE__*/_regenerator().m(joinChannelWithInviteKey),
|
|
16467
|
+
_marked36 = /*#__PURE__*/_regenerator().m(setMessageRetentionPeriod),
|
|
16468
|
+
_marked37 = /*#__PURE__*/_regenerator().m(getChannelsWithUser),
|
|
16469
|
+
_marked38 = /*#__PURE__*/_regenerator().m(loadMoreMutualChannels),
|
|
16470
|
+
_marked39 = /*#__PURE__*/_regenerator().m(ChannelsSaga);
|
|
16360
16471
|
function createChannel(action) {
|
|
16361
16472
|
var payload, channelData, dontCreateIfNotExists, callback, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, whoDoesNotAdded, checkChannelExist, messageToSend, _allChannels, _memberId, _t;
|
|
16362
16473
|
return _regenerator().w(function (_context) {
|
|
@@ -16564,20 +16675,23 @@ function getChannels(action) {
|
|
|
16564
16675
|
_context2.p = 1;
|
|
16565
16676
|
payload = action.payload;
|
|
16566
16677
|
params = payload.params;
|
|
16678
|
+
_context2.n = 2;
|
|
16679
|
+
return call(deletePendingDeleteChannels);
|
|
16680
|
+
case 2:
|
|
16567
16681
|
log.info(new Date().toISOString() + " [getChannels] input params: " + JSON.stringify(params));
|
|
16568
16682
|
SceytChatClient = getClient();
|
|
16569
16683
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
16570
16684
|
log.info(new Date().toISOString() + " [getChannels] connection status: " + connectionStatus);
|
|
16571
16685
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
16572
|
-
_context2.n =
|
|
16686
|
+
_context2.n = 3;
|
|
16573
16687
|
break;
|
|
16574
16688
|
}
|
|
16575
16689
|
log.warn(new Date().toISOString() + " [getChannels] connection not ready, aborting. Status: " + connectionStatus);
|
|
16576
16690
|
return _context2.a(2);
|
|
16577
|
-
case 2:
|
|
16578
|
-
_context2.n = 3;
|
|
16579
|
-
return put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
16580
16691
|
case 3:
|
|
16692
|
+
_context2.n = 4;
|
|
16693
|
+
return put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
16694
|
+
case 4:
|
|
16581
16695
|
channelQueryBuilder = new SceytChatClient.ChannelListQueryBuilder();
|
|
16582
16696
|
channelTypesFilter = getChannelTypesFilter();
|
|
16583
16697
|
log.info(new Date().toISOString() + " [getChannels] channelTypesFilter: " + JSON.stringify(channelTypesFilter));
|
|
@@ -16600,50 +16714,50 @@ function getChannels(action) {
|
|
|
16600
16714
|
limit = params.limit || 50;
|
|
16601
16715
|
log.info(new Date().toISOString() + " [getChannels] query limit: " + limit);
|
|
16602
16716
|
channelQueryBuilder.limit(limit);
|
|
16603
|
-
_context2.n =
|
|
16717
|
+
_context2.n = 5;
|
|
16604
16718
|
return call(channelQueryBuilder.build);
|
|
16605
|
-
case
|
|
16719
|
+
case 5:
|
|
16606
16720
|
channelQuery = _context2.v;
|
|
16607
16721
|
log.info(new Date().toISOString() + " [getChannels] query built successfully");
|
|
16608
|
-
_context2.n =
|
|
16722
|
+
_context2.n = 6;
|
|
16609
16723
|
return call(channelQuery.loadNextPage);
|
|
16610
|
-
case
|
|
16724
|
+
case 6:
|
|
16611
16725
|
channelsData = _context2.v;
|
|
16612
16726
|
channelList = channelsData.channels;
|
|
16613
16727
|
log.info(new Date().toISOString() + " [getChannels] channelsData received: " + JSON.stringify({
|
|
16614
16728
|
channelsCount: (channelList === null || channelList === void 0 ? void 0 : channelList.length) || 0,
|
|
16615
16729
|
hasNext: channelsData.hasNext
|
|
16616
16730
|
}));
|
|
16617
|
-
_context2.n = 6;
|
|
16618
|
-
return put(channelHasNextAC(channelsData.hasNext));
|
|
16619
|
-
case 6:
|
|
16620
16731
|
_context2.n = 7;
|
|
16621
|
-
return
|
|
16732
|
+
return put(channelHasNextAC(channelsData.hasNext));
|
|
16622
16733
|
case 7:
|
|
16734
|
+
_context2.n = 8;
|
|
16735
|
+
return call(getActiveChannelId);
|
|
16736
|
+
case 8:
|
|
16623
16737
|
channelId = _context2.v;
|
|
16624
16738
|
log.info(new Date().toISOString() + " [getChannels] active channelId: " + channelId);
|
|
16625
16739
|
if (!channelId) {
|
|
16626
|
-
_context2.n =
|
|
16740
|
+
_context2.n = 10;
|
|
16627
16741
|
break;
|
|
16628
16742
|
}
|
|
16629
|
-
_context2.n =
|
|
16743
|
+
_context2.n = 9;
|
|
16630
16744
|
return call(getChannelFromMap, channelId);
|
|
16631
|
-
case
|
|
16745
|
+
case 9:
|
|
16632
16746
|
_t2 = _context2.v;
|
|
16633
|
-
_context2.n =
|
|
16747
|
+
_context2.n = 11;
|
|
16634
16748
|
break;
|
|
16635
|
-
case 9:
|
|
16636
|
-
_t2 = null;
|
|
16637
16749
|
case 10:
|
|
16750
|
+
_t2 = null;
|
|
16751
|
+
case 11:
|
|
16638
16752
|
activeChannel = _t2;
|
|
16639
16753
|
log.info(new Date().toISOString() + " [getChannels] activeChannel from map: " + (activeChannel ? (_activeChannel = activeChannel) === null || _activeChannel === void 0 ? void 0 : _activeChannel.id : 'null'));
|
|
16640
|
-
_context2.n =
|
|
16754
|
+
_context2.n = 12;
|
|
16641
16755
|
return call(destroyChannelsMap);
|
|
16642
|
-
case
|
|
16756
|
+
case 12:
|
|
16643
16757
|
log.info(new Date().toISOString() + " [getChannels] channels map destroyed");
|
|
16644
|
-
_context2.n =
|
|
16758
|
+
_context2.n = 13;
|
|
16645
16759
|
return call(setChannelsInMap, channelList);
|
|
16646
|
-
case
|
|
16760
|
+
case 13:
|
|
16647
16761
|
_yield$call = _context2.v;
|
|
16648
16762
|
mappedChannels = _yield$call.channels;
|
|
16649
16763
|
channelsForUpdateLastReactionMessage = _yield$call.channelsForUpdateLastReactionMessage;
|
|
@@ -16653,12 +16767,12 @@ function getChannels(action) {
|
|
|
16653
16767
|
}));
|
|
16654
16768
|
log.info(new Date().toISOString() + " channelsForUpdateLastReactionMessage: " + (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length));
|
|
16655
16769
|
if (!(channelsForUpdateLastReactionMessage !== null && channelsForUpdateLastReactionMessage !== void 0 && channelsForUpdateLastReactionMessage.length)) {
|
|
16656
|
-
_context2.n =
|
|
16770
|
+
_context2.n = 15;
|
|
16657
16771
|
break;
|
|
16658
16772
|
}
|
|
16659
16773
|
log.info(new Date().toISOString() + " [getChannels] processing channels for\n reaction message update: " + (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length));
|
|
16660
16774
|
channelMessageMap = {};
|
|
16661
|
-
_context2.n =
|
|
16775
|
+
_context2.n = 14;
|
|
16662
16776
|
return call(function () {
|
|
16663
16777
|
try {
|
|
16664
16778
|
return Promise.resolve(Promise.all(channelsForUpdateLastReactionMessage.map(function (channel) {
|
|
@@ -16681,7 +16795,7 @@ function getChannels(action) {
|
|
|
16681
16795
|
return Promise.reject(e);
|
|
16682
16796
|
}
|
|
16683
16797
|
});
|
|
16684
|
-
case
|
|
16798
|
+
case 14:
|
|
16685
16799
|
log.info(new Date().toISOString() + " [getChannels] reaction messages fetched: " + (channelMessageMap ? (_Object$keys = Object.keys(channelMessageMap)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length : 0), channelMessageMap ? (_Object$keys2 = Object.keys(channelMessageMap)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length : 0);
|
|
16686
16800
|
mappedChannels = mappedChannels.map(function (channel) {
|
|
16687
16801
|
if (channelMessageMap[channel === null || channel === void 0 ? void 0 : channel.id]) {
|
|
@@ -16690,31 +16804,31 @@ function getChannels(action) {
|
|
|
16690
16804
|
return channel;
|
|
16691
16805
|
});
|
|
16692
16806
|
log.info(new Date().toISOString() + " [getChannels] mappedChannels updated with reaction messages, final count: " + (((_mappedChannels2 = mappedChannels) === null || _mappedChannels2 === void 0 ? void 0 : _mappedChannels2.length) || 0));
|
|
16693
|
-
case
|
|
16807
|
+
case 15:
|
|
16694
16808
|
log.info(new Date().toISOString() + " [getChannels] setting channels in state, count: " + (((_mappedChannels3 = mappedChannels) === null || _mappedChannels3 === void 0 ? void 0 : _mappedChannels3.length) || 0));
|
|
16695
|
-
_context2.n =
|
|
16809
|
+
_context2.n = 16;
|
|
16696
16810
|
return put(setChannelsAC(mappedChannels));
|
|
16697
|
-
case
|
|
16811
|
+
case 16:
|
|
16698
16812
|
if (!channelId) {
|
|
16699
16813
|
activeChannel = channelList[0];
|
|
16700
16814
|
log.info(new Date().toISOString() + " [getChannels] no active channelId, setting first channel as active: " + ((_activeChannel2 = activeChannel) === null || _activeChannel2 === void 0 ? void 0 : _activeChannel2.id));
|
|
16701
16815
|
}
|
|
16702
16816
|
query.channelQuery = channelQuery;
|
|
16703
16817
|
if (!(activeChannel && getAutoSelectFitsChannel())) {
|
|
16704
|
-
_context2.n =
|
|
16818
|
+
_context2.n = 17;
|
|
16705
16819
|
break;
|
|
16706
16820
|
}
|
|
16707
16821
|
log.info(new Date().toISOString() + " [getChannels] auto-selecting channel: " + ((_activeChannel3 = activeChannel) === null || _activeChannel3 === void 0 ? void 0 : _activeChannel3.id));
|
|
16708
|
-
_context2.n = 16;
|
|
16709
|
-
return put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
16710
|
-
case 16:
|
|
16711
16822
|
_context2.n = 17;
|
|
16712
|
-
return put(
|
|
16823
|
+
return put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
16713
16824
|
case 17:
|
|
16825
|
+
_context2.n = 18;
|
|
16826
|
+
return put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
16827
|
+
case 18:
|
|
16714
16828
|
hiddenList = store.getState().ChannelReducer.hideChannelList;
|
|
16715
16829
|
log.info(new Date().toISOString() + " [getChannels] hiddenList state: " + hiddenList);
|
|
16716
16830
|
if (hiddenList) {
|
|
16717
|
-
_context2.n =
|
|
16831
|
+
_context2.n = 29;
|
|
16718
16832
|
break;
|
|
16719
16833
|
}
|
|
16720
16834
|
log.info(new Date().toISOString() + " [getChannels] starting all channels query (hiddenList is false)");
|
|
@@ -16729,36 +16843,36 @@ function getChannels(action) {
|
|
|
16729
16843
|
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery memberCount: " + (params === null || params === void 0 ? void 0 : params.memberCount));
|
|
16730
16844
|
}
|
|
16731
16845
|
allChannelsQueryBuilder.limit(50);
|
|
16732
|
-
_context2.n =
|
|
16846
|
+
_context2.n = 19;
|
|
16733
16847
|
return call(allChannelsQueryBuilder.build);
|
|
16734
|
-
case
|
|
16848
|
+
case 19:
|
|
16735
16849
|
allChannelsQuery = _context2.v;
|
|
16736
16850
|
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery built");
|
|
16737
16851
|
hasNext = true;
|
|
16738
16852
|
totalAllChannelsAdded = 0;
|
|
16739
16853
|
i = 0;
|
|
16740
|
-
case
|
|
16854
|
+
case 20:
|
|
16741
16855
|
if (!(i <= 4)) {
|
|
16742
|
-
_context2.n =
|
|
16856
|
+
_context2.n = 28;
|
|
16743
16857
|
break;
|
|
16744
16858
|
}
|
|
16745
16859
|
if (!hasNext) {
|
|
16746
|
-
_context2.n =
|
|
16860
|
+
_context2.n = 26;
|
|
16747
16861
|
break;
|
|
16748
16862
|
}
|
|
16749
|
-
_context2.p =
|
|
16863
|
+
_context2.p = 21;
|
|
16750
16864
|
_connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
16751
16865
|
if (!(_connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
16752
|
-
_context2.n =
|
|
16866
|
+
_context2.n = 22;
|
|
16753
16867
|
break;
|
|
16754
16868
|
}
|
|
16755
16869
|
log.warn(new Date().toISOString() + " [getChannels] connection not ready, aborting. Status: " + _connectionStatus);
|
|
16756
|
-
return _context2.a(3,
|
|
16757
|
-
case
|
|
16870
|
+
return _context2.a(3, 28);
|
|
16871
|
+
case 22:
|
|
16758
16872
|
log.info(new Date().toISOString() + " [getChannels] loading all channels page: " + (i + 1));
|
|
16759
|
-
_context2.n =
|
|
16873
|
+
_context2.n = 23;
|
|
16760
16874
|
return call(allChannelsQuery.loadNextPage);
|
|
16761
|
-
case
|
|
16875
|
+
case 23:
|
|
16762
16876
|
allChannelsData = _context2.v;
|
|
16763
16877
|
hasNext = allChannelsData.hasNext;
|
|
16764
16878
|
allChannelList = allChannelsData.channels;
|
|
@@ -16769,34 +16883,34 @@ function getChannels(action) {
|
|
|
16769
16883
|
addChannelsToAllChannels(allChannelList);
|
|
16770
16884
|
totalAllChannelsAdded += (allChannelList === null || allChannelList === void 0 ? void 0 : allChannelList.length) || 0;
|
|
16771
16885
|
log.info(new Date().toISOString() + " [getChannels] total all channels added so far: " + totalAllChannelsAdded);
|
|
16772
|
-
_context2.n =
|
|
16886
|
+
_context2.n = 25;
|
|
16773
16887
|
break;
|
|
16774
|
-
case
|
|
16775
|
-
_context2.p =
|
|
16888
|
+
case 24:
|
|
16889
|
+
_context2.p = 24;
|
|
16776
16890
|
_t3 = _context2.v;
|
|
16777
16891
|
log.error(_t3, "Error on get all channels page: " + (i + 1));
|
|
16778
|
-
return _context2.a(3,
|
|
16779
|
-
case 24:
|
|
16780
|
-
_context2.n = 26;
|
|
16781
|
-
break;
|
|
16892
|
+
return _context2.a(3, 28);
|
|
16782
16893
|
case 25:
|
|
16783
|
-
|
|
16894
|
+
_context2.n = 27;
|
|
16895
|
+
break;
|
|
16784
16896
|
case 26:
|
|
16897
|
+
log.info(new Date().toISOString() + " [getChannels] no more pages available, stopping at iteration: " + i);
|
|
16898
|
+
case 27:
|
|
16785
16899
|
i++;
|
|
16786
|
-
_context2.n =
|
|
16900
|
+
_context2.n = 20;
|
|
16787
16901
|
break;
|
|
16788
|
-
case
|
|
16902
|
+
case 28:
|
|
16789
16903
|
log.info(new Date().toISOString() + " [getChannels] all channels query completed, total channels added: " + totalAllChannelsAdded);
|
|
16790
|
-
_context2.n =
|
|
16904
|
+
_context2.n = 30;
|
|
16791
16905
|
break;
|
|
16792
|
-
case 28:
|
|
16793
|
-
log.info(new Date().toISOString() + " [getChannels] skipping all channels query (hiddenList is true)");
|
|
16794
16906
|
case 29:
|
|
16907
|
+
log.info(new Date().toISOString() + " [getChannels] skipping all channels query (hiddenList is true)");
|
|
16908
|
+
case 30:
|
|
16795
16909
|
log.info(new Date().toISOString() + " [getChannels] completed successfully. Final mapped channels count: " + (((_mappedChannels4 = mappedChannels) === null || _mappedChannels4 === void 0 ? void 0 : _mappedChannels4.length) || 0));
|
|
16796
|
-
_context2.n =
|
|
16910
|
+
_context2.n = 32;
|
|
16797
16911
|
break;
|
|
16798
|
-
case
|
|
16799
|
-
_context2.p =
|
|
16912
|
+
case 31:
|
|
16913
|
+
_context2.p = 31;
|
|
16800
16914
|
_t4 = _context2.v;
|
|
16801
16915
|
log.error(new Date().toISOString() + " [getChannels] error occurred: " + JSON.stringify(_t4), 'Error on get channels');
|
|
16802
16916
|
log.error(new Date().toISOString() + " [getChannels] error details: " + JSON.stringify({
|
|
@@ -16804,10 +16918,10 @@ function getChannels(action) {
|
|
|
16804
16918
|
code: _t4.code,
|
|
16805
16919
|
stack: _t4.stack
|
|
16806
16920
|
}));
|
|
16807
|
-
case
|
|
16921
|
+
case 32:
|
|
16808
16922
|
return _context2.a(2);
|
|
16809
16923
|
}
|
|
16810
|
-
}, _marked2$1, null, [[
|
|
16924
|
+
}, _marked2$1, null, [[21, 24], [1, 31]]);
|
|
16811
16925
|
}
|
|
16812
16926
|
function searchChannels(action) {
|
|
16813
16927
|
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;
|
|
@@ -17411,7 +17525,7 @@ function markMessagesRead(action) {
|
|
|
17411
17525
|
}, _marked9, null, [[2, 9]]);
|
|
17412
17526
|
}
|
|
17413
17527
|
function markVoiceMessageAsPlayed(action) {
|
|
17414
|
-
var payload, channelId, messageIds, channel, _t10;
|
|
17528
|
+
var payload, channelId, messageIds, channel, messageListMarker, _iterator6, _step6, messageId, updateParams, _t10;
|
|
17415
17529
|
return _regenerator().w(function (_context0) {
|
|
17416
17530
|
while (1) switch (_context0.p = _context0.n) {
|
|
17417
17531
|
case 0:
|
|
@@ -17429,25 +17543,54 @@ function markVoiceMessageAsPlayed(action) {
|
|
|
17429
17543
|
}
|
|
17430
17544
|
}
|
|
17431
17545
|
if (!channel) {
|
|
17432
|
-
_context0.n =
|
|
17546
|
+
_context0.n = 7;
|
|
17433
17547
|
break;
|
|
17434
17548
|
}
|
|
17435
17549
|
_context0.n = 3;
|
|
17436
17550
|
return call(channel.markVoiceMessagesAsPlayed, messageIds);
|
|
17437
17551
|
case 3:
|
|
17552
|
+
messageListMarker = _context0.v;
|
|
17553
|
+
_iterator6 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
17554
|
+
case 4:
|
|
17555
|
+
if ((_step6 = _iterator6()).done) {
|
|
17556
|
+
_context0.n = 7;
|
|
17557
|
+
break;
|
|
17558
|
+
}
|
|
17559
|
+
messageId = _step6.value;
|
|
17560
|
+
updateParams = {
|
|
17561
|
+
deliveryStatus: MESSAGE_DELIVERY_STATUS.PLAYED,
|
|
17562
|
+
userMarkers: [{
|
|
17563
|
+
user: messageListMarker.user,
|
|
17564
|
+
createdAt: messageListMarker.createdAt,
|
|
17565
|
+
messageId: messageId,
|
|
17566
|
+
name: MESSAGE_DELIVERY_STATUS.READ
|
|
17567
|
+
}]
|
|
17568
|
+
};
|
|
17438
17569
|
_context0.n = 5;
|
|
17570
|
+
return put(updateMessageAC(messageId, updateParams));
|
|
17571
|
+
case 5:
|
|
17572
|
+
updateMessageOnMap(channel.id, {
|
|
17573
|
+
messageId: messageId,
|
|
17574
|
+
params: updateParams
|
|
17575
|
+
});
|
|
17576
|
+
updateMessageOnAllMessages(messageId, updateParams);
|
|
17577
|
+
case 6:
|
|
17578
|
+
_context0.n = 4;
|
|
17439
17579
|
break;
|
|
17440
|
-
case
|
|
17441
|
-
_context0.
|
|
17580
|
+
case 7:
|
|
17581
|
+
_context0.n = 9;
|
|
17582
|
+
break;
|
|
17583
|
+
case 8:
|
|
17584
|
+
_context0.p = 8;
|
|
17442
17585
|
_t10 = _context0.v;
|
|
17443
17586
|
log.error(_t10, 'Error on mark voice messages read');
|
|
17444
|
-
case
|
|
17587
|
+
case 9:
|
|
17445
17588
|
return _context0.a(2);
|
|
17446
17589
|
}
|
|
17447
|
-
}, _marked0, null, [[1,
|
|
17590
|
+
}, _marked0, null, [[1, 8]]);
|
|
17448
17591
|
}
|
|
17449
17592
|
function markMessagesDelivered(action) {
|
|
17450
|
-
var payload, channelId, messageIds, channel, _t11;
|
|
17593
|
+
var payload, channelId, messageIds, channel, messageListMarker, _iterator7, _step7, messageId, updateParams, _t11;
|
|
17451
17594
|
return _regenerator().w(function (_context1) {
|
|
17452
17595
|
while (1) switch (_context1.p = _context1.n) {
|
|
17453
17596
|
case 0:
|
|
@@ -17465,23 +17608,52 @@ function markMessagesDelivered(action) {
|
|
|
17465
17608
|
}
|
|
17466
17609
|
}
|
|
17467
17610
|
if (!channel) {
|
|
17468
|
-
_context1.n =
|
|
17611
|
+
_context1.n = 7;
|
|
17469
17612
|
break;
|
|
17470
17613
|
}
|
|
17471
17614
|
log.info('send delivered marker ', messageIds);
|
|
17472
17615
|
_context1.n = 3;
|
|
17473
17616
|
return call(channel.markMessagesAsReceived, messageIds);
|
|
17474
17617
|
case 3:
|
|
17618
|
+
messageListMarker = _context1.v;
|
|
17619
|
+
_iterator7 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
17620
|
+
case 4:
|
|
17621
|
+
if ((_step7 = _iterator7()).done) {
|
|
17622
|
+
_context1.n = 7;
|
|
17623
|
+
break;
|
|
17624
|
+
}
|
|
17625
|
+
messageId = _step7.value;
|
|
17626
|
+
updateParams = {
|
|
17627
|
+
deliveryStatus: MESSAGE_DELIVERY_STATUS.DELIVERED,
|
|
17628
|
+
userMarkers: [{
|
|
17629
|
+
user: messageListMarker.user,
|
|
17630
|
+
createdAt: messageListMarker.createdAt,
|
|
17631
|
+
messageId: messageId,
|
|
17632
|
+
name: MESSAGE_DELIVERY_STATUS.DELIVERED
|
|
17633
|
+
}]
|
|
17634
|
+
};
|
|
17475
17635
|
_context1.n = 5;
|
|
17636
|
+
return put(updateMessageAC(messageId, updateParams));
|
|
17637
|
+
case 5:
|
|
17638
|
+
updateMessageOnMap(channel.id, {
|
|
17639
|
+
messageId: messageId,
|
|
17640
|
+
params: updateParams
|
|
17641
|
+
});
|
|
17642
|
+
updateMessageOnAllMessages(messageId, updateParams);
|
|
17643
|
+
case 6:
|
|
17644
|
+
_context1.n = 4;
|
|
17476
17645
|
break;
|
|
17477
|
-
case
|
|
17478
|
-
_context1.
|
|
17646
|
+
case 7:
|
|
17647
|
+
_context1.n = 9;
|
|
17648
|
+
break;
|
|
17649
|
+
case 8:
|
|
17650
|
+
_context1.p = 8;
|
|
17479
17651
|
_t11 = _context1.v;
|
|
17480
17652
|
log.error(_t11, 'Error on mark messages delivered');
|
|
17481
|
-
case
|
|
17653
|
+
case 9:
|
|
17482
17654
|
return _context1.a(2);
|
|
17483
17655
|
}
|
|
17484
|
-
}, _marked1, null, [[1,
|
|
17656
|
+
}, _marked1, null, [[1, 8]]);
|
|
17485
17657
|
}
|
|
17486
17658
|
function switchChannel(action) {
|
|
17487
17659
|
var payload, channel, updateActiveChannel, channelToSwitch, existingChannel, addChannel, _SceytChatClient5, fetchedChannel, channelFromMap, currentActiveChannel, _t12;
|
|
@@ -17878,50 +18050,52 @@ function leaveChannel(action) {
|
|
|
17878
18050
|
}
|
|
17879
18051
|
}, _marked18, null, [[0, 6]]);
|
|
17880
18052
|
}
|
|
17881
|
-
function
|
|
17882
|
-
var
|
|
18053
|
+
function deletePendingDeleteChannels() {
|
|
18054
|
+
var pendingDeleteChannels, _iterator8, _step8, channel, resendableError, _t20;
|
|
17883
18055
|
return _regenerator().w(function (_context19) {
|
|
17884
18056
|
while (1) switch (_context19.p = _context19.n) {
|
|
17885
18057
|
case 0:
|
|
17886
|
-
|
|
17887
|
-
|
|
17888
|
-
channelId = payload.channelId;
|
|
17889
|
-
_context19.n = 1;
|
|
17890
|
-
return call(getChannelFromMap, channelId);
|
|
18058
|
+
pendingDeleteChannels = getPendingDeleteChannels();
|
|
18059
|
+
_iterator8 = _createForOfIteratorHelperLoose(pendingDeleteChannels);
|
|
17891
18060
|
case 1:
|
|
17892
|
-
|
|
17893
|
-
|
|
17894
|
-
channel = getChannelFromAllChannels(channelId);
|
|
17895
|
-
}
|
|
17896
|
-
if (!channel) {
|
|
17897
|
-
_context19.n = 5;
|
|
18061
|
+
if ((_step8 = _iterator8()).done) {
|
|
18062
|
+
_context19.n = 9;
|
|
17898
18063
|
break;
|
|
17899
18064
|
}
|
|
17900
|
-
|
|
17901
|
-
|
|
17902
|
-
case 2:
|
|
18065
|
+
channel = _step8.value;
|
|
18066
|
+
_context19.p = 2;
|
|
17903
18067
|
_context19.n = 3;
|
|
17904
|
-
return
|
|
18068
|
+
return call(channel["delete"]);
|
|
17905
18069
|
case 3:
|
|
17906
18070
|
_context19.n = 4;
|
|
17907
|
-
return put(
|
|
18071
|
+
return put(setChannelToRemoveAC(channel));
|
|
17908
18072
|
case 4:
|
|
17909
18073
|
_context19.n = 5;
|
|
17910
|
-
return put(
|
|
18074
|
+
return put(removeChannelAC(channel.id));
|
|
17911
18075
|
case 5:
|
|
17912
|
-
_context19.n =
|
|
17913
|
-
|
|
18076
|
+
_context19.n = 6;
|
|
18077
|
+
return put(removeChannelCachesAC(channel.id));
|
|
17914
18078
|
case 6:
|
|
17915
|
-
|
|
17916
|
-
|
|
17917
|
-
|
|
18079
|
+
removePendingDeleteChannel(channel.id);
|
|
18080
|
+
_context19.n = 8;
|
|
18081
|
+
break;
|
|
17918
18082
|
case 7:
|
|
18083
|
+
_context19.p = 7;
|
|
18084
|
+
_t20 = _context19.v;
|
|
18085
|
+
resendableError = isResendableError(_t20 === null || _t20 === void 0 ? void 0 : _t20.type);
|
|
18086
|
+
if (!resendableError) {
|
|
18087
|
+
removePendingDeleteChannel(channel.id);
|
|
18088
|
+
}
|
|
18089
|
+
case 8:
|
|
18090
|
+
_context19.n = 1;
|
|
18091
|
+
break;
|
|
18092
|
+
case 9:
|
|
17919
18093
|
return _context19.a(2);
|
|
17920
18094
|
}
|
|
17921
|
-
}, _marked19, null, [[
|
|
18095
|
+
}, _marked19, null, [[2, 7]]);
|
|
17922
18096
|
}
|
|
17923
|
-
function
|
|
17924
|
-
var payload, channelId, channel, _t21;
|
|
18097
|
+
function deleteChannel(action) {
|
|
18098
|
+
var payload, channelId, channel, activeChannelId, lastChannel, _t21;
|
|
17925
18099
|
return _regenerator().w(function (_context20) {
|
|
17926
18100
|
while (1) switch (_context20.p = _context20.n) {
|
|
17927
18101
|
case 0:
|
|
@@ -17935,39 +18109,63 @@ function blockChannel(action) {
|
|
|
17935
18109
|
if (!channel) {
|
|
17936
18110
|
channel = getChannelFromAllChannels(channelId);
|
|
17937
18111
|
}
|
|
17938
|
-
if (!
|
|
17939
|
-
_context20.n =
|
|
18112
|
+
if (!(store.getState().UserReducer.connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
18113
|
+
_context20.n = 5;
|
|
17940
18114
|
break;
|
|
17941
18115
|
}
|
|
18116
|
+
setPendingDeleteChannel(channel);
|
|
17942
18117
|
_context20.n = 2;
|
|
17943
|
-
return call(
|
|
18118
|
+
return call(getActiveChannelId);
|
|
17944
18119
|
case 2:
|
|
18120
|
+
activeChannelId = _context20.v;
|
|
18121
|
+
if (!(activeChannelId === channelId)) {
|
|
18122
|
+
_context20.n = 4;
|
|
18123
|
+
break;
|
|
18124
|
+
}
|
|
17945
18125
|
_context20.n = 3;
|
|
17946
|
-
return
|
|
18126
|
+
return call(getLastChannelFromMap, true);
|
|
17947
18127
|
case 3:
|
|
18128
|
+
lastChannel = _context20.v;
|
|
17948
18129
|
_context20.n = 4;
|
|
17949
|
-
return put(
|
|
18130
|
+
return put(switchChannelActionAC(lastChannel || null));
|
|
17950
18131
|
case 4:
|
|
17951
|
-
_context20.
|
|
17952
|
-
break;
|
|
18132
|
+
return _context20.a(2);
|
|
17953
18133
|
case 5:
|
|
17954
|
-
|
|
17955
|
-
|
|
17956
|
-
|
|
18134
|
+
if (!channel) {
|
|
18135
|
+
_context20.n = 9;
|
|
18136
|
+
break;
|
|
18137
|
+
}
|
|
18138
|
+
_context20.n = 6;
|
|
18139
|
+
return call(channel["delete"]);
|
|
17957
18140
|
case 6:
|
|
18141
|
+
_context20.n = 7;
|
|
18142
|
+
return put(setChannelToRemoveAC(channel));
|
|
18143
|
+
case 7:
|
|
18144
|
+
_context20.n = 8;
|
|
18145
|
+
return put(removeChannelAC(channelId));
|
|
18146
|
+
case 8:
|
|
18147
|
+
_context20.n = 9;
|
|
18148
|
+
return put(removeChannelCachesAC(channelId));
|
|
18149
|
+
case 9:
|
|
18150
|
+
_context20.n = 11;
|
|
18151
|
+
break;
|
|
18152
|
+
case 10:
|
|
18153
|
+
_context20.p = 10;
|
|
18154
|
+
_t21 = _context20.v;
|
|
18155
|
+
log.error('ERROR in delete channel', _t21);
|
|
18156
|
+
case 11:
|
|
17958
18157
|
return _context20.a(2);
|
|
17959
18158
|
}
|
|
17960
|
-
}, _marked20, null, [[0,
|
|
18159
|
+
}, _marked20, null, [[0, 10]]);
|
|
17961
18160
|
}
|
|
17962
|
-
function
|
|
17963
|
-
var payload, channelId,
|
|
18161
|
+
function blockChannel(action) {
|
|
18162
|
+
var payload, channelId, channel, _t22;
|
|
17964
18163
|
return _regenerator().w(function (_context21) {
|
|
17965
18164
|
while (1) switch (_context21.p = _context21.n) {
|
|
17966
18165
|
case 0:
|
|
17967
18166
|
_context21.p = 0;
|
|
17968
18167
|
payload = action.payload;
|
|
17969
|
-
channelId = payload.channelId
|
|
17970
|
-
_SceytChatClient6 = getClient();
|
|
18168
|
+
channelId = payload.channelId;
|
|
17971
18169
|
_context21.n = 1;
|
|
17972
18170
|
return call(getChannelFromMap, channelId);
|
|
17973
18171
|
case 1:
|
|
@@ -17975,6 +18173,46 @@ function updateChannel(action) {
|
|
|
17975
18173
|
if (!channel) {
|
|
17976
18174
|
channel = getChannelFromAllChannels(channelId);
|
|
17977
18175
|
}
|
|
18176
|
+
if (!channel) {
|
|
18177
|
+
_context21.n = 4;
|
|
18178
|
+
break;
|
|
18179
|
+
}
|
|
18180
|
+
_context21.n = 2;
|
|
18181
|
+
return call(channel.block);
|
|
18182
|
+
case 2:
|
|
18183
|
+
_context21.n = 3;
|
|
18184
|
+
return put(removeChannelAC(channelId));
|
|
18185
|
+
case 3:
|
|
18186
|
+
_context21.n = 4;
|
|
18187
|
+
return put(removeChannelCachesAC(channelId));
|
|
18188
|
+
case 4:
|
|
18189
|
+
_context21.n = 6;
|
|
18190
|
+
break;
|
|
18191
|
+
case 5:
|
|
18192
|
+
_context21.p = 5;
|
|
18193
|
+
_t22 = _context21.v;
|
|
18194
|
+
log.error('ERROR in block channel - ', _t22.message);
|
|
18195
|
+
case 6:
|
|
18196
|
+
return _context21.a(2);
|
|
18197
|
+
}
|
|
18198
|
+
}, _marked21, null, [[0, 5]]);
|
|
18199
|
+
}
|
|
18200
|
+
function updateChannel(action) {
|
|
18201
|
+
var payload, channelId, config, _SceytChatClient6, channel, paramsToUpdate, fileToUpload, _yield$call5, subject, avatarUrl, metadata, onUpdateChannel, _channel3, _channel4, _channel5, fields, updatedChannel, _t23;
|
|
18202
|
+
return _regenerator().w(function (_context22) {
|
|
18203
|
+
while (1) switch (_context22.p = _context22.n) {
|
|
18204
|
+
case 0:
|
|
18205
|
+
_context22.p = 0;
|
|
18206
|
+
payload = action.payload;
|
|
18207
|
+
channelId = payload.channelId, config = payload.config;
|
|
18208
|
+
_SceytChatClient6 = getClient();
|
|
18209
|
+
_context22.n = 1;
|
|
18210
|
+
return call(getChannelFromMap, channelId);
|
|
18211
|
+
case 1:
|
|
18212
|
+
channel = _context22.v;
|
|
18213
|
+
if (!channel) {
|
|
18214
|
+
channel = getChannelFromAllChannels(channelId);
|
|
18215
|
+
}
|
|
17978
18216
|
paramsToUpdate = {
|
|
17979
18217
|
uri: channel.uri,
|
|
17980
18218
|
subject: channel.subject,
|
|
@@ -17982,7 +18220,7 @@ function updateChannel(action) {
|
|
|
17982
18220
|
avatarUrl: channel.avatarUrl
|
|
17983
18221
|
};
|
|
17984
18222
|
if (!config.avatar) {
|
|
17985
|
-
|
|
18223
|
+
_context22.n = 3;
|
|
17986
18224
|
break;
|
|
17987
18225
|
}
|
|
17988
18226
|
fileToUpload = {
|
|
@@ -17991,10 +18229,10 @@ function updateChannel(action) {
|
|
|
17991
18229
|
log.info('upload percent - ', progressPercent);
|
|
17992
18230
|
}
|
|
17993
18231
|
};
|
|
17994
|
-
|
|
18232
|
+
_context22.n = 2;
|
|
17995
18233
|
return call(_SceytChatClient6.uploadFile, fileToUpload);
|
|
17996
18234
|
case 2:
|
|
17997
|
-
paramsToUpdate.avatarUrl =
|
|
18235
|
+
paramsToUpdate.avatarUrl = _context22.v;
|
|
17998
18236
|
case 3:
|
|
17999
18237
|
if (config.subject) {
|
|
18000
18238
|
paramsToUpdate.subject = config.subject;
|
|
@@ -18005,14 +18243,14 @@ function updateChannel(action) {
|
|
|
18005
18243
|
if (config.avatarUrl === '') {
|
|
18006
18244
|
paramsToUpdate.avatarUrl = '';
|
|
18007
18245
|
}
|
|
18008
|
-
|
|
18246
|
+
_context22.n = 4;
|
|
18009
18247
|
return call(channel.update, paramsToUpdate);
|
|
18010
18248
|
case 4:
|
|
18011
|
-
_yield$call5 =
|
|
18249
|
+
_yield$call5 = _context22.v;
|
|
18012
18250
|
subject = _yield$call5.subject;
|
|
18013
18251
|
avatarUrl = _yield$call5.avatarUrl;
|
|
18014
18252
|
metadata = _yield$call5.metadata;
|
|
18015
|
-
|
|
18253
|
+
_context22.n = 5;
|
|
18016
18254
|
return put(updateChannelDataAC(channelId, {
|
|
18017
18255
|
subject: subject,
|
|
18018
18256
|
avatarUrl: avatarUrl,
|
|
@@ -18026,7 +18264,7 @@ function updateChannel(action) {
|
|
|
18026
18264
|
});
|
|
18027
18265
|
onUpdateChannel = getOnUpdateChannel();
|
|
18028
18266
|
if (!onUpdateChannel) {
|
|
18029
|
-
|
|
18267
|
+
_context22.n = 7;
|
|
18030
18268
|
break;
|
|
18031
18269
|
}
|
|
18032
18270
|
fields = [];
|
|
@@ -18039,35 +18277,35 @@ function updateChannel(action) {
|
|
|
18039
18277
|
if (JSON.stringify((_channel5 = channel) === null || _channel5 === void 0 ? void 0 : _channel5.metadata) !== metadata) {
|
|
18040
18278
|
fields.push('metadata');
|
|
18041
18279
|
}
|
|
18042
|
-
|
|
18280
|
+
_context22.n = 6;
|
|
18043
18281
|
return call(getChannelFromMap, channelId);
|
|
18044
18282
|
case 6:
|
|
18045
|
-
updatedChannel =
|
|
18283
|
+
updatedChannel = _context22.v;
|
|
18046
18284
|
onUpdateChannel(updatedChannel, fields);
|
|
18047
18285
|
case 7:
|
|
18048
|
-
|
|
18286
|
+
_context22.n = 9;
|
|
18049
18287
|
break;
|
|
18050
18288
|
case 8:
|
|
18051
|
-
|
|
18052
|
-
|
|
18053
|
-
log.error('ERROR in update channel',
|
|
18289
|
+
_context22.p = 8;
|
|
18290
|
+
_t23 = _context22.v;
|
|
18291
|
+
log.error('ERROR in update channel', _t23.message);
|
|
18054
18292
|
case 9:
|
|
18055
|
-
return
|
|
18293
|
+
return _context22.a(2);
|
|
18056
18294
|
}
|
|
18057
|
-
},
|
|
18295
|
+
}, _marked22, null, [[0, 8]]);
|
|
18058
18296
|
}
|
|
18059
18297
|
function checkUsersStatus() {
|
|
18060
|
-
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData,
|
|
18061
|
-
return _regenerator().w(function (
|
|
18062
|
-
while (1) switch (
|
|
18298
|
+
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData, _t24;
|
|
18299
|
+
return _regenerator().w(function (_context23) {
|
|
18300
|
+
while (1) switch (_context23.p = _context23.n) {
|
|
18063
18301
|
case 0:
|
|
18064
|
-
|
|
18302
|
+
_context23.p = 0;
|
|
18065
18303
|
_SceytChatClient7 = getClient();
|
|
18066
18304
|
usersForUpdate = Object.keys(usersMap);
|
|
18067
|
-
|
|
18305
|
+
_context23.n = 1;
|
|
18068
18306
|
return call(_SceytChatClient7.getUsers, usersForUpdate);
|
|
18069
18307
|
case 1:
|
|
18070
|
-
updatedUsers =
|
|
18308
|
+
updatedUsers = _context23.v;
|
|
18071
18309
|
usersToUpdateMap = {};
|
|
18072
18310
|
update = false;
|
|
18073
18311
|
updatedUsers.forEach(function (updatedUser) {
|
|
@@ -18079,149 +18317,149 @@ function checkUsersStatus() {
|
|
|
18079
18317
|
}
|
|
18080
18318
|
});
|
|
18081
18319
|
if (!update) {
|
|
18082
|
-
|
|
18320
|
+
_context23.n = 4;
|
|
18083
18321
|
break;
|
|
18084
18322
|
}
|
|
18085
18323
|
updateData = JSON.parse(JSON.stringify(usersToUpdateMap));
|
|
18086
|
-
|
|
18324
|
+
_context23.n = 2;
|
|
18087
18325
|
return put(updateMembersPresenceAC(updateData));
|
|
18088
18326
|
case 2:
|
|
18089
|
-
|
|
18327
|
+
_context23.n = 3;
|
|
18090
18328
|
return put(updateUserStatusOnMapAC(updateData));
|
|
18091
18329
|
case 3:
|
|
18092
|
-
|
|
18330
|
+
_context23.n = 4;
|
|
18093
18331
|
return put(updateUserStatusOnChannelAC(updateData));
|
|
18094
18332
|
case 4:
|
|
18095
|
-
|
|
18333
|
+
_context23.n = 6;
|
|
18096
18334
|
break;
|
|
18097
18335
|
case 5:
|
|
18098
|
-
|
|
18099
|
-
|
|
18100
|
-
log.error('ERROR in check user status : ',
|
|
18336
|
+
_context23.p = 5;
|
|
18337
|
+
_t24 = _context23.v;
|
|
18338
|
+
log.error('ERROR in check user status : ', _t24.message);
|
|
18101
18339
|
case 6:
|
|
18102
|
-
return
|
|
18340
|
+
return _context23.a(2);
|
|
18103
18341
|
}
|
|
18104
|
-
},
|
|
18342
|
+
}, _marked23, null, [[0, 5]]);
|
|
18105
18343
|
}
|
|
18106
18344
|
function sendTyping(action) {
|
|
18107
|
-
var state, activeChannelId, channel,
|
|
18108
|
-
return _regenerator().w(function (
|
|
18109
|
-
while (1) switch (
|
|
18345
|
+
var state, activeChannelId, channel, _t25;
|
|
18346
|
+
return _regenerator().w(function (_context24) {
|
|
18347
|
+
while (1) switch (_context24.p = _context24.n) {
|
|
18110
18348
|
case 0:
|
|
18111
18349
|
state = action.payload.state;
|
|
18112
|
-
|
|
18350
|
+
_context24.n = 1;
|
|
18113
18351
|
return call(getActiveChannelId);
|
|
18114
18352
|
case 1:
|
|
18115
|
-
activeChannelId =
|
|
18116
|
-
|
|
18353
|
+
activeChannelId = _context24.v;
|
|
18354
|
+
_context24.n = 2;
|
|
18117
18355
|
return call(getChannelFromMap, activeChannelId);
|
|
18118
18356
|
case 2:
|
|
18119
|
-
channel =
|
|
18120
|
-
|
|
18357
|
+
channel = _context24.v;
|
|
18358
|
+
_context24.p = 3;
|
|
18121
18359
|
if (!channel) {
|
|
18122
|
-
|
|
18360
|
+
_context24.n = 6;
|
|
18123
18361
|
break;
|
|
18124
18362
|
}
|
|
18125
18363
|
if (!state) {
|
|
18126
|
-
|
|
18364
|
+
_context24.n = 5;
|
|
18127
18365
|
break;
|
|
18128
18366
|
}
|
|
18129
|
-
|
|
18367
|
+
_context24.n = 4;
|
|
18130
18368
|
return call(channel.startTyping);
|
|
18131
18369
|
case 4:
|
|
18132
|
-
|
|
18370
|
+
_context24.n = 6;
|
|
18133
18371
|
break;
|
|
18134
18372
|
case 5:
|
|
18135
|
-
|
|
18373
|
+
_context24.n = 6;
|
|
18136
18374
|
return call(channel.stopTyping);
|
|
18137
18375
|
case 6:
|
|
18138
|
-
|
|
18376
|
+
_context24.n = 8;
|
|
18139
18377
|
break;
|
|
18140
18378
|
case 7:
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
log.error('ERROR in send typing',
|
|
18379
|
+
_context24.p = 7;
|
|
18380
|
+
_t25 = _context24.v;
|
|
18381
|
+
log.error('ERROR in send typing', _t25);
|
|
18144
18382
|
case 8:
|
|
18145
|
-
return
|
|
18383
|
+
return _context24.a(2);
|
|
18146
18384
|
}
|
|
18147
|
-
},
|
|
18385
|
+
}, _marked24, null, [[3, 7]]);
|
|
18148
18386
|
}
|
|
18149
18387
|
function sendRecording(action) {
|
|
18150
|
-
var _action$payload, state, channelId, channel,
|
|
18151
|
-
return _regenerator().w(function (
|
|
18152
|
-
while (1) switch (
|
|
18388
|
+
var _action$payload, state, channelId, channel, _t26;
|
|
18389
|
+
return _regenerator().w(function (_context25) {
|
|
18390
|
+
while (1) switch (_context25.p = _context25.n) {
|
|
18153
18391
|
case 0:
|
|
18154
18392
|
_action$payload = action.payload, state = _action$payload.state, channelId = _action$payload.channelId;
|
|
18155
|
-
|
|
18393
|
+
_context25.n = 1;
|
|
18156
18394
|
return call(getChannelFromMap, channelId);
|
|
18157
18395
|
case 1:
|
|
18158
|
-
channel =
|
|
18159
|
-
|
|
18396
|
+
channel = _context25.v;
|
|
18397
|
+
_context25.p = 2;
|
|
18160
18398
|
if (!channel) {
|
|
18161
|
-
|
|
18399
|
+
_context25.n = 5;
|
|
18162
18400
|
break;
|
|
18163
18401
|
}
|
|
18164
18402
|
if (!state) {
|
|
18165
|
-
|
|
18403
|
+
_context25.n = 4;
|
|
18166
18404
|
break;
|
|
18167
18405
|
}
|
|
18168
|
-
|
|
18406
|
+
_context25.n = 3;
|
|
18169
18407
|
return call(channel.startRecording);
|
|
18170
18408
|
case 3:
|
|
18171
|
-
|
|
18409
|
+
_context25.n = 5;
|
|
18172
18410
|
break;
|
|
18173
18411
|
case 4:
|
|
18174
|
-
|
|
18412
|
+
_context25.n = 5;
|
|
18175
18413
|
return call(channel.stopRecording);
|
|
18176
18414
|
case 5:
|
|
18177
|
-
|
|
18415
|
+
_context25.n = 7;
|
|
18178
18416
|
break;
|
|
18179
18417
|
case 6:
|
|
18180
|
-
|
|
18181
|
-
|
|
18182
|
-
log.error('ERROR in send recording',
|
|
18418
|
+
_context25.p = 6;
|
|
18419
|
+
_t26 = _context25.v;
|
|
18420
|
+
log.error('ERROR in send recording', _t26);
|
|
18183
18421
|
case 7:
|
|
18184
|
-
return
|
|
18422
|
+
return _context25.a(2);
|
|
18185
18423
|
}
|
|
18186
|
-
},
|
|
18424
|
+
}, _marked25, null, [[2, 6]]);
|
|
18187
18425
|
}
|
|
18188
18426
|
function clearHistory(action) {
|
|
18189
|
-
var payload, channelId, channel, activeChannelId, groupName,
|
|
18190
|
-
return _regenerator().w(function (
|
|
18191
|
-
while (1) switch (
|
|
18427
|
+
var payload, channelId, channel, activeChannelId, groupName, _t27;
|
|
18428
|
+
return _regenerator().w(function (_context26) {
|
|
18429
|
+
while (1) switch (_context26.p = _context26.n) {
|
|
18192
18430
|
case 0:
|
|
18193
|
-
|
|
18431
|
+
_context26.p = 0;
|
|
18194
18432
|
payload = action.payload;
|
|
18195
18433
|
channelId = payload.channelId;
|
|
18196
|
-
|
|
18434
|
+
_context26.n = 1;
|
|
18197
18435
|
return call(getChannelFromMap, channelId);
|
|
18198
18436
|
case 1:
|
|
18199
|
-
channel =
|
|
18437
|
+
channel = _context26.v;
|
|
18200
18438
|
if (!channel) {
|
|
18201
18439
|
channel = getChannelFromAllChannels(channelId);
|
|
18202
18440
|
}
|
|
18203
|
-
|
|
18441
|
+
_context26.n = 2;
|
|
18204
18442
|
return call(getActiveChannelId);
|
|
18205
18443
|
case 2:
|
|
18206
|
-
activeChannelId =
|
|
18444
|
+
activeChannelId = _context26.v;
|
|
18207
18445
|
if (!channel) {
|
|
18208
|
-
|
|
18446
|
+
_context26.n = 7;
|
|
18209
18447
|
break;
|
|
18210
18448
|
}
|
|
18211
|
-
|
|
18449
|
+
_context26.n = 3;
|
|
18212
18450
|
return call(channel.deleteAllMessages);
|
|
18213
18451
|
case 3:
|
|
18214
|
-
|
|
18452
|
+
_context26.n = 4;
|
|
18215
18453
|
return put(clearMessagesAC());
|
|
18216
18454
|
case 4:
|
|
18217
18455
|
removeMessagesFromMap(channelId);
|
|
18218
18456
|
if (channelId === activeChannelId) {
|
|
18219
18457
|
removeAllMessages();
|
|
18220
18458
|
}
|
|
18221
|
-
|
|
18459
|
+
_context26.n = 5;
|
|
18222
18460
|
return put(clearSelectedMessagesAC());
|
|
18223
18461
|
case 5:
|
|
18224
|
-
|
|
18462
|
+
_context26.n = 6;
|
|
18225
18463
|
return put(updateChannelDataAC(channel.id, {
|
|
18226
18464
|
lastMessage: null,
|
|
18227
18465
|
newMessageCount: 0,
|
|
@@ -18234,64 +18472,64 @@ function clearHistory(action) {
|
|
|
18234
18472
|
newMentionCount: 0
|
|
18235
18473
|
});
|
|
18236
18474
|
groupName = getChannelGroupName(channel);
|
|
18237
|
-
|
|
18475
|
+
_context26.n = 7;
|
|
18238
18476
|
return put(updateSearchedChannelDataAC(channel.id, {
|
|
18239
18477
|
lastMessage: null,
|
|
18240
18478
|
newMessageCount: 0,
|
|
18241
18479
|
newMentionCount: 0
|
|
18242
18480
|
}, groupName));
|
|
18243
18481
|
case 7:
|
|
18244
|
-
|
|
18482
|
+
_context26.n = 9;
|
|
18245
18483
|
break;
|
|
18246
18484
|
case 8:
|
|
18247
|
-
|
|
18248
|
-
|
|
18249
|
-
log.error('ERROR in clear history',
|
|
18485
|
+
_context26.p = 8;
|
|
18486
|
+
_t27 = _context26.v;
|
|
18487
|
+
log.error('ERROR in clear history', _t27);
|
|
18250
18488
|
case 9:
|
|
18251
|
-
return
|
|
18489
|
+
return _context26.a(2);
|
|
18252
18490
|
}
|
|
18253
|
-
},
|
|
18491
|
+
}, _marked26, null, [[0, 8]]);
|
|
18254
18492
|
}
|
|
18255
18493
|
function deleteAllMessages(action) {
|
|
18256
|
-
var payload, channelId, channel, activeChannelId, groupName,
|
|
18257
|
-
return _regenerator().w(function (
|
|
18258
|
-
while (1) switch (
|
|
18494
|
+
var payload, channelId, channel, activeChannelId, groupName, _t28;
|
|
18495
|
+
return _regenerator().w(function (_context27) {
|
|
18496
|
+
while (1) switch (_context27.p = _context27.n) {
|
|
18259
18497
|
case 0:
|
|
18260
|
-
|
|
18498
|
+
_context27.p = 0;
|
|
18261
18499
|
payload = action.payload;
|
|
18262
18500
|
channelId = payload.channelId;
|
|
18263
|
-
|
|
18501
|
+
_context27.n = 1;
|
|
18264
18502
|
return call(getChannelFromMap, channelId);
|
|
18265
18503
|
case 1:
|
|
18266
|
-
channel =
|
|
18504
|
+
channel = _context27.v;
|
|
18267
18505
|
if (!channel) {
|
|
18268
18506
|
channel = getChannelFromAllChannels(channelId);
|
|
18269
18507
|
}
|
|
18270
|
-
|
|
18508
|
+
_context27.n = 2;
|
|
18271
18509
|
return call(getActiveChannelId);
|
|
18272
18510
|
case 2:
|
|
18273
|
-
activeChannelId =
|
|
18511
|
+
activeChannelId = _context27.v;
|
|
18274
18512
|
if (!channel) {
|
|
18275
|
-
|
|
18513
|
+
_context27.n = 8;
|
|
18276
18514
|
break;
|
|
18277
18515
|
}
|
|
18278
|
-
|
|
18516
|
+
_context27.n = 3;
|
|
18279
18517
|
return call(channel.deleteAllMessages, true);
|
|
18280
18518
|
case 3:
|
|
18281
18519
|
removeMessagesFromMap(channelId);
|
|
18282
18520
|
if (!(channelId === activeChannelId)) {
|
|
18283
|
-
|
|
18521
|
+
_context27.n = 5;
|
|
18284
18522
|
break;
|
|
18285
18523
|
}
|
|
18286
|
-
|
|
18524
|
+
_context27.n = 4;
|
|
18287
18525
|
return put(clearMessagesAC());
|
|
18288
18526
|
case 4:
|
|
18289
18527
|
removeAllMessages();
|
|
18290
18528
|
case 5:
|
|
18291
|
-
|
|
18529
|
+
_context27.n = 6;
|
|
18292
18530
|
return put(clearSelectedMessagesAC());
|
|
18293
18531
|
case 6:
|
|
18294
|
-
|
|
18532
|
+
_context27.n = 7;
|
|
18295
18533
|
return put(updateChannelDataAC(channel.id, {
|
|
18296
18534
|
lastMessage: null,
|
|
18297
18535
|
newMessageCount: 0,
|
|
@@ -18304,230 +18542,230 @@ function deleteAllMessages(action) {
|
|
|
18304
18542
|
newMentionCount: 0
|
|
18305
18543
|
});
|
|
18306
18544
|
groupName = getChannelGroupName(channel);
|
|
18307
|
-
|
|
18545
|
+
_context27.n = 8;
|
|
18308
18546
|
return put(updateSearchedChannelDataAC(channel.id, {
|
|
18309
18547
|
lastMessage: null,
|
|
18310
18548
|
newMessageCount: 0,
|
|
18311
18549
|
newMentionCount: 0
|
|
18312
18550
|
}, groupName));
|
|
18313
18551
|
case 8:
|
|
18314
|
-
|
|
18552
|
+
_context27.n = 10;
|
|
18315
18553
|
break;
|
|
18316
18554
|
case 9:
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
log.error('ERROR in clear history',
|
|
18555
|
+
_context27.p = 9;
|
|
18556
|
+
_t28 = _context27.v;
|
|
18557
|
+
log.error('ERROR in clear history', _t28);
|
|
18320
18558
|
case 10:
|
|
18321
|
-
return
|
|
18559
|
+
return _context27.a(2);
|
|
18322
18560
|
}
|
|
18323
|
-
},
|
|
18561
|
+
}, _marked27, null, [[0, 9]]);
|
|
18324
18562
|
}
|
|
18325
18563
|
function joinChannel(action) {
|
|
18326
|
-
var payload, channelId, _SceytChatClient8, channel, joinedChannel,
|
|
18327
|
-
return _regenerator().w(function (
|
|
18328
|
-
while (1) switch (
|
|
18564
|
+
var payload, channelId, _SceytChatClient8, channel, joinedChannel, _t29;
|
|
18565
|
+
return _regenerator().w(function (_context28) {
|
|
18566
|
+
while (1) switch (_context28.p = _context28.n) {
|
|
18329
18567
|
case 0:
|
|
18330
|
-
|
|
18568
|
+
_context28.p = 0;
|
|
18331
18569
|
payload = action.payload;
|
|
18332
18570
|
channelId = payload.channelId;
|
|
18333
18571
|
_SceytChatClient8 = getClient();
|
|
18334
|
-
|
|
18572
|
+
_context28.n = 1;
|
|
18335
18573
|
return call(getChannelFromMap, channelId);
|
|
18336
18574
|
case 1:
|
|
18337
|
-
channel =
|
|
18575
|
+
channel = _context28.v;
|
|
18338
18576
|
if (!channel) {
|
|
18339
18577
|
channel = getChannelFromAllChannels(channelId);
|
|
18340
18578
|
}
|
|
18341
18579
|
if (channel) {
|
|
18342
|
-
|
|
18580
|
+
_context28.n = 3;
|
|
18343
18581
|
break;
|
|
18344
18582
|
}
|
|
18345
|
-
|
|
18583
|
+
_context28.n = 2;
|
|
18346
18584
|
return call(_SceytChatClient8.getChannel, channelId);
|
|
18347
18585
|
case 2:
|
|
18348
|
-
channel =
|
|
18586
|
+
channel = _context28.v;
|
|
18349
18587
|
case 3:
|
|
18350
|
-
|
|
18588
|
+
_context28.n = 4;
|
|
18351
18589
|
return call(channel.join);
|
|
18352
18590
|
case 4:
|
|
18353
|
-
joinedChannel =
|
|
18354
|
-
|
|
18591
|
+
joinedChannel = _context28.v;
|
|
18592
|
+
_context28.n = 5;
|
|
18355
18593
|
return put(setCloseSearchChannelsAC(true));
|
|
18356
18594
|
case 5:
|
|
18357
|
-
|
|
18595
|
+
_context28.n = 6;
|
|
18358
18596
|
return put(setChannelToAddAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
18359
18597
|
case 6:
|
|
18360
|
-
|
|
18598
|
+
_context28.n = 7;
|
|
18361
18599
|
return put(switchChannelActionAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
18362
18600
|
case 7:
|
|
18363
18601
|
addChannelToAllChannels(joinedChannel);
|
|
18364
|
-
|
|
18602
|
+
_context28.n = 8;
|
|
18365
18603
|
return call(setActiveChannelId, joinedChannel.id);
|
|
18366
18604
|
case 8:
|
|
18367
|
-
|
|
18605
|
+
_context28.n = 10;
|
|
18368
18606
|
break;
|
|
18369
18607
|
case 9:
|
|
18370
|
-
|
|
18371
|
-
|
|
18372
|
-
log.error(
|
|
18608
|
+
_context28.p = 9;
|
|
18609
|
+
_t29 = _context28.v;
|
|
18610
|
+
log.error(_t29, 'Error in join to channel');
|
|
18373
18611
|
case 10:
|
|
18374
|
-
return
|
|
18612
|
+
return _context28.a(2);
|
|
18375
18613
|
}
|
|
18376
|
-
},
|
|
18614
|
+
}, _marked28, null, [[0, 9]]);
|
|
18377
18615
|
}
|
|
18378
18616
|
function watchForChannelEvents() {
|
|
18379
|
-
return _regenerator().w(function (
|
|
18380
|
-
while (1) switch (
|
|
18617
|
+
return _regenerator().w(function (_context29) {
|
|
18618
|
+
while (1) switch (_context29.n) {
|
|
18381
18619
|
case 0:
|
|
18382
|
-
|
|
18620
|
+
_context29.n = 1;
|
|
18383
18621
|
return call(watchForEvents);
|
|
18384
18622
|
case 1:
|
|
18385
|
-
return
|
|
18623
|
+
return _context29.a(2);
|
|
18386
18624
|
}
|
|
18387
|
-
},
|
|
18625
|
+
}, _marked29);
|
|
18388
18626
|
}
|
|
18389
18627
|
function createChannelInviteKey(action) {
|
|
18390
|
-
var payload, channelId, _SceytChatClient9, channel, inviteKey,
|
|
18391
|
-
return _regenerator().w(function (
|
|
18392
|
-
while (1) switch (
|
|
18628
|
+
var payload, channelId, _SceytChatClient9, channel, inviteKey, _t30;
|
|
18629
|
+
return _regenerator().w(function (_context30) {
|
|
18630
|
+
while (1) switch (_context30.p = _context30.n) {
|
|
18393
18631
|
case 0:
|
|
18394
|
-
|
|
18632
|
+
_context30.p = 0;
|
|
18395
18633
|
payload = action.payload;
|
|
18396
18634
|
channelId = payload.channelId;
|
|
18397
18635
|
_SceytChatClient9 = getClient();
|
|
18398
|
-
|
|
18636
|
+
_context30.n = 1;
|
|
18399
18637
|
return call(getChannelFromMap, channelId);
|
|
18400
18638
|
case 1:
|
|
18401
|
-
channel =
|
|
18639
|
+
channel = _context30.v;
|
|
18402
18640
|
if (!channel) {
|
|
18403
18641
|
channel = getChannelFromAllChannels(channelId);
|
|
18404
18642
|
}
|
|
18405
18643
|
if (!channel) {
|
|
18406
|
-
|
|
18644
|
+
_context30.n = 3;
|
|
18407
18645
|
break;
|
|
18408
18646
|
}
|
|
18409
|
-
|
|
18647
|
+
_context30.n = 2;
|
|
18410
18648
|
return call(_SceytChatClient9.createInviteKey, {
|
|
18411
18649
|
maxUses: 0,
|
|
18412
18650
|
expiresAt: 0,
|
|
18413
18651
|
accessPriorHistory: true
|
|
18414
18652
|
});
|
|
18415
18653
|
case 2:
|
|
18416
|
-
inviteKey =
|
|
18417
|
-
|
|
18654
|
+
inviteKey = _context30.v;
|
|
18655
|
+
_context30.n = 3;
|
|
18418
18656
|
return put(setChannelInviteKeysAC(channelId, [inviteKey]));
|
|
18419
18657
|
case 3:
|
|
18420
|
-
|
|
18658
|
+
_context30.n = 5;
|
|
18421
18659
|
break;
|
|
18422
18660
|
case 4:
|
|
18423
|
-
|
|
18424
|
-
|
|
18425
|
-
log.error('ERROR in create channel invite key',
|
|
18661
|
+
_context30.p = 4;
|
|
18662
|
+
_t30 = _context30.v;
|
|
18663
|
+
log.error('ERROR in create channel invite key', _t30);
|
|
18426
18664
|
case 5:
|
|
18427
|
-
return
|
|
18665
|
+
return _context30.a(2);
|
|
18428
18666
|
}
|
|
18429
|
-
},
|
|
18667
|
+
}, _marked30, null, [[0, 4]]);
|
|
18430
18668
|
}
|
|
18431
18669
|
function getChannelInviteKeys(action) {
|
|
18432
|
-
var payload, channelId, channel, inviteKeys,
|
|
18433
|
-
return _regenerator().w(function (
|
|
18434
|
-
while (1) switch (
|
|
18670
|
+
var payload, channelId, channel, inviteKeys, _t31;
|
|
18671
|
+
return _regenerator().w(function (_context31) {
|
|
18672
|
+
while (1) switch (_context31.p = _context31.n) {
|
|
18435
18673
|
case 0:
|
|
18436
|
-
|
|
18674
|
+
_context31.p = 0;
|
|
18437
18675
|
payload = action.payload;
|
|
18438
18676
|
channelId = payload.channelId;
|
|
18439
|
-
|
|
18677
|
+
_context31.n = 1;
|
|
18440
18678
|
return call(getChannelFromMap, channelId);
|
|
18441
18679
|
case 1:
|
|
18442
|
-
channel =
|
|
18680
|
+
channel = _context31.v;
|
|
18443
18681
|
if (!channel) {
|
|
18444
18682
|
channel = getChannelFromAllChannels(channelId);
|
|
18445
18683
|
}
|
|
18446
18684
|
if (!channel) {
|
|
18447
|
-
|
|
18685
|
+
_context31.n = 3;
|
|
18448
18686
|
break;
|
|
18449
18687
|
}
|
|
18450
|
-
|
|
18688
|
+
_context31.n = 2;
|
|
18451
18689
|
return call(channel.getInviteKeys);
|
|
18452
18690
|
case 2:
|
|
18453
|
-
inviteKeys =
|
|
18454
|
-
|
|
18691
|
+
inviteKeys = _context31.v;
|
|
18692
|
+
_context31.n = 3;
|
|
18455
18693
|
return put(setChannelInviteKeysAC(channelId, inviteKeys));
|
|
18456
18694
|
case 3:
|
|
18457
|
-
|
|
18695
|
+
_context31.n = 5;
|
|
18458
18696
|
break;
|
|
18459
18697
|
case 4:
|
|
18460
|
-
|
|
18461
|
-
|
|
18462
|
-
log.error('ERROR in get channel invite keys',
|
|
18698
|
+
_context31.p = 4;
|
|
18699
|
+
_t31 = _context31.v;
|
|
18700
|
+
log.error('ERROR in get channel invite keys', _t31);
|
|
18463
18701
|
case 5:
|
|
18464
|
-
return
|
|
18702
|
+
return _context31.a(2);
|
|
18465
18703
|
}
|
|
18466
|
-
},
|
|
18704
|
+
}, _marked31, null, [[0, 4]]);
|
|
18467
18705
|
}
|
|
18468
18706
|
function regenerateChannelInviteKey(action) {
|
|
18469
|
-
var payload, channelId, key, deletePermanently, channel, inviteKey,
|
|
18470
|
-
return _regenerator().w(function (
|
|
18471
|
-
while (1) switch (
|
|
18707
|
+
var payload, channelId, key, deletePermanently, channel, inviteKey, _t32;
|
|
18708
|
+
return _regenerator().w(function (_context32) {
|
|
18709
|
+
while (1) switch (_context32.p = _context32.n) {
|
|
18472
18710
|
case 0:
|
|
18473
|
-
|
|
18711
|
+
_context32.p = 0;
|
|
18474
18712
|
payload = action.payload;
|
|
18475
18713
|
channelId = payload.channelId, key = payload.key, deletePermanently = payload.deletePermanently;
|
|
18476
|
-
|
|
18714
|
+
_context32.n = 1;
|
|
18477
18715
|
return call(getChannelFromMap, channelId);
|
|
18478
18716
|
case 1:
|
|
18479
|
-
channel =
|
|
18717
|
+
channel = _context32.v;
|
|
18480
18718
|
if (!channel) {
|
|
18481
18719
|
channel = getChannelFromAllChannels(channelId);
|
|
18482
18720
|
}
|
|
18483
18721
|
if (!channel) {
|
|
18484
|
-
|
|
18722
|
+
_context32.n = 3;
|
|
18485
18723
|
break;
|
|
18486
18724
|
}
|
|
18487
|
-
|
|
18725
|
+
_context32.n = 2;
|
|
18488
18726
|
return call(channel.regenerateInviteKey, {
|
|
18489
18727
|
key: key,
|
|
18490
18728
|
channelId: channelId,
|
|
18491
18729
|
deletePermanently: deletePermanently
|
|
18492
18730
|
});
|
|
18493
18731
|
case 2:
|
|
18494
|
-
inviteKey =
|
|
18495
|
-
|
|
18732
|
+
inviteKey = _context32.v;
|
|
18733
|
+
_context32.n = 3;
|
|
18496
18734
|
return put(setChannelInviteKeysAC(channelId, [inviteKey]));
|
|
18497
18735
|
case 3:
|
|
18498
|
-
|
|
18736
|
+
_context32.n = 5;
|
|
18499
18737
|
break;
|
|
18500
18738
|
case 4:
|
|
18501
|
-
|
|
18502
|
-
|
|
18503
|
-
log.error('ERROR in regenerate channel invite key',
|
|
18739
|
+
_context32.p = 4;
|
|
18740
|
+
_t32 = _context32.v;
|
|
18741
|
+
log.error('ERROR in regenerate channel invite key', _t32);
|
|
18504
18742
|
case 5:
|
|
18505
|
-
return
|
|
18743
|
+
return _context32.a(2);
|
|
18506
18744
|
}
|
|
18507
|
-
},
|
|
18745
|
+
}, _marked32, null, [[0, 4]]);
|
|
18508
18746
|
}
|
|
18509
18747
|
function updateChannelInviteKey(action) {
|
|
18510
|
-
var channelInviteKeys, channelId, payload, payloadChannelId, key, accessPriorHistory, expiresAt, maxUses, channel, copiedChannelInviteKeys,
|
|
18511
|
-
return _regenerator().w(function (
|
|
18512
|
-
while (1) switch (
|
|
18748
|
+
var channelInviteKeys, channelId, payload, payloadChannelId, key, accessPriorHistory, expiresAt, maxUses, channel, copiedChannelInviteKeys, _t33;
|
|
18749
|
+
return _regenerator().w(function (_context33) {
|
|
18750
|
+
while (1) switch (_context33.p = _context33.n) {
|
|
18513
18751
|
case 0:
|
|
18514
18752
|
channelInviteKeys = [];
|
|
18515
18753
|
channelId = '';
|
|
18516
|
-
|
|
18754
|
+
_context33.p = 1;
|
|
18517
18755
|
payload = action.payload;
|
|
18518
18756
|
payloadChannelId = payload.channelId, key = payload.key, accessPriorHistory = payload.accessPriorHistory, expiresAt = payload.expiresAt, maxUses = payload.maxUses;
|
|
18519
18757
|
channelId = payloadChannelId;
|
|
18520
|
-
|
|
18758
|
+
_context33.n = 2;
|
|
18521
18759
|
return call(getChannelFromMap, channelId);
|
|
18522
18760
|
case 2:
|
|
18523
|
-
channel =
|
|
18761
|
+
channel = _context33.v;
|
|
18524
18762
|
if (!channel) {
|
|
18525
18763
|
channel = getChannelFromAllChannels(channelId);
|
|
18526
18764
|
}
|
|
18527
18765
|
channelInviteKeys = store.getState().ChannelReducer.channelInviteKeys[channelId];
|
|
18528
18766
|
copiedChannelInviteKeys = JSON.parse(JSON.stringify(channelInviteKeys));
|
|
18529
18767
|
if (!copiedChannelInviteKeys) {
|
|
18530
|
-
|
|
18768
|
+
_context33.n = 3;
|
|
18531
18769
|
break;
|
|
18532
18770
|
}
|
|
18533
18771
|
copiedChannelInviteKeys.forEach(function (inviteKey) {
|
|
@@ -18537,14 +18775,14 @@ function updateChannelInviteKey(action) {
|
|
|
18537
18775
|
inviteKey.maxUses = maxUses;
|
|
18538
18776
|
}
|
|
18539
18777
|
});
|
|
18540
|
-
|
|
18778
|
+
_context33.n = 3;
|
|
18541
18779
|
return put(setChannelInviteKeysAC(channelId, copiedChannelInviteKeys));
|
|
18542
18780
|
case 3:
|
|
18543
18781
|
if (!channel) {
|
|
18544
|
-
|
|
18782
|
+
_context33.n = 4;
|
|
18545
18783
|
break;
|
|
18546
18784
|
}
|
|
18547
|
-
|
|
18785
|
+
_context33.n = 4;
|
|
18548
18786
|
return call(channel.updateInviteKey, {
|
|
18549
18787
|
key: key,
|
|
18550
18788
|
channelId: channelId,
|
|
@@ -18553,88 +18791,88 @@ function updateChannelInviteKey(action) {
|
|
|
18553
18791
|
accessPriorHistory: accessPriorHistory
|
|
18554
18792
|
});
|
|
18555
18793
|
case 4:
|
|
18556
|
-
|
|
18794
|
+
_context33.n = 6;
|
|
18557
18795
|
break;
|
|
18558
18796
|
case 5:
|
|
18559
|
-
|
|
18560
|
-
|
|
18561
|
-
log.error('ERROR in update channel invite key',
|
|
18562
|
-
|
|
18797
|
+
_context33.p = 5;
|
|
18798
|
+
_t33 = _context33.v;
|
|
18799
|
+
log.error('ERROR in update channel invite key', _t33);
|
|
18800
|
+
_context33.n = 6;
|
|
18563
18801
|
return put(setChannelInviteKeysAC(channelId, channelInviteKeys));
|
|
18564
18802
|
case 6:
|
|
18565
|
-
return
|
|
18803
|
+
return _context33.a(2);
|
|
18566
18804
|
}
|
|
18567
|
-
},
|
|
18805
|
+
}, _marked33, null, [[1, 5]]);
|
|
18568
18806
|
}
|
|
18569
18807
|
function getChannelByInviteKey(action) {
|
|
18570
|
-
var _channel$, _channel$2, payload, key, _SceytChatClient0, channel,
|
|
18571
|
-
return _regenerator().w(function (
|
|
18572
|
-
while (1) switch (
|
|
18808
|
+
var _channel$, _channel$2, payload, key, _SceytChatClient0, channel, _t34;
|
|
18809
|
+
return _regenerator().w(function (_context34) {
|
|
18810
|
+
while (1) switch (_context34.p = _context34.n) {
|
|
18573
18811
|
case 0:
|
|
18574
|
-
|
|
18812
|
+
_context34.p = 0;
|
|
18575
18813
|
payload = action.payload;
|
|
18576
18814
|
key = payload.key;
|
|
18577
18815
|
_SceytChatClient0 = getClient();
|
|
18578
|
-
|
|
18816
|
+
_context34.n = 1;
|
|
18579
18817
|
return call(_SceytChatClient0.Channel.getChannelByInviteKey, key);
|
|
18580
18818
|
case 1:
|
|
18581
|
-
channel =
|
|
18819
|
+
channel = _context34.v;
|
|
18582
18820
|
if (!(channel && channel.length > 0 && !((_channel$ = channel[0]) !== null && _channel$ !== void 0 && _channel$.role))) {
|
|
18583
|
-
|
|
18821
|
+
_context34.n = 3;
|
|
18584
18822
|
break;
|
|
18585
18823
|
}
|
|
18586
|
-
|
|
18824
|
+
_context34.n = 2;
|
|
18587
18825
|
return put(setJoinableChannelAC(JSON.parse(JSON.stringify(channel[0]))));
|
|
18588
18826
|
case 2:
|
|
18589
18827
|
window.history.pushState({}, '', window.location.pathname + '?join=' + key);
|
|
18590
|
-
|
|
18828
|
+
_context34.n = 5;
|
|
18591
18829
|
break;
|
|
18592
18830
|
case 3:
|
|
18593
18831
|
if (!(channel && channel.length > 0 && (_channel$2 = channel[0]) !== null && _channel$2 !== void 0 && _channel$2.role)) {
|
|
18594
|
-
|
|
18832
|
+
_context34.n = 5;
|
|
18595
18833
|
break;
|
|
18596
18834
|
}
|
|
18597
|
-
|
|
18835
|
+
_context34.n = 4;
|
|
18598
18836
|
return put(switchChannelActionAC(JSON.parse(JSON.stringify(channel[0]))));
|
|
18599
18837
|
case 4:
|
|
18600
18838
|
window.history.pushState({}, '', window.location.pathname);
|
|
18601
18839
|
case 5:
|
|
18602
|
-
|
|
18840
|
+
_context34.n = 8;
|
|
18603
18841
|
break;
|
|
18604
18842
|
case 6:
|
|
18605
|
-
|
|
18606
|
-
|
|
18607
|
-
if (!(
|
|
18608
|
-
|
|
18843
|
+
_context34.p = 6;
|
|
18844
|
+
_t34 = _context34.v;
|
|
18845
|
+
if (!(_t34.code === 1109)) {
|
|
18846
|
+
_context34.n = 7;
|
|
18609
18847
|
break;
|
|
18610
18848
|
}
|
|
18611
|
-
|
|
18849
|
+
_context34.n = 7;
|
|
18612
18850
|
return put(setChannelInviteKeyAvailableAC(false));
|
|
18613
18851
|
case 7:
|
|
18614
|
-
log.error('ERROR in get channel by invite key',
|
|
18852
|
+
log.error('ERROR in get channel by invite key', _t34);
|
|
18615
18853
|
case 8:
|
|
18616
|
-
return
|
|
18854
|
+
return _context34.a(2);
|
|
18617
18855
|
}
|
|
18618
|
-
},
|
|
18856
|
+
}, _marked34, null, [[0, 6]]);
|
|
18619
18857
|
}
|
|
18620
18858
|
function joinChannelWithInviteKey(action) {
|
|
18621
|
-
var payload, key, _SceytChatClient1, user, channel, messageToSend,
|
|
18622
|
-
return _regenerator().w(function (
|
|
18623
|
-
while (1) switch (
|
|
18859
|
+
var payload, key, _SceytChatClient1, user, channel, messageToSend, _t35;
|
|
18860
|
+
return _regenerator().w(function (_context35) {
|
|
18861
|
+
while (1) switch (_context35.p = _context35.n) {
|
|
18624
18862
|
case 0:
|
|
18625
|
-
|
|
18863
|
+
_context35.p = 0;
|
|
18626
18864
|
payload = action.payload;
|
|
18627
18865
|
key = payload.key;
|
|
18628
18866
|
_SceytChatClient1 = getClient();
|
|
18629
18867
|
user = _SceytChatClient1.user;
|
|
18630
|
-
|
|
18868
|
+
_context35.n = 1;
|
|
18631
18869
|
return call(_SceytChatClient1.Channel.joinChannelByInviteKey, key);
|
|
18632
18870
|
case 1:
|
|
18633
|
-
channel =
|
|
18634
|
-
|
|
18871
|
+
channel = _context35.v;
|
|
18872
|
+
_context35.n = 2;
|
|
18635
18873
|
return put(setJoinableChannelAC(null));
|
|
18636
18874
|
case 2:
|
|
18637
|
-
|
|
18875
|
+
_context35.n = 3;
|
|
18638
18876
|
return call(setChannelInMap, channel);
|
|
18639
18877
|
case 3:
|
|
18640
18878
|
messageToSend = {
|
|
@@ -18643,47 +18881,47 @@ function joinChannelWithInviteKey(action) {
|
|
|
18643
18881
|
attachments: [],
|
|
18644
18882
|
type: 'system'
|
|
18645
18883
|
};
|
|
18646
|
-
|
|
18884
|
+
_context35.n = 4;
|
|
18647
18885
|
return put(sendTextMessageAC(messageToSend, channel === null || channel === void 0 ? void 0 : channel.id, CONNECTION_STATUS.CONNECTED));
|
|
18648
18886
|
case 4:
|
|
18649
|
-
|
|
18887
|
+
_context35.n = 5;
|
|
18650
18888
|
return put(switchChannelActionAC(JSON.parse(JSON.stringify(channel))));
|
|
18651
18889
|
case 5:
|
|
18652
18890
|
window.history.pushState({}, '', window.location.pathname);
|
|
18653
|
-
|
|
18891
|
+
_context35.n = 7;
|
|
18654
18892
|
break;
|
|
18655
18893
|
case 6:
|
|
18656
|
-
|
|
18657
|
-
|
|
18658
|
-
log.error('ERROR in join channel with invite key',
|
|
18894
|
+
_context35.p = 6;
|
|
18895
|
+
_t35 = _context35.v;
|
|
18896
|
+
log.error('ERROR in join channel with invite key', _t35);
|
|
18659
18897
|
case 7:
|
|
18660
|
-
return
|
|
18898
|
+
return _context35.a(2);
|
|
18661
18899
|
}
|
|
18662
|
-
},
|
|
18900
|
+
}, _marked35, null, [[0, 6]]);
|
|
18663
18901
|
}
|
|
18664
18902
|
function setMessageRetentionPeriod(action) {
|
|
18665
|
-
var payload, channelId, periodInMilliseconds, channel, messageToSend,
|
|
18666
|
-
return _regenerator().w(function (
|
|
18667
|
-
while (1) switch (
|
|
18903
|
+
var payload, channelId, periodInMilliseconds, channel, messageToSend, _t36;
|
|
18904
|
+
return _regenerator().w(function (_context36) {
|
|
18905
|
+
while (1) switch (_context36.p = _context36.n) {
|
|
18668
18906
|
case 0:
|
|
18669
|
-
|
|
18907
|
+
_context36.p = 0;
|
|
18670
18908
|
payload = action.payload;
|
|
18671
18909
|
channelId = payload.channelId, periodInMilliseconds = payload.periodInMilliseconds;
|
|
18672
|
-
|
|
18910
|
+
_context36.n = 1;
|
|
18673
18911
|
return call(getChannelFromMap, channelId);
|
|
18674
18912
|
case 1:
|
|
18675
|
-
channel =
|
|
18913
|
+
channel = _context36.v;
|
|
18676
18914
|
if (!channel) {
|
|
18677
18915
|
channel = getChannelFromAllChannels(channelId);
|
|
18678
18916
|
}
|
|
18679
18917
|
if (!channel) {
|
|
18680
|
-
|
|
18918
|
+
_context36.n = 4;
|
|
18681
18919
|
break;
|
|
18682
18920
|
}
|
|
18683
|
-
|
|
18921
|
+
_context36.n = 2;
|
|
18684
18922
|
return call(channel.setMessageRetentionPeriod, periodInMilliseconds);
|
|
18685
18923
|
case 2:
|
|
18686
|
-
|
|
18924
|
+
_context36.n = 3;
|
|
18687
18925
|
return put(updateChannelDataAC(channelId, {
|
|
18688
18926
|
messageRetentionPeriod: periodInMilliseconds
|
|
18689
18927
|
}));
|
|
@@ -18700,32 +18938,32 @@ function setMessageRetentionPeriod(action) {
|
|
|
18700
18938
|
attachments: [],
|
|
18701
18939
|
type: 'system'
|
|
18702
18940
|
};
|
|
18703
|
-
|
|
18941
|
+
_context36.n = 4;
|
|
18704
18942
|
return put(sendTextMessageAC(messageToSend, channelId, CONNECTION_STATUS.CONNECTED));
|
|
18705
18943
|
case 4:
|
|
18706
|
-
|
|
18944
|
+
_context36.n = 6;
|
|
18707
18945
|
break;
|
|
18708
18946
|
case 5:
|
|
18709
|
-
|
|
18710
|
-
|
|
18711
|
-
log.error('ERROR in set message retention period',
|
|
18947
|
+
_context36.p = 5;
|
|
18948
|
+
_t36 = _context36.v;
|
|
18949
|
+
log.error('ERROR in set message retention period', _t36);
|
|
18712
18950
|
case 6:
|
|
18713
|
-
return
|
|
18951
|
+
return _context36.a(2);
|
|
18714
18952
|
}
|
|
18715
|
-
},
|
|
18953
|
+
}, _marked36, null, [[0, 5]]);
|
|
18716
18954
|
}
|
|
18717
18955
|
function getChannelsWithUser(action) {
|
|
18718
|
-
var payload, userId, _SceytChatClient10, channelsQueryBuilder, channelsQuery, channelsData, channels,
|
|
18719
|
-
return _regenerator().w(function (
|
|
18720
|
-
while (1) switch (
|
|
18956
|
+
var payload, userId, _SceytChatClient10, channelsQueryBuilder, channelsQuery, channelsData, channels, _t37;
|
|
18957
|
+
return _regenerator().w(function (_context37) {
|
|
18958
|
+
while (1) switch (_context37.p = _context37.n) {
|
|
18721
18959
|
case 0:
|
|
18722
|
-
|
|
18960
|
+
_context37.n = 1;
|
|
18723
18961
|
return put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18724
18962
|
case 1:
|
|
18725
|
-
|
|
18963
|
+
_context37.n = 2;
|
|
18726
18964
|
return put(setMutualChannelsAC([]));
|
|
18727
18965
|
case 2:
|
|
18728
|
-
|
|
18966
|
+
_context37.p = 2;
|
|
18729
18967
|
payload = action.payload;
|
|
18730
18968
|
userId = payload.userId;
|
|
18731
18969
|
_SceytChatClient10 = getClient();
|
|
@@ -18734,231 +18972,231 @@ function getChannelsWithUser(action) {
|
|
|
18734
18972
|
channelsQueryBuilder.setMutualWithUserId(userId);
|
|
18735
18973
|
channelsQueryBuilder.withExcludeTypes([DEFAULT_CHANNEL_TYPE.DIRECT]);
|
|
18736
18974
|
channelsQueryBuilder.limit(15);
|
|
18737
|
-
|
|
18975
|
+
_context37.n = 3;
|
|
18738
18976
|
return call(channelsQueryBuilder.build);
|
|
18739
18977
|
case 3:
|
|
18740
|
-
channelsQuery =
|
|
18978
|
+
channelsQuery = _context37.v;
|
|
18741
18979
|
query.mutualChannelsQuery = channelsQuery;
|
|
18742
|
-
|
|
18980
|
+
_context37.n = 4;
|
|
18743
18981
|
return call(channelsQuery.loadNextPage);
|
|
18744
18982
|
case 4:
|
|
18745
|
-
channelsData =
|
|
18983
|
+
channelsData = _context37.v;
|
|
18746
18984
|
channels = channelsData.channels;
|
|
18747
18985
|
if (!channelsData.hasNext) {
|
|
18748
|
-
|
|
18986
|
+
_context37.n = 6;
|
|
18749
18987
|
break;
|
|
18750
18988
|
}
|
|
18751
|
-
|
|
18989
|
+
_context37.n = 5;
|
|
18752
18990
|
return put(setMutualChannelsHasNextAC(true));
|
|
18753
18991
|
case 5:
|
|
18754
|
-
|
|
18992
|
+
_context37.n = 7;
|
|
18755
18993
|
break;
|
|
18756
18994
|
case 6:
|
|
18757
|
-
|
|
18995
|
+
_context37.n = 7;
|
|
18758
18996
|
return put(setMutualChannelsHasNextAC(false));
|
|
18759
18997
|
case 7:
|
|
18760
|
-
|
|
18998
|
+
_context37.n = 8;
|
|
18761
18999
|
return put(setMutualChannelsAC(channels));
|
|
18762
19000
|
case 8:
|
|
18763
|
-
|
|
19001
|
+
_context37.n = 10;
|
|
18764
19002
|
break;
|
|
18765
19003
|
case 9:
|
|
18766
|
-
|
|
18767
|
-
|
|
18768
|
-
log.error('ERROR in get groups in common',
|
|
19004
|
+
_context37.p = 9;
|
|
19005
|
+
_t37 = _context37.v;
|
|
19006
|
+
log.error('ERROR in get groups in common', _t37);
|
|
18769
19007
|
case 10:
|
|
18770
|
-
|
|
18771
|
-
|
|
19008
|
+
_context37.p = 10;
|
|
19009
|
+
_context37.n = 11;
|
|
18772
19010
|
return put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18773
19011
|
case 11:
|
|
18774
|
-
return
|
|
19012
|
+
return _context37.f(10);
|
|
18775
19013
|
case 12:
|
|
18776
|
-
return
|
|
19014
|
+
return _context37.a(2);
|
|
18777
19015
|
}
|
|
18778
|
-
},
|
|
19016
|
+
}, _marked37, null, [[2, 9, 10, 12]]);
|
|
18779
19017
|
}
|
|
18780
19018
|
function loadMoreMutualChannels(action) {
|
|
18781
|
-
var payload, limit, mutualChannelsQuery, channelsData,
|
|
18782
|
-
return _regenerator().w(function (
|
|
18783
|
-
while (1) switch (
|
|
19019
|
+
var payload, limit, mutualChannelsQuery, channelsData, _t38;
|
|
19020
|
+
return _regenerator().w(function (_context38) {
|
|
19021
|
+
while (1) switch (_context38.p = _context38.n) {
|
|
18784
19022
|
case 0:
|
|
18785
|
-
|
|
19023
|
+
_context38.n = 1;
|
|
18786
19024
|
return put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18787
19025
|
case 1:
|
|
18788
|
-
|
|
19026
|
+
_context38.p = 1;
|
|
18789
19027
|
payload = action.payload;
|
|
18790
19028
|
limit = payload.limit;
|
|
18791
19029
|
mutualChannelsQuery = query.mutualChannelsQuery;
|
|
18792
19030
|
if (mutualChannelsQuery) {
|
|
18793
|
-
|
|
19031
|
+
_context38.n = 2;
|
|
18794
19032
|
break;
|
|
18795
19033
|
}
|
|
18796
|
-
return
|
|
19034
|
+
return _context38.a(2);
|
|
18797
19035
|
case 2:
|
|
18798
19036
|
if (limit) {
|
|
18799
19037
|
mutualChannelsQuery.limit = limit;
|
|
18800
19038
|
}
|
|
18801
|
-
|
|
19039
|
+
_context38.n = 3;
|
|
18802
19040
|
return call(mutualChannelsQuery.loadNextPage);
|
|
18803
19041
|
case 3:
|
|
18804
|
-
channelsData =
|
|
19042
|
+
channelsData = _context38.v;
|
|
18805
19043
|
if (!channelsData.hasNext) {
|
|
18806
|
-
|
|
19044
|
+
_context38.n = 5;
|
|
18807
19045
|
break;
|
|
18808
19046
|
}
|
|
18809
|
-
|
|
19047
|
+
_context38.n = 4;
|
|
18810
19048
|
return put(setMutualChannelsHasNextAC(true));
|
|
18811
19049
|
case 4:
|
|
18812
|
-
|
|
19050
|
+
_context38.n = 6;
|
|
18813
19051
|
break;
|
|
18814
19052
|
case 5:
|
|
18815
|
-
|
|
19053
|
+
_context38.n = 6;
|
|
18816
19054
|
return put(setMutualChannelsHasNextAC(false));
|
|
18817
19055
|
case 6:
|
|
18818
|
-
|
|
19056
|
+
_context38.n = 7;
|
|
18819
19057
|
return put(setMutualChannelsAC(channelsData.channels));
|
|
18820
19058
|
case 7:
|
|
18821
|
-
|
|
19059
|
+
_context38.n = 9;
|
|
18822
19060
|
break;
|
|
18823
19061
|
case 8:
|
|
18824
|
-
|
|
18825
|
-
|
|
18826
|
-
log.error('ERROR in load more mutual channels',
|
|
19062
|
+
_context38.p = 8;
|
|
19063
|
+
_t38 = _context38.v;
|
|
19064
|
+
log.error('ERROR in load more mutual channels', _t38);
|
|
18827
19065
|
case 9:
|
|
18828
|
-
|
|
18829
|
-
|
|
19066
|
+
_context38.p = 9;
|
|
19067
|
+
_context38.n = 10;
|
|
18830
19068
|
return put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18831
19069
|
case 10:
|
|
18832
|
-
return
|
|
19070
|
+
return _context38.f(9);
|
|
18833
19071
|
case 11:
|
|
18834
|
-
return
|
|
19072
|
+
return _context38.a(2);
|
|
18835
19073
|
}
|
|
18836
|
-
},
|
|
19074
|
+
}, _marked38, null, [[1, 8, 9, 11]]);
|
|
18837
19075
|
}
|
|
18838
19076
|
function ChannelsSaga() {
|
|
18839
|
-
return _regenerator().w(function (
|
|
18840
|
-
while (1) switch (
|
|
19077
|
+
return _regenerator().w(function (_context39) {
|
|
19078
|
+
while (1) switch (_context39.n) {
|
|
18841
19079
|
case 0:
|
|
18842
|
-
|
|
19080
|
+
_context39.n = 1;
|
|
18843
19081
|
return takeLatest(CREATE_CHANNEL, createChannel);
|
|
18844
19082
|
case 1:
|
|
18845
|
-
|
|
19083
|
+
_context39.n = 2;
|
|
18846
19084
|
return takeLatest(GET_CHANNELS, getChannels);
|
|
18847
19085
|
case 2:
|
|
18848
|
-
|
|
19086
|
+
_context39.n = 3;
|
|
18849
19087
|
return takeLatest(SEARCH_CHANNELS, searchChannels);
|
|
18850
19088
|
case 3:
|
|
18851
|
-
|
|
19089
|
+
_context39.n = 4;
|
|
18852
19090
|
return takeLatest(GET_CHANNELS_FOR_FORWARD, getChannelsForForward);
|
|
18853
19091
|
case 4:
|
|
18854
|
-
|
|
19092
|
+
_context39.n = 5;
|
|
18855
19093
|
return takeLatest(SEARCH_CHANNELS_FOR_FORWARD, searchChannelsForForward);
|
|
18856
19094
|
case 5:
|
|
18857
|
-
|
|
19095
|
+
_context39.n = 6;
|
|
18858
19096
|
return takeLatest(LOAD_MORE_CHANNEL, channelsLoadMore);
|
|
18859
19097
|
case 6:
|
|
18860
|
-
|
|
19098
|
+
_context39.n = 7;
|
|
18861
19099
|
return takeLatest(LOAD_MORE_CHANNELS_FOR_FORWARD, channelsForForwardLoadMore);
|
|
18862
19100
|
case 7:
|
|
18863
|
-
|
|
19101
|
+
_context39.n = 8;
|
|
18864
19102
|
return takeLatest(GET_CHANNELS_WITH_USER, getChannelsWithUser);
|
|
18865
19103
|
case 8:
|
|
18866
|
-
|
|
19104
|
+
_context39.n = 9;
|
|
18867
19105
|
return takeLatest(LOAD_MORE_MUTUAL_CHANNELS, loadMoreMutualChannels);
|
|
18868
19106
|
case 9:
|
|
18869
|
-
|
|
19107
|
+
_context39.n = 10;
|
|
18870
19108
|
return takeEvery(SWITCH_CHANNEL, switchChannel);
|
|
18871
19109
|
case 10:
|
|
18872
|
-
|
|
19110
|
+
_context39.n = 11;
|
|
18873
19111
|
return takeLatest(LEAVE_CHANNEL, leaveChannel);
|
|
18874
19112
|
case 11:
|
|
18875
|
-
|
|
19113
|
+
_context39.n = 12;
|
|
18876
19114
|
return takeLatest(DELETE_CHANNEL, deleteChannel);
|
|
18877
19115
|
case 12:
|
|
18878
|
-
|
|
19116
|
+
_context39.n = 13;
|
|
18879
19117
|
return takeLatest(BLOCK_CHANNEL, blockChannel);
|
|
18880
19118
|
case 13:
|
|
18881
|
-
|
|
19119
|
+
_context39.n = 14;
|
|
18882
19120
|
return takeLatest(UPDATE_CHANNEL, updateChannel);
|
|
18883
19121
|
case 14:
|
|
18884
|
-
|
|
19122
|
+
_context39.n = 15;
|
|
18885
19123
|
return takeEvery(MARK_MESSAGES_AS_READ, markMessagesRead);
|
|
18886
19124
|
case 15:
|
|
18887
|
-
|
|
19125
|
+
_context39.n = 16;
|
|
18888
19126
|
return takeLatest(MARK_MESSAGES_AS_DELIVERED, markMessagesDelivered);
|
|
18889
19127
|
case 16:
|
|
18890
|
-
|
|
19128
|
+
_context39.n = 17;
|
|
18891
19129
|
return takeLatest(MARK_VOICE_MESSAGE_AS_PLAYED, markVoiceMessageAsPlayed);
|
|
18892
19130
|
case 17:
|
|
18893
|
-
|
|
19131
|
+
_context39.n = 18;
|
|
18894
19132
|
return takeLatest(WATCH_FOR_EVENTS, watchForChannelEvents);
|
|
18895
19133
|
case 18:
|
|
18896
|
-
|
|
19134
|
+
_context39.n = 19;
|
|
18897
19135
|
return takeLatest(TURN_OFF_NOTIFICATION, notificationsTurnOff);
|
|
18898
19136
|
case 19:
|
|
18899
|
-
|
|
19137
|
+
_context39.n = 20;
|
|
18900
19138
|
return takeLatest(TURN_ON_NOTIFICATION, notificationsTurnOn);
|
|
18901
19139
|
case 20:
|
|
18902
|
-
|
|
19140
|
+
_context39.n = 21;
|
|
18903
19141
|
return takeLatest(MARK_CHANNEL_AS_READ, markChannelAsRead);
|
|
18904
19142
|
case 21:
|
|
18905
|
-
|
|
19143
|
+
_context39.n = 22;
|
|
18906
19144
|
return takeLatest(MARK_CHANNEL_AS_UNREAD, markChannelAsUnRead);
|
|
18907
19145
|
case 22:
|
|
18908
|
-
|
|
19146
|
+
_context39.n = 23;
|
|
18909
19147
|
return takeLatest(CHECK_USER_STATUS, checkUsersStatus);
|
|
18910
19148
|
case 23:
|
|
18911
|
-
|
|
19149
|
+
_context39.n = 24;
|
|
18912
19150
|
return takeLatest(SEND_TYPING, sendTyping);
|
|
18913
19151
|
case 24:
|
|
18914
|
-
|
|
19152
|
+
_context39.n = 25;
|
|
18915
19153
|
return takeLatest(SEND_RECORDING, sendRecording);
|
|
18916
19154
|
case 25:
|
|
18917
|
-
|
|
19155
|
+
_context39.n = 26;
|
|
18918
19156
|
return takeLatest(PIN_CHANNEL, pinChannel);
|
|
18919
19157
|
case 26:
|
|
18920
|
-
|
|
19158
|
+
_context39.n = 27;
|
|
18921
19159
|
return takeLatest(UNPIN_CHANNEL, unpinChannel);
|
|
18922
19160
|
case 27:
|
|
18923
|
-
|
|
19161
|
+
_context39.n = 28;
|
|
18924
19162
|
return takeLatest(CLEAR_HISTORY, clearHistory);
|
|
18925
19163
|
case 28:
|
|
18926
|
-
|
|
19164
|
+
_context39.n = 29;
|
|
18927
19165
|
return takeLatest(JOIN_TO_CHANNEL, joinChannel);
|
|
18928
19166
|
case 29:
|
|
18929
|
-
|
|
19167
|
+
_context39.n = 30;
|
|
18930
19168
|
return takeLatest(DELETE_ALL_MESSAGES, deleteAllMessages);
|
|
18931
19169
|
case 30:
|
|
18932
|
-
|
|
19170
|
+
_context39.n = 31;
|
|
18933
19171
|
return takeLatest(REMOVE_CHANNEL_CACHES, removeChannelCaches);
|
|
18934
19172
|
case 31:
|
|
18935
|
-
|
|
19173
|
+
_context39.n = 32;
|
|
18936
19174
|
return takeLatest(GET_CHANNEL_MENTIONS, getChannelMentions);
|
|
18937
19175
|
case 32:
|
|
18938
|
-
|
|
19176
|
+
_context39.n = 33;
|
|
18939
19177
|
return takeLatest(CREATE_CHANNEL_INVITE_KEY, createChannelInviteKey);
|
|
18940
19178
|
case 33:
|
|
18941
|
-
|
|
19179
|
+
_context39.n = 34;
|
|
18942
19180
|
return takeLatest(UPDATE_CHANNEL_INVITE_KEY, updateChannelInviteKey);
|
|
18943
19181
|
case 34:
|
|
18944
|
-
|
|
19182
|
+
_context39.n = 35;
|
|
18945
19183
|
return takeLatest(REGENERATE_CHANNEL_INVITE_KEY, regenerateChannelInviteKey);
|
|
18946
19184
|
case 35:
|
|
18947
|
-
|
|
19185
|
+
_context39.n = 36;
|
|
18948
19186
|
return takeLatest(GET_CHANNEL_INVITE_KEYS, getChannelInviteKeys);
|
|
18949
19187
|
case 36:
|
|
18950
|
-
|
|
19188
|
+
_context39.n = 37;
|
|
18951
19189
|
return takeLatest(GET_CHANNEL_BY_INVITE_KEY, getChannelByInviteKey);
|
|
18952
19190
|
case 37:
|
|
18953
|
-
|
|
19191
|
+
_context39.n = 38;
|
|
18954
19192
|
return takeLatest(JOIN_TO_CHANNEL_WITH_INVITE_KEY, joinChannelWithInviteKey);
|
|
18955
19193
|
case 38:
|
|
18956
|
-
|
|
19194
|
+
_context39.n = 39;
|
|
18957
19195
|
return takeLatest(SET_MESSAGE_RETENTION_PERIOD, setMessageRetentionPeriod);
|
|
18958
19196
|
case 39:
|
|
18959
|
-
return
|
|
19197
|
+
return _context39.a(2);
|
|
18960
19198
|
}
|
|
18961
|
-
},
|
|
19199
|
+
}, _marked39);
|
|
18962
19200
|
}
|
|
18963
19201
|
|
|
18964
19202
|
function rgbaToThumbHash(w, h, rgba) {
|
|
@@ -19358,56 +19596,6 @@ var getFrame = function getFrame(videoSrc, time) {
|
|
|
19358
19596
|
}
|
|
19359
19597
|
};
|
|
19360
19598
|
|
|
19361
|
-
var SDKErrorTypeEnum = {
|
|
19362
|
-
BadRequest: {
|
|
19363
|
-
value: 'BadRequest',
|
|
19364
|
-
isResendable: false
|
|
19365
|
-
},
|
|
19366
|
-
BadParam: {
|
|
19367
|
-
value: 'BadParam',
|
|
19368
|
-
isResendable: false
|
|
19369
|
-
},
|
|
19370
|
-
NotFound: {
|
|
19371
|
-
value: 'NotFound',
|
|
19372
|
-
isResendable: false
|
|
19373
|
-
},
|
|
19374
|
-
NotAllowed: {
|
|
19375
|
-
value: 'NotAllowed',
|
|
19376
|
-
isResendable: false
|
|
19377
|
-
},
|
|
19378
|
-
TooLargeRequest: {
|
|
19379
|
-
value: 'TooLargeRequest',
|
|
19380
|
-
isResendable: false
|
|
19381
|
-
},
|
|
19382
|
-
InternalError: {
|
|
19383
|
-
value: 'InternalError',
|
|
19384
|
-
isResendable: true
|
|
19385
|
-
},
|
|
19386
|
-
TooManyRequests: {
|
|
19387
|
-
value: 'TooManyRequests',
|
|
19388
|
-
isResendable: true
|
|
19389
|
-
},
|
|
19390
|
-
Authentication: {
|
|
19391
|
-
value: 'Authentication',
|
|
19392
|
-
isResendable: true
|
|
19393
|
-
}
|
|
19394
|
-
};
|
|
19395
|
-
var fromValue = function fromValue(value) {
|
|
19396
|
-
if (!value) return null;
|
|
19397
|
-
var entries = Object.values(SDKErrorTypeEnum);
|
|
19398
|
-
return entries.find(function (entry) {
|
|
19399
|
-
return entry.value === value;
|
|
19400
|
-
}) || null;
|
|
19401
|
-
};
|
|
19402
|
-
var isResendableError = function isResendableError(value) {
|
|
19403
|
-
var _errorType$isResendab;
|
|
19404
|
-
if (!value) {
|
|
19405
|
-
return true;
|
|
19406
|
-
}
|
|
19407
|
-
var errorType = fromValue(value);
|
|
19408
|
-
return (_errorType$isResendab = errorType === null || errorType === void 0 ? void 0 : errorType.isResendable) != null ? _errorType$isResendab : true;
|
|
19409
|
-
};
|
|
19410
|
-
|
|
19411
19599
|
var _marked$3 = /*#__PURE__*/_regenerator().m(sendMessage),
|
|
19412
19600
|
_marked2$2 = /*#__PURE__*/_regenerator().m(sendTextMessage),
|
|
19413
19601
|
_marked3$1 = /*#__PURE__*/_regenerator().m(forwardMessage),
|
|
@@ -19603,7 +19791,7 @@ var updateMessage$1 = function updateMessage(actionType, pending, channelId, scr
|
|
|
19603
19791
|
break;
|
|
19604
19792
|
}
|
|
19605
19793
|
_context.n = 7;
|
|
19606
|
-
return put(getMessagesAC(channel,
|
|
19794
|
+
return put(getMessagesAC(channel, true, channel === null || channel === void 0 ? void 0 : (_channel$lastMessage3 = channel.lastMessage) === null || _channel$lastMessage3 === void 0 ? void 0 : _channel$lastMessage3.id, undefined, false, 'smooth', true));
|
|
19607
19795
|
case 7:
|
|
19608
19796
|
return _context.a(2);
|
|
19609
19797
|
}
|
|
@@ -19906,22 +20094,10 @@ function sendMessage(action) {
|
|
|
19906
20094
|
return attachment;
|
|
19907
20095
|
});
|
|
19908
20096
|
}
|
|
19909
|
-
messageUpdateData = {
|
|
19910
|
-
id: messageResponse.id,
|
|
19911
|
-
body: messageResponse.body,
|
|
19912
|
-
type: messageResponse.type,
|
|
19913
|
-
state: messageResponse.state,
|
|
19914
|
-
displayCount: messageResponse.displayCount,
|
|
19915
|
-
deliveryStatus: messageResponse.deliveryStatus,
|
|
20097
|
+
messageUpdateData = _extends({}, messageResponse, {
|
|
19916
20098
|
attachments: attachmentsToUpdate,
|
|
19917
|
-
mentionedUsers: messageResponse.mentionedUsers,
|
|
19918
|
-
bodyAttributes: messageResponse.bodyAttributes,
|
|
19919
|
-
metadata: messageResponse.metadata,
|
|
19920
|
-
parentMessage: messageResponse.parentMessage,
|
|
19921
|
-
repliedInThread: messageResponse.repliedInThread,
|
|
19922
|
-
createdAt: messageResponse.createdAt,
|
|
19923
20099
|
channelId: channel.id
|
|
19924
|
-
};
|
|
20100
|
+
});
|
|
19925
20101
|
stringifiedMessageUpdateData = JSON.parse(JSON.stringify(messageResponse));
|
|
19926
20102
|
activeChannelId = getActiveChannelId();
|
|
19927
20103
|
if (!(activeChannelId === channel.id)) {
|
|
@@ -20034,7 +20210,7 @@ function sendMessage(action) {
|
|
|
20034
20210
|
}, _marked$3, null, [[1, 16, 17, 19]]);
|
|
20035
20211
|
}
|
|
20036
20212
|
function sendTextMessage(action) {
|
|
20037
|
-
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend,
|
|
20213
|
+
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend, messageResponse, messageUpdateData, activeChannelId, stringifiedMessageUpdateData, messageToUpdate, channelUpdateParam, _channel3, _channel4, isErrorResendable, _activeChannelId, _t3;
|
|
20038
20214
|
return _regenerator().w(function (_context5) {
|
|
20039
20215
|
while (1) switch (_context5.p = _context5.n) {
|
|
20040
20216
|
case 0:
|
|
@@ -20144,23 +20320,9 @@ function sendTextMessage(action) {
|
|
|
20144
20320
|
case 11:
|
|
20145
20321
|
messageResponse = _context5.v;
|
|
20146
20322
|
case 12:
|
|
20147
|
-
messageUpdateData = {
|
|
20148
|
-
id: messageResponse.id,
|
|
20149
|
-
body: messageResponse.body,
|
|
20150
|
-
type: messageResponse.type,
|
|
20151
|
-
state: messageResponse.state,
|
|
20152
|
-
bodyAttributes: messageResponse.bodyAttributes,
|
|
20153
|
-
displayCount: messageResponse.displayCount,
|
|
20154
|
-
deliveryStatus: messageResponse.deliveryStatus,
|
|
20155
|
-
attachments: messageResponse.attachments,
|
|
20156
|
-
mentionedUsers: messageResponse.mentionedUsers,
|
|
20157
|
-
metadata: messageResponse.metadata,
|
|
20158
|
-
parentMessage: messageResponse.parentMessage,
|
|
20159
|
-
repliedInThread: messageResponse.repliedInThread,
|
|
20160
|
-
createdAt: messageResponse.createdAt,
|
|
20161
|
-
pollDetails: (_messageResponse = messageResponse) === null || _messageResponse === void 0 ? void 0 : _messageResponse.pollDetails,
|
|
20323
|
+
messageUpdateData = _extends({}, messageResponse, {
|
|
20162
20324
|
channelId: channel.id
|
|
20163
|
-
};
|
|
20325
|
+
});
|
|
20164
20326
|
activeChannelId = getActiveChannelId();
|
|
20165
20327
|
if (!(activeChannelId === channel.id)) {
|
|
20166
20328
|
_context5.n = 13;
|
|
@@ -20383,20 +20545,9 @@ function forwardMessage(action) {
|
|
|
20383
20545
|
return call(channel.sendMessage, messageToSend);
|
|
20384
20546
|
case 10:
|
|
20385
20547
|
messageResponse = _context6.v;
|
|
20386
|
-
messageUpdateData = {
|
|
20387
|
-
id: messageResponse.id,
|
|
20388
|
-
type: messageResponse.type,
|
|
20389
|
-
state: messageResponse.state,
|
|
20390
|
-
displayCount: messageResponse.displayCount,
|
|
20391
|
-
deliveryStatus: messageResponse.deliveryStatus,
|
|
20392
|
-
attachments: messageResponse.attachments,
|
|
20393
|
-
mentionedUsers: messageResponse.mentionedUsers,
|
|
20394
|
-
metadata: messageResponse.metadata,
|
|
20395
|
-
parentMessage: messageResponse.parentMessage,
|
|
20396
|
-
repliedInThread: messageResponse.repliedInThread,
|
|
20397
|
-
createdAt: messageResponse.createdAt,
|
|
20548
|
+
messageUpdateData = _extends({}, messageResponse, {
|
|
20398
20549
|
channelId: channel.id
|
|
20399
|
-
};
|
|
20550
|
+
});
|
|
20400
20551
|
if (!(channelId === activeChannelId)) {
|
|
20401
20552
|
_context6.n = 12;
|
|
20402
20553
|
break;
|
|
@@ -20798,7 +20949,7 @@ var getFilteredPendingMessages = function getFilteredPendingMessages(messages) {
|
|
|
20798
20949
|
return filteredPendingMessages;
|
|
20799
20950
|
};
|
|
20800
20951
|
function getMessagesQuery(action) {
|
|
20801
|
-
var _action$payload, channel, loadWithLastMessage, messageId, limit, highlight, behavior, scrollToMessage, networkChanged, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, _result$messages$, _result$messages,
|
|
20952
|
+
var _action$payload, channel, loadWithLastMessage, messageId, limit, highlight, behavior, scrollToMessage, networkChanged, channelNewMessageCount, connectionState, SceytChatClient, _updatedChannel, messageQueryBuilder, messageQuery, cachedMessages, result, _result$messages$, _result$messages, _result$messages$2, _result$messages2, messages, loadNextMessageId, loadPreviousMessageId, nextLoadLimit, previousLoadLimit, centerMessageIndex, firstResult, secondResult, _result$messages$3, _result$messages3, _channel$lastMessage4, _channel$lastMessage5, _channel$lastMessage6, _result$messages4, _messages, _filteredPendingMessages, updatedMessages, messageIdForLoad, _updatedMessages$, filteredPendingMessages, waitToSendPendingMessages, updatedChannel, _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16, _t17, _t18;
|
|
20802
20953
|
return _regenerator().w(function (_context10) {
|
|
20803
20954
|
while (1) switch (_context10.p = _context10.n) {
|
|
20804
20955
|
case 0:
|
|
@@ -20807,29 +20958,69 @@ function getMessagesQuery(action) {
|
|
|
20807
20958
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
20808
20959
|
case 1:
|
|
20809
20960
|
_action$payload = action.payload, channel = _action$payload.channel, loadWithLastMessage = _action$payload.loadWithLastMessage, messageId = _action$payload.messageId, limit = _action$payload.limit, highlight = _action$payload.highlight, behavior = _action$payload.behavior, scrollToMessage = _action$payload.scrollToMessage, networkChanged = _action$payload.networkChanged;
|
|
20961
|
+
channelNewMessageCount = (channel === null || channel === void 0 ? void 0 : channel.newMessageCount) || 0;
|
|
20810
20962
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
20811
20963
|
if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
|
|
20812
|
-
_context10.n =
|
|
20964
|
+
_context10.n = 77;
|
|
20813
20965
|
break;
|
|
20814
20966
|
}
|
|
20815
20967
|
SceytChatClient = getClient();
|
|
20968
|
+
if (!networkChanged) {
|
|
20969
|
+
_context10.n = 8;
|
|
20970
|
+
break;
|
|
20971
|
+
}
|
|
20972
|
+
_context10.p = 2;
|
|
20973
|
+
_context10.n = 3;
|
|
20974
|
+
return call(SceytChatClient.getChannel, channel.id, true);
|
|
20975
|
+
case 3:
|
|
20976
|
+
_updatedChannel = _context10.v;
|
|
20977
|
+
if (!(_updatedChannel && _updatedChannel !== null && _updatedChannel !== void 0 && _updatedChannel.id)) {
|
|
20978
|
+
_context10.n = 6;
|
|
20979
|
+
break;
|
|
20980
|
+
}
|
|
20981
|
+
_context10.n = 4;
|
|
20982
|
+
return put(updateChannelDataAC(channel.id, _extends({}, _updatedChannel)));
|
|
20983
|
+
case 4:
|
|
20984
|
+
channelNewMessageCount = (_updatedChannel === null || _updatedChannel === void 0 ? void 0 : _updatedChannel.newMessageCount) || 0;
|
|
20985
|
+
if (!(channelNewMessageCount !== channel.newMessageCount)) {
|
|
20986
|
+
_context10.n = 6;
|
|
20987
|
+
break;
|
|
20988
|
+
}
|
|
20989
|
+
_context10.n = 5;
|
|
20990
|
+
return put(updateChannelDataAC(channel.id, {
|
|
20991
|
+
newMessageCount: channelNewMessageCount
|
|
20992
|
+
}));
|
|
20993
|
+
case 5:
|
|
20994
|
+
updateChannelOnAllChannels(channel.id, {
|
|
20995
|
+
newMessageCount: channelNewMessageCount
|
|
20996
|
+
});
|
|
20997
|
+
_context10.n = 6;
|
|
20998
|
+
return put(setUnreadMessageIdAC(channel.lastDisplayedMessageId));
|
|
20999
|
+
case 6:
|
|
21000
|
+
_context10.n = 8;
|
|
21001
|
+
break;
|
|
21002
|
+
case 7:
|
|
21003
|
+
_context10.p = 7;
|
|
21004
|
+
_t0 = _context10.v;
|
|
21005
|
+
log.error('error to get updated channel in get messages query', _t0);
|
|
21006
|
+
case 8:
|
|
20816
21007
|
messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channel.id);
|
|
20817
21008
|
messageQueryBuilder.limit(limit || MESSAGES_MAX_LENGTH);
|
|
20818
21009
|
messageQueryBuilder.reverse(true);
|
|
20819
21010
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20820
|
-
_context10.n =
|
|
21011
|
+
_context10.n = 10;
|
|
20821
21012
|
break;
|
|
20822
21013
|
}
|
|
20823
|
-
_context10.n =
|
|
21014
|
+
_context10.n = 9;
|
|
20824
21015
|
return call(messageQueryBuilder.build);
|
|
20825
|
-
case
|
|
20826
|
-
|
|
20827
|
-
_context10.n =
|
|
21016
|
+
case 9:
|
|
21017
|
+
_t1 = _context10.v;
|
|
21018
|
+
_context10.n = 11;
|
|
20828
21019
|
break;
|
|
20829
|
-
case
|
|
20830
|
-
|
|
20831
|
-
case
|
|
20832
|
-
messageQuery =
|
|
21020
|
+
case 10:
|
|
21021
|
+
_t1 = null;
|
|
21022
|
+
case 11:
|
|
21023
|
+
messageQuery = _t1;
|
|
20833
21024
|
query.messageQuery = messageQuery;
|
|
20834
21025
|
cachedMessages = Object.values(getMessagesFromMap(channel.id) || {}).sort(function (a, b) {
|
|
20835
21026
|
return Number(a.id) - Number(b.id);
|
|
@@ -20839,161 +21030,126 @@ function getMessagesQuery(action) {
|
|
|
20839
21030
|
hasNext: false
|
|
20840
21031
|
};
|
|
20841
21032
|
if (!loadWithLastMessage) {
|
|
20842
|
-
_context10.n =
|
|
21033
|
+
_context10.n = 29;
|
|
20843
21034
|
break;
|
|
20844
21035
|
}
|
|
20845
|
-
if (!(
|
|
20846
|
-
_context10.n =
|
|
21036
|
+
if (!(channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
21037
|
+
_context10.n = 22;
|
|
20847
21038
|
break;
|
|
20848
21039
|
}
|
|
20849
21040
|
setHasPrevCached(false);
|
|
20850
21041
|
setAllMessages([]);
|
|
20851
21042
|
messageQuery.limit = MESSAGES_MAX_LENGTH;
|
|
20852
21043
|
if (!Number(channel.lastDisplayedMessageId)) {
|
|
20853
|
-
_context10.n =
|
|
21044
|
+
_context10.n = 15;
|
|
20854
21045
|
break;
|
|
20855
21046
|
}
|
|
20856
21047
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20857
|
-
_context10.n =
|
|
21048
|
+
_context10.n = 13;
|
|
20858
21049
|
break;
|
|
20859
21050
|
}
|
|
20860
|
-
_context10.n =
|
|
21051
|
+
_context10.n = 12;
|
|
20861
21052
|
return call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
|
|
20862
|
-
case
|
|
20863
|
-
|
|
20864
|
-
_context10.n =
|
|
21053
|
+
case 12:
|
|
21054
|
+
_t10 = _context10.v;
|
|
21055
|
+
_context10.n = 14;
|
|
20865
21056
|
break;
|
|
20866
|
-
case
|
|
20867
|
-
|
|
21057
|
+
case 13:
|
|
21058
|
+
_t10 = {
|
|
20868
21059
|
messages: [],
|
|
20869
21060
|
hasNext: false
|
|
20870
21061
|
};
|
|
20871
|
-
case
|
|
20872
|
-
result =
|
|
20873
|
-
_context10.n =
|
|
21062
|
+
case 14:
|
|
21063
|
+
result = _t10;
|
|
21064
|
+
_context10.n = 19;
|
|
20874
21065
|
break;
|
|
20875
|
-
case
|
|
21066
|
+
case 15:
|
|
20876
21067
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20877
|
-
_context10.n =
|
|
21068
|
+
_context10.n = 17;
|
|
20878
21069
|
break;
|
|
20879
21070
|
}
|
|
20880
|
-
_context10.n =
|
|
21071
|
+
_context10.n = 16;
|
|
20881
21072
|
return call(messageQuery.loadPrevious);
|
|
20882
|
-
case
|
|
20883
|
-
|
|
20884
|
-
_context10.n =
|
|
21073
|
+
case 16:
|
|
21074
|
+
_t11 = _context10.v;
|
|
21075
|
+
_context10.n = 18;
|
|
20885
21076
|
break;
|
|
20886
|
-
case
|
|
20887
|
-
|
|
21077
|
+
case 17:
|
|
21078
|
+
_t11 = {
|
|
20888
21079
|
messages: [],
|
|
20889
21080
|
hasNext: false
|
|
20890
21081
|
};
|
|
20891
|
-
case 11:
|
|
20892
|
-
result = _t10;
|
|
20893
|
-
case 12:
|
|
20894
|
-
_context10.n = 13;
|
|
20895
|
-
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20896
|
-
case 13:
|
|
20897
|
-
setMessagesToMap(channel.id, result.messages, (_result$messages$ = result.messages[0]) === null || _result$messages$ === void 0 ? void 0 : _result$messages$.id, (_result$messages = result.messages[result.messages.length - 1]) === null || _result$messages === void 0 ? void 0 : _result$messages.id);
|
|
20898
|
-
setAllMessages(result.messages);
|
|
20899
|
-
_context10.n = 14;
|
|
20900
|
-
return put(setMessagesHasPrevAC(true));
|
|
20901
|
-
case 14:
|
|
20902
|
-
_context10.n = 17;
|
|
20903
|
-
break;
|
|
20904
|
-
case 15:
|
|
20905
|
-
result.messages = getFromAllMessagesByMessageId('', '', true);
|
|
20906
|
-
_context10.n = 16;
|
|
20907
|
-
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20908
|
-
case 16:
|
|
20909
|
-
_context10.n = 17;
|
|
20910
|
-
return put(setMessagesHasPrevAC(true));
|
|
20911
|
-
case 17:
|
|
20912
|
-
_context10.n = 18;
|
|
20913
|
-
return put(setMessagesHasNextAC(false));
|
|
20914
21082
|
case 18:
|
|
20915
|
-
|
|
20916
|
-
if (!(messageId && scrollToMessage)) {
|
|
20917
|
-
_context10.n = 21;
|
|
20918
|
-
break;
|
|
20919
|
-
}
|
|
20920
|
-
if (!(channel.newMessageCount && channel.newMessageCount > 0)) {
|
|
20921
|
-
_context10.n = 20;
|
|
20922
|
-
break;
|
|
20923
|
-
}
|
|
20924
|
-
_context10.n = 19;
|
|
20925
|
-
return put(setScrollToMessagesAC(channel.lastDisplayedMessageId, highlight, behavior));
|
|
21083
|
+
result = _t11;
|
|
20926
21084
|
case 19:
|
|
20927
|
-
_context10.n =
|
|
20928
|
-
|
|
21085
|
+
_context10.n = 20;
|
|
21086
|
+
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20929
21087
|
case 20:
|
|
21088
|
+
setMessagesToMap(channel.id, result.messages, (_result$messages$ = result.messages[0]) === null || _result$messages$ === void 0 ? void 0 : _result$messages$.id, (_result$messages = result.messages[result.messages.length - 1]) === null || _result$messages === void 0 ? void 0 : _result$messages.id);
|
|
21089
|
+
setAllMessages(result.messages);
|
|
20930
21090
|
_context10.n = 21;
|
|
20931
|
-
return put(
|
|
21091
|
+
return put(setMessagesHasPrevAC(true));
|
|
20932
21092
|
case 21:
|
|
20933
|
-
_context10.n =
|
|
21093
|
+
_context10.n = 24;
|
|
20934
21094
|
break;
|
|
20935
21095
|
case 22:
|
|
20936
|
-
|
|
20937
|
-
_context10.n = 52;
|
|
20938
|
-
break;
|
|
20939
|
-
}
|
|
20940
|
-
messages = store.getState().MessageReducer.activeChannelMessages;
|
|
20941
|
-
centerMessageId = (_messages$Math$floor = messages[Math.floor(messages.length / 2)]) === null || _messages$Math$floor === void 0 ? void 0 : _messages$Math$floor.id;
|
|
20942
|
-
loadWithMessageId = networkChanged && (messages === null || messages === void 0 ? void 0 : messages.length) > 0 ? centerMessageId : messageId;
|
|
20943
|
-
allMessages = getAllMessages();
|
|
20944
|
-
messageIndex = allMessages.findIndex(function (msg) {
|
|
20945
|
-
return msg.id === loadWithMessageId;
|
|
20946
|
-
});
|
|
20947
|
-
maxLengthPart = MESSAGES_MAX_LENGTH / 2;
|
|
20948
|
-
if (!(messageIndex >= maxLengthPart)) {
|
|
20949
|
-
_context10.n = 25;
|
|
20950
|
-
break;
|
|
20951
|
-
}
|
|
20952
|
-
result.messages = allMessages.slice(messageIndex - maxLengthPart, messageIndex + maxLengthPart);
|
|
21096
|
+
result.messages = getFromAllMessagesByMessageId('', '', true);
|
|
20953
21097
|
_context10.n = 23;
|
|
20954
21098
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20955
21099
|
case 23:
|
|
20956
|
-
setHasPrevCached(messageIndex > maxLengthPart);
|
|
20957
|
-
setHasNextCached(allMessages.length > maxLengthPart);
|
|
20958
21100
|
_context10.n = 24;
|
|
20959
21101
|
return put(setMessagesHasPrevAC(true));
|
|
20960
21102
|
case 24:
|
|
20961
|
-
_context10.n =
|
|
20962
|
-
|
|
21103
|
+
_context10.n = 25;
|
|
21104
|
+
return put(setMessagesHasNextAC(false));
|
|
20963
21105
|
case 25:
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
21106
|
+
setHasNextCached(false);
|
|
21107
|
+
if (!(messageId && scrollToMessage)) {
|
|
21108
|
+
_context10.n = 28;
|
|
21109
|
+
break;
|
|
21110
|
+
}
|
|
21111
|
+
if (!(channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
20967
21112
|
_context10.n = 27;
|
|
20968
21113
|
break;
|
|
20969
21114
|
}
|
|
20970
21115
|
_context10.n = 26;
|
|
20971
|
-
return
|
|
21116
|
+
return put(setScrollToMessagesAC(channel.lastDisplayedMessageId, highlight, behavior));
|
|
20972
21117
|
case 26:
|
|
20973
|
-
_t11 = _context10.v;
|
|
20974
21118
|
_context10.n = 28;
|
|
20975
21119
|
break;
|
|
20976
21120
|
case 27:
|
|
20977
|
-
|
|
20978
|
-
|
|
20979
|
-
hasNext: false
|
|
20980
|
-
};
|
|
21121
|
+
_context10.n = 28;
|
|
21122
|
+
return put(scrollToNewMessageAC(true));
|
|
20981
21123
|
case 28:
|
|
20982
|
-
|
|
20983
|
-
|
|
20984
|
-
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
21124
|
+
_context10.n = 70;
|
|
21125
|
+
break;
|
|
20985
21126
|
case 29:
|
|
20986
|
-
if (!
|
|
20987
|
-
_context10.n =
|
|
21127
|
+
if (!messageId) {
|
|
21128
|
+
_context10.n = 40;
|
|
20988
21129
|
break;
|
|
20989
21130
|
}
|
|
20990
|
-
|
|
21131
|
+
messages = store.getState().MessageReducer.activeChannelMessages;
|
|
21132
|
+
loadNextMessageId = '';
|
|
21133
|
+
loadPreviousMessageId = '';
|
|
21134
|
+
nextLoadLimit = MESSAGES_MAX_PAGE_COUNT / 2;
|
|
21135
|
+
previousLoadLimit = MESSAGES_MAX_PAGE_COUNT / 2;
|
|
21136
|
+
if (networkChanged) {
|
|
21137
|
+
centerMessageIndex = getCenterTwoMessages(messages);
|
|
21138
|
+
loadPreviousMessageId = centerMessageIndex.mid2.messageId;
|
|
21139
|
+
loadNextMessageId = centerMessageIndex.mid1.messageId;
|
|
21140
|
+
previousLoadLimit = centerMessageIndex.mid2.index;
|
|
21141
|
+
nextLoadLimit = messages.length - centerMessageIndex.mid1.index - 1;
|
|
21142
|
+
} else if (messageId) {
|
|
21143
|
+
loadPreviousMessageId = messageId;
|
|
21144
|
+
}
|
|
21145
|
+
messageQuery.limit = previousLoadLimit;
|
|
21146
|
+
log.info('load by message id from server ...............', messageId);
|
|
20991
21147
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20992
21148
|
_context10.n = 31;
|
|
20993
21149
|
break;
|
|
20994
21150
|
}
|
|
20995
21151
|
_context10.n = 30;
|
|
20996
|
-
return call(messageQuery.loadPreviousMessageId,
|
|
21152
|
+
return call(messageQuery.loadPreviousMessageId, loadPreviousMessageId);
|
|
20997
21153
|
case 30:
|
|
20998
21154
|
_t12 = _context10.v;
|
|
20999
21155
|
_context10.n = 32;
|
|
@@ -21004,235 +21160,185 @@ function getMessagesQuery(action) {
|
|
|
21004
21160
|
hasNext: false
|
|
21005
21161
|
};
|
|
21006
21162
|
case 32:
|
|
21007
|
-
|
|
21008
|
-
|
|
21009
|
-
|
|
21010
|
-
|
|
21011
|
-
|
|
21012
|
-
|
|
21163
|
+
firstResult = _t12;
|
|
21164
|
+
if (!networkChanged && firstResult.messages.length > 0) {
|
|
21165
|
+
loadNextMessageId = firstResult.messages[firstResult.messages.length - 1].id;
|
|
21166
|
+
} else if (!networkChanged && !firstResult.messages.length) {
|
|
21167
|
+
loadNextMessageId = '0';
|
|
21168
|
+
}
|
|
21013
21169
|
messageQuery.reverse = false;
|
|
21170
|
+
messageQuery.limit = nextLoadLimit;
|
|
21014
21171
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21015
|
-
_context10.n =
|
|
21172
|
+
_context10.n = 34;
|
|
21016
21173
|
break;
|
|
21017
21174
|
}
|
|
21018
|
-
_context10.n =
|
|
21019
|
-
return call(messageQuery.loadNextMessageId,
|
|
21020
|
-
case
|
|
21175
|
+
_context10.n = 33;
|
|
21176
|
+
return call(messageQuery.loadNextMessageId, loadNextMessageId);
|
|
21177
|
+
case 33:
|
|
21021
21178
|
_t13 = _context10.v;
|
|
21022
|
-
_context10.n =
|
|
21179
|
+
_context10.n = 35;
|
|
21023
21180
|
break;
|
|
21024
|
-
case
|
|
21181
|
+
case 34:
|
|
21025
21182
|
_t13 = {
|
|
21026
21183
|
messages: [],
|
|
21027
21184
|
hasNext: false
|
|
21028
21185
|
};
|
|
21186
|
+
case 35:
|
|
21187
|
+
secondResult = _t13;
|
|
21188
|
+
result.messages = [].concat(firstResult.messages, secondResult.messages);
|
|
21189
|
+
_context10.n = 36;
|
|
21190
|
+
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
21029
21191
|
case 36:
|
|
21030
|
-
thirdResult = _t13;
|
|
21031
|
-
result.messages = [].concat(result.messages, thirdResult.messages);
|
|
21032
|
-
_context10.n = 37;
|
|
21033
|
-
return put(addMessagesAC(JSON.parse(JSON.stringify(thirdResult.messages)), MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21034
|
-
case 37:
|
|
21035
|
-
if (!(secondResult.hasNext && !thirdResult.hasNext)) {
|
|
21036
|
-
_context10.n = 42;
|
|
21037
|
-
break;
|
|
21038
|
-
}
|
|
21039
|
-
messageQuery.limit = MESSAGES_MAX_PAGE_COUNT - 50 - secondResult.messages.length - result.messages.length;
|
|
21040
|
-
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21041
|
-
_context10.n = 39;
|
|
21042
|
-
break;
|
|
21043
|
-
}
|
|
21044
|
-
_context10.n = 38;
|
|
21045
|
-
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
21046
|
-
case 38:
|
|
21047
|
-
_t14 = _context10.v;
|
|
21048
|
-
_context10.n = 40;
|
|
21049
|
-
break;
|
|
21050
|
-
case 39:
|
|
21051
|
-
_t14 = {
|
|
21052
|
-
messages: [],
|
|
21053
|
-
hasNext: false
|
|
21054
|
-
};
|
|
21055
|
-
case 40:
|
|
21056
|
-
fourthResult = _t14;
|
|
21057
|
-
result.messages = [].concat(fourthResult.messages, result.messages);
|
|
21058
|
-
_context10.n = 41;
|
|
21059
|
-
return put(addMessagesAC(JSON.parse(JSON.stringify(fourthResult.messages)), MESSAGE_LOAD_DIRECTION.PREV));
|
|
21060
|
-
case 41:
|
|
21061
|
-
_context10.n = 46;
|
|
21062
|
-
break;
|
|
21063
|
-
case 42:
|
|
21064
|
-
if (!(!secondResult.hasNext && thirdResult.hasNext)) {
|
|
21065
|
-
_context10.n = 46;
|
|
21066
|
-
break;
|
|
21067
|
-
}
|
|
21068
|
-
messageQuery.limit = MESSAGES_MAX_PAGE_COUNT - 50 - secondResult.messages.length - result.messages.length;
|
|
21069
|
-
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21070
|
-
_context10.n = 44;
|
|
21071
|
-
break;
|
|
21072
|
-
}
|
|
21073
|
-
_context10.n = 43;
|
|
21074
|
-
return call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
|
|
21075
|
-
case 43:
|
|
21076
|
-
_t15 = _context10.v;
|
|
21077
|
-
_context10.n = 45;
|
|
21078
|
-
break;
|
|
21079
|
-
case 44:
|
|
21080
|
-
_t15 = {
|
|
21081
|
-
messages: [],
|
|
21082
|
-
hasNext: false
|
|
21083
|
-
};
|
|
21084
|
-
case 45:
|
|
21085
|
-
_fourthResult = _t15;
|
|
21086
|
-
result.messages = [].concat(result.messages, _fourthResult.messages);
|
|
21087
|
-
_context10.n = 46;
|
|
21088
|
-
return put(addMessagesAC(JSON.parse(JSON.stringify(_fourthResult.messages)), MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21089
|
-
case 46:
|
|
21090
|
-
messageQuery.reverse = true;
|
|
21091
|
-
case 47:
|
|
21092
21192
|
setMessagesToMap(channel.id, result.messages, (_result$messages$2 = result.messages[0]) === null || _result$messages$2 === void 0 ? void 0 : _result$messages$2.id, (_result$messages2 = result.messages[result.messages.length - 1]) === null || _result$messages2 === void 0 ? void 0 : _result$messages2.id);
|
|
21093
21193
|
setAllMessages([].concat(result.messages));
|
|
21094
21194
|
setHasPrevCached(false);
|
|
21095
21195
|
setHasNextCached(false);
|
|
21096
|
-
|
|
21097
|
-
_context10.n = 49;
|
|
21196
|
+
_context10.n = 37;
|
|
21098
21197
|
return put(setMessagesHasNextAC(true));
|
|
21099
|
-
case
|
|
21100
|
-
if (!scrollToMessage) {
|
|
21101
|
-
_context10.n =
|
|
21198
|
+
case 37:
|
|
21199
|
+
if (!(scrollToMessage && !networkChanged)) {
|
|
21200
|
+
_context10.n = 38;
|
|
21102
21201
|
break;
|
|
21103
21202
|
}
|
|
21104
|
-
_context10.n =
|
|
21105
|
-
return put(setScrollToMessagesAC(
|
|
21106
|
-
case
|
|
21107
|
-
_context10.n =
|
|
21203
|
+
_context10.n = 38;
|
|
21204
|
+
return put(setScrollToMessagesAC(messageId, highlight, behavior));
|
|
21205
|
+
case 38:
|
|
21206
|
+
_context10.n = 39;
|
|
21108
21207
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
21109
|
-
case
|
|
21110
|
-
_context10.n =
|
|
21208
|
+
case 39:
|
|
21209
|
+
_context10.n = 70;
|
|
21111
21210
|
break;
|
|
21112
|
-
case
|
|
21113
|
-
if (!(
|
|
21114
|
-
_context10.n =
|
|
21211
|
+
case 40:
|
|
21212
|
+
if (!(channelNewMessageCount && channel.lastDisplayedMessageId)) {
|
|
21213
|
+
_context10.n = 54;
|
|
21115
21214
|
break;
|
|
21116
21215
|
}
|
|
21117
21216
|
setAllMessages([]);
|
|
21118
21217
|
messageQuery.limit = MESSAGES_MAX_LENGTH;
|
|
21119
21218
|
if (!Number(channel.lastDisplayedMessageId)) {
|
|
21120
|
-
_context10.n =
|
|
21219
|
+
_context10.n = 44;
|
|
21121
21220
|
break;
|
|
21122
21221
|
}
|
|
21123
21222
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21124
|
-
_context10.n =
|
|
21223
|
+
_context10.n = 42;
|
|
21125
21224
|
break;
|
|
21126
21225
|
}
|
|
21127
|
-
_context10.n =
|
|
21226
|
+
_context10.n = 41;
|
|
21128
21227
|
return call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
|
|
21129
|
-
case
|
|
21130
|
-
|
|
21131
|
-
_context10.n =
|
|
21228
|
+
case 41:
|
|
21229
|
+
_t14 = _context10.v;
|
|
21230
|
+
_context10.n = 43;
|
|
21132
21231
|
break;
|
|
21133
|
-
case
|
|
21134
|
-
|
|
21232
|
+
case 42:
|
|
21233
|
+
_t14 = {
|
|
21135
21234
|
messages: [],
|
|
21136
21235
|
hasNext: false
|
|
21137
21236
|
};
|
|
21138
|
-
case
|
|
21139
|
-
result =
|
|
21140
|
-
_context10.n =
|
|
21237
|
+
case 43:
|
|
21238
|
+
result = _t14;
|
|
21239
|
+
_context10.n = 48;
|
|
21141
21240
|
break;
|
|
21142
|
-
case
|
|
21241
|
+
case 44:
|
|
21143
21242
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21144
|
-
_context10.n =
|
|
21243
|
+
_context10.n = 46;
|
|
21145
21244
|
break;
|
|
21146
21245
|
}
|
|
21147
|
-
_context10.n =
|
|
21246
|
+
_context10.n = 45;
|
|
21148
21247
|
return call(messageQuery.loadPrevious);
|
|
21149
|
-
case
|
|
21150
|
-
|
|
21151
|
-
_context10.n =
|
|
21248
|
+
case 45:
|
|
21249
|
+
_t15 = _context10.v;
|
|
21250
|
+
_context10.n = 47;
|
|
21152
21251
|
break;
|
|
21153
|
-
case
|
|
21154
|
-
|
|
21252
|
+
case 46:
|
|
21253
|
+
_t15 = {
|
|
21155
21254
|
messages: [],
|
|
21156
21255
|
hasNext: false
|
|
21157
21256
|
};
|
|
21158
|
-
case
|
|
21159
|
-
result =
|
|
21160
|
-
case
|
|
21161
|
-
_context10.n =
|
|
21257
|
+
case 47:
|
|
21258
|
+
result = _t15;
|
|
21259
|
+
case 48:
|
|
21260
|
+
_context10.n = 49;
|
|
21162
21261
|
return put(setMessagesHasPrevAC(true));
|
|
21163
|
-
case
|
|
21164
|
-
_context10.n =
|
|
21262
|
+
case 49:
|
|
21263
|
+
_context10.n = 50;
|
|
21165
21264
|
return put(setMessagesHasNextAC(channel.lastMessage && result.messages.length > 0 && channel.lastMessage.id !== result.messages[result.messages.length - 1].id));
|
|
21166
|
-
case
|
|
21265
|
+
case 50:
|
|
21167
21266
|
setMessagesToMap(channel.id, result.messages, (_result$messages$3 = result.messages[0]) === null || _result$messages$3 === void 0 ? void 0 : _result$messages$3.id, (_result$messages3 = result.messages[result.messages.length - 1]) === null || _result$messages3 === void 0 ? void 0 : _result$messages3.id);
|
|
21168
21267
|
setAllMessages([].concat(result.messages));
|
|
21169
|
-
_context10.n =
|
|
21268
|
+
_context10.n = 51;
|
|
21170
21269
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
21171
|
-
case
|
|
21172
|
-
_context10.n =
|
|
21270
|
+
case 51:
|
|
21271
|
+
_context10.n = 52;
|
|
21272
|
+
return put(scrollToNewMessageAC(false));
|
|
21273
|
+
case 52:
|
|
21274
|
+
_context10.n = 53;
|
|
21275
|
+
return put(setUnreadScrollToAC(true));
|
|
21276
|
+
case 53:
|
|
21277
|
+
_context10.n = 70;
|
|
21173
21278
|
break;
|
|
21174
|
-
case
|
|
21279
|
+
case 54:
|
|
21175
21280
|
if (!(cachedMessages && cachedMessages.length)) {
|
|
21176
|
-
_context10.n =
|
|
21281
|
+
_context10.n = 57;
|
|
21177
21282
|
break;
|
|
21178
21283
|
}
|
|
21179
|
-
|
|
21180
|
-
|
|
21181
|
-
|
|
21182
|
-
|
|
21284
|
+
_messages = getFromAllMessagesByMessageId('', '', true);
|
|
21285
|
+
_context10.n = 55;
|
|
21286
|
+
return put(setMessagesAC(JSON.parse(JSON.stringify(_messages))));
|
|
21287
|
+
case 55:
|
|
21288
|
+
_context10.n = 56;
|
|
21183
21289
|
return delay(0);
|
|
21184
|
-
case
|
|
21185
|
-
_filteredPendingMessages = getFilteredPendingMessages(
|
|
21186
|
-
_context10.n =
|
|
21290
|
+
case 56:
|
|
21291
|
+
_filteredPendingMessages = getFilteredPendingMessages(_messages);
|
|
21292
|
+
_context10.n = 57;
|
|
21187
21293
|
return put(addMessagesAC(_filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21188
|
-
case
|
|
21294
|
+
case 57:
|
|
21189
21295
|
log.info('load message from server');
|
|
21190
21296
|
result = {
|
|
21191
21297
|
messages: [],
|
|
21192
21298
|
hasNext: false
|
|
21193
21299
|
};
|
|
21194
21300
|
if (!((channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId) > (channel === null || channel === void 0 ? void 0 : (_channel$lastMessage4 = channel.lastMessage) === null || _channel$lastMessage4 === void 0 ? void 0 : _channel$lastMessage4.id))) {
|
|
21195
|
-
_context10.n =
|
|
21301
|
+
_context10.n = 61;
|
|
21196
21302
|
break;
|
|
21197
21303
|
}
|
|
21198
21304
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21199
|
-
_context10.n =
|
|
21305
|
+
_context10.n = 59;
|
|
21200
21306
|
break;
|
|
21201
21307
|
}
|
|
21202
|
-
_context10.n =
|
|
21308
|
+
_context10.n = 58;
|
|
21203
21309
|
return call(messageQuery.loadPreviousMessageId, channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId);
|
|
21204
|
-
case
|
|
21205
|
-
|
|
21206
|
-
_context10.n =
|
|
21310
|
+
case 58:
|
|
21311
|
+
_t16 = _context10.v;
|
|
21312
|
+
_context10.n = 60;
|
|
21207
21313
|
break;
|
|
21208
|
-
case
|
|
21209
|
-
|
|
21314
|
+
case 59:
|
|
21315
|
+
_t16 = {
|
|
21210
21316
|
messages: [],
|
|
21211
21317
|
hasNext: false
|
|
21212
21318
|
};
|
|
21213
|
-
case
|
|
21214
|
-
result =
|
|
21215
|
-
_context10.n =
|
|
21319
|
+
case 60:
|
|
21320
|
+
result = _t16;
|
|
21321
|
+
_context10.n = 65;
|
|
21216
21322
|
break;
|
|
21217
|
-
case
|
|
21323
|
+
case 61:
|
|
21218
21324
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21219
|
-
_context10.n =
|
|
21325
|
+
_context10.n = 63;
|
|
21220
21326
|
break;
|
|
21221
21327
|
}
|
|
21222
|
-
_context10.n =
|
|
21328
|
+
_context10.n = 62;
|
|
21223
21329
|
return call(messageQuery.loadPrevious);
|
|
21224
|
-
case
|
|
21225
|
-
|
|
21226
|
-
_context10.n =
|
|
21330
|
+
case 62:
|
|
21331
|
+
_t17 = _context10.v;
|
|
21332
|
+
_context10.n = 64;
|
|
21227
21333
|
break;
|
|
21228
|
-
case
|
|
21229
|
-
|
|
21334
|
+
case 63:
|
|
21335
|
+
_t17 = {
|
|
21230
21336
|
messages: [],
|
|
21231
21337
|
hasNext: false
|
|
21232
21338
|
};
|
|
21233
|
-
case
|
|
21234
|
-
result =
|
|
21235
|
-
case
|
|
21339
|
+
case 64:
|
|
21340
|
+
result = _t17;
|
|
21341
|
+
case 65:
|
|
21236
21342
|
updatedMessages = [];
|
|
21237
21343
|
result.messages.forEach(function (msg) {
|
|
21238
21344
|
var updatedMessage = updateMessageOnMap(channel.id, {
|
|
@@ -21244,75 +21350,85 @@ function getMessagesQuery(action) {
|
|
|
21244
21350
|
});
|
|
21245
21351
|
messageIdForLoad = (channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId) > (channel === null || channel === void 0 ? void 0 : (_channel$lastMessage5 = channel.lastMessage) === null || _channel$lastMessage5 === void 0 ? void 0 : _channel$lastMessage5.id) ? (channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId) || '0' : (channel === null || channel === void 0 ? void 0 : (_channel$lastMessage6 = channel.lastMessage) === null || _channel$lastMessage6 === void 0 ? void 0 : _channel$lastMessage6.id) || '0';
|
|
21246
21352
|
if (!updatedMessages.length) {
|
|
21247
|
-
_context10.n =
|
|
21353
|
+
_context10.n = 69;
|
|
21248
21354
|
break;
|
|
21249
21355
|
}
|
|
21250
|
-
_context10.n =
|
|
21356
|
+
_context10.n = 66;
|
|
21251
21357
|
return call(updateMessages, channel, updatedMessages, (_updatedMessages$ = updatedMessages[0]) === null || _updatedMessages$ === void 0 ? void 0 : _updatedMessages$.id, messageIdForLoad);
|
|
21252
|
-
case
|
|
21253
|
-
_context10.n =
|
|
21358
|
+
case 66:
|
|
21359
|
+
_context10.n = 67;
|
|
21254
21360
|
return put(setMessagesHasPrevAC(true));
|
|
21255
|
-
case
|
|
21256
|
-
_context10.n =
|
|
21361
|
+
case 67:
|
|
21362
|
+
_context10.n = 68;
|
|
21257
21363
|
return put(setMessagesHasNextAC(false));
|
|
21258
|
-
case
|
|
21364
|
+
case 68:
|
|
21365
|
+
_context10.n = 70;
|
|
21366
|
+
break;
|
|
21367
|
+
case 69:
|
|
21368
|
+
if (!(!(cachedMessages !== null && cachedMessages !== void 0 && cachedMessages.length) && !((_result$messages4 = result.messages) !== null && _result$messages4 !== void 0 && _result$messages4.length))) {
|
|
21369
|
+
_context10.n = 70;
|
|
21370
|
+
break;
|
|
21371
|
+
}
|
|
21372
|
+
_context10.n = 70;
|
|
21373
|
+
return put(setMessagesAC([]));
|
|
21374
|
+
case 70:
|
|
21259
21375
|
filteredPendingMessages = getFilteredPendingMessages(result.messages);
|
|
21260
|
-
_context10.n =
|
|
21376
|
+
_context10.n = 71;
|
|
21261
21377
|
return put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21262
|
-
case
|
|
21378
|
+
case 71:
|
|
21263
21379
|
waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
|
|
21264
21380
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED && waitToSendPendingMessages)) {
|
|
21265
|
-
_context10.n =
|
|
21381
|
+
_context10.n = 73;
|
|
21266
21382
|
break;
|
|
21267
21383
|
}
|
|
21268
|
-
_context10.n =
|
|
21384
|
+
_context10.n = 72;
|
|
21269
21385
|
return put(setWaitToSendPendingMessagesAC(false));
|
|
21270
|
-
case
|
|
21271
|
-
_context10.n =
|
|
21386
|
+
case 72:
|
|
21387
|
+
_context10.n = 73;
|
|
21272
21388
|
return spawn(sendPendingMessages, connectionState);
|
|
21273
|
-
case
|
|
21274
|
-
_context10.n =
|
|
21389
|
+
case 73:
|
|
21390
|
+
_context10.n = 74;
|
|
21275
21391
|
return call(SceytChatClient.getChannel, channel.id, true);
|
|
21276
|
-
case
|
|
21392
|
+
case 74:
|
|
21277
21393
|
updatedChannel = _context10.v;
|
|
21278
21394
|
if (!(updatedChannel && updatedChannel !== null && updatedChannel !== void 0 && updatedChannel.lastMessage)) {
|
|
21279
|
-
_context10.n =
|
|
21395
|
+
_context10.n = 76;
|
|
21280
21396
|
break;
|
|
21281
21397
|
}
|
|
21282
|
-
_context10.n =
|
|
21398
|
+
_context10.n = 75;
|
|
21283
21399
|
return put(updateChannelLastMessageAC(updatedChannel.lastMessage, updatedChannel));
|
|
21284
|
-
case
|
|
21400
|
+
case 75:
|
|
21285
21401
|
updateChannelLastMessageOnAllChannels(channel.id, updatedChannel.lastMessage);
|
|
21286
|
-
case
|
|
21287
|
-
_context10.n =
|
|
21402
|
+
case 76:
|
|
21403
|
+
_context10.n = 78;
|
|
21288
21404
|
break;
|
|
21289
|
-
case
|
|
21405
|
+
case 77:
|
|
21290
21406
|
if (!(channel !== null && channel !== void 0 && channel.isMockChannel)) {
|
|
21291
|
-
_context10.n =
|
|
21407
|
+
_context10.n = 78;
|
|
21292
21408
|
break;
|
|
21293
21409
|
}
|
|
21294
|
-
_context10.n =
|
|
21410
|
+
_context10.n = 78;
|
|
21295
21411
|
return put(setMessagesAC([]));
|
|
21296
|
-
case
|
|
21297
|
-
_context10.n =
|
|
21412
|
+
case 78:
|
|
21413
|
+
_context10.n = 80;
|
|
21298
21414
|
break;
|
|
21299
|
-
case
|
|
21300
|
-
_context10.p =
|
|
21301
|
-
|
|
21302
|
-
log.error('error in message query',
|
|
21303
|
-
case
|
|
21304
|
-
_context10.p =
|
|
21305
|
-
_context10.n =
|
|
21415
|
+
case 79:
|
|
21416
|
+
_context10.p = 79;
|
|
21417
|
+
_t18 = _context10.v;
|
|
21418
|
+
log.error('error in message query', _t18);
|
|
21419
|
+
case 80:
|
|
21420
|
+
_context10.p = 80;
|
|
21421
|
+
_context10.n = 81;
|
|
21306
21422
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
21307
|
-
case
|
|
21308
|
-
return _context10.f(
|
|
21309
|
-
case
|
|
21423
|
+
case 81:
|
|
21424
|
+
return _context10.f(80);
|
|
21425
|
+
case 82:
|
|
21310
21426
|
return _context10.a(2);
|
|
21311
21427
|
}
|
|
21312
|
-
}, _marked7$1, null, [[0,
|
|
21428
|
+
}, _marked7$1, null, [[2, 7], [0, 79, 80, 82]]);
|
|
21313
21429
|
}
|
|
21314
21430
|
function getMessageQuery(action) {
|
|
21315
|
-
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage,
|
|
21431
|
+
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage, _t19;
|
|
21316
21432
|
return _regenerator().w(function (_context11) {
|
|
21317
21433
|
while (1) switch (_context11.p = _context11.n) {
|
|
21318
21434
|
case 0:
|
|
@@ -21362,15 +21478,15 @@ function getMessageQuery(action) {
|
|
|
21362
21478
|
break;
|
|
21363
21479
|
case 7:
|
|
21364
21480
|
_context11.p = 7;
|
|
21365
|
-
|
|
21366
|
-
log.error('error in message query',
|
|
21481
|
+
_t19 = _context11.v;
|
|
21482
|
+
log.error('error in message query', _t19);
|
|
21367
21483
|
case 8:
|
|
21368
21484
|
return _context11.a(2);
|
|
21369
21485
|
}
|
|
21370
21486
|
}, _marked8$1, null, [[0, 7]]);
|
|
21371
21487
|
}
|
|
21372
21488
|
function loadMoreMessages(action) {
|
|
21373
|
-
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _result$messages$4, _result$
|
|
21489
|
+
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _result$messages$4, _result$messages5, _result$messages$5, _result$messages6, _t20;
|
|
21374
21490
|
return _regenerator().w(function (_context12) {
|
|
21375
21491
|
while (1) switch (_context12.p = _context12.n) {
|
|
21376
21492
|
case 0:
|
|
@@ -21414,7 +21530,7 @@ function loadMoreMessages(action) {
|
|
|
21414
21530
|
result = _context12.v;
|
|
21415
21531
|
if (result.messages.length) {
|
|
21416
21532
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.PREV);
|
|
21417
|
-
setMessagesToMap(channelId, result.messages, (_result$messages$4 = result.messages[0]) === null || _result$messages$4 === void 0 ? void 0 : _result$messages$4.id, (_result$
|
|
21533
|
+
setMessagesToMap(channelId, result.messages, (_result$messages$4 = result.messages[0]) === null || _result$messages$4 === void 0 ? void 0 : _result$messages$4.id, (_result$messages5 = result.messages[result.messages.length - 1]) === null || _result$messages5 === void 0 ? void 0 : _result$messages5.id);
|
|
21418
21534
|
}
|
|
21419
21535
|
_context12.n = 5;
|
|
21420
21536
|
return put(setMessagesHasPrevAC(result.hasNext));
|
|
@@ -21442,7 +21558,7 @@ function loadMoreMessages(action) {
|
|
|
21442
21558
|
result = _context12.v;
|
|
21443
21559
|
if (result.messages.length) {
|
|
21444
21560
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.NEXT);
|
|
21445
|
-
setMessagesToMap(channelId, result.messages, (_result$messages$5 = result.messages[0]) === null || _result$messages$5 === void 0 ? void 0 : _result$messages$5.id, (_result$
|
|
21561
|
+
setMessagesToMap(channelId, result.messages, (_result$messages$5 = result.messages[0]) === null || _result$messages$5 === void 0 ? void 0 : _result$messages$5.id, (_result$messages6 = result.messages[result.messages.length - 1]) === null || _result$messages6 === void 0 ? void 0 : _result$messages6.id);
|
|
21446
21562
|
}
|
|
21447
21563
|
_context12.n = 9;
|
|
21448
21564
|
return put(setMessagesHasNextAC(result.hasNext));
|
|
@@ -21483,15 +21599,15 @@ function loadMoreMessages(action) {
|
|
|
21483
21599
|
break;
|
|
21484
21600
|
case 18:
|
|
21485
21601
|
_context12.p = 18;
|
|
21486
|
-
|
|
21487
|
-
log.error('error in load more messages',
|
|
21602
|
+
_t20 = _context12.v;
|
|
21603
|
+
log.error('error in load more messages', _t20);
|
|
21488
21604
|
case 19:
|
|
21489
21605
|
return _context12.a(2);
|
|
21490
21606
|
}
|
|
21491
21607
|
}, _marked9$1, null, [[0, 18]]);
|
|
21492
21608
|
}
|
|
21493
21609
|
function addReaction(action) {
|
|
21494
|
-
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam,
|
|
21610
|
+
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam, _t21;
|
|
21495
21611
|
return _regenerator().w(function (_context13) {
|
|
21496
21612
|
while (1) switch (_context13.p = _context13.n) {
|
|
21497
21613
|
case 0:
|
|
@@ -21544,15 +21660,15 @@ function addReaction(action) {
|
|
|
21544
21660
|
break;
|
|
21545
21661
|
case 8:
|
|
21546
21662
|
_context13.p = 8;
|
|
21547
|
-
|
|
21548
|
-
log.error('ERROR in add reaction',
|
|
21663
|
+
_t21 = _context13.v;
|
|
21664
|
+
log.error('ERROR in add reaction', _t21.message);
|
|
21549
21665
|
case 9:
|
|
21550
21666
|
return _context13.a(2);
|
|
21551
21667
|
}
|
|
21552
21668
|
}, _marked0$1, null, [[0, 8]]);
|
|
21553
21669
|
}
|
|
21554
21670
|
function deleteReaction(action) {
|
|
21555
|
-
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam,
|
|
21671
|
+
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam, _t22;
|
|
21556
21672
|
return _regenerator().w(function (_context14) {
|
|
21557
21673
|
while (1) switch (_context14.p = _context14.n) {
|
|
21558
21674
|
case 0:
|
|
@@ -21600,15 +21716,15 @@ function deleteReaction(action) {
|
|
|
21600
21716
|
break;
|
|
21601
21717
|
case 7:
|
|
21602
21718
|
_context14.p = 7;
|
|
21603
|
-
|
|
21604
|
-
log.error('ERROR in delete reaction',
|
|
21719
|
+
_t22 = _context14.v;
|
|
21720
|
+
log.error('ERROR in delete reaction', _t22.message);
|
|
21605
21721
|
case 8:
|
|
21606
21722
|
return _context14.a(2);
|
|
21607
21723
|
}
|
|
21608
21724
|
}, _marked1$1, null, [[0, 7]]);
|
|
21609
21725
|
}
|
|
21610
21726
|
function getReactions(action) {
|
|
21611
|
-
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result,
|
|
21727
|
+
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result, _t23;
|
|
21612
21728
|
return _regenerator().w(function (_context15) {
|
|
21613
21729
|
while (1) switch (_context15.p = _context15.n) {
|
|
21614
21730
|
case 0:
|
|
@@ -21643,15 +21759,15 @@ function getReactions(action) {
|
|
|
21643
21759
|
break;
|
|
21644
21760
|
case 6:
|
|
21645
21761
|
_context15.p = 6;
|
|
21646
|
-
|
|
21647
|
-
log.error('ERROR in get reactions',
|
|
21762
|
+
_t23 = _context15.v;
|
|
21763
|
+
log.error('ERROR in get reactions', _t23.message);
|
|
21648
21764
|
case 7:
|
|
21649
21765
|
return _context15.a(2);
|
|
21650
21766
|
}
|
|
21651
21767
|
}, _marked10$1, null, [[0, 6]]);
|
|
21652
21768
|
}
|
|
21653
21769
|
function loadMoreReactions(action) {
|
|
21654
|
-
var payload, limit, ReactionQuery, result,
|
|
21770
|
+
var payload, limit, ReactionQuery, result, _t24;
|
|
21655
21771
|
return _regenerator().w(function (_context16) {
|
|
21656
21772
|
while (1) switch (_context16.p = _context16.n) {
|
|
21657
21773
|
case 0:
|
|
@@ -21679,15 +21795,15 @@ function loadMoreReactions(action) {
|
|
|
21679
21795
|
break;
|
|
21680
21796
|
case 5:
|
|
21681
21797
|
_context16.p = 5;
|
|
21682
|
-
|
|
21683
|
-
log.error('ERROR in load more reactions',
|
|
21798
|
+
_t24 = _context16.v;
|
|
21799
|
+
log.error('ERROR in load more reactions', _t24.message);
|
|
21684
21800
|
case 6:
|
|
21685
21801
|
return _context16.a(2);
|
|
21686
21802
|
}
|
|
21687
21803
|
}, _marked11$1, null, [[0, 5]]);
|
|
21688
21804
|
}
|
|
21689
21805
|
function getMessageAttachments(action) {
|
|
21690
|
-
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result,
|
|
21806
|
+
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, _t25;
|
|
21691
21807
|
return _regenerator().w(function (_context17) {
|
|
21692
21808
|
while (1) switch (_context17.p = _context17.n) {
|
|
21693
21809
|
case 0:
|
|
@@ -21765,15 +21881,15 @@ function getMessageAttachments(action) {
|
|
|
21765
21881
|
break;
|
|
21766
21882
|
case 13:
|
|
21767
21883
|
_context17.p = 13;
|
|
21768
|
-
|
|
21769
|
-
log.error('error in message attachment query',
|
|
21884
|
+
_t25 = _context17.v;
|
|
21885
|
+
log.error('error in message attachment query', _t25);
|
|
21770
21886
|
case 14:
|
|
21771
21887
|
return _context17.a(2);
|
|
21772
21888
|
}
|
|
21773
21889
|
}, _marked12$1, null, [[0, 13]]);
|
|
21774
21890
|
}
|
|
21775
21891
|
function loadMoreMessageAttachments(action) {
|
|
21776
|
-
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext,
|
|
21892
|
+
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext, _t26;
|
|
21777
21893
|
return _regenerator().w(function (_context18) {
|
|
21778
21894
|
while (1) switch (_context18.p = _context18.n) {
|
|
21779
21895
|
case 0:
|
|
@@ -21817,15 +21933,15 @@ function loadMoreMessageAttachments(action) {
|
|
|
21817
21933
|
break;
|
|
21818
21934
|
case 8:
|
|
21819
21935
|
_context18.p = 8;
|
|
21820
|
-
|
|
21821
|
-
log.error('error in message attachment query',
|
|
21936
|
+
_t26 = _context18.v;
|
|
21937
|
+
log.error('error in message attachment query', _t26);
|
|
21822
21938
|
case 9:
|
|
21823
21939
|
return _context18.a(2);
|
|
21824
21940
|
}
|
|
21825
21941
|
}, _marked13$1, null, [[0, 8]]);
|
|
21826
21942
|
}
|
|
21827
21943
|
function pauseAttachmentUploading(action) {
|
|
21828
|
-
var attachmentId, isPaused,
|
|
21944
|
+
var attachmentId, isPaused, _t27;
|
|
21829
21945
|
return _regenerator().w(function (_context19) {
|
|
21830
21946
|
while (1) switch (_context19.p = _context19.n) {
|
|
21831
21947
|
case 0:
|
|
@@ -21847,15 +21963,15 @@ function pauseAttachmentUploading(action) {
|
|
|
21847
21963
|
break;
|
|
21848
21964
|
case 2:
|
|
21849
21965
|
_context19.p = 2;
|
|
21850
|
-
|
|
21851
|
-
log.error('error in pause attachment uploading',
|
|
21966
|
+
_t27 = _context19.v;
|
|
21967
|
+
log.error('error in pause attachment uploading', _t27);
|
|
21852
21968
|
case 3:
|
|
21853
21969
|
return _context19.a(2);
|
|
21854
21970
|
}
|
|
21855
21971
|
}, _marked14$1, null, [[0, 2]]);
|
|
21856
21972
|
}
|
|
21857
21973
|
function resumeAttachmentUploading(action) {
|
|
21858
|
-
var attachmentId, isResumed,
|
|
21974
|
+
var attachmentId, isResumed, _t28;
|
|
21859
21975
|
return _regenerator().w(function (_context20) {
|
|
21860
21976
|
while (1) switch (_context20.p = _context20.n) {
|
|
21861
21977
|
case 0:
|
|
@@ -21878,15 +21994,15 @@ function resumeAttachmentUploading(action) {
|
|
|
21878
21994
|
break;
|
|
21879
21995
|
case 2:
|
|
21880
21996
|
_context20.p = 2;
|
|
21881
|
-
|
|
21882
|
-
log.error('error in resume attachment uploading',
|
|
21997
|
+
_t28 = _context20.v;
|
|
21998
|
+
log.error('error in resume attachment uploading', _t28);
|
|
21883
21999
|
case 3:
|
|
21884
22000
|
return _context20.a(2);
|
|
21885
22001
|
}
|
|
21886
22002
|
}, _marked15$1, null, [[0, 2]]);
|
|
21887
22003
|
}
|
|
21888
22004
|
function getMessageMarkers(action) {
|
|
21889
|
-
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers,
|
|
22005
|
+
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers, _t29;
|
|
21890
22006
|
return _regenerator().w(function (_context21) {
|
|
21891
22007
|
while (1) switch (_context21.p = _context21.n) {
|
|
21892
22008
|
case 0:
|
|
@@ -21916,8 +22032,8 @@ function getMessageMarkers(action) {
|
|
|
21916
22032
|
break;
|
|
21917
22033
|
case 5:
|
|
21918
22034
|
_context21.p = 5;
|
|
21919
|
-
|
|
21920
|
-
log.error('error in get message markers',
|
|
22035
|
+
_t29 = _context21.v;
|
|
22036
|
+
log.error('error in get message markers', _t29);
|
|
21921
22037
|
case 6:
|
|
21922
22038
|
_context21.p = 6;
|
|
21923
22039
|
_context21.n = 7;
|
|
@@ -22033,7 +22149,7 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
|
22033
22149
|
}, _marked18$1);
|
|
22034
22150
|
}
|
|
22035
22151
|
function addPollVote(action) {
|
|
22036
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence2, user, vote, pendingAction, conflictCheck, channel, _Object$values, _store$getState$Messa, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj,
|
|
22152
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence2, user, vote, pendingAction, conflictCheck, channel, _Object$values, _store$getState$Messa, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj, _t30;
|
|
22037
22153
|
return _regenerator().w(function (_context24) {
|
|
22038
22154
|
while (1) switch (_context24.p = _context24.n) {
|
|
22039
22155
|
case 0:
|
|
@@ -22125,8 +22241,8 @@ function addPollVote(action) {
|
|
|
22125
22241
|
break;
|
|
22126
22242
|
case 7:
|
|
22127
22243
|
_context24.p = 7;
|
|
22128
|
-
|
|
22129
|
-
log.error('error in add poll vote',
|
|
22244
|
+
_t30 = _context24.v;
|
|
22245
|
+
log.error('error in add poll vote', _t30);
|
|
22130
22246
|
case 8:
|
|
22131
22247
|
return _context24.a(2);
|
|
22132
22248
|
}
|
|
@@ -22210,7 +22326,7 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
|
|
|
22210
22326
|
}, _marked21$1);
|
|
22211
22327
|
}
|
|
22212
22328
|
function deletePollVote(action) {
|
|
22213
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11, vote, pendingAction, conflictCheck, channel, _Object$values2, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj,
|
|
22329
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11, vote, pendingAction, conflictCheck, channel, _Object$values2, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj, _t31;
|
|
22214
22330
|
return _regenerator().w(function (_context27) {
|
|
22215
22331
|
while (1) switch (_context27.p = _context27.n) {
|
|
22216
22332
|
case 0:
|
|
@@ -22288,8 +22404,8 @@ function deletePollVote(action) {
|
|
|
22288
22404
|
break;
|
|
22289
22405
|
case 8:
|
|
22290
22406
|
_context27.p = 8;
|
|
22291
|
-
|
|
22292
|
-
log.error('error in delete poll vote',
|
|
22407
|
+
_t31 = _context27.v;
|
|
22408
|
+
log.error('error in delete poll vote', _t31);
|
|
22293
22409
|
case 9:
|
|
22294
22410
|
return _context27.a(2);
|
|
22295
22411
|
}
|
|
@@ -22367,7 +22483,7 @@ function updateMessageOptimisticallyForClosePoll(channelId, message) {
|
|
|
22367
22483
|
}, _marked24$1);
|
|
22368
22484
|
}
|
|
22369
22485
|
function closePoll(action) {
|
|
22370
|
-
var payload, channelId, pollId, message, sceytChatClient, connectionState,
|
|
22486
|
+
var payload, channelId, pollId, message, sceytChatClient, connectionState, _t32;
|
|
22371
22487
|
return _regenerator().w(function (_context30) {
|
|
22372
22488
|
while (1) switch (_context30.p = _context30.n) {
|
|
22373
22489
|
case 0:
|
|
@@ -22400,8 +22516,8 @@ function closePoll(action) {
|
|
|
22400
22516
|
break;
|
|
22401
22517
|
case 4:
|
|
22402
22518
|
_context30.p = 4;
|
|
22403
|
-
|
|
22404
|
-
log.error('error in close poll',
|
|
22519
|
+
_t32 = _context30.v;
|
|
22520
|
+
log.error('error in close poll', _t32);
|
|
22405
22521
|
case 5:
|
|
22406
22522
|
return _context30.a(2);
|
|
22407
22523
|
}
|
|
@@ -22490,7 +22606,7 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
|
|
|
22490
22606
|
}, _marked27$1);
|
|
22491
22607
|
}
|
|
22492
22608
|
function retractPollVote(action) {
|
|
22493
|
-
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator4, _step4, _message$pollDetails12, _message$pollDetails13, vote,
|
|
22609
|
+
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator4, _step4, _message$pollDetails12, _message$pollDetails13, vote, _t33;
|
|
22494
22610
|
return _regenerator().w(function (_context33) {
|
|
22495
22611
|
while (1) switch (_context33.p = _context33.n) {
|
|
22496
22612
|
case 0:
|
|
@@ -22532,15 +22648,15 @@ function retractPollVote(action) {
|
|
|
22532
22648
|
break;
|
|
22533
22649
|
case 4:
|
|
22534
22650
|
_context33.p = 4;
|
|
22535
|
-
|
|
22536
|
-
log.error('error in retract poll vote',
|
|
22651
|
+
_t33 = _context33.v;
|
|
22652
|
+
log.error('error in retract poll vote', _t33);
|
|
22537
22653
|
case 5:
|
|
22538
22654
|
return _context33.a(2);
|
|
22539
22655
|
}
|
|
22540
22656
|
}, _marked28$1, null, [[0, 4]]);
|
|
22541
22657
|
}
|
|
22542
22658
|
function resendPendingPollActions(action) {
|
|
22543
|
-
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy,
|
|
22659
|
+
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy, _t34;
|
|
22544
22660
|
return _regenerator().w(function (_context34) {
|
|
22545
22661
|
while (1) switch (_context34.p = _context34.n) {
|
|
22546
22662
|
case 0:
|
|
@@ -22589,15 +22705,15 @@ function resendPendingPollActions(action) {
|
|
|
22589
22705
|
break;
|
|
22590
22706
|
case 2:
|
|
22591
22707
|
_context34.p = 2;
|
|
22592
|
-
|
|
22593
|
-
log.error('error in resend pending poll actions',
|
|
22708
|
+
_t34 = _context34.v;
|
|
22709
|
+
log.error('error in resend pending poll actions', _t34);
|
|
22594
22710
|
case 3:
|
|
22595
22711
|
return _context34.a(2);
|
|
22596
22712
|
}
|
|
22597
22713
|
}, _marked29$1, null, [[0, 2]]);
|
|
22598
22714
|
}
|
|
22599
22715
|
function getPollVotes(action) {
|
|
22600
|
-
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes,
|
|
22716
|
+
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes, _t35;
|
|
22601
22717
|
return _regenerator().w(function (_context35) {
|
|
22602
22718
|
while (1) switch (_context35.p = _context35.n) {
|
|
22603
22719
|
case 0:
|
|
@@ -22663,8 +22779,8 @@ function getPollVotes(action) {
|
|
|
22663
22779
|
break;
|
|
22664
22780
|
case 7:
|
|
22665
22781
|
_context35.p = 7;
|
|
22666
|
-
|
|
22667
|
-
log.error('ERROR in get poll votes',
|
|
22782
|
+
_t35 = _context35.v;
|
|
22783
|
+
log.error('ERROR in get poll votes', _t35);
|
|
22668
22784
|
_context35.n = 8;
|
|
22669
22785
|
return put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
22670
22786
|
case 8:
|
|
@@ -22673,7 +22789,7 @@ function getPollVotes(action) {
|
|
|
22673
22789
|
}, _marked30$1, null, [[0, 7]]);
|
|
22674
22790
|
}
|
|
22675
22791
|
function loadMorePollVotes(action) {
|
|
22676
|
-
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes,
|
|
22792
|
+
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes, _t36;
|
|
22677
22793
|
return _regenerator().w(function (_context36) {
|
|
22678
22794
|
while (1) switch (_context36.p = _context36.n) {
|
|
22679
22795
|
case 0:
|
|
@@ -22731,8 +22847,8 @@ function loadMorePollVotes(action) {
|
|
|
22731
22847
|
break;
|
|
22732
22848
|
case 6:
|
|
22733
22849
|
_context36.p = 6;
|
|
22734
|
-
|
|
22735
|
-
log.error('ERROR in load more poll votes',
|
|
22850
|
+
_t36 = _context36.v;
|
|
22851
|
+
log.error('ERROR in load more poll votes', _t36);
|
|
22736
22852
|
_context36.n = 7;
|
|
22737
22853
|
return put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
22738
22854
|
case 7:
|
|
@@ -27874,7 +27990,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
27874
27990
|
loadMoreChannels: handleLoadMoreChannels,
|
|
27875
27991
|
searchValue: searchValue
|
|
27876
27992
|
}, !searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, channels.map(function (channel) {
|
|
27877
|
-
return ListItem ? (/*#__PURE__*/React__default.createElement(ListItem, {
|
|
27993
|
+
return !getPendingDeleteChannel(channel.id) && (ListItem ? (/*#__PURE__*/React__default.createElement(ListItem, {
|
|
27878
27994
|
channel: channel,
|
|
27879
27995
|
setSelectedChannel: setSelectedChannel,
|
|
27880
27996
|
key: channel.id
|
|
@@ -27907,7 +28023,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
27907
28023
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
27908
28024
|
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
27909
28025
|
showPhoneNumber: showPhoneNumber
|
|
27910
|
-
}));
|
|
28026
|
+
})));
|
|
27911
28027
|
}))) : channelsLoading === LOADING_STATE.LOADED && searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha = searchedChannels.chats_groups) !== null && _searchedChannels$cha !== void 0 && _searchedChannels$cha.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha2 = searchedChannels.channels) !== null && _searchedChannels$cha2 !== void 0 && _searchedChannels$cha2.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$con = searchedChannels.contacts) !== null && _searchedChannels$con !== void 0 && _searchedChannels$con.length ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, !!(searchedChannels.chats_groups && searchedChannels.chats_groups.length) && (/*#__PURE__*/React__default.createElement(DirectChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
|
|
27912
28028
|
color: textSecondary,
|
|
27913
28029
|
fontSize: searchedChannelsTitleFontSize
|
|
@@ -28591,6 +28707,9 @@ var pollVotesLoadingStateSelector = function pollVotesLoadingStateSelector(store
|
|
|
28591
28707
|
var unreadScrollToSelector = function unreadScrollToSelector(store) {
|
|
28592
28708
|
return store.MessageReducer.unreadScrollTo;
|
|
28593
28709
|
};
|
|
28710
|
+
var unreadMessageIdSelector = function unreadMessageIdSelector(store) {
|
|
28711
|
+
return store.MessageReducer.unreadMessageId;
|
|
28712
|
+
};
|
|
28594
28713
|
|
|
28595
28714
|
var _path$v;
|
|
28596
28715
|
function _extends$w() {
|
|
@@ -39145,42 +39264,40 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39145
39264
|
var showScrollToNewMessageButton = useSelector(showScrollToNewMessageButtonSelector, shallowEqual);
|
|
39146
39265
|
var unreadScrollTo = useSelector(unreadScrollToSelector, shallowEqual);
|
|
39147
39266
|
var messages = useSelector(activeChannelMessagesSelector, shallowEqual) || [];
|
|
39148
|
-
var
|
|
39149
|
-
|
|
39150
|
-
|
|
39267
|
+
var unreadMessageId = useSelector(unreadMessageIdSelector, shallowEqual);
|
|
39268
|
+
var _useState2 = useState(null),
|
|
39269
|
+
mediaFile = _useState2[0],
|
|
39270
|
+
setMediaFile = _useState2[1];
|
|
39151
39271
|
var _useState3 = useState(null),
|
|
39152
|
-
|
|
39153
|
-
|
|
39272
|
+
isDragging = _useState3[0],
|
|
39273
|
+
setIsDragging = _useState3[1];
|
|
39154
39274
|
var _useState4 = useState(null),
|
|
39155
|
-
|
|
39156
|
-
|
|
39157
|
-
var _useState5 = useState(
|
|
39158
|
-
|
|
39159
|
-
|
|
39275
|
+
showTopDate = _useState4[0],
|
|
39276
|
+
setShowTopDate = _useState4[1];
|
|
39277
|
+
var _useState5 = useState(false),
|
|
39278
|
+
stopScrolling = _useState5[0],
|
|
39279
|
+
setStopScrolling = _useState5[1];
|
|
39160
39280
|
var _useState6 = useState(false),
|
|
39161
|
-
|
|
39162
|
-
|
|
39163
|
-
var _useState7 = useState(false),
|
|
39164
|
-
isScrolling = _useState7[0],
|
|
39165
|
-
setIsScrolling = _useState7[1];
|
|
39281
|
+
isScrolling = _useState6[0],
|
|
39282
|
+
setIsScrolling = _useState6[1];
|
|
39166
39283
|
var hideTopDateTimeout = useRef(null);
|
|
39167
|
-
var
|
|
39168
|
-
lastVisibleMessageId =
|
|
39169
|
-
_setLastVisibleMessageId =
|
|
39170
|
-
var
|
|
39171
|
-
scrollToReply =
|
|
39172
|
-
setScrollToReply =
|
|
39173
|
-
var
|
|
39174
|
-
previousScrollTop =
|
|
39175
|
-
setPreviousScrollTop =
|
|
39176
|
-
var
|
|
39177
|
-
shouldPreserveScroll =
|
|
39178
|
-
setShouldPreserveScroll =
|
|
39284
|
+
var _useState7 = useState(''),
|
|
39285
|
+
lastVisibleMessageId = _useState7[0],
|
|
39286
|
+
_setLastVisibleMessageId = _useState7[1];
|
|
39287
|
+
var _useState8 = useState(null),
|
|
39288
|
+
scrollToReply = _useState8[0],
|
|
39289
|
+
setScrollToReply = _useState8[1];
|
|
39290
|
+
var _useState9 = useState(0),
|
|
39291
|
+
previousScrollTop = _useState9[0],
|
|
39292
|
+
setPreviousScrollTop = _useState9[1];
|
|
39293
|
+
var _useState0 = useState(false),
|
|
39294
|
+
shouldPreserveScroll = _useState0[0],
|
|
39295
|
+
setShouldPreserveScroll = _useState0[1];
|
|
39179
39296
|
var messageForReply = {};
|
|
39180
39297
|
var attachmentsSelected = false;
|
|
39181
|
-
var
|
|
39182
|
-
topDateLabel =
|
|
39183
|
-
setTopDateLabel =
|
|
39298
|
+
var _useState1 = useState(''),
|
|
39299
|
+
topDateLabel = _useState1[0],
|
|
39300
|
+
setTopDateLabel = _useState1[1];
|
|
39184
39301
|
var scrollRef = useRef(null);
|
|
39185
39302
|
var loadFromServerRef = useRef(false);
|
|
39186
39303
|
var loadDirectionRef = useRef('');
|
|
@@ -39515,7 +39632,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39515
39632
|
var visibleMessagesIds = Object.keys(visibleMessages);
|
|
39516
39633
|
var messageId = visibleMessagesIds[visibleMessagesIds.length - 1];
|
|
39517
39634
|
dispatch(getMessagesAC(channel, undefined, messageId, undefined, undefined, 'instant'));
|
|
39518
|
-
|
|
39635
|
+
dispatch(setUnreadMessageIdAC(messageId));
|
|
39519
39636
|
} else {
|
|
39520
39637
|
if (!channel.isLinkedChannel) {
|
|
39521
39638
|
clearVisibleMessagesMap();
|
|
@@ -39525,9 +39642,9 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39525
39642
|
}
|
|
39526
39643
|
if (channel.id) {
|
|
39527
39644
|
if (channel.newMessageCount && channel.newMessageCount > 0) {
|
|
39528
|
-
|
|
39645
|
+
dispatch(setUnreadMessageIdAC(channel.lastDisplayedMessageId));
|
|
39529
39646
|
} else {
|
|
39530
|
-
|
|
39647
|
+
dispatch(setUnreadMessageIdAC(''));
|
|
39531
39648
|
}
|
|
39532
39649
|
}
|
|
39533
39650
|
}
|
|
@@ -39551,7 +39668,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39551
39668
|
if (messages.length > 0 && hiddenMessagesProperties !== null && hiddenMessagesProperties !== void 0 && hiddenMessagesProperties.includes(HiddenMessageProperty.hideAfterSendMessage)) {
|
|
39552
39669
|
var lastMessage = messages[messages.length - 1];
|
|
39553
39670
|
if (lastMessage.user.id === user.id) {
|
|
39554
|
-
|
|
39671
|
+
dispatch(setUnreadMessageIdAC(''));
|
|
39555
39672
|
}
|
|
39556
39673
|
}
|
|
39557
39674
|
}, [messages, hiddenMessagesProperties, user === null || user === void 0 ? void 0 : user.id]);
|
|
@@ -39672,12 +39789,14 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39672
39789
|
useEffect(function () {
|
|
39673
39790
|
log.info('connection status is changed.. .... ', connectionStatus, 'channel ... ', channel);
|
|
39674
39791
|
if (connectionStatus === CONNECTION_STATUS.CONNECTED && channel !== null && channel !== void 0 && channel.id) {
|
|
39792
|
+
var _channel$lastMessage4;
|
|
39675
39793
|
loadingRef.current = false;
|
|
39676
39794
|
prevDisableRef.current = false;
|
|
39677
39795
|
nextDisableRef.current = false;
|
|
39678
39796
|
clearMessagesMap();
|
|
39679
39797
|
removeAllMessages();
|
|
39680
|
-
|
|
39798
|
+
var isWithLastVisibleMessageId = lastVisibleMessageId !== ((_channel$lastMessage4 = channel.lastMessage) === null || _channel$lastMessage4 === void 0 ? void 0 : _channel$lastMessage4.id) && lastVisibleMessageId ? lastVisibleMessageId : '';
|
|
39799
|
+
dispatch(getMessagesAC(channel, false, isWithLastVisibleMessageId, 0, false, 'instant', false, true));
|
|
39681
39800
|
}
|
|
39682
39801
|
}, [connectionStatus]);
|
|
39683
39802
|
useEffect(function () {
|