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