sceyt-chat-react-uikit 1.8.8-beta.2 → 1.8.8-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Channel/index.test.d.ts +1 -0
- package/index.js +512 -406
- package/index.modern.js +512 -406
- package/package.json +1 -1
- package/types/index.d.ts +7 -1
package/index.js
CHANGED
|
@@ -10468,17 +10468,21 @@ function setMessageToEditAC(message) {
|
|
|
10468
10468
|
message: message
|
|
10469
10469
|
});
|
|
10470
10470
|
}
|
|
10471
|
-
function loadLatestMessagesAC(channel, messageId, networkChanged, applyVisibleWindow) {
|
|
10471
|
+
function loadLatestMessagesAC(channel, messageId, networkChanged, applyVisibleWindow, forceLatestWindow) {
|
|
10472
10472
|
if (applyVisibleWindow === void 0) {
|
|
10473
10473
|
applyVisibleWindow = true;
|
|
10474
10474
|
}
|
|
10475
|
+
if (forceLatestWindow === void 0) {
|
|
10476
|
+
forceLatestWindow = false;
|
|
10477
|
+
}
|
|
10475
10478
|
return {
|
|
10476
10479
|
type: LOAD_LATEST_MESSAGES,
|
|
10477
10480
|
payload: {
|
|
10478
10481
|
channel: channel,
|
|
10479
10482
|
messageId: messageId,
|
|
10480
10483
|
networkChanged: networkChanged,
|
|
10481
|
-
applyVisibleWindow: applyVisibleWindow
|
|
10484
|
+
applyVisibleWindow: applyVisibleWindow,
|
|
10485
|
+
forceLatestWindow: forceLatestWindow
|
|
10482
10486
|
}
|
|
10483
10487
|
};
|
|
10484
10488
|
}
|
|
@@ -16163,6 +16167,9 @@ function sendMessage(action) {
|
|
|
16163
16167
|
}
|
|
16164
16168
|
_messageBuilder = channel.createMessageBuilder();
|
|
16165
16169
|
_messageBuilder.setBody(i === 0 ? message.body : '').setAttachments([]).setBodyAttributes(i === 0 ? message.bodyAttributes : {}).setMentionUserIds(i === 0 ? mentionedUserIds : []).setType(message.type).setDisplayCount(message.type === exports.MESSAGE_TYPE.SYSTEM ? 0 : 1).setSilent(message.type === exports.MESSAGE_TYPE.SYSTEM).setMetadata(i === 0 ? JSON.stringify(message.metadata) : '');
|
|
16170
|
+
if (channel.type === DEFAULT_CHANNEL_TYPE.DIRECT) {
|
|
16171
|
+
_messageBuilder.setDisableMentionsCount(true);
|
|
16172
|
+
}
|
|
16166
16173
|
if (message.parentMessage) {
|
|
16167
16174
|
_messageBuilder.setParentMessageId(message.parentMessage ? message.parentMessage.id : null);
|
|
16168
16175
|
}
|
|
@@ -16234,6 +16241,9 @@ function sendMessage(action) {
|
|
|
16234
16241
|
}
|
|
16235
16242
|
messageBuilder = channel.createMessageBuilder();
|
|
16236
16243
|
messageBuilder.setBody(message.body).setBodyAttributes(message.bodyAttributes).setAttachments(message.attachments).setMentionUserIds(mentionedUserIds).setType(message.type).setDisplayCount(message.type === exports.MESSAGE_TYPE.SYSTEM ? 0 : 1).setSilent(message.type === exports.MESSAGE_TYPE.SYSTEM).setMetadata(JSON.stringify(message.metadata));
|
|
16244
|
+
if (channel.type === DEFAULT_CHANNEL_TYPE.DIRECT) {
|
|
16245
|
+
messageBuilder.setDisableMentionsCount(true);
|
|
16246
|
+
}
|
|
16237
16247
|
if (message.parentMessage) {
|
|
16238
16248
|
messageBuilder.setParentMessageId(message.parentMessage ? message.parentMessage.id : null);
|
|
16239
16249
|
}
|
|
@@ -16530,6 +16540,9 @@ function sendTextMessage(action) {
|
|
|
16530
16540
|
}
|
|
16531
16541
|
messageBuilder = channel.createMessageBuilder();
|
|
16532
16542
|
messageBuilder.setBody(message.body).setBodyAttributes(message.bodyAttributes).setAttachments(attachments).setMentionUserIds(mentionedUserIds).setType(message.type).setDisplayCount((message === null || message === void 0 ? void 0 : message.displayCount) !== undefined ? message.displayCount : message.type === exports.MESSAGE_TYPE.SYSTEM ? 0 : 1).setSilent((message === null || message === void 0 ? void 0 : message.silent) !== undefined ? message.silent : message.type === exports.MESSAGE_TYPE.SYSTEM).setMetadata(JSON.stringify(message.metadata)).setPollDetails(message.pollDetails ? message.pollDetails : null);
|
|
16543
|
+
if (channel.type === DEFAULT_CHANNEL_TYPE.DIRECT) {
|
|
16544
|
+
messageBuilder.setDisableMentionsCount(true);
|
|
16545
|
+
}
|
|
16533
16546
|
if (message.parentMessage) {
|
|
16534
16547
|
messageBuilder.setParentMessageId(message.parentMessage ? message.parentMessage.id : null);
|
|
16535
16548
|
}
|
|
@@ -18649,7 +18662,7 @@ function loadDefaultMessages(action) {
|
|
|
18649
18662
|
}, _marked26, null, [[0, 34, 35, 37]]);
|
|
18650
18663
|
}
|
|
18651
18664
|
function getMessagesQuery(action) {
|
|
18652
|
-
var _action$payload5, channel, limit, networkChanged, _action$payload5$appl, applyVisibleWindow, channelNewMessageCount, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, result, appliedMessages, firstConfirmedMessageId, lastConfirmedMessageId, _channel$lastMessage1, cachedMessages, cacheIsCurrent, _firstConfirmedMessageId2, _lastConfirmedMessageId2, activeMessages, activeConfirmedMessages, sameVisibleWindow, filteredPendingMessages, activeById, changedMessages, waitToSendPendingMessages, _t28, _t29, _t30, _t31;
|
|
18665
|
+
var _action$payload5, channel, limit, networkChanged, _action$payload5$appl, applyVisibleWindow, _action$payload5$forc, forceLatestWindow, channelNewMessageCount, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, result, appliedMessages, firstConfirmedMessageId, lastConfirmedMessageId, _channel$lastMessage1, cachedMessages, cacheIsCurrent, _firstConfirmedMessageId2, _lastConfirmedMessageId2, activeMessages, activeConfirmedMessages, sameVisibleWindow, filteredPendingMessages, activeById, changedMessages, waitToSendPendingMessages, _t28, _t29, _t30, _t31;
|
|
18653
18666
|
return _regenerator().w(function (_context33) {
|
|
18654
18667
|
while (1) switch (_context33.p = _context33.n) {
|
|
18655
18668
|
case 0:
|
|
@@ -18657,7 +18670,7 @@ function getMessagesQuery(action) {
|
|
|
18657
18670
|
_context33.n = 1;
|
|
18658
18671
|
return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADING);
|
|
18659
18672
|
case 1:
|
|
18660
|
-
_action$payload5 = action.payload, channel = _action$payload5.channel, limit = _action$payload5.limit, networkChanged = _action$payload5.networkChanged, _action$payload5$appl = _action$payload5.applyVisibleWindow, applyVisibleWindow = _action$payload5$appl === void 0 ? true : _action$payload5$appl;
|
|
18673
|
+
_action$payload5 = action.payload, channel = _action$payload5.channel, limit = _action$payload5.limit, networkChanged = _action$payload5.networkChanged, _action$payload5$appl = _action$payload5.applyVisibleWindow, applyVisibleWindow = _action$payload5$appl === void 0 ? true : _action$payload5$appl, _action$payload5$forc = _action$payload5.forceLatestWindow, forceLatestWindow = _action$payload5$forc === void 0 ? false : _action$payload5$forc;
|
|
18661
18674
|
channelNewMessageCount = (channel === null || channel === void 0 ? void 0 : channel.newMessageCount) || 0;
|
|
18662
18675
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
18663
18676
|
if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
|
|
@@ -18699,7 +18712,7 @@ function getMessagesQuery(action) {
|
|
|
18699
18712
|
hasNext: false
|
|
18700
18713
|
};
|
|
18701
18714
|
appliedMessages = [];
|
|
18702
|
-
if (!(!networkChanged && channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
18715
|
+
if (!(!networkChanged && !forceLatestWindow && channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
18703
18716
|
_context33.n = 17;
|
|
18704
18717
|
break;
|
|
18705
18718
|
}
|
|
@@ -22212,10 +22225,11 @@ function updateActiveChannelMembersRemove(removedMembers, channelId) {
|
|
|
22212
22225
|
|
|
22213
22226
|
var _marked$2 = /*#__PURE__*/_regenerator().m(handleChannelMessageEvent),
|
|
22214
22227
|
_marked2$2 = /*#__PURE__*/_regenerator().m(handleUnreadMessagesInfoEvent),
|
|
22215
|
-
_marked3$1 = /*#__PURE__*/_regenerator().m(
|
|
22216
|
-
_marked4$1 = /*#__PURE__*/_regenerator().m(
|
|
22217
|
-
_marked5$1 = /*#__PURE__*/_regenerator().m(
|
|
22218
|
-
_marked6$1 = /*#__PURE__*/_regenerator().m(
|
|
22228
|
+
_marked3$1 = /*#__PURE__*/_regenerator().m(handleChannelMarkedAsReadEvent),
|
|
22229
|
+
_marked4$1 = /*#__PURE__*/_regenerator().m(handleMessageMarkersReceivedEvent),
|
|
22230
|
+
_marked5$1 = /*#__PURE__*/_regenerator().m(handleDeleteMessageEvent),
|
|
22231
|
+
_marked6$1 = /*#__PURE__*/_regenerator().m(handleEditMessageEvent),
|
|
22232
|
+
_marked7$1 = /*#__PURE__*/_regenerator().m(watchForEvents);
|
|
22219
22233
|
var getStoredChannel$1 = function getStoredChannel(channelId) {
|
|
22220
22234
|
return getChannelFromMap(channelId) || getChannelFromAllChannels(channelId) || getChannelFromAllChannelsMap(channelId) || null;
|
|
22221
22235
|
};
|
|
@@ -22463,26 +22477,62 @@ function handleUnreadMessagesInfoEvent(args) {
|
|
|
22463
22477
|
}
|
|
22464
22478
|
}, _marked2$2);
|
|
22465
22479
|
}
|
|
22480
|
+
function handleChannelMarkedAsReadEvent(args) {
|
|
22481
|
+
var channel, channelUpdateParams, groupName;
|
|
22482
|
+
return _regenerator().w(function (_context3) {
|
|
22483
|
+
while (1) switch (_context3.n) {
|
|
22484
|
+
case 0:
|
|
22485
|
+
channel = args.channel;
|
|
22486
|
+
if (channel) {
|
|
22487
|
+
_context3.n = 1;
|
|
22488
|
+
break;
|
|
22489
|
+
}
|
|
22490
|
+
return _context3.a(2);
|
|
22491
|
+
case 1:
|
|
22492
|
+
channelUpdateParams = _extends({
|
|
22493
|
+
unread: false,
|
|
22494
|
+
newMessageCount: 0,
|
|
22495
|
+
newMentionCount: 0,
|
|
22496
|
+
muted: channel.muted,
|
|
22497
|
+
mutedTill: channel.mutedTill
|
|
22498
|
+
}, channel.lastReceivedMsgId ? {
|
|
22499
|
+
lastReceivedMsgId: channel.lastReceivedMsgId
|
|
22500
|
+
} : {}, channel.lastDisplayedMessageId ? {
|
|
22501
|
+
lastDisplayedMessageId: channel.lastDisplayedMessageId
|
|
22502
|
+
} : {});
|
|
22503
|
+
_context3.n = 2;
|
|
22504
|
+
return effects.put(updateChannelDataAC(channel.id, channelUpdateParams));
|
|
22505
|
+
case 2:
|
|
22506
|
+
groupName = getChannelGroupName(channel);
|
|
22507
|
+
_context3.n = 3;
|
|
22508
|
+
return effects.put(updateSearchedChannelDataAC(channel.id, channelUpdateParams, groupName));
|
|
22509
|
+
case 3:
|
|
22510
|
+
updateChannelOnAllChannels(channel.id, channelUpdateParams);
|
|
22511
|
+
case 4:
|
|
22512
|
+
return _context3.a(2);
|
|
22513
|
+
}
|
|
22514
|
+
}, _marked3$1);
|
|
22515
|
+
}
|
|
22466
22516
|
function handleMessageMarkersReceivedEvent(args, SceytChatClient) {
|
|
22467
22517
|
var _markerList$user;
|
|
22468
22518
|
var channelId, markerList, channel, isOwnMarker, activeChannelId, updateLastMessage, markersMap, markerUpdateParams, _iterator, _step, messageId, lastMessage;
|
|
22469
|
-
return _regenerator().w(function (
|
|
22470
|
-
while (1) switch (
|
|
22519
|
+
return _regenerator().w(function (_context4) {
|
|
22520
|
+
while (1) switch (_context4.n) {
|
|
22471
22521
|
case 0:
|
|
22472
22522
|
channelId = args.channelId, markerList = args.markerList;
|
|
22473
22523
|
channel = getStoredChannel$1(channelId);
|
|
22474
22524
|
log.info('channel MESSAGE_MARKERS_RECEIVED ... channel: ', channel, 'markers list: ', markerList);
|
|
22475
22525
|
if (channel) {
|
|
22476
|
-
|
|
22526
|
+
_context4.n = 1;
|
|
22477
22527
|
break;
|
|
22478
22528
|
}
|
|
22479
|
-
return
|
|
22529
|
+
return _context4.a(2);
|
|
22480
22530
|
case 1:
|
|
22481
22531
|
isOwnMarker = ((_markerList$user = markerList.user) === null || _markerList$user === void 0 ? void 0 : _markerList$user.id) === SceytChatClient.user.id;
|
|
22482
|
-
|
|
22532
|
+
_context4.n = 2;
|
|
22483
22533
|
return effects.call(getActiveChannelId);
|
|
22484
22534
|
case 2:
|
|
22485
|
-
activeChannelId =
|
|
22535
|
+
activeChannelId = _context4.v;
|
|
22486
22536
|
updateLastMessage = false;
|
|
22487
22537
|
markersMap = {};
|
|
22488
22538
|
markerUpdateParams = {
|
|
@@ -22497,19 +22547,19 @@ function handleMessageMarkersReceivedEvent(args, SceytChatClient) {
|
|
|
22497
22547
|
}
|
|
22498
22548
|
}
|
|
22499
22549
|
if (!updateLastMessage) {
|
|
22500
|
-
|
|
22550
|
+
_context4.n = 3;
|
|
22501
22551
|
break;
|
|
22502
22552
|
}
|
|
22503
22553
|
lastMessage = _extends({}, channel.lastMessage, updateMessageDeliveryStatusAndMarkers(channel.lastMessage, markerUpdateParams, isOwnMarker));
|
|
22504
22554
|
updateChannelLastMessageOnAllChannels(channel.id, lastMessage);
|
|
22505
|
-
|
|
22555
|
+
_context4.n = 3;
|
|
22506
22556
|
return effects.put(updateChannelLastMessageStatusAC(lastMessage, channel));
|
|
22507
22557
|
case 3:
|
|
22508
22558
|
if (!(activeChannelId === channelId)) {
|
|
22509
|
-
|
|
22559
|
+
_context4.n = 4;
|
|
22510
22560
|
break;
|
|
22511
22561
|
}
|
|
22512
|
-
|
|
22562
|
+
_context4.n = 4;
|
|
22513
22563
|
return effects.put(updateMessagesStatusAC(markerList.name, markersMap, isOwnMarker, markerList));
|
|
22514
22564
|
case 4:
|
|
22515
22565
|
updateMessageStatusOnMap(channel.id, {
|
|
@@ -22518,32 +22568,32 @@ function handleMessageMarkersReceivedEvent(args, SceytChatClient) {
|
|
|
22518
22568
|
marker: markerList
|
|
22519
22569
|
}, isOwnMarker);
|
|
22520
22570
|
if (isOwnMarker) {
|
|
22521
|
-
|
|
22571
|
+
_context4.n = 5;
|
|
22522
22572
|
break;
|
|
22523
22573
|
}
|
|
22524
|
-
|
|
22574
|
+
_context4.n = 5;
|
|
22525
22575
|
return effects.put(updateMessagesMarkersAC(channelId, markerList.name, markerList));
|
|
22526
22576
|
case 5:
|
|
22527
|
-
return
|
|
22577
|
+
return _context4.a(2);
|
|
22528
22578
|
}
|
|
22529
|
-
},
|
|
22579
|
+
}, _marked4$1);
|
|
22530
22580
|
}
|
|
22531
22581
|
function handleDeleteMessageEvent(args) {
|
|
22532
22582
|
var channel, deletedMessage, activeChannelId, channelExists;
|
|
22533
|
-
return _regenerator().w(function (
|
|
22534
|
-
while (1) switch (
|
|
22583
|
+
return _regenerator().w(function (_context5) {
|
|
22584
|
+
while (1) switch (_context5.n) {
|
|
22535
22585
|
case 0:
|
|
22536
22586
|
channel = args.channel, deletedMessage = args.deletedMessage;
|
|
22537
|
-
|
|
22587
|
+
_context5.n = 1;
|
|
22538
22588
|
return effects.call(getActiveChannelId);
|
|
22539
22589
|
case 1:
|
|
22540
|
-
activeChannelId =
|
|
22590
|
+
activeChannelId = _context5.v;
|
|
22541
22591
|
channelExists = checkChannelExists(channel.id);
|
|
22542
22592
|
if (!(channel.id === activeChannelId)) {
|
|
22543
|
-
|
|
22593
|
+
_context5.n = 2;
|
|
22544
22594
|
break;
|
|
22545
22595
|
}
|
|
22546
|
-
|
|
22596
|
+
_context5.n = 2;
|
|
22547
22597
|
return effects.put(updateMessageAC(deletedMessage.id, deletedMessage));
|
|
22548
22598
|
case 2:
|
|
22549
22599
|
updateMessageOnMap(channel.id, {
|
|
@@ -22551,10 +22601,10 @@ function handleDeleteMessageEvent(args) {
|
|
|
22551
22601
|
params: deletedMessage
|
|
22552
22602
|
});
|
|
22553
22603
|
if (!channelExists) {
|
|
22554
|
-
|
|
22604
|
+
_context5.n = 4;
|
|
22555
22605
|
break;
|
|
22556
22606
|
}
|
|
22557
|
-
|
|
22607
|
+
_context5.n = 3;
|
|
22558
22608
|
return effects.put(updateChannelDataAC(channel.id, {
|
|
22559
22609
|
newMessageCount: channel.newMessageCount,
|
|
22560
22610
|
muted: channel.muted,
|
|
@@ -22562,10 +22612,10 @@ function handleDeleteMessageEvent(args) {
|
|
|
22562
22612
|
}));
|
|
22563
22613
|
case 3:
|
|
22564
22614
|
if (!(channel.lastMessage.id === deletedMessage.id)) {
|
|
22565
|
-
|
|
22615
|
+
_context5.n = 4;
|
|
22566
22616
|
break;
|
|
22567
22617
|
}
|
|
22568
|
-
|
|
22618
|
+
_context5.n = 4;
|
|
22569
22619
|
return effects.put(updateChannelLastMessageAC(deletedMessage, channel));
|
|
22570
22620
|
case 4:
|
|
22571
22621
|
updateChannelOnAllChannels(channel.id, {
|
|
@@ -22573,29 +22623,29 @@ function handleDeleteMessageEvent(args) {
|
|
|
22573
22623
|
muted: channel.muted,
|
|
22574
22624
|
mutedTill: channel.mutedTill
|
|
22575
22625
|
}, deletedMessage);
|
|
22576
|
-
|
|
22626
|
+
_context5.n = 5;
|
|
22577
22627
|
return effects.put(removePendingMessageMutationAC(deletedMessage.id));
|
|
22578
22628
|
case 5:
|
|
22579
|
-
return
|
|
22629
|
+
return _context5.a(2);
|
|
22580
22630
|
}
|
|
22581
|
-
},
|
|
22631
|
+
}, _marked5$1);
|
|
22582
22632
|
}
|
|
22583
22633
|
function handleEditMessageEvent(args) {
|
|
22584
22634
|
var channel, message, activeChannelId, channelExists;
|
|
22585
|
-
return _regenerator().w(function (
|
|
22586
|
-
while (1) switch (
|
|
22635
|
+
return _regenerator().w(function (_context6) {
|
|
22636
|
+
while (1) switch (_context6.n) {
|
|
22587
22637
|
case 0:
|
|
22588
22638
|
channel = args.channel, message = args.message;
|
|
22589
|
-
|
|
22639
|
+
_context6.n = 1;
|
|
22590
22640
|
return effects.call(getActiveChannelId);
|
|
22591
22641
|
case 1:
|
|
22592
|
-
activeChannelId =
|
|
22642
|
+
activeChannelId = _context6.v;
|
|
22593
22643
|
channelExists = checkChannelExists(channel.id);
|
|
22594
22644
|
if (!(channel.id === activeChannelId)) {
|
|
22595
|
-
|
|
22645
|
+
_context6.n = 2;
|
|
22596
22646
|
break;
|
|
22597
22647
|
}
|
|
22598
|
-
|
|
22648
|
+
_context6.n = 2;
|
|
22599
22649
|
return effects.put(updateMessageAC(message.id, {
|
|
22600
22650
|
body: message.body,
|
|
22601
22651
|
state: message.state,
|
|
@@ -22606,14 +22656,14 @@ function handleEditMessageEvent(args) {
|
|
|
22606
22656
|
}));
|
|
22607
22657
|
case 2:
|
|
22608
22658
|
if (!channelExists) {
|
|
22609
|
-
|
|
22659
|
+
_context6.n = 3;
|
|
22610
22660
|
break;
|
|
22611
22661
|
}
|
|
22612
22662
|
if (!(channel.lastMessage.id === message.id)) {
|
|
22613
|
-
|
|
22663
|
+
_context6.n = 3;
|
|
22614
22664
|
break;
|
|
22615
22665
|
}
|
|
22616
|
-
|
|
22666
|
+
_context6.n = 3;
|
|
22617
22667
|
return effects.put(updateChannelLastMessageAC(message, channel));
|
|
22618
22668
|
case 3:
|
|
22619
22669
|
if (checkChannelExistsOnMessagesMap(channel.id)) {
|
|
@@ -22623,17 +22673,17 @@ function handleEditMessageEvent(args) {
|
|
|
22623
22673
|
});
|
|
22624
22674
|
}
|
|
22625
22675
|
updateChannelOnAllChannels(channel.id, {}, message);
|
|
22626
|
-
|
|
22676
|
+
_context6.n = 4;
|
|
22627
22677
|
return effects.put(removePendingMessageMutationAC(message.id));
|
|
22628
22678
|
case 4:
|
|
22629
|
-
return
|
|
22679
|
+
return _context6.a(2);
|
|
22630
22680
|
}
|
|
22631
|
-
},
|
|
22681
|
+
}, _marked6$1);
|
|
22632
22682
|
}
|
|
22633
22683
|
function watchForEvents() {
|
|
22634
22684
|
var SceytChatClient, channelListener, connectionListener, usersTimeout, chan, _loop;
|
|
22635
|
-
return _regenerator().w(function (
|
|
22636
|
-
while (1) switch (
|
|
22685
|
+
return _regenerator().w(function (_context0) {
|
|
22686
|
+
while (1) switch (_context0.n) {
|
|
22637
22687
|
case 0:
|
|
22638
22688
|
SceytChatClient = getClient();
|
|
22639
22689
|
channelListener = new SceytChatClient.ChannelListener();
|
|
@@ -23033,45 +23083,45 @@ function watchForEvents() {
|
|
|
23033
23083
|
};
|
|
23034
23084
|
});
|
|
23035
23085
|
_loop = /*#__PURE__*/_regenerator().m(function _callee3() {
|
|
23036
|
-
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, joinedMember, _chan2, customLoadMembersFunctions, joinMembersEvent, membersList, updateChannelData, _channel, member, _channelExists, activeChannelId, groupName, _updateChannelData, users, blockedUsers, allChannels, _loop2, _iterator2, _step2, _users, unblockedUsers, _allChannels, _loop3, _iterator3, _step3, _channel2, removedMembers, _activeChannelId, _channelExists2, activeChannel, _updateChannelData2, _groupName, _channel3, addedMembers, _activeChannelId2, _channelExists3, _updateChannelData3, _customLoadMembersFunctions, addMembersEvent, _membersList, _groupName2, onUpdateChannel, updatedChannel, _channelExists4, subject, avatarUrl, muted, mutedTill, metadata, _channel4, fields, parsedChannelMeta, parsedMeta, _activeChannelId3, _groupName3, channelId, _channel5, _channel6, user, message, reaction, isSelf, _activeChannelId4, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelUpdateParams, _pollDetailsData$chan, _pollDetailsData$chan2, _channel7, pollDetails, messageId, pollDetailsData, _activeChannelId5, addedVotes, deletedVotes, objs, _iterator4, _step4, vote, _iterator5, _step5, _vote, _i, _objs, obj, _store$getState$Messa3, key, hasNext, _i2, _objs2, _obj, _pollDetailsData$chan3, _channel8, _pollDetails, _messageId, _pollDetailsData, _activeChannelId6, _deletedVotes, _objs3, _iterator6, _step6, _vote2, _i3, _objs4, _obj2, _i4, _objs5, _obj3, _pollDetailsData2$cha, _channel9, _pollDetails2, _messageId2, _activeChannelId7, _pollDetailsData2, retractedVotes, _objs6, _iterator7, _step7, _vote4, _i5, _objs7, _obj4, _iterator8, _step8, _vote3, _channel0, _messageId3, _activeChannelId8, _obj5, _channel1, _user, _message, _reaction, channelFromMap, _isSelf, _activeChannelId9, _channelUpdateParams, _channel10, _activeChannelId0, channelExist, _channel11, _channel12, _channel13, _channel14, _channel15, _activeChannelId1, lastChannel, _channel16, _channel17, _groupName4, _channel18,
|
|
23037
|
-
return _regenerator().w(function (
|
|
23038
|
-
while (1) switch (
|
|
23086
|
+
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, joinedMember, _chan2, customLoadMembersFunctions, joinMembersEvent, membersList, updateChannelData, _channel, member, _channelExists, activeChannelId, groupName, _updateChannelData, users, blockedUsers, allChannels, _loop2, _iterator2, _step2, _users, unblockedUsers, _allChannels, _loop3, _iterator3, _step3, _channel2, removedMembers, _activeChannelId, _channelExists2, activeChannel, _updateChannelData2, _groupName, _channel3, addedMembers, _activeChannelId2, _channelExists3, _updateChannelData3, _customLoadMembersFunctions, addMembersEvent, _membersList, _groupName2, onUpdateChannel, updatedChannel, _channelExists4, subject, avatarUrl, muted, mutedTill, metadata, _channel4, fields, parsedChannelMeta, parsedMeta, _activeChannelId3, _groupName3, channelId, _channel5, _channel6, user, message, reaction, isSelf, _activeChannelId4, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelUpdateParams, _pollDetailsData$chan, _pollDetailsData$chan2, _channel7, pollDetails, messageId, pollDetailsData, _activeChannelId5, addedVotes, deletedVotes, objs, _iterator4, _step4, vote, _iterator5, _step5, _vote, _i, _objs, obj, _store$getState$Messa3, key, hasNext, _i2, _objs2, _obj, _pollDetailsData$chan3, _channel8, _pollDetails, _messageId, _pollDetailsData, _activeChannelId6, _deletedVotes, _objs3, _iterator6, _step6, _vote2, _i3, _objs4, _obj2, _i4, _objs5, _obj3, _pollDetailsData2$cha, _channel9, _pollDetails2, _messageId2, _activeChannelId7, _pollDetailsData2, retractedVotes, _objs6, _iterator7, _step7, _vote4, _i5, _objs7, _obj4, _iterator8, _step8, _vote3, _channel0, _messageId3, _activeChannelId8, _obj5, _channel1, _user, _message, _reaction, channelFromMap, _isSelf, _activeChannelId9, _channelUpdateParams, _channel10, _activeChannelId0, channelExist, _channel11, _channel12, _channel13, _channel14, _channel15, _activeChannelId1, lastChannel, _channel16, _channel17, _groupName4, _channel18, members, _activeChannelId10, _customLoadMembersFunctions2, updateMembersEvent, _membersList2, i, _channel19, _channel20, _channelId, from, name, status, _t, _t2, _t3, _t4;
|
|
23087
|
+
return _regenerator().w(function (_context9) {
|
|
23088
|
+
while (1) switch (_context9.p = _context9.n) {
|
|
23039
23089
|
case 0:
|
|
23040
|
-
|
|
23041
|
-
|
|
23090
|
+
_context9.p = 0;
|
|
23091
|
+
_context9.n = 1;
|
|
23042
23092
|
return effects.take(chan);
|
|
23043
23093
|
case 1:
|
|
23044
|
-
_yield$take =
|
|
23094
|
+
_yield$take = _context9.v;
|
|
23045
23095
|
type = _yield$take.type;
|
|
23046
23096
|
args = _yield$take.args;
|
|
23047
23097
|
_t = type;
|
|
23048
|
-
|
|
23098
|
+
_context9.n = _t === CHANNEL_EVENT_TYPES.CREATE ? 2 : _t === CHANNEL_EVENT_TYPES.JOIN ? 7 : _t === CHANNEL_EVENT_TYPES.LEAVE ? 17 : _t === CHANNEL_EVENT_TYPES.BLOCK ? 30 : _t === CHANNEL_EVENT_TYPES.UNBLOCK ? 34 : _t === CHANNEL_EVENT_TYPES.KICK_MEMBERS ? 38 : _t === CHANNEL_EVENT_TYPES.ADD_MEMBERS ? 49 : _t === CHANNEL_EVENT_TYPES.UPDATE_CHANNEL ? 64 : _t === CHANNEL_EVENT_TYPES.MESSAGE ? 69 : _t === CHANNEL_EVENT_TYPES.MESSAGE_MARKERS_RECEIVED ? 71 : _t === CHANNEL_EVENT_TYPES.DELETE ? 73 : _t === CHANNEL_EVENT_TYPES.DELETE_MESSAGE ? 75 : _t === CHANNEL_EVENT_TYPES.EDIT_MESSAGE ? 77 : _t === CHANNEL_EVENT_TYPES.REACTION_ADDED ? 79 : _t === CHANNEL_EVENT_TYPES.POLL_ADDED ? 86 : _t === CHANNEL_EVENT_TYPES.POLL_DELETED ? 96 : _t === CHANNEL_EVENT_TYPES.POLL_RETRACTED ? 104 : _t === CHANNEL_EVENT_TYPES.POLL_CLOSED ? 112 : _t === CHANNEL_EVENT_TYPES.REACTION_DELETED ? 116 : _t === CHANNEL_EVENT_TYPES.UNREAD_MESSAGES_INFO ? 120 : _t === CHANNEL_EVENT_TYPES.CLEAR_HISTORY ? 122 : _t === CHANNEL_EVENT_TYPES.MUTE ? 128 : _t === CHANNEL_EVENT_TYPES.UNMUTE ? 130 : _t === CHANNEL_EVENT_TYPES.PINED ? 132 : _t === CHANNEL_EVENT_TYPES.UNPINED ? 134 : _t === CHANNEL_EVENT_TYPES.HIDE ? 136 : _t === CHANNEL_EVENT_TYPES.UNHIDE ? 141 : _t === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_UNREAD ? 143 : _t === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_READ ? 146 : _t === CHANNEL_EVENT_TYPES.CHANGE_ROLE ? 148 : _t === CHANNEL_EVENT_TYPES.FROZEN ? 158 : _t === CHANNEL_EVENT_TYPES.UNFROZEN ? 159 : _t === CHANNEL_EVENT_TYPES.CHANNEL_EVENT ? 160 : _t === CONNECTION_EVENT_TYPES.CONNECTION_STATUS_CHANGED ? 169 : 173;
|
|
23049
23099
|
break;
|
|
23050
23100
|
case 2:
|
|
23051
23101
|
createdChannel = args.createdChannel;
|
|
23052
23102
|
log.info('CHANNEL_EVENT_CREATE ... ', createdChannel);
|
|
23053
23103
|
channelFilterTypes = getChannelTypesFilter();
|
|
23054
23104
|
if (!(channelFilterTypes !== null && channelFilterTypes !== void 0 && channelFilterTypes.length ? channelFilterTypes.includes(createdChannel.type) : true)) {
|
|
23055
|
-
|
|
23105
|
+
_context9.n = 6;
|
|
23056
23106
|
break;
|
|
23057
23107
|
}
|
|
23058
23108
|
getFromContacts = getShowOnlyContactUsers();
|
|
23059
23109
|
channelExists = checkChannelExists(createdChannel.id);
|
|
23060
23110
|
if (channelExists) {
|
|
23061
|
-
|
|
23111
|
+
_context9.n = 5;
|
|
23062
23112
|
break;
|
|
23063
23113
|
}
|
|
23064
23114
|
if (!getFromContacts) {
|
|
23065
|
-
|
|
23115
|
+
_context9.n = 3;
|
|
23066
23116
|
break;
|
|
23067
23117
|
}
|
|
23068
|
-
|
|
23118
|
+
_context9.n = 3;
|
|
23069
23119
|
return effects.put(getContactsAC());
|
|
23070
23120
|
case 3:
|
|
23071
|
-
|
|
23121
|
+
_context9.n = 4;
|
|
23072
23122
|
return effects.call(setChannelInMap, createdChannel);
|
|
23073
23123
|
case 4:
|
|
23074
|
-
|
|
23124
|
+
_context9.n = 5;
|
|
23075
23125
|
return effects.put(setChannelToAddAC(JSON.parse(JSON.stringify(createdChannel))));
|
|
23076
23126
|
case 5:
|
|
23077
23127
|
_chan = getChannelFromAllChannels(createdChannel.id);
|
|
@@ -23079,7 +23129,7 @@ function watchForEvents() {
|
|
|
23079
23129
|
addChannelToAllChannels(createdChannel);
|
|
23080
23130
|
}
|
|
23081
23131
|
case 6:
|
|
23082
|
-
return
|
|
23132
|
+
return _context9.a(3, 174);
|
|
23083
23133
|
case 7:
|
|
23084
23134
|
channel = args.channel, joinedMember = args.joinedMember;
|
|
23085
23135
|
log.info('channel JOIN ... . ', channel);
|
|
@@ -23089,114 +23139,114 @@ function watchForEvents() {
|
|
|
23089
23139
|
_chan2 = getChannelFromAllChannels(channel.id);
|
|
23090
23140
|
}
|
|
23091
23141
|
if (!_chan2) {
|
|
23092
|
-
|
|
23142
|
+
_context9.n = 16;
|
|
23093
23143
|
break;
|
|
23094
23144
|
}
|
|
23095
23145
|
customLoadMembersFunctions = getCustomLoadMembersFunctions();
|
|
23096
23146
|
joinMembersEvent = customLoadMembersFunctions === null || customLoadMembersFunctions === void 0 ? void 0 : customLoadMembersFunctions.joinMembersEvent;
|
|
23097
23147
|
membersList = [];
|
|
23098
23148
|
if (!joinMembersEvent) {
|
|
23099
|
-
|
|
23149
|
+
_context9.n = 10;
|
|
23100
23150
|
break;
|
|
23101
23151
|
}
|
|
23102
|
-
|
|
23152
|
+
_context9.n = 8;
|
|
23103
23153
|
return effects.call(joinMembersEvent, _chan2.id, [joinedMember], store.getState().MembersReducer.channelsMembersMap[_chan2.id] || []);
|
|
23104
23154
|
case 8:
|
|
23105
|
-
membersList =
|
|
23106
|
-
|
|
23155
|
+
membersList = _context9.v;
|
|
23156
|
+
_context9.n = 9;
|
|
23107
23157
|
return effects.put(setMembersToListAC(membersList, _chan2.id));
|
|
23108
23158
|
case 9:
|
|
23109
|
-
|
|
23159
|
+
_context9.n = 11;
|
|
23110
23160
|
break;
|
|
23111
23161
|
case 10:
|
|
23112
|
-
|
|
23162
|
+
_context9.n = 11;
|
|
23113
23163
|
return effects.put(addMembersToListAC([joinedMember], _chan2.id));
|
|
23114
23164
|
case 11:
|
|
23115
23165
|
updateChannelOnAllChannels(_chan2.id, {
|
|
23116
23166
|
memberCount: _chan2.memberCount + 1
|
|
23117
23167
|
});
|
|
23118
23168
|
if (!joinMembersEvent) {
|
|
23119
|
-
|
|
23169
|
+
_context9.n = 12;
|
|
23120
23170
|
break;
|
|
23121
23171
|
}
|
|
23122
23172
|
_t2 = {
|
|
23123
23173
|
members: membersList
|
|
23124
23174
|
};
|
|
23125
|
-
|
|
23175
|
+
_context9.n = 14;
|
|
23126
23176
|
break;
|
|
23127
23177
|
case 12:
|
|
23128
|
-
|
|
23178
|
+
_context9.n = 13;
|
|
23129
23179
|
return effects.call(updateActiveChannelMembersAdd, [joinedMember], _chan2.id) || {};
|
|
23130
23180
|
case 13:
|
|
23131
|
-
_t2 =
|
|
23181
|
+
_t2 = _context9.v;
|
|
23132
23182
|
case 14:
|
|
23133
23183
|
updateChannelData = _t2;
|
|
23134
|
-
|
|
23184
|
+
_context9.n = 15;
|
|
23135
23185
|
return effects.put(updateChannelDataAC(_chan2.id, _extends({
|
|
23136
23186
|
memberCount: _chan2.memberCount + 1
|
|
23137
23187
|
}, updateChannelData)));
|
|
23138
23188
|
case 15:
|
|
23139
|
-
|
|
23189
|
+
_context9.n = 16;
|
|
23140
23190
|
return effects.put(updateSearchedChannelDataAC(_chan2.id, {
|
|
23141
23191
|
memberCount: _chan2.memberCount + 1
|
|
23142
23192
|
}, getChannelGroupName(_chan2)));
|
|
23143
23193
|
case 16:
|
|
23144
|
-
return
|
|
23194
|
+
return _context9.a(3, 174);
|
|
23145
23195
|
case 17:
|
|
23146
23196
|
_channel = args.channel, member = args.member;
|
|
23147
23197
|
log.info('channel LEAVE ... ', _channel, member);
|
|
23148
23198
|
_channelExists = checkChannelExists(_channel.id);
|
|
23149
|
-
|
|
23199
|
+
_context9.n = 18;
|
|
23150
23200
|
return effects.call(getActiveChannelId);
|
|
23151
23201
|
case 18:
|
|
23152
|
-
activeChannelId =
|
|
23202
|
+
activeChannelId = _context9.v;
|
|
23153
23203
|
if (!(member.id === SceytChatClient.user.id)) {
|
|
23154
|
-
|
|
23204
|
+
_context9.n = 23;
|
|
23155
23205
|
break;
|
|
23156
23206
|
}
|
|
23157
|
-
|
|
23207
|
+
_context9.n = 19;
|
|
23158
23208
|
return effects.put(switchChannelActionAC(null));
|
|
23159
23209
|
case 19:
|
|
23160
|
-
|
|
23210
|
+
_context9.n = 20;
|
|
23161
23211
|
return effects.put(removeChannelAC(_channel.id));
|
|
23162
23212
|
case 20:
|
|
23163
23213
|
removeChannelFromMap(_channel.id);
|
|
23164
23214
|
deleteChannelFromAllChannels(_channel.id);
|
|
23165
|
-
|
|
23215
|
+
_context9.n = 21;
|
|
23166
23216
|
return effects.put(setChannelToRemoveAC(_channel));
|
|
23167
23217
|
case 21:
|
|
23168
|
-
|
|
23218
|
+
_context9.n = 22;
|
|
23169
23219
|
return effects.put(removeChannelCachesAC(_channel.id));
|
|
23170
23220
|
case 22:
|
|
23171
|
-
|
|
23221
|
+
_context9.n = 29;
|
|
23172
23222
|
break;
|
|
23173
23223
|
case 23:
|
|
23174
23224
|
groupName = getChannelGroupName(_channel);
|
|
23175
23225
|
if (!_channelExists) {
|
|
23176
|
-
|
|
23226
|
+
_context9.n = 27;
|
|
23177
23227
|
break;
|
|
23178
23228
|
}
|
|
23179
23229
|
_updateChannelData = {};
|
|
23180
23230
|
if (!(activeChannelId === _channel.id)) {
|
|
23181
|
-
|
|
23231
|
+
_context9.n = 26;
|
|
23182
23232
|
break;
|
|
23183
23233
|
}
|
|
23184
|
-
|
|
23234
|
+
_context9.n = 24;
|
|
23185
23235
|
return effects.put(removeMemberFromListAC([member], _channel.id));
|
|
23186
23236
|
case 24:
|
|
23187
|
-
|
|
23237
|
+
_context9.n = 25;
|
|
23188
23238
|
return effects.call(updateActiveChannelMembersRemove, [member], _channel.id) || {};
|
|
23189
23239
|
case 25:
|
|
23190
|
-
_updateChannelData =
|
|
23240
|
+
_updateChannelData = _context9.v;
|
|
23191
23241
|
case 26:
|
|
23192
|
-
|
|
23242
|
+
_context9.n = 27;
|
|
23193
23243
|
return effects.put(updateChannelDataAC(_channel.id, _extends({
|
|
23194
23244
|
memberCount: _channel.memberCount,
|
|
23195
23245
|
muted: _channel.muted,
|
|
23196
23246
|
mutedTill: _channel.mutedTill
|
|
23197
23247
|
}, _updateChannelData)));
|
|
23198
23248
|
case 27:
|
|
23199
|
-
|
|
23249
|
+
_context9.n = 28;
|
|
23200
23250
|
return effects.put(updateSearchedChannelDataAC(_channel.id, {
|
|
23201
23251
|
memberCount: _channel.memberCount,
|
|
23202
23252
|
muted: _channel.muted,
|
|
@@ -23209,7 +23259,7 @@ function watchForEvents() {
|
|
|
23209
23259
|
mutedTill: _channel.mutedTill
|
|
23210
23260
|
});
|
|
23211
23261
|
case 29:
|
|
23212
|
-
return
|
|
23262
|
+
return _context9.a(3, 174);
|
|
23213
23263
|
case 30:
|
|
23214
23264
|
log.info('user BLOCK ... ');
|
|
23215
23265
|
users = args.users;
|
|
@@ -23222,8 +23272,8 @@ function watchForEvents() {
|
|
|
23222
23272
|
allChannels = store.getState().ChannelReducer.channels;
|
|
23223
23273
|
_loop2 = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
23224
23274
|
var user, directChannel, _directChannel$member, updatedMembers;
|
|
23225
|
-
return _regenerator().w(function (
|
|
23226
|
-
while (1) switch (
|
|
23275
|
+
return _regenerator().w(function (_context7) {
|
|
23276
|
+
while (1) switch (_context7.n) {
|
|
23227
23277
|
case 0:
|
|
23228
23278
|
user = _step2.value;
|
|
23229
23279
|
directChannel = allChannels.find(function (ch) {
|
|
@@ -23233,7 +23283,7 @@ function watchForEvents() {
|
|
|
23233
23283
|
}));
|
|
23234
23284
|
});
|
|
23235
23285
|
if (!directChannel) {
|
|
23236
|
-
|
|
23286
|
+
_context7.n = 1;
|
|
23237
23287
|
break;
|
|
23238
23288
|
}
|
|
23239
23289
|
updatedMembers = (_directChannel$member = directChannel.members) === null || _directChannel$member === void 0 ? void 0 : _directChannel$member.map(function (m) {
|
|
@@ -23241,27 +23291,27 @@ function watchForEvents() {
|
|
|
23241
23291
|
blocked: true
|
|
23242
23292
|
}) : m;
|
|
23243
23293
|
});
|
|
23244
|
-
|
|
23294
|
+
_context7.n = 1;
|
|
23245
23295
|
return effects.put(updateChannelDataAC(directChannel.id, {
|
|
23246
23296
|
members: updatedMembers
|
|
23247
23297
|
}));
|
|
23248
23298
|
case 1:
|
|
23249
|
-
return
|
|
23299
|
+
return _context7.a(2);
|
|
23250
23300
|
}
|
|
23251
23301
|
}, _callee);
|
|
23252
23302
|
});
|
|
23253
23303
|
_iterator2 = _createForOfIteratorHelperLoose(blockedUsers);
|
|
23254
23304
|
case 31:
|
|
23255
23305
|
if ((_step2 = _iterator2()).done) {
|
|
23256
|
-
|
|
23306
|
+
_context9.n = 33;
|
|
23257
23307
|
break;
|
|
23258
23308
|
}
|
|
23259
|
-
return
|
|
23309
|
+
return _context9.d(_regeneratorValues(_loop2()), 32);
|
|
23260
23310
|
case 32:
|
|
23261
|
-
|
|
23311
|
+
_context9.n = 31;
|
|
23262
23312
|
break;
|
|
23263
23313
|
case 33:
|
|
23264
|
-
return
|
|
23314
|
+
return _context9.a(3, 174);
|
|
23265
23315
|
case 34:
|
|
23266
23316
|
log.info('user UNBLOCK ... ');
|
|
23267
23317
|
_users = args.users;
|
|
@@ -23274,8 +23324,8 @@ function watchForEvents() {
|
|
|
23274
23324
|
_allChannels = store.getState().ChannelReducer.channels;
|
|
23275
23325
|
_loop3 = /*#__PURE__*/_regenerator().m(function _callee2() {
|
|
23276
23326
|
var user, directChannel, _directChannel$member2, updatedMembers;
|
|
23277
|
-
return _regenerator().w(function (
|
|
23278
|
-
while (1) switch (
|
|
23327
|
+
return _regenerator().w(function (_context8) {
|
|
23328
|
+
while (1) switch (_context8.n) {
|
|
23279
23329
|
case 0:
|
|
23280
23330
|
user = _step3.value;
|
|
23281
23331
|
directChannel = _allChannels.find(function (ch) {
|
|
@@ -23285,7 +23335,7 @@ function watchForEvents() {
|
|
|
23285
23335
|
}));
|
|
23286
23336
|
});
|
|
23287
23337
|
if (!directChannel) {
|
|
23288
|
-
|
|
23338
|
+
_context8.n = 1;
|
|
23289
23339
|
break;
|
|
23290
23340
|
}
|
|
23291
23341
|
updatedMembers = (_directChannel$member2 = directChannel.members) === null || _directChannel$member2 === void 0 ? void 0 : _directChannel$member2.map(function (m) {
|
|
@@ -23293,85 +23343,85 @@ function watchForEvents() {
|
|
|
23293
23343
|
blocked: false
|
|
23294
23344
|
}) : m;
|
|
23295
23345
|
});
|
|
23296
|
-
|
|
23346
|
+
_context8.n = 1;
|
|
23297
23347
|
return effects.put(updateChannelDataAC(directChannel.id, {
|
|
23298
23348
|
members: updatedMembers
|
|
23299
23349
|
}));
|
|
23300
23350
|
case 1:
|
|
23301
|
-
return
|
|
23351
|
+
return _context8.a(2);
|
|
23302
23352
|
}
|
|
23303
23353
|
}, _callee2);
|
|
23304
23354
|
});
|
|
23305
23355
|
_iterator3 = _createForOfIteratorHelperLoose(unblockedUsers);
|
|
23306
23356
|
case 35:
|
|
23307
23357
|
if ((_step3 = _iterator3()).done) {
|
|
23308
|
-
|
|
23358
|
+
_context9.n = 37;
|
|
23309
23359
|
break;
|
|
23310
23360
|
}
|
|
23311
|
-
return
|
|
23361
|
+
return _context9.d(_regeneratorValues(_loop3()), 36);
|
|
23312
23362
|
case 36:
|
|
23313
|
-
|
|
23363
|
+
_context9.n = 35;
|
|
23314
23364
|
break;
|
|
23315
23365
|
case 37:
|
|
23316
|
-
return
|
|
23366
|
+
return _context9.a(3, 174);
|
|
23317
23367
|
case 38:
|
|
23318
23368
|
_channel2 = args.channel, removedMembers = args.removedMembers;
|
|
23319
23369
|
log.info('channel KICK_MEMBERS ... ', removedMembers);
|
|
23320
|
-
|
|
23370
|
+
_context9.n = 39;
|
|
23321
23371
|
return effects.call(getActiveChannelId);
|
|
23322
23372
|
case 39:
|
|
23323
|
-
_activeChannelId =
|
|
23373
|
+
_activeChannelId = _context9.v;
|
|
23324
23374
|
_channelExists2 = checkChannelExists(_channel2.id);
|
|
23325
23375
|
if (!_channelExists2) {
|
|
23326
|
-
|
|
23376
|
+
_context9.n = 48;
|
|
23327
23377
|
break;
|
|
23328
23378
|
}
|
|
23329
23379
|
if (!removedMembers.find(function (mem) {
|
|
23330
23380
|
return mem.id === SceytChatClient.user.id;
|
|
23331
23381
|
})) {
|
|
23332
|
-
|
|
23382
|
+
_context9.n = 43;
|
|
23333
23383
|
break;
|
|
23334
23384
|
}
|
|
23335
23385
|
removeChannelFromMap(_channel2.id);
|
|
23336
|
-
|
|
23386
|
+
_context9.n = 40;
|
|
23337
23387
|
return effects.put(removeChannelAC(_channel2.id));
|
|
23338
23388
|
case 40:
|
|
23339
|
-
|
|
23389
|
+
_context9.n = 41;
|
|
23340
23390
|
return effects.call(getLastChannelFromMap);
|
|
23341
23391
|
case 41:
|
|
23342
|
-
activeChannel =
|
|
23392
|
+
activeChannel = _context9.v;
|
|
23343
23393
|
if (!activeChannel) {
|
|
23344
|
-
|
|
23394
|
+
_context9.n = 42;
|
|
23345
23395
|
break;
|
|
23346
23396
|
}
|
|
23347
|
-
|
|
23397
|
+
_context9.n = 42;
|
|
23348
23398
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
23349
23399
|
case 42:
|
|
23350
|
-
|
|
23400
|
+
_context9.n = 48;
|
|
23351
23401
|
break;
|
|
23352
23402
|
case 43:
|
|
23353
23403
|
_updateChannelData2 = {};
|
|
23354
23404
|
if (!(_activeChannelId === _channel2.id)) {
|
|
23355
|
-
|
|
23405
|
+
_context9.n = 46;
|
|
23356
23406
|
break;
|
|
23357
23407
|
}
|
|
23358
|
-
|
|
23408
|
+
_context9.n = 44;
|
|
23359
23409
|
return effects.put(removeMemberFromListAC(removedMembers, _channel2.id));
|
|
23360
23410
|
case 44:
|
|
23361
|
-
|
|
23411
|
+
_context9.n = 45;
|
|
23362
23412
|
return effects.call(updateActiveChannelMembersRemove, removedMembers, _channel2.id) || {};
|
|
23363
23413
|
case 45:
|
|
23364
|
-
_updateChannelData2 =
|
|
23414
|
+
_updateChannelData2 = _context9.v;
|
|
23365
23415
|
case 46:
|
|
23366
23416
|
_groupName = getChannelGroupName(_channel2);
|
|
23367
|
-
|
|
23417
|
+
_context9.n = 47;
|
|
23368
23418
|
return effects.put(updateSearchedChannelDataAC(_channel2.id, {
|
|
23369
23419
|
memberCount: _channel2.memberCount,
|
|
23370
23420
|
muted: _channel2.muted,
|
|
23371
23421
|
mutedTill: _channel2.mutedTill
|
|
23372
23422
|
}, _groupName));
|
|
23373
23423
|
case 47:
|
|
23374
|
-
|
|
23424
|
+
_context9.n = 48;
|
|
23375
23425
|
return effects.put(updateChannelDataAC(_channel2.id, _extends({
|
|
23376
23426
|
memberCount: _channel2.memberCount,
|
|
23377
23427
|
muted: _channel2.muted,
|
|
@@ -23383,79 +23433,79 @@ function watchForEvents() {
|
|
|
23383
23433
|
muted: _channel2.muted,
|
|
23384
23434
|
mutedTill: _channel2.mutedTill
|
|
23385
23435
|
});
|
|
23386
|
-
return
|
|
23436
|
+
return _context9.a(3, 174);
|
|
23387
23437
|
case 49:
|
|
23388
23438
|
_channel3 = args.channel, addedMembers = args.addedMembers;
|
|
23389
23439
|
log.info('channel ADD_MEMBERS ... ', addedMembers);
|
|
23390
|
-
|
|
23440
|
+
_context9.n = 50;
|
|
23391
23441
|
return effects.call(getActiveChannelId);
|
|
23392
23442
|
case 50:
|
|
23393
|
-
_activeChannelId2 =
|
|
23443
|
+
_activeChannelId2 = _context9.v;
|
|
23394
23444
|
_channelExists3 = checkChannelExists(_channel3.id);
|
|
23395
23445
|
if (!_channelExists3) {
|
|
23396
|
-
|
|
23446
|
+
_context9.n = 60;
|
|
23397
23447
|
break;
|
|
23398
23448
|
}
|
|
23399
23449
|
_updateChannelData3 = {};
|
|
23400
23450
|
if (!(_activeChannelId2 === _channel3.id)) {
|
|
23401
|
-
|
|
23451
|
+
_context9.n = 58;
|
|
23402
23452
|
break;
|
|
23403
23453
|
}
|
|
23404
23454
|
_customLoadMembersFunctions = getCustomLoadMembersFunctions();
|
|
23405
23455
|
addMembersEvent = _customLoadMembersFunctions === null || _customLoadMembersFunctions === void 0 ? void 0 : _customLoadMembersFunctions.addMembersEvent;
|
|
23406
23456
|
_membersList = [];
|
|
23407
23457
|
if (!addMembersEvent) {
|
|
23408
|
-
|
|
23458
|
+
_context9.n = 53;
|
|
23409
23459
|
break;
|
|
23410
23460
|
}
|
|
23411
|
-
|
|
23461
|
+
_context9.n = 51;
|
|
23412
23462
|
return effects.call(addMembersEvent, _channel3.id, addedMembers, store.getState().MembersReducer.channelsMembersMap[_channel3.id] || []);
|
|
23413
23463
|
case 51:
|
|
23414
|
-
_membersList =
|
|
23415
|
-
|
|
23464
|
+
_membersList = _context9.v;
|
|
23465
|
+
_context9.n = 52;
|
|
23416
23466
|
return effects.put(setMembersToListAC(_membersList, _channel3.id));
|
|
23417
23467
|
case 52:
|
|
23418
|
-
|
|
23468
|
+
_context9.n = 54;
|
|
23419
23469
|
break;
|
|
23420
23470
|
case 53:
|
|
23421
|
-
|
|
23471
|
+
_context9.n = 54;
|
|
23422
23472
|
return effects.put(addMembersToListAC(addedMembers, _channel3.id));
|
|
23423
23473
|
case 54:
|
|
23424
23474
|
if (!addMembersEvent) {
|
|
23425
|
-
|
|
23475
|
+
_context9.n = 55;
|
|
23426
23476
|
break;
|
|
23427
23477
|
}
|
|
23428
23478
|
_t3 = {
|
|
23429
23479
|
members: _membersList
|
|
23430
23480
|
};
|
|
23431
|
-
|
|
23481
|
+
_context9.n = 57;
|
|
23432
23482
|
break;
|
|
23433
23483
|
case 55:
|
|
23434
|
-
|
|
23484
|
+
_context9.n = 56;
|
|
23435
23485
|
return effects.call(updateActiveChannelMembersAdd, addedMembers, _channel3.id) || {};
|
|
23436
23486
|
case 56:
|
|
23437
|
-
_t3 =
|
|
23487
|
+
_t3 = _context9.v;
|
|
23438
23488
|
case 57:
|
|
23439
23489
|
_updateChannelData3 = _t3;
|
|
23440
23490
|
case 58:
|
|
23441
|
-
|
|
23491
|
+
_context9.n = 59;
|
|
23442
23492
|
return effects.put(updateChannelDataAC(_channel3.id, _extends({
|
|
23443
23493
|
memberCount: _channel3.memberCount,
|
|
23444
23494
|
muted: _channel3.muted,
|
|
23445
23495
|
mutedTill: _channel3.mutedTill
|
|
23446
23496
|
}, _updateChannelData3)));
|
|
23447
23497
|
case 59:
|
|
23448
|
-
|
|
23498
|
+
_context9.n = 62;
|
|
23449
23499
|
break;
|
|
23450
23500
|
case 60:
|
|
23451
|
-
|
|
23501
|
+
_context9.n = 61;
|
|
23452
23502
|
return effects.call(setChannelInMap, _channel3);
|
|
23453
23503
|
case 61:
|
|
23454
|
-
|
|
23504
|
+
_context9.n = 62;
|
|
23455
23505
|
return effects.put(setAddedToChannelAC(JSON.parse(JSON.stringify(_channel3))));
|
|
23456
23506
|
case 62:
|
|
23457
23507
|
_groupName2 = getChannelGroupName(_channel3);
|
|
23458
|
-
|
|
23508
|
+
_context9.n = 63;
|
|
23459
23509
|
return effects.put(updateSearchedChannelDataAC(_channel3.id, {
|
|
23460
23510
|
memberCount: _channel3.memberCount,
|
|
23461
23511
|
muted: _channel3.muted,
|
|
@@ -23467,7 +23517,7 @@ function watchForEvents() {
|
|
|
23467
23517
|
muted: _channel3.muted,
|
|
23468
23518
|
mutedTill: _channel3.mutedTill
|
|
23469
23519
|
});
|
|
23470
|
-
return
|
|
23520
|
+
return _context9.a(3, 174);
|
|
23471
23521
|
case 64:
|
|
23472
23522
|
onUpdateChannel = getOnUpdateChannel();
|
|
23473
23523
|
log.info('channel UPDATE_CHANNEL ... ');
|
|
@@ -23499,10 +23549,10 @@ function watchForEvents() {
|
|
|
23499
23549
|
onUpdateChannel(updatedChannel, fields);
|
|
23500
23550
|
}
|
|
23501
23551
|
if (!_channelExists4) {
|
|
23502
|
-
|
|
23552
|
+
_context9.n = 67;
|
|
23503
23553
|
break;
|
|
23504
23554
|
}
|
|
23505
|
-
|
|
23555
|
+
_context9.n = 65;
|
|
23506
23556
|
return effects.put(updateChannelDataAC(updatedChannel.id, {
|
|
23507
23557
|
subject: subject,
|
|
23508
23558
|
avatarUrl: avatarUrl,
|
|
@@ -23510,21 +23560,21 @@ function watchForEvents() {
|
|
|
23510
23560
|
mutedTill: mutedTill
|
|
23511
23561
|
}));
|
|
23512
23562
|
case 65:
|
|
23513
|
-
|
|
23563
|
+
_context9.n = 66;
|
|
23514
23564
|
return effects.call(getActiveChannelId);
|
|
23515
23565
|
case 66:
|
|
23516
|
-
_activeChannelId3 =
|
|
23566
|
+
_activeChannelId3 = _context9.v;
|
|
23517
23567
|
if (!(_activeChannelId3 === updatedChannel.id)) {
|
|
23518
|
-
|
|
23568
|
+
_context9.n = 67;
|
|
23519
23569
|
break;
|
|
23520
23570
|
}
|
|
23521
|
-
|
|
23571
|
+
_context9.n = 67;
|
|
23522
23572
|
return effects.put(setActiveChannelAC(_extends({}, updatedChannel, {
|
|
23523
23573
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
23524
23574
|
})));
|
|
23525
23575
|
case 67:
|
|
23526
23576
|
_groupName3 = getChannelGroupName(updatedChannel);
|
|
23527
|
-
|
|
23577
|
+
_context9.n = 68;
|
|
23528
23578
|
return effects.put(updateSearchedChannelDataAC(updatedChannel.id, {
|
|
23529
23579
|
subject: subject,
|
|
23530
23580
|
avatarUrl: avatarUrl,
|
|
@@ -23539,67 +23589,67 @@ function watchForEvents() {
|
|
|
23539
23589
|
mutedTill: mutedTill,
|
|
23540
23590
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
23541
23591
|
});
|
|
23542
|
-
return
|
|
23592
|
+
return _context9.a(3, 174);
|
|
23543
23593
|
case 69:
|
|
23544
|
-
|
|
23594
|
+
_context9.n = 70;
|
|
23545
23595
|
return effects.call(handleChannelMessageEvent, args, SceytChatClient);
|
|
23546
23596
|
case 70:
|
|
23547
|
-
return
|
|
23597
|
+
return _context9.a(3, 174);
|
|
23548
23598
|
case 71:
|
|
23549
|
-
|
|
23599
|
+
_context9.n = 72;
|
|
23550
23600
|
return effects.call(handleMessageMarkersReceivedEvent, args, SceytChatClient);
|
|
23551
23601
|
case 72:
|
|
23552
|
-
return
|
|
23602
|
+
return _context9.a(3, 174);
|
|
23553
23603
|
case 73:
|
|
23554
23604
|
channelId = args.channelId;
|
|
23555
23605
|
log.info('channel DELETE ... ');
|
|
23556
23606
|
_channel5 = getChannelFromMap(channelId);
|
|
23557
|
-
|
|
23607
|
+
_context9.n = 74;
|
|
23558
23608
|
return effects.put(setChannelToRemoveAC(_channel5));
|
|
23559
23609
|
case 74:
|
|
23560
23610
|
deleteChannelFromAllChannels(channelId);
|
|
23561
|
-
return
|
|
23611
|
+
return _context9.a(3, 174);
|
|
23562
23612
|
case 75:
|
|
23563
23613
|
log.info('channel DELETE_MESSAGE ... ');
|
|
23564
|
-
|
|
23614
|
+
_context9.n = 76;
|
|
23565
23615
|
return effects.call(handleDeleteMessageEvent, args);
|
|
23566
23616
|
case 76:
|
|
23567
|
-
return
|
|
23617
|
+
return _context9.a(3, 174);
|
|
23568
23618
|
case 77:
|
|
23569
|
-
|
|
23619
|
+
_context9.n = 78;
|
|
23570
23620
|
return effects.call(handleEditMessageEvent, args);
|
|
23571
23621
|
case 78:
|
|
23572
|
-
return
|
|
23622
|
+
return _context9.a(3, 174);
|
|
23573
23623
|
case 79:
|
|
23574
23624
|
_channel6 = args.channel, user = args.user, message = args.message, reaction = args.reaction;
|
|
23575
23625
|
isSelf = user.id === SceytChatClient.user.id;
|
|
23576
|
-
|
|
23626
|
+
_context9.n = 80;
|
|
23577
23627
|
return effects.call(getActiveChannelId);
|
|
23578
23628
|
case 80:
|
|
23579
|
-
_activeChannelId4 =
|
|
23629
|
+
_activeChannelId4 = _context9.v;
|
|
23580
23630
|
if (!(_channel6.id === _activeChannelId4)) {
|
|
23581
|
-
|
|
23631
|
+
_context9.n = 81;
|
|
23582
23632
|
break;
|
|
23583
23633
|
}
|
|
23584
|
-
|
|
23634
|
+
_context9.n = 81;
|
|
23585
23635
|
return effects.put(addReactionToMessageAC(message, reaction, isSelf));
|
|
23586
23636
|
case 81:
|
|
23587
23637
|
if (!(message.user.id === SceytChatClient.user.id)) {
|
|
23588
|
-
|
|
23638
|
+
_context9.n = 85;
|
|
23589
23639
|
break;
|
|
23590
23640
|
}
|
|
23591
23641
|
if (!(!isSelf && Notification.permission === 'granted')) {
|
|
23592
|
-
|
|
23642
|
+
_context9.n = 83;
|
|
23593
23643
|
break;
|
|
23594
23644
|
}
|
|
23595
23645
|
if (!(document.visibilityState !== 'visible' || _channel6.id !== _activeChannelId4)) {
|
|
23596
|
-
|
|
23646
|
+
_context9.n = 83;
|
|
23597
23647
|
break;
|
|
23598
23648
|
}
|
|
23599
|
-
|
|
23649
|
+
_context9.n = 82;
|
|
23600
23650
|
return effects.select(contactsMapSelector);
|
|
23601
23651
|
case 82:
|
|
23602
|
-
contactsMap =
|
|
23652
|
+
contactsMap = _context9.v;
|
|
23603
23653
|
_getFromContacts = getShowOnlyContactUsers();
|
|
23604
23654
|
state = store.getState();
|
|
23605
23655
|
theme = state.ThemeReducer.theme || 'light';
|
|
@@ -23620,7 +23670,7 @@ function watchForEvents() {
|
|
|
23620
23670
|
}) : undefined);
|
|
23621
23671
|
case 83:
|
|
23622
23672
|
if (!(_channel6.newReactions && _channel6.newReactions.length)) {
|
|
23623
|
-
|
|
23673
|
+
_context9.n = 84;
|
|
23624
23674
|
break;
|
|
23625
23675
|
}
|
|
23626
23676
|
channelUpdateParams = {
|
|
@@ -23630,7 +23680,7 @@ function watchForEvents() {
|
|
|
23630
23680
|
muted: _channel6.muted,
|
|
23631
23681
|
mutedTill: _channel6.mutedTill
|
|
23632
23682
|
};
|
|
23633
|
-
|
|
23683
|
+
_context9.n = 84;
|
|
23634
23684
|
return effects.put(updateChannelDataAC(_channel6.id, channelUpdateParams));
|
|
23635
23685
|
case 84:
|
|
23636
23686
|
updateChannelOnAllChannels(_channel6.id, {
|
|
@@ -23644,15 +23694,15 @@ function watchForEvents() {
|
|
|
23644
23694
|
if (checkChannelExistsOnMessagesMap(_channel6.id)) {
|
|
23645
23695
|
addReactionToMessageOnMap(_channel6.id, message, reaction, true);
|
|
23646
23696
|
}
|
|
23647
|
-
return
|
|
23697
|
+
return _context9.a(3, 174);
|
|
23648
23698
|
case 86:
|
|
23649
23699
|
log.info('CHANNEL_EVENT_TYPES.POLL_ADDED ... ');
|
|
23650
23700
|
_channel7 = args.channel, pollDetails = args.pollDetails, messageId = args.messageId;
|
|
23651
23701
|
pollDetailsData = pollDetails;
|
|
23652
|
-
|
|
23702
|
+
_context9.n = 87;
|
|
23653
23703
|
return effects.call(getActiveChannelId);
|
|
23654
23704
|
case 87:
|
|
23655
|
-
_activeChannelId5 =
|
|
23705
|
+
_activeChannelId5 = _context9.v;
|
|
23656
23706
|
addedVotes = (pollDetailsData === null || pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan = pollDetailsData.changedVotes) === null || _pollDetailsData$chan === void 0 ? void 0 : _pollDetailsData$chan.addedVotes) || [];
|
|
23657
23707
|
deletedVotes = (pollDetailsData === null || pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan2 = pollDetailsData.changedVotes) === null || _pollDetailsData$chan2 === void 0 ? void 0 : _pollDetailsData$chan2.removedVotes) || [];
|
|
23658
23708
|
objs = [];
|
|
@@ -23673,37 +23723,37 @@ function watchForEvents() {
|
|
|
23673
23723
|
_i = 0, _objs = objs;
|
|
23674
23724
|
case 88:
|
|
23675
23725
|
if (!(_i < _objs.length)) {
|
|
23676
|
-
|
|
23726
|
+
_context9.n = 92;
|
|
23677
23727
|
break;
|
|
23678
23728
|
}
|
|
23679
23729
|
obj = _objs[_i];
|
|
23680
23730
|
if (!(pollDetailsData !== null && pollDetailsData !== void 0 && pollDetailsData.id && obj.vote)) {
|
|
23681
|
-
|
|
23731
|
+
_context9.n = 91;
|
|
23682
23732
|
break;
|
|
23683
23733
|
}
|
|
23684
23734
|
key = pollDetailsData.id + "_" + obj.vote.optionId;
|
|
23685
23735
|
hasNext = ((_store$getState$Messa3 = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa3 === void 0 ? void 0 : _store$getState$Messa3[key]) || false;
|
|
23686
23736
|
if (!(obj.type === 'addOwn')) {
|
|
23687
|
-
|
|
23737
|
+
_context9.n = 90;
|
|
23688
23738
|
break;
|
|
23689
23739
|
}
|
|
23690
|
-
|
|
23740
|
+
_context9.n = 89;
|
|
23691
23741
|
return effects.put(addPollVotesToListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote], hasNext, undefined));
|
|
23692
23742
|
case 89:
|
|
23693
|
-
|
|
23743
|
+
_context9.n = 91;
|
|
23694
23744
|
break;
|
|
23695
23745
|
case 90:
|
|
23696
|
-
|
|
23746
|
+
_context9.n = 91;
|
|
23697
23747
|
return effects.put(deletePollVotesFromListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote], messageId));
|
|
23698
23748
|
case 91:
|
|
23699
23749
|
_i++;
|
|
23700
|
-
|
|
23750
|
+
_context9.n = 88;
|
|
23701
23751
|
break;
|
|
23702
23752
|
case 92:
|
|
23703
23753
|
_i2 = 0, _objs2 = objs;
|
|
23704
23754
|
case 93:
|
|
23705
23755
|
if (!(_i2 < _objs2.length)) {
|
|
23706
|
-
|
|
23756
|
+
_context9.n = 95;
|
|
23707
23757
|
break;
|
|
23708
23758
|
}
|
|
23709
23759
|
_obj = _objs2[_i2];
|
|
@@ -23715,25 +23765,25 @@ function watchForEvents() {
|
|
|
23715
23765
|
vote: _obj.vote
|
|
23716
23766
|
});
|
|
23717
23767
|
if (!(_channel7.id === _activeChannelId5)) {
|
|
23718
|
-
|
|
23768
|
+
_context9.n = 94;
|
|
23719
23769
|
break;
|
|
23720
23770
|
}
|
|
23721
|
-
|
|
23771
|
+
_context9.n = 94;
|
|
23722
23772
|
return effects.put(updateMessageAC(messageId, {}, undefined, _obj));
|
|
23723
23773
|
case 94:
|
|
23724
23774
|
_i2++;
|
|
23725
|
-
|
|
23775
|
+
_context9.n = 93;
|
|
23726
23776
|
break;
|
|
23727
23777
|
case 95:
|
|
23728
|
-
return
|
|
23778
|
+
return _context9.a(3, 174);
|
|
23729
23779
|
case 96:
|
|
23730
23780
|
log.info('CHANNEL_EVENT_TYPES.POLL_DELETED ... ');
|
|
23731
23781
|
_channel8 = args.channel, _pollDetails = args.pollDetails, _messageId = args.messageId;
|
|
23732
23782
|
_pollDetailsData = _pollDetails;
|
|
23733
|
-
|
|
23783
|
+
_context9.n = 97;
|
|
23734
23784
|
return effects.call(getActiveChannelId);
|
|
23735
23785
|
case 97:
|
|
23736
|
-
_activeChannelId6 =
|
|
23786
|
+
_activeChannelId6 = _context9.v;
|
|
23737
23787
|
_deletedVotes = (_pollDetailsData === null || _pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan3 = _pollDetailsData.changedVotes) === null || _pollDetailsData$chan3 === void 0 ? void 0 : _pollDetailsData$chan3.removedVotes) || [];
|
|
23738
23788
|
_objs3 = [];
|
|
23739
23789
|
for (_iterator6 = _createForOfIteratorHelperLoose(_deletedVotes); !(_step6 = _iterator6()).done;) {
|
|
@@ -23746,25 +23796,25 @@ function watchForEvents() {
|
|
|
23746
23796
|
_i3 = 0, _objs4 = _objs3;
|
|
23747
23797
|
case 98:
|
|
23748
23798
|
if (!(_i3 < _objs4.length)) {
|
|
23749
|
-
|
|
23799
|
+
_context9.n = 100;
|
|
23750
23800
|
break;
|
|
23751
23801
|
}
|
|
23752
23802
|
_obj2 = _objs4[_i3];
|
|
23753
23803
|
if (!(_pollDetailsData !== null && _pollDetailsData !== void 0 && _pollDetailsData.id && _obj2.vote)) {
|
|
23754
|
-
|
|
23804
|
+
_context9.n = 99;
|
|
23755
23805
|
break;
|
|
23756
23806
|
}
|
|
23757
|
-
|
|
23807
|
+
_context9.n = 99;
|
|
23758
23808
|
return effects.put(deletePollVotesFromListAC(_pollDetailsData.id, _obj2.vote.optionId, [_obj2.vote], _messageId));
|
|
23759
23809
|
case 99:
|
|
23760
23810
|
_i3++;
|
|
23761
|
-
|
|
23811
|
+
_context9.n = 98;
|
|
23762
23812
|
break;
|
|
23763
23813
|
case 100:
|
|
23764
23814
|
_i4 = 0, _objs5 = _objs3;
|
|
23765
23815
|
case 101:
|
|
23766
23816
|
if (!(_i4 < _objs5.length)) {
|
|
23767
|
-
|
|
23817
|
+
_context9.n = 103;
|
|
23768
23818
|
break;
|
|
23769
23819
|
}
|
|
23770
23820
|
_obj3 = _objs5[_i4];
|
|
@@ -23773,24 +23823,24 @@ function watchForEvents() {
|
|
|
23773
23823
|
params: {}
|
|
23774
23824
|
}, _obj3);
|
|
23775
23825
|
if (!(_channel8.id === _activeChannelId6)) {
|
|
23776
|
-
|
|
23826
|
+
_context9.n = 102;
|
|
23777
23827
|
break;
|
|
23778
23828
|
}
|
|
23779
|
-
|
|
23829
|
+
_context9.n = 102;
|
|
23780
23830
|
return effects.put(updateMessageAC(_messageId, {}, undefined, _obj3));
|
|
23781
23831
|
case 102:
|
|
23782
23832
|
_i4++;
|
|
23783
|
-
|
|
23833
|
+
_context9.n = 101;
|
|
23784
23834
|
break;
|
|
23785
23835
|
case 103:
|
|
23786
|
-
return
|
|
23836
|
+
return _context9.a(3, 174);
|
|
23787
23837
|
case 104:
|
|
23788
23838
|
log.info('CHANNEL_EVENT_TYPES.POLL_RETRACTED ... ');
|
|
23789
23839
|
_channel9 = args.channel, _pollDetails2 = args.pollDetails, _messageId2 = args.messageId;
|
|
23790
|
-
|
|
23840
|
+
_context9.n = 105;
|
|
23791
23841
|
return effects.call(getActiveChannelId);
|
|
23792
23842
|
case 105:
|
|
23793
|
-
_activeChannelId7 =
|
|
23843
|
+
_activeChannelId7 = _context9.v;
|
|
23794
23844
|
_pollDetailsData2 = _pollDetails2;
|
|
23795
23845
|
retractedVotes = (_pollDetailsData2 === null || _pollDetailsData2 === void 0 ? void 0 : (_pollDetailsData2$cha = _pollDetailsData2.changedVotes) === null || _pollDetailsData2$cha === void 0 ? void 0 : _pollDetailsData2$cha.removedVotes) || [];
|
|
23796
23846
|
_objs6 = [];
|
|
@@ -23804,7 +23854,7 @@ function watchForEvents() {
|
|
|
23804
23854
|
_i5 = 0, _objs7 = _objs6;
|
|
23805
23855
|
case 106:
|
|
23806
23856
|
if (!(_i5 < _objs7.length)) {
|
|
23807
|
-
|
|
23857
|
+
_context9.n = 111;
|
|
23808
23858
|
break;
|
|
23809
23859
|
}
|
|
23810
23860
|
_obj4 = _objs7[_i5];
|
|
@@ -23813,41 +23863,41 @@ function watchForEvents() {
|
|
|
23813
23863
|
params: {}
|
|
23814
23864
|
}, _obj4);
|
|
23815
23865
|
if (!(_pollDetailsData2 !== null && _pollDetailsData2 !== void 0 && _pollDetailsData2.id && retractedVotes.length > 0)) {
|
|
23816
|
-
|
|
23866
|
+
_context9.n = 109;
|
|
23817
23867
|
break;
|
|
23818
23868
|
}
|
|
23819
23869
|
_iterator8 = _createForOfIteratorHelperLoose(retractedVotes);
|
|
23820
23870
|
case 107:
|
|
23821
23871
|
if ((_step8 = _iterator8()).done) {
|
|
23822
|
-
|
|
23872
|
+
_context9.n = 109;
|
|
23823
23873
|
break;
|
|
23824
23874
|
}
|
|
23825
23875
|
_vote3 = _step8.value;
|
|
23826
|
-
|
|
23876
|
+
_context9.n = 108;
|
|
23827
23877
|
return effects.put(deletePollVotesFromListAC(_pollDetailsData2.id, _vote3.optionId, [_vote3], _messageId2));
|
|
23828
23878
|
case 108:
|
|
23829
|
-
|
|
23879
|
+
_context9.n = 107;
|
|
23830
23880
|
break;
|
|
23831
23881
|
case 109:
|
|
23832
23882
|
if (!(_channel9.id === _activeChannelId7)) {
|
|
23833
|
-
|
|
23883
|
+
_context9.n = 110;
|
|
23834
23884
|
break;
|
|
23835
23885
|
}
|
|
23836
|
-
|
|
23886
|
+
_context9.n = 110;
|
|
23837
23887
|
return effects.put(updateMessageAC(_messageId2, {}, undefined, _obj4));
|
|
23838
23888
|
case 110:
|
|
23839
23889
|
_i5++;
|
|
23840
|
-
|
|
23890
|
+
_context9.n = 106;
|
|
23841
23891
|
break;
|
|
23842
23892
|
case 111:
|
|
23843
|
-
return
|
|
23893
|
+
return _context9.a(3, 174);
|
|
23844
23894
|
case 112:
|
|
23845
23895
|
log.info('CHANNEL_EVENT_TYPES.POLL_CLOSED ... ');
|
|
23846
23896
|
_channel0 = args.channel, _messageId3 = args.messageId;
|
|
23847
|
-
|
|
23897
|
+
_context9.n = 113;
|
|
23848
23898
|
return effects.call(getActiveChannelId);
|
|
23849
23899
|
case 113:
|
|
23850
|
-
_activeChannelId8 =
|
|
23900
|
+
_activeChannelId8 = _context9.v;
|
|
23851
23901
|
_obj5 = {
|
|
23852
23902
|
type: 'close'
|
|
23853
23903
|
};
|
|
@@ -23856,74 +23906,74 @@ function watchForEvents() {
|
|
|
23856
23906
|
params: {}
|
|
23857
23907
|
}, _obj5);
|
|
23858
23908
|
if (!(_channel0.id === _activeChannelId8)) {
|
|
23859
|
-
|
|
23909
|
+
_context9.n = 115;
|
|
23860
23910
|
break;
|
|
23861
23911
|
}
|
|
23862
|
-
|
|
23912
|
+
_context9.n = 114;
|
|
23863
23913
|
return effects.put(updateMessageAC(_messageId3, {}, undefined, _obj5));
|
|
23864
23914
|
case 114:
|
|
23865
|
-
return
|
|
23915
|
+
return _context9.a(3, 174);
|
|
23866
23916
|
case 115:
|
|
23867
|
-
return
|
|
23917
|
+
return _context9.a(3, 174);
|
|
23868
23918
|
case 116:
|
|
23869
23919
|
_channel1 = args.channel, _user = args.user, _message = args.message, _reaction = args.reaction;
|
|
23870
23920
|
log.info('channel REACTION_DELETED ... ', _channel1);
|
|
23871
23921
|
channelFromMap = getChannelFromMap(_channel1.id);
|
|
23872
23922
|
_isSelf = _user.id === SceytChatClient.user.id;
|
|
23873
|
-
|
|
23923
|
+
_context9.n = 117;
|
|
23874
23924
|
return effects.call(getActiveChannelId);
|
|
23875
23925
|
case 117:
|
|
23876
|
-
_activeChannelId9 =
|
|
23926
|
+
_activeChannelId9 = _context9.v;
|
|
23877
23927
|
if (!(_channel1.id === _activeChannelId9)) {
|
|
23878
|
-
|
|
23928
|
+
_context9.n = 118;
|
|
23879
23929
|
break;
|
|
23880
23930
|
}
|
|
23881
|
-
|
|
23931
|
+
_context9.n = 118;
|
|
23882
23932
|
return effects.put(deleteReactionFromMessageAC(_message, _reaction, _isSelf));
|
|
23883
23933
|
case 118:
|
|
23884
23934
|
_channelUpdateParams = JSON.parse(JSON.stringify(_channel1));
|
|
23885
23935
|
if (channelFromMap && channelFromMap.lastReactedMessage && channelFromMap.lastReactedMessage.id === _message.id) {
|
|
23886
23936
|
_channelUpdateParams.lastReactedMessage = null;
|
|
23887
23937
|
}
|
|
23888
|
-
|
|
23938
|
+
_context9.n = 119;
|
|
23889
23939
|
return effects.put(updateChannelDataAC(_channel1.id, _channelUpdateParams));
|
|
23890
23940
|
case 119:
|
|
23891
23941
|
updateChannelOnAllChannels(_channel1.id, _channelUpdateParams);
|
|
23892
23942
|
if (checkChannelExistsOnMessagesMap(_channel1.id)) {
|
|
23893
23943
|
removeReactionToMessageOnMap(_channel1.id, _message, _reaction, true);
|
|
23894
23944
|
}
|
|
23895
|
-
return
|
|
23945
|
+
return _context9.a(3, 174);
|
|
23896
23946
|
case 120:
|
|
23897
|
-
|
|
23947
|
+
_context9.n = 121;
|
|
23898
23948
|
return effects.call(handleUnreadMessagesInfoEvent, args);
|
|
23899
23949
|
case 121:
|
|
23900
|
-
return
|
|
23950
|
+
return _context9.a(3, 174);
|
|
23901
23951
|
case 122:
|
|
23902
23952
|
_channel10 = args.channel;
|
|
23903
23953
|
log.info('CLEAR_HISTORY: ', _channel10);
|
|
23904
|
-
|
|
23954
|
+
_context9.n = 123;
|
|
23905
23955
|
return effects.call(getActiveChannelId);
|
|
23906
23956
|
case 123:
|
|
23907
|
-
_activeChannelId0 =
|
|
23908
|
-
|
|
23957
|
+
_activeChannelId0 = _context9.v;
|
|
23958
|
+
_context9.n = 124;
|
|
23909
23959
|
return effects.call(checkChannelExists, _channel10.id);
|
|
23910
23960
|
case 124:
|
|
23911
|
-
channelExist =
|
|
23961
|
+
channelExist = _context9.v;
|
|
23912
23962
|
if (!(_channel10.id === _activeChannelId0)) {
|
|
23913
|
-
|
|
23963
|
+
_context9.n = 126;
|
|
23914
23964
|
break;
|
|
23915
23965
|
}
|
|
23916
|
-
|
|
23966
|
+
_context9.n = 125;
|
|
23917
23967
|
return effects.put(clearMessagesAC());
|
|
23918
23968
|
case 125:
|
|
23919
23969
|
removeAllMessages();
|
|
23920
23970
|
case 126:
|
|
23921
23971
|
removeMessagesFromMap(_channel10.id);
|
|
23922
23972
|
if (!channelExist) {
|
|
23923
|
-
|
|
23973
|
+
_context9.n = 127;
|
|
23924
23974
|
break;
|
|
23925
23975
|
}
|
|
23926
|
-
|
|
23976
|
+
_context9.n = 127;
|
|
23927
23977
|
return effects.put(updateChannelDataAC(_channel10.id, {
|
|
23928
23978
|
lastMessage: null,
|
|
23929
23979
|
newMessageCount: 0,
|
|
@@ -23939,11 +23989,11 @@ function watchForEvents() {
|
|
|
23939
23989
|
muted: _channel10.muted,
|
|
23940
23990
|
mutedTill: _channel10.mutedTill
|
|
23941
23991
|
});
|
|
23942
|
-
return
|
|
23992
|
+
return _context9.a(3, 174);
|
|
23943
23993
|
case 128:
|
|
23944
23994
|
_channel11 = args.channel;
|
|
23945
23995
|
log.info('channel MUTE ... ');
|
|
23946
|
-
|
|
23996
|
+
_context9.n = 129;
|
|
23947
23997
|
return effects.put(updateChannelDataAC(_channel11.id, {
|
|
23948
23998
|
muted: _channel11.muted,
|
|
23949
23999
|
mutedTill: _channel11.mutedTill
|
|
@@ -23953,11 +24003,11 @@ function watchForEvents() {
|
|
|
23953
24003
|
muted: _channel11.muted,
|
|
23954
24004
|
mutedTill: _channel11.mutedTill
|
|
23955
24005
|
});
|
|
23956
|
-
return
|
|
24006
|
+
return _context9.a(3, 174);
|
|
23957
24007
|
case 130:
|
|
23958
24008
|
_channel12 = args.channel;
|
|
23959
24009
|
log.info('channel UNMUTE ... ');
|
|
23960
|
-
|
|
24010
|
+
_context9.n = 131;
|
|
23961
24011
|
return effects.put(updateChannelDataAC(_channel12.id, {
|
|
23962
24012
|
muted: _channel12.muted,
|
|
23963
24013
|
mutedTill: _channel12.mutedTill
|
|
@@ -23967,11 +24017,11 @@ function watchForEvents() {
|
|
|
23967
24017
|
muted: _channel12.muted,
|
|
23968
24018
|
mutedTill: _channel12.mutedTill
|
|
23969
24019
|
});
|
|
23970
|
-
return
|
|
24020
|
+
return _context9.a(3, 174);
|
|
23971
24021
|
case 132:
|
|
23972
24022
|
_channel13 = args.channel;
|
|
23973
24023
|
log.info('channel PINED ... ');
|
|
23974
|
-
|
|
24024
|
+
_context9.n = 133;
|
|
23975
24025
|
return effects.put(updateChannelDataAC(_channel13.id, {
|
|
23976
24026
|
pinnedAt: _channel13.pinnedAt
|
|
23977
24027
|
}, true));
|
|
@@ -23979,11 +24029,11 @@ function watchForEvents() {
|
|
|
23979
24029
|
updateChannelOnAllChannels(_channel13.id, {
|
|
23980
24030
|
pinnedAt: _channel13.pinnedAt
|
|
23981
24031
|
});
|
|
23982
|
-
return
|
|
24032
|
+
return _context9.a(3, 174);
|
|
23983
24033
|
case 134:
|
|
23984
24034
|
_channel14 = args.channel;
|
|
23985
24035
|
log.info('channel UNPINED ... ');
|
|
23986
|
-
|
|
24036
|
+
_context9.n = 135;
|
|
23987
24037
|
return effects.put(updateChannelDataAC(_channel14.id, {
|
|
23988
24038
|
pinnedAt: _channel14.pinnedAt
|
|
23989
24039
|
}, false, true));
|
|
@@ -23991,39 +24041,39 @@ function watchForEvents() {
|
|
|
23991
24041
|
updateChannelOnAllChannels(_channel14.id, {
|
|
23992
24042
|
pinnedAt: _channel14.pinnedAt
|
|
23993
24043
|
});
|
|
23994
|
-
return
|
|
24044
|
+
return _context9.a(3, 174);
|
|
23995
24045
|
case 136:
|
|
23996
24046
|
_channel15 = args.channel;
|
|
23997
24047
|
log.info('channel HIDE ... ');
|
|
23998
|
-
|
|
24048
|
+
_context9.n = 137;
|
|
23999
24049
|
return effects.put(setChannelToHideAC(_channel15));
|
|
24000
24050
|
case 137:
|
|
24001
|
-
|
|
24051
|
+
_context9.n = 138;
|
|
24002
24052
|
return effects.call(getActiveChannelId);
|
|
24003
24053
|
case 138:
|
|
24004
|
-
_activeChannelId1 =
|
|
24054
|
+
_activeChannelId1 = _context9.v;
|
|
24005
24055
|
if (!(_activeChannelId1 === _channel15.id)) {
|
|
24006
|
-
|
|
24056
|
+
_context9.n = 140;
|
|
24007
24057
|
break;
|
|
24008
24058
|
}
|
|
24009
|
-
|
|
24059
|
+
_context9.n = 139;
|
|
24010
24060
|
return effects.call(getLastChannelFromMap, true);
|
|
24011
24061
|
case 139:
|
|
24012
|
-
lastChannel =
|
|
24013
|
-
|
|
24062
|
+
lastChannel = _context9.v;
|
|
24063
|
+
_context9.n = 140;
|
|
24014
24064
|
return effects.put(switchChannelActionAC(lastChannel || null));
|
|
24015
24065
|
case 140:
|
|
24016
|
-
return
|
|
24066
|
+
return _context9.a(3, 174);
|
|
24017
24067
|
case 141:
|
|
24018
24068
|
_channel16 = args.channel;
|
|
24019
24069
|
log.info('channel UNHIDE ... ');
|
|
24020
|
-
|
|
24070
|
+
_context9.n = 142;
|
|
24021
24071
|
return effects.put(setChannelToUnHideAC(_channel16));
|
|
24022
24072
|
case 142:
|
|
24023
|
-
return
|
|
24073
|
+
return _context9.a(3, 174);
|
|
24024
24074
|
case 143:
|
|
24025
24075
|
_channel17 = args.channel;
|
|
24026
|
-
|
|
24076
|
+
_context9.n = 144;
|
|
24027
24077
|
return effects.put(updateChannelDataAC(_channel17.id, {
|
|
24028
24078
|
unread: _channel17.unread,
|
|
24029
24079
|
muted: _channel17.muted,
|
|
@@ -24031,7 +24081,7 @@ function watchForEvents() {
|
|
|
24031
24081
|
}));
|
|
24032
24082
|
case 144:
|
|
24033
24083
|
_groupName4 = getChannelGroupName(_channel17);
|
|
24034
|
-
|
|
24084
|
+
_context9.n = 145;
|
|
24035
24085
|
return effects.put(updateSearchedChannelDataAC(_channel17.id, {
|
|
24036
24086
|
unread: _channel17.unread
|
|
24037
24087
|
}, _groupName4));
|
|
@@ -24039,104 +24089,90 @@ function watchForEvents() {
|
|
|
24039
24089
|
updateChannelOnAllChannels(_channel17.id, {
|
|
24040
24090
|
unread: _channel17.unread
|
|
24041
24091
|
});
|
|
24042
|
-
return
|
|
24092
|
+
return _context9.a(3, 174);
|
|
24043
24093
|
case 146:
|
|
24044
|
-
|
|
24045
|
-
|
|
24046
|
-
return effects.put(updateChannelDataAC(_channel18.id, {
|
|
24047
|
-
unread: _channel18.unread,
|
|
24048
|
-
muted: _channel18.muted,
|
|
24049
|
-
mutedTill: _channel18.mutedTill
|
|
24050
|
-
}));
|
|
24094
|
+
_context9.n = 147;
|
|
24095
|
+
return effects.call(handleChannelMarkedAsReadEvent, args);
|
|
24051
24096
|
case 147:
|
|
24052
|
-
|
|
24053
|
-
_context8.n = 148;
|
|
24054
|
-
return effects.put(updateSearchedChannelDataAC(_channel18.id, {
|
|
24055
|
-
unread: _channel18.unread
|
|
24056
|
-
}, _groupName5));
|
|
24097
|
+
return _context9.a(3, 174);
|
|
24057
24098
|
case 148:
|
|
24058
|
-
|
|
24059
|
-
|
|
24060
|
-
});
|
|
24061
|
-
return _context8.a(3, 175);
|
|
24062
|
-
case 149:
|
|
24063
|
-
_channel19 = args.channel, members = args.members;
|
|
24064
|
-
log.info('channel CHANGE_ROLE channel ... ', _channel19);
|
|
24099
|
+
_channel18 = args.channel, members = args.members;
|
|
24100
|
+
log.info('channel CHANGE_ROLE channel ... ', _channel18);
|
|
24065
24101
|
log.info('channel CHANGE_ROLE member ... ', members);
|
|
24066
|
-
|
|
24102
|
+
_context9.n = 149;
|
|
24067
24103
|
return effects.call(getActiveChannelId);
|
|
24068
|
-
case
|
|
24069
|
-
_activeChannelId10 =
|
|
24070
|
-
if (!(
|
|
24071
|
-
|
|
24104
|
+
case 149:
|
|
24105
|
+
_activeChannelId10 = _context9.v;
|
|
24106
|
+
if (!(_channel18.id === _activeChannelId10)) {
|
|
24107
|
+
_context9.n = 153;
|
|
24072
24108
|
break;
|
|
24073
24109
|
}
|
|
24074
24110
|
_customLoadMembersFunctions2 = getCustomLoadMembersFunctions();
|
|
24075
24111
|
updateMembersEvent = _customLoadMembersFunctions2 === null || _customLoadMembersFunctions2 === void 0 ? void 0 : _customLoadMembersFunctions2.updateMembersEvent;
|
|
24076
24112
|
if (!updateMembersEvent) {
|
|
24077
|
-
|
|
24113
|
+
_context9.n = 152;
|
|
24078
24114
|
break;
|
|
24079
24115
|
}
|
|
24080
|
-
|
|
24081
|
-
return effects.call(updateMembersEvent,
|
|
24116
|
+
_context9.n = 150;
|
|
24117
|
+
return effects.call(updateMembersEvent, _channel18.id, members, store.getState().MembersReducer.channelsMembersMap[_channel18.id] || []);
|
|
24118
|
+
case 150:
|
|
24119
|
+
_membersList2 = _context9.v;
|
|
24120
|
+
_context9.n = 151;
|
|
24121
|
+
return effects.put(setMembersToListAC(_membersList2, _channel18.id));
|
|
24082
24122
|
case 151:
|
|
24083
|
-
|
|
24084
|
-
_context8.n = 152;
|
|
24085
|
-
return effects.put(setMembersToListAC(_membersList2, _channel19.id));
|
|
24086
|
-
case 152:
|
|
24087
|
-
_context8.n = 154;
|
|
24123
|
+
_context9.n = 153;
|
|
24088
24124
|
break;
|
|
24125
|
+
case 152:
|
|
24126
|
+
_context9.n = 153;
|
|
24127
|
+
return effects.put(updateMembersAC(members, _channel18.id));
|
|
24089
24128
|
case 153:
|
|
24090
|
-
_context8.n = 154;
|
|
24091
|
-
return effects.put(updateMembersAC(members, _channel19.id));
|
|
24092
|
-
case 154:
|
|
24093
24129
|
i = 0;
|
|
24094
|
-
case
|
|
24130
|
+
case 154:
|
|
24095
24131
|
if (!(i < members.length)) {
|
|
24096
|
-
|
|
24132
|
+
_context9.n = 157;
|
|
24097
24133
|
break;
|
|
24098
24134
|
}
|
|
24099
24135
|
if (!(members[i].id === SceytChatClient.user.id)) {
|
|
24100
|
-
|
|
24136
|
+
_context9.n = 156;
|
|
24101
24137
|
break;
|
|
24102
24138
|
}
|
|
24103
|
-
|
|
24104
|
-
return effects.put(updateChannelDataAC(
|
|
24139
|
+
_context9.n = 155;
|
|
24140
|
+
return effects.put(updateChannelDataAC(_channel18.id, {
|
|
24105
24141
|
userRole: members[i].role,
|
|
24106
|
-
muted:
|
|
24107
|
-
mutedTill:
|
|
24142
|
+
muted: _channel18.muted,
|
|
24143
|
+
mutedTill: _channel18.mutedTill
|
|
24108
24144
|
}));
|
|
24109
|
-
case
|
|
24110
|
-
updateChannelOnAllChannels(
|
|
24145
|
+
case 155:
|
|
24146
|
+
updateChannelOnAllChannels(_channel18.id, {
|
|
24111
24147
|
userRole: members[i].role,
|
|
24112
|
-
muted:
|
|
24113
|
-
mutedTill:
|
|
24148
|
+
muted: _channel18.muted,
|
|
24149
|
+
mutedTill: _channel18.mutedTill
|
|
24114
24150
|
});
|
|
24115
|
-
case
|
|
24151
|
+
case 156:
|
|
24116
24152
|
i++;
|
|
24117
|
-
|
|
24153
|
+
_context9.n = 154;
|
|
24118
24154
|
break;
|
|
24155
|
+
case 157:
|
|
24156
|
+
return _context9.a(3, 174);
|
|
24119
24157
|
case 158:
|
|
24120
|
-
|
|
24158
|
+
_channel19 = args.channel;
|
|
24159
|
+
log.info('channel frozen channel ... ', _channel19);
|
|
24160
|
+
return _context9.a(3, 174);
|
|
24121
24161
|
case 159:
|
|
24122
24162
|
_channel20 = args.channel;
|
|
24123
|
-
log.info('channel
|
|
24124
|
-
return
|
|
24163
|
+
log.info('channel unfrozen channel ... ', _channel20);
|
|
24164
|
+
return _context9.a(3, 174);
|
|
24125
24165
|
case 160:
|
|
24126
|
-
_channel21 = args.channel;
|
|
24127
|
-
log.info('channel unfrozen channel ... ', _channel21);
|
|
24128
|
-
return _context8.a(3, 175);
|
|
24129
|
-
case 161:
|
|
24130
24166
|
_channelId = args.channelId, from = args.from, name = args.name;
|
|
24131
24167
|
log.info('channel event received >>>... . . . . . ', args);
|
|
24132
24168
|
if (!(from.id === SceytChatClient.user.id)) {
|
|
24133
|
-
|
|
24169
|
+
_context9.n = 161;
|
|
24134
24170
|
break;
|
|
24135
24171
|
}
|
|
24136
|
-
return
|
|
24137
|
-
case
|
|
24172
|
+
return _context9.a(3, 174);
|
|
24173
|
+
case 161:
|
|
24138
24174
|
if (!(name === 'start_typing')) {
|
|
24139
|
-
|
|
24175
|
+
_context9.n = 163;
|
|
24140
24176
|
break;
|
|
24141
24177
|
}
|
|
24142
24178
|
if (!usersTimeout.typingTimeout[_channelId]) {
|
|
@@ -24148,27 +24184,27 @@ function watchForEvents() {
|
|
|
24148
24184
|
usersTimeout.typingTimeout[_channelId][from.id] = setTimeout(function () {
|
|
24149
24185
|
channelListener.onReceivedChannelEvent(_channelId, from, 'stop_typing');
|
|
24150
24186
|
}, 5000);
|
|
24151
|
-
|
|
24187
|
+
_context9.n = 162;
|
|
24152
24188
|
return effects.put(switchTypingIndicatorAC(true, _channelId, from));
|
|
24153
|
-
case
|
|
24154
|
-
|
|
24189
|
+
case 162:
|
|
24190
|
+
_context9.n = 168;
|
|
24155
24191
|
break;
|
|
24156
|
-
case
|
|
24192
|
+
case 163:
|
|
24157
24193
|
if (!(name === 'stop_typing')) {
|
|
24158
|
-
|
|
24194
|
+
_context9.n = 165;
|
|
24159
24195
|
break;
|
|
24160
24196
|
}
|
|
24161
24197
|
if (usersTimeout.typingTimeout[_channelId] && usersTimeout.typingTimeout[_channelId][from.id]) {
|
|
24162
24198
|
clearTimeout(usersTimeout.typingTimeout[_channelId][from.id]);
|
|
24163
24199
|
}
|
|
24164
|
-
|
|
24200
|
+
_context9.n = 164;
|
|
24165
24201
|
return effects.put(switchTypingIndicatorAC(false, _channelId, from));
|
|
24166
|
-
case
|
|
24167
|
-
|
|
24202
|
+
case 164:
|
|
24203
|
+
_context9.n = 168;
|
|
24168
24204
|
break;
|
|
24169
|
-
case
|
|
24205
|
+
case 165:
|
|
24170
24206
|
if (!(name === 'start_recording')) {
|
|
24171
|
-
|
|
24207
|
+
_context9.n = 167;
|
|
24172
24208
|
break;
|
|
24173
24209
|
}
|
|
24174
24210
|
if (!usersTimeout.recordingTimeout[_channelId]) {
|
|
@@ -24180,63 +24216,63 @@ function watchForEvents() {
|
|
|
24180
24216
|
usersTimeout.recordingTimeout[_channelId][from.id] = setTimeout(function () {
|
|
24181
24217
|
channelListener.onReceivedChannelEvent(_channelId, from, 'stop_recording');
|
|
24182
24218
|
}, 5000);
|
|
24183
|
-
|
|
24219
|
+
_context9.n = 166;
|
|
24184
24220
|
return effects.put(switchRecordingIndicatorAC(true, _channelId, from));
|
|
24185
|
-
case
|
|
24186
|
-
|
|
24221
|
+
case 166:
|
|
24222
|
+
_context9.n = 168;
|
|
24187
24223
|
break;
|
|
24188
|
-
case
|
|
24224
|
+
case 167:
|
|
24189
24225
|
if (!(name === 'stop_recording')) {
|
|
24190
|
-
|
|
24226
|
+
_context9.n = 168;
|
|
24191
24227
|
break;
|
|
24192
24228
|
}
|
|
24193
24229
|
if (usersTimeout.recordingTimeout[_channelId] && usersTimeout.recordingTimeout[_channelId][from.id]) {
|
|
24194
24230
|
clearTimeout(usersTimeout.recordingTimeout[_channelId][from.id]);
|
|
24195
24231
|
}
|
|
24196
|
-
|
|
24232
|
+
_context9.n = 168;
|
|
24197
24233
|
return effects.put(switchRecordingIndicatorAC(false, _channelId, from));
|
|
24234
|
+
case 168:
|
|
24235
|
+
return _context9.a(3, 174);
|
|
24198
24236
|
case 169:
|
|
24199
|
-
return _context8.a(3, 175);
|
|
24200
|
-
case 170:
|
|
24201
24237
|
status = args.status;
|
|
24202
24238
|
log.info('connection status changed . . . . . ', status);
|
|
24203
|
-
|
|
24239
|
+
_context9.n = 170;
|
|
24204
24240
|
return effects.put(setConnectionStatusAC(status));
|
|
24205
|
-
case
|
|
24241
|
+
case 170:
|
|
24206
24242
|
if (!(status === CONNECTION_STATUS.CONNECTED)) {
|
|
24207
|
-
|
|
24243
|
+
_context9.n = 172;
|
|
24208
24244
|
break;
|
|
24209
24245
|
}
|
|
24210
|
-
|
|
24246
|
+
_context9.n = 171;
|
|
24211
24247
|
return effects.put(getRolesAC());
|
|
24212
|
-
case
|
|
24213
|
-
|
|
24248
|
+
case 171:
|
|
24249
|
+
_context9.n = 172;
|
|
24214
24250
|
return effects.put(resendPendingMessageMutationsAC(status));
|
|
24251
|
+
case 172:
|
|
24252
|
+
return _context9.a(3, 174);
|
|
24215
24253
|
case 173:
|
|
24216
|
-
return _context8.a(3, 175);
|
|
24217
|
-
case 174:
|
|
24218
24254
|
log.warn('UNHANDLED EVENT FROM REDUX-SAGA EVENT-CHANNEL');
|
|
24219
|
-
case
|
|
24220
|
-
|
|
24255
|
+
case 174:
|
|
24256
|
+
_context9.n = 176;
|
|
24221
24257
|
break;
|
|
24222
|
-
case
|
|
24223
|
-
|
|
24224
|
-
_t4 =
|
|
24258
|
+
case 175:
|
|
24259
|
+
_context9.p = 175;
|
|
24260
|
+
_t4 = _context9.v;
|
|
24225
24261
|
log.error('Error in watchForEvents:', _t4);
|
|
24226
|
-
case
|
|
24227
|
-
return
|
|
24262
|
+
case 176:
|
|
24263
|
+
return _context9.a(2);
|
|
24228
24264
|
}
|
|
24229
|
-
}, _callee3, null, [[0,
|
|
24265
|
+
}, _callee3, null, [[0, 175]]);
|
|
24230
24266
|
});
|
|
24231
24267
|
case 1:
|
|
24232
|
-
return
|
|
24268
|
+
return _context0.d(_regeneratorValues(_loop()), 2);
|
|
24233
24269
|
case 2:
|
|
24234
|
-
|
|
24270
|
+
_context0.n = 1;
|
|
24235
24271
|
break;
|
|
24236
24272
|
case 3:
|
|
24237
|
-
return
|
|
24273
|
+
return _context0.a(2);
|
|
24238
24274
|
}
|
|
24239
|
-
},
|
|
24275
|
+
}, _marked7$1);
|
|
24240
24276
|
}
|
|
24241
24277
|
|
|
24242
24278
|
var _marked$3 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
@@ -24245,7 +24281,7 @@ var _marked$3 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
|
24245
24281
|
_marked4$2 = /*#__PURE__*/_regenerator().m(getChannelsForForward),
|
|
24246
24282
|
_marked5$2 = /*#__PURE__*/_regenerator().m(searchChannelsForForward),
|
|
24247
24283
|
_marked6$2 = /*#__PURE__*/_regenerator().m(channelsLoadMore),
|
|
24248
|
-
_marked7$
|
|
24284
|
+
_marked7$2 = /*#__PURE__*/_regenerator().m(getChannelMentions),
|
|
24249
24285
|
_marked8$1 = /*#__PURE__*/_regenerator().m(channelsForForwardLoadMore),
|
|
24250
24286
|
_marked9$1 = /*#__PURE__*/_regenerator().m(markMessagesRead),
|
|
24251
24287
|
_marked0$1 = /*#__PURE__*/_regenerator().m(markVoiceMessageAsPlayed),
|
|
@@ -24282,6 +24318,34 @@ var _marked$3 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
|
24282
24318
|
_marked39$1 = /*#__PURE__*/_regenerator().m(getChannelsWithUser),
|
|
24283
24319
|
_marked40$1 = /*#__PURE__*/_regenerator().m(loadMoreMutualChannels),
|
|
24284
24320
|
_marked41$1 = /*#__PURE__*/_regenerator().m(ChannelsSaga);
|
|
24321
|
+
var getUniqueMessageIds = function getUniqueMessageIds(messageIds) {
|
|
24322
|
+
if (messageIds === void 0) {
|
|
24323
|
+
messageIds = [];
|
|
24324
|
+
}
|
|
24325
|
+
return Array.from(new Set(messageIds.filter(Boolean)));
|
|
24326
|
+
};
|
|
24327
|
+
var getNewestMessageId = function getNewestMessageId(messageIds) {
|
|
24328
|
+
return getUniqueMessageIds(messageIds).reduce(function (latestMessageId, messageId) {
|
|
24329
|
+
return compareMessageIds(messageId, latestMessageId) > 0 ? messageId : latestMessageId;
|
|
24330
|
+
}, '');
|
|
24331
|
+
};
|
|
24332
|
+
var getLatestIncomingConfirmedMessageId = function getLatestIncomingConfirmedMessageId(channel) {
|
|
24333
|
+
var _channel$lastMessage, _channel$lastMessage2;
|
|
24334
|
+
if (!(channel !== null && channel !== void 0 && channel.id)) {
|
|
24335
|
+
return '';
|
|
24336
|
+
}
|
|
24337
|
+
var latestIncomingConfirmedMessageId = (_channel$lastMessage = channel.lastMessage) !== null && _channel$lastMessage !== void 0 && _channel$lastMessage.incoming && (_channel$lastMessage2 = channel.lastMessage) !== null && _channel$lastMessage2 !== void 0 && _channel$lastMessage2.id ? channel.lastMessage.id : '';
|
|
24338
|
+
var cachedMessages = Object.values(getMessagesFromMap(channel.id) || {});
|
|
24339
|
+
cachedMessages.forEach(function (message) {
|
|
24340
|
+
if (message !== null && message !== void 0 && message.incoming && message.id && compareMessageIds(message.id, latestIncomingConfirmedMessageId) > 0) {
|
|
24341
|
+
latestIncomingConfirmedMessageId = message.id;
|
|
24342
|
+
}
|
|
24343
|
+
});
|
|
24344
|
+
return latestIncomingConfirmedMessageId;
|
|
24345
|
+
};
|
|
24346
|
+
var getLatestUnreadBoundaryId = function getLatestUnreadBoundaryId(channel) {
|
|
24347
|
+
return (channel === null || channel === void 0 ? void 0 : channel.lastReceivedMsgId) || getLatestIncomingConfirmedMessageId(channel);
|
|
24348
|
+
};
|
|
24285
24349
|
function createChannel(action) {
|
|
24286
24350
|
var payload, channelData, dontCreateIfNotExists, callback, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, whoDoesNotAdded, checkChannelExist, messageToSend, _allChannels, _memberId, _t;
|
|
24287
24351
|
return _regenerator().w(function (_context) {
|
|
@@ -25278,7 +25342,7 @@ function getChannelMentions(action) {
|
|
|
25278
25342
|
case 5:
|
|
25279
25343
|
return _context8.a(2);
|
|
25280
25344
|
}
|
|
25281
|
-
}, _marked7$
|
|
25345
|
+
}, _marked7$2, null, [[0, 4]]);
|
|
25282
25346
|
}
|
|
25283
25347
|
function channelsForForwardLoadMore(action) {
|
|
25284
25348
|
var payload, limit, _SceytChatClient4, channelQueryForward, channelsData, channelsToAdd, _yield$call4, mappedChannels, _t0;
|
|
@@ -25332,17 +25396,19 @@ function channelsForForwardLoadMore(action) {
|
|
|
25332
25396
|
}, _marked8$1, null, [[0, 7]]);
|
|
25333
25397
|
}
|
|
25334
25398
|
function markMessagesRead(action) {
|
|
25335
|
-
var payload, channelId, messageIds, connectionStatus, channel, messageListMarker, _iterator6, _step6, messageId, updateParams, _t1;
|
|
25399
|
+
var payload, channelId, messageIds, connectionStatus, channel, previousLastDisplayedMessageId, latestUnreadBoundaryId, messageListMarker, readMessageIds, nextLastDisplayedMessageId, newlyCoveredUnreadCount, nextNewMessageCount, reachedLatestUnreadBoundary, updateData, _iterator6, _step6, messageId, updateParams, _t1;
|
|
25336
25400
|
return _regenerator().w(function (_context0) {
|
|
25337
25401
|
while (1) switch (_context0.p = _context0.n) {
|
|
25338
25402
|
case 0:
|
|
25339
25403
|
payload = action.payload;
|
|
25340
25404
|
channelId = payload.channelId, messageIds = payload.messageIds;
|
|
25405
|
+
log.info("[READ_MESSAGE] saga ch=" + channelId + " ids=[" + messageIds.join(',') + "]");
|
|
25341
25406
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
25342
25407
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
25343
25408
|
_context0.n = 1;
|
|
25344
25409
|
break;
|
|
25345
25410
|
}
|
|
25411
|
+
log.warn("[READ_MESSAGE] saga skip \u2014 not connected (" + connectionStatus + ")");
|
|
25346
25412
|
return _context0.a(2);
|
|
25347
25413
|
case 1:
|
|
25348
25414
|
_context0.n = 2;
|
|
@@ -25357,22 +25423,42 @@ function markMessagesRead(action) {
|
|
|
25357
25423
|
}
|
|
25358
25424
|
}
|
|
25359
25425
|
if (!channel) {
|
|
25360
|
-
_context0.n =
|
|
25426
|
+
_context0.n = 10;
|
|
25361
25427
|
break;
|
|
25362
25428
|
}
|
|
25429
|
+
previousLastDisplayedMessageId = channel.lastDisplayedMessageId || '';
|
|
25430
|
+
latestUnreadBoundaryId = getLatestUnreadBoundaryId(channel);
|
|
25431
|
+
log.info("[READ_MESSAGE] calling markMessagesAsDisplayed ch=" + channelId);
|
|
25363
25432
|
_context0.n = 4;
|
|
25364
25433
|
return effects.call(channel.markMessagesAsDisplayed, messageIds);
|
|
25365
25434
|
case 4:
|
|
25366
25435
|
messageListMarker = _context0.v;
|
|
25436
|
+
readMessageIds = getUniqueMessageIds((messageListMarker === null || messageListMarker === void 0 ? void 0 : messageListMarker.messageIds) || messageIds);
|
|
25437
|
+
nextLastDisplayedMessageId = getNewestMessageId([previousLastDisplayedMessageId].concat(readMessageIds)) || previousLastDisplayedMessageId;
|
|
25438
|
+
newlyCoveredUnreadCount = readMessageIds.filter(function (messageId) {
|
|
25439
|
+
if (compareMessageIds(messageId, previousLastDisplayedMessageId) <= 0) {
|
|
25440
|
+
return false;
|
|
25441
|
+
}
|
|
25442
|
+
return !latestUnreadBoundaryId || compareMessageIds(messageId, latestUnreadBoundaryId) <= 0;
|
|
25443
|
+
}).length;
|
|
25444
|
+
nextNewMessageCount = Math.max(0, (channel.newMessageCount || 0) - newlyCoveredUnreadCount);
|
|
25445
|
+
reachedLatestUnreadBoundary = !!latestUnreadBoundaryId && compareMessageIds(nextLastDisplayedMessageId, latestUnreadBoundaryId) >= 0;
|
|
25446
|
+
updateData = reachedLatestUnreadBoundary || readMessageIds.length > 0 && nextNewMessageCount === 0 ? {
|
|
25447
|
+
lastDisplayedMessageId: nextLastDisplayedMessageId,
|
|
25448
|
+
unread: false,
|
|
25449
|
+
newMessageCount: 0,
|
|
25450
|
+
newMentionCount: 0
|
|
25451
|
+
} : _extends({
|
|
25452
|
+
lastDisplayedMessageId: nextLastDisplayedMessageId
|
|
25453
|
+
}, newlyCoveredUnreadCount > 0 ? {
|
|
25454
|
+
newMessageCount: nextNewMessageCount
|
|
25455
|
+
} : {});
|
|
25456
|
+
log.info("[READ_MESSAGE] marked " + readMessageIds.length + " msgs, newCount=" + nextNewMessageCount);
|
|
25367
25457
|
_context0.n = 5;
|
|
25368
|
-
return effects.put(updateChannelDataAC(channel.id,
|
|
25369
|
-
lastDisplayedMessageId: channel.lastDisplayedMessageId
|
|
25370
|
-
}));
|
|
25458
|
+
return effects.put(updateChannelDataAC(channel.id, updateData));
|
|
25371
25459
|
case 5:
|
|
25372
|
-
updateChannelOnAllChannels(channel.id,
|
|
25373
|
-
|
|
25374
|
-
});
|
|
25375
|
-
_iterator6 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
25460
|
+
updateChannelOnAllChannels(channel.id, updateData);
|
|
25461
|
+
_iterator6 = _createForOfIteratorHelperLoose(readMessageIds);
|
|
25376
25462
|
case 6:
|
|
25377
25463
|
if ((_step6 = _iterator6()).done) {
|
|
25378
25464
|
_context0.n = 9;
|
|
@@ -25382,8 +25468,8 @@ function markMessagesRead(action) {
|
|
|
25382
25468
|
updateParams = {
|
|
25383
25469
|
deliveryStatus: MESSAGE_DELIVERY_STATUS.READ,
|
|
25384
25470
|
userMarkers: [{
|
|
25385
|
-
user: messageListMarker.user,
|
|
25386
|
-
createdAt: messageListMarker.createdAt,
|
|
25471
|
+
user: (messageListMarker === null || messageListMarker === void 0 ? void 0 : messageListMarker.user) || null,
|
|
25472
|
+
createdAt: (messageListMarker === null || messageListMarker === void 0 ? void 0 : messageListMarker.createdAt) || new Date(),
|
|
25387
25473
|
messageId: messageId,
|
|
25388
25474
|
name: MESSAGE_DELIVERY_STATUS.READ
|
|
25389
25475
|
}]
|
|
@@ -25402,13 +25488,18 @@ function markMessagesRead(action) {
|
|
|
25402
25488
|
_context0.n = 11;
|
|
25403
25489
|
break;
|
|
25404
25490
|
case 10:
|
|
25405
|
-
|
|
25406
|
-
_t1 = _context0.v;
|
|
25407
|
-
log.error(_t1, 'Error on mark messages read');
|
|
25491
|
+
log.warn("[READ_MESSAGE] saga skip \u2014 channel not found ch=" + channelId);
|
|
25408
25492
|
case 11:
|
|
25493
|
+
_context0.n = 13;
|
|
25494
|
+
break;
|
|
25495
|
+
case 12:
|
|
25496
|
+
_context0.p = 12;
|
|
25497
|
+
_t1 = _context0.v;
|
|
25498
|
+
log.error(_t1, '[READ_MESSAGE] Error on mark messages read');
|
|
25499
|
+
case 13:
|
|
25409
25500
|
return _context0.a(2);
|
|
25410
25501
|
}
|
|
25411
|
-
}, _marked9$1, null, [[3,
|
|
25502
|
+
}, _marked9$1, null, [[3, 12]]);
|
|
25412
25503
|
}
|
|
25413
25504
|
function markVoiceMessageAsPlayed(action) {
|
|
25414
25505
|
var payload, channelId, messageIds, connectionStatus, channel, messageListMarker, _iterator7, _step7, messageId, updateParams, _t10;
|
|
@@ -25831,7 +25922,7 @@ function notificationsTurnOn() {
|
|
|
25831
25922
|
}, _marked14$1, null, [[3, 6]]);
|
|
25832
25923
|
}
|
|
25833
25924
|
function markChannelAsRead(action) {
|
|
25834
|
-
var channelId, channel, updatedChannel, updateData, _t16;
|
|
25925
|
+
var channelId, channel, updatedChannel, latestUnreadBoundaryId, lastDisplayedCandidates, nextLastDisplayedMessageId, updateData, _t16;
|
|
25835
25926
|
return _regenerator().w(function (_context16) {
|
|
25836
25927
|
while (1) switch (_context16.p = _context16.n) {
|
|
25837
25928
|
case 0:
|
|
@@ -25848,11 +25939,14 @@ function markChannelAsRead(action) {
|
|
|
25848
25939
|
return effects.call(channel.markAsRead);
|
|
25849
25940
|
case 2:
|
|
25850
25941
|
updatedChannel = _context16.v;
|
|
25942
|
+
latestUnreadBoundaryId = getLatestUnreadBoundaryId(channel);
|
|
25943
|
+
lastDisplayedCandidates = [channel.lastDisplayedMessageId || '', (updatedChannel === null || updatedChannel === void 0 ? void 0 : updatedChannel.lastDisplayedMessageId) || '', latestUnreadBoundaryId].filter(Boolean);
|
|
25944
|
+
nextLastDisplayedMessageId = getNewestMessageId(lastDisplayedCandidates) || (updatedChannel === null || updatedChannel === void 0 ? void 0 : updatedChannel.lastDisplayedMessageId) || channel.lastDisplayedMessageId;
|
|
25851
25945
|
updateData = {
|
|
25852
25946
|
unread: false,
|
|
25853
25947
|
newMessageCount: 0,
|
|
25854
25948
|
newMentionCount: 0,
|
|
25855
|
-
lastDisplayedMessageId:
|
|
25949
|
+
lastDisplayedMessageId: nextLastDisplayedMessageId
|
|
25856
25950
|
};
|
|
25857
25951
|
updateChannelOnAllChannels(channel.id, updateData);
|
|
25858
25952
|
_context16.n = 3;
|
|
@@ -27259,7 +27353,7 @@ var _marked$4 = /*#__PURE__*/_regenerator().m(getMembers),
|
|
|
27259
27353
|
_marked4$3 = /*#__PURE__*/_regenerator().m(kickMemberFromChannel),
|
|
27260
27354
|
_marked5$3 = /*#__PURE__*/_regenerator().m(blockMember),
|
|
27261
27355
|
_marked6$3 = /*#__PURE__*/_regenerator().m(changeMemberRole),
|
|
27262
|
-
_marked7$
|
|
27356
|
+
_marked7$3 = /*#__PURE__*/_regenerator().m(reportMember),
|
|
27263
27357
|
_marked8$2 = /*#__PURE__*/_regenerator().m(getRoles),
|
|
27264
27358
|
_marked9$2 = /*#__PURE__*/_regenerator().m(MembersSaga);
|
|
27265
27359
|
function getMembers(action) {
|
|
@@ -27722,7 +27816,7 @@ function reportMember(action) {
|
|
|
27722
27816
|
case 4:
|
|
27723
27817
|
return _context7.a(2);
|
|
27724
27818
|
}
|
|
27725
|
-
}, _marked7$
|
|
27819
|
+
}, _marked7$3, null, [[1, 3]]);
|
|
27726
27820
|
}
|
|
27727
27821
|
function getRoles(action) {
|
|
27728
27822
|
var _action$payload, timeout, attempts, SceytChatClient, roles, _t1;
|
|
@@ -27800,7 +27894,7 @@ var _marked$5 = /*#__PURE__*/_regenerator().m(getContacts),
|
|
|
27800
27894
|
_marked4$4 = /*#__PURE__*/_regenerator().m(updateProfile),
|
|
27801
27895
|
_marked5$4 = /*#__PURE__*/_regenerator().m(getUsers),
|
|
27802
27896
|
_marked6$4 = /*#__PURE__*/_regenerator().m(loadMoreUsers),
|
|
27803
|
-
_marked7$
|
|
27897
|
+
_marked7$4 = /*#__PURE__*/_regenerator().m(MembersSaga$1);
|
|
27804
27898
|
function getContacts() {
|
|
27805
27899
|
var SceytChatClient, contactsData, _t;
|
|
27806
27900
|
return _regenerator().w(function (_context) {
|
|
@@ -28239,7 +28333,7 @@ function MembersSaga$1() {
|
|
|
28239
28333
|
case 6:
|
|
28240
28334
|
return _context7.a(2);
|
|
28241
28335
|
}
|
|
28242
|
-
}, _marked7$
|
|
28336
|
+
}, _marked7$4);
|
|
28243
28337
|
}
|
|
28244
28338
|
|
|
28245
28339
|
var _marked$6 = /*#__PURE__*/_regenerator().m(rootSaga);
|
|
@@ -40446,7 +40540,8 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
40446
40540
|
incomingMessageBackgroundX = _useColor[THEME_COLORS.INCOMING_MESSAGE_BACKGROUND_X],
|
|
40447
40541
|
outgoingMessageBackgroundX = _useColor[THEME_COLORS.OUTGOING_MESSAGE_BACKGROUND_X],
|
|
40448
40542
|
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
|
|
40449
|
-
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY]
|
|
40543
|
+
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
40544
|
+
background = _useColor[THEME_COLORS.BACKGROUND];
|
|
40450
40545
|
var attachment = React.useMemo(function () {
|
|
40451
40546
|
return attachments.find(function (attachment) {
|
|
40452
40547
|
return attachment.type === attachmentTypes.link;
|
|
@@ -40553,7 +40648,8 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
40553
40648
|
onLoad: onImageLoad,
|
|
40554
40649
|
onError: function onError() {
|
|
40555
40650
|
setImageLoadError(true);
|
|
40556
|
-
}
|
|
40651
|
+
},
|
|
40652
|
+
bgColor: background
|
|
40557
40653
|
})))
|
|
40558
40654
|
} : null, {
|
|
40559
40655
|
key: 'title',
|
|
@@ -40705,7 +40801,9 @@ var Url = styled__default.p(_templateObject6$j || (_templateObject6$j = _taggedT
|
|
|
40705
40801
|
var maxWidth = _ref15.maxWidth;
|
|
40706
40802
|
return maxWidth && "\n max-width: " + maxWidth + "px;\n ";
|
|
40707
40803
|
});
|
|
40708
|
-
var Img = styled__default.img(_templateObject7$i || (_templateObject7$i = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n border-radius: inherit;\n"])))
|
|
40804
|
+
var Img = styled__default.img(_templateObject7$i || (_templateObject7$i = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n border-radius: inherit;\n background: ", ";\n"])), function (props) {
|
|
40805
|
+
return props.bgColor;
|
|
40806
|
+
});
|
|
40709
40807
|
var OGRow = styled__default.div(_templateObject8$g || (_templateObject8$g = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n padding: 0;\n"])));
|
|
40710
40808
|
var OGTextWrapper = styled__default.div(_templateObject9$d || (_templateObject9$d = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n"])));
|
|
40711
40809
|
var FaviconContainer = styled__default.div(_templateObject0$c || (_templateObject0$c = _taggedTemplateLiteralLoose(["\n width: 52px;\n height: 52px;\n border-radius: 8px;\n overflow: hidden;\n margin: 8px;\n flex: 0 0 52px;\n"])));
|
|
@@ -43247,14 +43345,18 @@ var Message$1 = function Message(_ref) {
|
|
|
43247
43345
|
dispatch(markMessagesAsDeliveredAC(channel.id, [message.id]));
|
|
43248
43346
|
}
|
|
43249
43347
|
}
|
|
43250
|
-
|
|
43348
|
+
var alreadyRead = !!(message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
|
|
43251
43349
|
return marker.name === MESSAGE_DELIVERY_STATUS.READ;
|
|
43252
|
-
}))
|
|
43350
|
+
}));
|
|
43351
|
+
if (isVisible && message.incoming && !alreadyRead && !disableAutoReadTracking && isTabActive && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
43352
|
+
console.log("[READ_MESSAGE] queuing msgId=" + message.id + " ch=" + channel.id);
|
|
43253
43353
|
if (queueReadMarker) {
|
|
43254
43354
|
queueReadMarker(channel.id, message.id);
|
|
43255
43355
|
} else {
|
|
43256
43356
|
dispatch(markMessagesAsReadAC(channel.id, [message.id]));
|
|
43257
43357
|
}
|
|
43358
|
+
} else if (isVisible && message.incoming && !alreadyRead) {
|
|
43359
|
+
console.log("[READ_MESSAGE] skip msgId=" + message.id, "disabledTracking=" + disableAutoReadTracking + " tabActive=" + isTabActive, "newMsgCount=" + channel.newMessageCount + " conn=" + connectionStatus);
|
|
43258
43360
|
}
|
|
43259
43361
|
}, [dispatch, message.incoming, message.userMarkers, message.id, isVisible, channel.id, channel.newMessageCount, connectionStatus, queueReadMarker, queueDeliveredMarker, disableAutoReadTracking, isTabActive]);
|
|
43260
43362
|
var handleForwardMessage = React.useCallback(function (channelIds) {
|
|
@@ -44286,6 +44388,7 @@ function useChatController(_ref5) {
|
|
|
44286
44388
|
}, [clearJumpScrollingLock]);
|
|
44287
44389
|
var queueVisibleUnreadCheck = React.useCallback(function () {
|
|
44288
44390
|
if (pendingVisibleUnreadFrameRef.current !== null || unreadScrollTo || !tabIsActive) {
|
|
44391
|
+
console.log("[READ_MESSAGE] queueVisibleUnreadCheck blocked", "pendingRaf=" + (pendingVisibleUnreadFrameRef.current !== null) + " unreadScrollTo=" + unreadScrollTo + " tabActive=" + tabIsActive);
|
|
44289
44392
|
return;
|
|
44290
44393
|
}
|
|
44291
44394
|
pendingVisibleUnreadFrameRef.current = requestAnimationFrame(function () {
|
|
@@ -44296,6 +44399,7 @@ function useChatController(_ref5) {
|
|
|
44296
44399
|
}
|
|
44297
44400
|
var unreadStartIndex = getUnreadTrackingStartIndex(messages);
|
|
44298
44401
|
if (unreadStartIndex < 0) {
|
|
44402
|
+
console.log('[READ_MESSAGE] queueVisibleUnreadCheck: no unread start index, skip');
|
|
44299
44403
|
return;
|
|
44300
44404
|
}
|
|
44301
44405
|
var candidateUnreadMessages = messages.slice(unreadStartIndex);
|
|
@@ -44321,8 +44425,10 @@ function useChatController(_ref5) {
|
|
|
44321
44425
|
return message.id;
|
|
44322
44426
|
});
|
|
44323
44427
|
if (!ids.length || !channel.id || !channel.newMessageCount) {
|
|
44428
|
+
console.log("[READ_MESSAGE] queueVisibleUnreadCheck: nothing to mark ids=" + ids.length + " newMsgCount=" + channel.newMessageCount);
|
|
44324
44429
|
return;
|
|
44325
44430
|
}
|
|
44431
|
+
console.log("[READ_MESSAGE] queueVisibleUnreadCheck: marking ch=" + channel.id + " ids=[" + ids.join(',') + "]");
|
|
44326
44432
|
ids.forEach(function (id) {
|
|
44327
44433
|
visibleUnreadReportedRef.current.add(id);
|
|
44328
44434
|
});
|
|
@@ -44600,7 +44706,7 @@ function useChatController(_ref5) {
|
|
|
44600
44706
|
};
|
|
44601
44707
|
return Promise.resolve(beginWindowPagedRequest(function () {
|
|
44602
44708
|
if (connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
44603
|
-
dispatch(loadLatestMessagesAC(channelRef.current));
|
|
44709
|
+
dispatch(loadLatestMessagesAC(channelRef.current, undefined, undefined, true, true));
|
|
44604
44710
|
return;
|
|
44605
44711
|
}
|
|
44606
44712
|
dispatch(loadDefaultMessagesAC(channelRef.current));
|
|
@@ -45035,8 +45141,6 @@ function useChatController(_ref5) {
|
|
|
45035
45141
|
}
|
|
45036
45142
|
if (currentScrollTop <= historyEdgeScrollTop + PRELOAD_TRIGGER_PX) {
|
|
45037
45143
|
currentScrollTop = historyEdgeScrollTop;
|
|
45038
|
-
} else if (currentScrollTop >= latestEdgeScrollTop - PRELOAD_TRIGGER_PX) {
|
|
45039
|
-
currentScrollTop = latestEdgeScrollTop;
|
|
45040
45144
|
}
|
|
45041
45145
|
if (currentScrollTop !== container.scrollTop) {
|
|
45042
45146
|
setScrollTop(container, currentScrollTop, 'auto');
|
|
@@ -45980,7 +46084,9 @@ var createMessageMarkerBatcher = function createMessageMarkerBatcher(_ref) {
|
|
|
45980
46084
|
onFlushDelivered(channelId, Array.from(queue.deliveredIds));
|
|
45981
46085
|
}
|
|
45982
46086
|
if (queue.readIds.size > 0) {
|
|
45983
|
-
|
|
46087
|
+
var ids = Array.from(queue.readIds);
|
|
46088
|
+
console.log("[READ_MESSAGE] flush ch=" + channelId + " ids=[" + ids.join(',') + "]");
|
|
46089
|
+
onFlushRead(channelId, ids);
|
|
45984
46090
|
}
|
|
45985
46091
|
channelQueues["delete"](channelId);
|
|
45986
46092
|
};
|
|
@@ -45997,6 +46103,7 @@ var createMessageMarkerBatcher = function createMessageMarkerBatcher(_ref) {
|
|
|
45997
46103
|
}
|
|
45998
46104
|
var queue = getQueue(channelId);
|
|
45999
46105
|
queue.readIds.add(messageId);
|
|
46106
|
+
console.log("[READ_MESSAGE] enqueue msgId=" + messageId + " ch=" + channelId + " queueSize=" + queue.readIds.size);
|
|
46000
46107
|
scheduleFlush(channelId);
|
|
46001
46108
|
};
|
|
46002
46109
|
var enqueueDelivered = function enqueueDelivered(channelId, messageId) {
|
|
@@ -46233,6 +46340,7 @@ var MessageList = function MessageList(_ref) {
|
|
|
46233
46340
|
markerBatcherRef.current = createMessageMarkerBatcher({
|
|
46234
46341
|
debounceMs: DEFAULT_MARKER_BATCH_DEBOUNCE_MS,
|
|
46235
46342
|
onFlushRead: function onFlushRead(channelId, messageIds) {
|
|
46343
|
+
console.log("[READ_MESSAGE] dispatch markAsRead ch=" + channelId + " ids=[" + messageIds.join(',') + "]");
|
|
46236
46344
|
dispatch(markMessagesAsReadAC(channelId, messageIds));
|
|
46237
46345
|
},
|
|
46238
46346
|
onFlushDelivered: function onFlushDelivered(channelId, messageIds) {
|
|
@@ -46280,6 +46388,7 @@ var MessageList = function MessageList(_ref) {
|
|
|
46280
46388
|
}, [browserTabIsActive]);
|
|
46281
46389
|
var queueReadMarker = React.useCallback(function (channelId, messageId) {
|
|
46282
46390
|
var _markerBatcherRef$cur;
|
|
46391
|
+
console.log("[READ_MESSAGE] queueReadMarker ch=" + channelId + " msgId=" + messageId);
|
|
46283
46392
|
(_markerBatcherRef$cur = markerBatcherRef.current) === null || _markerBatcherRef$cur === void 0 ? void 0 : _markerBatcherRef$cur.enqueueRead(channelId, messageId);
|
|
46284
46393
|
}, []);
|
|
46285
46394
|
var queueDeliveredMarker = React.useCallback(function (channelId, messageId) {
|
|
@@ -46343,6 +46452,7 @@ var MessageList = function MessageList(_ref) {
|
|
|
46343
46452
|
}
|
|
46344
46453
|
if (channel.lastMessage.id && String(channel.lastMessage.user.id) !== currentUserId) {
|
|
46345
46454
|
var _markerBatcherRef$cur5;
|
|
46455
|
+
console.log("[READ_MESSAGE] scrollToBottom enqueue ch=" + channel.id + " msgId=" + channel.lastMessage.id);
|
|
46346
46456
|
(_markerBatcherRef$cur5 = markerBatcherRef.current) === null || _markerBatcherRef$cur5 === void 0 ? void 0 : _markerBatcherRef$cur5.enqueueRead(channel.id, channel.lastMessage.id);
|
|
46347
46457
|
}
|
|
46348
46458
|
jumpToLatest(true);
|
|
@@ -48530,28 +48640,24 @@ function useFormatMessage(editor, editorState, setMessageBodyAttributes, setMess
|
|
|
48530
48640
|
var member = activeChannelMembers.find(function (m) {
|
|
48531
48641
|
return m.id === segment.mentionUserId;
|
|
48532
48642
|
});
|
|
48533
|
-
|
|
48534
|
-
|
|
48535
|
-
|
|
48536
|
-
|
|
48537
|
-
|
|
48538
|
-
|
|
48539
|
-
|
|
48540
|
-
|
|
48541
|
-
|
|
48542
|
-
|
|
48543
|
-
var textNode = lexical.$createTextNode(segment.text);
|
|
48544
|
-
if (segment.format > 0) {
|
|
48545
|
-
textNode.setFormat(segment.format);
|
|
48546
|
-
}
|
|
48547
|
-
nodes.push(textNode);
|
|
48643
|
+
var mentionData = member ? _extends({}, member, {
|
|
48644
|
+
name: segment.text
|
|
48645
|
+
}) : {
|
|
48646
|
+
id: segment.mentionUserId,
|
|
48647
|
+
name: segment.text
|
|
48648
|
+
};
|
|
48649
|
+
setMentionedMember(mentionData);
|
|
48650
|
+
var mentionNode = $createMentionNode(mentionData);
|
|
48651
|
+
if (segment.format > 0) {
|
|
48652
|
+
mentionNode.setFormat(segment.format);
|
|
48548
48653
|
}
|
|
48654
|
+
nodes.push(mentionNode);
|
|
48549
48655
|
} else {
|
|
48550
|
-
var
|
|
48656
|
+
var textNode = lexical.$createTextNode(segment.text);
|
|
48551
48657
|
if (segment.format > 0) {
|
|
48552
|
-
|
|
48658
|
+
textNode.setFormat(segment.format);
|
|
48553
48659
|
}
|
|
48554
|
-
nodes.push(
|
|
48660
|
+
nodes.push(textNode);
|
|
48555
48661
|
}
|
|
48556
48662
|
});
|
|
48557
48663
|
if (nodes.length > 0) {
|