sceyt-chat-react-uikit 1.8.8-beta.3 → 1.8.8-beta.5
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 +527 -429
- package/index.modern.js +527 -429
- package/package.json +1 -1
- package/types/index.d.ts +7 -1
package/index.js
CHANGED
|
@@ -16167,6 +16167,9 @@ function sendMessage(action) {
|
|
|
16167
16167
|
}
|
|
16168
16168
|
_messageBuilder = channel.createMessageBuilder();
|
|
16169
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
|
+
}
|
|
16170
16173
|
if (message.parentMessage) {
|
|
16171
16174
|
_messageBuilder.setParentMessageId(message.parentMessage ? message.parentMessage.id : null);
|
|
16172
16175
|
}
|
|
@@ -16238,6 +16241,9 @@ function sendMessage(action) {
|
|
|
16238
16241
|
}
|
|
16239
16242
|
messageBuilder = channel.createMessageBuilder();
|
|
16240
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
|
+
}
|
|
16241
16247
|
if (message.parentMessage) {
|
|
16242
16248
|
messageBuilder.setParentMessageId(message.parentMessage ? message.parentMessage.id : null);
|
|
16243
16249
|
}
|
|
@@ -16534,6 +16540,9 @@ function sendTextMessage(action) {
|
|
|
16534
16540
|
}
|
|
16535
16541
|
messageBuilder = channel.createMessageBuilder();
|
|
16536
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
|
+
}
|
|
16537
16546
|
if (message.parentMessage) {
|
|
16538
16547
|
messageBuilder.setParentMessageId(message.parentMessage ? message.parentMessage.id : null);
|
|
16539
16548
|
}
|
|
@@ -22216,10 +22225,11 @@ function updateActiveChannelMembersRemove(removedMembers, channelId) {
|
|
|
22216
22225
|
|
|
22217
22226
|
var _marked$2 = /*#__PURE__*/_regenerator().m(handleChannelMessageEvent),
|
|
22218
22227
|
_marked2$2 = /*#__PURE__*/_regenerator().m(handleUnreadMessagesInfoEvent),
|
|
22219
|
-
_marked3$1 = /*#__PURE__*/_regenerator().m(
|
|
22220
|
-
_marked4$1 = /*#__PURE__*/_regenerator().m(
|
|
22221
|
-
_marked5$1 = /*#__PURE__*/_regenerator().m(
|
|
22222
|
-
_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);
|
|
22223
22233
|
var getStoredChannel$1 = function getStoredChannel(channelId) {
|
|
22224
22234
|
return getChannelFromMap(channelId) || getChannelFromAllChannels(channelId) || getChannelFromAllChannelsMap(channelId) || null;
|
|
22225
22235
|
};
|
|
@@ -22467,26 +22477,62 @@ function handleUnreadMessagesInfoEvent(args) {
|
|
|
22467
22477
|
}
|
|
22468
22478
|
}, _marked2$2);
|
|
22469
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
|
+
}
|
|
22470
22516
|
function handleMessageMarkersReceivedEvent(args, SceytChatClient) {
|
|
22471
22517
|
var _markerList$user;
|
|
22472
22518
|
var channelId, markerList, channel, isOwnMarker, activeChannelId, updateLastMessage, markersMap, markerUpdateParams, _iterator, _step, messageId, lastMessage;
|
|
22473
|
-
return _regenerator().w(function (
|
|
22474
|
-
while (1) switch (
|
|
22519
|
+
return _regenerator().w(function (_context4) {
|
|
22520
|
+
while (1) switch (_context4.n) {
|
|
22475
22521
|
case 0:
|
|
22476
22522
|
channelId = args.channelId, markerList = args.markerList;
|
|
22477
22523
|
channel = getStoredChannel$1(channelId);
|
|
22478
22524
|
log.info('channel MESSAGE_MARKERS_RECEIVED ... channel: ', channel, 'markers list: ', markerList);
|
|
22479
22525
|
if (channel) {
|
|
22480
|
-
|
|
22526
|
+
_context4.n = 1;
|
|
22481
22527
|
break;
|
|
22482
22528
|
}
|
|
22483
|
-
return
|
|
22529
|
+
return _context4.a(2);
|
|
22484
22530
|
case 1:
|
|
22485
22531
|
isOwnMarker = ((_markerList$user = markerList.user) === null || _markerList$user === void 0 ? void 0 : _markerList$user.id) === SceytChatClient.user.id;
|
|
22486
|
-
|
|
22532
|
+
_context4.n = 2;
|
|
22487
22533
|
return effects.call(getActiveChannelId);
|
|
22488
22534
|
case 2:
|
|
22489
|
-
activeChannelId =
|
|
22535
|
+
activeChannelId = _context4.v;
|
|
22490
22536
|
updateLastMessage = false;
|
|
22491
22537
|
markersMap = {};
|
|
22492
22538
|
markerUpdateParams = {
|
|
@@ -22501,19 +22547,19 @@ function handleMessageMarkersReceivedEvent(args, SceytChatClient) {
|
|
|
22501
22547
|
}
|
|
22502
22548
|
}
|
|
22503
22549
|
if (!updateLastMessage) {
|
|
22504
|
-
|
|
22550
|
+
_context4.n = 3;
|
|
22505
22551
|
break;
|
|
22506
22552
|
}
|
|
22507
22553
|
lastMessage = _extends({}, channel.lastMessage, updateMessageDeliveryStatusAndMarkers(channel.lastMessage, markerUpdateParams, isOwnMarker));
|
|
22508
22554
|
updateChannelLastMessageOnAllChannels(channel.id, lastMessage);
|
|
22509
|
-
|
|
22555
|
+
_context4.n = 3;
|
|
22510
22556
|
return effects.put(updateChannelLastMessageStatusAC(lastMessage, channel));
|
|
22511
22557
|
case 3:
|
|
22512
22558
|
if (!(activeChannelId === channelId)) {
|
|
22513
|
-
|
|
22559
|
+
_context4.n = 4;
|
|
22514
22560
|
break;
|
|
22515
22561
|
}
|
|
22516
|
-
|
|
22562
|
+
_context4.n = 4;
|
|
22517
22563
|
return effects.put(updateMessagesStatusAC(markerList.name, markersMap, isOwnMarker, markerList));
|
|
22518
22564
|
case 4:
|
|
22519
22565
|
updateMessageStatusOnMap(channel.id, {
|
|
@@ -22522,32 +22568,32 @@ function handleMessageMarkersReceivedEvent(args, SceytChatClient) {
|
|
|
22522
22568
|
marker: markerList
|
|
22523
22569
|
}, isOwnMarker);
|
|
22524
22570
|
if (isOwnMarker) {
|
|
22525
|
-
|
|
22571
|
+
_context4.n = 5;
|
|
22526
22572
|
break;
|
|
22527
22573
|
}
|
|
22528
|
-
|
|
22574
|
+
_context4.n = 5;
|
|
22529
22575
|
return effects.put(updateMessagesMarkersAC(channelId, markerList.name, markerList));
|
|
22530
22576
|
case 5:
|
|
22531
|
-
return
|
|
22577
|
+
return _context4.a(2);
|
|
22532
22578
|
}
|
|
22533
|
-
},
|
|
22579
|
+
}, _marked4$1);
|
|
22534
22580
|
}
|
|
22535
22581
|
function handleDeleteMessageEvent(args) {
|
|
22536
22582
|
var channel, deletedMessage, activeChannelId, channelExists;
|
|
22537
|
-
return _regenerator().w(function (
|
|
22538
|
-
while (1) switch (
|
|
22583
|
+
return _regenerator().w(function (_context5) {
|
|
22584
|
+
while (1) switch (_context5.n) {
|
|
22539
22585
|
case 0:
|
|
22540
22586
|
channel = args.channel, deletedMessage = args.deletedMessage;
|
|
22541
|
-
|
|
22587
|
+
_context5.n = 1;
|
|
22542
22588
|
return effects.call(getActiveChannelId);
|
|
22543
22589
|
case 1:
|
|
22544
|
-
activeChannelId =
|
|
22590
|
+
activeChannelId = _context5.v;
|
|
22545
22591
|
channelExists = checkChannelExists(channel.id);
|
|
22546
22592
|
if (!(channel.id === activeChannelId)) {
|
|
22547
|
-
|
|
22593
|
+
_context5.n = 2;
|
|
22548
22594
|
break;
|
|
22549
22595
|
}
|
|
22550
|
-
|
|
22596
|
+
_context5.n = 2;
|
|
22551
22597
|
return effects.put(updateMessageAC(deletedMessage.id, deletedMessage));
|
|
22552
22598
|
case 2:
|
|
22553
22599
|
updateMessageOnMap(channel.id, {
|
|
@@ -22555,10 +22601,10 @@ function handleDeleteMessageEvent(args) {
|
|
|
22555
22601
|
params: deletedMessage
|
|
22556
22602
|
});
|
|
22557
22603
|
if (!channelExists) {
|
|
22558
|
-
|
|
22604
|
+
_context5.n = 4;
|
|
22559
22605
|
break;
|
|
22560
22606
|
}
|
|
22561
|
-
|
|
22607
|
+
_context5.n = 3;
|
|
22562
22608
|
return effects.put(updateChannelDataAC(channel.id, {
|
|
22563
22609
|
newMessageCount: channel.newMessageCount,
|
|
22564
22610
|
muted: channel.muted,
|
|
@@ -22566,10 +22612,10 @@ function handleDeleteMessageEvent(args) {
|
|
|
22566
22612
|
}));
|
|
22567
22613
|
case 3:
|
|
22568
22614
|
if (!(channel.lastMessage.id === deletedMessage.id)) {
|
|
22569
|
-
|
|
22615
|
+
_context5.n = 4;
|
|
22570
22616
|
break;
|
|
22571
22617
|
}
|
|
22572
|
-
|
|
22618
|
+
_context5.n = 4;
|
|
22573
22619
|
return effects.put(updateChannelLastMessageAC(deletedMessage, channel));
|
|
22574
22620
|
case 4:
|
|
22575
22621
|
updateChannelOnAllChannels(channel.id, {
|
|
@@ -22577,29 +22623,29 @@ function handleDeleteMessageEvent(args) {
|
|
|
22577
22623
|
muted: channel.muted,
|
|
22578
22624
|
mutedTill: channel.mutedTill
|
|
22579
22625
|
}, deletedMessage);
|
|
22580
|
-
|
|
22626
|
+
_context5.n = 5;
|
|
22581
22627
|
return effects.put(removePendingMessageMutationAC(deletedMessage.id));
|
|
22582
22628
|
case 5:
|
|
22583
|
-
return
|
|
22629
|
+
return _context5.a(2);
|
|
22584
22630
|
}
|
|
22585
|
-
},
|
|
22631
|
+
}, _marked5$1);
|
|
22586
22632
|
}
|
|
22587
22633
|
function handleEditMessageEvent(args) {
|
|
22588
22634
|
var channel, message, activeChannelId, channelExists;
|
|
22589
|
-
return _regenerator().w(function (
|
|
22590
|
-
while (1) switch (
|
|
22635
|
+
return _regenerator().w(function (_context6) {
|
|
22636
|
+
while (1) switch (_context6.n) {
|
|
22591
22637
|
case 0:
|
|
22592
22638
|
channel = args.channel, message = args.message;
|
|
22593
|
-
|
|
22639
|
+
_context6.n = 1;
|
|
22594
22640
|
return effects.call(getActiveChannelId);
|
|
22595
22641
|
case 1:
|
|
22596
|
-
activeChannelId =
|
|
22642
|
+
activeChannelId = _context6.v;
|
|
22597
22643
|
channelExists = checkChannelExists(channel.id);
|
|
22598
22644
|
if (!(channel.id === activeChannelId)) {
|
|
22599
|
-
|
|
22645
|
+
_context6.n = 2;
|
|
22600
22646
|
break;
|
|
22601
22647
|
}
|
|
22602
|
-
|
|
22648
|
+
_context6.n = 2;
|
|
22603
22649
|
return effects.put(updateMessageAC(message.id, {
|
|
22604
22650
|
body: message.body,
|
|
22605
22651
|
state: message.state,
|
|
@@ -22610,14 +22656,14 @@ function handleEditMessageEvent(args) {
|
|
|
22610
22656
|
}));
|
|
22611
22657
|
case 2:
|
|
22612
22658
|
if (!channelExists) {
|
|
22613
|
-
|
|
22659
|
+
_context6.n = 3;
|
|
22614
22660
|
break;
|
|
22615
22661
|
}
|
|
22616
22662
|
if (!(channel.lastMessage.id === message.id)) {
|
|
22617
|
-
|
|
22663
|
+
_context6.n = 3;
|
|
22618
22664
|
break;
|
|
22619
22665
|
}
|
|
22620
|
-
|
|
22666
|
+
_context6.n = 3;
|
|
22621
22667
|
return effects.put(updateChannelLastMessageAC(message, channel));
|
|
22622
22668
|
case 3:
|
|
22623
22669
|
if (checkChannelExistsOnMessagesMap(channel.id)) {
|
|
@@ -22627,17 +22673,17 @@ function handleEditMessageEvent(args) {
|
|
|
22627
22673
|
});
|
|
22628
22674
|
}
|
|
22629
22675
|
updateChannelOnAllChannels(channel.id, {}, message);
|
|
22630
|
-
|
|
22676
|
+
_context6.n = 4;
|
|
22631
22677
|
return effects.put(removePendingMessageMutationAC(message.id));
|
|
22632
22678
|
case 4:
|
|
22633
|
-
return
|
|
22679
|
+
return _context6.a(2);
|
|
22634
22680
|
}
|
|
22635
|
-
},
|
|
22681
|
+
}, _marked6$1);
|
|
22636
22682
|
}
|
|
22637
22683
|
function watchForEvents() {
|
|
22638
22684
|
var SceytChatClient, channelListener, connectionListener, usersTimeout, chan, _loop;
|
|
22639
|
-
return _regenerator().w(function (
|
|
22640
|
-
while (1) switch (
|
|
22685
|
+
return _regenerator().w(function (_context0) {
|
|
22686
|
+
while (1) switch (_context0.n) {
|
|
22641
22687
|
case 0:
|
|
22642
22688
|
SceytChatClient = getClient();
|
|
22643
22689
|
channelListener = new SceytChatClient.ChannelListener();
|
|
@@ -23037,45 +23083,45 @@ function watchForEvents() {
|
|
|
23037
23083
|
};
|
|
23038
23084
|
});
|
|
23039
23085
|
_loop = /*#__PURE__*/_regenerator().m(function _callee3() {
|
|
23040
|
-
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,
|
|
23041
|
-
return _regenerator().w(function (
|
|
23042
|
-
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) {
|
|
23043
23089
|
case 0:
|
|
23044
|
-
|
|
23045
|
-
|
|
23090
|
+
_context9.p = 0;
|
|
23091
|
+
_context9.n = 1;
|
|
23046
23092
|
return effects.take(chan);
|
|
23047
23093
|
case 1:
|
|
23048
|
-
_yield$take =
|
|
23094
|
+
_yield$take = _context9.v;
|
|
23049
23095
|
type = _yield$take.type;
|
|
23050
23096
|
args = _yield$take.args;
|
|
23051
23097
|
_t = type;
|
|
23052
|
-
|
|
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;
|
|
23053
23099
|
break;
|
|
23054
23100
|
case 2:
|
|
23055
23101
|
createdChannel = args.createdChannel;
|
|
23056
23102
|
log.info('CHANNEL_EVENT_CREATE ... ', createdChannel);
|
|
23057
23103
|
channelFilterTypes = getChannelTypesFilter();
|
|
23058
23104
|
if (!(channelFilterTypes !== null && channelFilterTypes !== void 0 && channelFilterTypes.length ? channelFilterTypes.includes(createdChannel.type) : true)) {
|
|
23059
|
-
|
|
23105
|
+
_context9.n = 6;
|
|
23060
23106
|
break;
|
|
23061
23107
|
}
|
|
23062
23108
|
getFromContacts = getShowOnlyContactUsers();
|
|
23063
23109
|
channelExists = checkChannelExists(createdChannel.id);
|
|
23064
23110
|
if (channelExists) {
|
|
23065
|
-
|
|
23111
|
+
_context9.n = 5;
|
|
23066
23112
|
break;
|
|
23067
23113
|
}
|
|
23068
23114
|
if (!getFromContacts) {
|
|
23069
|
-
|
|
23115
|
+
_context9.n = 3;
|
|
23070
23116
|
break;
|
|
23071
23117
|
}
|
|
23072
|
-
|
|
23118
|
+
_context9.n = 3;
|
|
23073
23119
|
return effects.put(getContactsAC());
|
|
23074
23120
|
case 3:
|
|
23075
|
-
|
|
23121
|
+
_context9.n = 4;
|
|
23076
23122
|
return effects.call(setChannelInMap, createdChannel);
|
|
23077
23123
|
case 4:
|
|
23078
|
-
|
|
23124
|
+
_context9.n = 5;
|
|
23079
23125
|
return effects.put(setChannelToAddAC(JSON.parse(JSON.stringify(createdChannel))));
|
|
23080
23126
|
case 5:
|
|
23081
23127
|
_chan = getChannelFromAllChannels(createdChannel.id);
|
|
@@ -23083,7 +23129,7 @@ function watchForEvents() {
|
|
|
23083
23129
|
addChannelToAllChannels(createdChannel);
|
|
23084
23130
|
}
|
|
23085
23131
|
case 6:
|
|
23086
|
-
return
|
|
23132
|
+
return _context9.a(3, 174);
|
|
23087
23133
|
case 7:
|
|
23088
23134
|
channel = args.channel, joinedMember = args.joinedMember;
|
|
23089
23135
|
log.info('channel JOIN ... . ', channel);
|
|
@@ -23093,114 +23139,114 @@ function watchForEvents() {
|
|
|
23093
23139
|
_chan2 = getChannelFromAllChannels(channel.id);
|
|
23094
23140
|
}
|
|
23095
23141
|
if (!_chan2) {
|
|
23096
|
-
|
|
23142
|
+
_context9.n = 16;
|
|
23097
23143
|
break;
|
|
23098
23144
|
}
|
|
23099
23145
|
customLoadMembersFunctions = getCustomLoadMembersFunctions();
|
|
23100
23146
|
joinMembersEvent = customLoadMembersFunctions === null || customLoadMembersFunctions === void 0 ? void 0 : customLoadMembersFunctions.joinMembersEvent;
|
|
23101
23147
|
membersList = [];
|
|
23102
23148
|
if (!joinMembersEvent) {
|
|
23103
|
-
|
|
23149
|
+
_context9.n = 10;
|
|
23104
23150
|
break;
|
|
23105
23151
|
}
|
|
23106
|
-
|
|
23152
|
+
_context9.n = 8;
|
|
23107
23153
|
return effects.call(joinMembersEvent, _chan2.id, [joinedMember], store.getState().MembersReducer.channelsMembersMap[_chan2.id] || []);
|
|
23108
23154
|
case 8:
|
|
23109
|
-
membersList =
|
|
23110
|
-
|
|
23155
|
+
membersList = _context9.v;
|
|
23156
|
+
_context9.n = 9;
|
|
23111
23157
|
return effects.put(setMembersToListAC(membersList, _chan2.id));
|
|
23112
23158
|
case 9:
|
|
23113
|
-
|
|
23159
|
+
_context9.n = 11;
|
|
23114
23160
|
break;
|
|
23115
23161
|
case 10:
|
|
23116
|
-
|
|
23162
|
+
_context9.n = 11;
|
|
23117
23163
|
return effects.put(addMembersToListAC([joinedMember], _chan2.id));
|
|
23118
23164
|
case 11:
|
|
23119
23165
|
updateChannelOnAllChannels(_chan2.id, {
|
|
23120
23166
|
memberCount: _chan2.memberCount + 1
|
|
23121
23167
|
});
|
|
23122
23168
|
if (!joinMembersEvent) {
|
|
23123
|
-
|
|
23169
|
+
_context9.n = 12;
|
|
23124
23170
|
break;
|
|
23125
23171
|
}
|
|
23126
23172
|
_t2 = {
|
|
23127
23173
|
members: membersList
|
|
23128
23174
|
};
|
|
23129
|
-
|
|
23175
|
+
_context9.n = 14;
|
|
23130
23176
|
break;
|
|
23131
23177
|
case 12:
|
|
23132
|
-
|
|
23178
|
+
_context9.n = 13;
|
|
23133
23179
|
return effects.call(updateActiveChannelMembersAdd, [joinedMember], _chan2.id) || {};
|
|
23134
23180
|
case 13:
|
|
23135
|
-
_t2 =
|
|
23181
|
+
_t2 = _context9.v;
|
|
23136
23182
|
case 14:
|
|
23137
23183
|
updateChannelData = _t2;
|
|
23138
|
-
|
|
23184
|
+
_context9.n = 15;
|
|
23139
23185
|
return effects.put(updateChannelDataAC(_chan2.id, _extends({
|
|
23140
23186
|
memberCount: _chan2.memberCount + 1
|
|
23141
23187
|
}, updateChannelData)));
|
|
23142
23188
|
case 15:
|
|
23143
|
-
|
|
23189
|
+
_context9.n = 16;
|
|
23144
23190
|
return effects.put(updateSearchedChannelDataAC(_chan2.id, {
|
|
23145
23191
|
memberCount: _chan2.memberCount + 1
|
|
23146
23192
|
}, getChannelGroupName(_chan2)));
|
|
23147
23193
|
case 16:
|
|
23148
|
-
return
|
|
23194
|
+
return _context9.a(3, 174);
|
|
23149
23195
|
case 17:
|
|
23150
23196
|
_channel = args.channel, member = args.member;
|
|
23151
23197
|
log.info('channel LEAVE ... ', _channel, member);
|
|
23152
23198
|
_channelExists = checkChannelExists(_channel.id);
|
|
23153
|
-
|
|
23199
|
+
_context9.n = 18;
|
|
23154
23200
|
return effects.call(getActiveChannelId);
|
|
23155
23201
|
case 18:
|
|
23156
|
-
activeChannelId =
|
|
23202
|
+
activeChannelId = _context9.v;
|
|
23157
23203
|
if (!(member.id === SceytChatClient.user.id)) {
|
|
23158
|
-
|
|
23204
|
+
_context9.n = 23;
|
|
23159
23205
|
break;
|
|
23160
23206
|
}
|
|
23161
|
-
|
|
23207
|
+
_context9.n = 19;
|
|
23162
23208
|
return effects.put(switchChannelActionAC(null));
|
|
23163
23209
|
case 19:
|
|
23164
|
-
|
|
23210
|
+
_context9.n = 20;
|
|
23165
23211
|
return effects.put(removeChannelAC(_channel.id));
|
|
23166
23212
|
case 20:
|
|
23167
23213
|
removeChannelFromMap(_channel.id);
|
|
23168
23214
|
deleteChannelFromAllChannels(_channel.id);
|
|
23169
|
-
|
|
23215
|
+
_context9.n = 21;
|
|
23170
23216
|
return effects.put(setChannelToRemoveAC(_channel));
|
|
23171
23217
|
case 21:
|
|
23172
|
-
|
|
23218
|
+
_context9.n = 22;
|
|
23173
23219
|
return effects.put(removeChannelCachesAC(_channel.id));
|
|
23174
23220
|
case 22:
|
|
23175
|
-
|
|
23221
|
+
_context9.n = 29;
|
|
23176
23222
|
break;
|
|
23177
23223
|
case 23:
|
|
23178
23224
|
groupName = getChannelGroupName(_channel);
|
|
23179
23225
|
if (!_channelExists) {
|
|
23180
|
-
|
|
23226
|
+
_context9.n = 27;
|
|
23181
23227
|
break;
|
|
23182
23228
|
}
|
|
23183
23229
|
_updateChannelData = {};
|
|
23184
23230
|
if (!(activeChannelId === _channel.id)) {
|
|
23185
|
-
|
|
23231
|
+
_context9.n = 26;
|
|
23186
23232
|
break;
|
|
23187
23233
|
}
|
|
23188
|
-
|
|
23234
|
+
_context9.n = 24;
|
|
23189
23235
|
return effects.put(removeMemberFromListAC([member], _channel.id));
|
|
23190
23236
|
case 24:
|
|
23191
|
-
|
|
23237
|
+
_context9.n = 25;
|
|
23192
23238
|
return effects.call(updateActiveChannelMembersRemove, [member], _channel.id) || {};
|
|
23193
23239
|
case 25:
|
|
23194
|
-
_updateChannelData =
|
|
23240
|
+
_updateChannelData = _context9.v;
|
|
23195
23241
|
case 26:
|
|
23196
|
-
|
|
23242
|
+
_context9.n = 27;
|
|
23197
23243
|
return effects.put(updateChannelDataAC(_channel.id, _extends({
|
|
23198
23244
|
memberCount: _channel.memberCount,
|
|
23199
23245
|
muted: _channel.muted,
|
|
23200
23246
|
mutedTill: _channel.mutedTill
|
|
23201
23247
|
}, _updateChannelData)));
|
|
23202
23248
|
case 27:
|
|
23203
|
-
|
|
23249
|
+
_context9.n = 28;
|
|
23204
23250
|
return effects.put(updateSearchedChannelDataAC(_channel.id, {
|
|
23205
23251
|
memberCount: _channel.memberCount,
|
|
23206
23252
|
muted: _channel.muted,
|
|
@@ -23213,7 +23259,7 @@ function watchForEvents() {
|
|
|
23213
23259
|
mutedTill: _channel.mutedTill
|
|
23214
23260
|
});
|
|
23215
23261
|
case 29:
|
|
23216
|
-
return
|
|
23262
|
+
return _context9.a(3, 174);
|
|
23217
23263
|
case 30:
|
|
23218
23264
|
log.info('user BLOCK ... ');
|
|
23219
23265
|
users = args.users;
|
|
@@ -23226,8 +23272,8 @@ function watchForEvents() {
|
|
|
23226
23272
|
allChannels = store.getState().ChannelReducer.channels;
|
|
23227
23273
|
_loop2 = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
23228
23274
|
var user, directChannel, _directChannel$member, updatedMembers;
|
|
23229
|
-
return _regenerator().w(function (
|
|
23230
|
-
while (1) switch (
|
|
23275
|
+
return _regenerator().w(function (_context7) {
|
|
23276
|
+
while (1) switch (_context7.n) {
|
|
23231
23277
|
case 0:
|
|
23232
23278
|
user = _step2.value;
|
|
23233
23279
|
directChannel = allChannels.find(function (ch) {
|
|
@@ -23237,7 +23283,7 @@ function watchForEvents() {
|
|
|
23237
23283
|
}));
|
|
23238
23284
|
});
|
|
23239
23285
|
if (!directChannel) {
|
|
23240
|
-
|
|
23286
|
+
_context7.n = 1;
|
|
23241
23287
|
break;
|
|
23242
23288
|
}
|
|
23243
23289
|
updatedMembers = (_directChannel$member = directChannel.members) === null || _directChannel$member === void 0 ? void 0 : _directChannel$member.map(function (m) {
|
|
@@ -23245,27 +23291,27 @@ function watchForEvents() {
|
|
|
23245
23291
|
blocked: true
|
|
23246
23292
|
}) : m;
|
|
23247
23293
|
});
|
|
23248
|
-
|
|
23294
|
+
_context7.n = 1;
|
|
23249
23295
|
return effects.put(updateChannelDataAC(directChannel.id, {
|
|
23250
23296
|
members: updatedMembers
|
|
23251
23297
|
}));
|
|
23252
23298
|
case 1:
|
|
23253
|
-
return
|
|
23299
|
+
return _context7.a(2);
|
|
23254
23300
|
}
|
|
23255
23301
|
}, _callee);
|
|
23256
23302
|
});
|
|
23257
23303
|
_iterator2 = _createForOfIteratorHelperLoose(blockedUsers);
|
|
23258
23304
|
case 31:
|
|
23259
23305
|
if ((_step2 = _iterator2()).done) {
|
|
23260
|
-
|
|
23306
|
+
_context9.n = 33;
|
|
23261
23307
|
break;
|
|
23262
23308
|
}
|
|
23263
|
-
return
|
|
23309
|
+
return _context9.d(_regeneratorValues(_loop2()), 32);
|
|
23264
23310
|
case 32:
|
|
23265
|
-
|
|
23311
|
+
_context9.n = 31;
|
|
23266
23312
|
break;
|
|
23267
23313
|
case 33:
|
|
23268
|
-
return
|
|
23314
|
+
return _context9.a(3, 174);
|
|
23269
23315
|
case 34:
|
|
23270
23316
|
log.info('user UNBLOCK ... ');
|
|
23271
23317
|
_users = args.users;
|
|
@@ -23278,8 +23324,8 @@ function watchForEvents() {
|
|
|
23278
23324
|
_allChannels = store.getState().ChannelReducer.channels;
|
|
23279
23325
|
_loop3 = /*#__PURE__*/_regenerator().m(function _callee2() {
|
|
23280
23326
|
var user, directChannel, _directChannel$member2, updatedMembers;
|
|
23281
|
-
return _regenerator().w(function (
|
|
23282
|
-
while (1) switch (
|
|
23327
|
+
return _regenerator().w(function (_context8) {
|
|
23328
|
+
while (1) switch (_context8.n) {
|
|
23283
23329
|
case 0:
|
|
23284
23330
|
user = _step3.value;
|
|
23285
23331
|
directChannel = _allChannels.find(function (ch) {
|
|
@@ -23289,7 +23335,7 @@ function watchForEvents() {
|
|
|
23289
23335
|
}));
|
|
23290
23336
|
});
|
|
23291
23337
|
if (!directChannel) {
|
|
23292
|
-
|
|
23338
|
+
_context8.n = 1;
|
|
23293
23339
|
break;
|
|
23294
23340
|
}
|
|
23295
23341
|
updatedMembers = (_directChannel$member2 = directChannel.members) === null || _directChannel$member2 === void 0 ? void 0 : _directChannel$member2.map(function (m) {
|
|
@@ -23297,85 +23343,85 @@ function watchForEvents() {
|
|
|
23297
23343
|
blocked: false
|
|
23298
23344
|
}) : m;
|
|
23299
23345
|
});
|
|
23300
|
-
|
|
23346
|
+
_context8.n = 1;
|
|
23301
23347
|
return effects.put(updateChannelDataAC(directChannel.id, {
|
|
23302
23348
|
members: updatedMembers
|
|
23303
23349
|
}));
|
|
23304
23350
|
case 1:
|
|
23305
|
-
return
|
|
23351
|
+
return _context8.a(2);
|
|
23306
23352
|
}
|
|
23307
23353
|
}, _callee2);
|
|
23308
23354
|
});
|
|
23309
23355
|
_iterator3 = _createForOfIteratorHelperLoose(unblockedUsers);
|
|
23310
23356
|
case 35:
|
|
23311
23357
|
if ((_step3 = _iterator3()).done) {
|
|
23312
|
-
|
|
23358
|
+
_context9.n = 37;
|
|
23313
23359
|
break;
|
|
23314
23360
|
}
|
|
23315
|
-
return
|
|
23361
|
+
return _context9.d(_regeneratorValues(_loop3()), 36);
|
|
23316
23362
|
case 36:
|
|
23317
|
-
|
|
23363
|
+
_context9.n = 35;
|
|
23318
23364
|
break;
|
|
23319
23365
|
case 37:
|
|
23320
|
-
return
|
|
23366
|
+
return _context9.a(3, 174);
|
|
23321
23367
|
case 38:
|
|
23322
23368
|
_channel2 = args.channel, removedMembers = args.removedMembers;
|
|
23323
23369
|
log.info('channel KICK_MEMBERS ... ', removedMembers);
|
|
23324
|
-
|
|
23370
|
+
_context9.n = 39;
|
|
23325
23371
|
return effects.call(getActiveChannelId);
|
|
23326
23372
|
case 39:
|
|
23327
|
-
_activeChannelId =
|
|
23373
|
+
_activeChannelId = _context9.v;
|
|
23328
23374
|
_channelExists2 = checkChannelExists(_channel2.id);
|
|
23329
23375
|
if (!_channelExists2) {
|
|
23330
|
-
|
|
23376
|
+
_context9.n = 48;
|
|
23331
23377
|
break;
|
|
23332
23378
|
}
|
|
23333
23379
|
if (!removedMembers.find(function (mem) {
|
|
23334
23380
|
return mem.id === SceytChatClient.user.id;
|
|
23335
23381
|
})) {
|
|
23336
|
-
|
|
23382
|
+
_context9.n = 43;
|
|
23337
23383
|
break;
|
|
23338
23384
|
}
|
|
23339
23385
|
removeChannelFromMap(_channel2.id);
|
|
23340
|
-
|
|
23386
|
+
_context9.n = 40;
|
|
23341
23387
|
return effects.put(removeChannelAC(_channel2.id));
|
|
23342
23388
|
case 40:
|
|
23343
|
-
|
|
23389
|
+
_context9.n = 41;
|
|
23344
23390
|
return effects.call(getLastChannelFromMap);
|
|
23345
23391
|
case 41:
|
|
23346
|
-
activeChannel =
|
|
23392
|
+
activeChannel = _context9.v;
|
|
23347
23393
|
if (!activeChannel) {
|
|
23348
|
-
|
|
23394
|
+
_context9.n = 42;
|
|
23349
23395
|
break;
|
|
23350
23396
|
}
|
|
23351
|
-
|
|
23397
|
+
_context9.n = 42;
|
|
23352
23398
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
23353
23399
|
case 42:
|
|
23354
|
-
|
|
23400
|
+
_context9.n = 48;
|
|
23355
23401
|
break;
|
|
23356
23402
|
case 43:
|
|
23357
23403
|
_updateChannelData2 = {};
|
|
23358
23404
|
if (!(_activeChannelId === _channel2.id)) {
|
|
23359
|
-
|
|
23405
|
+
_context9.n = 46;
|
|
23360
23406
|
break;
|
|
23361
23407
|
}
|
|
23362
|
-
|
|
23408
|
+
_context9.n = 44;
|
|
23363
23409
|
return effects.put(removeMemberFromListAC(removedMembers, _channel2.id));
|
|
23364
23410
|
case 44:
|
|
23365
|
-
|
|
23411
|
+
_context9.n = 45;
|
|
23366
23412
|
return effects.call(updateActiveChannelMembersRemove, removedMembers, _channel2.id) || {};
|
|
23367
23413
|
case 45:
|
|
23368
|
-
_updateChannelData2 =
|
|
23414
|
+
_updateChannelData2 = _context9.v;
|
|
23369
23415
|
case 46:
|
|
23370
23416
|
_groupName = getChannelGroupName(_channel2);
|
|
23371
|
-
|
|
23417
|
+
_context9.n = 47;
|
|
23372
23418
|
return effects.put(updateSearchedChannelDataAC(_channel2.id, {
|
|
23373
23419
|
memberCount: _channel2.memberCount,
|
|
23374
23420
|
muted: _channel2.muted,
|
|
23375
23421
|
mutedTill: _channel2.mutedTill
|
|
23376
23422
|
}, _groupName));
|
|
23377
23423
|
case 47:
|
|
23378
|
-
|
|
23424
|
+
_context9.n = 48;
|
|
23379
23425
|
return effects.put(updateChannelDataAC(_channel2.id, _extends({
|
|
23380
23426
|
memberCount: _channel2.memberCount,
|
|
23381
23427
|
muted: _channel2.muted,
|
|
@@ -23387,79 +23433,79 @@ function watchForEvents() {
|
|
|
23387
23433
|
muted: _channel2.muted,
|
|
23388
23434
|
mutedTill: _channel2.mutedTill
|
|
23389
23435
|
});
|
|
23390
|
-
return
|
|
23436
|
+
return _context9.a(3, 174);
|
|
23391
23437
|
case 49:
|
|
23392
23438
|
_channel3 = args.channel, addedMembers = args.addedMembers;
|
|
23393
23439
|
log.info('channel ADD_MEMBERS ... ', addedMembers);
|
|
23394
|
-
|
|
23440
|
+
_context9.n = 50;
|
|
23395
23441
|
return effects.call(getActiveChannelId);
|
|
23396
23442
|
case 50:
|
|
23397
|
-
_activeChannelId2 =
|
|
23443
|
+
_activeChannelId2 = _context9.v;
|
|
23398
23444
|
_channelExists3 = checkChannelExists(_channel3.id);
|
|
23399
23445
|
if (!_channelExists3) {
|
|
23400
|
-
|
|
23446
|
+
_context9.n = 60;
|
|
23401
23447
|
break;
|
|
23402
23448
|
}
|
|
23403
23449
|
_updateChannelData3 = {};
|
|
23404
23450
|
if (!(_activeChannelId2 === _channel3.id)) {
|
|
23405
|
-
|
|
23451
|
+
_context9.n = 58;
|
|
23406
23452
|
break;
|
|
23407
23453
|
}
|
|
23408
23454
|
_customLoadMembersFunctions = getCustomLoadMembersFunctions();
|
|
23409
23455
|
addMembersEvent = _customLoadMembersFunctions === null || _customLoadMembersFunctions === void 0 ? void 0 : _customLoadMembersFunctions.addMembersEvent;
|
|
23410
23456
|
_membersList = [];
|
|
23411
23457
|
if (!addMembersEvent) {
|
|
23412
|
-
|
|
23458
|
+
_context9.n = 53;
|
|
23413
23459
|
break;
|
|
23414
23460
|
}
|
|
23415
|
-
|
|
23461
|
+
_context9.n = 51;
|
|
23416
23462
|
return effects.call(addMembersEvent, _channel3.id, addedMembers, store.getState().MembersReducer.channelsMembersMap[_channel3.id] || []);
|
|
23417
23463
|
case 51:
|
|
23418
|
-
_membersList =
|
|
23419
|
-
|
|
23464
|
+
_membersList = _context9.v;
|
|
23465
|
+
_context9.n = 52;
|
|
23420
23466
|
return effects.put(setMembersToListAC(_membersList, _channel3.id));
|
|
23421
23467
|
case 52:
|
|
23422
|
-
|
|
23468
|
+
_context9.n = 54;
|
|
23423
23469
|
break;
|
|
23424
23470
|
case 53:
|
|
23425
|
-
|
|
23471
|
+
_context9.n = 54;
|
|
23426
23472
|
return effects.put(addMembersToListAC(addedMembers, _channel3.id));
|
|
23427
23473
|
case 54:
|
|
23428
23474
|
if (!addMembersEvent) {
|
|
23429
|
-
|
|
23475
|
+
_context9.n = 55;
|
|
23430
23476
|
break;
|
|
23431
23477
|
}
|
|
23432
23478
|
_t3 = {
|
|
23433
23479
|
members: _membersList
|
|
23434
23480
|
};
|
|
23435
|
-
|
|
23481
|
+
_context9.n = 57;
|
|
23436
23482
|
break;
|
|
23437
23483
|
case 55:
|
|
23438
|
-
|
|
23484
|
+
_context9.n = 56;
|
|
23439
23485
|
return effects.call(updateActiveChannelMembersAdd, addedMembers, _channel3.id) || {};
|
|
23440
23486
|
case 56:
|
|
23441
|
-
_t3 =
|
|
23487
|
+
_t3 = _context9.v;
|
|
23442
23488
|
case 57:
|
|
23443
23489
|
_updateChannelData3 = _t3;
|
|
23444
23490
|
case 58:
|
|
23445
|
-
|
|
23491
|
+
_context9.n = 59;
|
|
23446
23492
|
return effects.put(updateChannelDataAC(_channel3.id, _extends({
|
|
23447
23493
|
memberCount: _channel3.memberCount,
|
|
23448
23494
|
muted: _channel3.muted,
|
|
23449
23495
|
mutedTill: _channel3.mutedTill
|
|
23450
23496
|
}, _updateChannelData3)));
|
|
23451
23497
|
case 59:
|
|
23452
|
-
|
|
23498
|
+
_context9.n = 62;
|
|
23453
23499
|
break;
|
|
23454
23500
|
case 60:
|
|
23455
|
-
|
|
23501
|
+
_context9.n = 61;
|
|
23456
23502
|
return effects.call(setChannelInMap, _channel3);
|
|
23457
23503
|
case 61:
|
|
23458
|
-
|
|
23504
|
+
_context9.n = 62;
|
|
23459
23505
|
return effects.put(setAddedToChannelAC(JSON.parse(JSON.stringify(_channel3))));
|
|
23460
23506
|
case 62:
|
|
23461
23507
|
_groupName2 = getChannelGroupName(_channel3);
|
|
23462
|
-
|
|
23508
|
+
_context9.n = 63;
|
|
23463
23509
|
return effects.put(updateSearchedChannelDataAC(_channel3.id, {
|
|
23464
23510
|
memberCount: _channel3.memberCount,
|
|
23465
23511
|
muted: _channel3.muted,
|
|
@@ -23471,7 +23517,7 @@ function watchForEvents() {
|
|
|
23471
23517
|
muted: _channel3.muted,
|
|
23472
23518
|
mutedTill: _channel3.mutedTill
|
|
23473
23519
|
});
|
|
23474
|
-
return
|
|
23520
|
+
return _context9.a(3, 174);
|
|
23475
23521
|
case 64:
|
|
23476
23522
|
onUpdateChannel = getOnUpdateChannel();
|
|
23477
23523
|
log.info('channel UPDATE_CHANNEL ... ');
|
|
@@ -23503,10 +23549,10 @@ function watchForEvents() {
|
|
|
23503
23549
|
onUpdateChannel(updatedChannel, fields);
|
|
23504
23550
|
}
|
|
23505
23551
|
if (!_channelExists4) {
|
|
23506
|
-
|
|
23552
|
+
_context9.n = 67;
|
|
23507
23553
|
break;
|
|
23508
23554
|
}
|
|
23509
|
-
|
|
23555
|
+
_context9.n = 65;
|
|
23510
23556
|
return effects.put(updateChannelDataAC(updatedChannel.id, {
|
|
23511
23557
|
subject: subject,
|
|
23512
23558
|
avatarUrl: avatarUrl,
|
|
@@ -23514,21 +23560,21 @@ function watchForEvents() {
|
|
|
23514
23560
|
mutedTill: mutedTill
|
|
23515
23561
|
}));
|
|
23516
23562
|
case 65:
|
|
23517
|
-
|
|
23563
|
+
_context9.n = 66;
|
|
23518
23564
|
return effects.call(getActiveChannelId);
|
|
23519
23565
|
case 66:
|
|
23520
|
-
_activeChannelId3 =
|
|
23566
|
+
_activeChannelId3 = _context9.v;
|
|
23521
23567
|
if (!(_activeChannelId3 === updatedChannel.id)) {
|
|
23522
|
-
|
|
23568
|
+
_context9.n = 67;
|
|
23523
23569
|
break;
|
|
23524
23570
|
}
|
|
23525
|
-
|
|
23571
|
+
_context9.n = 67;
|
|
23526
23572
|
return effects.put(setActiveChannelAC(_extends({}, updatedChannel, {
|
|
23527
23573
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
23528
23574
|
})));
|
|
23529
23575
|
case 67:
|
|
23530
23576
|
_groupName3 = getChannelGroupName(updatedChannel);
|
|
23531
|
-
|
|
23577
|
+
_context9.n = 68;
|
|
23532
23578
|
return effects.put(updateSearchedChannelDataAC(updatedChannel.id, {
|
|
23533
23579
|
subject: subject,
|
|
23534
23580
|
avatarUrl: avatarUrl,
|
|
@@ -23543,67 +23589,67 @@ function watchForEvents() {
|
|
|
23543
23589
|
mutedTill: mutedTill,
|
|
23544
23590
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
23545
23591
|
});
|
|
23546
|
-
return
|
|
23592
|
+
return _context9.a(3, 174);
|
|
23547
23593
|
case 69:
|
|
23548
|
-
|
|
23594
|
+
_context9.n = 70;
|
|
23549
23595
|
return effects.call(handleChannelMessageEvent, args, SceytChatClient);
|
|
23550
23596
|
case 70:
|
|
23551
|
-
return
|
|
23597
|
+
return _context9.a(3, 174);
|
|
23552
23598
|
case 71:
|
|
23553
|
-
|
|
23599
|
+
_context9.n = 72;
|
|
23554
23600
|
return effects.call(handleMessageMarkersReceivedEvent, args, SceytChatClient);
|
|
23555
23601
|
case 72:
|
|
23556
|
-
return
|
|
23602
|
+
return _context9.a(3, 174);
|
|
23557
23603
|
case 73:
|
|
23558
23604
|
channelId = args.channelId;
|
|
23559
23605
|
log.info('channel DELETE ... ');
|
|
23560
23606
|
_channel5 = getChannelFromMap(channelId);
|
|
23561
|
-
|
|
23607
|
+
_context9.n = 74;
|
|
23562
23608
|
return effects.put(setChannelToRemoveAC(_channel5));
|
|
23563
23609
|
case 74:
|
|
23564
23610
|
deleteChannelFromAllChannels(channelId);
|
|
23565
|
-
return
|
|
23611
|
+
return _context9.a(3, 174);
|
|
23566
23612
|
case 75:
|
|
23567
23613
|
log.info('channel DELETE_MESSAGE ... ');
|
|
23568
|
-
|
|
23614
|
+
_context9.n = 76;
|
|
23569
23615
|
return effects.call(handleDeleteMessageEvent, args);
|
|
23570
23616
|
case 76:
|
|
23571
|
-
return
|
|
23617
|
+
return _context9.a(3, 174);
|
|
23572
23618
|
case 77:
|
|
23573
|
-
|
|
23619
|
+
_context9.n = 78;
|
|
23574
23620
|
return effects.call(handleEditMessageEvent, args);
|
|
23575
23621
|
case 78:
|
|
23576
|
-
return
|
|
23622
|
+
return _context9.a(3, 174);
|
|
23577
23623
|
case 79:
|
|
23578
23624
|
_channel6 = args.channel, user = args.user, message = args.message, reaction = args.reaction;
|
|
23579
23625
|
isSelf = user.id === SceytChatClient.user.id;
|
|
23580
|
-
|
|
23626
|
+
_context9.n = 80;
|
|
23581
23627
|
return effects.call(getActiveChannelId);
|
|
23582
23628
|
case 80:
|
|
23583
|
-
_activeChannelId4 =
|
|
23629
|
+
_activeChannelId4 = _context9.v;
|
|
23584
23630
|
if (!(_channel6.id === _activeChannelId4)) {
|
|
23585
|
-
|
|
23631
|
+
_context9.n = 81;
|
|
23586
23632
|
break;
|
|
23587
23633
|
}
|
|
23588
|
-
|
|
23634
|
+
_context9.n = 81;
|
|
23589
23635
|
return effects.put(addReactionToMessageAC(message, reaction, isSelf));
|
|
23590
23636
|
case 81:
|
|
23591
23637
|
if (!(message.user.id === SceytChatClient.user.id)) {
|
|
23592
|
-
|
|
23638
|
+
_context9.n = 85;
|
|
23593
23639
|
break;
|
|
23594
23640
|
}
|
|
23595
23641
|
if (!(!isSelf && Notification.permission === 'granted')) {
|
|
23596
|
-
|
|
23642
|
+
_context9.n = 83;
|
|
23597
23643
|
break;
|
|
23598
23644
|
}
|
|
23599
23645
|
if (!(document.visibilityState !== 'visible' || _channel6.id !== _activeChannelId4)) {
|
|
23600
|
-
|
|
23646
|
+
_context9.n = 83;
|
|
23601
23647
|
break;
|
|
23602
23648
|
}
|
|
23603
|
-
|
|
23649
|
+
_context9.n = 82;
|
|
23604
23650
|
return effects.select(contactsMapSelector);
|
|
23605
23651
|
case 82:
|
|
23606
|
-
contactsMap =
|
|
23652
|
+
contactsMap = _context9.v;
|
|
23607
23653
|
_getFromContacts = getShowOnlyContactUsers();
|
|
23608
23654
|
state = store.getState();
|
|
23609
23655
|
theme = state.ThemeReducer.theme || 'light';
|
|
@@ -23624,7 +23670,7 @@ function watchForEvents() {
|
|
|
23624
23670
|
}) : undefined);
|
|
23625
23671
|
case 83:
|
|
23626
23672
|
if (!(_channel6.newReactions && _channel6.newReactions.length)) {
|
|
23627
|
-
|
|
23673
|
+
_context9.n = 84;
|
|
23628
23674
|
break;
|
|
23629
23675
|
}
|
|
23630
23676
|
channelUpdateParams = {
|
|
@@ -23634,7 +23680,7 @@ function watchForEvents() {
|
|
|
23634
23680
|
muted: _channel6.muted,
|
|
23635
23681
|
mutedTill: _channel6.mutedTill
|
|
23636
23682
|
};
|
|
23637
|
-
|
|
23683
|
+
_context9.n = 84;
|
|
23638
23684
|
return effects.put(updateChannelDataAC(_channel6.id, channelUpdateParams));
|
|
23639
23685
|
case 84:
|
|
23640
23686
|
updateChannelOnAllChannels(_channel6.id, {
|
|
@@ -23648,15 +23694,15 @@ function watchForEvents() {
|
|
|
23648
23694
|
if (checkChannelExistsOnMessagesMap(_channel6.id)) {
|
|
23649
23695
|
addReactionToMessageOnMap(_channel6.id, message, reaction, true);
|
|
23650
23696
|
}
|
|
23651
|
-
return
|
|
23697
|
+
return _context9.a(3, 174);
|
|
23652
23698
|
case 86:
|
|
23653
23699
|
log.info('CHANNEL_EVENT_TYPES.POLL_ADDED ... ');
|
|
23654
23700
|
_channel7 = args.channel, pollDetails = args.pollDetails, messageId = args.messageId;
|
|
23655
23701
|
pollDetailsData = pollDetails;
|
|
23656
|
-
|
|
23702
|
+
_context9.n = 87;
|
|
23657
23703
|
return effects.call(getActiveChannelId);
|
|
23658
23704
|
case 87:
|
|
23659
|
-
_activeChannelId5 =
|
|
23705
|
+
_activeChannelId5 = _context9.v;
|
|
23660
23706
|
addedVotes = (pollDetailsData === null || pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan = pollDetailsData.changedVotes) === null || _pollDetailsData$chan === void 0 ? void 0 : _pollDetailsData$chan.addedVotes) || [];
|
|
23661
23707
|
deletedVotes = (pollDetailsData === null || pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan2 = pollDetailsData.changedVotes) === null || _pollDetailsData$chan2 === void 0 ? void 0 : _pollDetailsData$chan2.removedVotes) || [];
|
|
23662
23708
|
objs = [];
|
|
@@ -23677,37 +23723,37 @@ function watchForEvents() {
|
|
|
23677
23723
|
_i = 0, _objs = objs;
|
|
23678
23724
|
case 88:
|
|
23679
23725
|
if (!(_i < _objs.length)) {
|
|
23680
|
-
|
|
23726
|
+
_context9.n = 92;
|
|
23681
23727
|
break;
|
|
23682
23728
|
}
|
|
23683
23729
|
obj = _objs[_i];
|
|
23684
23730
|
if (!(pollDetailsData !== null && pollDetailsData !== void 0 && pollDetailsData.id && obj.vote)) {
|
|
23685
|
-
|
|
23731
|
+
_context9.n = 91;
|
|
23686
23732
|
break;
|
|
23687
23733
|
}
|
|
23688
23734
|
key = pollDetailsData.id + "_" + obj.vote.optionId;
|
|
23689
23735
|
hasNext = ((_store$getState$Messa3 = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa3 === void 0 ? void 0 : _store$getState$Messa3[key]) || false;
|
|
23690
23736
|
if (!(obj.type === 'addOwn')) {
|
|
23691
|
-
|
|
23737
|
+
_context9.n = 90;
|
|
23692
23738
|
break;
|
|
23693
23739
|
}
|
|
23694
|
-
|
|
23740
|
+
_context9.n = 89;
|
|
23695
23741
|
return effects.put(addPollVotesToListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote], hasNext, undefined));
|
|
23696
23742
|
case 89:
|
|
23697
|
-
|
|
23743
|
+
_context9.n = 91;
|
|
23698
23744
|
break;
|
|
23699
23745
|
case 90:
|
|
23700
|
-
|
|
23746
|
+
_context9.n = 91;
|
|
23701
23747
|
return effects.put(deletePollVotesFromListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote], messageId));
|
|
23702
23748
|
case 91:
|
|
23703
23749
|
_i++;
|
|
23704
|
-
|
|
23750
|
+
_context9.n = 88;
|
|
23705
23751
|
break;
|
|
23706
23752
|
case 92:
|
|
23707
23753
|
_i2 = 0, _objs2 = objs;
|
|
23708
23754
|
case 93:
|
|
23709
23755
|
if (!(_i2 < _objs2.length)) {
|
|
23710
|
-
|
|
23756
|
+
_context9.n = 95;
|
|
23711
23757
|
break;
|
|
23712
23758
|
}
|
|
23713
23759
|
_obj = _objs2[_i2];
|
|
@@ -23719,25 +23765,25 @@ function watchForEvents() {
|
|
|
23719
23765
|
vote: _obj.vote
|
|
23720
23766
|
});
|
|
23721
23767
|
if (!(_channel7.id === _activeChannelId5)) {
|
|
23722
|
-
|
|
23768
|
+
_context9.n = 94;
|
|
23723
23769
|
break;
|
|
23724
23770
|
}
|
|
23725
|
-
|
|
23771
|
+
_context9.n = 94;
|
|
23726
23772
|
return effects.put(updateMessageAC(messageId, {}, undefined, _obj));
|
|
23727
23773
|
case 94:
|
|
23728
23774
|
_i2++;
|
|
23729
|
-
|
|
23775
|
+
_context9.n = 93;
|
|
23730
23776
|
break;
|
|
23731
23777
|
case 95:
|
|
23732
|
-
return
|
|
23778
|
+
return _context9.a(3, 174);
|
|
23733
23779
|
case 96:
|
|
23734
23780
|
log.info('CHANNEL_EVENT_TYPES.POLL_DELETED ... ');
|
|
23735
23781
|
_channel8 = args.channel, _pollDetails = args.pollDetails, _messageId = args.messageId;
|
|
23736
23782
|
_pollDetailsData = _pollDetails;
|
|
23737
|
-
|
|
23783
|
+
_context9.n = 97;
|
|
23738
23784
|
return effects.call(getActiveChannelId);
|
|
23739
23785
|
case 97:
|
|
23740
|
-
_activeChannelId6 =
|
|
23786
|
+
_activeChannelId6 = _context9.v;
|
|
23741
23787
|
_deletedVotes = (_pollDetailsData === null || _pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan3 = _pollDetailsData.changedVotes) === null || _pollDetailsData$chan3 === void 0 ? void 0 : _pollDetailsData$chan3.removedVotes) || [];
|
|
23742
23788
|
_objs3 = [];
|
|
23743
23789
|
for (_iterator6 = _createForOfIteratorHelperLoose(_deletedVotes); !(_step6 = _iterator6()).done;) {
|
|
@@ -23750,25 +23796,25 @@ function watchForEvents() {
|
|
|
23750
23796
|
_i3 = 0, _objs4 = _objs3;
|
|
23751
23797
|
case 98:
|
|
23752
23798
|
if (!(_i3 < _objs4.length)) {
|
|
23753
|
-
|
|
23799
|
+
_context9.n = 100;
|
|
23754
23800
|
break;
|
|
23755
23801
|
}
|
|
23756
23802
|
_obj2 = _objs4[_i3];
|
|
23757
23803
|
if (!(_pollDetailsData !== null && _pollDetailsData !== void 0 && _pollDetailsData.id && _obj2.vote)) {
|
|
23758
|
-
|
|
23804
|
+
_context9.n = 99;
|
|
23759
23805
|
break;
|
|
23760
23806
|
}
|
|
23761
|
-
|
|
23807
|
+
_context9.n = 99;
|
|
23762
23808
|
return effects.put(deletePollVotesFromListAC(_pollDetailsData.id, _obj2.vote.optionId, [_obj2.vote], _messageId));
|
|
23763
23809
|
case 99:
|
|
23764
23810
|
_i3++;
|
|
23765
|
-
|
|
23811
|
+
_context9.n = 98;
|
|
23766
23812
|
break;
|
|
23767
23813
|
case 100:
|
|
23768
23814
|
_i4 = 0, _objs5 = _objs3;
|
|
23769
23815
|
case 101:
|
|
23770
23816
|
if (!(_i4 < _objs5.length)) {
|
|
23771
|
-
|
|
23817
|
+
_context9.n = 103;
|
|
23772
23818
|
break;
|
|
23773
23819
|
}
|
|
23774
23820
|
_obj3 = _objs5[_i4];
|
|
@@ -23777,24 +23823,24 @@ function watchForEvents() {
|
|
|
23777
23823
|
params: {}
|
|
23778
23824
|
}, _obj3);
|
|
23779
23825
|
if (!(_channel8.id === _activeChannelId6)) {
|
|
23780
|
-
|
|
23826
|
+
_context9.n = 102;
|
|
23781
23827
|
break;
|
|
23782
23828
|
}
|
|
23783
|
-
|
|
23829
|
+
_context9.n = 102;
|
|
23784
23830
|
return effects.put(updateMessageAC(_messageId, {}, undefined, _obj3));
|
|
23785
23831
|
case 102:
|
|
23786
23832
|
_i4++;
|
|
23787
|
-
|
|
23833
|
+
_context9.n = 101;
|
|
23788
23834
|
break;
|
|
23789
23835
|
case 103:
|
|
23790
|
-
return
|
|
23836
|
+
return _context9.a(3, 174);
|
|
23791
23837
|
case 104:
|
|
23792
23838
|
log.info('CHANNEL_EVENT_TYPES.POLL_RETRACTED ... ');
|
|
23793
23839
|
_channel9 = args.channel, _pollDetails2 = args.pollDetails, _messageId2 = args.messageId;
|
|
23794
|
-
|
|
23840
|
+
_context9.n = 105;
|
|
23795
23841
|
return effects.call(getActiveChannelId);
|
|
23796
23842
|
case 105:
|
|
23797
|
-
_activeChannelId7 =
|
|
23843
|
+
_activeChannelId7 = _context9.v;
|
|
23798
23844
|
_pollDetailsData2 = _pollDetails2;
|
|
23799
23845
|
retractedVotes = (_pollDetailsData2 === null || _pollDetailsData2 === void 0 ? void 0 : (_pollDetailsData2$cha = _pollDetailsData2.changedVotes) === null || _pollDetailsData2$cha === void 0 ? void 0 : _pollDetailsData2$cha.removedVotes) || [];
|
|
23800
23846
|
_objs6 = [];
|
|
@@ -23808,7 +23854,7 @@ function watchForEvents() {
|
|
|
23808
23854
|
_i5 = 0, _objs7 = _objs6;
|
|
23809
23855
|
case 106:
|
|
23810
23856
|
if (!(_i5 < _objs7.length)) {
|
|
23811
|
-
|
|
23857
|
+
_context9.n = 111;
|
|
23812
23858
|
break;
|
|
23813
23859
|
}
|
|
23814
23860
|
_obj4 = _objs7[_i5];
|
|
@@ -23817,41 +23863,41 @@ function watchForEvents() {
|
|
|
23817
23863
|
params: {}
|
|
23818
23864
|
}, _obj4);
|
|
23819
23865
|
if (!(_pollDetailsData2 !== null && _pollDetailsData2 !== void 0 && _pollDetailsData2.id && retractedVotes.length > 0)) {
|
|
23820
|
-
|
|
23866
|
+
_context9.n = 109;
|
|
23821
23867
|
break;
|
|
23822
23868
|
}
|
|
23823
23869
|
_iterator8 = _createForOfIteratorHelperLoose(retractedVotes);
|
|
23824
23870
|
case 107:
|
|
23825
23871
|
if ((_step8 = _iterator8()).done) {
|
|
23826
|
-
|
|
23872
|
+
_context9.n = 109;
|
|
23827
23873
|
break;
|
|
23828
23874
|
}
|
|
23829
23875
|
_vote3 = _step8.value;
|
|
23830
|
-
|
|
23876
|
+
_context9.n = 108;
|
|
23831
23877
|
return effects.put(deletePollVotesFromListAC(_pollDetailsData2.id, _vote3.optionId, [_vote3], _messageId2));
|
|
23832
23878
|
case 108:
|
|
23833
|
-
|
|
23879
|
+
_context9.n = 107;
|
|
23834
23880
|
break;
|
|
23835
23881
|
case 109:
|
|
23836
23882
|
if (!(_channel9.id === _activeChannelId7)) {
|
|
23837
|
-
|
|
23883
|
+
_context9.n = 110;
|
|
23838
23884
|
break;
|
|
23839
23885
|
}
|
|
23840
|
-
|
|
23886
|
+
_context9.n = 110;
|
|
23841
23887
|
return effects.put(updateMessageAC(_messageId2, {}, undefined, _obj4));
|
|
23842
23888
|
case 110:
|
|
23843
23889
|
_i5++;
|
|
23844
|
-
|
|
23890
|
+
_context9.n = 106;
|
|
23845
23891
|
break;
|
|
23846
23892
|
case 111:
|
|
23847
|
-
return
|
|
23893
|
+
return _context9.a(3, 174);
|
|
23848
23894
|
case 112:
|
|
23849
23895
|
log.info('CHANNEL_EVENT_TYPES.POLL_CLOSED ... ');
|
|
23850
23896
|
_channel0 = args.channel, _messageId3 = args.messageId;
|
|
23851
|
-
|
|
23897
|
+
_context9.n = 113;
|
|
23852
23898
|
return effects.call(getActiveChannelId);
|
|
23853
23899
|
case 113:
|
|
23854
|
-
_activeChannelId8 =
|
|
23900
|
+
_activeChannelId8 = _context9.v;
|
|
23855
23901
|
_obj5 = {
|
|
23856
23902
|
type: 'close'
|
|
23857
23903
|
};
|
|
@@ -23860,74 +23906,74 @@ function watchForEvents() {
|
|
|
23860
23906
|
params: {}
|
|
23861
23907
|
}, _obj5);
|
|
23862
23908
|
if (!(_channel0.id === _activeChannelId8)) {
|
|
23863
|
-
|
|
23909
|
+
_context9.n = 115;
|
|
23864
23910
|
break;
|
|
23865
23911
|
}
|
|
23866
|
-
|
|
23912
|
+
_context9.n = 114;
|
|
23867
23913
|
return effects.put(updateMessageAC(_messageId3, {}, undefined, _obj5));
|
|
23868
23914
|
case 114:
|
|
23869
|
-
return
|
|
23915
|
+
return _context9.a(3, 174);
|
|
23870
23916
|
case 115:
|
|
23871
|
-
return
|
|
23917
|
+
return _context9.a(3, 174);
|
|
23872
23918
|
case 116:
|
|
23873
23919
|
_channel1 = args.channel, _user = args.user, _message = args.message, _reaction = args.reaction;
|
|
23874
23920
|
log.info('channel REACTION_DELETED ... ', _channel1);
|
|
23875
23921
|
channelFromMap = getChannelFromMap(_channel1.id);
|
|
23876
23922
|
_isSelf = _user.id === SceytChatClient.user.id;
|
|
23877
|
-
|
|
23923
|
+
_context9.n = 117;
|
|
23878
23924
|
return effects.call(getActiveChannelId);
|
|
23879
23925
|
case 117:
|
|
23880
|
-
_activeChannelId9 =
|
|
23926
|
+
_activeChannelId9 = _context9.v;
|
|
23881
23927
|
if (!(_channel1.id === _activeChannelId9)) {
|
|
23882
|
-
|
|
23928
|
+
_context9.n = 118;
|
|
23883
23929
|
break;
|
|
23884
23930
|
}
|
|
23885
|
-
|
|
23931
|
+
_context9.n = 118;
|
|
23886
23932
|
return effects.put(deleteReactionFromMessageAC(_message, _reaction, _isSelf));
|
|
23887
23933
|
case 118:
|
|
23888
23934
|
_channelUpdateParams = JSON.parse(JSON.stringify(_channel1));
|
|
23889
23935
|
if (channelFromMap && channelFromMap.lastReactedMessage && channelFromMap.lastReactedMessage.id === _message.id) {
|
|
23890
23936
|
_channelUpdateParams.lastReactedMessage = null;
|
|
23891
23937
|
}
|
|
23892
|
-
|
|
23938
|
+
_context9.n = 119;
|
|
23893
23939
|
return effects.put(updateChannelDataAC(_channel1.id, _channelUpdateParams));
|
|
23894
23940
|
case 119:
|
|
23895
23941
|
updateChannelOnAllChannels(_channel1.id, _channelUpdateParams);
|
|
23896
23942
|
if (checkChannelExistsOnMessagesMap(_channel1.id)) {
|
|
23897
23943
|
removeReactionToMessageOnMap(_channel1.id, _message, _reaction, true);
|
|
23898
23944
|
}
|
|
23899
|
-
return
|
|
23945
|
+
return _context9.a(3, 174);
|
|
23900
23946
|
case 120:
|
|
23901
|
-
|
|
23947
|
+
_context9.n = 121;
|
|
23902
23948
|
return effects.call(handleUnreadMessagesInfoEvent, args);
|
|
23903
23949
|
case 121:
|
|
23904
|
-
return
|
|
23950
|
+
return _context9.a(3, 174);
|
|
23905
23951
|
case 122:
|
|
23906
23952
|
_channel10 = args.channel;
|
|
23907
23953
|
log.info('CLEAR_HISTORY: ', _channel10);
|
|
23908
|
-
|
|
23954
|
+
_context9.n = 123;
|
|
23909
23955
|
return effects.call(getActiveChannelId);
|
|
23910
23956
|
case 123:
|
|
23911
|
-
_activeChannelId0 =
|
|
23912
|
-
|
|
23957
|
+
_activeChannelId0 = _context9.v;
|
|
23958
|
+
_context9.n = 124;
|
|
23913
23959
|
return effects.call(checkChannelExists, _channel10.id);
|
|
23914
23960
|
case 124:
|
|
23915
|
-
channelExist =
|
|
23961
|
+
channelExist = _context9.v;
|
|
23916
23962
|
if (!(_channel10.id === _activeChannelId0)) {
|
|
23917
|
-
|
|
23963
|
+
_context9.n = 126;
|
|
23918
23964
|
break;
|
|
23919
23965
|
}
|
|
23920
|
-
|
|
23966
|
+
_context9.n = 125;
|
|
23921
23967
|
return effects.put(clearMessagesAC());
|
|
23922
23968
|
case 125:
|
|
23923
23969
|
removeAllMessages();
|
|
23924
23970
|
case 126:
|
|
23925
23971
|
removeMessagesFromMap(_channel10.id);
|
|
23926
23972
|
if (!channelExist) {
|
|
23927
|
-
|
|
23973
|
+
_context9.n = 127;
|
|
23928
23974
|
break;
|
|
23929
23975
|
}
|
|
23930
|
-
|
|
23976
|
+
_context9.n = 127;
|
|
23931
23977
|
return effects.put(updateChannelDataAC(_channel10.id, {
|
|
23932
23978
|
lastMessage: null,
|
|
23933
23979
|
newMessageCount: 0,
|
|
@@ -23943,11 +23989,11 @@ function watchForEvents() {
|
|
|
23943
23989
|
muted: _channel10.muted,
|
|
23944
23990
|
mutedTill: _channel10.mutedTill
|
|
23945
23991
|
});
|
|
23946
|
-
return
|
|
23992
|
+
return _context9.a(3, 174);
|
|
23947
23993
|
case 128:
|
|
23948
23994
|
_channel11 = args.channel;
|
|
23949
23995
|
log.info('channel MUTE ... ');
|
|
23950
|
-
|
|
23996
|
+
_context9.n = 129;
|
|
23951
23997
|
return effects.put(updateChannelDataAC(_channel11.id, {
|
|
23952
23998
|
muted: _channel11.muted,
|
|
23953
23999
|
mutedTill: _channel11.mutedTill
|
|
@@ -23957,11 +24003,11 @@ function watchForEvents() {
|
|
|
23957
24003
|
muted: _channel11.muted,
|
|
23958
24004
|
mutedTill: _channel11.mutedTill
|
|
23959
24005
|
});
|
|
23960
|
-
return
|
|
24006
|
+
return _context9.a(3, 174);
|
|
23961
24007
|
case 130:
|
|
23962
24008
|
_channel12 = args.channel;
|
|
23963
24009
|
log.info('channel UNMUTE ... ');
|
|
23964
|
-
|
|
24010
|
+
_context9.n = 131;
|
|
23965
24011
|
return effects.put(updateChannelDataAC(_channel12.id, {
|
|
23966
24012
|
muted: _channel12.muted,
|
|
23967
24013
|
mutedTill: _channel12.mutedTill
|
|
@@ -23971,11 +24017,11 @@ function watchForEvents() {
|
|
|
23971
24017
|
muted: _channel12.muted,
|
|
23972
24018
|
mutedTill: _channel12.mutedTill
|
|
23973
24019
|
});
|
|
23974
|
-
return
|
|
24020
|
+
return _context9.a(3, 174);
|
|
23975
24021
|
case 132:
|
|
23976
24022
|
_channel13 = args.channel;
|
|
23977
24023
|
log.info('channel PINED ... ');
|
|
23978
|
-
|
|
24024
|
+
_context9.n = 133;
|
|
23979
24025
|
return effects.put(updateChannelDataAC(_channel13.id, {
|
|
23980
24026
|
pinnedAt: _channel13.pinnedAt
|
|
23981
24027
|
}, true));
|
|
@@ -23983,11 +24029,11 @@ function watchForEvents() {
|
|
|
23983
24029
|
updateChannelOnAllChannels(_channel13.id, {
|
|
23984
24030
|
pinnedAt: _channel13.pinnedAt
|
|
23985
24031
|
});
|
|
23986
|
-
return
|
|
24032
|
+
return _context9.a(3, 174);
|
|
23987
24033
|
case 134:
|
|
23988
24034
|
_channel14 = args.channel;
|
|
23989
24035
|
log.info('channel UNPINED ... ');
|
|
23990
|
-
|
|
24036
|
+
_context9.n = 135;
|
|
23991
24037
|
return effects.put(updateChannelDataAC(_channel14.id, {
|
|
23992
24038
|
pinnedAt: _channel14.pinnedAt
|
|
23993
24039
|
}, false, true));
|
|
@@ -23995,39 +24041,39 @@ function watchForEvents() {
|
|
|
23995
24041
|
updateChannelOnAllChannels(_channel14.id, {
|
|
23996
24042
|
pinnedAt: _channel14.pinnedAt
|
|
23997
24043
|
});
|
|
23998
|
-
return
|
|
24044
|
+
return _context9.a(3, 174);
|
|
23999
24045
|
case 136:
|
|
24000
24046
|
_channel15 = args.channel;
|
|
24001
24047
|
log.info('channel HIDE ... ');
|
|
24002
|
-
|
|
24048
|
+
_context9.n = 137;
|
|
24003
24049
|
return effects.put(setChannelToHideAC(_channel15));
|
|
24004
24050
|
case 137:
|
|
24005
|
-
|
|
24051
|
+
_context9.n = 138;
|
|
24006
24052
|
return effects.call(getActiveChannelId);
|
|
24007
24053
|
case 138:
|
|
24008
|
-
_activeChannelId1 =
|
|
24054
|
+
_activeChannelId1 = _context9.v;
|
|
24009
24055
|
if (!(_activeChannelId1 === _channel15.id)) {
|
|
24010
|
-
|
|
24056
|
+
_context9.n = 140;
|
|
24011
24057
|
break;
|
|
24012
24058
|
}
|
|
24013
|
-
|
|
24059
|
+
_context9.n = 139;
|
|
24014
24060
|
return effects.call(getLastChannelFromMap, true);
|
|
24015
24061
|
case 139:
|
|
24016
|
-
lastChannel =
|
|
24017
|
-
|
|
24062
|
+
lastChannel = _context9.v;
|
|
24063
|
+
_context9.n = 140;
|
|
24018
24064
|
return effects.put(switchChannelActionAC(lastChannel || null));
|
|
24019
24065
|
case 140:
|
|
24020
|
-
return
|
|
24066
|
+
return _context9.a(3, 174);
|
|
24021
24067
|
case 141:
|
|
24022
24068
|
_channel16 = args.channel;
|
|
24023
24069
|
log.info('channel UNHIDE ... ');
|
|
24024
|
-
|
|
24070
|
+
_context9.n = 142;
|
|
24025
24071
|
return effects.put(setChannelToUnHideAC(_channel16));
|
|
24026
24072
|
case 142:
|
|
24027
|
-
return
|
|
24073
|
+
return _context9.a(3, 174);
|
|
24028
24074
|
case 143:
|
|
24029
24075
|
_channel17 = args.channel;
|
|
24030
|
-
|
|
24076
|
+
_context9.n = 144;
|
|
24031
24077
|
return effects.put(updateChannelDataAC(_channel17.id, {
|
|
24032
24078
|
unread: _channel17.unread,
|
|
24033
24079
|
muted: _channel17.muted,
|
|
@@ -24035,7 +24081,7 @@ function watchForEvents() {
|
|
|
24035
24081
|
}));
|
|
24036
24082
|
case 144:
|
|
24037
24083
|
_groupName4 = getChannelGroupName(_channel17);
|
|
24038
|
-
|
|
24084
|
+
_context9.n = 145;
|
|
24039
24085
|
return effects.put(updateSearchedChannelDataAC(_channel17.id, {
|
|
24040
24086
|
unread: _channel17.unread
|
|
24041
24087
|
}, _groupName4));
|
|
@@ -24043,104 +24089,90 @@ function watchForEvents() {
|
|
|
24043
24089
|
updateChannelOnAllChannels(_channel17.id, {
|
|
24044
24090
|
unread: _channel17.unread
|
|
24045
24091
|
});
|
|
24046
|
-
return
|
|
24092
|
+
return _context9.a(3, 174);
|
|
24047
24093
|
case 146:
|
|
24048
|
-
|
|
24049
|
-
|
|
24050
|
-
return effects.put(updateChannelDataAC(_channel18.id, {
|
|
24051
|
-
unread: _channel18.unread,
|
|
24052
|
-
muted: _channel18.muted,
|
|
24053
|
-
mutedTill: _channel18.mutedTill
|
|
24054
|
-
}));
|
|
24094
|
+
_context9.n = 147;
|
|
24095
|
+
return effects.call(handleChannelMarkedAsReadEvent, args);
|
|
24055
24096
|
case 147:
|
|
24056
|
-
|
|
24057
|
-
_context8.n = 148;
|
|
24058
|
-
return effects.put(updateSearchedChannelDataAC(_channel18.id, {
|
|
24059
|
-
unread: _channel18.unread
|
|
24060
|
-
}, _groupName5));
|
|
24097
|
+
return _context9.a(3, 174);
|
|
24061
24098
|
case 148:
|
|
24062
|
-
|
|
24063
|
-
|
|
24064
|
-
});
|
|
24065
|
-
return _context8.a(3, 175);
|
|
24066
|
-
case 149:
|
|
24067
|
-
_channel19 = args.channel, members = args.members;
|
|
24068
|
-
log.info('channel CHANGE_ROLE channel ... ', _channel19);
|
|
24099
|
+
_channel18 = args.channel, members = args.members;
|
|
24100
|
+
log.info('channel CHANGE_ROLE channel ... ', _channel18);
|
|
24069
24101
|
log.info('channel CHANGE_ROLE member ... ', members);
|
|
24070
|
-
|
|
24102
|
+
_context9.n = 149;
|
|
24071
24103
|
return effects.call(getActiveChannelId);
|
|
24072
|
-
case
|
|
24073
|
-
_activeChannelId10 =
|
|
24074
|
-
if (!(
|
|
24075
|
-
|
|
24104
|
+
case 149:
|
|
24105
|
+
_activeChannelId10 = _context9.v;
|
|
24106
|
+
if (!(_channel18.id === _activeChannelId10)) {
|
|
24107
|
+
_context9.n = 153;
|
|
24076
24108
|
break;
|
|
24077
24109
|
}
|
|
24078
24110
|
_customLoadMembersFunctions2 = getCustomLoadMembersFunctions();
|
|
24079
24111
|
updateMembersEvent = _customLoadMembersFunctions2 === null || _customLoadMembersFunctions2 === void 0 ? void 0 : _customLoadMembersFunctions2.updateMembersEvent;
|
|
24080
24112
|
if (!updateMembersEvent) {
|
|
24081
|
-
|
|
24113
|
+
_context9.n = 152;
|
|
24082
24114
|
break;
|
|
24083
24115
|
}
|
|
24084
|
-
|
|
24085
|
-
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));
|
|
24086
24122
|
case 151:
|
|
24087
|
-
|
|
24088
|
-
_context8.n = 152;
|
|
24089
|
-
return effects.put(setMembersToListAC(_membersList2, _channel19.id));
|
|
24090
|
-
case 152:
|
|
24091
|
-
_context8.n = 154;
|
|
24123
|
+
_context9.n = 153;
|
|
24092
24124
|
break;
|
|
24125
|
+
case 152:
|
|
24126
|
+
_context9.n = 153;
|
|
24127
|
+
return effects.put(updateMembersAC(members, _channel18.id));
|
|
24093
24128
|
case 153:
|
|
24094
|
-
_context8.n = 154;
|
|
24095
|
-
return effects.put(updateMembersAC(members, _channel19.id));
|
|
24096
|
-
case 154:
|
|
24097
24129
|
i = 0;
|
|
24098
|
-
case
|
|
24130
|
+
case 154:
|
|
24099
24131
|
if (!(i < members.length)) {
|
|
24100
|
-
|
|
24132
|
+
_context9.n = 157;
|
|
24101
24133
|
break;
|
|
24102
24134
|
}
|
|
24103
24135
|
if (!(members[i].id === SceytChatClient.user.id)) {
|
|
24104
|
-
|
|
24136
|
+
_context9.n = 156;
|
|
24105
24137
|
break;
|
|
24106
24138
|
}
|
|
24107
|
-
|
|
24108
|
-
return effects.put(updateChannelDataAC(
|
|
24139
|
+
_context9.n = 155;
|
|
24140
|
+
return effects.put(updateChannelDataAC(_channel18.id, {
|
|
24109
24141
|
userRole: members[i].role,
|
|
24110
|
-
muted:
|
|
24111
|
-
mutedTill:
|
|
24142
|
+
muted: _channel18.muted,
|
|
24143
|
+
mutedTill: _channel18.mutedTill
|
|
24112
24144
|
}));
|
|
24113
|
-
case
|
|
24114
|
-
updateChannelOnAllChannels(
|
|
24145
|
+
case 155:
|
|
24146
|
+
updateChannelOnAllChannels(_channel18.id, {
|
|
24115
24147
|
userRole: members[i].role,
|
|
24116
|
-
muted:
|
|
24117
|
-
mutedTill:
|
|
24148
|
+
muted: _channel18.muted,
|
|
24149
|
+
mutedTill: _channel18.mutedTill
|
|
24118
24150
|
});
|
|
24119
|
-
case
|
|
24151
|
+
case 156:
|
|
24120
24152
|
i++;
|
|
24121
|
-
|
|
24153
|
+
_context9.n = 154;
|
|
24122
24154
|
break;
|
|
24155
|
+
case 157:
|
|
24156
|
+
return _context9.a(3, 174);
|
|
24123
24157
|
case 158:
|
|
24124
|
-
|
|
24158
|
+
_channel19 = args.channel;
|
|
24159
|
+
log.info('channel frozen channel ... ', _channel19);
|
|
24160
|
+
return _context9.a(3, 174);
|
|
24125
24161
|
case 159:
|
|
24126
24162
|
_channel20 = args.channel;
|
|
24127
|
-
log.info('channel
|
|
24128
|
-
return
|
|
24163
|
+
log.info('channel unfrozen channel ... ', _channel20);
|
|
24164
|
+
return _context9.a(3, 174);
|
|
24129
24165
|
case 160:
|
|
24130
|
-
_channel21 = args.channel;
|
|
24131
|
-
log.info('channel unfrozen channel ... ', _channel21);
|
|
24132
|
-
return _context8.a(3, 175);
|
|
24133
|
-
case 161:
|
|
24134
24166
|
_channelId = args.channelId, from = args.from, name = args.name;
|
|
24135
24167
|
log.info('channel event received >>>... . . . . . ', args);
|
|
24136
24168
|
if (!(from.id === SceytChatClient.user.id)) {
|
|
24137
|
-
|
|
24169
|
+
_context9.n = 161;
|
|
24138
24170
|
break;
|
|
24139
24171
|
}
|
|
24140
|
-
return
|
|
24141
|
-
case
|
|
24172
|
+
return _context9.a(3, 174);
|
|
24173
|
+
case 161:
|
|
24142
24174
|
if (!(name === 'start_typing')) {
|
|
24143
|
-
|
|
24175
|
+
_context9.n = 163;
|
|
24144
24176
|
break;
|
|
24145
24177
|
}
|
|
24146
24178
|
if (!usersTimeout.typingTimeout[_channelId]) {
|
|
@@ -24152,27 +24184,27 @@ function watchForEvents() {
|
|
|
24152
24184
|
usersTimeout.typingTimeout[_channelId][from.id] = setTimeout(function () {
|
|
24153
24185
|
channelListener.onReceivedChannelEvent(_channelId, from, 'stop_typing');
|
|
24154
24186
|
}, 5000);
|
|
24155
|
-
|
|
24187
|
+
_context9.n = 162;
|
|
24156
24188
|
return effects.put(switchTypingIndicatorAC(true, _channelId, from));
|
|
24157
|
-
case
|
|
24158
|
-
|
|
24189
|
+
case 162:
|
|
24190
|
+
_context9.n = 168;
|
|
24159
24191
|
break;
|
|
24160
|
-
case
|
|
24192
|
+
case 163:
|
|
24161
24193
|
if (!(name === 'stop_typing')) {
|
|
24162
|
-
|
|
24194
|
+
_context9.n = 165;
|
|
24163
24195
|
break;
|
|
24164
24196
|
}
|
|
24165
24197
|
if (usersTimeout.typingTimeout[_channelId] && usersTimeout.typingTimeout[_channelId][from.id]) {
|
|
24166
24198
|
clearTimeout(usersTimeout.typingTimeout[_channelId][from.id]);
|
|
24167
24199
|
}
|
|
24168
|
-
|
|
24200
|
+
_context9.n = 164;
|
|
24169
24201
|
return effects.put(switchTypingIndicatorAC(false, _channelId, from));
|
|
24170
|
-
case
|
|
24171
|
-
|
|
24202
|
+
case 164:
|
|
24203
|
+
_context9.n = 168;
|
|
24172
24204
|
break;
|
|
24173
|
-
case
|
|
24205
|
+
case 165:
|
|
24174
24206
|
if (!(name === 'start_recording')) {
|
|
24175
|
-
|
|
24207
|
+
_context9.n = 167;
|
|
24176
24208
|
break;
|
|
24177
24209
|
}
|
|
24178
24210
|
if (!usersTimeout.recordingTimeout[_channelId]) {
|
|
@@ -24184,63 +24216,63 @@ function watchForEvents() {
|
|
|
24184
24216
|
usersTimeout.recordingTimeout[_channelId][from.id] = setTimeout(function () {
|
|
24185
24217
|
channelListener.onReceivedChannelEvent(_channelId, from, 'stop_recording');
|
|
24186
24218
|
}, 5000);
|
|
24187
|
-
|
|
24219
|
+
_context9.n = 166;
|
|
24188
24220
|
return effects.put(switchRecordingIndicatorAC(true, _channelId, from));
|
|
24189
|
-
case
|
|
24190
|
-
|
|
24221
|
+
case 166:
|
|
24222
|
+
_context9.n = 168;
|
|
24191
24223
|
break;
|
|
24192
|
-
case
|
|
24224
|
+
case 167:
|
|
24193
24225
|
if (!(name === 'stop_recording')) {
|
|
24194
|
-
|
|
24226
|
+
_context9.n = 168;
|
|
24195
24227
|
break;
|
|
24196
24228
|
}
|
|
24197
24229
|
if (usersTimeout.recordingTimeout[_channelId] && usersTimeout.recordingTimeout[_channelId][from.id]) {
|
|
24198
24230
|
clearTimeout(usersTimeout.recordingTimeout[_channelId][from.id]);
|
|
24199
24231
|
}
|
|
24200
|
-
|
|
24232
|
+
_context9.n = 168;
|
|
24201
24233
|
return effects.put(switchRecordingIndicatorAC(false, _channelId, from));
|
|
24234
|
+
case 168:
|
|
24235
|
+
return _context9.a(3, 174);
|
|
24202
24236
|
case 169:
|
|
24203
|
-
return _context8.a(3, 175);
|
|
24204
|
-
case 170:
|
|
24205
24237
|
status = args.status;
|
|
24206
24238
|
log.info('connection status changed . . . . . ', status);
|
|
24207
|
-
|
|
24239
|
+
_context9.n = 170;
|
|
24208
24240
|
return effects.put(setConnectionStatusAC(status));
|
|
24209
|
-
case
|
|
24241
|
+
case 170:
|
|
24210
24242
|
if (!(status === CONNECTION_STATUS.CONNECTED)) {
|
|
24211
|
-
|
|
24243
|
+
_context9.n = 172;
|
|
24212
24244
|
break;
|
|
24213
24245
|
}
|
|
24214
|
-
|
|
24246
|
+
_context9.n = 171;
|
|
24215
24247
|
return effects.put(getRolesAC());
|
|
24216
|
-
case
|
|
24217
|
-
|
|
24248
|
+
case 171:
|
|
24249
|
+
_context9.n = 172;
|
|
24218
24250
|
return effects.put(resendPendingMessageMutationsAC(status));
|
|
24251
|
+
case 172:
|
|
24252
|
+
return _context9.a(3, 174);
|
|
24219
24253
|
case 173:
|
|
24220
|
-
return _context8.a(3, 175);
|
|
24221
|
-
case 174:
|
|
24222
24254
|
log.warn('UNHANDLED EVENT FROM REDUX-SAGA EVENT-CHANNEL');
|
|
24223
|
-
case
|
|
24224
|
-
|
|
24255
|
+
case 174:
|
|
24256
|
+
_context9.n = 176;
|
|
24225
24257
|
break;
|
|
24226
|
-
case
|
|
24227
|
-
|
|
24228
|
-
_t4 =
|
|
24258
|
+
case 175:
|
|
24259
|
+
_context9.p = 175;
|
|
24260
|
+
_t4 = _context9.v;
|
|
24229
24261
|
log.error('Error in watchForEvents:', _t4);
|
|
24230
|
-
case
|
|
24231
|
-
return
|
|
24262
|
+
case 176:
|
|
24263
|
+
return _context9.a(2);
|
|
24232
24264
|
}
|
|
24233
|
-
}, _callee3, null, [[0,
|
|
24265
|
+
}, _callee3, null, [[0, 175]]);
|
|
24234
24266
|
});
|
|
24235
24267
|
case 1:
|
|
24236
|
-
return
|
|
24268
|
+
return _context0.d(_regeneratorValues(_loop()), 2);
|
|
24237
24269
|
case 2:
|
|
24238
|
-
|
|
24270
|
+
_context0.n = 1;
|
|
24239
24271
|
break;
|
|
24240
24272
|
case 3:
|
|
24241
|
-
return
|
|
24273
|
+
return _context0.a(2);
|
|
24242
24274
|
}
|
|
24243
|
-
},
|
|
24275
|
+
}, _marked7$1);
|
|
24244
24276
|
}
|
|
24245
24277
|
|
|
24246
24278
|
var _marked$3 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
@@ -24249,7 +24281,7 @@ var _marked$3 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
|
24249
24281
|
_marked4$2 = /*#__PURE__*/_regenerator().m(getChannelsForForward),
|
|
24250
24282
|
_marked5$2 = /*#__PURE__*/_regenerator().m(searchChannelsForForward),
|
|
24251
24283
|
_marked6$2 = /*#__PURE__*/_regenerator().m(channelsLoadMore),
|
|
24252
|
-
_marked7$
|
|
24284
|
+
_marked7$2 = /*#__PURE__*/_regenerator().m(getChannelMentions),
|
|
24253
24285
|
_marked8$1 = /*#__PURE__*/_regenerator().m(channelsForForwardLoadMore),
|
|
24254
24286
|
_marked9$1 = /*#__PURE__*/_regenerator().m(markMessagesRead),
|
|
24255
24287
|
_marked0$1 = /*#__PURE__*/_regenerator().m(markVoiceMessageAsPlayed),
|
|
@@ -24286,6 +24318,34 @@ var _marked$3 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
|
24286
24318
|
_marked39$1 = /*#__PURE__*/_regenerator().m(getChannelsWithUser),
|
|
24287
24319
|
_marked40$1 = /*#__PURE__*/_regenerator().m(loadMoreMutualChannels),
|
|
24288
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
|
+
};
|
|
24289
24349
|
function createChannel(action) {
|
|
24290
24350
|
var payload, channelData, dontCreateIfNotExists, callback, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, whoDoesNotAdded, checkChannelExist, messageToSend, _allChannels, _memberId, _t;
|
|
24291
24351
|
return _regenerator().w(function (_context) {
|
|
@@ -25282,7 +25342,7 @@ function getChannelMentions(action) {
|
|
|
25282
25342
|
case 5:
|
|
25283
25343
|
return _context8.a(2);
|
|
25284
25344
|
}
|
|
25285
|
-
}, _marked7$
|
|
25345
|
+
}, _marked7$2, null, [[0, 4]]);
|
|
25286
25346
|
}
|
|
25287
25347
|
function channelsForForwardLoadMore(action) {
|
|
25288
25348
|
var payload, limit, _SceytChatClient4, channelQueryForward, channelsData, channelsToAdd, _yield$call4, mappedChannels, _t0;
|
|
@@ -25336,17 +25396,19 @@ function channelsForForwardLoadMore(action) {
|
|
|
25336
25396
|
}, _marked8$1, null, [[0, 7]]);
|
|
25337
25397
|
}
|
|
25338
25398
|
function markMessagesRead(action) {
|
|
25339
|
-
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;
|
|
25340
25400
|
return _regenerator().w(function (_context0) {
|
|
25341
25401
|
while (1) switch (_context0.p = _context0.n) {
|
|
25342
25402
|
case 0:
|
|
25343
25403
|
payload = action.payload;
|
|
25344
25404
|
channelId = payload.channelId, messageIds = payload.messageIds;
|
|
25405
|
+
log.info("[READ_MESSAGE] saga ch=" + channelId + " ids=[" + messageIds.join(',') + "]");
|
|
25345
25406
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
25346
25407
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
25347
25408
|
_context0.n = 1;
|
|
25348
25409
|
break;
|
|
25349
25410
|
}
|
|
25411
|
+
log.warn("[READ_MESSAGE] saga skip \u2014 not connected (" + connectionStatus + ")");
|
|
25350
25412
|
return _context0.a(2);
|
|
25351
25413
|
case 1:
|
|
25352
25414
|
_context0.n = 2;
|
|
@@ -25361,22 +25423,42 @@ function markMessagesRead(action) {
|
|
|
25361
25423
|
}
|
|
25362
25424
|
}
|
|
25363
25425
|
if (!channel) {
|
|
25364
|
-
_context0.n =
|
|
25426
|
+
_context0.n = 10;
|
|
25365
25427
|
break;
|
|
25366
25428
|
}
|
|
25429
|
+
previousLastDisplayedMessageId = channel.lastDisplayedMessageId || '';
|
|
25430
|
+
latestUnreadBoundaryId = getLatestUnreadBoundaryId(channel);
|
|
25431
|
+
log.info("[READ_MESSAGE] calling markMessagesAsDisplayed ch=" + channelId);
|
|
25367
25432
|
_context0.n = 4;
|
|
25368
25433
|
return effects.call(channel.markMessagesAsDisplayed, messageIds);
|
|
25369
25434
|
case 4:
|
|
25370
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);
|
|
25371
25457
|
_context0.n = 5;
|
|
25372
|
-
return effects.put(updateChannelDataAC(channel.id,
|
|
25373
|
-
lastDisplayedMessageId: channel.lastDisplayedMessageId
|
|
25374
|
-
}));
|
|
25458
|
+
return effects.put(updateChannelDataAC(channel.id, updateData));
|
|
25375
25459
|
case 5:
|
|
25376
|
-
updateChannelOnAllChannels(channel.id,
|
|
25377
|
-
|
|
25378
|
-
});
|
|
25379
|
-
_iterator6 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
25460
|
+
updateChannelOnAllChannels(channel.id, updateData);
|
|
25461
|
+
_iterator6 = _createForOfIteratorHelperLoose(readMessageIds);
|
|
25380
25462
|
case 6:
|
|
25381
25463
|
if ((_step6 = _iterator6()).done) {
|
|
25382
25464
|
_context0.n = 9;
|
|
@@ -25386,8 +25468,8 @@ function markMessagesRead(action) {
|
|
|
25386
25468
|
updateParams = {
|
|
25387
25469
|
deliveryStatus: MESSAGE_DELIVERY_STATUS.READ,
|
|
25388
25470
|
userMarkers: [{
|
|
25389
|
-
user: messageListMarker.user,
|
|
25390
|
-
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(),
|
|
25391
25473
|
messageId: messageId,
|
|
25392
25474
|
name: MESSAGE_DELIVERY_STATUS.READ
|
|
25393
25475
|
}]
|
|
@@ -25406,13 +25488,18 @@ function markMessagesRead(action) {
|
|
|
25406
25488
|
_context0.n = 11;
|
|
25407
25489
|
break;
|
|
25408
25490
|
case 10:
|
|
25409
|
-
|
|
25410
|
-
_t1 = _context0.v;
|
|
25411
|
-
log.error(_t1, 'Error on mark messages read');
|
|
25491
|
+
log.warn("[READ_MESSAGE] saga skip \u2014 channel not found ch=" + channelId);
|
|
25412
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:
|
|
25413
25500
|
return _context0.a(2);
|
|
25414
25501
|
}
|
|
25415
|
-
}, _marked9$1, null, [[3,
|
|
25502
|
+
}, _marked9$1, null, [[3, 12]]);
|
|
25416
25503
|
}
|
|
25417
25504
|
function markVoiceMessageAsPlayed(action) {
|
|
25418
25505
|
var payload, channelId, messageIds, connectionStatus, channel, messageListMarker, _iterator7, _step7, messageId, updateParams, _t10;
|
|
@@ -25835,7 +25922,7 @@ function notificationsTurnOn() {
|
|
|
25835
25922
|
}, _marked14$1, null, [[3, 6]]);
|
|
25836
25923
|
}
|
|
25837
25924
|
function markChannelAsRead(action) {
|
|
25838
|
-
var channelId, channel, updatedChannel, updateData, _t16;
|
|
25925
|
+
var channelId, channel, updatedChannel, latestUnreadBoundaryId, lastDisplayedCandidates, nextLastDisplayedMessageId, updateData, _t16;
|
|
25839
25926
|
return _regenerator().w(function (_context16) {
|
|
25840
25927
|
while (1) switch (_context16.p = _context16.n) {
|
|
25841
25928
|
case 0:
|
|
@@ -25852,11 +25939,14 @@ function markChannelAsRead(action) {
|
|
|
25852
25939
|
return effects.call(channel.markAsRead);
|
|
25853
25940
|
case 2:
|
|
25854
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;
|
|
25855
25945
|
updateData = {
|
|
25856
25946
|
unread: false,
|
|
25857
25947
|
newMessageCount: 0,
|
|
25858
25948
|
newMentionCount: 0,
|
|
25859
|
-
lastDisplayedMessageId:
|
|
25949
|
+
lastDisplayedMessageId: nextLastDisplayedMessageId
|
|
25860
25950
|
};
|
|
25861
25951
|
updateChannelOnAllChannels(channel.id, updateData);
|
|
25862
25952
|
_context16.n = 3;
|
|
@@ -27263,7 +27353,7 @@ var _marked$4 = /*#__PURE__*/_regenerator().m(getMembers),
|
|
|
27263
27353
|
_marked4$3 = /*#__PURE__*/_regenerator().m(kickMemberFromChannel),
|
|
27264
27354
|
_marked5$3 = /*#__PURE__*/_regenerator().m(blockMember),
|
|
27265
27355
|
_marked6$3 = /*#__PURE__*/_regenerator().m(changeMemberRole),
|
|
27266
|
-
_marked7$
|
|
27356
|
+
_marked7$3 = /*#__PURE__*/_regenerator().m(reportMember),
|
|
27267
27357
|
_marked8$2 = /*#__PURE__*/_regenerator().m(getRoles),
|
|
27268
27358
|
_marked9$2 = /*#__PURE__*/_regenerator().m(MembersSaga);
|
|
27269
27359
|
function getMembers(action) {
|
|
@@ -27726,7 +27816,7 @@ function reportMember(action) {
|
|
|
27726
27816
|
case 4:
|
|
27727
27817
|
return _context7.a(2);
|
|
27728
27818
|
}
|
|
27729
|
-
}, _marked7$
|
|
27819
|
+
}, _marked7$3, null, [[1, 3]]);
|
|
27730
27820
|
}
|
|
27731
27821
|
function getRoles(action) {
|
|
27732
27822
|
var _action$payload, timeout, attempts, SceytChatClient, roles, _t1;
|
|
@@ -27804,7 +27894,7 @@ var _marked$5 = /*#__PURE__*/_regenerator().m(getContacts),
|
|
|
27804
27894
|
_marked4$4 = /*#__PURE__*/_regenerator().m(updateProfile),
|
|
27805
27895
|
_marked5$4 = /*#__PURE__*/_regenerator().m(getUsers),
|
|
27806
27896
|
_marked6$4 = /*#__PURE__*/_regenerator().m(loadMoreUsers),
|
|
27807
|
-
_marked7$
|
|
27897
|
+
_marked7$4 = /*#__PURE__*/_regenerator().m(MembersSaga$1);
|
|
27808
27898
|
function getContacts() {
|
|
27809
27899
|
var SceytChatClient, contactsData, _t;
|
|
27810
27900
|
return _regenerator().w(function (_context) {
|
|
@@ -28243,7 +28333,7 @@ function MembersSaga$1() {
|
|
|
28243
28333
|
case 6:
|
|
28244
28334
|
return _context7.a(2);
|
|
28245
28335
|
}
|
|
28246
|
-
}, _marked7$
|
|
28336
|
+
}, _marked7$4);
|
|
28247
28337
|
}
|
|
28248
28338
|
|
|
28249
28339
|
var _marked$6 = /*#__PURE__*/_regenerator().m(rootSaga);
|
|
@@ -35919,25 +36009,19 @@ var Message = function Message(_ref) {
|
|
|
35919
36009
|
if (setLastVisibleMessageId) {
|
|
35920
36010
|
setLastVisibleMessageId(message);
|
|
35921
36011
|
}
|
|
35922
|
-
|
|
35923
|
-
dispatch(setVisibleMessageAC(message));
|
|
35924
|
-
}
|
|
36012
|
+
dispatch(setVisibleMessageAC(message));
|
|
35925
36013
|
if (scrollToNewMessage.scrollToBottom && channel.lastMessage && compareMessagesForList(message, channel.lastMessage) >= 0) {
|
|
35926
36014
|
dispatch(scrollToNewMessageAC(false, false, false));
|
|
35927
36015
|
}
|
|
35928
36016
|
} else {
|
|
35929
|
-
|
|
35930
|
-
dispatch(removeVisibleMessageAC(message));
|
|
35931
|
-
}
|
|
36017
|
+
dispatch(removeVisibleMessageAC(message));
|
|
35932
36018
|
}
|
|
35933
|
-
}, [channel.
|
|
36019
|
+
}, [channel.lastMessage, dispatch, isVisible, message, scrollToNewMessage.scrollToBottom, unreadScrollTo, setLastVisibleMessageId]);
|
|
35934
36020
|
React.useEffect(function () {
|
|
35935
36021
|
return function () {
|
|
35936
|
-
|
|
35937
|
-
dispatch(removeVisibleMessageAC(message));
|
|
35938
|
-
}
|
|
36022
|
+
dispatch(removeVisibleMessageAC(message));
|
|
35939
36023
|
};
|
|
35940
|
-
}, [
|
|
36024
|
+
}, [dispatch, message]);
|
|
35941
36025
|
return /*#__PURE__*/React__default.createElement(Container$c, {
|
|
35942
36026
|
id: message.id || message.tid,
|
|
35943
36027
|
ref: messageItemRef,
|
|
@@ -38561,7 +38645,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
38561
38645
|
height: '48px',
|
|
38562
38646
|
downloading: downloadingFile,
|
|
38563
38647
|
file: attachment,
|
|
38564
|
-
src:
|
|
38648
|
+
src: attachment.attachmentUrl || attachmentUrl,
|
|
38565
38649
|
borderRadius: borderRadius,
|
|
38566
38650
|
setVideoIsReadyToSend: setVideoIsReadyToSend,
|
|
38567
38651
|
backgroundColor: backgroundColor && backgroundColor !== 'inherit' ? backgroundColor : overlayBackground2,
|
|
@@ -40450,7 +40534,8 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
40450
40534
|
incomingMessageBackgroundX = _useColor[THEME_COLORS.INCOMING_MESSAGE_BACKGROUND_X],
|
|
40451
40535
|
outgoingMessageBackgroundX = _useColor[THEME_COLORS.OUTGOING_MESSAGE_BACKGROUND_X],
|
|
40452
40536
|
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
|
|
40453
|
-
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY]
|
|
40537
|
+
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
40538
|
+
background = _useColor[THEME_COLORS.BACKGROUND];
|
|
40454
40539
|
var attachment = React.useMemo(function () {
|
|
40455
40540
|
return attachments.find(function (attachment) {
|
|
40456
40541
|
return attachment.type === attachmentTypes.link;
|
|
@@ -40557,7 +40642,8 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
40557
40642
|
onLoad: onImageLoad,
|
|
40558
40643
|
onError: function onError() {
|
|
40559
40644
|
setImageLoadError(true);
|
|
40560
|
-
}
|
|
40645
|
+
},
|
|
40646
|
+
bgColor: background
|
|
40561
40647
|
})))
|
|
40562
40648
|
} : null, {
|
|
40563
40649
|
key: 'title',
|
|
@@ -40682,7 +40768,7 @@ var ImageContainer = styled__default.div(_templateObject2$C || (_templateObject2
|
|
|
40682
40768
|
return maxHeight ? maxHeight + "px" : '240px';
|
|
40683
40769
|
});
|
|
40684
40770
|
var OGText = styled__default.div(_templateObject3$w || (_templateObject3$w = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 0;\n"])));
|
|
40685
|
-
var Title$3 = styled__default.p(_templateObject4$r || (_templateObject4$r = _taggedTemplateLiteralLoose(["\n font-weight: bold;\n font-size: 14px;\n line-height: 18px;\n letter-spacing: 0px;\n color: ", ";\n margin: 4px 0 0 0;\n padding: ", ";\n box-sizing: border-box;\n overflow-wrap: anywhere;\n ", "\n"])), function (_ref0) {
|
|
40771
|
+
var Title$3 = styled__default.p(_templateObject4$r || (_templateObject4$r = _taggedTemplateLiteralLoose(["\n font-weight: bold;\n font-size: 14px;\n line-height: 18px;\n letter-spacing: 0px;\n color: ", ";\n margin: 4px 0 0 0;\n padding: ", ";\n box-sizing: border-box;\n overflow-wrap: anywhere;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n ", "\n"])), function (_ref0) {
|
|
40686
40772
|
var color = _ref0.color;
|
|
40687
40773
|
return color;
|
|
40688
40774
|
}, function (_ref1) {
|
|
@@ -40709,7 +40795,9 @@ var Url = styled__default.p(_templateObject6$j || (_templateObject6$j = _taggedT
|
|
|
40709
40795
|
var maxWidth = _ref15.maxWidth;
|
|
40710
40796
|
return maxWidth && "\n max-width: " + maxWidth + "px;\n ";
|
|
40711
40797
|
});
|
|
40712
|
-
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"])))
|
|
40798
|
+
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) {
|
|
40799
|
+
return props.bgColor;
|
|
40800
|
+
});
|
|
40713
40801
|
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"])));
|
|
40714
40802
|
var OGTextWrapper = styled__default.div(_templateObject9$d || (_templateObject9$d = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n"])));
|
|
40715
40803
|
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"])));
|
|
@@ -43251,14 +43339,18 @@ var Message$1 = function Message(_ref) {
|
|
|
43251
43339
|
dispatch(markMessagesAsDeliveredAC(channel.id, [message.id]));
|
|
43252
43340
|
}
|
|
43253
43341
|
}
|
|
43254
|
-
|
|
43342
|
+
var alreadyRead = !!(message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
|
|
43255
43343
|
return marker.name === MESSAGE_DELIVERY_STATUS.READ;
|
|
43256
|
-
}))
|
|
43344
|
+
}));
|
|
43345
|
+
if (isVisible && message.incoming && !alreadyRead && !disableAutoReadTracking && isTabActive && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
43346
|
+
console.log("[READ_MESSAGE] queuing msgId=" + message.id + " ch=" + channel.id);
|
|
43257
43347
|
if (queueReadMarker) {
|
|
43258
43348
|
queueReadMarker(channel.id, message.id);
|
|
43259
43349
|
} else {
|
|
43260
43350
|
dispatch(markMessagesAsReadAC(channel.id, [message.id]));
|
|
43261
43351
|
}
|
|
43352
|
+
} else if (isVisible && message.incoming && !alreadyRead) {
|
|
43353
|
+
console.log("[READ_MESSAGE] skip msgId=" + message.id, "disabledTracking=" + disableAutoReadTracking + " tabActive=" + isTabActive, "newMsgCount=" + channel.newMessageCount + " conn=" + connectionStatus);
|
|
43262
43354
|
}
|
|
43263
43355
|
}, [dispatch, message.incoming, message.userMarkers, message.id, isVisible, channel.id, channel.newMessageCount, connectionStatus, queueReadMarker, queueDeliveredMarker, disableAutoReadTracking, isTabActive]);
|
|
43264
43356
|
var handleForwardMessage = React.useCallback(function (channelIds) {
|
|
@@ -43303,25 +43395,19 @@ var Message$1 = function Message(_ref) {
|
|
|
43303
43395
|
setLastVisibleMessageId(message);
|
|
43304
43396
|
}
|
|
43305
43397
|
handleSendReadMarker();
|
|
43306
|
-
|
|
43307
|
-
dispatch(setVisibleMessageAC(message));
|
|
43308
|
-
}
|
|
43398
|
+
dispatch(setVisibleMessageAC(message));
|
|
43309
43399
|
if (scrollToNewMessage.scrollToBottom && channel.lastMessage && compareMessagesForList(message, channel.lastMessage) >= 0) {
|
|
43310
43400
|
dispatch(scrollToNewMessageAC(false, false, false));
|
|
43311
43401
|
}
|
|
43312
43402
|
} else {
|
|
43313
|
-
|
|
43314
|
-
dispatch(removeVisibleMessageAC(message));
|
|
43315
|
-
}
|
|
43403
|
+
dispatch(removeVisibleMessageAC(message));
|
|
43316
43404
|
}
|
|
43317
|
-
}, [isVisible, setLastVisibleMessageId, message.id, handleSendReadMarker, channel.
|
|
43405
|
+
}, [isVisible, setLastVisibleMessageId, message.id, handleSendReadMarker, channel.lastMessage, scrollToNewMessage.scrollToBottom, dispatch, message, isTabActive]);
|
|
43318
43406
|
React.useEffect(function () {
|
|
43319
43407
|
return function () {
|
|
43320
|
-
|
|
43321
|
-
dispatch(removeVisibleMessageAC(message));
|
|
43322
|
-
}
|
|
43408
|
+
dispatch(removeVisibleMessageAC(message));
|
|
43323
43409
|
};
|
|
43324
|
-
}, [
|
|
43410
|
+
}, [dispatch, message]);
|
|
43325
43411
|
React.useEffect(function () {
|
|
43326
43412
|
if (!isVisible && infoPopupOpen) {
|
|
43327
43413
|
setInfoPopupOpen(false);
|
|
@@ -44290,6 +44376,7 @@ function useChatController(_ref5) {
|
|
|
44290
44376
|
}, [clearJumpScrollingLock]);
|
|
44291
44377
|
var queueVisibleUnreadCheck = React.useCallback(function () {
|
|
44292
44378
|
if (pendingVisibleUnreadFrameRef.current !== null || unreadScrollTo || !tabIsActive) {
|
|
44379
|
+
console.log("[READ_MESSAGE] queueVisibleUnreadCheck blocked", "pendingRaf=" + (pendingVisibleUnreadFrameRef.current !== null) + " unreadScrollTo=" + unreadScrollTo + " tabActive=" + tabIsActive);
|
|
44293
44380
|
return;
|
|
44294
44381
|
}
|
|
44295
44382
|
pendingVisibleUnreadFrameRef.current = requestAnimationFrame(function () {
|
|
@@ -44300,6 +44387,7 @@ function useChatController(_ref5) {
|
|
|
44300
44387
|
}
|
|
44301
44388
|
var unreadStartIndex = getUnreadTrackingStartIndex(messages);
|
|
44302
44389
|
if (unreadStartIndex < 0) {
|
|
44390
|
+
console.log('[READ_MESSAGE] queueVisibleUnreadCheck: no unread start index, skip');
|
|
44303
44391
|
return;
|
|
44304
44392
|
}
|
|
44305
44393
|
var candidateUnreadMessages = messages.slice(unreadStartIndex);
|
|
@@ -44325,8 +44413,10 @@ function useChatController(_ref5) {
|
|
|
44325
44413
|
return message.id;
|
|
44326
44414
|
});
|
|
44327
44415
|
if (!ids.length || !channel.id || !channel.newMessageCount) {
|
|
44416
|
+
console.log("[READ_MESSAGE] queueVisibleUnreadCheck: nothing to mark ids=" + ids.length + " newMsgCount=" + channel.newMessageCount);
|
|
44328
44417
|
return;
|
|
44329
44418
|
}
|
|
44419
|
+
console.log("[READ_MESSAGE] queueVisibleUnreadCheck: marking ch=" + channel.id + " ids=[" + ids.join(',') + "]");
|
|
44330
44420
|
ids.forEach(function (id) {
|
|
44331
44421
|
visibleUnreadReportedRef.current.add(id);
|
|
44332
44422
|
});
|
|
@@ -45619,9 +45709,7 @@ function useChatController(_ref5) {
|
|
|
45619
45709
|
}
|
|
45620
45710
|
var savedRestoreWindow = channelRestoreWindowMap.get(channel.id);
|
|
45621
45711
|
if (savedRestoreWindow) {
|
|
45622
|
-
|
|
45623
|
-
dispatch(clearVisibleMessagesMapAC());
|
|
45624
|
-
}
|
|
45712
|
+
dispatch(clearVisibleMessagesMapAC());
|
|
45625
45713
|
if (channel.backToLinkedChannel) {
|
|
45626
45714
|
restoreRef.current = {
|
|
45627
45715
|
mode: 'restore-scroll-top',
|
|
@@ -45656,9 +45744,7 @@ function useChatController(_ref5) {
|
|
|
45656
45744
|
}
|
|
45657
45745
|
return;
|
|
45658
45746
|
}
|
|
45659
|
-
|
|
45660
|
-
dispatch(clearVisibleMessagesMapAC());
|
|
45661
|
-
}
|
|
45747
|
+
dispatch(clearVisibleMessagesMapAC());
|
|
45662
45748
|
if (channel.newMessageCount && channel.lastDisplayedMessageId) {
|
|
45663
45749
|
suppressNextMessageChange();
|
|
45664
45750
|
dispatch(loadNearUnreadAC(channel));
|
|
@@ -45666,7 +45752,7 @@ function useChatController(_ref5) {
|
|
|
45666
45752
|
suppressNextMessageChange();
|
|
45667
45753
|
dispatch(loadDefaultMessagesAC(channel));
|
|
45668
45754
|
}
|
|
45669
|
-
}, [dispatch, channel === null || channel === void 0 ? void 0 : channel.id, channel.backToLinkedChannel,
|
|
45755
|
+
}, [dispatch, channel === null || channel === void 0 ? void 0 : channel.id, channel.backToLinkedChannel, suppressNextMessageChange]);
|
|
45670
45756
|
React.useEffect(function () {
|
|
45671
45757
|
if (!(channel !== null && channel !== void 0 && channel.id) || clearedSelectionChannelIdRef.current === channel.id) {
|
|
45672
45758
|
return;
|
|
@@ -45736,6 +45822,16 @@ function useChatController(_ref5) {
|
|
|
45736
45822
|
return m.sortKey === latestLocalRef || m.localRef === latestLocalRef;
|
|
45737
45823
|
});
|
|
45738
45824
|
var shouldShow = !isLatestInView || !isViewingLatest && (pendingNewestCount > 0 || !!scrollToMentionedMessage);
|
|
45825
|
+
console.log('[scrollToNewMsg]', {
|
|
45826
|
+
latestLocalRef: latestLocalRef,
|
|
45827
|
+
isLatestInView: !!isLatestInView,
|
|
45828
|
+
isViewingLatest: isViewingLatest,
|
|
45829
|
+
pendingNewestCount: pendingNewestCount,
|
|
45830
|
+
scrollToMentionedMessage: scrollToMentionedMessage,
|
|
45831
|
+
shouldShow: shouldShow,
|
|
45832
|
+
showScrollToNewMessageButton: showScrollToNewMessageButton,
|
|
45833
|
+
latestVisibleMessages: latestVisibleMessages
|
|
45834
|
+
});
|
|
45739
45835
|
if (showScrollToNewMessageButton !== shouldShow) {
|
|
45740
45836
|
dispatch(showScrollToNewMessageButtonAC(shouldShow));
|
|
45741
45837
|
}
|
|
@@ -45982,7 +46078,9 @@ var createMessageMarkerBatcher = function createMessageMarkerBatcher(_ref) {
|
|
|
45982
46078
|
onFlushDelivered(channelId, Array.from(queue.deliveredIds));
|
|
45983
46079
|
}
|
|
45984
46080
|
if (queue.readIds.size > 0) {
|
|
45985
|
-
|
|
46081
|
+
var ids = Array.from(queue.readIds);
|
|
46082
|
+
console.log("[READ_MESSAGE] flush ch=" + channelId + " ids=[" + ids.join(',') + "]");
|
|
46083
|
+
onFlushRead(channelId, ids);
|
|
45986
46084
|
}
|
|
45987
46085
|
channelQueues["delete"](channelId);
|
|
45988
46086
|
};
|
|
@@ -45999,6 +46097,7 @@ var createMessageMarkerBatcher = function createMessageMarkerBatcher(_ref) {
|
|
|
45999
46097
|
}
|
|
46000
46098
|
var queue = getQueue(channelId);
|
|
46001
46099
|
queue.readIds.add(messageId);
|
|
46100
|
+
console.log("[READ_MESSAGE] enqueue msgId=" + messageId + " ch=" + channelId + " queueSize=" + queue.readIds.size);
|
|
46002
46101
|
scheduleFlush(channelId);
|
|
46003
46102
|
};
|
|
46004
46103
|
var enqueueDelivered = function enqueueDelivered(channelId, messageId) {
|
|
@@ -46235,6 +46334,7 @@ var MessageList = function MessageList(_ref) {
|
|
|
46235
46334
|
markerBatcherRef.current = createMessageMarkerBatcher({
|
|
46236
46335
|
debounceMs: DEFAULT_MARKER_BATCH_DEBOUNCE_MS,
|
|
46237
46336
|
onFlushRead: function onFlushRead(channelId, messageIds) {
|
|
46337
|
+
console.log("[READ_MESSAGE] dispatch markAsRead ch=" + channelId + " ids=[" + messageIds.join(',') + "]");
|
|
46238
46338
|
dispatch(markMessagesAsReadAC(channelId, messageIds));
|
|
46239
46339
|
},
|
|
46240
46340
|
onFlushDelivered: function onFlushDelivered(channelId, messageIds) {
|
|
@@ -46282,6 +46382,7 @@ var MessageList = function MessageList(_ref) {
|
|
|
46282
46382
|
}, [browserTabIsActive]);
|
|
46283
46383
|
var queueReadMarker = React.useCallback(function (channelId, messageId) {
|
|
46284
46384
|
var _markerBatcherRef$cur;
|
|
46385
|
+
console.log("[READ_MESSAGE] queueReadMarker ch=" + channelId + " msgId=" + messageId);
|
|
46285
46386
|
(_markerBatcherRef$cur = markerBatcherRef.current) === null || _markerBatcherRef$cur === void 0 ? void 0 : _markerBatcherRef$cur.enqueueRead(channelId, messageId);
|
|
46286
46387
|
}, []);
|
|
46287
46388
|
var queueDeliveredMarker = React.useCallback(function (channelId, messageId) {
|
|
@@ -46345,6 +46446,7 @@ var MessageList = function MessageList(_ref) {
|
|
|
46345
46446
|
}
|
|
46346
46447
|
if (channel.lastMessage.id && String(channel.lastMessage.user.id) !== currentUserId) {
|
|
46347
46448
|
var _markerBatcherRef$cur5;
|
|
46449
|
+
console.log("[READ_MESSAGE] scrollToBottom enqueue ch=" + channel.id + " msgId=" + channel.lastMessage.id);
|
|
46348
46450
|
(_markerBatcherRef$cur5 = markerBatcherRef.current) === null || _markerBatcherRef$cur5 === void 0 ? void 0 : _markerBatcherRef$cur5.enqueueRead(channel.id, channel.lastMessage.id);
|
|
46349
46451
|
}
|
|
46350
46452
|
jumpToLatest(true);
|
|
@@ -48532,28 +48634,24 @@ function useFormatMessage(editor, editorState, setMessageBodyAttributes, setMess
|
|
|
48532
48634
|
var member = activeChannelMembers.find(function (m) {
|
|
48533
48635
|
return m.id === segment.mentionUserId;
|
|
48534
48636
|
});
|
|
48535
|
-
|
|
48536
|
-
|
|
48537
|
-
|
|
48538
|
-
|
|
48539
|
-
|
|
48540
|
-
|
|
48541
|
-
|
|
48542
|
-
|
|
48543
|
-
|
|
48544
|
-
|
|
48545
|
-
var textNode = lexical.$createTextNode(segment.text);
|
|
48546
|
-
if (segment.format > 0) {
|
|
48547
|
-
textNode.setFormat(segment.format);
|
|
48548
|
-
}
|
|
48549
|
-
nodes.push(textNode);
|
|
48637
|
+
var mentionData = member ? _extends({}, member, {
|
|
48638
|
+
name: segment.text
|
|
48639
|
+
}) : {
|
|
48640
|
+
id: segment.mentionUserId,
|
|
48641
|
+
name: segment.text
|
|
48642
|
+
};
|
|
48643
|
+
setMentionedMember(mentionData);
|
|
48644
|
+
var mentionNode = $createMentionNode(mentionData);
|
|
48645
|
+
if (segment.format > 0) {
|
|
48646
|
+
mentionNode.setFormat(segment.format);
|
|
48550
48647
|
}
|
|
48648
|
+
nodes.push(mentionNode);
|
|
48551
48649
|
} else {
|
|
48552
|
-
var
|
|
48650
|
+
var textNode = lexical.$createTextNode(segment.text);
|
|
48553
48651
|
if (segment.format > 0) {
|
|
48554
|
-
|
|
48652
|
+
textNode.setFormat(segment.format);
|
|
48555
48653
|
}
|
|
48556
|
-
nodes.push(
|
|
48654
|
+
nodes.push(textNode);
|
|
48557
48655
|
}
|
|
48558
48656
|
});
|
|
48559
48657
|
if (nodes.length > 0) {
|