sceyt-chat-react-uikit 1.7.6-beta.4 → 1.7.6-beta.6
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/Message/OGMetadata/index.d.ts +2 -2
- package/index.js +450 -366
- package/index.modern.js +450 -366
- package/package.json +1 -1
package/index.modern.js
CHANGED
|
@@ -11219,7 +11219,16 @@ var messageSlice = createSlice({
|
|
|
11219
11219
|
markersMap = _action$payload2.markersMap;
|
|
11220
11220
|
var markerName = name;
|
|
11221
11221
|
for (var index = 0; index < state.activeChannelMessages.length; index++) {
|
|
11222
|
-
if (
|
|
11222
|
+
if (markerName === MESSAGE_DELIVERY_STATUS.DELIVERED && (state.activeChannelMessages[index].deliveryStatus === MESSAGE_DELIVERY_STATUS.DELIVERED || state.activeChannelMessages[index].deliveryStatus === MESSAGE_DELIVERY_STATUS.READ || state.activeChannelMessages[index].deliveryStatus === MESSAGE_DELIVERY_STATUS.PLAYED)) {
|
|
11223
|
+
continue;
|
|
11224
|
+
}
|
|
11225
|
+
if (markerName === MESSAGE_DELIVERY_STATUS.READ && (state.activeChannelMessages[index].deliveryStatus === MESSAGE_DELIVERY_STATUS.READ || state.activeChannelMessages[index].deliveryStatus === MESSAGE_DELIVERY_STATUS.PLAYED)) {
|
|
11226
|
+
continue;
|
|
11227
|
+
}
|
|
11228
|
+
if (markerName === MESSAGE_DELIVERY_STATUS.PLAYED && state.activeChannelMessages[index].deliveryStatus === MESSAGE_DELIVERY_STATUS.PLAYED) {
|
|
11229
|
+
continue;
|
|
11230
|
+
}
|
|
11231
|
+
if (markersMap[state.activeChannelMessages[index].id] && state.activeChannelMessages[index].state !== 'Deleted') {
|
|
11223
11232
|
state.activeChannelMessages[index].deliveryStatus = markerName;
|
|
11224
11233
|
}
|
|
11225
11234
|
}
|
|
@@ -14408,7 +14417,7 @@ function watchForEvents() {
|
|
|
14408
14417
|
};
|
|
14409
14418
|
});
|
|
14410
14419
|
_loop = /*#__PURE__*/_regenerator().m(function _callee2() {
|
|
14411
|
-
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, activeChannelMessages, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _pollDetailsData$chan, _pollDetailsData$chan2, _channel1, pollDetails, messageId, pollDetailsData, _activeChannelId0, addedVotes, deletedVotes, objs,
|
|
14420
|
+
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, activeChannelMessages, _loop2, _iterator, _step, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _pollDetailsData$chan, _pollDetailsData$chan2, _channel1, pollDetails, messageId, pollDetailsData, _activeChannelId0, addedVotes, deletedVotes, objs, _iterator2, _step2, vote, _iterator3, _step3, _vote, _i, _objs, obj, _store$getState$Messa, key, hasNext, _i2, _objs2, _obj, _pollDetailsData$chan3, _channel10, _pollDetails, _messageId, _pollDetailsData, _activeChannelId1, _deletedVotes, _objs3, _iterator4, _step4, _vote2, _i3, _objs4, _obj2, _i4, _objs5, _obj3, _pollDetailsData2$cha, _channel11, _pollDetails2, _messageId2, _activeChannelId10, _pollDetailsData2, retractedVotes, _objs6, _iterator5, _step5, _vote4, _i5, _objs7, _obj4, _iterator6, _step6, _vote3, _channel12, _messageId3, _activeChannelId11, _obj5, _channel13, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId12, _channelUpdateParams, _channel14, _updatedChannel, _channel15, _activeChannelId13, channelExist, _channel16, _channel17, _channel18, _channel19, _channel20, _channel21, _channel22, _groupName5, _channel23, _groupName6, _channel24, members, _activeChannelId14, i, _channel25, _channel26, _channelId2, from, name, status, _t, _t2;
|
|
14412
14421
|
return _regenerator().w(function (_context2) {
|
|
14413
14422
|
while (1) switch (_context2.p = _context2.n) {
|
|
14414
14423
|
case 0:
|
|
@@ -14420,7 +14429,7 @@ function watchForEvents() {
|
|
|
14420
14429
|
type = _yield$take.type;
|
|
14421
14430
|
args = _yield$take.args;
|
|
14422
14431
|
_t = type;
|
|
14423
|
-
_context2.n = _t === CHANNEL_EVENT_TYPES.CREATE ? 2 : _t === CHANNEL_EVENT_TYPES.JOIN ? 7 : _t === CHANNEL_EVENT_TYPES.LEAVE ? 9 : _t === CHANNEL_EVENT_TYPES.BLOCK ? 22 : _t === CHANNEL_EVENT_TYPES.UNBLOCK ? 24 : _t === CHANNEL_EVENT_TYPES.KICK_MEMBERS ? 25 : _t === CHANNEL_EVENT_TYPES.ADD_MEMBERS ? 36 : _t === CHANNEL_EVENT_TYPES.UPDATE_CHANNEL ? 46 : _t === CHANNEL_EVENT_TYPES.MESSAGE ? 51 : _t === CHANNEL_EVENT_TYPES.MESSAGE_MARKERS_RECEIVED ? 68 : _t === CHANNEL_EVENT_TYPES.DELETE ?
|
|
14432
|
+
_context2.n = _t === CHANNEL_EVENT_TYPES.CREATE ? 2 : _t === CHANNEL_EVENT_TYPES.JOIN ? 7 : _t === CHANNEL_EVENT_TYPES.LEAVE ? 9 : _t === CHANNEL_EVENT_TYPES.BLOCK ? 22 : _t === CHANNEL_EVENT_TYPES.UNBLOCK ? 24 : _t === CHANNEL_EVENT_TYPES.KICK_MEMBERS ? 25 : _t === CHANNEL_EVENT_TYPES.ADD_MEMBERS ? 36 : _t === CHANNEL_EVENT_TYPES.UPDATE_CHANNEL ? 46 : _t === CHANNEL_EVENT_TYPES.MESSAGE ? 51 : _t === CHANNEL_EVENT_TYPES.MESSAGE_MARKERS_RECEIVED ? 68 : _t === CHANNEL_EVENT_TYPES.DELETE ? 78 : _t === CHANNEL_EVENT_TYPES.DELETE_MESSAGE ? 80 : _t === CHANNEL_EVENT_TYPES.EDIT_MESSAGE ? 85 : _t === CHANNEL_EVENT_TYPES.REACTION_ADDED ? 90 : _t === CHANNEL_EVENT_TYPES.POLL_ADDED ? 98 : _t === CHANNEL_EVENT_TYPES.POLL_DELETED ? 108 : _t === CHANNEL_EVENT_TYPES.POLL_RETRACTED ? 116 : _t === CHANNEL_EVENT_TYPES.POLL_CLOSED ? 124 : _t === CHANNEL_EVENT_TYPES.REACTION_DELETED ? 128 : _t === CHANNEL_EVENT_TYPES.UNREAD_MESSAGES_INFO ? 133 : _t === CHANNEL_EVENT_TYPES.CLEAR_HISTORY ? 136 : _t === CHANNEL_EVENT_TYPES.MUTE ? 142 : _t === CHANNEL_EVENT_TYPES.UNMUTE ? 144 : _t === CHANNEL_EVENT_TYPES.PINED ? 146 : _t === CHANNEL_EVENT_TYPES.UNPINED ? 148 : _t === CHANNEL_EVENT_TYPES.HIDE ? 150 : _t === CHANNEL_EVENT_TYPES.UNHIDE ? 152 : _t === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_UNREAD ? 154 : _t === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_READ ? 157 : _t === CHANNEL_EVENT_TYPES.CHANGE_ROLE ? 160 : _t === CHANNEL_EVENT_TYPES.FROZEN ? 167 : _t === CHANNEL_EVENT_TYPES.UNFROZEN ? 168 : _t === CHANNEL_EVENT_TYPES.CHANNEL_EVENT ? 169 : _t === CONNECTION_EVENT_TYPES.CONNECTION_STATUS_CHANGED ? 178 : 181;
|
|
14424
14433
|
break;
|
|
14425
14434
|
case 2:
|
|
14426
14435
|
createdChannel = args.createdChannel;
|
|
@@ -14454,7 +14463,7 @@ function watchForEvents() {
|
|
|
14454
14463
|
addChannelToAllChannels(createdChannel);
|
|
14455
14464
|
}
|
|
14456
14465
|
case 6:
|
|
14457
|
-
return _context2.a(3,
|
|
14466
|
+
return _context2.a(3, 182);
|
|
14458
14467
|
case 7:
|
|
14459
14468
|
channel = args.channel;
|
|
14460
14469
|
log.info('channel JOIN ... . ', channel);
|
|
@@ -14465,7 +14474,7 @@ function watchForEvents() {
|
|
|
14465
14474
|
if (!_chan2) {
|
|
14466
14475
|
addChannelToAllChannels(channel);
|
|
14467
14476
|
}
|
|
14468
|
-
return _context2.a(3,
|
|
14477
|
+
return _context2.a(3, 182);
|
|
14469
14478
|
case 9:
|
|
14470
14479
|
_channel = args.channel, member = args.member;
|
|
14471
14480
|
log.info('channel LEAVE ... ', _channel, member);
|
|
@@ -14533,7 +14542,7 @@ function watchForEvents() {
|
|
|
14533
14542
|
mutedTill: _channel.mutedTill
|
|
14534
14543
|
});
|
|
14535
14544
|
case 21:
|
|
14536
|
-
return _context2.a(3,
|
|
14545
|
+
return _context2.a(3, 182);
|
|
14537
14546
|
case 22:
|
|
14538
14547
|
log.info('channel BLOCK ... ');
|
|
14539
14548
|
_channel2 = args.channel;
|
|
@@ -14545,10 +14554,10 @@ function watchForEvents() {
|
|
|
14545
14554
|
_context2.n = 23;
|
|
14546
14555
|
return put(removeChannelAC(_channel2.id));
|
|
14547
14556
|
case 23:
|
|
14548
|
-
return _context2.a(3,
|
|
14557
|
+
return _context2.a(3, 182);
|
|
14549
14558
|
case 24:
|
|
14550
14559
|
log.info('channel UNBLOCK ... ');
|
|
14551
|
-
return _context2.a(3,
|
|
14560
|
+
return _context2.a(3, 182);
|
|
14552
14561
|
case 25:
|
|
14553
14562
|
_channel3 = args.channel, removedMembers = args.removedMembers;
|
|
14554
14563
|
log.info('channel KICK_MEMBERS ... ', removedMembers);
|
|
@@ -14618,7 +14627,7 @@ function watchForEvents() {
|
|
|
14618
14627
|
muted: _channel3.muted,
|
|
14619
14628
|
mutedTill: _channel3.mutedTill
|
|
14620
14629
|
});
|
|
14621
|
-
return _context2.a(3,
|
|
14630
|
+
return _context2.a(3, 182);
|
|
14622
14631
|
case 36:
|
|
14623
14632
|
_channel4 = args.channel, addedMembers = args.addedMembers;
|
|
14624
14633
|
log.info('channel ADD_MEMBERS ... ', addedMembers);
|
|
@@ -14673,7 +14682,7 @@ function watchForEvents() {
|
|
|
14673
14682
|
muted: _channel4.muted,
|
|
14674
14683
|
mutedTill: _channel4.mutedTill
|
|
14675
14684
|
});
|
|
14676
|
-
return _context2.a(3,
|
|
14685
|
+
return _context2.a(3, 182);
|
|
14677
14686
|
case 46:
|
|
14678
14687
|
log.info('channel UPDATE_CHANNEL ... ');
|
|
14679
14688
|
updatedChannel = args.updatedChannel;
|
|
@@ -14720,7 +14729,7 @@ function watchForEvents() {
|
|
|
14720
14729
|
mutedTill: mutedTill,
|
|
14721
14730
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
14722
14731
|
});
|
|
14723
|
-
return _context2.a(3,
|
|
14732
|
+
return _context2.a(3, 182);
|
|
14724
14733
|
case 51:
|
|
14725
14734
|
_channel5 = args.channel, message = args.message;
|
|
14726
14735
|
log.info('channel MESSAGE ... id : ', message.id, ', channel.id: ', _channel5.id);
|
|
@@ -14885,7 +14894,7 @@ function watchForEvents() {
|
|
|
14885
14894
|
});
|
|
14886
14895
|
updateChannelLastMessageOnAllChannels(_channel5.id, _channel5.lastMessage);
|
|
14887
14896
|
case 67:
|
|
14888
|
-
return _context2.a(3,
|
|
14897
|
+
return _context2.a(3, 182);
|
|
14889
14898
|
case 68:
|
|
14890
14899
|
channelId = args.channelId, markerList = args.markerList;
|
|
14891
14900
|
_context2.n = 69;
|
|
@@ -14894,7 +14903,7 @@ function watchForEvents() {
|
|
|
14894
14903
|
_channel6 = _context2.v;
|
|
14895
14904
|
log.info('channel MESSAGE_MARKERS_RECEIVED ... channel: ', _channel6, 'markers list: ', markerList);
|
|
14896
14905
|
if (!_channel6) {
|
|
14897
|
-
_context2.n =
|
|
14906
|
+
_context2.n = 77;
|
|
14898
14907
|
break;
|
|
14899
14908
|
}
|
|
14900
14909
|
_context2.n = 70;
|
|
@@ -14904,11 +14913,12 @@ function watchForEvents() {
|
|
|
14904
14913
|
updateLastMessage = false;
|
|
14905
14914
|
markersMap = {};
|
|
14906
14915
|
activeChannelMessages = getMessagesFromMap(_activeChannelId6);
|
|
14907
|
-
|
|
14908
|
-
var isPendingMessage;
|
|
14916
|
+
_loop2 = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
14917
|
+
var messageId, isPendingMessage;
|
|
14909
14918
|
return _regenerator().w(function (_context) {
|
|
14910
14919
|
while (1) switch (_context.n) {
|
|
14911
14920
|
case 0:
|
|
14921
|
+
messageId = _step.value;
|
|
14912
14922
|
if (!(activeChannelMessages !== null && activeChannelMessages !== void 0 && activeChannelMessages.find(function (message) {
|
|
14913
14923
|
return message.id === messageId;
|
|
14914
14924
|
}))) {
|
|
@@ -14942,100 +14952,111 @@ function watchForEvents() {
|
|
|
14942
14952
|
return _context.a(2);
|
|
14943
14953
|
}
|
|
14944
14954
|
}, _callee);
|
|
14945
|
-
})
|
|
14955
|
+
});
|
|
14956
|
+
_iterator = _createForOfIteratorHelperLoose(markerList.messageIds);
|
|
14957
|
+
case 71:
|
|
14958
|
+
if ((_step = _iterator()).done) {
|
|
14959
|
+
_context2.n = 73;
|
|
14960
|
+
break;
|
|
14961
|
+
}
|
|
14962
|
+
return _context2.d(_regeneratorValues(_loop2()), 72);
|
|
14963
|
+
case 72:
|
|
14964
|
+
_context2.n = 71;
|
|
14965
|
+
break;
|
|
14966
|
+
case 73:
|
|
14946
14967
|
if (!updateLastMessage) {
|
|
14947
|
-
_context2.n =
|
|
14968
|
+
_context2.n = 74;
|
|
14948
14969
|
break;
|
|
14949
14970
|
}
|
|
14950
14971
|
lastMessage = _extends({}, _channel6.lastMessage, {
|
|
14951
14972
|
deliveryStatus: markerList.name
|
|
14952
14973
|
});
|
|
14953
14974
|
updateChannelLastMessageOnAllChannels(_channel6.id, lastMessage);
|
|
14954
|
-
_context2.n =
|
|
14975
|
+
_context2.n = 74;
|
|
14955
14976
|
return put(updateChannelLastMessageStatusAC(lastMessage, _channel6));
|
|
14956
|
-
case
|
|
14977
|
+
case 74:
|
|
14957
14978
|
if (!(_activeChannelId6 === channelId)) {
|
|
14958
|
-
_context2.n =
|
|
14979
|
+
_context2.n = 76;
|
|
14959
14980
|
break;
|
|
14960
14981
|
}
|
|
14961
|
-
_context2.n =
|
|
14982
|
+
_context2.n = 75;
|
|
14962
14983
|
return put(updateMessagesStatusAC(markerList.name, markersMap));
|
|
14963
|
-
case
|
|
14984
|
+
case 75:
|
|
14964
14985
|
updateMarkersOnAllMessages(markersMap, markerList.name);
|
|
14965
|
-
case
|
|
14986
|
+
case 76:
|
|
14966
14987
|
updateMessageStatusOnMap(_channel6.id, {
|
|
14967
14988
|
name: markerList.name,
|
|
14968
14989
|
markersMap: markersMap
|
|
14969
14990
|
});
|
|
14970
|
-
_context2.n =
|
|
14991
|
+
_context2.n = 77;
|
|
14971
14992
|
return put(updateMessagesMarkersAC(channelId, markerList.name, markerList));
|
|
14972
|
-
case
|
|
14973
|
-
return _context2.a(3,
|
|
14974
|
-
case
|
|
14993
|
+
case 77:
|
|
14994
|
+
return _context2.a(3, 182);
|
|
14995
|
+
case 78:
|
|
14975
14996
|
_channelId = args.channelId;
|
|
14976
14997
|
log.info('channel DELETE ... ');
|
|
14977
14998
|
_channel7 = getChannelFromMap(_channelId);
|
|
14978
|
-
_context2.n =
|
|
14999
|
+
_context2.n = 79;
|
|
14979
15000
|
return put(setChannelToRemoveAC(_channel7));
|
|
14980
|
-
case
|
|
15001
|
+
case 79:
|
|
14981
15002
|
deleteChannelFromAllChannels(_channelId);
|
|
14982
|
-
return _context2.a(3,
|
|
14983
|
-
case
|
|
15003
|
+
return _context2.a(3, 182);
|
|
15004
|
+
case 80:
|
|
14984
15005
|
_channel8 = args.channel, deletedMessage = args.deletedMessage;
|
|
14985
|
-
_context2.n =
|
|
15006
|
+
_context2.n = 81;
|
|
14986
15007
|
return call(getActiveChannelId);
|
|
14987
|
-
case
|
|
15008
|
+
case 81:
|
|
14988
15009
|
_activeChannelId7 = _context2.v;
|
|
14989
15010
|
log.info('channel DELETE_MESSAGE ... ');
|
|
14990
15011
|
_channelExists7 = checkChannelExists(_channel8.id);
|
|
14991
15012
|
if (!(_channel8.id === _activeChannelId7)) {
|
|
14992
|
-
_context2.n =
|
|
15013
|
+
_context2.n = 82;
|
|
14993
15014
|
break;
|
|
14994
15015
|
}
|
|
14995
15016
|
updateMessageOnAllMessages(deletedMessage.id, deletedMessage);
|
|
14996
|
-
_context2.n =
|
|
15017
|
+
_context2.n = 82;
|
|
14997
15018
|
return put(updateMessageAC(deletedMessage.id, deletedMessage));
|
|
14998
|
-
case
|
|
15019
|
+
case 82:
|
|
14999
15020
|
updateMessageOnMap(_channel8.id, {
|
|
15000
15021
|
messageId: deletedMessage.id,
|
|
15001
15022
|
params: deletedMessage
|
|
15002
15023
|
});
|
|
15003
15024
|
if (!_channelExists7) {
|
|
15004
|
-
_context2.n =
|
|
15025
|
+
_context2.n = 84;
|
|
15005
15026
|
break;
|
|
15006
15027
|
}
|
|
15007
|
-
_context2.n =
|
|
15028
|
+
_context2.n = 83;
|
|
15008
15029
|
return put(updateChannelDataAC(_channel8.id, {
|
|
15009
15030
|
newMessageCount: _channel8.newMessageCount,
|
|
15010
15031
|
muted: _channel8.muted,
|
|
15011
15032
|
mutedTill: _channel8.mutedTill
|
|
15012
15033
|
}));
|
|
15013
|
-
case
|
|
15034
|
+
case 83:
|
|
15014
15035
|
if (!(_channel8.lastMessage.id === deletedMessage.id)) {
|
|
15015
|
-
_context2.n =
|
|
15036
|
+
_context2.n = 84;
|
|
15016
15037
|
break;
|
|
15017
15038
|
}
|
|
15018
|
-
_context2.n =
|
|
15039
|
+
_context2.n = 84;
|
|
15019
15040
|
return put(updateChannelLastMessageAC(deletedMessage, _channel8));
|
|
15020
|
-
case
|
|
15041
|
+
case 84:
|
|
15021
15042
|
updateChannelOnAllChannels(_channel8.id, {
|
|
15022
15043
|
newMessageCount: _channel8.newMessageCount,
|
|
15023
15044
|
muted: _channel8.muted,
|
|
15024
15045
|
mutedTill: _channel8.mutedTill
|
|
15025
15046
|
}, deletedMessage);
|
|
15026
|
-
return _context2.a(3,
|
|
15027
|
-
case
|
|
15047
|
+
return _context2.a(3, 182);
|
|
15048
|
+
case 85:
|
|
15028
15049
|
_channel9 = args.channel, _message = args.message;
|
|
15029
|
-
_context2.n =
|
|
15050
|
+
_context2.n = 86;
|
|
15030
15051
|
return call(getActiveChannelId);
|
|
15031
|
-
case
|
|
15052
|
+
case 86:
|
|
15032
15053
|
_activeChannelId8 = _context2.v;
|
|
15033
15054
|
_channelExists8 = checkChannelExists(_channel9.id);
|
|
15034
15055
|
if (!(_channel9.id === _activeChannelId8)) {
|
|
15035
|
-
_context2.n =
|
|
15056
|
+
_context2.n = 88;
|
|
15036
15057
|
break;
|
|
15037
15058
|
}
|
|
15038
|
-
_context2.n =
|
|
15059
|
+
_context2.n = 87;
|
|
15039
15060
|
return put(updateMessageAC(_message.id, {
|
|
15040
15061
|
body: _message.body,
|
|
15041
15062
|
state: _message.state,
|
|
@@ -15044,7 +15065,7 @@ function watchForEvents() {
|
|
|
15044
15065
|
mentionedUsers: _message.mentionedUsers,
|
|
15045
15066
|
updatedAt: _message.updatedAt
|
|
15046
15067
|
}));
|
|
15047
|
-
case
|
|
15068
|
+
case 87:
|
|
15048
15069
|
updateMessageOnAllMessages(_message.id, {
|
|
15049
15070
|
body: _message.body,
|
|
15050
15071
|
state: _message.state,
|
|
@@ -15053,18 +15074,18 @@ function watchForEvents() {
|
|
|
15053
15074
|
mentionedUsers: _message.mentionedUsers,
|
|
15054
15075
|
updatedAt: _message.updatedAt
|
|
15055
15076
|
});
|
|
15056
|
-
case
|
|
15077
|
+
case 88:
|
|
15057
15078
|
if (!_channelExists8) {
|
|
15058
|
-
_context2.n =
|
|
15079
|
+
_context2.n = 89;
|
|
15059
15080
|
break;
|
|
15060
15081
|
}
|
|
15061
15082
|
if (!(_channel9.lastMessage.id === _message.id)) {
|
|
15062
|
-
_context2.n =
|
|
15083
|
+
_context2.n = 89;
|
|
15063
15084
|
break;
|
|
15064
15085
|
}
|
|
15065
|
-
_context2.n =
|
|
15086
|
+
_context2.n = 89;
|
|
15066
15087
|
return put(updateChannelLastMessageAC(_message, _channel9));
|
|
15067
|
-
case
|
|
15088
|
+
case 89:
|
|
15068
15089
|
if (checkChannelExistsOnMessagesMap(_channel9.id)) {
|
|
15069
15090
|
updateMessageOnMap(_channel9.id, {
|
|
15070
15091
|
messageId: _message.id,
|
|
@@ -15072,38 +15093,38 @@ function watchForEvents() {
|
|
|
15072
15093
|
});
|
|
15073
15094
|
}
|
|
15074
15095
|
updateChannelOnAllChannels(_channel9.id, {}, _message);
|
|
15075
|
-
return _context2.a(3,
|
|
15076
|
-
case
|
|
15096
|
+
return _context2.a(3, 182);
|
|
15097
|
+
case 90:
|
|
15077
15098
|
_channel0 = args.channel, user = args.user, _message2 = args.message, reaction = args.reaction;
|
|
15078
15099
|
isSelf = user.id === SceytChatClient.user.id;
|
|
15079
|
-
_context2.n =
|
|
15100
|
+
_context2.n = 91;
|
|
15080
15101
|
return call(getActiveChannelId);
|
|
15081
|
-
case
|
|
15102
|
+
case 91:
|
|
15082
15103
|
_activeChannelId9 = _context2.v;
|
|
15083
15104
|
if (!(_channel0.id === _activeChannelId9)) {
|
|
15084
|
-
_context2.n =
|
|
15105
|
+
_context2.n = 93;
|
|
15085
15106
|
break;
|
|
15086
15107
|
}
|
|
15087
|
-
_context2.n =
|
|
15108
|
+
_context2.n = 92;
|
|
15088
15109
|
return put(addReactionToMessageAC(_message2, reaction, isSelf));
|
|
15089
|
-
case
|
|
15110
|
+
case 92:
|
|
15090
15111
|
addReactionOnAllMessages(_message2, reaction, true);
|
|
15091
|
-
case
|
|
15112
|
+
case 93:
|
|
15092
15113
|
if (!(_message2.user.id === SceytChatClient.user.id)) {
|
|
15093
|
-
_context2.n =
|
|
15114
|
+
_context2.n = 97;
|
|
15094
15115
|
break;
|
|
15095
15116
|
}
|
|
15096
15117
|
if (!(!isSelf && Notification.permission === 'granted')) {
|
|
15097
|
-
_context2.n =
|
|
15118
|
+
_context2.n = 95;
|
|
15098
15119
|
break;
|
|
15099
15120
|
}
|
|
15100
15121
|
if (!(document.visibilityState !== 'visible' || _channel0.id !== _activeChannelId9)) {
|
|
15101
|
-
_context2.n =
|
|
15122
|
+
_context2.n = 95;
|
|
15102
15123
|
break;
|
|
15103
15124
|
}
|
|
15104
|
-
_context2.n =
|
|
15125
|
+
_context2.n = 94;
|
|
15105
15126
|
return select(contactsMapSelector);
|
|
15106
|
-
case
|
|
15127
|
+
case 94:
|
|
15107
15128
|
_contactsMap = _context2.v;
|
|
15108
15129
|
_getFromContacts2 = getShowOnlyContactUsers();
|
|
15109
15130
|
_state = store.getState();
|
|
@@ -15123,9 +15144,9 @@ function watchForEvents() {
|
|
|
15123
15144
|
setNotification(_messageBody, reaction.user, _channel0, reaction.key, _message2.attachments && _message2.attachments.length ? _message2.attachments.find(function (att) {
|
|
15124
15145
|
return att.type !== attachmentTypes.link;
|
|
15125
15146
|
}) : undefined);
|
|
15126
|
-
case
|
|
15147
|
+
case 95:
|
|
15127
15148
|
if (!(_channel0.newReactions && _channel0.newReactions.length)) {
|
|
15128
|
-
_context2.n =
|
|
15149
|
+
_context2.n = 96;
|
|
15129
15150
|
break;
|
|
15130
15151
|
}
|
|
15131
15152
|
channelUpdateParams = {
|
|
@@ -15135,9 +15156,9 @@ function watchForEvents() {
|
|
|
15135
15156
|
muted: _channel0.muted,
|
|
15136
15157
|
mutedTill: _channel0.mutedTill
|
|
15137
15158
|
};
|
|
15138
|
-
_context2.n =
|
|
15159
|
+
_context2.n = 96;
|
|
15139
15160
|
return put(updateChannelDataAC(_channel0.id, channelUpdateParams));
|
|
15140
|
-
case
|
|
15161
|
+
case 96:
|
|
15141
15162
|
updateChannelOnAllChannels(_channel0.id, {
|
|
15142
15163
|
userMessageReactions: _channel0.newReactions,
|
|
15143
15164
|
lastReactedMessage: _message2,
|
|
@@ -15145,31 +15166,31 @@ function watchForEvents() {
|
|
|
15145
15166
|
muted: _channel0.muted,
|
|
15146
15167
|
mutedTill: _channel0.mutedTill
|
|
15147
15168
|
});
|
|
15148
|
-
case
|
|
15169
|
+
case 97:
|
|
15149
15170
|
if (checkChannelExistsOnMessagesMap(_channel0.id)) {
|
|
15150
15171
|
addReactionToMessageOnMap(_channel0.id, _message2, reaction, true);
|
|
15151
15172
|
}
|
|
15152
|
-
return _context2.a(3,
|
|
15153
|
-
case
|
|
15173
|
+
return _context2.a(3, 182);
|
|
15174
|
+
case 98:
|
|
15154
15175
|
_channel1 = args.channel, pollDetails = args.pollDetails, messageId = args.messageId;
|
|
15155
15176
|
pollDetailsData = pollDetails;
|
|
15156
|
-
_context2.n =
|
|
15177
|
+
_context2.n = 99;
|
|
15157
15178
|
return call(getActiveChannelId);
|
|
15158
|
-
case
|
|
15179
|
+
case 99:
|
|
15159
15180
|
_activeChannelId0 = _context2.v;
|
|
15160
15181
|
addedVotes = (pollDetailsData === null || pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan = pollDetailsData.changedVotes) === null || _pollDetailsData$chan === void 0 ? void 0 : _pollDetailsData$chan.addedVotes) || [];
|
|
15161
15182
|
deletedVotes = (pollDetailsData === null || pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan2 = pollDetailsData.changedVotes) === null || _pollDetailsData$chan2 === void 0 ? void 0 : _pollDetailsData$chan2.removedVotes) || [];
|
|
15162
15183
|
objs = [];
|
|
15163
|
-
for (
|
|
15164
|
-
vote =
|
|
15184
|
+
for (_iterator2 = _createForOfIteratorHelperLoose(deletedVotes); !(_step2 = _iterator2()).done;) {
|
|
15185
|
+
vote = _step2.value;
|
|
15165
15186
|
objs.push({
|
|
15166
15187
|
type: vote.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15167
15188
|
vote: vote,
|
|
15168
15189
|
incrementVotesPerOptionCount: -((deletedVotes === null || deletedVotes === void 0 ? void 0 : deletedVotes.length) || 0)
|
|
15169
15190
|
});
|
|
15170
15191
|
}
|
|
15171
|
-
for (
|
|
15172
|
-
_vote =
|
|
15192
|
+
for (_iterator3 = _createForOfIteratorHelperLoose(addedVotes); !(_step3 = _iterator3()).done;) {
|
|
15193
|
+
_vote = _step3.value;
|
|
15173
15194
|
objs.push({
|
|
15174
15195
|
type: _vote.user.id === SceytChatClient.user.id ? 'addOwn' : 'add',
|
|
15175
15196
|
vote: _vote,
|
|
@@ -15177,39 +15198,39 @@ function watchForEvents() {
|
|
|
15177
15198
|
});
|
|
15178
15199
|
}
|
|
15179
15200
|
_i = 0, _objs = objs;
|
|
15180
|
-
case
|
|
15201
|
+
case 100:
|
|
15181
15202
|
if (!(_i < _objs.length)) {
|
|
15182
|
-
_context2.n =
|
|
15203
|
+
_context2.n = 104;
|
|
15183
15204
|
break;
|
|
15184
15205
|
}
|
|
15185
15206
|
obj = _objs[_i];
|
|
15186
15207
|
if (!(pollDetailsData !== null && pollDetailsData !== void 0 && pollDetailsData.id && obj.vote)) {
|
|
15187
|
-
_context2.n =
|
|
15208
|
+
_context2.n = 103;
|
|
15188
15209
|
break;
|
|
15189
15210
|
}
|
|
15190
15211
|
key = pollDetailsData.id + "_" + obj.vote.optionId;
|
|
15191
15212
|
hasNext = ((_store$getState$Messa = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa === void 0 ? void 0 : _store$getState$Messa[key]) || false;
|
|
15192
15213
|
if (!(obj.type === 'addOwn')) {
|
|
15193
|
-
_context2.n =
|
|
15214
|
+
_context2.n = 102;
|
|
15194
15215
|
break;
|
|
15195
15216
|
}
|
|
15196
|
-
_context2.n =
|
|
15217
|
+
_context2.n = 101;
|
|
15197
15218
|
return put(addPollVotesToListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote], hasNext, undefined));
|
|
15198
|
-
case
|
|
15199
|
-
_context2.n =
|
|
15219
|
+
case 101:
|
|
15220
|
+
_context2.n = 103;
|
|
15200
15221
|
break;
|
|
15201
|
-
case
|
|
15202
|
-
_context2.n =
|
|
15222
|
+
case 102:
|
|
15223
|
+
_context2.n = 103;
|
|
15203
15224
|
return put(deletePollVotesFromListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote], messageId));
|
|
15204
|
-
case
|
|
15225
|
+
case 103:
|
|
15205
15226
|
_i++;
|
|
15206
|
-
_context2.n =
|
|
15227
|
+
_context2.n = 100;
|
|
15207
15228
|
break;
|
|
15208
|
-
case
|
|
15229
|
+
case 104:
|
|
15209
15230
|
_i2 = 0, _objs2 = objs;
|
|
15210
|
-
case
|
|
15231
|
+
case 105:
|
|
15211
15232
|
if (!(_i2 < _objs2.length)) {
|
|
15212
|
-
_context2.n =
|
|
15233
|
+
_context2.n = 107;
|
|
15213
15234
|
break;
|
|
15214
15235
|
}
|
|
15215
15236
|
_obj = _objs2[_i2];
|
|
@@ -15222,29 +15243,29 @@ function watchForEvents() {
|
|
|
15222
15243
|
incrementVotesPerOptionCount: _obj.incrementVotesPerOptionCount
|
|
15223
15244
|
});
|
|
15224
15245
|
if (!(_channel1.id === _activeChannelId0)) {
|
|
15225
|
-
_context2.n =
|
|
15246
|
+
_context2.n = 106;
|
|
15226
15247
|
break;
|
|
15227
15248
|
}
|
|
15228
15249
|
updateMessageOnAllMessages(messageId, {}, _obj);
|
|
15229
|
-
_context2.n =
|
|
15250
|
+
_context2.n = 106;
|
|
15230
15251
|
return put(updateMessageAC(messageId, {}, undefined, _obj));
|
|
15231
|
-
case
|
|
15252
|
+
case 106:
|
|
15232
15253
|
_i2++;
|
|
15233
|
-
_context2.n =
|
|
15254
|
+
_context2.n = 105;
|
|
15234
15255
|
break;
|
|
15235
|
-
case
|
|
15236
|
-
return _context2.a(3,
|
|
15237
|
-
case
|
|
15256
|
+
case 107:
|
|
15257
|
+
return _context2.a(3, 182);
|
|
15258
|
+
case 108:
|
|
15238
15259
|
_channel10 = args.channel, _pollDetails = args.pollDetails, _messageId = args.messageId;
|
|
15239
15260
|
_pollDetailsData = _pollDetails;
|
|
15240
|
-
_context2.n =
|
|
15261
|
+
_context2.n = 109;
|
|
15241
15262
|
return call(getActiveChannelId);
|
|
15242
|
-
case
|
|
15263
|
+
case 109:
|
|
15243
15264
|
_activeChannelId1 = _context2.v;
|
|
15244
15265
|
_deletedVotes = (_pollDetailsData === null || _pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan3 = _pollDetailsData.changedVotes) === null || _pollDetailsData$chan3 === void 0 ? void 0 : _pollDetailsData$chan3.removedVotes) || [];
|
|
15245
15266
|
_objs3 = [];
|
|
15246
|
-
for (
|
|
15247
|
-
_vote2 =
|
|
15267
|
+
for (_iterator4 = _createForOfIteratorHelperLoose(_deletedVotes); !(_step4 = _iterator4()).done;) {
|
|
15268
|
+
_vote2 = _step4.value;
|
|
15248
15269
|
_objs3.push({
|
|
15249
15270
|
type: _vote2.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15250
15271
|
vote: _vote2,
|
|
@@ -15252,27 +15273,27 @@ function watchForEvents() {
|
|
|
15252
15273
|
});
|
|
15253
15274
|
}
|
|
15254
15275
|
_i3 = 0, _objs4 = _objs3;
|
|
15255
|
-
case
|
|
15276
|
+
case 110:
|
|
15256
15277
|
if (!(_i3 < _objs4.length)) {
|
|
15257
|
-
_context2.n =
|
|
15278
|
+
_context2.n = 112;
|
|
15258
15279
|
break;
|
|
15259
15280
|
}
|
|
15260
15281
|
_obj2 = _objs4[_i3];
|
|
15261
15282
|
if (!(_pollDetailsData !== null && _pollDetailsData !== void 0 && _pollDetailsData.id && _obj2.vote)) {
|
|
15262
|
-
_context2.n =
|
|
15283
|
+
_context2.n = 111;
|
|
15263
15284
|
break;
|
|
15264
15285
|
}
|
|
15265
|
-
_context2.n =
|
|
15286
|
+
_context2.n = 111;
|
|
15266
15287
|
return put(deletePollVotesFromListAC(_pollDetailsData.id, _obj2.vote.optionId, [_obj2.vote], _messageId));
|
|
15267
|
-
case
|
|
15288
|
+
case 111:
|
|
15268
15289
|
_i3++;
|
|
15269
|
-
_context2.n =
|
|
15290
|
+
_context2.n = 110;
|
|
15270
15291
|
break;
|
|
15271
|
-
case
|
|
15292
|
+
case 112:
|
|
15272
15293
|
_i4 = 0, _objs5 = _objs3;
|
|
15273
|
-
case
|
|
15294
|
+
case 113:
|
|
15274
15295
|
if (!(_i4 < _objs5.length)) {
|
|
15275
|
-
_context2.n =
|
|
15296
|
+
_context2.n = 115;
|
|
15276
15297
|
break;
|
|
15277
15298
|
}
|
|
15278
15299
|
_obj3 = _objs5[_i4];
|
|
@@ -15281,29 +15302,29 @@ function watchForEvents() {
|
|
|
15281
15302
|
params: {}
|
|
15282
15303
|
}, _obj3);
|
|
15283
15304
|
if (!(_channel10.id === _activeChannelId1)) {
|
|
15284
|
-
_context2.n =
|
|
15305
|
+
_context2.n = 114;
|
|
15285
15306
|
break;
|
|
15286
15307
|
}
|
|
15287
15308
|
updateMessageOnAllMessages(_messageId, {}, _obj3);
|
|
15288
|
-
_context2.n =
|
|
15309
|
+
_context2.n = 114;
|
|
15289
15310
|
return put(updateMessageAC(_messageId, {}, undefined, _obj3));
|
|
15290
|
-
case
|
|
15311
|
+
case 114:
|
|
15291
15312
|
_i4++;
|
|
15292
|
-
_context2.n =
|
|
15313
|
+
_context2.n = 113;
|
|
15293
15314
|
break;
|
|
15294
|
-
case
|
|
15295
|
-
return _context2.a(3,
|
|
15296
|
-
case
|
|
15315
|
+
case 115:
|
|
15316
|
+
return _context2.a(3, 182);
|
|
15317
|
+
case 116:
|
|
15297
15318
|
_channel11 = args.channel, _pollDetails2 = args.pollDetails, _messageId2 = args.messageId;
|
|
15298
|
-
_context2.n =
|
|
15319
|
+
_context2.n = 117;
|
|
15299
15320
|
return call(getActiveChannelId);
|
|
15300
|
-
case
|
|
15321
|
+
case 117:
|
|
15301
15322
|
_activeChannelId10 = _context2.v;
|
|
15302
15323
|
_pollDetailsData2 = _pollDetails2;
|
|
15303
15324
|
retractedVotes = (_pollDetailsData2 === null || _pollDetailsData2 === void 0 ? void 0 : (_pollDetailsData2$cha = _pollDetailsData2.changedVotes) === null || _pollDetailsData2$cha === void 0 ? void 0 : _pollDetailsData2$cha.removedVotes) || [];
|
|
15304
15325
|
_objs6 = [];
|
|
15305
|
-
for (
|
|
15306
|
-
_vote4 =
|
|
15326
|
+
for (_iterator5 = _createForOfIteratorHelperLoose(retractedVotes); !(_step5 = _iterator5()).done;) {
|
|
15327
|
+
_vote4 = _step5.value;
|
|
15307
15328
|
_objs6.push({
|
|
15308
15329
|
type: _vote4.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15309
15330
|
vote: _vote4,
|
|
@@ -15311,9 +15332,9 @@ function watchForEvents() {
|
|
|
15311
15332
|
});
|
|
15312
15333
|
}
|
|
15313
15334
|
_i5 = 0, _objs7 = _objs6;
|
|
15314
|
-
case
|
|
15335
|
+
case 118:
|
|
15315
15336
|
if (!(_i5 < _objs7.length)) {
|
|
15316
|
-
_context2.n =
|
|
15337
|
+
_context2.n = 123;
|
|
15317
15338
|
break;
|
|
15318
15339
|
}
|
|
15319
15340
|
_obj4 = _objs7[_i5];
|
|
@@ -15322,40 +15343,40 @@ function watchForEvents() {
|
|
|
15322
15343
|
params: {}
|
|
15323
15344
|
}, _obj4);
|
|
15324
15345
|
if (!(_pollDetailsData2 !== null && _pollDetailsData2 !== void 0 && _pollDetailsData2.id && retractedVotes.length > 0)) {
|
|
15325
|
-
_context2.n =
|
|
15346
|
+
_context2.n = 121;
|
|
15326
15347
|
break;
|
|
15327
15348
|
}
|
|
15328
|
-
|
|
15329
|
-
case
|
|
15330
|
-
if ((
|
|
15331
|
-
_context2.n =
|
|
15349
|
+
_iterator6 = _createForOfIteratorHelperLoose(retractedVotes);
|
|
15350
|
+
case 119:
|
|
15351
|
+
if ((_step6 = _iterator6()).done) {
|
|
15352
|
+
_context2.n = 121;
|
|
15332
15353
|
break;
|
|
15333
15354
|
}
|
|
15334
|
-
_vote3 =
|
|
15335
|
-
_context2.n =
|
|
15355
|
+
_vote3 = _step6.value;
|
|
15356
|
+
_context2.n = 120;
|
|
15336
15357
|
return put(deletePollVotesFromListAC(_pollDetailsData2.id, _vote3.optionId, [_vote3], _messageId2));
|
|
15337
|
-
case
|
|
15338
|
-
_context2.n =
|
|
15358
|
+
case 120:
|
|
15359
|
+
_context2.n = 119;
|
|
15339
15360
|
break;
|
|
15340
|
-
case
|
|
15361
|
+
case 121:
|
|
15341
15362
|
if (!(_channel11.id === _activeChannelId10)) {
|
|
15342
|
-
_context2.n =
|
|
15363
|
+
_context2.n = 122;
|
|
15343
15364
|
break;
|
|
15344
15365
|
}
|
|
15345
15366
|
updateMessageOnAllMessages(_messageId2, {}, _obj4);
|
|
15346
|
-
_context2.n =
|
|
15367
|
+
_context2.n = 122;
|
|
15347
15368
|
return put(updateMessageAC(_messageId2, {}, undefined, _obj4));
|
|
15348
|
-
case
|
|
15369
|
+
case 122:
|
|
15349
15370
|
_i5++;
|
|
15350
|
-
_context2.n =
|
|
15371
|
+
_context2.n = 118;
|
|
15351
15372
|
break;
|
|
15352
|
-
case
|
|
15353
|
-
return _context2.a(3,
|
|
15354
|
-
case
|
|
15373
|
+
case 123:
|
|
15374
|
+
return _context2.a(3, 182);
|
|
15375
|
+
case 124:
|
|
15355
15376
|
_channel12 = args.channel, _messageId3 = args.messageId;
|
|
15356
|
-
_context2.n =
|
|
15377
|
+
_context2.n = 125;
|
|
15357
15378
|
return call(getActiveChannelId);
|
|
15358
|
-
case
|
|
15379
|
+
case 125:
|
|
15359
15380
|
_activeChannelId11 = _context2.v;
|
|
15360
15381
|
_obj5 = {
|
|
15361
15382
|
type: 'close',
|
|
@@ -15366,54 +15387,54 @@ function watchForEvents() {
|
|
|
15366
15387
|
params: {}
|
|
15367
15388
|
}, _obj5);
|
|
15368
15389
|
if (!(_channel12.id === _activeChannelId11)) {
|
|
15369
|
-
_context2.n =
|
|
15390
|
+
_context2.n = 127;
|
|
15370
15391
|
break;
|
|
15371
15392
|
}
|
|
15372
15393
|
updateMessageOnAllMessages(_messageId3, {}, _obj5);
|
|
15373
|
-
_context2.n =
|
|
15394
|
+
_context2.n = 126;
|
|
15374
15395
|
return put(updateMessageAC(_messageId3, {}, undefined, _obj5));
|
|
15375
|
-
case
|
|
15376
|
-
return _context2.a(3,
|
|
15377
|
-
case
|
|
15378
|
-
return _context2.a(3,
|
|
15379
|
-
case
|
|
15396
|
+
case 126:
|
|
15397
|
+
return _context2.a(3, 182);
|
|
15398
|
+
case 127:
|
|
15399
|
+
return _context2.a(3, 182);
|
|
15400
|
+
case 128:
|
|
15380
15401
|
_channel13 = args.channel, _user = args.user, _message3 = args.message, _reaction = args.reaction;
|
|
15381
15402
|
log.info('channel REACTION_DELETED ... ', _channel13);
|
|
15382
15403
|
channelFromMap = getChannelFromMap(_channel13.id);
|
|
15383
15404
|
_isSelf = _user.id === SceytChatClient.user.id;
|
|
15384
|
-
_context2.n =
|
|
15405
|
+
_context2.n = 129;
|
|
15385
15406
|
return call(getActiveChannelId);
|
|
15386
|
-
case
|
|
15407
|
+
case 129:
|
|
15387
15408
|
_activeChannelId12 = _context2.v;
|
|
15388
15409
|
if (!(_channel13.id === _activeChannelId12)) {
|
|
15389
|
-
_context2.n =
|
|
15410
|
+
_context2.n = 131;
|
|
15390
15411
|
break;
|
|
15391
15412
|
}
|
|
15392
|
-
_context2.n =
|
|
15413
|
+
_context2.n = 130;
|
|
15393
15414
|
return put(deleteReactionFromMessageAC(_message3, _reaction, _isSelf));
|
|
15394
|
-
case
|
|
15415
|
+
case 130:
|
|
15395
15416
|
removeReactionOnAllMessages(_message3, _reaction, true);
|
|
15396
|
-
case
|
|
15417
|
+
case 131:
|
|
15397
15418
|
_channelUpdateParams = JSON.parse(JSON.stringify(_channel13));
|
|
15398
15419
|
if (channelFromMap && channelFromMap.lastReactedMessage && channelFromMap.lastReactedMessage.id === _message3.id) {
|
|
15399
15420
|
_channelUpdateParams.lastReactedMessage = null;
|
|
15400
15421
|
}
|
|
15401
|
-
_context2.n =
|
|
15422
|
+
_context2.n = 132;
|
|
15402
15423
|
return put(updateChannelDataAC(_channel13.id, _channelUpdateParams));
|
|
15403
|
-
case
|
|
15424
|
+
case 132:
|
|
15404
15425
|
updateChannelOnAllChannels(_channel13.id, _channelUpdateParams);
|
|
15405
15426
|
if (checkChannelExistsOnMessagesMap(_channel13.id)) {
|
|
15406
15427
|
removeReactionToMessageOnMap(_channel13.id, _message3, _reaction, true);
|
|
15407
15428
|
}
|
|
15408
|
-
return _context2.a(3,
|
|
15409
|
-
case
|
|
15429
|
+
return _context2.a(3, 182);
|
|
15430
|
+
case 133:
|
|
15410
15431
|
_channel14 = args.channel;
|
|
15411
15432
|
if (!_channel14) {
|
|
15412
|
-
_context2.n =
|
|
15433
|
+
_context2.n = 135;
|
|
15413
15434
|
break;
|
|
15414
15435
|
}
|
|
15415
15436
|
_updatedChannel = JSON.parse(JSON.stringify(_channel14));
|
|
15416
|
-
_context2.n =
|
|
15437
|
+
_context2.n = 134;
|
|
15417
15438
|
return put(updateChannelDataAC(_channel14.id, {
|
|
15418
15439
|
lastMessage: _channel14.lastMessage,
|
|
15419
15440
|
newMessageCount: _channel14.newMessageCount,
|
|
@@ -15426,36 +15447,36 @@ function watchForEvents() {
|
|
|
15426
15447
|
lastDisplayedMessageId: _channel14.lastDisplayedMessageId,
|
|
15427
15448
|
messageRetentionPeriod: _channel14.messageRetentionPeriod
|
|
15428
15449
|
}));
|
|
15429
|
-
case
|
|
15450
|
+
case 134:
|
|
15430
15451
|
updateChannelOnAllChannels(_channel14.id, _updatedChannel);
|
|
15431
|
-
case
|
|
15432
|
-
return _context2.a(3,
|
|
15433
|
-
case
|
|
15452
|
+
case 135:
|
|
15453
|
+
return _context2.a(3, 182);
|
|
15454
|
+
case 136:
|
|
15434
15455
|
_channel15 = args.channel;
|
|
15435
15456
|
log.info('CLEAR_HISTORY: ', _channel15);
|
|
15436
|
-
_context2.n =
|
|
15457
|
+
_context2.n = 137;
|
|
15437
15458
|
return call(getActiveChannelId);
|
|
15438
|
-
case
|
|
15459
|
+
case 137:
|
|
15439
15460
|
_activeChannelId13 = _context2.v;
|
|
15440
|
-
_context2.n =
|
|
15461
|
+
_context2.n = 138;
|
|
15441
15462
|
return call(checkChannelExists, _channel15.id);
|
|
15442
|
-
case
|
|
15463
|
+
case 138:
|
|
15443
15464
|
channelExist = _context2.v;
|
|
15444
15465
|
if (!(_channel15.id === _activeChannelId13)) {
|
|
15445
|
-
_context2.n =
|
|
15466
|
+
_context2.n = 140;
|
|
15446
15467
|
break;
|
|
15447
15468
|
}
|
|
15448
|
-
_context2.n =
|
|
15469
|
+
_context2.n = 139;
|
|
15449
15470
|
return put(clearMessagesAC());
|
|
15450
|
-
case
|
|
15471
|
+
case 139:
|
|
15451
15472
|
removeAllMessages();
|
|
15452
|
-
case
|
|
15473
|
+
case 140:
|
|
15453
15474
|
removeMessagesFromMap(_channel15.id);
|
|
15454
15475
|
if (!channelExist) {
|
|
15455
|
-
_context2.n =
|
|
15476
|
+
_context2.n = 141;
|
|
15456
15477
|
break;
|
|
15457
15478
|
}
|
|
15458
|
-
_context2.n =
|
|
15479
|
+
_context2.n = 141;
|
|
15459
15480
|
return put(updateChannelDataAC(_channel15.id, {
|
|
15460
15481
|
lastMessage: null,
|
|
15461
15482
|
newMessageCount: 0,
|
|
@@ -15463,7 +15484,7 @@ function watchForEvents() {
|
|
|
15463
15484
|
muted: _channel15.muted,
|
|
15464
15485
|
mutedTill: _channel15.mutedTill
|
|
15465
15486
|
}));
|
|
15466
|
-
case
|
|
15487
|
+
case 141:
|
|
15467
15488
|
updateChannelOnAllChannels(_channel15.id, {
|
|
15468
15489
|
lastMessage: null,
|
|
15469
15490
|
newMessageCount: 0,
|
|
@@ -15471,173 +15492,173 @@ function watchForEvents() {
|
|
|
15471
15492
|
muted: _channel15.muted,
|
|
15472
15493
|
mutedTill: _channel15.mutedTill
|
|
15473
15494
|
});
|
|
15474
|
-
return _context2.a(3,
|
|
15475
|
-
case
|
|
15495
|
+
return _context2.a(3, 182);
|
|
15496
|
+
case 142:
|
|
15476
15497
|
_channel16 = args.channel;
|
|
15477
15498
|
log.info('channel MUTE ... ');
|
|
15478
|
-
_context2.n =
|
|
15499
|
+
_context2.n = 143;
|
|
15479
15500
|
return put(updateChannelDataAC(_channel16.id, {
|
|
15480
15501
|
muted: _channel16.muted,
|
|
15481
15502
|
mutedTill: _channel16.mutedTill
|
|
15482
15503
|
}));
|
|
15483
|
-
case
|
|
15504
|
+
case 143:
|
|
15484
15505
|
updateChannelOnAllChannels(_channel16.id, {
|
|
15485
15506
|
muted: _channel16.muted,
|
|
15486
15507
|
mutedTill: _channel16.mutedTill
|
|
15487
15508
|
});
|
|
15488
|
-
return _context2.a(3,
|
|
15489
|
-
case
|
|
15509
|
+
return _context2.a(3, 182);
|
|
15510
|
+
case 144:
|
|
15490
15511
|
_channel17 = args.channel;
|
|
15491
15512
|
log.info('channel UNMUTE ... ');
|
|
15492
|
-
_context2.n =
|
|
15513
|
+
_context2.n = 145;
|
|
15493
15514
|
return put(updateChannelDataAC(_channel17.id, {
|
|
15494
15515
|
muted: _channel17.muted,
|
|
15495
15516
|
mutedTill: _channel17.mutedTill
|
|
15496
15517
|
}));
|
|
15497
|
-
case
|
|
15518
|
+
case 145:
|
|
15498
15519
|
updateChannelOnAllChannels(_channel17.id, {
|
|
15499
15520
|
muted: _channel17.muted,
|
|
15500
15521
|
mutedTill: _channel17.mutedTill
|
|
15501
15522
|
});
|
|
15502
|
-
return _context2.a(3,
|
|
15503
|
-
case
|
|
15523
|
+
return _context2.a(3, 182);
|
|
15524
|
+
case 146:
|
|
15504
15525
|
_channel18 = args.channel;
|
|
15505
15526
|
log.info('channel PINED ... ');
|
|
15506
|
-
_context2.n =
|
|
15527
|
+
_context2.n = 147;
|
|
15507
15528
|
return put(updateChannelDataAC(_channel18.id, {
|
|
15508
15529
|
pinnedAt: _channel18.pinnedAt
|
|
15509
15530
|
}, true));
|
|
15510
|
-
case
|
|
15531
|
+
case 147:
|
|
15511
15532
|
updateChannelOnAllChannels(_channel18.id, {
|
|
15512
15533
|
pinnedAt: _channel18.pinnedAt
|
|
15513
15534
|
});
|
|
15514
|
-
return _context2.a(3,
|
|
15515
|
-
case
|
|
15535
|
+
return _context2.a(3, 182);
|
|
15536
|
+
case 148:
|
|
15516
15537
|
_channel19 = args.channel;
|
|
15517
15538
|
log.info('channel UNPINED ... ');
|
|
15518
|
-
_context2.n =
|
|
15539
|
+
_context2.n = 149;
|
|
15519
15540
|
return put(updateChannelDataAC(_channel19.id, {
|
|
15520
15541
|
pinnedAt: _channel19.pinnedAt
|
|
15521
15542
|
}, false, true));
|
|
15522
|
-
case
|
|
15543
|
+
case 149:
|
|
15523
15544
|
updateChannelOnAllChannels(_channel19.id, {
|
|
15524
15545
|
pinnedAt: _channel19.pinnedAt
|
|
15525
15546
|
});
|
|
15526
|
-
return _context2.a(3,
|
|
15527
|
-
case
|
|
15547
|
+
return _context2.a(3, 182);
|
|
15548
|
+
case 150:
|
|
15528
15549
|
_channel20 = args.channel;
|
|
15529
15550
|
log.info('channel HIDE ... ');
|
|
15530
|
-
_context2.n =
|
|
15551
|
+
_context2.n = 151;
|
|
15531
15552
|
return put(setChannelToHideAC(_channel20));
|
|
15532
|
-
case
|
|
15533
|
-
return _context2.a(3,
|
|
15534
|
-
case
|
|
15553
|
+
case 151:
|
|
15554
|
+
return _context2.a(3, 182);
|
|
15555
|
+
case 152:
|
|
15535
15556
|
_channel21 = args.channel;
|
|
15536
15557
|
log.info('channel UNHIDE ... ');
|
|
15537
|
-
_context2.n =
|
|
15558
|
+
_context2.n = 153;
|
|
15538
15559
|
return put(setChannelToUnHideAC(_channel21));
|
|
15539
|
-
case
|
|
15540
|
-
return _context2.a(3,
|
|
15541
|
-
case
|
|
15560
|
+
case 153:
|
|
15561
|
+
return _context2.a(3, 182);
|
|
15562
|
+
case 154:
|
|
15542
15563
|
_channel22 = args.channel;
|
|
15543
|
-
_context2.n =
|
|
15564
|
+
_context2.n = 155;
|
|
15544
15565
|
return put(updateChannelDataAC(_channel22.id, {
|
|
15545
15566
|
unread: _channel22.unread,
|
|
15546
15567
|
muted: _channel22.muted,
|
|
15547
15568
|
mutedTill: _channel22.mutedTill
|
|
15548
15569
|
}));
|
|
15549
|
-
case
|
|
15570
|
+
case 155:
|
|
15550
15571
|
_groupName5 = getChannelGroupName(_channel22);
|
|
15551
|
-
_context2.n =
|
|
15572
|
+
_context2.n = 156;
|
|
15552
15573
|
return put(updateSearchedChannelDataAC(_channel22.id, {
|
|
15553
15574
|
unread: _channel22.unread
|
|
15554
15575
|
}, _groupName5));
|
|
15555
|
-
case
|
|
15576
|
+
case 156:
|
|
15556
15577
|
updateChannelOnAllChannels(_channel22.id, {
|
|
15557
15578
|
unread: _channel22.unread
|
|
15558
15579
|
});
|
|
15559
|
-
return _context2.a(3,
|
|
15560
|
-
case
|
|
15580
|
+
return _context2.a(3, 182);
|
|
15581
|
+
case 157:
|
|
15561
15582
|
_channel23 = args.channel;
|
|
15562
|
-
_context2.n =
|
|
15583
|
+
_context2.n = 158;
|
|
15563
15584
|
return put(updateChannelDataAC(_channel23.id, {
|
|
15564
15585
|
unread: _channel23.unread,
|
|
15565
15586
|
muted: _channel23.muted,
|
|
15566
15587
|
mutedTill: _channel23.mutedTill
|
|
15567
15588
|
}));
|
|
15568
|
-
case
|
|
15589
|
+
case 158:
|
|
15569
15590
|
_groupName6 = getChannelGroupName(_channel23);
|
|
15570
|
-
_context2.n =
|
|
15591
|
+
_context2.n = 159;
|
|
15571
15592
|
return put(updateSearchedChannelDataAC(_channel23.id, {
|
|
15572
15593
|
unread: _channel23.unread
|
|
15573
15594
|
}, _groupName6));
|
|
15574
|
-
case
|
|
15595
|
+
case 159:
|
|
15575
15596
|
updateChannelOnAllChannels(_channel23.id, {
|
|
15576
15597
|
unread: _channel23.unread
|
|
15577
15598
|
});
|
|
15578
|
-
return _context2.a(3,
|
|
15579
|
-
case
|
|
15599
|
+
return _context2.a(3, 182);
|
|
15600
|
+
case 160:
|
|
15580
15601
|
_channel24 = args.channel, members = args.members;
|
|
15581
15602
|
log.info('channel CHANGE_ROLE channel ... ', _channel24);
|
|
15582
15603
|
log.info('channel CHANGE_ROLE member ... ', members);
|
|
15583
|
-
_context2.n =
|
|
15604
|
+
_context2.n = 161;
|
|
15584
15605
|
return call(getActiveChannelId);
|
|
15585
|
-
case
|
|
15606
|
+
case 161:
|
|
15586
15607
|
_activeChannelId14 = _context2.v;
|
|
15587
15608
|
if (!(_channel24.id === _activeChannelId14)) {
|
|
15588
|
-
_context2.n =
|
|
15609
|
+
_context2.n = 162;
|
|
15589
15610
|
break;
|
|
15590
15611
|
}
|
|
15591
|
-
_context2.n =
|
|
15612
|
+
_context2.n = 162;
|
|
15592
15613
|
return put(updateMembersAC(members));
|
|
15593
|
-
case
|
|
15614
|
+
case 162:
|
|
15594
15615
|
i = 0;
|
|
15595
|
-
case
|
|
15616
|
+
case 163:
|
|
15596
15617
|
if (!(i < members.length)) {
|
|
15597
|
-
_context2.n =
|
|
15618
|
+
_context2.n = 166;
|
|
15598
15619
|
break;
|
|
15599
15620
|
}
|
|
15600
15621
|
if (!(members[i].id === SceytChatClient.user.id)) {
|
|
15601
|
-
_context2.n =
|
|
15622
|
+
_context2.n = 165;
|
|
15602
15623
|
break;
|
|
15603
15624
|
}
|
|
15604
|
-
_context2.n =
|
|
15625
|
+
_context2.n = 164;
|
|
15605
15626
|
return put(updateChannelDataAC(_channel24.id, {
|
|
15606
15627
|
userRole: members[i].role,
|
|
15607
15628
|
muted: _channel24.muted,
|
|
15608
15629
|
mutedTill: _channel24.mutedTill
|
|
15609
15630
|
}));
|
|
15610
|
-
case
|
|
15631
|
+
case 164:
|
|
15611
15632
|
updateChannelOnAllChannels(_channel24.id, {
|
|
15612
15633
|
userRole: members[i].role,
|
|
15613
15634
|
muted: _channel24.muted,
|
|
15614
15635
|
mutedTill: _channel24.mutedTill
|
|
15615
15636
|
});
|
|
15616
|
-
case
|
|
15637
|
+
case 165:
|
|
15617
15638
|
i++;
|
|
15618
|
-
_context2.n =
|
|
15639
|
+
_context2.n = 163;
|
|
15619
15640
|
break;
|
|
15620
|
-
case
|
|
15621
|
-
return _context2.a(3,
|
|
15622
|
-
case
|
|
15641
|
+
case 166:
|
|
15642
|
+
return _context2.a(3, 182);
|
|
15643
|
+
case 167:
|
|
15623
15644
|
_channel25 = args.channel;
|
|
15624
15645
|
log.info('channel frozen channel ... ', _channel25);
|
|
15625
|
-
return _context2.a(3,
|
|
15626
|
-
case
|
|
15646
|
+
return _context2.a(3, 182);
|
|
15647
|
+
case 168:
|
|
15627
15648
|
_channel26 = args.channel;
|
|
15628
15649
|
log.info('channel unfrozen channel ... ', _channel26);
|
|
15629
|
-
return _context2.a(3,
|
|
15630
|
-
case
|
|
15650
|
+
return _context2.a(3, 182);
|
|
15651
|
+
case 169:
|
|
15631
15652
|
_channelId2 = args.channelId, from = args.from, name = args.name;
|
|
15632
15653
|
log.info('channel event received >>>... . . . . . ', args);
|
|
15633
15654
|
if (!(from.id === SceytChatClient.user.id)) {
|
|
15634
|
-
_context2.n =
|
|
15655
|
+
_context2.n = 170;
|
|
15635
15656
|
break;
|
|
15636
15657
|
}
|
|
15637
|
-
return _context2.a(3,
|
|
15638
|
-
case
|
|
15658
|
+
return _context2.a(3, 182);
|
|
15659
|
+
case 170:
|
|
15639
15660
|
if (!(name === 'start_typing')) {
|
|
15640
|
-
_context2.n =
|
|
15661
|
+
_context2.n = 172;
|
|
15641
15662
|
break;
|
|
15642
15663
|
}
|
|
15643
15664
|
if (!usersTimeout[_channelId2]) {
|
|
@@ -15649,27 +15670,27 @@ function watchForEvents() {
|
|
|
15649
15670
|
usersTimeout[_channelId2][from.id] = setTimeout(function () {
|
|
15650
15671
|
channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_typing');
|
|
15651
15672
|
}, 5000);
|
|
15652
|
-
_context2.n =
|
|
15673
|
+
_context2.n = 171;
|
|
15653
15674
|
return put(switchTypingIndicatorAC(true, _channelId2, from));
|
|
15654
|
-
case
|
|
15655
|
-
_context2.n =
|
|
15675
|
+
case 171:
|
|
15676
|
+
_context2.n = 177;
|
|
15656
15677
|
break;
|
|
15657
|
-
case
|
|
15678
|
+
case 172:
|
|
15658
15679
|
if (!(name === 'stop_typing')) {
|
|
15659
|
-
_context2.n =
|
|
15680
|
+
_context2.n = 174;
|
|
15660
15681
|
break;
|
|
15661
15682
|
}
|
|
15662
15683
|
if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
|
|
15663
15684
|
clearTimeout(usersTimeout[_channelId2][from.id]);
|
|
15664
15685
|
}
|
|
15665
|
-
_context2.n =
|
|
15686
|
+
_context2.n = 173;
|
|
15666
15687
|
return put(switchTypingIndicatorAC(false, _channelId2, from));
|
|
15667
|
-
case
|
|
15668
|
-
_context2.n =
|
|
15688
|
+
case 173:
|
|
15689
|
+
_context2.n = 177;
|
|
15669
15690
|
break;
|
|
15670
|
-
case
|
|
15691
|
+
case 174:
|
|
15671
15692
|
if (!(name === 'start_recording')) {
|
|
15672
|
-
_context2.n =
|
|
15693
|
+
_context2.n = 176;
|
|
15673
15694
|
break;
|
|
15674
15695
|
}
|
|
15675
15696
|
if (!usersTimeout[_channelId2]) {
|
|
@@ -15681,50 +15702,50 @@ function watchForEvents() {
|
|
|
15681
15702
|
usersTimeout[_channelId2][from.id] = setTimeout(function () {
|
|
15682
15703
|
channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_recording');
|
|
15683
15704
|
}, 5000);
|
|
15684
|
-
_context2.n =
|
|
15705
|
+
_context2.n = 175;
|
|
15685
15706
|
return put(switchRecordingIndicatorAC(true, _channelId2, from));
|
|
15686
|
-
case
|
|
15687
|
-
_context2.n =
|
|
15707
|
+
case 175:
|
|
15708
|
+
_context2.n = 177;
|
|
15688
15709
|
break;
|
|
15689
|
-
case
|
|
15710
|
+
case 176:
|
|
15690
15711
|
if (!(name === 'stop_recording')) {
|
|
15691
|
-
_context2.n =
|
|
15712
|
+
_context2.n = 177;
|
|
15692
15713
|
break;
|
|
15693
15714
|
}
|
|
15694
15715
|
if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
|
|
15695
15716
|
clearTimeout(usersTimeout[_channelId2][from.id]);
|
|
15696
15717
|
}
|
|
15697
|
-
_context2.n =
|
|
15718
|
+
_context2.n = 177;
|
|
15698
15719
|
return put(switchRecordingIndicatorAC(false, _channelId2, from));
|
|
15699
|
-
case
|
|
15700
|
-
return _context2.a(3,
|
|
15701
|
-
case
|
|
15720
|
+
case 177:
|
|
15721
|
+
return _context2.a(3, 182);
|
|
15722
|
+
case 178:
|
|
15702
15723
|
status = args.status;
|
|
15703
15724
|
log.info('connection status changed . . . . . ', status);
|
|
15704
|
-
_context2.n =
|
|
15725
|
+
_context2.n = 179;
|
|
15705
15726
|
return put(setConnectionStatusAC(status));
|
|
15706
|
-
case
|
|
15727
|
+
case 179:
|
|
15707
15728
|
if (!(status === CONNECTION_STATUS.CONNECTED)) {
|
|
15708
|
-
_context2.n =
|
|
15729
|
+
_context2.n = 180;
|
|
15709
15730
|
break;
|
|
15710
15731
|
}
|
|
15711
|
-
_context2.n =
|
|
15732
|
+
_context2.n = 180;
|
|
15712
15733
|
return put(getRolesAC());
|
|
15713
|
-
case
|
|
15714
|
-
return _context2.a(3,
|
|
15715
|
-
case
|
|
15734
|
+
case 180:
|
|
15735
|
+
return _context2.a(3, 182);
|
|
15736
|
+
case 181:
|
|
15716
15737
|
log.warn('UNHANDLED EVENT FROM REDUX-SAGA EVENT-CHANNEL');
|
|
15717
|
-
case
|
|
15718
|
-
_context2.n =
|
|
15738
|
+
case 182:
|
|
15739
|
+
_context2.n = 184;
|
|
15719
15740
|
break;
|
|
15720
|
-
case
|
|
15721
|
-
_context2.p =
|
|
15741
|
+
case 183:
|
|
15742
|
+
_context2.p = 183;
|
|
15722
15743
|
_t2 = _context2.v;
|
|
15723
15744
|
log.error('Error in watchForEvents:', _t2);
|
|
15724
|
-
case
|
|
15745
|
+
case 184:
|
|
15725
15746
|
return _context2.a(2);
|
|
15726
15747
|
}
|
|
15727
|
-
}, _callee2, null, [[0,
|
|
15748
|
+
}, _callee2, null, [[0, 183]]);
|
|
15728
15749
|
});
|
|
15729
15750
|
case 1:
|
|
15730
15751
|
return _context3.d(_regeneratorValues(_loop()), 2);
|
|
@@ -34749,7 +34770,8 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34749
34770
|
var _useColor = useColors(),
|
|
34750
34771
|
incomingMessageBackgroundX = _useColor[THEME_COLORS.INCOMING_MESSAGE_BACKGROUND_X],
|
|
34751
34772
|
outgoingMessageBackgroundX = _useColor[THEME_COLORS.OUTGOING_MESSAGE_BACKGROUND_X],
|
|
34752
|
-
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY]
|
|
34773
|
+
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
|
|
34774
|
+
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY];
|
|
34753
34775
|
var attachment = useMemo(function () {
|
|
34754
34776
|
return attachments.find(function (attachment) {
|
|
34755
34777
|
return attachment.type === attachmentTypes.link;
|
|
@@ -34875,7 +34897,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34875
34897
|
}
|
|
34876
34898
|
}, []);
|
|
34877
34899
|
useEffect(function () {
|
|
34878
|
-
if (attachment !== null && attachment !== void 0 && attachment.id && attachment !== null && attachment !== void 0 && attachment.url && !
|
|
34900
|
+
if (attachment !== null && attachment !== void 0 && attachment.id && attachment !== null && attachment !== void 0 && attachment.url && !(oGMetadata !== null && oGMetadata !== void 0 && oGMetadata[attachment === null || attachment === void 0 ? void 0 : attachment.url])) {
|
|
34879
34901
|
setShouldAnimate(true);
|
|
34880
34902
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
34881
34903
|
if (url) {
|
|
@@ -34883,6 +34905,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34883
34905
|
try {
|
|
34884
34906
|
if (cachedMetadata) {
|
|
34885
34907
|
handleMetadata(cachedMetadata);
|
|
34908
|
+
setMetadataLoaded(true);
|
|
34886
34909
|
}
|
|
34887
34910
|
ogMetadataQueryBuilder(url);
|
|
34888
34911
|
return Promise.resolve();
|
|
@@ -34895,7 +34918,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34895
34918
|
});
|
|
34896
34919
|
}
|
|
34897
34920
|
}
|
|
34898
|
-
}, [attachment,
|
|
34921
|
+
}, [attachment, oGMetadata === null || oGMetadata === void 0 ? void 0 : oGMetadata[attachment === null || attachment === void 0 ? void 0 : attachment.url]]);
|
|
34899
34922
|
var ogUrl = useMemo(function () {
|
|
34900
34923
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
34901
34924
|
var urlObj = validateUrl(url);
|
|
@@ -34930,18 +34953,23 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34930
34953
|
link: 4
|
|
34931
34954
|
};
|
|
34932
34955
|
}, [order]);
|
|
34956
|
+
var MIN_IMAGE_HEIGHT = 180;
|
|
34957
|
+
var MAX_IMAGE_HEIGHT = 400;
|
|
34958
|
+
var showImage = useMemo(function () {
|
|
34959
|
+
return hasImage && calculatedImageHeight >= MIN_IMAGE_HEIGHT && calculatedImageHeight <= MAX_IMAGE_HEIGHT;
|
|
34960
|
+
}, [hasImage, calculatedImageHeight]);
|
|
34933
34961
|
useEffect(function () {
|
|
34934
34962
|
if (metadataLoaded || oGMetadata !== null && oGMetadata !== void 0 && oGMetadata[attachment === null || attachment === void 0 ? void 0 : attachment.url]) {
|
|
34935
|
-
if (
|
|
34936
|
-
metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, true,
|
|
34963
|
+
if (oGMetadata !== null && oGMetadata !== void 0 && oGMetadata[attachment === null || attachment === void 0 ? void 0 : attachment.url] && metadataGetSuccessCallback && metadata) {
|
|
34964
|
+
metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, true, showImage, metadata);
|
|
34937
34965
|
} else {
|
|
34938
|
-
metadataGetSuccessCallback === null || metadataGetSuccessCallback === void 0 ? void 0 : metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, false, false);
|
|
34966
|
+
metadataGetSuccessCallback === null || metadataGetSuccessCallback === void 0 ? void 0 : metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, false, false, metadata);
|
|
34939
34967
|
}
|
|
34940
34968
|
}
|
|
34941
|
-
}, [
|
|
34969
|
+
}, [metadataLoaded, oGMetadata, attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata]);
|
|
34942
34970
|
var elements = useMemo(function () {
|
|
34943
|
-
var _resolvedOrder$image, _metadata$og11, _metadata$og11$image, _metadata$og11$image$, _resolvedOrder$title, _metadata$og12, _metadata$og13, _resolvedOrder$descri, _metadata$og14, _metadata$og15, _resolvedOrder$link;
|
|
34944
|
-
return [
|
|
34971
|
+
var _resolvedOrder$image, _metadata$og11, _metadata$og11$image, _metadata$og11$image$, _resolvedOrder$title, _metadata$og12, _metadata$og13, _metadata$og13$title, _resolvedOrder$descri, _metadata$og14, _metadata$og15, _metadata$og15$descri, _resolvedOrder$link;
|
|
34972
|
+
return [showImage ? {
|
|
34945
34973
|
key: 'image',
|
|
34946
34974
|
order: (_resolvedOrder$image = resolvedOrder === null || resolvedOrder === void 0 ? void 0 : resolvedOrder.image) != null ? _resolvedOrder$image : 1,
|
|
34947
34975
|
render: (/*#__PURE__*/React__default.createElement(ImageContainer, {
|
|
@@ -34962,8 +34990,9 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34962
34990
|
render: ogShowTitle && (metadata === null || metadata === void 0 ? void 0 : (_metadata$og12 = metadata.og) === null || _metadata$og12 === void 0 ? void 0 : _metadata$og12.title) && (/*#__PURE__*/React__default.createElement(Title$3, {
|
|
34963
34991
|
maxWidth: maxWidth,
|
|
34964
34992
|
shouldAnimate: shouldAnimate,
|
|
34965
|
-
padding: infoPadding
|
|
34966
|
-
|
|
34993
|
+
padding: infoPadding,
|
|
34994
|
+
color: textPrimary
|
|
34995
|
+
}, /*#__PURE__*/React__default.createElement("span", null, metadata === null || metadata === void 0 ? void 0 : (_metadata$og13 = metadata.og) === null || _metadata$og13 === void 0 ? void 0 : (_metadata$og13$title = _metadata$og13.title) === null || _metadata$og13$title === void 0 ? void 0 : _metadata$og13$title.trim())))
|
|
34967
34996
|
}, {
|
|
34968
34997
|
key: 'description',
|
|
34969
34998
|
order: (_resolvedOrder$descri = resolvedOrder === null || resolvedOrder === void 0 ? void 0 : resolvedOrder.description) != null ? _resolvedOrder$descri : 3,
|
|
@@ -34972,7 +35001,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
34972
35001
|
shouldAnimate: shouldAnimate,
|
|
34973
35002
|
color: textSecondary,
|
|
34974
35003
|
padding: infoPadding
|
|
34975
|
-
}, metadata === null || metadata === void 0 ? void 0 : (_metadata$og15 = metadata.og) === null || _metadata$og15 === void 0 ? void 0 : _metadata$og15.description))
|
|
35004
|
+
}, metadata === null || metadata === void 0 ? void 0 : (_metadata$og15 = metadata.og) === null || _metadata$og15 === void 0 ? void 0 : (_metadata$og15$descri = _metadata$og15.description) === null || _metadata$og15$descri === void 0 ? void 0 : _metadata$og15$descri.trim()))
|
|
34976
35005
|
}, {
|
|
34977
35006
|
key: 'link',
|
|
34978
35007
|
order: (_resolvedOrder$link = resolvedOrder === null || resolvedOrder === void 0 ? void 0 : resolvedOrder.link) != null ? _resolvedOrder$link : 4,
|
|
@@ -35030,7 +35059,8 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
35030
35059
|
borderRadius: ogContainerBorderRadius,
|
|
35031
35060
|
padding: ogContainerPadding,
|
|
35032
35061
|
className: ogContainerClassName,
|
|
35033
|
-
containerMargin: ogContainerMargin
|
|
35062
|
+
containerMargin: ogContainerMargin,
|
|
35063
|
+
maxWidth: maxWidth
|
|
35034
35064
|
}, isInviteLink ? {
|
|
35035
35065
|
as: 'div',
|
|
35036
35066
|
onClick: function onClick() {
|
|
@@ -35044,84 +35074,90 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
35044
35074
|
}), content);
|
|
35045
35075
|
};
|
|
35046
35076
|
var sharedKeyframes = "\n @keyframes fadeInSlideUp {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes expandHeight {\n from {\n max-height: 0;\n opacity: 0;\n }\n to {\n max-height: 1000px;\n opacity: 1;\n }\n }\n";
|
|
35047
|
-
var OGMetadataContainer = styled.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteralLoose(["\n min-width: inherit;\n max-width:
|
|
35048
|
-
var
|
|
35049
|
-
|
|
35050
|
-
bgColor = _ref2.bgColor;
|
|
35051
|
-
return showBackground ? customBg != null ? customBg : bgColor : 'transparent';
|
|
35077
|
+
var OGMetadataContainer = styled.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteralLoose(["\n min-width: inherit;\n max-width: ", ";\n width: 100%;\n display: grid;\n grid-template-columns: 1fr;\n border-radius: 8px;\n background-color: ", ";\n border-radius: ", ";\n margin: ", ";\n // margin-bottom: ", ";\n padding: ", ";\n text-decoration: none;\n // color: inherit;\n &:hover {\n opacity: 0.9;\n cursor: pointer;\n }\n"])), function (_ref2) {
|
|
35078
|
+
var maxWidth = _ref2.maxWidth;
|
|
35079
|
+
return maxWidth ? maxWidth + "px" : 'inherit';
|
|
35052
35080
|
}, function (_ref3) {
|
|
35053
|
-
var
|
|
35054
|
-
|
|
35081
|
+
var showBackground = _ref3.showBackground,
|
|
35082
|
+
customBg = _ref3.customBg,
|
|
35083
|
+
bgColor = _ref3.bgColor;
|
|
35084
|
+
return showBackground ? customBg != null ? customBg : bgColor : 'transparent';
|
|
35055
35085
|
}, function (_ref4) {
|
|
35056
|
-
var
|
|
35057
|
-
return
|
|
35086
|
+
var borderRadius = _ref4.borderRadius;
|
|
35087
|
+
return borderRadius !== undefined ? borderRadius : '8px';
|
|
35058
35088
|
}, function (_ref5) {
|
|
35059
|
-
var
|
|
35060
|
-
return
|
|
35089
|
+
var containerMargin = _ref5.containerMargin;
|
|
35090
|
+
return containerMargin != null ? containerMargin : '0.8rem auto 0';
|
|
35061
35091
|
}, function (_ref6) {
|
|
35062
|
-
var
|
|
35092
|
+
var showOGMetadata = _ref6.showOGMetadata;
|
|
35093
|
+
return showOGMetadata ? '0.4rem' : '0';
|
|
35094
|
+
}, function (_ref7) {
|
|
35095
|
+
var padding = _ref7.padding;
|
|
35063
35096
|
return padding != null ? padding : '0';
|
|
35064
35097
|
});
|
|
35065
|
-
var ImageContainer = styled.div(_templateObject2$A || (_templateObject2$A = _taggedTemplateLiteralLoose(["\n ", "\n width: 100%;\n height: ", ";\n opacity: ", ";\n margin: 0 auto;\n overflow: hidden;\n ", "\n"])), sharedKeyframes, function (
|
|
35066
|
-
var containerHeight =
|
|
35098
|
+
var ImageContainer = styled.div(_templateObject2$A || (_templateObject2$A = _taggedTemplateLiteralLoose(["\n ", "\n width: 100%;\n height: ", ";\n opacity: ", ";\n margin: 0 auto;\n border-radius: 8px 8px 0 0;\n overflow: hidden;\n ", "\n"])), sharedKeyframes, function (_ref8) {
|
|
35099
|
+
var containerHeight = _ref8.containerHeight;
|
|
35067
35100
|
return containerHeight ? containerHeight + "px" : '0px';
|
|
35068
|
-
}, function (_ref8) {
|
|
35069
|
-
var showOGMetadata = _ref8.showOGMetadata,
|
|
35070
|
-
containerHeight = _ref8.containerHeight;
|
|
35071
|
-
return showOGMetadata && containerHeight ? 1 : 0;
|
|
35072
35101
|
}, function (_ref9) {
|
|
35073
|
-
var
|
|
35074
|
-
showOGMetadata = _ref9.showOGMetadata,
|
|
35102
|
+
var showOGMetadata = _ref9.showOGMetadata,
|
|
35075
35103
|
containerHeight = _ref9.containerHeight;
|
|
35104
|
+
return showOGMetadata && containerHeight ? 1 : 0;
|
|
35105
|
+
}, function (_ref0) {
|
|
35106
|
+
var shouldAnimate = _ref0.shouldAnimate,
|
|
35107
|
+
showOGMetadata = _ref0.showOGMetadata,
|
|
35108
|
+
containerHeight = _ref0.containerHeight;
|
|
35076
35109
|
return shouldAnimate && showOGMetadata && containerHeight && "\n animation: expandHeight 0.3s ease-out forwards;\n ";
|
|
35077
35110
|
});
|
|
35078
|
-
var OGText = styled.div(_templateObject3$u || (_templateObject3$u = _taggedTemplateLiteralLoose(["\n ", "\n display: flex;\n flex-direction: column;\n gap: 0;\n ", "\n ", ";\n"])), sharedKeyframes, function (
|
|
35079
|
-
var shouldAnimate =
|
|
35111
|
+
var OGText = styled.div(_templateObject3$u || (_templateObject3$u = _taggedTemplateLiteralLoose(["\n ", "\n display: flex;\n flex-direction: column;\n gap: 0;\n ", "\n ", ";\n"])), sharedKeyframes, function (_ref1) {
|
|
35112
|
+
var shouldAnimate = _ref1.shouldAnimate;
|
|
35080
35113
|
return shouldAnimate && "\n animation: fadeInSlideUp 0.3s ease-out forwards;\n ";
|
|
35081
|
-
}, function (
|
|
35082
|
-
var margin =
|
|
35114
|
+
}, function (_ref10) {
|
|
35115
|
+
var margin = _ref10.margin;
|
|
35083
35116
|
return margin ? '12px' : '0';
|
|
35084
35117
|
});
|
|
35085
|
-
var Title$3 = styled.p(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n ", "\n font-weight:
|
|
35086
|
-
var
|
|
35118
|
+
var Title$3 = styled.p(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n ", "\n // font-family: Inter;\n font-weight: 500;\n font-size: 14px;\n line-height: 18px;\n letter-spacing: 0px;\n color: ", ";\n margin: 4px 0 0 0;\n padding: ", ";\n box-sizing: border-box;\n ", "\n ", "\n"])), sharedKeyframes, function (_ref11) {
|
|
35119
|
+
var color = _ref11.color;
|
|
35120
|
+
return color;
|
|
35121
|
+
}, function (_ref12) {
|
|
35122
|
+
var padding = _ref12.padding;
|
|
35087
35123
|
return padding != null ? padding : '0';
|
|
35088
|
-
}, function (
|
|
35089
|
-
var maxWidth =
|
|
35124
|
+
}, function (_ref13) {
|
|
35125
|
+
var maxWidth = _ref13.maxWidth;
|
|
35090
35126
|
return maxWidth && "\n max-width: " + maxWidth + "px;\n ";
|
|
35091
|
-
}, function (
|
|
35092
|
-
var shouldAnimate =
|
|
35127
|
+
}, function (_ref14) {
|
|
35128
|
+
var shouldAnimate = _ref14.shouldAnimate;
|
|
35093
35129
|
return shouldAnimate && "\n animation: fadeInSlideUp 0.3s ease-out 0.1s backwards;\n ";
|
|
35094
35130
|
});
|
|
35095
|
-
var Desc = styled.p(_templateObject5$l || (_templateObject5$l = _taggedTemplateLiteralLoose(["\n ", "\n font-weight: normal;\n font-size: 13px;\n line-height: 16px;\n margin:
|
|
35096
|
-
var padding =
|
|
35131
|
+
var Desc = styled.p(_templateObject5$l || (_templateObject5$l = _taggedTemplateLiteralLoose(["\n ", "\n font-weight: normal;\n font-size: 13px;\n line-height: 16px;\n margin: 4px 0 4px 0;\n padding: ", ";\n color: ", ";\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n box-sizing: border-box;\n ", "\n ", "\n"])), sharedKeyframes, function (_ref15) {
|
|
35132
|
+
var padding = _ref15.padding;
|
|
35097
35133
|
return padding != null ? padding : '0';
|
|
35098
|
-
}, function (
|
|
35099
|
-
var color =
|
|
35134
|
+
}, function (_ref16) {
|
|
35135
|
+
var color = _ref16.color;
|
|
35100
35136
|
return color;
|
|
35101
|
-
}, function (
|
|
35102
|
-
var maxWidth =
|
|
35137
|
+
}, function (_ref17) {
|
|
35138
|
+
var maxWidth = _ref17.maxWidth;
|
|
35103
35139
|
return maxWidth && "\n max-width: " + maxWidth + "px;\n ";
|
|
35104
|
-
}, function (
|
|
35105
|
-
var shouldAnimate =
|
|
35140
|
+
}, function (_ref18) {
|
|
35141
|
+
var shouldAnimate = _ref18.shouldAnimate;
|
|
35106
35142
|
return shouldAnimate && "\n animation: fadeInSlideUp 0.3s ease-out 0.2s backwards;\n ";
|
|
35107
35143
|
});
|
|
35108
|
-
var Url = styled.p(_templateObject6$j || (_templateObject6$j = _taggedTemplateLiteralLoose(["\n ", "\n font-weight: normal;\n font-size: 13px;\n line-height: 16px;\n margin: 0 0 12px 0;\n padding: ", ";\n color: gray;\n box-sizing: border-box;\n ", "\n ", "\n"])), sharedKeyframes, function (
|
|
35109
|
-
var padding =
|
|
35144
|
+
var Url = styled.p(_templateObject6$j || (_templateObject6$j = _taggedTemplateLiteralLoose(["\n ", "\n font-weight: normal;\n font-size: 13px;\n line-height: 16px;\n margin: 0 0 12px 0;\n padding: ", ";\n color: gray;\n box-sizing: border-box;\n ", "\n ", "\n"])), sharedKeyframes, function (_ref19) {
|
|
35145
|
+
var padding = _ref19.padding;
|
|
35110
35146
|
return padding != null ? padding : '0';
|
|
35111
|
-
}, function (
|
|
35112
|
-
var maxWidth =
|
|
35147
|
+
}, function (_ref20) {
|
|
35148
|
+
var maxWidth = _ref20.maxWidth;
|
|
35113
35149
|
return maxWidth && "\n max-width: " + maxWidth + "px;\n ";
|
|
35114
|
-
}, function (
|
|
35115
|
-
var shouldAnimate =
|
|
35150
|
+
}, function (_ref21) {
|
|
35151
|
+
var shouldAnimate = _ref21.shouldAnimate;
|
|
35116
35152
|
return shouldAnimate && "\n animation: fadeInSlideUp 0.3s ease-out 0.3s backwards;\n ";
|
|
35117
35153
|
});
|
|
35118
|
-
var Img = styled.img(_templateObject7$h || (_templateObject7$h = _taggedTemplateLiteralLoose(["\n ", "\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n border-radius: inherit;\n ", "\n"])), sharedKeyframes, function (
|
|
35119
|
-
var shouldAnimate =
|
|
35154
|
+
var Img = styled.img(_templateObject7$h || (_templateObject7$h = _taggedTemplateLiteralLoose(["\n ", "\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n // object-fit: cover;\n // object-position: center;\n // image-rendering: auto;\n border-radius: inherit;\n ", "\n"])), sharedKeyframes, function (_ref22) {
|
|
35155
|
+
var shouldAnimate = _ref22.shouldAnimate;
|
|
35120
35156
|
return shouldAnimate && "\n animation: fadeIn 0.4s ease-out forwards;\n ";
|
|
35121
35157
|
});
|
|
35122
|
-
var OGRow = styled.div(_templateObject8$g || (_templateObject8$g = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n"])));
|
|
35158
|
+
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"])));
|
|
35123
35159
|
var OGTextWrapper = styled.div(_templateObject9$e || (_templateObject9$e = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n"])));
|
|
35124
|
-
var FaviconContainer = styled.div(_templateObject0$d || (_templateObject0$d = _taggedTemplateLiteralLoose(["\n width: 52px;\n height: 52px;\n border-radius: 8px;\n overflow: hidden;\n margin:
|
|
35160
|
+
var FaviconContainer = styled.div(_templateObject0$d || (_templateObject0$d = _taggedTemplateLiteralLoose(["\n width: 52px;\n height: 52px;\n border-radius: 8px;\n overflow: hidden;\n margin: 8px;\n flex: 0 0 52px;\n"])));
|
|
35125
35161
|
var FaviconImg = styled.img(_templateObject1$a || (_templateObject1$a = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n"])));
|
|
35126
35162
|
|
|
35127
35163
|
var _templateObject$G, _templateObject2$B, _templateObject3$v, _templateObject4$r, _templateObject5$m;
|
|
@@ -35350,6 +35386,41 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35350
35386
|
var selectionIsActive = useMemo(function () {
|
|
35351
35387
|
return selectedMessagesMap && selectedMessagesMap.size > 0;
|
|
35352
35388
|
}, [selectedMessagesMap]);
|
|
35389
|
+
var hasLongLinkAttachmentUrl = useMemo(function () {
|
|
35390
|
+
if (!linkAttachment || !linkAttachment.url) return false;
|
|
35391
|
+
return linkAttachment.url.length > 100;
|
|
35392
|
+
}, [linkAttachment]);
|
|
35393
|
+
var oGMetadata = useSelector(function (state) {
|
|
35394
|
+
return state.MessageReducer.oGMetadata;
|
|
35395
|
+
});
|
|
35396
|
+
var linkMetadata = useMemo(function () {
|
|
35397
|
+
if (!(linkAttachment !== null && linkAttachment !== void 0 && linkAttachment.url)) return null;
|
|
35398
|
+
return (oGMetadata === null || oGMetadata === void 0 ? void 0 : oGMetadata[linkAttachment.url]) || null;
|
|
35399
|
+
}, [oGMetadata, linkAttachment === null || linkAttachment === void 0 ? void 0 : linkAttachment.url]);
|
|
35400
|
+
var ogMetadataContainerWidth = useMemo(function () {
|
|
35401
|
+
var _linkMetadata$og, _linkMetadata$og$imag, _linkMetadata$og$imag2, _linkMetadata$og2, _linkMetadata$og3, _linkMetadata$og3$fav;
|
|
35402
|
+
if (!linkMetadata || !linkAttachment) return (ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxWidth) || 400;
|
|
35403
|
+
if (hasLongLinkAttachmentUrl) {
|
|
35404
|
+
return 400;
|
|
35405
|
+
}
|
|
35406
|
+
var hasImage = (linkMetadata === null || linkMetadata === void 0 ? void 0 : (_linkMetadata$og = linkMetadata.og) === null || _linkMetadata$og === void 0 ? void 0 : (_linkMetadata$og$imag = _linkMetadata$og.image) === null || _linkMetadata$og$imag === void 0 ? void 0 : (_linkMetadata$og$imag2 = _linkMetadata$og$imag[0]) === null || _linkMetadata$og$imag2 === void 0 ? void 0 : _linkMetadata$og$imag2.url) && (linkMetadata === null || linkMetadata === void 0 ? void 0 : linkMetadata.imageWidth) && (linkMetadata === null || linkMetadata === void 0 ? void 0 : linkMetadata.imageHeight);
|
|
35407
|
+
var imageWidth = linkMetadata === null || linkMetadata === void 0 ? void 0 : linkMetadata.imageWidth;
|
|
35408
|
+
var imageHeight = linkMetadata === null || linkMetadata === void 0 ? void 0 : linkMetadata.imageHeight;
|
|
35409
|
+
var calculatedImageHeight = imageWidth && imageHeight ? imageHeight / (imageWidth / ((ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxWidth) || 400)) : 0;
|
|
35410
|
+
var showImage = hasImage && calculatedImageHeight >= 180 && calculatedImageHeight <= 400;
|
|
35411
|
+
var hasDescription = linkMetadata === null || linkMetadata === void 0 ? void 0 : (_linkMetadata$og2 = linkMetadata.og) === null || _linkMetadata$og2 === void 0 ? void 0 : _linkMetadata$og2.description;
|
|
35412
|
+
var hasFavicon = (ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.ogShowFavicon) && (linkMetadata === null || linkMetadata === void 0 ? void 0 : linkMetadata.faviconLoaded) && (linkMetadata === null || linkMetadata === void 0 ? void 0 : (_linkMetadata$og3 = linkMetadata.og) === null || _linkMetadata$og3 === void 0 ? void 0 : (_linkMetadata$og3$fav = _linkMetadata$og3.favicon) === null || _linkMetadata$og3$fav === void 0 ? void 0 : _linkMetadata$og3$fav.url);
|
|
35413
|
+
if (showImage) {
|
|
35414
|
+
return 400;
|
|
35415
|
+
}
|
|
35416
|
+
if (hasDescription && hasFavicon) {
|
|
35417
|
+
return 336;
|
|
35418
|
+
}
|
|
35419
|
+
if (hasDescription) {
|
|
35420
|
+
return 356;
|
|
35421
|
+
}
|
|
35422
|
+
return (ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxWidth) || 400;
|
|
35423
|
+
}, [linkMetadata, linkAttachment, ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxWidth, ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.ogShowFavicon, hasLongLinkAttachmentUrl]);
|
|
35353
35424
|
var handleRemoveFailedAttachment = function handleRemoveFailedAttachment(attachmentId) {
|
|
35354
35425
|
log.info('remove attachment .. ', attachmentId);
|
|
35355
35426
|
};
|
|
@@ -35367,7 +35438,10 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35367
35438
|
},
|
|
35368
35439
|
borderRadius: borderRadius,
|
|
35369
35440
|
withAttachments: notLinkAttachment,
|
|
35370
|
-
|
|
35441
|
+
hasLinkAttachment: !!linkAttachment,
|
|
35442
|
+
hasLongLinkAttachmentUrl: hasLongLinkAttachmentUrl,
|
|
35443
|
+
attachmentWidth: withAttachments ? mediaAttachment ? attachmentMetas && getSendAttachmentsAsSeparateMessages() && attachmentMetas.szw && calculateRenderedImageWidth(attachmentMetas.szw, attachmentMetas.szh, mediaAttachment.type === attachmentTypes.image ? imageAttachmentMaxWidth : videoAttachmentMaxWidth, mediaAttachment.type === attachmentTypes.image ? imageAttachmentMaxHeight : videoAttachmentMaxHeight)[0] || 400 : message.attachments[0].type === attachmentTypes.voice ? 254 : message.attachments[0].type === attachmentTypes.file ? fileAttachmentsBoxWidth : undefined : undefined,
|
|
35444
|
+
ogMetadataMaxWidth: ogMetadataContainerWidth,
|
|
35371
35445
|
noBody: !message.body && !withAttachments,
|
|
35372
35446
|
onMouseEnter: handleMouseEnter,
|
|
35373
35447
|
onMouseLeave: handleMouseLeave
|
|
@@ -35523,7 +35597,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35523
35597
|
unsupportedMessage: unsupportedMessage,
|
|
35524
35598
|
unsupportedMessageColor: textSecondary
|
|
35525
35599
|
}, ogContainerFirst && linkAttachment && !mediaAttachment && !withMediaAttachment && !fileAttachment && (/*#__PURE__*/React__default.createElement(OGMetadata, {
|
|
35526
|
-
maxWidth:
|
|
35600
|
+
maxWidth: ogMetadataContainerWidth,
|
|
35527
35601
|
maxHeight: ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxHeight,
|
|
35528
35602
|
attachments: [linkAttachment],
|
|
35529
35603
|
state: message.state,
|
|
@@ -35562,7 +35636,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35562
35636
|
}))), !withAttachments && message.state === MESSAGE_STATUS.DELETE ? (/*#__PURE__*/React__default.createElement(MessageStatusDeleted$1, {
|
|
35563
35637
|
color: textSecondary
|
|
35564
35638
|
}, " Message was deleted. ")) : '', !ogContainerFirst && linkAttachment && !mediaAttachment && !withMediaAttachment && !fileAttachment && (/*#__PURE__*/React__default.createElement(OGMetadata, {
|
|
35565
|
-
maxWidth:
|
|
35639
|
+
maxWidth: ogMetadataContainerWidth,
|
|
35566
35640
|
maxHeight: ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.maxHeight,
|
|
35567
35641
|
attachments: [linkAttachment],
|
|
35568
35642
|
state: message.state,
|
|
@@ -35584,7 +35658,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35584
35658
|
ogContainerBackground: ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.ogContainerBackground,
|
|
35585
35659
|
infoPadding: ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.infoPadding,
|
|
35586
35660
|
isInviteLink: ogMetadataProps === null || ogMetadataProps === void 0 ? void 0 : ogMetadataProps.isInviteLink
|
|
35587
|
-
})), messageStatusAndTimePosition === 'onMessage' && !notLinkAttachment && (messageStatusVisible || messageTimeVisible) ? (/*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
35661
|
+
})), messageStatusAndTimePosition === 'onMessage' && !notLinkAttachment && !!linkAttachment && (messageStatusVisible || messageTimeVisible) ? (/*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
35588
35662
|
message: message,
|
|
35589
35663
|
showMessageTimeAndStatusOnlyOnHover: showMessageTimeAndStatusOnlyOnHover,
|
|
35590
35664
|
messageStatusDisplayingType: messageStatusDisplayingType,
|
|
@@ -35600,25 +35674,31 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
35600
35674
|
messageStatusVisible: !!messageStatusVisible,
|
|
35601
35675
|
leftMargin: true,
|
|
35602
35676
|
messageTimeColorOnAttachment: messageTimeColorOnAttachment || textSecondary
|
|
35603
|
-
})) : null), notLinkAttachment && messageStatusAndTimePosition === 'onMessage' && (messageStatusVisible || messageTimeVisible) && (
|
|
35604
|
-
message
|
|
35605
|
-
|
|
35606
|
-
|
|
35607
|
-
|
|
35608
|
-
|
|
35609
|
-
|
|
35610
|
-
|
|
35611
|
-
|
|
35612
|
-
|
|
35613
|
-
|
|
35614
|
-
|
|
35615
|
-
|
|
35616
|
-
|
|
35617
|
-
|
|
35618
|
-
|
|
35619
|
-
|
|
35620
|
-
|
|
35621
|
-
|
|
35677
|
+
})) : null), notLinkAttachment && messageStatusAndTimePosition === 'onMessage' && (messageStatusVisible || messageTimeVisible) && function () {
|
|
35678
|
+
var nonLinkAttachment = message.attachments.find(function (a) {
|
|
35679
|
+
return a.type !== attachmentTypes.link;
|
|
35680
|
+
});
|
|
35681
|
+
var attachmentType = nonLinkAttachment === null || nonLinkAttachment === void 0 ? void 0 : nonLinkAttachment.type;
|
|
35682
|
+
return /*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
35683
|
+
message: message,
|
|
35684
|
+
showMessageTimeAndStatusOnlyOnHover: showMessageTimeAndStatusOnlyOnHover,
|
|
35685
|
+
messageStatusDisplayingType: messageStatusDisplayingType,
|
|
35686
|
+
messageStatusSize: messageStatusSize,
|
|
35687
|
+
messageStatusColor: attachmentType === 'voice' ? textSecondary : attachmentType === 'image' || attachmentType === 'video' ? textOnPrimary : messageStateColor || textSecondary,
|
|
35688
|
+
messageReadStatusColor: messageReadStatusColor,
|
|
35689
|
+
messageStateFontSize: messageStateFontSize,
|
|
35690
|
+
messageStateColor: messageStateColor,
|
|
35691
|
+
messageTimeFontSize: messageTimeFontSize,
|
|
35692
|
+
messageTimeColor: messageTimeColor,
|
|
35693
|
+
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight,
|
|
35694
|
+
messageTimeVisible: !!messageTimeVisible,
|
|
35695
|
+
messageStatusVisible: !!messageStatusVisible,
|
|
35696
|
+
withAttachment: withAttachments,
|
|
35697
|
+
leftMargin: true,
|
|
35698
|
+
fileAttachment: withAttachments && (attachmentType === 'file' || attachmentType === 'voice'),
|
|
35699
|
+
messageTimeColorOnAttachment: attachmentType === 'voice' ? textSecondary : attachmentType === 'image' || attachmentType === 'video' ? textOnPrimary : textSecondary
|
|
35700
|
+
});
|
|
35701
|
+
}(), withAttachments && message.attachments.map(function (attachment) {
|
|
35622
35702
|
return /*#__PURE__*/React__default.createElement(Attachment$1, {
|
|
35623
35703
|
key: attachment.tid || attachment.url,
|
|
35624
35704
|
handleMediaItemClick: selectionIsActive ? undefined : handleMediaItemClick,
|
|
@@ -35691,7 +35771,7 @@ var MessageStatusDeleted$1 = styled.span(_templateObject2$B || (_templateObject2
|
|
|
35691
35771
|
}, function (props) {
|
|
35692
35772
|
return props.fontSize;
|
|
35693
35773
|
});
|
|
35694
|
-
var MessageBodyContainer = styled.div(_templateObject3$v || (_templateObject3$v = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: ", ";\n //display: inline-block;\n border-radius: ", ";\n direction: ", ";\n max-width: ", ";\n width:
|
|
35774
|
+
var MessageBodyContainer = styled.div(_templateObject3$v || (_templateObject3$v = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: ", ";\n //display: inline-block;\n border-radius: ", ";\n direction: ", ";\n max-width: ", ";\n width: ", ";\n overflow-wrap: break-word;\n word-break: break-word;\n\n ", "\n padding: ", ";\n //direction: ", ";\n //overflow: ", ";\n transition: all 0.3s;\n transform-origin: right;\n"])), function (props) {
|
|
35695
35775
|
var _props$outgoingMessag, _props$incomingMessag;
|
|
35696
35776
|
return props.isSelfMessage ? (_props$outgoingMessag = props.outgoingMessageStyles) === null || _props$outgoingMessag === void 0 ? void 0 : _props$outgoingMessag.background : (_props$incomingMessag = props.incomingMessageStyles) === null || _props$incomingMessag === void 0 ? void 0 : _props$incomingMessag.background;
|
|
35697
35777
|
}, function (props) {
|
|
@@ -35699,10 +35779,14 @@ var MessageBodyContainer = styled.div(_templateObject3$v || (_templateObject3$v
|
|
|
35699
35779
|
}, function (props) {
|
|
35700
35780
|
return props.rtlDirection ? 'initial' : '';
|
|
35701
35781
|
}, function (props) {
|
|
35702
|
-
return props.withAttachments ? props.attachmentWidth && props.attachmentWidth <
|
|
35782
|
+
return props.hasLinkAttachment && !props.withAttachments ? props.ogMetadataMaxWidth ? props.ogMetadataMaxWidth + "px" : '416px' : props.hasLongLinkAttachmentUrl && !props.withAttachments ? '400px' : props.withAttachments ? props.attachmentWidth && props.attachmentWidth < 400 ? props.attachmentWidth < 165 ? props.isReplyMessage ? '210px' : '165px' : props.attachmentWidth + "px" : '400px' : '100%';
|
|
35783
|
+
}, function (props) {
|
|
35784
|
+
return props.hasLinkAttachment && !props.withAttachments && props.ogMetadataMaxWidth ? props.ogMetadataMaxWidth + "px" : props.hasLongLinkAttachmentUrl && !props.withAttachments ? '416px' : 'max-content';
|
|
35785
|
+
}, function (props) {
|
|
35786
|
+
return props.hasLongLinkAttachmentUrl && "\n & a {\n overflow-wrap: anywhere;\n word-break: break-all;\n white-space: normal;\n max-width: " + (props.withAttachments ? '400px' : props.hasLinkAttachment && props.ogMetadataMaxWidth ? props.ogMetadataMaxWidth + "px" : '416px') + ";\n }\n ";
|
|
35703
35787
|
}, function (props) {
|
|
35704
35788
|
var _props$outgoingMessag2, _props$incomingMessag2;
|
|
35705
|
-
return props.withAttachments ? props.isReplyMessage ? '1px 0 0 ' : '0' : props.isSelfMessage ? ((_props$outgoingMessag2 = props.outgoingMessageStyles) === null || _props$outgoingMessag2 === void 0 ? void 0 : _props$outgoingMessag2.background) === 'inherit' ? '0' : '8px 12px' : ((_props$incomingMessag2 = props.incomingMessageStyles) === null || _props$incomingMessag2 === void 0 ? void 0 : _props$incomingMessag2.background) === 'inherit' ? ' 0' : '8px 12px';
|
|
35789
|
+
return props.withAttachments ? props.isReplyMessage ? '1px 0 0 ' : '0' : props.hasLinkAttachment ? '8px' : props.isSelfMessage ? ((_props$outgoingMessag2 = props.outgoingMessageStyles) === null || _props$outgoingMessag2 === void 0 ? void 0 : _props$outgoingMessag2.background) === 'inherit' ? '0' : '8px 12px' : ((_props$incomingMessag2 = props.incomingMessageStyles) === null || _props$incomingMessag2 === void 0 ? void 0 : _props$incomingMessag2.background) === 'inherit' ? ' 0' : '8px 12px';
|
|
35706
35790
|
}, function (props) {
|
|
35707
35791
|
return props.isSelfMessage ? 'initial' : '';
|
|
35708
35792
|
}, function (props) {
|
|
@@ -36522,20 +36606,20 @@ var Message$1 = function Message(_ref) {
|
|
|
36522
36606
|
setFrequentlyEmojisOpen(false);
|
|
36523
36607
|
};
|
|
36524
36608
|
var handleSendReadMarker = function handleSendReadMarker() {
|
|
36525
|
-
if (isVisible && message.incoming && !(message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
|
|
36526
|
-
return marker.name === MESSAGE_DELIVERY_STATUS.READ;
|
|
36527
|
-
})) && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
36528
|
-
dispatch(markMessagesAsReadAC(channel.id, [message.id]));
|
|
36529
|
-
}
|
|
36530
36609
|
if (!message.userMarkers.find(function (marker) {
|
|
36531
36610
|
return marker.name === MESSAGE_DELIVERY_STATUS.DELIVERED;
|
|
36532
36611
|
})) {
|
|
36533
36612
|
if (message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
|
|
36534
36613
|
return marker.name === MESSAGE_DELIVERY_STATUS.READ;
|
|
36535
|
-
})) {
|
|
36614
|
+
}) && message.incoming) {
|
|
36536
36615
|
dispatch(markMessagesAsDeliveredAC(channel.id, [message.id]));
|
|
36537
36616
|
}
|
|
36538
36617
|
}
|
|
36618
|
+
if (isVisible && message.incoming && !(message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
|
|
36619
|
+
return marker.name === MESSAGE_DELIVERY_STATUS.READ;
|
|
36620
|
+
})) && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
36621
|
+
dispatch(markMessagesAsReadAC(channel.id, [message.id]));
|
|
36622
|
+
}
|
|
36539
36623
|
};
|
|
36540
36624
|
var handleForwardMessage = function handleForwardMessage(channelIds) {
|
|
36541
36625
|
if (channelIds && channelIds.length) {
|