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