sceyt-chat-react-uikit 1.6.8-beta.2 → 1.6.8-beta.3
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/index.js +411 -328
- package/index.modern.js +412 -329
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -11482,7 +11482,66 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11482
11482
|
}
|
|
11483
11483
|
};
|
|
11484
11484
|
|
|
11485
|
-
var _marked = /*#__PURE__*/_regeneratorRuntime().mark(
|
|
11485
|
+
var _marked = /*#__PURE__*/_regeneratorRuntime().mark(updateActiveChannelMembersAdd),
|
|
11486
|
+
_marked2 = /*#__PURE__*/_regeneratorRuntime().mark(updateActiveChannelMembersRemove);
|
|
11487
|
+
function updateActiveChannelMembersAdd(addedMembers) {
|
|
11488
|
+
var state, activeChannel, updatedMembers;
|
|
11489
|
+
return _regeneratorRuntime().wrap(function updateActiveChannelMembersAdd$(_context) {
|
|
11490
|
+
while (1) switch (_context.prev = _context.next) {
|
|
11491
|
+
case 0:
|
|
11492
|
+
_context.next = 2;
|
|
11493
|
+
return effects.select();
|
|
11494
|
+
case 2:
|
|
11495
|
+
state = _context.sent;
|
|
11496
|
+
activeChannel = state.ChannelReducer.activeChannel;
|
|
11497
|
+
if (!(activeChannel && activeChannel.id)) {
|
|
11498
|
+
_context.next = 9;
|
|
11499
|
+
break;
|
|
11500
|
+
}
|
|
11501
|
+
updatedMembers = [].concat(activeChannel.members || [], addedMembers);
|
|
11502
|
+
updatedMembers = Array.from(new Set(updatedMembers));
|
|
11503
|
+
_context.next = 9;
|
|
11504
|
+
return effects.put(updateChannelDataAC(activeChannel.id, {
|
|
11505
|
+
members: updatedMembers
|
|
11506
|
+
}));
|
|
11507
|
+
case 9:
|
|
11508
|
+
case "end":
|
|
11509
|
+
return _context.stop();
|
|
11510
|
+
}
|
|
11511
|
+
}, _marked);
|
|
11512
|
+
}
|
|
11513
|
+
function updateActiveChannelMembersRemove(removedMembers) {
|
|
11514
|
+
var state, activeChannel, updatedMembers;
|
|
11515
|
+
return _regeneratorRuntime().wrap(function updateActiveChannelMembersRemove$(_context2) {
|
|
11516
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
11517
|
+
case 0:
|
|
11518
|
+
_context2.next = 2;
|
|
11519
|
+
return effects.select();
|
|
11520
|
+
case 2:
|
|
11521
|
+
state = _context2.sent;
|
|
11522
|
+
activeChannel = state.ChannelReducer.activeChannel;
|
|
11523
|
+
if (!(activeChannel && activeChannel.id)) {
|
|
11524
|
+
_context2.next = 9;
|
|
11525
|
+
break;
|
|
11526
|
+
}
|
|
11527
|
+
updatedMembers = (activeChannel.members || []).filter(function (member) {
|
|
11528
|
+
return !removedMembers.find(function (removed) {
|
|
11529
|
+
return removed.id === member.id;
|
|
11530
|
+
});
|
|
11531
|
+
});
|
|
11532
|
+
updatedMembers = Array.from(new Set(updatedMembers));
|
|
11533
|
+
_context2.next = 9;
|
|
11534
|
+
return effects.put(updateChannelDataAC(activeChannel.id, {
|
|
11535
|
+
members: updatedMembers
|
|
11536
|
+
}));
|
|
11537
|
+
case 9:
|
|
11538
|
+
case "end":
|
|
11539
|
+
return _context2.stop();
|
|
11540
|
+
}
|
|
11541
|
+
}, _marked2);
|
|
11542
|
+
}
|
|
11543
|
+
|
|
11544
|
+
var _marked$1 = /*#__PURE__*/_regeneratorRuntime().mark(watchForEvents);
|
|
11486
11545
|
function watchForEvents() {
|
|
11487
11546
|
var SceytChatClient, channelListener, connectionListener, usersTimeout, chan, _loop;
|
|
11488
11547
|
return _regeneratorRuntime().wrap(function watchForEvents$(_context2) {
|
|
@@ -11852,7 +11911,7 @@ function watchForEvents() {
|
|
|
11852
11911
|
type = _yield$take.type;
|
|
11853
11912
|
args = _yield$take.args;
|
|
11854
11913
|
_context.t0 = type;
|
|
11855
|
-
_context.next = _context.t0 === CHANNEL_EVENT_TYPES.CREATE ? 8 : _context.t0 === CHANNEL_EVENT_TYPES.JOIN ? 25 : _context.t0 === CHANNEL_EVENT_TYPES.LEAVE ? 34 : _context.t0 === CHANNEL_EVENT_TYPES.BLOCK ?
|
|
11914
|
+
_context.next = _context.t0 === CHANNEL_EVENT_TYPES.CREATE ? 8 : _context.t0 === CHANNEL_EVENT_TYPES.JOIN ? 25 : _context.t0 === CHANNEL_EVENT_TYPES.LEAVE ? 34 : _context.t0 === CHANNEL_EVENT_TYPES.BLOCK ? 60 : _context.t0 === CHANNEL_EVENT_TYPES.UNBLOCK ? 67 : _context.t0 === CHANNEL_EVENT_TYPES.KICK_MEMBERS ? 69 : _context.t0 === CHANNEL_EVENT_TYPES.ADD_MEMBERS ? 100 : _context.t0 === CHANNEL_EVENT_TYPES.UPDATE_CHANNEL ? 125 : _context.t0 === CHANNEL_EVENT_TYPES.MESSAGE ? 142 : _context.t0 === CHANNEL_EVENT_TYPES.MESSAGE_MARKERS_RECEIVED ? 209 : _context.t0 === CHANNEL_EVENT_TYPES.DELETE ? 232 : _context.t0 === CHANNEL_EVENT_TYPES.DELETE_MESSAGE ? 239 : _context.t0 === CHANNEL_EVENT_TYPES.EDIT_MESSAGE ? 256 : _context.t0 === CHANNEL_EVENT_TYPES.REACTION_ADDED ? 271 : _context.t0 === CHANNEL_EVENT_TYPES.REACTION_DELETED ? 299 : _context.t0 === CHANNEL_EVENT_TYPES.UNREAD_MESSAGES_INFO ? 315 : _context.t0 === CHANNEL_EVENT_TYPES.CLEAR_HISTORY ? 322 : _context.t0 === CHANNEL_EVENT_TYPES.MUTE ? 340 : _context.t0 === CHANNEL_EVENT_TYPES.UNMUTE ? 346 : _context.t0 === CHANNEL_EVENT_TYPES.PINED ? 352 : _context.t0 === CHANNEL_EVENT_TYPES.UNPINED ? 358 : _context.t0 === CHANNEL_EVENT_TYPES.HIDE ? 364 : _context.t0 === CHANNEL_EVENT_TYPES.UNHIDE ? 369 : _context.t0 === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_UNREAD ? 374 : _context.t0 === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_READ ? 382 : _context.t0 === CHANNEL_EVENT_TYPES.CHANGE_ROLE ? 390 : _context.t0 === CHANNEL_EVENT_TYPES.FROZEN ? 409 : _context.t0 === CHANNEL_EVENT_TYPES.UNFROZEN ? 412 : _context.t0 === CHANNEL_EVENT_TYPES.CHANNEL_EVENT ? 415 : _context.t0 === CONNECTION_EVENT_TYPES.CONNECTION_STATUS_CHANGED ? 446 : 454;
|
|
11856
11915
|
break;
|
|
11857
11916
|
case 8:
|
|
11858
11917
|
createdChannel = args.createdChannel;
|
|
@@ -11886,7 +11945,7 @@ function watchForEvents() {
|
|
|
11886
11945
|
addChannelToAllChannels(createdChannel);
|
|
11887
11946
|
}
|
|
11888
11947
|
case 24:
|
|
11889
|
-
return _context.abrupt("break",
|
|
11948
|
+
return _context.abrupt("break", 455);
|
|
11890
11949
|
case 25:
|
|
11891
11950
|
channel = args.channel;
|
|
11892
11951
|
log.info('channel JOIN ... . ', channel);
|
|
@@ -11897,7 +11956,7 @@ function watchForEvents() {
|
|
|
11897
11956
|
if (!_chan2) {
|
|
11898
11957
|
addChannelToAllChannels(channel);
|
|
11899
11958
|
}
|
|
11900
|
-
return _context.abrupt("break",
|
|
11959
|
+
return _context.abrupt("break", 455);
|
|
11901
11960
|
case 34:
|
|
11902
11961
|
_channel = args.channel, member = args.member;
|
|
11903
11962
|
log.info('channel LEAVE ... ', _channel, member);
|
|
@@ -11915,208 +11974,217 @@ function watchForEvents() {
|
|
|
11915
11974
|
case 43:
|
|
11916
11975
|
removeChannelFromMap(_channel.id);
|
|
11917
11976
|
deleteChannelFromAllChannels(_channel.id);
|
|
11918
|
-
_context.next =
|
|
11977
|
+
_context.next = 59;
|
|
11919
11978
|
break;
|
|
11920
11979
|
case 47:
|
|
11921
11980
|
groupName = getChannelGroupName(_channel);
|
|
11922
11981
|
if (!_channelExists) {
|
|
11923
|
-
_context.next =
|
|
11982
|
+
_context.next = 56;
|
|
11924
11983
|
break;
|
|
11925
11984
|
}
|
|
11926
11985
|
if (!(_activeChannelId === _channel.id)) {
|
|
11927
|
-
_context.next =
|
|
11986
|
+
_context.next = 54;
|
|
11928
11987
|
break;
|
|
11929
11988
|
}
|
|
11930
11989
|
_context.next = 52;
|
|
11931
11990
|
return effects.put(removeMemberFromListAC([member]));
|
|
11932
11991
|
case 52:
|
|
11933
11992
|
_context.next = 54;
|
|
11993
|
+
return updateActiveChannelMembersRemove([member]);
|
|
11994
|
+
case 54:
|
|
11995
|
+
_context.next = 56;
|
|
11934
11996
|
return effects.put(updateChannelDataAC(_channel.id, {
|
|
11935
11997
|
memberCount: _channel.memberCount,
|
|
11936
11998
|
muted: _channel.muted,
|
|
11937
11999
|
mutedTill: _channel.mutedTill
|
|
11938
12000
|
}));
|
|
11939
|
-
case
|
|
11940
|
-
_context.next =
|
|
12001
|
+
case 56:
|
|
12002
|
+
_context.next = 58;
|
|
11941
12003
|
return effects.put(updateSearchedChannelDataAC(_channel.id, {
|
|
11942
12004
|
memberCount: _channel.memberCount,
|
|
11943
12005
|
muted: _channel.muted,
|
|
11944
12006
|
mutedTill: _channel.mutedTill
|
|
11945
12007
|
}, groupName));
|
|
11946
|
-
case
|
|
12008
|
+
case 58:
|
|
11947
12009
|
updateChannelOnAllChannels(_channel.id, {
|
|
11948
12010
|
memberCount: _channel.memberCount,
|
|
11949
12011
|
muted: _channel.muted,
|
|
11950
12012
|
mutedTill: _channel.mutedTill
|
|
11951
12013
|
});
|
|
11952
|
-
case
|
|
11953
|
-
return _context.abrupt("break",
|
|
11954
|
-
case
|
|
12014
|
+
case 59:
|
|
12015
|
+
return _context.abrupt("break", 455);
|
|
12016
|
+
case 60:
|
|
11955
12017
|
log.info('channel BLOCK ... ');
|
|
11956
12018
|
_channel2 = args.channel;
|
|
11957
12019
|
_channelExists2 = checkChannelExists(_channel2.id);
|
|
11958
12020
|
if (!_channelExists2) {
|
|
11959
|
-
_context.next =
|
|
12021
|
+
_context.next = 66;
|
|
11960
12022
|
break;
|
|
11961
12023
|
}
|
|
11962
|
-
_context.next =
|
|
12024
|
+
_context.next = 66;
|
|
11963
12025
|
return effects.put(removeChannelAC(_channel2.id));
|
|
11964
|
-
case
|
|
11965
|
-
return _context.abrupt("break",
|
|
11966
|
-
case 65:
|
|
11967
|
-
log.info('channel UNBLOCK ... ');
|
|
11968
|
-
return _context.abrupt("break", 449);
|
|
12026
|
+
case 66:
|
|
12027
|
+
return _context.abrupt("break", 455);
|
|
11969
12028
|
case 67:
|
|
12029
|
+
log.info('channel UNBLOCK ... ');
|
|
12030
|
+
return _context.abrupt("break", 455);
|
|
12031
|
+
case 69:
|
|
11970
12032
|
_channel3 = args.channel, removedMembers = args.removedMembers;
|
|
11971
12033
|
log.info('channel KICK_MEMBERS ... ', removedMembers);
|
|
11972
|
-
_context.next =
|
|
12034
|
+
_context.next = 73;
|
|
11973
12035
|
return effects.call(getActiveChannelId);
|
|
11974
|
-
case
|
|
12036
|
+
case 73:
|
|
11975
12037
|
_activeChannelId2 = _context.sent;
|
|
11976
12038
|
_channelExists3 = checkChannelExists(_channel3.id);
|
|
11977
12039
|
if (!_channelExists3) {
|
|
11978
|
-
_context.next =
|
|
12040
|
+
_context.next = 98;
|
|
11979
12041
|
break;
|
|
11980
12042
|
}
|
|
11981
12043
|
if (!removedMembers.find(function (mem) {
|
|
11982
12044
|
return mem.id === SceytChatClient.user.id;
|
|
11983
12045
|
})) {
|
|
11984
|
-
_context.next =
|
|
12046
|
+
_context.next = 88;
|
|
11985
12047
|
break;
|
|
11986
12048
|
}
|
|
11987
12049
|
removeChannelFromMap(_channel3.id);
|
|
11988
|
-
_context.next = 78;
|
|
11989
|
-
return effects.put(removeChannelAC(_channel3.id));
|
|
11990
|
-
case 78:
|
|
11991
12050
|
_context.next = 80;
|
|
11992
|
-
return effects.
|
|
12051
|
+
return effects.put(removeChannelAC(_channel3.id));
|
|
11993
12052
|
case 80:
|
|
12053
|
+
_context.next = 82;
|
|
12054
|
+
return effects.call(getLastChannelFromMap);
|
|
12055
|
+
case 82:
|
|
11994
12056
|
activeChannel = _context.sent;
|
|
11995
12057
|
if (!activeChannel) {
|
|
11996
|
-
_context.next =
|
|
12058
|
+
_context.next = 86;
|
|
11997
12059
|
break;
|
|
11998
12060
|
}
|
|
11999
|
-
_context.next =
|
|
12061
|
+
_context.next = 86;
|
|
12000
12062
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
12001
|
-
case 84:
|
|
12002
|
-
_context.next = 94;
|
|
12003
|
-
break;
|
|
12004
12063
|
case 86:
|
|
12064
|
+
_context.next = 98;
|
|
12065
|
+
break;
|
|
12066
|
+
case 88:
|
|
12005
12067
|
if (!(_activeChannelId2 === _channel3.id)) {
|
|
12006
|
-
_context.next =
|
|
12068
|
+
_context.next = 93;
|
|
12007
12069
|
break;
|
|
12008
12070
|
}
|
|
12009
|
-
_context.next =
|
|
12071
|
+
_context.next = 91;
|
|
12010
12072
|
return effects.put(removeMemberFromListAC(removedMembers));
|
|
12011
|
-
case
|
|
12073
|
+
case 91:
|
|
12074
|
+
_context.next = 93;
|
|
12075
|
+
return updateActiveChannelMembersRemove(removedMembers);
|
|
12076
|
+
case 93:
|
|
12012
12077
|
_groupName = getChannelGroupName(_channel3);
|
|
12013
|
-
_context.next =
|
|
12078
|
+
_context.next = 96;
|
|
12014
12079
|
return effects.put(updateSearchedChannelDataAC(_channel3.id, {
|
|
12015
12080
|
memberCount: _channel3.memberCount,
|
|
12016
12081
|
muted: _channel3.muted,
|
|
12017
12082
|
mutedTill: _channel3.mutedTill
|
|
12018
12083
|
}, _groupName));
|
|
12019
|
-
case
|
|
12020
|
-
_context.next =
|
|
12084
|
+
case 96:
|
|
12085
|
+
_context.next = 98;
|
|
12021
12086
|
return effects.put(updateChannelDataAC(_channel3.id, {
|
|
12022
12087
|
memberCount: _channel3.memberCount,
|
|
12023
12088
|
muted: _channel3.muted,
|
|
12024
12089
|
mutedTill: _channel3.mutedTill
|
|
12025
12090
|
}));
|
|
12026
|
-
case
|
|
12091
|
+
case 98:
|
|
12027
12092
|
updateChannelOnAllChannels(_channel3.id, {
|
|
12028
12093
|
memberCount: _channel3.memberCount,
|
|
12029
12094
|
muted: _channel3.muted,
|
|
12030
12095
|
mutedTill: _channel3.mutedTill
|
|
12031
12096
|
});
|
|
12032
|
-
return _context.abrupt("break",
|
|
12033
|
-
case
|
|
12097
|
+
return _context.abrupt("break", 455);
|
|
12098
|
+
case 100:
|
|
12034
12099
|
_channel4 = args.channel, addedMembers = args.addedMembers;
|
|
12035
12100
|
log.info('channel ADD_MEMBERS ... ', addedMembers);
|
|
12036
|
-
_context.next =
|
|
12101
|
+
_context.next = 104;
|
|
12037
12102
|
return effects.call(getActiveChannelId);
|
|
12038
|
-
case
|
|
12103
|
+
case 104:
|
|
12039
12104
|
_activeChannelId3 = _context.sent;
|
|
12040
12105
|
_channelExists4 = checkChannelExists(_channel4.id);
|
|
12041
12106
|
if (!_channelExists4) {
|
|
12042
|
-
_context.next =
|
|
12107
|
+
_context.next = 116;
|
|
12043
12108
|
break;
|
|
12044
12109
|
}
|
|
12045
12110
|
if (!(_activeChannelId3 === _channel4.id)) {
|
|
12046
|
-
_context.next =
|
|
12111
|
+
_context.next = 112;
|
|
12047
12112
|
break;
|
|
12048
12113
|
}
|
|
12049
|
-
_context.next =
|
|
12114
|
+
_context.next = 110;
|
|
12050
12115
|
return effects.put(addMembersToListAC(addedMembers));
|
|
12051
|
-
case
|
|
12052
|
-
_context.next =
|
|
12116
|
+
case 110:
|
|
12117
|
+
_context.next = 112;
|
|
12118
|
+
return updateActiveChannelMembersAdd(addedMembers);
|
|
12119
|
+
case 112:
|
|
12120
|
+
_context.next = 114;
|
|
12053
12121
|
return effects.put(updateChannelDataAC(_channel4.id, {
|
|
12054
12122
|
memberCount: _channel4.memberCount,
|
|
12055
12123
|
muted: _channel4.muted,
|
|
12056
12124
|
mutedTill: _channel4.mutedTill
|
|
12057
12125
|
}));
|
|
12058
|
-
case
|
|
12059
|
-
_context.next =
|
|
12126
|
+
case 114:
|
|
12127
|
+
_context.next = 120;
|
|
12060
12128
|
break;
|
|
12061
|
-
case
|
|
12062
|
-
_context.next =
|
|
12129
|
+
case 116:
|
|
12130
|
+
_context.next = 118;
|
|
12063
12131
|
return effects.call(setChannelInMap, _channel4);
|
|
12064
|
-
case
|
|
12065
|
-
_context.next =
|
|
12132
|
+
case 118:
|
|
12133
|
+
_context.next = 120;
|
|
12066
12134
|
return effects.put(setAddedToChannelAC(JSON.parse(JSON.stringify(_channel4))));
|
|
12067
|
-
case
|
|
12135
|
+
case 120:
|
|
12068
12136
|
_groupName2 = getChannelGroupName(_channel4);
|
|
12069
|
-
_context.next =
|
|
12137
|
+
_context.next = 123;
|
|
12070
12138
|
return effects.put(updateSearchedChannelDataAC(_channel4.id, {
|
|
12071
12139
|
memberCount: _channel4.memberCount,
|
|
12072
12140
|
muted: _channel4.muted,
|
|
12073
12141
|
mutedTill: _channel4.mutedTill
|
|
12074
12142
|
}, _groupName2));
|
|
12075
|
-
case
|
|
12143
|
+
case 123:
|
|
12076
12144
|
updateChannelOnAllChannels(_channel4.id, {
|
|
12077
12145
|
memberCount: _channel4.memberCount,
|
|
12078
12146
|
muted: _channel4.muted,
|
|
12079
12147
|
mutedTill: _channel4.mutedTill
|
|
12080
12148
|
});
|
|
12081
|
-
return _context.abrupt("break",
|
|
12082
|
-
case
|
|
12149
|
+
return _context.abrupt("break", 455);
|
|
12150
|
+
case 125:
|
|
12083
12151
|
updatedChannel = args.updatedChannel;
|
|
12084
12152
|
_channelExists5 = checkChannelExists(updatedChannel.id);
|
|
12085
12153
|
subject = updatedChannel.subject, avatarUrl = updatedChannel.avatarUrl, muted = updatedChannel.muted, mutedTill = updatedChannel.mutedTill, metadata = updatedChannel.metadata;
|
|
12086
12154
|
if (!_channelExists5) {
|
|
12087
|
-
_context.next =
|
|
12155
|
+
_context.next = 137;
|
|
12088
12156
|
break;
|
|
12089
12157
|
}
|
|
12090
|
-
_context.next =
|
|
12158
|
+
_context.next = 131;
|
|
12091
12159
|
return effects.put(updateChannelDataAC(updatedChannel.id, {
|
|
12092
12160
|
subject: subject,
|
|
12093
12161
|
avatarUrl: avatarUrl,
|
|
12094
12162
|
muted: muted,
|
|
12095
12163
|
mutedTill: mutedTill
|
|
12096
12164
|
}));
|
|
12097
|
-
case
|
|
12098
|
-
_context.next =
|
|
12165
|
+
case 131:
|
|
12166
|
+
_context.next = 133;
|
|
12099
12167
|
return effects.call(getActiveChannelId);
|
|
12100
|
-
case
|
|
12168
|
+
case 133:
|
|
12101
12169
|
_activeChannelId4 = _context.sent;
|
|
12102
12170
|
if (!(_activeChannelId4 === updatedChannel.id)) {
|
|
12103
|
-
_context.next =
|
|
12171
|
+
_context.next = 137;
|
|
12104
12172
|
break;
|
|
12105
12173
|
}
|
|
12106
|
-
_context.next =
|
|
12174
|
+
_context.next = 137;
|
|
12107
12175
|
return effects.put(setActiveChannelAC(_extends({}, updatedChannel, {
|
|
12108
12176
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
12109
12177
|
})));
|
|
12110
|
-
case
|
|
12178
|
+
case 137:
|
|
12111
12179
|
_groupName3 = getChannelGroupName(updatedChannel);
|
|
12112
|
-
_context.next =
|
|
12180
|
+
_context.next = 140;
|
|
12113
12181
|
return effects.put(updateSearchedChannelDataAC(updatedChannel.id, {
|
|
12114
12182
|
subject: subject,
|
|
12115
12183
|
avatarUrl: avatarUrl,
|
|
12116
12184
|
muted: muted,
|
|
12117
12185
|
mutedTill: mutedTill
|
|
12118
12186
|
}, _groupName3));
|
|
12119
|
-
case
|
|
12187
|
+
case 140:
|
|
12120
12188
|
updateChannelOnAllChannels(updatedChannel.id, {
|
|
12121
12189
|
subject: subject,
|
|
12122
12190
|
avatarUrl: avatarUrl,
|
|
@@ -12124,102 +12192,102 @@ function watchForEvents() {
|
|
|
12124
12192
|
mutedTill: mutedTill,
|
|
12125
12193
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
12126
12194
|
});
|
|
12127
|
-
return _context.abrupt("break",
|
|
12128
|
-
case
|
|
12195
|
+
return _context.abrupt("break", 455);
|
|
12196
|
+
case 142:
|
|
12129
12197
|
_channel5 = args.channel, message = args.message;
|
|
12130
12198
|
log.info('channel MESSAGE ... id : ', message.id, ' message: ', message, ' channel.id: ', _channel5.id);
|
|
12131
12199
|
messageToHandle = handleNewMessages ? handleNewMessages(message, _channel5) : message;
|
|
12132
12200
|
_channelFilterTypes = getChannelTypesFilter();
|
|
12133
12201
|
if (!(messageToHandle && _channel5 && (_channelFilterTypes !== null && _channelFilterTypes !== void 0 && _channelFilterTypes.length ? _channelFilterTypes.includes(_channel5.type) : true))) {
|
|
12134
|
-
_context.next =
|
|
12202
|
+
_context.next = 208;
|
|
12135
12203
|
break;
|
|
12136
12204
|
}
|
|
12137
12205
|
_channel5.metadata = isJSON(_channel5.metadata) ? JSON.parse(_channel5.metadata) : _channel5.metadata;
|
|
12138
|
-
_context.next =
|
|
12206
|
+
_context.next = 150;
|
|
12139
12207
|
return effects.call(getActiveChannelId);
|
|
12140
|
-
case
|
|
12208
|
+
case 150:
|
|
12141
12209
|
_activeChannelId5 = _context.sent;
|
|
12142
12210
|
_channelExists6 = checkChannelExists(_channel5.id);
|
|
12143
12211
|
channelForAdd = JSON.parse(JSON.stringify(_channel5));
|
|
12144
|
-
_context.next =
|
|
12212
|
+
_context.next = 155;
|
|
12145
12213
|
return effects.put(addChannelAC(channelForAdd));
|
|
12146
|
-
case
|
|
12214
|
+
case 155:
|
|
12147
12215
|
if (_channelExists6) {
|
|
12148
|
-
_context.next =
|
|
12216
|
+
_context.next = 160;
|
|
12149
12217
|
break;
|
|
12150
12218
|
}
|
|
12151
|
-
_context.next =
|
|
12219
|
+
_context.next = 158;
|
|
12152
12220
|
return effects.call(setChannelInMap, _channel5);
|
|
12153
|
-
case
|
|
12154
|
-
_context.next =
|
|
12221
|
+
case 158:
|
|
12222
|
+
_context.next = 163;
|
|
12155
12223
|
break;
|
|
12156
|
-
case
|
|
12224
|
+
case 160:
|
|
12157
12225
|
if (message.repliedInThread) {
|
|
12158
|
-
_context.next =
|
|
12226
|
+
_context.next = 163;
|
|
12159
12227
|
break;
|
|
12160
12228
|
}
|
|
12161
|
-
_context.next =
|
|
12229
|
+
_context.next = 163;
|
|
12162
12230
|
return effects.put(updateChannelLastMessageAC(message, channelForAdd));
|
|
12163
|
-
case
|
|
12231
|
+
case 163:
|
|
12164
12232
|
if (!(_channel5.id === _activeChannelId5)) {
|
|
12165
|
-
_context.next =
|
|
12233
|
+
_context.next = 175;
|
|
12166
12234
|
break;
|
|
12167
12235
|
}
|
|
12168
12236
|
if (getHasNextCached()) {
|
|
12169
|
-
_context.next =
|
|
12237
|
+
_context.next = 167;
|
|
12170
12238
|
break;
|
|
12171
12239
|
}
|
|
12172
|
-
_context.next =
|
|
12240
|
+
_context.next = 167;
|
|
12173
12241
|
return effects.put(addMessageAC(message));
|
|
12174
|
-
case
|
|
12242
|
+
case 167:
|
|
12175
12243
|
addAllMessages([message], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
12176
|
-
_context.next =
|
|
12244
|
+
_context.next = 171;
|
|
12177
12245
|
return effects.select(messagesHasNextSelector);
|
|
12178
|
-
case
|
|
12246
|
+
case 171:
|
|
12179
12247
|
hasNextMessage = _context.sent;
|
|
12180
12248
|
if (!(!getHasNextCached() && !hasNextMessage)) {
|
|
12181
|
-
_context.next =
|
|
12249
|
+
_context.next = 175;
|
|
12182
12250
|
break;
|
|
12183
12251
|
}
|
|
12184
|
-
_context.next =
|
|
12252
|
+
_context.next = 175;
|
|
12185
12253
|
return effects.put(scrollToNewMessageAC(true, false, true));
|
|
12186
|
-
case
|
|
12254
|
+
case 175:
|
|
12187
12255
|
if (getMessagesFromMap(_channel5.id) && getMessagesFromMap(_channel5.id).length) {
|
|
12188
12256
|
addMessageToMap(_channel5.id, message);
|
|
12189
12257
|
}
|
|
12190
|
-
_context.next =
|
|
12258
|
+
_context.next = 178;
|
|
12191
12259
|
return effects.put(updateChannelDataAC(_channel5.id, _extends({}, channelForAdd, {
|
|
12192
12260
|
userMessageReactions: [],
|
|
12193
12261
|
lastReactedMessage: null
|
|
12194
12262
|
})));
|
|
12195
|
-
case
|
|
12263
|
+
case 178:
|
|
12196
12264
|
_groupName4 = getChannelGroupName(_channel5);
|
|
12197
|
-
_context.next =
|
|
12265
|
+
_context.next = 181;
|
|
12198
12266
|
return effects.put(updateSearchedChannelDataAC(_channel5.id, _extends({}, channelForAdd, {
|
|
12199
12267
|
userMessageReactions: [],
|
|
12200
12268
|
lastReactedMessage: null
|
|
12201
12269
|
}), _groupName4));
|
|
12202
|
-
case
|
|
12270
|
+
case 181:
|
|
12203
12271
|
showNotifications = getShowNotifications();
|
|
12204
12272
|
if (!(showNotifications && !message.silent && message.user.id !== SceytChatClient.user.id && !_channel5.muted)) {
|
|
12205
|
-
_context.next =
|
|
12273
|
+
_context.next = 198;
|
|
12206
12274
|
break;
|
|
12207
12275
|
}
|
|
12208
12276
|
if (!(Notification.permission === 'granted')) {
|
|
12209
|
-
_context.next =
|
|
12277
|
+
_context.next = 198;
|
|
12210
12278
|
break;
|
|
12211
12279
|
}
|
|
12212
|
-
_context.next =
|
|
12280
|
+
_context.next = 186;
|
|
12213
12281
|
return effects.select(browserTabIsActiveSelector);
|
|
12214
|
-
case
|
|
12282
|
+
case 186:
|
|
12215
12283
|
tabIsActive = _context.sent;
|
|
12216
12284
|
if (!(document.visibilityState !== 'visible' || !tabIsActive || _channel5.id !== _activeChannelId5)) {
|
|
12217
|
-
_context.next =
|
|
12285
|
+
_context.next = 198;
|
|
12218
12286
|
break;
|
|
12219
12287
|
}
|
|
12220
|
-
_context.next =
|
|
12288
|
+
_context.next = 190;
|
|
12221
12289
|
return effects.select(contactsMapSelector);
|
|
12222
|
-
case
|
|
12290
|
+
case 190:
|
|
12223
12291
|
contactsMap = _context.sent;
|
|
12224
12292
|
_getFromContacts = getShowOnlyContactUsers();
|
|
12225
12293
|
state = store.getState();
|
|
@@ -12239,42 +12307,42 @@ function watchForEvents() {
|
|
|
12239
12307
|
setNotification(messageBody, message.user, _channel5, undefined, message.attachments && message.attachments.length ? message.attachments.find(function (att) {
|
|
12240
12308
|
return att.type !== attachmentTypes.link;
|
|
12241
12309
|
}) : undefined);
|
|
12242
|
-
case
|
|
12310
|
+
case 198:
|
|
12243
12311
|
log.info('send delivered for message . .. . ', message);
|
|
12244
12312
|
if (!(message.repliedInThread && message.parentMessage.id)) {
|
|
12245
|
-
_context.next =
|
|
12313
|
+
_context.next = 204;
|
|
12246
12314
|
break;
|
|
12247
12315
|
}
|
|
12248
|
-
_context.next =
|
|
12316
|
+
_context.next = 202;
|
|
12249
12317
|
return effects.put(markMessagesAsDeliveredAC(message.parentMessage.id, [message.id]));
|
|
12250
|
-
case
|
|
12251
|
-
_context.next =
|
|
12318
|
+
case 202:
|
|
12319
|
+
_context.next = 206;
|
|
12252
12320
|
break;
|
|
12253
|
-
case
|
|
12254
|
-
_context.next =
|
|
12321
|
+
case 204:
|
|
12322
|
+
_context.next = 206;
|
|
12255
12323
|
return effects.put(markMessagesAsDeliveredAC(_channel5.id, [message.id]));
|
|
12256
|
-
case
|
|
12324
|
+
case 206:
|
|
12257
12325
|
updateChannelOnAllChannels(_channel5.id, _extends({}, channelForAdd, {
|
|
12258
12326
|
userMessageReactions: [],
|
|
12259
12327
|
lastReactedMessage: null
|
|
12260
12328
|
}));
|
|
12261
12329
|
updateChannelLastMessageOnAllChannels(_channel5.id, _channel5.lastMessage);
|
|
12262
|
-
case
|
|
12263
|
-
return _context.abrupt("break",
|
|
12264
|
-
case
|
|
12330
|
+
case 208:
|
|
12331
|
+
return _context.abrupt("break", 455);
|
|
12332
|
+
case 209:
|
|
12265
12333
|
channelId = args.channelId, markerList = args.markerList;
|
|
12266
|
-
_context.next =
|
|
12334
|
+
_context.next = 212;
|
|
12267
12335
|
return effects.call(getChannelFromMap, channelId);
|
|
12268
|
-
case
|
|
12336
|
+
case 212:
|
|
12269
12337
|
_channel6 = _context.sent;
|
|
12270
12338
|
log.info('channel MESSAGE_MARKERS_RECEIVED ... channel: ', _channel6, 'markers list: ', markerList);
|
|
12271
12339
|
if (!_channel6) {
|
|
12272
|
-
_context.next =
|
|
12340
|
+
_context.next = 231;
|
|
12273
12341
|
break;
|
|
12274
12342
|
}
|
|
12275
|
-
_context.next =
|
|
12343
|
+
_context.next = 217;
|
|
12276
12344
|
return effects.call(getActiveChannelId);
|
|
12277
|
-
case
|
|
12345
|
+
case 217:
|
|
12278
12346
|
_activeChannelId6 = _context.sent;
|
|
12279
12347
|
updateLastMessage = false;
|
|
12280
12348
|
markersMap = {};
|
|
@@ -12292,91 +12360,91 @@ function watchForEvents() {
|
|
|
12292
12360
|
});
|
|
12293
12361
|
});
|
|
12294
12362
|
if (!updateLastMessage) {
|
|
12295
|
-
_context.next =
|
|
12363
|
+
_context.next = 226;
|
|
12296
12364
|
break;
|
|
12297
12365
|
}
|
|
12298
12366
|
lastMessage = _extends({}, _channel6.lastMessage, {
|
|
12299
12367
|
deliveryStatus: markerList.name
|
|
12300
12368
|
});
|
|
12301
12369
|
updateChannelLastMessageOnAllChannels(_channel6.id, lastMessage);
|
|
12302
|
-
_context.next =
|
|
12370
|
+
_context.next = 226;
|
|
12303
12371
|
return effects.put(updateChannelLastMessageStatusAC(lastMessage, JSON.parse(JSON.stringify(_channel6))));
|
|
12304
|
-
case
|
|
12372
|
+
case 226:
|
|
12305
12373
|
if (!(_activeChannelId6 === channelId)) {
|
|
12306
|
-
_context.next =
|
|
12374
|
+
_context.next = 230;
|
|
12307
12375
|
break;
|
|
12308
12376
|
}
|
|
12309
|
-
_context.next =
|
|
12377
|
+
_context.next = 229;
|
|
12310
12378
|
return effects.put(updateMessagesStatusAC(markerList.name, markersMap));
|
|
12311
|
-
case
|
|
12379
|
+
case 229:
|
|
12312
12380
|
updateMarkersOnAllMessages(markersMap, markerList.name);
|
|
12313
|
-
case
|
|
12381
|
+
case 230:
|
|
12314
12382
|
updateMessageStatusOnMap(_channel6.id, {
|
|
12315
12383
|
name: markerList.name,
|
|
12316
12384
|
markersMap: markersMap
|
|
12317
12385
|
});
|
|
12318
|
-
case
|
|
12319
|
-
return _context.abrupt("break",
|
|
12320
|
-
case
|
|
12386
|
+
case 231:
|
|
12387
|
+
return _context.abrupt("break", 455);
|
|
12388
|
+
case 232:
|
|
12321
12389
|
_channelId = args.channelId;
|
|
12322
12390
|
log.info('channel DELETE ... ');
|
|
12323
12391
|
_channel7 = getChannelFromMap(_channelId);
|
|
12324
|
-
_context.next =
|
|
12392
|
+
_context.next = 237;
|
|
12325
12393
|
return effects.put(setChannelToRemoveAC(_channel7));
|
|
12326
|
-
case
|
|
12394
|
+
case 237:
|
|
12327
12395
|
deleteChannelFromAllChannels(_channelId);
|
|
12328
|
-
return _context.abrupt("break",
|
|
12329
|
-
case
|
|
12396
|
+
return _context.abrupt("break", 455);
|
|
12397
|
+
case 239:
|
|
12330
12398
|
_channel8 = args.channel, deletedMessage = args.deletedMessage;
|
|
12331
12399
|
_activeChannelId7 = getActiveChannelId();
|
|
12332
12400
|
log.info('channel DELETE_MESSAGE ... ');
|
|
12333
12401
|
_channelExists7 = checkChannelExists(_channel8.id);
|
|
12334
12402
|
if (!(_channel8.id === _activeChannelId7)) {
|
|
12335
|
-
_context.next =
|
|
12403
|
+
_context.next = 247;
|
|
12336
12404
|
break;
|
|
12337
12405
|
}
|
|
12338
12406
|
updateMessageOnAllMessages(deletedMessage.id, deletedMessage);
|
|
12339
|
-
_context.next =
|
|
12407
|
+
_context.next = 247;
|
|
12340
12408
|
return effects.put(updateMessageAC(deletedMessage.id, deletedMessage));
|
|
12341
|
-
case
|
|
12409
|
+
case 247:
|
|
12342
12410
|
updateMessageOnMap(_channel8.id, {
|
|
12343
12411
|
messageId: deletedMessage.id,
|
|
12344
12412
|
params: deletedMessage
|
|
12345
12413
|
});
|
|
12346
12414
|
if (!_channelExists7) {
|
|
12347
|
-
_context.next =
|
|
12415
|
+
_context.next = 254;
|
|
12348
12416
|
break;
|
|
12349
12417
|
}
|
|
12350
|
-
_context.next =
|
|
12418
|
+
_context.next = 251;
|
|
12351
12419
|
return effects.put(updateChannelDataAC(_channel8.id, {
|
|
12352
12420
|
newMessageCount: _channel8.newMessageCount,
|
|
12353
12421
|
muted: _channel8.muted,
|
|
12354
12422
|
mutedTill: _channel8.mutedTill
|
|
12355
12423
|
}));
|
|
12356
|
-
case
|
|
12424
|
+
case 251:
|
|
12357
12425
|
if (!(_channel8.lastMessage.id === deletedMessage.id)) {
|
|
12358
|
-
_context.next =
|
|
12426
|
+
_context.next = 254;
|
|
12359
12427
|
break;
|
|
12360
12428
|
}
|
|
12361
|
-
_context.next =
|
|
12429
|
+
_context.next = 254;
|
|
12362
12430
|
return effects.put(updateChannelLastMessageAC(deletedMessage, _channel8));
|
|
12363
|
-
case
|
|
12431
|
+
case 254:
|
|
12364
12432
|
updateChannelOnAllChannels(_channel8.id, {
|
|
12365
12433
|
newMessageCount: _channel8.newMessageCount,
|
|
12366
12434
|
muted: _channel8.muted,
|
|
12367
12435
|
mutedTill: _channel8.mutedTill
|
|
12368
12436
|
}, deletedMessage);
|
|
12369
|
-
return _context.abrupt("break",
|
|
12370
|
-
case
|
|
12437
|
+
return _context.abrupt("break", 455);
|
|
12438
|
+
case 256:
|
|
12371
12439
|
_channel9 = args.channel, _message = args.message;
|
|
12372
12440
|
log.info('channel EDIT_MESSAGE ... ', _message);
|
|
12373
12441
|
_activeChannelId8 = getActiveChannelId();
|
|
12374
12442
|
_channelExists8 = checkChannelExists(_channel9.id);
|
|
12375
12443
|
if (!(_channel9.id === _activeChannelId8)) {
|
|
12376
|
-
_context.next =
|
|
12444
|
+
_context.next = 264;
|
|
12377
12445
|
break;
|
|
12378
12446
|
}
|
|
12379
|
-
_context.next =
|
|
12447
|
+
_context.next = 263;
|
|
12380
12448
|
return effects.put(updateMessageAC(_message.id, {
|
|
12381
12449
|
body: _message.body,
|
|
12382
12450
|
state: _message.state,
|
|
@@ -12385,7 +12453,7 @@ function watchForEvents() {
|
|
|
12385
12453
|
mentionedUsers: _message.mentionedUsers,
|
|
12386
12454
|
updatedAt: _message.updatedAt
|
|
12387
12455
|
}));
|
|
12388
|
-
case
|
|
12456
|
+
case 263:
|
|
12389
12457
|
updateMessageOnAllMessages(_message.id, {
|
|
12390
12458
|
body: _message.body,
|
|
12391
12459
|
state: _message.state,
|
|
@@ -12394,18 +12462,18 @@ function watchForEvents() {
|
|
|
12394
12462
|
mentionedUsers: _message.mentionedUsers,
|
|
12395
12463
|
updatedAt: _message.updatedAt
|
|
12396
12464
|
});
|
|
12397
|
-
case
|
|
12465
|
+
case 264:
|
|
12398
12466
|
if (!_channelExists8) {
|
|
12399
|
-
_context.next =
|
|
12467
|
+
_context.next = 268;
|
|
12400
12468
|
break;
|
|
12401
12469
|
}
|
|
12402
12470
|
if (!(_channel9.lastMessage.id === _message.id)) {
|
|
12403
|
-
_context.next =
|
|
12471
|
+
_context.next = 268;
|
|
12404
12472
|
break;
|
|
12405
12473
|
}
|
|
12406
|
-
_context.next =
|
|
12474
|
+
_context.next = 268;
|
|
12407
12475
|
return effects.put(updateChannelLastMessageAC(_message, _channel9));
|
|
12408
|
-
case
|
|
12476
|
+
case 268:
|
|
12409
12477
|
if (checkChannelExistsOnMessagesMap(_channel9.id)) {
|
|
12410
12478
|
updateMessageOnMap(_channel9.id, {
|
|
12411
12479
|
messageId: _message.id,
|
|
@@ -12413,36 +12481,36 @@ function watchForEvents() {
|
|
|
12413
12481
|
});
|
|
12414
12482
|
}
|
|
12415
12483
|
updateChannelOnAllChannels(_channel9.id, {}, _message);
|
|
12416
|
-
return _context.abrupt("break",
|
|
12417
|
-
case
|
|
12484
|
+
return _context.abrupt("break", 455);
|
|
12485
|
+
case 271:
|
|
12418
12486
|
_channel0 = args.channel, user = args.user, _message2 = args.message, reaction = args.reaction;
|
|
12419
12487
|
log.info('channel REACTION_ADDED ... ', args);
|
|
12420
12488
|
isSelf = user.id === SceytChatClient.user.id;
|
|
12421
12489
|
_activeChannelId9 = getActiveChannelId();
|
|
12422
12490
|
if (!(_channel0.id === _activeChannelId9)) {
|
|
12423
|
-
_context.next =
|
|
12491
|
+
_context.next = 279;
|
|
12424
12492
|
break;
|
|
12425
12493
|
}
|
|
12426
|
-
_context.next =
|
|
12494
|
+
_context.next = 278;
|
|
12427
12495
|
return effects.put(addReactionToMessageAC(_message2, reaction, isSelf));
|
|
12428
|
-
case
|
|
12496
|
+
case 278:
|
|
12429
12497
|
addReactionOnAllMessages(_message2, reaction, true);
|
|
12430
|
-
case
|
|
12498
|
+
case 279:
|
|
12431
12499
|
if (!(_message2.user.id === SceytChatClient.user.id)) {
|
|
12432
|
-
_context.next =
|
|
12500
|
+
_context.next = 297;
|
|
12433
12501
|
break;
|
|
12434
12502
|
}
|
|
12435
12503
|
if (!(!isSelf && Notification.permission === 'granted')) {
|
|
12436
|
-
_context.next =
|
|
12504
|
+
_context.next = 292;
|
|
12437
12505
|
break;
|
|
12438
12506
|
}
|
|
12439
12507
|
if (!(document.visibilityState !== 'visible' || _channel0.id !== _activeChannelId9)) {
|
|
12440
|
-
_context.next =
|
|
12508
|
+
_context.next = 292;
|
|
12441
12509
|
break;
|
|
12442
12510
|
}
|
|
12443
|
-
_context.next =
|
|
12511
|
+
_context.next = 284;
|
|
12444
12512
|
return effects.select(contactsMapSelector);
|
|
12445
|
-
case
|
|
12513
|
+
case 284:
|
|
12446
12514
|
_contactsMap = _context.sent;
|
|
12447
12515
|
_getFromContacts2 = getShowOnlyContactUsers();
|
|
12448
12516
|
_state = store.getState();
|
|
@@ -12462,9 +12530,9 @@ function watchForEvents() {
|
|
|
12462
12530
|
setNotification(_messageBody, reaction.user, _channel0, reaction.key, _message2.attachments && _message2.attachments.length ? _message2.attachments.find(function (att) {
|
|
12463
12531
|
return att.type !== attachmentTypes.link;
|
|
12464
12532
|
}) : undefined);
|
|
12465
|
-
case
|
|
12533
|
+
case 292:
|
|
12466
12534
|
if (!(_channel0.newReactions && _channel0.newReactions.length)) {
|
|
12467
|
-
_context.next =
|
|
12535
|
+
_context.next = 296;
|
|
12468
12536
|
break;
|
|
12469
12537
|
}
|
|
12470
12538
|
channelUpdateParams = {
|
|
@@ -12474,9 +12542,9 @@ function watchForEvents() {
|
|
|
12474
12542
|
muted: _channel0.muted,
|
|
12475
12543
|
mutedTill: _channel0.mutedTill
|
|
12476
12544
|
};
|
|
12477
|
-
_context.next =
|
|
12545
|
+
_context.next = 296;
|
|
12478
12546
|
return effects.put(updateChannelDataAC(_channel0.id, channelUpdateParams));
|
|
12479
|
-
case
|
|
12547
|
+
case 296:
|
|
12480
12548
|
updateChannelOnAllChannels(_channel0.id, {
|
|
12481
12549
|
userMessageReactions: _channel0.newReactions,
|
|
12482
12550
|
lastReactedMessage: _message2,
|
|
@@ -12484,77 +12552,77 @@ function watchForEvents() {
|
|
|
12484
12552
|
muted: _channel0.muted,
|
|
12485
12553
|
mutedTill: _channel0.mutedTill
|
|
12486
12554
|
});
|
|
12487
|
-
case
|
|
12555
|
+
case 297:
|
|
12488
12556
|
if (checkChannelExistsOnMessagesMap(_channel0.id)) {
|
|
12489
12557
|
addReactionToMessageOnMap(_channel0.id, _message2, reaction, true);
|
|
12490
12558
|
}
|
|
12491
|
-
return _context.abrupt("break",
|
|
12492
|
-
case
|
|
12559
|
+
return _context.abrupt("break", 455);
|
|
12560
|
+
case 299:
|
|
12493
12561
|
_channel1 = args.channel, _user = args.user, _message3 = args.message, _reaction = args.reaction;
|
|
12494
12562
|
log.info('channel REACTION_DELETED ... ', _channel1);
|
|
12495
12563
|
channelFromMap = getChannelFromMap(_channel1.id);
|
|
12496
12564
|
_isSelf = _user.id === SceytChatClient.user.id;
|
|
12497
12565
|
_activeChannelId0 = getActiveChannelId();
|
|
12498
12566
|
if (!(_channel1.id === _activeChannelId0)) {
|
|
12499
|
-
_context.next =
|
|
12567
|
+
_context.next = 308;
|
|
12500
12568
|
break;
|
|
12501
12569
|
}
|
|
12502
|
-
_context.next =
|
|
12570
|
+
_context.next = 307;
|
|
12503
12571
|
return effects.put(deleteReactionFromMessageAC(_message3, _reaction, _isSelf));
|
|
12504
|
-
case
|
|
12572
|
+
case 307:
|
|
12505
12573
|
removeReactionOnAllMessages(_message3, _reaction, true);
|
|
12506
|
-
case
|
|
12574
|
+
case 308:
|
|
12507
12575
|
_channelUpdateParams = JSON.parse(JSON.stringify(_channel1));
|
|
12508
12576
|
if (channelFromMap && channelFromMap.lastReactedMessage && channelFromMap.lastReactedMessage.id === _message3.id) {
|
|
12509
12577
|
_channelUpdateParams.lastReactedMessage = null;
|
|
12510
12578
|
}
|
|
12511
|
-
_context.next =
|
|
12579
|
+
_context.next = 312;
|
|
12512
12580
|
return effects.put(updateChannelDataAC(_channel1.id, _channelUpdateParams));
|
|
12513
|
-
case
|
|
12581
|
+
case 312:
|
|
12514
12582
|
updateChannelOnAllChannels(_channel1.id, _channelUpdateParams);
|
|
12515
12583
|
if (checkChannelExistsOnMessagesMap(_channel1.id)) {
|
|
12516
12584
|
removeReactionToMessageOnMap(_channel1.id, _message3, _reaction, true);
|
|
12517
12585
|
}
|
|
12518
|
-
return _context.abrupt("break",
|
|
12519
|
-
case
|
|
12586
|
+
return _context.abrupt("break", 455);
|
|
12587
|
+
case 315:
|
|
12520
12588
|
_channel10 = args.channel;
|
|
12521
12589
|
if (!_channel10) {
|
|
12522
|
-
_context.next =
|
|
12590
|
+
_context.next = 321;
|
|
12523
12591
|
break;
|
|
12524
12592
|
}
|
|
12525
12593
|
_updatedChannel = JSON.parse(JSON.stringify(_channel10));
|
|
12526
|
-
_context.next =
|
|
12594
|
+
_context.next = 320;
|
|
12527
12595
|
return effects.put(updateChannelDataAC(_channel10.id, _updatedChannel));
|
|
12528
|
-
case
|
|
12596
|
+
case 320:
|
|
12529
12597
|
updateChannelOnAllChannels(_channel10.id, _updatedChannel);
|
|
12530
|
-
case
|
|
12531
|
-
return _context.abrupt("break",
|
|
12532
|
-
case
|
|
12598
|
+
case 321:
|
|
12599
|
+
return _context.abrupt("break", 455);
|
|
12600
|
+
case 322:
|
|
12533
12601
|
_channel11 = args.channel;
|
|
12534
12602
|
log.info('CLEAR_HISTORY: ', _channel11);
|
|
12535
|
-
_context.next =
|
|
12603
|
+
_context.next = 326;
|
|
12536
12604
|
return effects.call(getActiveChannelId);
|
|
12537
|
-
case
|
|
12605
|
+
case 326:
|
|
12538
12606
|
_activeChannelId1 = _context.sent;
|
|
12539
|
-
_context.next =
|
|
12607
|
+
_context.next = 329;
|
|
12540
12608
|
return effects.call(checkChannelExists, _channel11.id);
|
|
12541
|
-
case
|
|
12609
|
+
case 329:
|
|
12542
12610
|
channelExist = _context.sent;
|
|
12543
12611
|
if (!(_channel11.id === _activeChannelId1)) {
|
|
12544
|
-
_context.next =
|
|
12612
|
+
_context.next = 334;
|
|
12545
12613
|
break;
|
|
12546
12614
|
}
|
|
12547
|
-
_context.next =
|
|
12615
|
+
_context.next = 333;
|
|
12548
12616
|
return effects.put(clearMessagesAC());
|
|
12549
|
-
case
|
|
12617
|
+
case 333:
|
|
12550
12618
|
removeAllMessages();
|
|
12551
|
-
case
|
|
12619
|
+
case 334:
|
|
12552
12620
|
removeMessagesFromMap(_channel11.id);
|
|
12553
12621
|
if (!channelExist) {
|
|
12554
|
-
_context.next =
|
|
12622
|
+
_context.next = 338;
|
|
12555
12623
|
break;
|
|
12556
12624
|
}
|
|
12557
|
-
_context.next =
|
|
12625
|
+
_context.next = 338;
|
|
12558
12626
|
return effects.put(updateChannelDataAC(_channel11.id, {
|
|
12559
12627
|
lastMessage: null,
|
|
12560
12628
|
newMessageCount: 0,
|
|
@@ -12562,7 +12630,7 @@ function watchForEvents() {
|
|
|
12562
12630
|
muted: _channel11.muted,
|
|
12563
12631
|
mutedTill: _channel11.mutedTill
|
|
12564
12632
|
}));
|
|
12565
|
-
case
|
|
12633
|
+
case 338:
|
|
12566
12634
|
updateChannelOnAllChannels(_channel11.id, {
|
|
12567
12635
|
lastMessage: null,
|
|
12568
12636
|
newMessageCount: 0,
|
|
@@ -12570,173 +12638,173 @@ function watchForEvents() {
|
|
|
12570
12638
|
muted: _channel11.muted,
|
|
12571
12639
|
mutedTill: _channel11.mutedTill
|
|
12572
12640
|
});
|
|
12573
|
-
return _context.abrupt("break",
|
|
12574
|
-
case
|
|
12641
|
+
return _context.abrupt("break", 455);
|
|
12642
|
+
case 340:
|
|
12575
12643
|
_channel12 = args.channel;
|
|
12576
12644
|
log.info('channel MUTE ... ');
|
|
12577
|
-
_context.next =
|
|
12645
|
+
_context.next = 344;
|
|
12578
12646
|
return effects.put(updateChannelDataAC(_channel12.id, {
|
|
12579
12647
|
muted: _channel12.muted,
|
|
12580
12648
|
mutedTill: _channel12.mutedTill
|
|
12581
12649
|
}));
|
|
12582
|
-
case
|
|
12650
|
+
case 344:
|
|
12583
12651
|
updateChannelOnAllChannels(_channel12.id, {
|
|
12584
12652
|
muted: _channel12.muted,
|
|
12585
12653
|
mutedTill: _channel12.mutedTill
|
|
12586
12654
|
});
|
|
12587
|
-
return _context.abrupt("break",
|
|
12588
|
-
case
|
|
12655
|
+
return _context.abrupt("break", 455);
|
|
12656
|
+
case 346:
|
|
12589
12657
|
_channel13 = args.channel;
|
|
12590
12658
|
log.info('channel UNMUTE ... ');
|
|
12591
|
-
_context.next =
|
|
12659
|
+
_context.next = 350;
|
|
12592
12660
|
return effects.put(updateChannelDataAC(_channel13.id, {
|
|
12593
12661
|
muted: _channel13.muted,
|
|
12594
12662
|
mutedTill: _channel13.mutedTill
|
|
12595
12663
|
}));
|
|
12596
|
-
case
|
|
12664
|
+
case 350:
|
|
12597
12665
|
updateChannelOnAllChannels(_channel13.id, {
|
|
12598
12666
|
muted: _channel13.muted,
|
|
12599
12667
|
mutedTill: _channel13.mutedTill
|
|
12600
12668
|
});
|
|
12601
|
-
return _context.abrupt("break",
|
|
12602
|
-
case
|
|
12669
|
+
return _context.abrupt("break", 455);
|
|
12670
|
+
case 352:
|
|
12603
12671
|
_channel14 = args.channel;
|
|
12604
12672
|
log.info('channel PINED ... ');
|
|
12605
|
-
_context.next =
|
|
12673
|
+
_context.next = 356;
|
|
12606
12674
|
return effects.put(updateChannelDataAC(_channel14.id, {
|
|
12607
12675
|
pinnedAt: _channel14.pinnedAt
|
|
12608
12676
|
}, true));
|
|
12609
|
-
case
|
|
12677
|
+
case 356:
|
|
12610
12678
|
updateChannelOnAllChannels(_channel14.id, {
|
|
12611
12679
|
pinnedAt: _channel14.pinnedAt
|
|
12612
12680
|
});
|
|
12613
|
-
return _context.abrupt("break",
|
|
12614
|
-
case
|
|
12681
|
+
return _context.abrupt("break", 455);
|
|
12682
|
+
case 358:
|
|
12615
12683
|
_channel15 = args.channel;
|
|
12616
12684
|
log.info('channel UNPINED ... ');
|
|
12617
|
-
_context.next =
|
|
12685
|
+
_context.next = 362;
|
|
12618
12686
|
return effects.put(updateChannelDataAC(_channel15.id, {
|
|
12619
12687
|
pinnedAt: _channel15.pinnedAt
|
|
12620
12688
|
}, false, true));
|
|
12621
|
-
case
|
|
12689
|
+
case 362:
|
|
12622
12690
|
updateChannelOnAllChannels(_channel15.id, {
|
|
12623
12691
|
pinnedAt: _channel15.pinnedAt
|
|
12624
12692
|
});
|
|
12625
|
-
return _context.abrupt("break",
|
|
12626
|
-
case
|
|
12693
|
+
return _context.abrupt("break", 455);
|
|
12694
|
+
case 364:
|
|
12627
12695
|
_channel16 = args.channel;
|
|
12628
12696
|
log.info('channel HIDE ... ');
|
|
12629
|
-
_context.next =
|
|
12697
|
+
_context.next = 368;
|
|
12630
12698
|
return effects.put(setChannelToHideAC(_channel16));
|
|
12631
|
-
case
|
|
12632
|
-
return _context.abrupt("break",
|
|
12633
|
-
case
|
|
12699
|
+
case 368:
|
|
12700
|
+
return _context.abrupt("break", 455);
|
|
12701
|
+
case 369:
|
|
12634
12702
|
_channel17 = args.channel;
|
|
12635
12703
|
log.info('channel UNHIDE ... ');
|
|
12636
|
-
_context.next =
|
|
12704
|
+
_context.next = 373;
|
|
12637
12705
|
return effects.put(setChannelToUnHideAC(_channel17));
|
|
12638
|
-
case
|
|
12639
|
-
return _context.abrupt("break",
|
|
12640
|
-
case
|
|
12706
|
+
case 373:
|
|
12707
|
+
return _context.abrupt("break", 455);
|
|
12708
|
+
case 374:
|
|
12641
12709
|
_channel18 = args.channel;
|
|
12642
|
-
_context.next =
|
|
12710
|
+
_context.next = 377;
|
|
12643
12711
|
return effects.put(updateChannelDataAC(_channel18.id, {
|
|
12644
12712
|
unread: _channel18.unread,
|
|
12645
12713
|
muted: _channel18.muted,
|
|
12646
12714
|
mutedTill: _channel18.mutedTill
|
|
12647
12715
|
}));
|
|
12648
|
-
case
|
|
12716
|
+
case 377:
|
|
12649
12717
|
_groupName5 = getChannelGroupName(_channel18);
|
|
12650
|
-
_context.next =
|
|
12718
|
+
_context.next = 380;
|
|
12651
12719
|
return effects.put(updateSearchedChannelDataAC(_channel18.id, {
|
|
12652
12720
|
unread: _channel18.unread
|
|
12653
12721
|
}, _groupName5));
|
|
12654
|
-
case
|
|
12722
|
+
case 380:
|
|
12655
12723
|
updateChannelOnAllChannels(_channel18.id, {
|
|
12656
12724
|
unread: _channel18.unread
|
|
12657
12725
|
});
|
|
12658
|
-
return _context.abrupt("break",
|
|
12659
|
-
case
|
|
12726
|
+
return _context.abrupt("break", 455);
|
|
12727
|
+
case 382:
|
|
12660
12728
|
_channel19 = args.channel;
|
|
12661
|
-
_context.next =
|
|
12729
|
+
_context.next = 385;
|
|
12662
12730
|
return effects.put(updateChannelDataAC(_channel19.id, {
|
|
12663
12731
|
unread: _channel19.unread,
|
|
12664
12732
|
muted: _channel19.muted,
|
|
12665
12733
|
mutedTill: _channel19.mutedTill
|
|
12666
12734
|
}));
|
|
12667
|
-
case
|
|
12735
|
+
case 385:
|
|
12668
12736
|
_groupName6 = getChannelGroupName(_channel19);
|
|
12669
|
-
_context.next =
|
|
12737
|
+
_context.next = 388;
|
|
12670
12738
|
return effects.put(updateSearchedChannelDataAC(_channel19.id, {
|
|
12671
12739
|
unread: _channel19.unread
|
|
12672
12740
|
}, _groupName6));
|
|
12673
|
-
case
|
|
12741
|
+
case 388:
|
|
12674
12742
|
updateChannelOnAllChannels(_channel19.id, {
|
|
12675
12743
|
unread: _channel19.unread
|
|
12676
12744
|
});
|
|
12677
|
-
return _context.abrupt("break",
|
|
12678
|
-
case
|
|
12745
|
+
return _context.abrupt("break", 455);
|
|
12746
|
+
case 390:
|
|
12679
12747
|
_channel20 = args.channel, members = args.members;
|
|
12680
12748
|
log.info('channel CHANGE_ROLE channel ... ', _channel20);
|
|
12681
12749
|
log.info('channel CHANGE_ROLE member ... ', members);
|
|
12682
|
-
_context.next =
|
|
12750
|
+
_context.next = 395;
|
|
12683
12751
|
return effects.call(getActiveChannelId);
|
|
12684
|
-
case
|
|
12752
|
+
case 395:
|
|
12685
12753
|
_activeChannelId10 = _context.sent;
|
|
12686
12754
|
if (!(_channel20.id === _activeChannelId10)) {
|
|
12687
|
-
_context.next =
|
|
12755
|
+
_context.next = 399;
|
|
12688
12756
|
break;
|
|
12689
12757
|
}
|
|
12690
|
-
_context.next =
|
|
12758
|
+
_context.next = 399;
|
|
12691
12759
|
return effects.put(updateMembersAC(members));
|
|
12692
|
-
case
|
|
12760
|
+
case 399:
|
|
12693
12761
|
i = 0;
|
|
12694
|
-
case
|
|
12762
|
+
case 400:
|
|
12695
12763
|
if (!(i < members.length)) {
|
|
12696
|
-
_context.next =
|
|
12764
|
+
_context.next = 408;
|
|
12697
12765
|
break;
|
|
12698
12766
|
}
|
|
12699
12767
|
if (!(members[i].id === SceytChatClient.user.id)) {
|
|
12700
|
-
_context.next =
|
|
12768
|
+
_context.next = 405;
|
|
12701
12769
|
break;
|
|
12702
12770
|
}
|
|
12703
|
-
_context.next =
|
|
12771
|
+
_context.next = 404;
|
|
12704
12772
|
return effects.put(updateChannelDataAC(_channel20.id, {
|
|
12705
12773
|
userRole: members[i].role,
|
|
12706
12774
|
muted: _channel20.muted,
|
|
12707
12775
|
mutedTill: _channel20.mutedTill
|
|
12708
12776
|
}));
|
|
12709
|
-
case
|
|
12777
|
+
case 404:
|
|
12710
12778
|
updateChannelOnAllChannels(_channel20.id, {
|
|
12711
12779
|
userRole: members[i].role,
|
|
12712
12780
|
muted: _channel20.muted,
|
|
12713
12781
|
mutedTill: _channel20.mutedTill
|
|
12714
12782
|
});
|
|
12715
|
-
case
|
|
12783
|
+
case 405:
|
|
12716
12784
|
i++;
|
|
12717
|
-
_context.next =
|
|
12785
|
+
_context.next = 400;
|
|
12718
12786
|
break;
|
|
12719
|
-
case
|
|
12720
|
-
return _context.abrupt("break",
|
|
12721
|
-
case
|
|
12787
|
+
case 408:
|
|
12788
|
+
return _context.abrupt("break", 455);
|
|
12789
|
+
case 409:
|
|
12722
12790
|
_channel21 = args.channel;
|
|
12723
12791
|
log.info('channel frozen channel ... ', _channel21);
|
|
12724
|
-
return _context.abrupt("break",
|
|
12725
|
-
case
|
|
12792
|
+
return _context.abrupt("break", 455);
|
|
12793
|
+
case 412:
|
|
12726
12794
|
_channel22 = args.channel;
|
|
12727
12795
|
log.info('channel unfrozen channel ... ', _channel22);
|
|
12728
|
-
return _context.abrupt("break",
|
|
12729
|
-
case
|
|
12796
|
+
return _context.abrupt("break", 455);
|
|
12797
|
+
case 415:
|
|
12730
12798
|
_channelId2 = args.channelId, from = args.from, name = args.name;
|
|
12731
12799
|
log.info('channel event received >>>... . . . . . ', args);
|
|
12732
12800
|
if (!(from.id === SceytChatClient.user.id)) {
|
|
12733
|
-
_context.next =
|
|
12801
|
+
_context.next = 419;
|
|
12734
12802
|
break;
|
|
12735
12803
|
}
|
|
12736
|
-
return _context.abrupt("break",
|
|
12737
|
-
case
|
|
12804
|
+
return _context.abrupt("break", 455);
|
|
12805
|
+
case 419:
|
|
12738
12806
|
if (!(name === 'start_typing')) {
|
|
12739
|
-
_context.next =
|
|
12807
|
+
_context.next = 427;
|
|
12740
12808
|
break;
|
|
12741
12809
|
}
|
|
12742
12810
|
if (!usersTimeout[_channelId2]) {
|
|
@@ -12748,27 +12816,27 @@ function watchForEvents() {
|
|
|
12748
12816
|
usersTimeout[_channelId2][from.id] = setTimeout(function () {
|
|
12749
12817
|
channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_typing');
|
|
12750
12818
|
}, 5000);
|
|
12751
|
-
_context.next =
|
|
12819
|
+
_context.next = 425;
|
|
12752
12820
|
return effects.put(switchTypingIndicatorAC(true, _channelId2, from));
|
|
12753
|
-
case
|
|
12754
|
-
_context.next =
|
|
12821
|
+
case 425:
|
|
12822
|
+
_context.next = 445;
|
|
12755
12823
|
break;
|
|
12756
|
-
case
|
|
12824
|
+
case 427:
|
|
12757
12825
|
if (!(name === 'stop_typing')) {
|
|
12758
|
-
_context.next =
|
|
12826
|
+
_context.next = 433;
|
|
12759
12827
|
break;
|
|
12760
12828
|
}
|
|
12761
12829
|
if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
|
|
12762
12830
|
clearTimeout(usersTimeout[_channelId2][from.id]);
|
|
12763
12831
|
}
|
|
12764
|
-
_context.next =
|
|
12832
|
+
_context.next = 431;
|
|
12765
12833
|
return effects.put(switchTypingIndicatorAC(false, _channelId2, from));
|
|
12766
|
-
case
|
|
12767
|
-
_context.next =
|
|
12834
|
+
case 431:
|
|
12835
|
+
_context.next = 445;
|
|
12768
12836
|
break;
|
|
12769
|
-
case
|
|
12837
|
+
case 433:
|
|
12770
12838
|
if (!(name === 'start_recording')) {
|
|
12771
|
-
_context.next =
|
|
12839
|
+
_context.next = 441;
|
|
12772
12840
|
break;
|
|
12773
12841
|
}
|
|
12774
12842
|
if (!usersTimeout[_channelId2]) {
|
|
@@ -12780,40 +12848,40 @@ function watchForEvents() {
|
|
|
12780
12848
|
usersTimeout[_channelId2][from.id] = setTimeout(function () {
|
|
12781
12849
|
channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_recording');
|
|
12782
12850
|
}, 5000);
|
|
12783
|
-
_context.next = 433;
|
|
12784
|
-
return effects.put(switchRecordingIndicatorAC(true, _channelId2, from));
|
|
12785
|
-
case 433:
|
|
12786
12851
|
_context.next = 439;
|
|
12852
|
+
return effects.put(switchRecordingIndicatorAC(true, _channelId2, from));
|
|
12853
|
+
case 439:
|
|
12854
|
+
_context.next = 445;
|
|
12787
12855
|
break;
|
|
12788
|
-
case
|
|
12856
|
+
case 441:
|
|
12789
12857
|
if (!(name === 'stop_recording')) {
|
|
12790
|
-
_context.next =
|
|
12858
|
+
_context.next = 445;
|
|
12791
12859
|
break;
|
|
12792
12860
|
}
|
|
12793
12861
|
if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
|
|
12794
12862
|
clearTimeout(usersTimeout[_channelId2][from.id]);
|
|
12795
12863
|
}
|
|
12796
|
-
_context.next =
|
|
12864
|
+
_context.next = 445;
|
|
12797
12865
|
return effects.put(switchRecordingIndicatorAC(false, _channelId2, from));
|
|
12798
|
-
case
|
|
12799
|
-
return _context.abrupt("break",
|
|
12800
|
-
case
|
|
12866
|
+
case 445:
|
|
12867
|
+
return _context.abrupt("break", 455);
|
|
12868
|
+
case 446:
|
|
12801
12869
|
status = args.status;
|
|
12802
12870
|
log.info('connection status changed . . . . . ', status);
|
|
12803
|
-
_context.next =
|
|
12871
|
+
_context.next = 450;
|
|
12804
12872
|
return effects.put(setConnectionStatusAC(status));
|
|
12805
|
-
case
|
|
12873
|
+
case 450:
|
|
12806
12874
|
if (!(status === CONNECTION_STATUS.CONNECTED)) {
|
|
12807
|
-
_context.next =
|
|
12875
|
+
_context.next = 453;
|
|
12808
12876
|
break;
|
|
12809
12877
|
}
|
|
12810
|
-
_context.next =
|
|
12878
|
+
_context.next = 453;
|
|
12811
12879
|
return effects.put(getRolesAC());
|
|
12812
|
-
case
|
|
12813
|
-
return _context.abrupt("break",
|
|
12814
|
-
case
|
|
12880
|
+
case 453:
|
|
12881
|
+
return _context.abrupt("break", 455);
|
|
12882
|
+
case 454:
|
|
12815
12883
|
log.warn('UNHANDLED EVENT FROM REDUX-SAGA EVENT-CHANNEL');
|
|
12816
|
-
case
|
|
12884
|
+
case 455:
|
|
12817
12885
|
case "end":
|
|
12818
12886
|
return _context.stop();
|
|
12819
12887
|
}
|
|
@@ -12828,7 +12896,7 @@ function watchForEvents() {
|
|
|
12828
12896
|
case "end":
|
|
12829
12897
|
return _context2.stop();
|
|
12830
12898
|
}
|
|
12831
|
-
}, _marked);
|
|
12899
|
+
}, _marked$1);
|
|
12832
12900
|
}
|
|
12833
12901
|
|
|
12834
12902
|
var channelsSelector = function channelsSelector(store) {
|
|
@@ -12906,8 +12974,8 @@ var channelMessageDraftIsRemovedSelector = function channelMessageDraftIsRemoved
|
|
|
12906
12974
|
return store.ChannelReducer.draftIsRemoved;
|
|
12907
12975
|
};
|
|
12908
12976
|
|
|
12909
|
-
var _marked$
|
|
12910
|
-
_marked2 = /*#__PURE__*/_regeneratorRuntime().mark(getChannels),
|
|
12977
|
+
var _marked$2 = /*#__PURE__*/_regeneratorRuntime().mark(createChannel),
|
|
12978
|
+
_marked2$1 = /*#__PURE__*/_regeneratorRuntime().mark(getChannels),
|
|
12911
12979
|
_marked3 = /*#__PURE__*/_regeneratorRuntime().mark(searchChannels),
|
|
12912
12980
|
_marked4 = /*#__PURE__*/_regeneratorRuntime().mark(getChannelsForForward),
|
|
12913
12981
|
_marked5 = /*#__PURE__*/_regeneratorRuntime().mark(searchChannelsForForward),
|
|
@@ -13112,7 +13180,7 @@ function createChannel(action) {
|
|
|
13112
13180
|
case "end":
|
|
13113
13181
|
return _context.stop();
|
|
13114
13182
|
}
|
|
13115
|
-
}, _marked$
|
|
13183
|
+
}, _marked$2, null, [[0, 53]]);
|
|
13116
13184
|
}
|
|
13117
13185
|
function getChannels(action) {
|
|
13118
13186
|
var _params$filter, _types, payload, params, SceytChatClient, channelQueryBuilder, channelTypesFilter, types, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, channelMessageMap, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, i, allChannelsData, allChannelList;
|
|
@@ -13295,7 +13363,7 @@ function getChannels(action) {
|
|
|
13295
13363
|
case "end":
|
|
13296
13364
|
return _context2.stop();
|
|
13297
13365
|
}
|
|
13298
|
-
}, _marked2, null, [[0, 89], [72, 81]]);
|
|
13366
|
+
}, _marked2$1, null, [[0, 89], [72, 81]]);
|
|
13299
13367
|
}
|
|
13300
13368
|
function searchChannels(action) {
|
|
13301
13369
|
var payload, params, contactsMap, SceytChatClient, getFromContacts, searchBy, _params$filter2, _types2, channelQueryBuilder, channelTypesFilter, types, allChannels, publicChannels, chatsGroups, contactsList, contactsWithChannelsMap, lowerCaseSearchBy, channelQuery, channelsData, channelsToAdd;
|
|
@@ -14412,7 +14480,8 @@ function checkUsersStatus() {
|
|
|
14412
14480
|
usersToUpdateMap = {};
|
|
14413
14481
|
update = false;
|
|
14414
14482
|
updatedUsers.forEach(function (updatedUser) {
|
|
14415
|
-
|
|
14483
|
+
var _usersMap$updatedUser, _usersMap$updatedUser2, _usersMap$updatedUser3, _usersMap$updatedUser4, _usersMap$updatedUser5, _usersMap$updatedUser6, _usersMap$updatedUser7, _usersMap$updatedUser8, _usersMap$updatedUser9;
|
|
14484
|
+
if (updatedUser.presence && (updatedUser.presence.state !== ((_usersMap$updatedUser = usersMap[updatedUser.id]) === null || _usersMap$updatedUser === void 0 ? void 0 : (_usersMap$updatedUser2 = _usersMap$updatedUser.presence) === null || _usersMap$updatedUser2 === void 0 ? void 0 : _usersMap$updatedUser2.state) || updatedUser.presence.status !== ((_usersMap$updatedUser3 = usersMap[updatedUser.id]) === null || _usersMap$updatedUser3 === void 0 ? void 0 : (_usersMap$updatedUser4 = _usersMap$updatedUser3.presence) === null || _usersMap$updatedUser4 === void 0 ? void 0 : _usersMap$updatedUser4.status) || updatedUser.presence.lastActiveAt && new Date(updatedUser.presence.lastActiveAt).getTime() !== new Date(((_usersMap$updatedUser5 = usersMap[updatedUser.id]) === null || _usersMap$updatedUser5 === void 0 ? void 0 : (_usersMap$updatedUser6 = _usersMap$updatedUser5.presence) === null || _usersMap$updatedUser6 === void 0 ? void 0 : _usersMap$updatedUser6.lastActiveAt) || 0).getTime() || updatedUser.avatarUrl !== ((_usersMap$updatedUser7 = usersMap[updatedUser.id]) === null || _usersMap$updatedUser7 === void 0 ? void 0 : _usersMap$updatedUser7.avatarUrl) || updatedUser.firstName !== ((_usersMap$updatedUser8 = usersMap[updatedUser.id]) === null || _usersMap$updatedUser8 === void 0 ? void 0 : _usersMap$updatedUser8.firstName) || updatedUser.lastName !== ((_usersMap$updatedUser9 = usersMap[updatedUser.id]) === null || _usersMap$updatedUser9 === void 0 ? void 0 : _usersMap$updatedUser9.lastName))) {
|
|
14416
14485
|
updateUserOnMap(updatedUser);
|
|
14417
14486
|
usersToUpdateMap[updatedUser.id] = updatedUser;
|
|
14418
14487
|
update = true;
|
|
@@ -15355,8 +15424,8 @@ var getFrame = function getFrame(videoSrc, time) {
|
|
|
15355
15424
|
}
|
|
15356
15425
|
};
|
|
15357
15426
|
|
|
15358
|
-
var _marked$
|
|
15359
|
-
_marked2$
|
|
15427
|
+
var _marked$3 = /*#__PURE__*/_regeneratorRuntime().mark(sendMessage),
|
|
15428
|
+
_marked2$2 = /*#__PURE__*/_regeneratorRuntime().mark(sendTextMessage),
|
|
15360
15429
|
_marked3$1 = /*#__PURE__*/_regeneratorRuntime().mark(forwardMessage),
|
|
15361
15430
|
_marked4$1 = /*#__PURE__*/_regeneratorRuntime().mark(resendMessage),
|
|
15362
15431
|
_marked5$1 = /*#__PURE__*/_regeneratorRuntime().mark(deleteMessage),
|
|
@@ -15954,7 +16023,7 @@ function sendMessage(action) {
|
|
|
15954
16023
|
case "end":
|
|
15955
16024
|
return _context3.stop();
|
|
15956
16025
|
}
|
|
15957
|
-
}, _marked$
|
|
16026
|
+
}, _marked$3, null, [[2, 80]]);
|
|
15958
16027
|
}
|
|
15959
16028
|
function sendTextMessage(action) {
|
|
15960
16029
|
var payload, message, connectionState, channelId, channel, sendMessageTid, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, hasNextMessages, messagesToAdd, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam;
|
|
@@ -16152,7 +16221,7 @@ function sendTextMessage(action) {
|
|
|
16152
16221
|
case "end":
|
|
16153
16222
|
return _context4.stop();
|
|
16154
16223
|
}
|
|
16155
|
-
}, _marked2$
|
|
16224
|
+
}, _marked2$2, null, [[8, 82]]);
|
|
16156
16225
|
}
|
|
16157
16226
|
function forwardMessage(action) {
|
|
16158
16227
|
var payload, message, channelId, connectionState, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam;
|
|
@@ -17682,8 +17751,8 @@ function MessageSaga() {
|
|
|
17682
17751
|
}, _marked15$1);
|
|
17683
17752
|
}
|
|
17684
17753
|
|
|
17685
|
-
var _marked$
|
|
17686
|
-
_marked2$
|
|
17754
|
+
var _marked$4 = /*#__PURE__*/_regeneratorRuntime().mark(getMembers),
|
|
17755
|
+
_marked2$3 = /*#__PURE__*/_regeneratorRuntime().mark(loadMoreMembers),
|
|
17687
17756
|
_marked3$2 = /*#__PURE__*/_regeneratorRuntime().mark(addMembers),
|
|
17688
17757
|
_marked4$2 = /*#__PURE__*/_regeneratorRuntime().mark(kickMemberFromChannel),
|
|
17689
17758
|
_marked5$2 = /*#__PURE__*/_regeneratorRuntime().mark(blockMember),
|
|
@@ -17731,7 +17800,7 @@ function getMembers(action) {
|
|
|
17731
17800
|
case "end":
|
|
17732
17801
|
return _context.stop();
|
|
17733
17802
|
}
|
|
17734
|
-
}, _marked$
|
|
17803
|
+
}, _marked$4, null, [[0, 22]]);
|
|
17735
17804
|
}
|
|
17736
17805
|
function loadMoreMembers(action) {
|
|
17737
17806
|
var payload, limit, membersQuery, _yield$call2, members;
|
|
@@ -17759,16 +17828,19 @@ function loadMoreMembers(action) {
|
|
|
17759
17828
|
_context2.next = 15;
|
|
17760
17829
|
return effects.put(setMembersLoadingStateAC(LOADING_STATE.LOADED));
|
|
17761
17830
|
case 15:
|
|
17762
|
-
_context2.next =
|
|
17763
|
-
|
|
17831
|
+
_context2.next = 17;
|
|
17832
|
+
return updateActiveChannelMembersAdd(members);
|
|
17764
17833
|
case 17:
|
|
17765
|
-
_context2.
|
|
17834
|
+
_context2.next = 22;
|
|
17835
|
+
break;
|
|
17836
|
+
case 19:
|
|
17837
|
+
_context2.prev = 19;
|
|
17766
17838
|
_context2.t0 = _context2["catch"](0);
|
|
17767
|
-
case
|
|
17839
|
+
case 22:
|
|
17768
17840
|
case "end":
|
|
17769
17841
|
return _context2.stop();
|
|
17770
17842
|
}
|
|
17771
|
-
}, _marked2$
|
|
17843
|
+
}, _marked2$3, null, [[0, 19]]);
|
|
17772
17844
|
}
|
|
17773
17845
|
function addMembers(action) {
|
|
17774
17846
|
var payload, members, channelId, channel, membersToAdd, addedMembers, membersIds, messageToSend;
|
|
@@ -17783,7 +17855,7 @@ function addMembers(action) {
|
|
|
17783
17855
|
case 5:
|
|
17784
17856
|
channel = _context3.sent;
|
|
17785
17857
|
if (!channel) {
|
|
17786
|
-
_context3.next =
|
|
17858
|
+
_context3.next = 24;
|
|
17787
17859
|
break;
|
|
17788
17860
|
}
|
|
17789
17861
|
membersToAdd = members.map(function (mem) {
|
|
@@ -17825,17 +17897,20 @@ function addMembers(action) {
|
|
|
17825
17897
|
memberCount: channel.memberCount + addedMembers.length
|
|
17826
17898
|
}));
|
|
17827
17899
|
case 22:
|
|
17828
|
-
_context3.next =
|
|
17829
|
-
|
|
17900
|
+
_context3.next = 24;
|
|
17901
|
+
return updateActiveChannelMembersAdd(addedMembers);
|
|
17830
17902
|
case 24:
|
|
17831
|
-
_context3.
|
|
17903
|
+
_context3.next = 29;
|
|
17904
|
+
break;
|
|
17905
|
+
case 26:
|
|
17906
|
+
_context3.prev = 26;
|
|
17832
17907
|
_context3.t0 = _context3["catch"](0);
|
|
17833
17908
|
log.error('error on add members... ', _context3.t0);
|
|
17834
|
-
case
|
|
17909
|
+
case 29:
|
|
17835
17910
|
case "end":
|
|
17836
17911
|
return _context3.stop();
|
|
17837
17912
|
}
|
|
17838
|
-
}, _marked3$2, null, [[0,
|
|
17913
|
+
}, _marked3$2, null, [[0, 26]]);
|
|
17839
17914
|
}
|
|
17840
17915
|
function kickMemberFromChannel(action) {
|
|
17841
17916
|
var payload, memberId, channelId, channel, removedMembers, membersIds, messageToSend;
|
|
@@ -17884,16 +17959,19 @@ function kickMemberFromChannel(action) {
|
|
|
17884
17959
|
memberCount: channel.memberCount - removedMembers.length
|
|
17885
17960
|
}));
|
|
17886
17961
|
case 20:
|
|
17887
|
-
_context4.next =
|
|
17888
|
-
|
|
17962
|
+
_context4.next = 22;
|
|
17963
|
+
return updateActiveChannelMembersRemove(removedMembers);
|
|
17889
17964
|
case 22:
|
|
17890
|
-
_context4.
|
|
17891
|
-
|
|
17965
|
+
_context4.next = 26;
|
|
17966
|
+
break;
|
|
17892
17967
|
case 24:
|
|
17968
|
+
_context4.prev = 24;
|
|
17969
|
+
_context4.t0 = _context4["catch"](0);
|
|
17970
|
+
case 26:
|
|
17893
17971
|
case "end":
|
|
17894
17972
|
return _context4.stop();
|
|
17895
17973
|
}
|
|
17896
|
-
}, _marked4$2, null, [[0,
|
|
17974
|
+
}, _marked4$2, null, [[0, 24]]);
|
|
17897
17975
|
}
|
|
17898
17976
|
function blockMember(action) {
|
|
17899
17977
|
var payload, memberId, channelId, channel, removedMembers;
|
|
@@ -17922,16 +18000,19 @@ function blockMember(action) {
|
|
|
17922
18000
|
memberCount: channel.memberCount - removedMembers.length
|
|
17923
18001
|
}));
|
|
17924
18002
|
case 14:
|
|
17925
|
-
_context5.next =
|
|
17926
|
-
|
|
18003
|
+
_context5.next = 16;
|
|
18004
|
+
return updateActiveChannelMembersRemove(removedMembers);
|
|
17927
18005
|
case 16:
|
|
17928
|
-
_context5.
|
|
17929
|
-
|
|
18006
|
+
_context5.next = 20;
|
|
18007
|
+
break;
|
|
17930
18008
|
case 18:
|
|
18009
|
+
_context5.prev = 18;
|
|
18010
|
+
_context5.t0 = _context5["catch"](0);
|
|
18011
|
+
case 20:
|
|
17931
18012
|
case "end":
|
|
17932
18013
|
return _context5.stop();
|
|
17933
18014
|
}
|
|
17934
|
-
}, _marked5$2, null, [[0,
|
|
18015
|
+
}, _marked5$2, null, [[0, 18]]);
|
|
17935
18016
|
}
|
|
17936
18017
|
function changeMemberRole(action) {
|
|
17937
18018
|
var payload, channelId, members, channel, updatedMembers;
|
|
@@ -18053,8 +18134,8 @@ function MembersSaga() {
|
|
|
18053
18134
|
}, _marked9$2);
|
|
18054
18135
|
}
|
|
18055
18136
|
|
|
18056
|
-
var _marked$
|
|
18057
|
-
_marked2$
|
|
18137
|
+
var _marked$5 = /*#__PURE__*/_regeneratorRuntime().mark(getContacts),
|
|
18138
|
+
_marked2$4 = /*#__PURE__*/_regeneratorRuntime().mark(blockUser),
|
|
18058
18139
|
_marked3$3 = /*#__PURE__*/_regeneratorRuntime().mark(unblockUser),
|
|
18059
18140
|
_marked4$3 = /*#__PURE__*/_regeneratorRuntime().mark(updateProfile),
|
|
18060
18141
|
_marked5$3 = /*#__PURE__*/_regeneratorRuntime().mark(getUsers),
|
|
@@ -18087,7 +18168,7 @@ function getContacts() {
|
|
|
18087
18168
|
case "end":
|
|
18088
18169
|
return _context.stop();
|
|
18089
18170
|
}
|
|
18090
|
-
}, _marked$
|
|
18171
|
+
}, _marked$5, null, [[0, 11]]);
|
|
18091
18172
|
}
|
|
18092
18173
|
function blockUser(action) {
|
|
18093
18174
|
var SceytChatClient, payload, userIds, blockedUsers, activeChannelId, activeChannel, isDirectChannel, directChannelUser;
|
|
@@ -18149,7 +18230,7 @@ function blockUser(action) {
|
|
|
18149
18230
|
case "end":
|
|
18150
18231
|
return _context2.stop();
|
|
18151
18232
|
}
|
|
18152
|
-
}, _marked2$
|
|
18233
|
+
}, _marked2$4, null, [[0, 21]]);
|
|
18153
18234
|
}
|
|
18154
18235
|
function unblockUser(action) {
|
|
18155
18236
|
var SceytChatClient, payload, userIds, unblockedUsers, activeChannelId, activeChannel, isDirectChannel, directChannelUser;
|
|
@@ -18407,7 +18488,7 @@ function MembersSaga$1() {
|
|
|
18407
18488
|
}, _marked7$3);
|
|
18408
18489
|
}
|
|
18409
18490
|
|
|
18410
|
-
var _marked$
|
|
18491
|
+
var _marked$6 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga);
|
|
18411
18492
|
function rootSaga() {
|
|
18412
18493
|
return _regeneratorRuntime().wrap(function rootSaga$(_context) {
|
|
18413
18494
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -18418,7 +18499,7 @@ function rootSaga() {
|
|
|
18418
18499
|
case "end":
|
|
18419
18500
|
return _context.stop();
|
|
18420
18501
|
}
|
|
18421
|
-
}, _marked$
|
|
18502
|
+
}, _marked$6);
|
|
18422
18503
|
}
|
|
18423
18504
|
|
|
18424
18505
|
var sagaMiddleware = createSagaMiddleware__default();
|
|
@@ -18893,9 +18974,10 @@ function useUpdatePresence(channel, isVisible) {
|
|
|
18893
18974
|
}
|
|
18894
18975
|
React.useEffect(function () {
|
|
18895
18976
|
if (userId && isVisible && directChannelUser) {
|
|
18977
|
+
var _usersMap$userId, _usersMap$userId$pres;
|
|
18896
18978
|
if (!usersMap[userId]) {
|
|
18897
18979
|
setUserToMap(directChannelUser);
|
|
18898
|
-
} else if (usersMap[userId].presence.state !== directChannelUser.presence.state) {
|
|
18980
|
+
} else if (((_usersMap$userId = usersMap[userId]) === null || _usersMap$userId === void 0 ? void 0 : (_usersMap$userId$pres = _usersMap$userId.presence) === null || _usersMap$userId$pres === void 0 ? void 0 : _usersMap$userId$pres.state) !== directChannelUser.presence.state) {
|
|
18899
18981
|
var _updateUserStatusOnCh;
|
|
18900
18982
|
updateUserOnMap(directChannelUser);
|
|
18901
18983
|
dispatch(updateUserStatusOnChannelAC((_updateUserStatusOnCh = {}, _updateUserStatusOnCh[directChannelUser.id] = directChannelUser, _updateUserStatusOnCh)));
|
|
@@ -18911,7 +18993,8 @@ function useUpdatePresence(channel, isVisible) {
|
|
|
18911
18993
|
}
|
|
18912
18994
|
}, [connectionStatus]);
|
|
18913
18995
|
React.useEffect(function () {
|
|
18914
|
-
|
|
18996
|
+
var _usersMap$directChann, _usersMap$directChann2;
|
|
18997
|
+
if (directChannelUser && usersMap[directChannelUser.id] && directChannelUser.presence && (directChannelUser.presence.state !== usersMap[directChannelUser.id].state || directChannelUser.presence.lastActiveAt && new Date(directChannelUser.presence.lastActiveAt).getTime() !== new Date(((_usersMap$directChann = usersMap[directChannelUser.id]) === null || _usersMap$directChann === void 0 ? void 0 : (_usersMap$directChann2 = _usersMap$directChann.presence) === null || _usersMap$directChann2 === void 0 ? void 0 : _usersMap$directChann2.lastActiveAt) || 0).getTime())) {
|
|
18915
18998
|
var _updateUserStatusOnCh2;
|
|
18916
18999
|
dispatch(updateUserStatusOnChannelAC((_updateUserStatusOnCh2 = {}, _updateUserStatusOnCh2[directChannelUser.id] = directChannelUser, _updateUserStatusOnCh2)));
|
|
18917
19000
|
updateUserOnMap(directChannelUser);
|
|
@@ -21671,7 +21754,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
21671
21754
|
if (getSelectedChannel) {
|
|
21672
21755
|
getSelectedChannel(activeChannel);
|
|
21673
21756
|
}
|
|
21674
|
-
}, [activeChannel]);
|
|
21757
|
+
}, [activeChannel && activeChannel.members && activeChannel.members.length]);
|
|
21675
21758
|
useDidUpdate(function () {
|
|
21676
21759
|
if (closeSearchChannels) {
|
|
21677
21760
|
getMyChannels();
|