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.modern.js
CHANGED
|
@@ -4,7 +4,7 @@ import log from 'loglevel';
|
|
|
4
4
|
import createSagaMiddleware, { eventChannel } from 'redux-saga';
|
|
5
5
|
import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
|
|
6
6
|
import FileSaver from 'file-saver';
|
|
7
|
-
import { put,
|
|
7
|
+
import { put, select, call, take, takeLatest, takeEvery, all } from 'redux-saga/effects';
|
|
8
8
|
import { v4 } from 'uuid';
|
|
9
9
|
import styled, { createGlobalStyle, keyframes } from 'styled-components';
|
|
10
10
|
import LinkifyIt from 'linkify-it';
|
|
@@ -11459,7 +11459,66 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11459
11459
|
}
|
|
11460
11460
|
};
|
|
11461
11461
|
|
|
11462
|
-
var _marked = /*#__PURE__*/_regeneratorRuntime().mark(
|
|
11462
|
+
var _marked = /*#__PURE__*/_regeneratorRuntime().mark(updateActiveChannelMembersAdd),
|
|
11463
|
+
_marked2 = /*#__PURE__*/_regeneratorRuntime().mark(updateActiveChannelMembersRemove);
|
|
11464
|
+
function updateActiveChannelMembersAdd(addedMembers) {
|
|
11465
|
+
var state, activeChannel, updatedMembers;
|
|
11466
|
+
return _regeneratorRuntime().wrap(function updateActiveChannelMembersAdd$(_context) {
|
|
11467
|
+
while (1) switch (_context.prev = _context.next) {
|
|
11468
|
+
case 0:
|
|
11469
|
+
_context.next = 2;
|
|
11470
|
+
return select();
|
|
11471
|
+
case 2:
|
|
11472
|
+
state = _context.sent;
|
|
11473
|
+
activeChannel = state.ChannelReducer.activeChannel;
|
|
11474
|
+
if (!(activeChannel && activeChannel.id)) {
|
|
11475
|
+
_context.next = 9;
|
|
11476
|
+
break;
|
|
11477
|
+
}
|
|
11478
|
+
updatedMembers = [].concat(activeChannel.members || [], addedMembers);
|
|
11479
|
+
updatedMembers = Array.from(new Set(updatedMembers));
|
|
11480
|
+
_context.next = 9;
|
|
11481
|
+
return put(updateChannelDataAC(activeChannel.id, {
|
|
11482
|
+
members: updatedMembers
|
|
11483
|
+
}));
|
|
11484
|
+
case 9:
|
|
11485
|
+
case "end":
|
|
11486
|
+
return _context.stop();
|
|
11487
|
+
}
|
|
11488
|
+
}, _marked);
|
|
11489
|
+
}
|
|
11490
|
+
function updateActiveChannelMembersRemove(removedMembers) {
|
|
11491
|
+
var state, activeChannel, updatedMembers;
|
|
11492
|
+
return _regeneratorRuntime().wrap(function updateActiveChannelMembersRemove$(_context2) {
|
|
11493
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
11494
|
+
case 0:
|
|
11495
|
+
_context2.next = 2;
|
|
11496
|
+
return select();
|
|
11497
|
+
case 2:
|
|
11498
|
+
state = _context2.sent;
|
|
11499
|
+
activeChannel = state.ChannelReducer.activeChannel;
|
|
11500
|
+
if (!(activeChannel && activeChannel.id)) {
|
|
11501
|
+
_context2.next = 9;
|
|
11502
|
+
break;
|
|
11503
|
+
}
|
|
11504
|
+
updatedMembers = (activeChannel.members || []).filter(function (member) {
|
|
11505
|
+
return !removedMembers.find(function (removed) {
|
|
11506
|
+
return removed.id === member.id;
|
|
11507
|
+
});
|
|
11508
|
+
});
|
|
11509
|
+
updatedMembers = Array.from(new Set(updatedMembers));
|
|
11510
|
+
_context2.next = 9;
|
|
11511
|
+
return put(updateChannelDataAC(activeChannel.id, {
|
|
11512
|
+
members: updatedMembers
|
|
11513
|
+
}));
|
|
11514
|
+
case 9:
|
|
11515
|
+
case "end":
|
|
11516
|
+
return _context2.stop();
|
|
11517
|
+
}
|
|
11518
|
+
}, _marked2);
|
|
11519
|
+
}
|
|
11520
|
+
|
|
11521
|
+
var _marked$1 = /*#__PURE__*/_regeneratorRuntime().mark(watchForEvents);
|
|
11463
11522
|
function watchForEvents() {
|
|
11464
11523
|
var SceytChatClient, channelListener, connectionListener, usersTimeout, chan, _loop;
|
|
11465
11524
|
return _regeneratorRuntime().wrap(function watchForEvents$(_context2) {
|
|
@@ -11829,7 +11888,7 @@ function watchForEvents() {
|
|
|
11829
11888
|
type = _yield$take.type;
|
|
11830
11889
|
args = _yield$take.args;
|
|
11831
11890
|
_context.t0 = type;
|
|
11832
|
-
_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 ?
|
|
11891
|
+
_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;
|
|
11833
11892
|
break;
|
|
11834
11893
|
case 8:
|
|
11835
11894
|
createdChannel = args.createdChannel;
|
|
@@ -11863,7 +11922,7 @@ function watchForEvents() {
|
|
|
11863
11922
|
addChannelToAllChannels(createdChannel);
|
|
11864
11923
|
}
|
|
11865
11924
|
case 24:
|
|
11866
|
-
return _context.abrupt("break",
|
|
11925
|
+
return _context.abrupt("break", 455);
|
|
11867
11926
|
case 25:
|
|
11868
11927
|
channel = args.channel;
|
|
11869
11928
|
log.info('channel JOIN ... . ', channel);
|
|
@@ -11874,7 +11933,7 @@ function watchForEvents() {
|
|
|
11874
11933
|
if (!_chan2) {
|
|
11875
11934
|
addChannelToAllChannels(channel);
|
|
11876
11935
|
}
|
|
11877
|
-
return _context.abrupt("break",
|
|
11936
|
+
return _context.abrupt("break", 455);
|
|
11878
11937
|
case 34:
|
|
11879
11938
|
_channel = args.channel, member = args.member;
|
|
11880
11939
|
log.info('channel LEAVE ... ', _channel, member);
|
|
@@ -11892,208 +11951,217 @@ function watchForEvents() {
|
|
|
11892
11951
|
case 43:
|
|
11893
11952
|
removeChannelFromMap(_channel.id);
|
|
11894
11953
|
deleteChannelFromAllChannels(_channel.id);
|
|
11895
|
-
_context.next =
|
|
11954
|
+
_context.next = 59;
|
|
11896
11955
|
break;
|
|
11897
11956
|
case 47:
|
|
11898
11957
|
groupName = getChannelGroupName(_channel);
|
|
11899
11958
|
if (!_channelExists) {
|
|
11900
|
-
_context.next =
|
|
11959
|
+
_context.next = 56;
|
|
11901
11960
|
break;
|
|
11902
11961
|
}
|
|
11903
11962
|
if (!(_activeChannelId === _channel.id)) {
|
|
11904
|
-
_context.next =
|
|
11963
|
+
_context.next = 54;
|
|
11905
11964
|
break;
|
|
11906
11965
|
}
|
|
11907
11966
|
_context.next = 52;
|
|
11908
11967
|
return put(removeMemberFromListAC([member]));
|
|
11909
11968
|
case 52:
|
|
11910
11969
|
_context.next = 54;
|
|
11970
|
+
return updateActiveChannelMembersRemove([member]);
|
|
11971
|
+
case 54:
|
|
11972
|
+
_context.next = 56;
|
|
11911
11973
|
return put(updateChannelDataAC(_channel.id, {
|
|
11912
11974
|
memberCount: _channel.memberCount,
|
|
11913
11975
|
muted: _channel.muted,
|
|
11914
11976
|
mutedTill: _channel.mutedTill
|
|
11915
11977
|
}));
|
|
11916
|
-
case
|
|
11917
|
-
_context.next =
|
|
11978
|
+
case 56:
|
|
11979
|
+
_context.next = 58;
|
|
11918
11980
|
return put(updateSearchedChannelDataAC(_channel.id, {
|
|
11919
11981
|
memberCount: _channel.memberCount,
|
|
11920
11982
|
muted: _channel.muted,
|
|
11921
11983
|
mutedTill: _channel.mutedTill
|
|
11922
11984
|
}, groupName));
|
|
11923
|
-
case
|
|
11985
|
+
case 58:
|
|
11924
11986
|
updateChannelOnAllChannels(_channel.id, {
|
|
11925
11987
|
memberCount: _channel.memberCount,
|
|
11926
11988
|
muted: _channel.muted,
|
|
11927
11989
|
mutedTill: _channel.mutedTill
|
|
11928
11990
|
});
|
|
11929
|
-
case
|
|
11930
|
-
return _context.abrupt("break",
|
|
11931
|
-
case
|
|
11991
|
+
case 59:
|
|
11992
|
+
return _context.abrupt("break", 455);
|
|
11993
|
+
case 60:
|
|
11932
11994
|
log.info('channel BLOCK ... ');
|
|
11933
11995
|
_channel2 = args.channel;
|
|
11934
11996
|
_channelExists2 = checkChannelExists(_channel2.id);
|
|
11935
11997
|
if (!_channelExists2) {
|
|
11936
|
-
_context.next =
|
|
11998
|
+
_context.next = 66;
|
|
11937
11999
|
break;
|
|
11938
12000
|
}
|
|
11939
|
-
_context.next =
|
|
12001
|
+
_context.next = 66;
|
|
11940
12002
|
return put(removeChannelAC(_channel2.id));
|
|
11941
|
-
case
|
|
11942
|
-
return _context.abrupt("break",
|
|
11943
|
-
case 65:
|
|
11944
|
-
log.info('channel UNBLOCK ... ');
|
|
11945
|
-
return _context.abrupt("break", 449);
|
|
12003
|
+
case 66:
|
|
12004
|
+
return _context.abrupt("break", 455);
|
|
11946
12005
|
case 67:
|
|
12006
|
+
log.info('channel UNBLOCK ... ');
|
|
12007
|
+
return _context.abrupt("break", 455);
|
|
12008
|
+
case 69:
|
|
11947
12009
|
_channel3 = args.channel, removedMembers = args.removedMembers;
|
|
11948
12010
|
log.info('channel KICK_MEMBERS ... ', removedMembers);
|
|
11949
|
-
_context.next =
|
|
12011
|
+
_context.next = 73;
|
|
11950
12012
|
return call(getActiveChannelId);
|
|
11951
|
-
case
|
|
12013
|
+
case 73:
|
|
11952
12014
|
_activeChannelId2 = _context.sent;
|
|
11953
12015
|
_channelExists3 = checkChannelExists(_channel3.id);
|
|
11954
12016
|
if (!_channelExists3) {
|
|
11955
|
-
_context.next =
|
|
12017
|
+
_context.next = 98;
|
|
11956
12018
|
break;
|
|
11957
12019
|
}
|
|
11958
12020
|
if (!removedMembers.find(function (mem) {
|
|
11959
12021
|
return mem.id === SceytChatClient.user.id;
|
|
11960
12022
|
})) {
|
|
11961
|
-
_context.next =
|
|
12023
|
+
_context.next = 88;
|
|
11962
12024
|
break;
|
|
11963
12025
|
}
|
|
11964
12026
|
removeChannelFromMap(_channel3.id);
|
|
11965
|
-
_context.next = 78;
|
|
11966
|
-
return put(removeChannelAC(_channel3.id));
|
|
11967
|
-
case 78:
|
|
11968
12027
|
_context.next = 80;
|
|
11969
|
-
return
|
|
12028
|
+
return put(removeChannelAC(_channel3.id));
|
|
11970
12029
|
case 80:
|
|
12030
|
+
_context.next = 82;
|
|
12031
|
+
return call(getLastChannelFromMap);
|
|
12032
|
+
case 82:
|
|
11971
12033
|
activeChannel = _context.sent;
|
|
11972
12034
|
if (!activeChannel) {
|
|
11973
|
-
_context.next =
|
|
12035
|
+
_context.next = 86;
|
|
11974
12036
|
break;
|
|
11975
12037
|
}
|
|
11976
|
-
_context.next =
|
|
12038
|
+
_context.next = 86;
|
|
11977
12039
|
return put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
11978
|
-
case 84:
|
|
11979
|
-
_context.next = 94;
|
|
11980
|
-
break;
|
|
11981
12040
|
case 86:
|
|
12041
|
+
_context.next = 98;
|
|
12042
|
+
break;
|
|
12043
|
+
case 88:
|
|
11982
12044
|
if (!(_activeChannelId2 === _channel3.id)) {
|
|
11983
|
-
_context.next =
|
|
12045
|
+
_context.next = 93;
|
|
11984
12046
|
break;
|
|
11985
12047
|
}
|
|
11986
|
-
_context.next =
|
|
12048
|
+
_context.next = 91;
|
|
11987
12049
|
return put(removeMemberFromListAC(removedMembers));
|
|
11988
|
-
case
|
|
12050
|
+
case 91:
|
|
12051
|
+
_context.next = 93;
|
|
12052
|
+
return updateActiveChannelMembersRemove(removedMembers);
|
|
12053
|
+
case 93:
|
|
11989
12054
|
_groupName = getChannelGroupName(_channel3);
|
|
11990
|
-
_context.next =
|
|
12055
|
+
_context.next = 96;
|
|
11991
12056
|
return put(updateSearchedChannelDataAC(_channel3.id, {
|
|
11992
12057
|
memberCount: _channel3.memberCount,
|
|
11993
12058
|
muted: _channel3.muted,
|
|
11994
12059
|
mutedTill: _channel3.mutedTill
|
|
11995
12060
|
}, _groupName));
|
|
11996
|
-
case
|
|
11997
|
-
_context.next =
|
|
12061
|
+
case 96:
|
|
12062
|
+
_context.next = 98;
|
|
11998
12063
|
return put(updateChannelDataAC(_channel3.id, {
|
|
11999
12064
|
memberCount: _channel3.memberCount,
|
|
12000
12065
|
muted: _channel3.muted,
|
|
12001
12066
|
mutedTill: _channel3.mutedTill
|
|
12002
12067
|
}));
|
|
12003
|
-
case
|
|
12068
|
+
case 98:
|
|
12004
12069
|
updateChannelOnAllChannels(_channel3.id, {
|
|
12005
12070
|
memberCount: _channel3.memberCount,
|
|
12006
12071
|
muted: _channel3.muted,
|
|
12007
12072
|
mutedTill: _channel3.mutedTill
|
|
12008
12073
|
});
|
|
12009
|
-
return _context.abrupt("break",
|
|
12010
|
-
case
|
|
12074
|
+
return _context.abrupt("break", 455);
|
|
12075
|
+
case 100:
|
|
12011
12076
|
_channel4 = args.channel, addedMembers = args.addedMembers;
|
|
12012
12077
|
log.info('channel ADD_MEMBERS ... ', addedMembers);
|
|
12013
|
-
_context.next =
|
|
12078
|
+
_context.next = 104;
|
|
12014
12079
|
return call(getActiveChannelId);
|
|
12015
|
-
case
|
|
12080
|
+
case 104:
|
|
12016
12081
|
_activeChannelId3 = _context.sent;
|
|
12017
12082
|
_channelExists4 = checkChannelExists(_channel4.id);
|
|
12018
12083
|
if (!_channelExists4) {
|
|
12019
|
-
_context.next =
|
|
12084
|
+
_context.next = 116;
|
|
12020
12085
|
break;
|
|
12021
12086
|
}
|
|
12022
12087
|
if (!(_activeChannelId3 === _channel4.id)) {
|
|
12023
|
-
_context.next =
|
|
12088
|
+
_context.next = 112;
|
|
12024
12089
|
break;
|
|
12025
12090
|
}
|
|
12026
|
-
_context.next =
|
|
12091
|
+
_context.next = 110;
|
|
12027
12092
|
return put(addMembersToListAC(addedMembers));
|
|
12028
|
-
case
|
|
12029
|
-
_context.next =
|
|
12093
|
+
case 110:
|
|
12094
|
+
_context.next = 112;
|
|
12095
|
+
return updateActiveChannelMembersAdd(addedMembers);
|
|
12096
|
+
case 112:
|
|
12097
|
+
_context.next = 114;
|
|
12030
12098
|
return put(updateChannelDataAC(_channel4.id, {
|
|
12031
12099
|
memberCount: _channel4.memberCount,
|
|
12032
12100
|
muted: _channel4.muted,
|
|
12033
12101
|
mutedTill: _channel4.mutedTill
|
|
12034
12102
|
}));
|
|
12035
|
-
case
|
|
12036
|
-
_context.next =
|
|
12103
|
+
case 114:
|
|
12104
|
+
_context.next = 120;
|
|
12037
12105
|
break;
|
|
12038
|
-
case
|
|
12039
|
-
_context.next =
|
|
12106
|
+
case 116:
|
|
12107
|
+
_context.next = 118;
|
|
12040
12108
|
return call(setChannelInMap, _channel4);
|
|
12041
|
-
case
|
|
12042
|
-
_context.next =
|
|
12109
|
+
case 118:
|
|
12110
|
+
_context.next = 120;
|
|
12043
12111
|
return put(setAddedToChannelAC(JSON.parse(JSON.stringify(_channel4))));
|
|
12044
|
-
case
|
|
12112
|
+
case 120:
|
|
12045
12113
|
_groupName2 = getChannelGroupName(_channel4);
|
|
12046
|
-
_context.next =
|
|
12114
|
+
_context.next = 123;
|
|
12047
12115
|
return put(updateSearchedChannelDataAC(_channel4.id, {
|
|
12048
12116
|
memberCount: _channel4.memberCount,
|
|
12049
12117
|
muted: _channel4.muted,
|
|
12050
12118
|
mutedTill: _channel4.mutedTill
|
|
12051
12119
|
}, _groupName2));
|
|
12052
|
-
case
|
|
12120
|
+
case 123:
|
|
12053
12121
|
updateChannelOnAllChannels(_channel4.id, {
|
|
12054
12122
|
memberCount: _channel4.memberCount,
|
|
12055
12123
|
muted: _channel4.muted,
|
|
12056
12124
|
mutedTill: _channel4.mutedTill
|
|
12057
12125
|
});
|
|
12058
|
-
return _context.abrupt("break",
|
|
12059
|
-
case
|
|
12126
|
+
return _context.abrupt("break", 455);
|
|
12127
|
+
case 125:
|
|
12060
12128
|
updatedChannel = args.updatedChannel;
|
|
12061
12129
|
_channelExists5 = checkChannelExists(updatedChannel.id);
|
|
12062
12130
|
subject = updatedChannel.subject, avatarUrl = updatedChannel.avatarUrl, muted = updatedChannel.muted, mutedTill = updatedChannel.mutedTill, metadata = updatedChannel.metadata;
|
|
12063
12131
|
if (!_channelExists5) {
|
|
12064
|
-
_context.next =
|
|
12132
|
+
_context.next = 137;
|
|
12065
12133
|
break;
|
|
12066
12134
|
}
|
|
12067
|
-
_context.next =
|
|
12135
|
+
_context.next = 131;
|
|
12068
12136
|
return put(updateChannelDataAC(updatedChannel.id, {
|
|
12069
12137
|
subject: subject,
|
|
12070
12138
|
avatarUrl: avatarUrl,
|
|
12071
12139
|
muted: muted,
|
|
12072
12140
|
mutedTill: mutedTill
|
|
12073
12141
|
}));
|
|
12074
|
-
case
|
|
12075
|
-
_context.next =
|
|
12142
|
+
case 131:
|
|
12143
|
+
_context.next = 133;
|
|
12076
12144
|
return call(getActiveChannelId);
|
|
12077
|
-
case
|
|
12145
|
+
case 133:
|
|
12078
12146
|
_activeChannelId4 = _context.sent;
|
|
12079
12147
|
if (!(_activeChannelId4 === updatedChannel.id)) {
|
|
12080
|
-
_context.next =
|
|
12148
|
+
_context.next = 137;
|
|
12081
12149
|
break;
|
|
12082
12150
|
}
|
|
12083
|
-
_context.next =
|
|
12151
|
+
_context.next = 137;
|
|
12084
12152
|
return put(setActiveChannelAC(_extends({}, updatedChannel, {
|
|
12085
12153
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
12086
12154
|
})));
|
|
12087
|
-
case
|
|
12155
|
+
case 137:
|
|
12088
12156
|
_groupName3 = getChannelGroupName(updatedChannel);
|
|
12089
|
-
_context.next =
|
|
12157
|
+
_context.next = 140;
|
|
12090
12158
|
return put(updateSearchedChannelDataAC(updatedChannel.id, {
|
|
12091
12159
|
subject: subject,
|
|
12092
12160
|
avatarUrl: avatarUrl,
|
|
12093
12161
|
muted: muted,
|
|
12094
12162
|
mutedTill: mutedTill
|
|
12095
12163
|
}, _groupName3));
|
|
12096
|
-
case
|
|
12164
|
+
case 140:
|
|
12097
12165
|
updateChannelOnAllChannels(updatedChannel.id, {
|
|
12098
12166
|
subject: subject,
|
|
12099
12167
|
avatarUrl: avatarUrl,
|
|
@@ -12101,102 +12169,102 @@ function watchForEvents() {
|
|
|
12101
12169
|
mutedTill: mutedTill,
|
|
12102
12170
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
12103
12171
|
});
|
|
12104
|
-
return _context.abrupt("break",
|
|
12105
|
-
case
|
|
12172
|
+
return _context.abrupt("break", 455);
|
|
12173
|
+
case 142:
|
|
12106
12174
|
_channel5 = args.channel, message = args.message;
|
|
12107
12175
|
log.info('channel MESSAGE ... id : ', message.id, ' message: ', message, ' channel.id: ', _channel5.id);
|
|
12108
12176
|
messageToHandle = handleNewMessages ? handleNewMessages(message, _channel5) : message;
|
|
12109
12177
|
_channelFilterTypes = getChannelTypesFilter();
|
|
12110
12178
|
if (!(messageToHandle && _channel5 && (_channelFilterTypes !== null && _channelFilterTypes !== void 0 && _channelFilterTypes.length ? _channelFilterTypes.includes(_channel5.type) : true))) {
|
|
12111
|
-
_context.next =
|
|
12179
|
+
_context.next = 208;
|
|
12112
12180
|
break;
|
|
12113
12181
|
}
|
|
12114
12182
|
_channel5.metadata = isJSON(_channel5.metadata) ? JSON.parse(_channel5.metadata) : _channel5.metadata;
|
|
12115
|
-
_context.next =
|
|
12183
|
+
_context.next = 150;
|
|
12116
12184
|
return call(getActiveChannelId);
|
|
12117
|
-
case
|
|
12185
|
+
case 150:
|
|
12118
12186
|
_activeChannelId5 = _context.sent;
|
|
12119
12187
|
_channelExists6 = checkChannelExists(_channel5.id);
|
|
12120
12188
|
channelForAdd = JSON.parse(JSON.stringify(_channel5));
|
|
12121
|
-
_context.next =
|
|
12189
|
+
_context.next = 155;
|
|
12122
12190
|
return put(addChannelAC(channelForAdd));
|
|
12123
|
-
case
|
|
12191
|
+
case 155:
|
|
12124
12192
|
if (_channelExists6) {
|
|
12125
|
-
_context.next =
|
|
12193
|
+
_context.next = 160;
|
|
12126
12194
|
break;
|
|
12127
12195
|
}
|
|
12128
|
-
_context.next =
|
|
12196
|
+
_context.next = 158;
|
|
12129
12197
|
return call(setChannelInMap, _channel5);
|
|
12130
|
-
case
|
|
12131
|
-
_context.next =
|
|
12198
|
+
case 158:
|
|
12199
|
+
_context.next = 163;
|
|
12132
12200
|
break;
|
|
12133
|
-
case
|
|
12201
|
+
case 160:
|
|
12134
12202
|
if (message.repliedInThread) {
|
|
12135
|
-
_context.next =
|
|
12203
|
+
_context.next = 163;
|
|
12136
12204
|
break;
|
|
12137
12205
|
}
|
|
12138
|
-
_context.next =
|
|
12206
|
+
_context.next = 163;
|
|
12139
12207
|
return put(updateChannelLastMessageAC(message, channelForAdd));
|
|
12140
|
-
case
|
|
12208
|
+
case 163:
|
|
12141
12209
|
if (!(_channel5.id === _activeChannelId5)) {
|
|
12142
|
-
_context.next =
|
|
12210
|
+
_context.next = 175;
|
|
12143
12211
|
break;
|
|
12144
12212
|
}
|
|
12145
12213
|
if (getHasNextCached()) {
|
|
12146
|
-
_context.next =
|
|
12214
|
+
_context.next = 167;
|
|
12147
12215
|
break;
|
|
12148
12216
|
}
|
|
12149
|
-
_context.next =
|
|
12217
|
+
_context.next = 167;
|
|
12150
12218
|
return put(addMessageAC(message));
|
|
12151
|
-
case
|
|
12219
|
+
case 167:
|
|
12152
12220
|
addAllMessages([message], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
12153
|
-
_context.next =
|
|
12221
|
+
_context.next = 171;
|
|
12154
12222
|
return select(messagesHasNextSelector);
|
|
12155
|
-
case
|
|
12223
|
+
case 171:
|
|
12156
12224
|
hasNextMessage = _context.sent;
|
|
12157
12225
|
if (!(!getHasNextCached() && !hasNextMessage)) {
|
|
12158
|
-
_context.next =
|
|
12226
|
+
_context.next = 175;
|
|
12159
12227
|
break;
|
|
12160
12228
|
}
|
|
12161
|
-
_context.next =
|
|
12229
|
+
_context.next = 175;
|
|
12162
12230
|
return put(scrollToNewMessageAC(true, false, true));
|
|
12163
|
-
case
|
|
12231
|
+
case 175:
|
|
12164
12232
|
if (getMessagesFromMap(_channel5.id) && getMessagesFromMap(_channel5.id).length) {
|
|
12165
12233
|
addMessageToMap(_channel5.id, message);
|
|
12166
12234
|
}
|
|
12167
|
-
_context.next =
|
|
12235
|
+
_context.next = 178;
|
|
12168
12236
|
return put(updateChannelDataAC(_channel5.id, _extends({}, channelForAdd, {
|
|
12169
12237
|
userMessageReactions: [],
|
|
12170
12238
|
lastReactedMessage: null
|
|
12171
12239
|
})));
|
|
12172
|
-
case
|
|
12240
|
+
case 178:
|
|
12173
12241
|
_groupName4 = getChannelGroupName(_channel5);
|
|
12174
|
-
_context.next =
|
|
12242
|
+
_context.next = 181;
|
|
12175
12243
|
return put(updateSearchedChannelDataAC(_channel5.id, _extends({}, channelForAdd, {
|
|
12176
12244
|
userMessageReactions: [],
|
|
12177
12245
|
lastReactedMessage: null
|
|
12178
12246
|
}), _groupName4));
|
|
12179
|
-
case
|
|
12247
|
+
case 181:
|
|
12180
12248
|
showNotifications = getShowNotifications();
|
|
12181
12249
|
if (!(showNotifications && !message.silent && message.user.id !== SceytChatClient.user.id && !_channel5.muted)) {
|
|
12182
|
-
_context.next =
|
|
12250
|
+
_context.next = 198;
|
|
12183
12251
|
break;
|
|
12184
12252
|
}
|
|
12185
12253
|
if (!(Notification.permission === 'granted')) {
|
|
12186
|
-
_context.next =
|
|
12254
|
+
_context.next = 198;
|
|
12187
12255
|
break;
|
|
12188
12256
|
}
|
|
12189
|
-
_context.next =
|
|
12257
|
+
_context.next = 186;
|
|
12190
12258
|
return select(browserTabIsActiveSelector);
|
|
12191
|
-
case
|
|
12259
|
+
case 186:
|
|
12192
12260
|
tabIsActive = _context.sent;
|
|
12193
12261
|
if (!(document.visibilityState !== 'visible' || !tabIsActive || _channel5.id !== _activeChannelId5)) {
|
|
12194
|
-
_context.next =
|
|
12262
|
+
_context.next = 198;
|
|
12195
12263
|
break;
|
|
12196
12264
|
}
|
|
12197
|
-
_context.next =
|
|
12265
|
+
_context.next = 190;
|
|
12198
12266
|
return select(contactsMapSelector);
|
|
12199
|
-
case
|
|
12267
|
+
case 190:
|
|
12200
12268
|
contactsMap = _context.sent;
|
|
12201
12269
|
_getFromContacts = getShowOnlyContactUsers();
|
|
12202
12270
|
state = store.getState();
|
|
@@ -12216,42 +12284,42 @@ function watchForEvents() {
|
|
|
12216
12284
|
setNotification(messageBody, message.user, _channel5, undefined, message.attachments && message.attachments.length ? message.attachments.find(function (att) {
|
|
12217
12285
|
return att.type !== attachmentTypes.link;
|
|
12218
12286
|
}) : undefined);
|
|
12219
|
-
case
|
|
12287
|
+
case 198:
|
|
12220
12288
|
log.info('send delivered for message . .. . ', message);
|
|
12221
12289
|
if (!(message.repliedInThread && message.parentMessage.id)) {
|
|
12222
|
-
_context.next =
|
|
12290
|
+
_context.next = 204;
|
|
12223
12291
|
break;
|
|
12224
12292
|
}
|
|
12225
|
-
_context.next =
|
|
12293
|
+
_context.next = 202;
|
|
12226
12294
|
return put(markMessagesAsDeliveredAC(message.parentMessage.id, [message.id]));
|
|
12227
|
-
case
|
|
12228
|
-
_context.next =
|
|
12295
|
+
case 202:
|
|
12296
|
+
_context.next = 206;
|
|
12229
12297
|
break;
|
|
12230
|
-
case
|
|
12231
|
-
_context.next =
|
|
12298
|
+
case 204:
|
|
12299
|
+
_context.next = 206;
|
|
12232
12300
|
return put(markMessagesAsDeliveredAC(_channel5.id, [message.id]));
|
|
12233
|
-
case
|
|
12301
|
+
case 206:
|
|
12234
12302
|
updateChannelOnAllChannels(_channel5.id, _extends({}, channelForAdd, {
|
|
12235
12303
|
userMessageReactions: [],
|
|
12236
12304
|
lastReactedMessage: null
|
|
12237
12305
|
}));
|
|
12238
12306
|
updateChannelLastMessageOnAllChannels(_channel5.id, _channel5.lastMessage);
|
|
12239
|
-
case
|
|
12240
|
-
return _context.abrupt("break",
|
|
12241
|
-
case
|
|
12307
|
+
case 208:
|
|
12308
|
+
return _context.abrupt("break", 455);
|
|
12309
|
+
case 209:
|
|
12242
12310
|
channelId = args.channelId, markerList = args.markerList;
|
|
12243
|
-
_context.next =
|
|
12311
|
+
_context.next = 212;
|
|
12244
12312
|
return call(getChannelFromMap, channelId);
|
|
12245
|
-
case
|
|
12313
|
+
case 212:
|
|
12246
12314
|
_channel6 = _context.sent;
|
|
12247
12315
|
log.info('channel MESSAGE_MARKERS_RECEIVED ... channel: ', _channel6, 'markers list: ', markerList);
|
|
12248
12316
|
if (!_channel6) {
|
|
12249
|
-
_context.next =
|
|
12317
|
+
_context.next = 231;
|
|
12250
12318
|
break;
|
|
12251
12319
|
}
|
|
12252
|
-
_context.next =
|
|
12320
|
+
_context.next = 217;
|
|
12253
12321
|
return call(getActiveChannelId);
|
|
12254
|
-
case
|
|
12322
|
+
case 217:
|
|
12255
12323
|
_activeChannelId6 = _context.sent;
|
|
12256
12324
|
updateLastMessage = false;
|
|
12257
12325
|
markersMap = {};
|
|
@@ -12269,91 +12337,91 @@ function watchForEvents() {
|
|
|
12269
12337
|
});
|
|
12270
12338
|
});
|
|
12271
12339
|
if (!updateLastMessage) {
|
|
12272
|
-
_context.next =
|
|
12340
|
+
_context.next = 226;
|
|
12273
12341
|
break;
|
|
12274
12342
|
}
|
|
12275
12343
|
lastMessage = _extends({}, _channel6.lastMessage, {
|
|
12276
12344
|
deliveryStatus: markerList.name
|
|
12277
12345
|
});
|
|
12278
12346
|
updateChannelLastMessageOnAllChannels(_channel6.id, lastMessage);
|
|
12279
|
-
_context.next =
|
|
12347
|
+
_context.next = 226;
|
|
12280
12348
|
return put(updateChannelLastMessageStatusAC(lastMessage, JSON.parse(JSON.stringify(_channel6))));
|
|
12281
|
-
case
|
|
12349
|
+
case 226:
|
|
12282
12350
|
if (!(_activeChannelId6 === channelId)) {
|
|
12283
|
-
_context.next =
|
|
12351
|
+
_context.next = 230;
|
|
12284
12352
|
break;
|
|
12285
12353
|
}
|
|
12286
|
-
_context.next =
|
|
12354
|
+
_context.next = 229;
|
|
12287
12355
|
return put(updateMessagesStatusAC(markerList.name, markersMap));
|
|
12288
|
-
case
|
|
12356
|
+
case 229:
|
|
12289
12357
|
updateMarkersOnAllMessages(markersMap, markerList.name);
|
|
12290
|
-
case
|
|
12358
|
+
case 230:
|
|
12291
12359
|
updateMessageStatusOnMap(_channel6.id, {
|
|
12292
12360
|
name: markerList.name,
|
|
12293
12361
|
markersMap: markersMap
|
|
12294
12362
|
});
|
|
12295
|
-
case
|
|
12296
|
-
return _context.abrupt("break",
|
|
12297
|
-
case
|
|
12363
|
+
case 231:
|
|
12364
|
+
return _context.abrupt("break", 455);
|
|
12365
|
+
case 232:
|
|
12298
12366
|
_channelId = args.channelId;
|
|
12299
12367
|
log.info('channel DELETE ... ');
|
|
12300
12368
|
_channel7 = getChannelFromMap(_channelId);
|
|
12301
|
-
_context.next =
|
|
12369
|
+
_context.next = 237;
|
|
12302
12370
|
return put(setChannelToRemoveAC(_channel7));
|
|
12303
|
-
case
|
|
12371
|
+
case 237:
|
|
12304
12372
|
deleteChannelFromAllChannels(_channelId);
|
|
12305
|
-
return _context.abrupt("break",
|
|
12306
|
-
case
|
|
12373
|
+
return _context.abrupt("break", 455);
|
|
12374
|
+
case 239:
|
|
12307
12375
|
_channel8 = args.channel, deletedMessage = args.deletedMessage;
|
|
12308
12376
|
_activeChannelId7 = getActiveChannelId();
|
|
12309
12377
|
log.info('channel DELETE_MESSAGE ... ');
|
|
12310
12378
|
_channelExists7 = checkChannelExists(_channel8.id);
|
|
12311
12379
|
if (!(_channel8.id === _activeChannelId7)) {
|
|
12312
|
-
_context.next =
|
|
12380
|
+
_context.next = 247;
|
|
12313
12381
|
break;
|
|
12314
12382
|
}
|
|
12315
12383
|
updateMessageOnAllMessages(deletedMessage.id, deletedMessage);
|
|
12316
|
-
_context.next =
|
|
12384
|
+
_context.next = 247;
|
|
12317
12385
|
return put(updateMessageAC(deletedMessage.id, deletedMessage));
|
|
12318
|
-
case
|
|
12386
|
+
case 247:
|
|
12319
12387
|
updateMessageOnMap(_channel8.id, {
|
|
12320
12388
|
messageId: deletedMessage.id,
|
|
12321
12389
|
params: deletedMessage
|
|
12322
12390
|
});
|
|
12323
12391
|
if (!_channelExists7) {
|
|
12324
|
-
_context.next =
|
|
12392
|
+
_context.next = 254;
|
|
12325
12393
|
break;
|
|
12326
12394
|
}
|
|
12327
|
-
_context.next =
|
|
12395
|
+
_context.next = 251;
|
|
12328
12396
|
return put(updateChannelDataAC(_channel8.id, {
|
|
12329
12397
|
newMessageCount: _channel8.newMessageCount,
|
|
12330
12398
|
muted: _channel8.muted,
|
|
12331
12399
|
mutedTill: _channel8.mutedTill
|
|
12332
12400
|
}));
|
|
12333
|
-
case
|
|
12401
|
+
case 251:
|
|
12334
12402
|
if (!(_channel8.lastMessage.id === deletedMessage.id)) {
|
|
12335
|
-
_context.next =
|
|
12403
|
+
_context.next = 254;
|
|
12336
12404
|
break;
|
|
12337
12405
|
}
|
|
12338
|
-
_context.next =
|
|
12406
|
+
_context.next = 254;
|
|
12339
12407
|
return put(updateChannelLastMessageAC(deletedMessage, _channel8));
|
|
12340
|
-
case
|
|
12408
|
+
case 254:
|
|
12341
12409
|
updateChannelOnAllChannels(_channel8.id, {
|
|
12342
12410
|
newMessageCount: _channel8.newMessageCount,
|
|
12343
12411
|
muted: _channel8.muted,
|
|
12344
12412
|
mutedTill: _channel8.mutedTill
|
|
12345
12413
|
}, deletedMessage);
|
|
12346
|
-
return _context.abrupt("break",
|
|
12347
|
-
case
|
|
12414
|
+
return _context.abrupt("break", 455);
|
|
12415
|
+
case 256:
|
|
12348
12416
|
_channel9 = args.channel, _message = args.message;
|
|
12349
12417
|
log.info('channel EDIT_MESSAGE ... ', _message);
|
|
12350
12418
|
_activeChannelId8 = getActiveChannelId();
|
|
12351
12419
|
_channelExists8 = checkChannelExists(_channel9.id);
|
|
12352
12420
|
if (!(_channel9.id === _activeChannelId8)) {
|
|
12353
|
-
_context.next =
|
|
12421
|
+
_context.next = 264;
|
|
12354
12422
|
break;
|
|
12355
12423
|
}
|
|
12356
|
-
_context.next =
|
|
12424
|
+
_context.next = 263;
|
|
12357
12425
|
return put(updateMessageAC(_message.id, {
|
|
12358
12426
|
body: _message.body,
|
|
12359
12427
|
state: _message.state,
|
|
@@ -12362,7 +12430,7 @@ function watchForEvents() {
|
|
|
12362
12430
|
mentionedUsers: _message.mentionedUsers,
|
|
12363
12431
|
updatedAt: _message.updatedAt
|
|
12364
12432
|
}));
|
|
12365
|
-
case
|
|
12433
|
+
case 263:
|
|
12366
12434
|
updateMessageOnAllMessages(_message.id, {
|
|
12367
12435
|
body: _message.body,
|
|
12368
12436
|
state: _message.state,
|
|
@@ -12371,18 +12439,18 @@ function watchForEvents() {
|
|
|
12371
12439
|
mentionedUsers: _message.mentionedUsers,
|
|
12372
12440
|
updatedAt: _message.updatedAt
|
|
12373
12441
|
});
|
|
12374
|
-
case
|
|
12442
|
+
case 264:
|
|
12375
12443
|
if (!_channelExists8) {
|
|
12376
|
-
_context.next =
|
|
12444
|
+
_context.next = 268;
|
|
12377
12445
|
break;
|
|
12378
12446
|
}
|
|
12379
12447
|
if (!(_channel9.lastMessage.id === _message.id)) {
|
|
12380
|
-
_context.next =
|
|
12448
|
+
_context.next = 268;
|
|
12381
12449
|
break;
|
|
12382
12450
|
}
|
|
12383
|
-
_context.next =
|
|
12451
|
+
_context.next = 268;
|
|
12384
12452
|
return put(updateChannelLastMessageAC(_message, _channel9));
|
|
12385
|
-
case
|
|
12453
|
+
case 268:
|
|
12386
12454
|
if (checkChannelExistsOnMessagesMap(_channel9.id)) {
|
|
12387
12455
|
updateMessageOnMap(_channel9.id, {
|
|
12388
12456
|
messageId: _message.id,
|
|
@@ -12390,36 +12458,36 @@ function watchForEvents() {
|
|
|
12390
12458
|
});
|
|
12391
12459
|
}
|
|
12392
12460
|
updateChannelOnAllChannels(_channel9.id, {}, _message);
|
|
12393
|
-
return _context.abrupt("break",
|
|
12394
|
-
case
|
|
12461
|
+
return _context.abrupt("break", 455);
|
|
12462
|
+
case 271:
|
|
12395
12463
|
_channel0 = args.channel, user = args.user, _message2 = args.message, reaction = args.reaction;
|
|
12396
12464
|
log.info('channel REACTION_ADDED ... ', args);
|
|
12397
12465
|
isSelf = user.id === SceytChatClient.user.id;
|
|
12398
12466
|
_activeChannelId9 = getActiveChannelId();
|
|
12399
12467
|
if (!(_channel0.id === _activeChannelId9)) {
|
|
12400
|
-
_context.next =
|
|
12468
|
+
_context.next = 279;
|
|
12401
12469
|
break;
|
|
12402
12470
|
}
|
|
12403
|
-
_context.next =
|
|
12471
|
+
_context.next = 278;
|
|
12404
12472
|
return put(addReactionToMessageAC(_message2, reaction, isSelf));
|
|
12405
|
-
case
|
|
12473
|
+
case 278:
|
|
12406
12474
|
addReactionOnAllMessages(_message2, reaction, true);
|
|
12407
|
-
case
|
|
12475
|
+
case 279:
|
|
12408
12476
|
if (!(_message2.user.id === SceytChatClient.user.id)) {
|
|
12409
|
-
_context.next =
|
|
12477
|
+
_context.next = 297;
|
|
12410
12478
|
break;
|
|
12411
12479
|
}
|
|
12412
12480
|
if (!(!isSelf && Notification.permission === 'granted')) {
|
|
12413
|
-
_context.next =
|
|
12481
|
+
_context.next = 292;
|
|
12414
12482
|
break;
|
|
12415
12483
|
}
|
|
12416
12484
|
if (!(document.visibilityState !== 'visible' || _channel0.id !== _activeChannelId9)) {
|
|
12417
|
-
_context.next =
|
|
12485
|
+
_context.next = 292;
|
|
12418
12486
|
break;
|
|
12419
12487
|
}
|
|
12420
|
-
_context.next =
|
|
12488
|
+
_context.next = 284;
|
|
12421
12489
|
return select(contactsMapSelector);
|
|
12422
|
-
case
|
|
12490
|
+
case 284:
|
|
12423
12491
|
_contactsMap = _context.sent;
|
|
12424
12492
|
_getFromContacts2 = getShowOnlyContactUsers();
|
|
12425
12493
|
_state = store.getState();
|
|
@@ -12439,9 +12507,9 @@ function watchForEvents() {
|
|
|
12439
12507
|
setNotification(_messageBody, reaction.user, _channel0, reaction.key, _message2.attachments && _message2.attachments.length ? _message2.attachments.find(function (att) {
|
|
12440
12508
|
return att.type !== attachmentTypes.link;
|
|
12441
12509
|
}) : undefined);
|
|
12442
|
-
case
|
|
12510
|
+
case 292:
|
|
12443
12511
|
if (!(_channel0.newReactions && _channel0.newReactions.length)) {
|
|
12444
|
-
_context.next =
|
|
12512
|
+
_context.next = 296;
|
|
12445
12513
|
break;
|
|
12446
12514
|
}
|
|
12447
12515
|
channelUpdateParams = {
|
|
@@ -12451,9 +12519,9 @@ function watchForEvents() {
|
|
|
12451
12519
|
muted: _channel0.muted,
|
|
12452
12520
|
mutedTill: _channel0.mutedTill
|
|
12453
12521
|
};
|
|
12454
|
-
_context.next =
|
|
12522
|
+
_context.next = 296;
|
|
12455
12523
|
return put(updateChannelDataAC(_channel0.id, channelUpdateParams));
|
|
12456
|
-
case
|
|
12524
|
+
case 296:
|
|
12457
12525
|
updateChannelOnAllChannels(_channel0.id, {
|
|
12458
12526
|
userMessageReactions: _channel0.newReactions,
|
|
12459
12527
|
lastReactedMessage: _message2,
|
|
@@ -12461,77 +12529,77 @@ function watchForEvents() {
|
|
|
12461
12529
|
muted: _channel0.muted,
|
|
12462
12530
|
mutedTill: _channel0.mutedTill
|
|
12463
12531
|
});
|
|
12464
|
-
case
|
|
12532
|
+
case 297:
|
|
12465
12533
|
if (checkChannelExistsOnMessagesMap(_channel0.id)) {
|
|
12466
12534
|
addReactionToMessageOnMap(_channel0.id, _message2, reaction, true);
|
|
12467
12535
|
}
|
|
12468
|
-
return _context.abrupt("break",
|
|
12469
|
-
case
|
|
12536
|
+
return _context.abrupt("break", 455);
|
|
12537
|
+
case 299:
|
|
12470
12538
|
_channel1 = args.channel, _user = args.user, _message3 = args.message, _reaction = args.reaction;
|
|
12471
12539
|
log.info('channel REACTION_DELETED ... ', _channel1);
|
|
12472
12540
|
channelFromMap = getChannelFromMap(_channel1.id);
|
|
12473
12541
|
_isSelf = _user.id === SceytChatClient.user.id;
|
|
12474
12542
|
_activeChannelId0 = getActiveChannelId();
|
|
12475
12543
|
if (!(_channel1.id === _activeChannelId0)) {
|
|
12476
|
-
_context.next =
|
|
12544
|
+
_context.next = 308;
|
|
12477
12545
|
break;
|
|
12478
12546
|
}
|
|
12479
|
-
_context.next =
|
|
12547
|
+
_context.next = 307;
|
|
12480
12548
|
return put(deleteReactionFromMessageAC(_message3, _reaction, _isSelf));
|
|
12481
|
-
case
|
|
12549
|
+
case 307:
|
|
12482
12550
|
removeReactionOnAllMessages(_message3, _reaction, true);
|
|
12483
|
-
case
|
|
12551
|
+
case 308:
|
|
12484
12552
|
_channelUpdateParams = JSON.parse(JSON.stringify(_channel1));
|
|
12485
12553
|
if (channelFromMap && channelFromMap.lastReactedMessage && channelFromMap.lastReactedMessage.id === _message3.id) {
|
|
12486
12554
|
_channelUpdateParams.lastReactedMessage = null;
|
|
12487
12555
|
}
|
|
12488
|
-
_context.next =
|
|
12556
|
+
_context.next = 312;
|
|
12489
12557
|
return put(updateChannelDataAC(_channel1.id, _channelUpdateParams));
|
|
12490
|
-
case
|
|
12558
|
+
case 312:
|
|
12491
12559
|
updateChannelOnAllChannels(_channel1.id, _channelUpdateParams);
|
|
12492
12560
|
if (checkChannelExistsOnMessagesMap(_channel1.id)) {
|
|
12493
12561
|
removeReactionToMessageOnMap(_channel1.id, _message3, _reaction, true);
|
|
12494
12562
|
}
|
|
12495
|
-
return _context.abrupt("break",
|
|
12496
|
-
case
|
|
12563
|
+
return _context.abrupt("break", 455);
|
|
12564
|
+
case 315:
|
|
12497
12565
|
_channel10 = args.channel;
|
|
12498
12566
|
if (!_channel10) {
|
|
12499
|
-
_context.next =
|
|
12567
|
+
_context.next = 321;
|
|
12500
12568
|
break;
|
|
12501
12569
|
}
|
|
12502
12570
|
_updatedChannel = JSON.parse(JSON.stringify(_channel10));
|
|
12503
|
-
_context.next =
|
|
12571
|
+
_context.next = 320;
|
|
12504
12572
|
return put(updateChannelDataAC(_channel10.id, _updatedChannel));
|
|
12505
|
-
case
|
|
12573
|
+
case 320:
|
|
12506
12574
|
updateChannelOnAllChannels(_channel10.id, _updatedChannel);
|
|
12507
|
-
case
|
|
12508
|
-
return _context.abrupt("break",
|
|
12509
|
-
case
|
|
12575
|
+
case 321:
|
|
12576
|
+
return _context.abrupt("break", 455);
|
|
12577
|
+
case 322:
|
|
12510
12578
|
_channel11 = args.channel;
|
|
12511
12579
|
log.info('CLEAR_HISTORY: ', _channel11);
|
|
12512
|
-
_context.next =
|
|
12580
|
+
_context.next = 326;
|
|
12513
12581
|
return call(getActiveChannelId);
|
|
12514
|
-
case
|
|
12582
|
+
case 326:
|
|
12515
12583
|
_activeChannelId1 = _context.sent;
|
|
12516
|
-
_context.next =
|
|
12584
|
+
_context.next = 329;
|
|
12517
12585
|
return call(checkChannelExists, _channel11.id);
|
|
12518
|
-
case
|
|
12586
|
+
case 329:
|
|
12519
12587
|
channelExist = _context.sent;
|
|
12520
12588
|
if (!(_channel11.id === _activeChannelId1)) {
|
|
12521
|
-
_context.next =
|
|
12589
|
+
_context.next = 334;
|
|
12522
12590
|
break;
|
|
12523
12591
|
}
|
|
12524
|
-
_context.next =
|
|
12592
|
+
_context.next = 333;
|
|
12525
12593
|
return put(clearMessagesAC());
|
|
12526
|
-
case
|
|
12594
|
+
case 333:
|
|
12527
12595
|
removeAllMessages();
|
|
12528
|
-
case
|
|
12596
|
+
case 334:
|
|
12529
12597
|
removeMessagesFromMap(_channel11.id);
|
|
12530
12598
|
if (!channelExist) {
|
|
12531
|
-
_context.next =
|
|
12599
|
+
_context.next = 338;
|
|
12532
12600
|
break;
|
|
12533
12601
|
}
|
|
12534
|
-
_context.next =
|
|
12602
|
+
_context.next = 338;
|
|
12535
12603
|
return put(updateChannelDataAC(_channel11.id, {
|
|
12536
12604
|
lastMessage: null,
|
|
12537
12605
|
newMessageCount: 0,
|
|
@@ -12539,7 +12607,7 @@ function watchForEvents() {
|
|
|
12539
12607
|
muted: _channel11.muted,
|
|
12540
12608
|
mutedTill: _channel11.mutedTill
|
|
12541
12609
|
}));
|
|
12542
|
-
case
|
|
12610
|
+
case 338:
|
|
12543
12611
|
updateChannelOnAllChannels(_channel11.id, {
|
|
12544
12612
|
lastMessage: null,
|
|
12545
12613
|
newMessageCount: 0,
|
|
@@ -12547,173 +12615,173 @@ function watchForEvents() {
|
|
|
12547
12615
|
muted: _channel11.muted,
|
|
12548
12616
|
mutedTill: _channel11.mutedTill
|
|
12549
12617
|
});
|
|
12550
|
-
return _context.abrupt("break",
|
|
12551
|
-
case
|
|
12618
|
+
return _context.abrupt("break", 455);
|
|
12619
|
+
case 340:
|
|
12552
12620
|
_channel12 = args.channel;
|
|
12553
12621
|
log.info('channel MUTE ... ');
|
|
12554
|
-
_context.next =
|
|
12622
|
+
_context.next = 344;
|
|
12555
12623
|
return put(updateChannelDataAC(_channel12.id, {
|
|
12556
12624
|
muted: _channel12.muted,
|
|
12557
12625
|
mutedTill: _channel12.mutedTill
|
|
12558
12626
|
}));
|
|
12559
|
-
case
|
|
12627
|
+
case 344:
|
|
12560
12628
|
updateChannelOnAllChannels(_channel12.id, {
|
|
12561
12629
|
muted: _channel12.muted,
|
|
12562
12630
|
mutedTill: _channel12.mutedTill
|
|
12563
12631
|
});
|
|
12564
|
-
return _context.abrupt("break",
|
|
12565
|
-
case
|
|
12632
|
+
return _context.abrupt("break", 455);
|
|
12633
|
+
case 346:
|
|
12566
12634
|
_channel13 = args.channel;
|
|
12567
12635
|
log.info('channel UNMUTE ... ');
|
|
12568
|
-
_context.next =
|
|
12636
|
+
_context.next = 350;
|
|
12569
12637
|
return put(updateChannelDataAC(_channel13.id, {
|
|
12570
12638
|
muted: _channel13.muted,
|
|
12571
12639
|
mutedTill: _channel13.mutedTill
|
|
12572
12640
|
}));
|
|
12573
|
-
case
|
|
12641
|
+
case 350:
|
|
12574
12642
|
updateChannelOnAllChannels(_channel13.id, {
|
|
12575
12643
|
muted: _channel13.muted,
|
|
12576
12644
|
mutedTill: _channel13.mutedTill
|
|
12577
12645
|
});
|
|
12578
|
-
return _context.abrupt("break",
|
|
12579
|
-
case
|
|
12646
|
+
return _context.abrupt("break", 455);
|
|
12647
|
+
case 352:
|
|
12580
12648
|
_channel14 = args.channel;
|
|
12581
12649
|
log.info('channel PINED ... ');
|
|
12582
|
-
_context.next =
|
|
12650
|
+
_context.next = 356;
|
|
12583
12651
|
return put(updateChannelDataAC(_channel14.id, {
|
|
12584
12652
|
pinnedAt: _channel14.pinnedAt
|
|
12585
12653
|
}, true));
|
|
12586
|
-
case
|
|
12654
|
+
case 356:
|
|
12587
12655
|
updateChannelOnAllChannels(_channel14.id, {
|
|
12588
12656
|
pinnedAt: _channel14.pinnedAt
|
|
12589
12657
|
});
|
|
12590
|
-
return _context.abrupt("break",
|
|
12591
|
-
case
|
|
12658
|
+
return _context.abrupt("break", 455);
|
|
12659
|
+
case 358:
|
|
12592
12660
|
_channel15 = args.channel;
|
|
12593
12661
|
log.info('channel UNPINED ... ');
|
|
12594
|
-
_context.next =
|
|
12662
|
+
_context.next = 362;
|
|
12595
12663
|
return put(updateChannelDataAC(_channel15.id, {
|
|
12596
12664
|
pinnedAt: _channel15.pinnedAt
|
|
12597
12665
|
}, false, true));
|
|
12598
|
-
case
|
|
12666
|
+
case 362:
|
|
12599
12667
|
updateChannelOnAllChannels(_channel15.id, {
|
|
12600
12668
|
pinnedAt: _channel15.pinnedAt
|
|
12601
12669
|
});
|
|
12602
|
-
return _context.abrupt("break",
|
|
12603
|
-
case
|
|
12670
|
+
return _context.abrupt("break", 455);
|
|
12671
|
+
case 364:
|
|
12604
12672
|
_channel16 = args.channel;
|
|
12605
12673
|
log.info('channel HIDE ... ');
|
|
12606
|
-
_context.next =
|
|
12674
|
+
_context.next = 368;
|
|
12607
12675
|
return put(setChannelToHideAC(_channel16));
|
|
12608
|
-
case
|
|
12609
|
-
return _context.abrupt("break",
|
|
12610
|
-
case
|
|
12676
|
+
case 368:
|
|
12677
|
+
return _context.abrupt("break", 455);
|
|
12678
|
+
case 369:
|
|
12611
12679
|
_channel17 = args.channel;
|
|
12612
12680
|
log.info('channel UNHIDE ... ');
|
|
12613
|
-
_context.next =
|
|
12681
|
+
_context.next = 373;
|
|
12614
12682
|
return put(setChannelToUnHideAC(_channel17));
|
|
12615
|
-
case
|
|
12616
|
-
return _context.abrupt("break",
|
|
12617
|
-
case
|
|
12683
|
+
case 373:
|
|
12684
|
+
return _context.abrupt("break", 455);
|
|
12685
|
+
case 374:
|
|
12618
12686
|
_channel18 = args.channel;
|
|
12619
|
-
_context.next =
|
|
12687
|
+
_context.next = 377;
|
|
12620
12688
|
return put(updateChannelDataAC(_channel18.id, {
|
|
12621
12689
|
unread: _channel18.unread,
|
|
12622
12690
|
muted: _channel18.muted,
|
|
12623
12691
|
mutedTill: _channel18.mutedTill
|
|
12624
12692
|
}));
|
|
12625
|
-
case
|
|
12693
|
+
case 377:
|
|
12626
12694
|
_groupName5 = getChannelGroupName(_channel18);
|
|
12627
|
-
_context.next =
|
|
12695
|
+
_context.next = 380;
|
|
12628
12696
|
return put(updateSearchedChannelDataAC(_channel18.id, {
|
|
12629
12697
|
unread: _channel18.unread
|
|
12630
12698
|
}, _groupName5));
|
|
12631
|
-
case
|
|
12699
|
+
case 380:
|
|
12632
12700
|
updateChannelOnAllChannels(_channel18.id, {
|
|
12633
12701
|
unread: _channel18.unread
|
|
12634
12702
|
});
|
|
12635
|
-
return _context.abrupt("break",
|
|
12636
|
-
case
|
|
12703
|
+
return _context.abrupt("break", 455);
|
|
12704
|
+
case 382:
|
|
12637
12705
|
_channel19 = args.channel;
|
|
12638
|
-
_context.next =
|
|
12706
|
+
_context.next = 385;
|
|
12639
12707
|
return put(updateChannelDataAC(_channel19.id, {
|
|
12640
12708
|
unread: _channel19.unread,
|
|
12641
12709
|
muted: _channel19.muted,
|
|
12642
12710
|
mutedTill: _channel19.mutedTill
|
|
12643
12711
|
}));
|
|
12644
|
-
case
|
|
12712
|
+
case 385:
|
|
12645
12713
|
_groupName6 = getChannelGroupName(_channel19);
|
|
12646
|
-
_context.next =
|
|
12714
|
+
_context.next = 388;
|
|
12647
12715
|
return put(updateSearchedChannelDataAC(_channel19.id, {
|
|
12648
12716
|
unread: _channel19.unread
|
|
12649
12717
|
}, _groupName6));
|
|
12650
|
-
case
|
|
12718
|
+
case 388:
|
|
12651
12719
|
updateChannelOnAllChannels(_channel19.id, {
|
|
12652
12720
|
unread: _channel19.unread
|
|
12653
12721
|
});
|
|
12654
|
-
return _context.abrupt("break",
|
|
12655
|
-
case
|
|
12722
|
+
return _context.abrupt("break", 455);
|
|
12723
|
+
case 390:
|
|
12656
12724
|
_channel20 = args.channel, members = args.members;
|
|
12657
12725
|
log.info('channel CHANGE_ROLE channel ... ', _channel20);
|
|
12658
12726
|
log.info('channel CHANGE_ROLE member ... ', members);
|
|
12659
|
-
_context.next =
|
|
12727
|
+
_context.next = 395;
|
|
12660
12728
|
return call(getActiveChannelId);
|
|
12661
|
-
case
|
|
12729
|
+
case 395:
|
|
12662
12730
|
_activeChannelId10 = _context.sent;
|
|
12663
12731
|
if (!(_channel20.id === _activeChannelId10)) {
|
|
12664
|
-
_context.next =
|
|
12732
|
+
_context.next = 399;
|
|
12665
12733
|
break;
|
|
12666
12734
|
}
|
|
12667
|
-
_context.next =
|
|
12735
|
+
_context.next = 399;
|
|
12668
12736
|
return put(updateMembersAC(members));
|
|
12669
|
-
case
|
|
12737
|
+
case 399:
|
|
12670
12738
|
i = 0;
|
|
12671
|
-
case
|
|
12739
|
+
case 400:
|
|
12672
12740
|
if (!(i < members.length)) {
|
|
12673
|
-
_context.next =
|
|
12741
|
+
_context.next = 408;
|
|
12674
12742
|
break;
|
|
12675
12743
|
}
|
|
12676
12744
|
if (!(members[i].id === SceytChatClient.user.id)) {
|
|
12677
|
-
_context.next =
|
|
12745
|
+
_context.next = 405;
|
|
12678
12746
|
break;
|
|
12679
12747
|
}
|
|
12680
|
-
_context.next =
|
|
12748
|
+
_context.next = 404;
|
|
12681
12749
|
return put(updateChannelDataAC(_channel20.id, {
|
|
12682
12750
|
userRole: members[i].role,
|
|
12683
12751
|
muted: _channel20.muted,
|
|
12684
12752
|
mutedTill: _channel20.mutedTill
|
|
12685
12753
|
}));
|
|
12686
|
-
case
|
|
12754
|
+
case 404:
|
|
12687
12755
|
updateChannelOnAllChannels(_channel20.id, {
|
|
12688
12756
|
userRole: members[i].role,
|
|
12689
12757
|
muted: _channel20.muted,
|
|
12690
12758
|
mutedTill: _channel20.mutedTill
|
|
12691
12759
|
});
|
|
12692
|
-
case
|
|
12760
|
+
case 405:
|
|
12693
12761
|
i++;
|
|
12694
|
-
_context.next =
|
|
12762
|
+
_context.next = 400;
|
|
12695
12763
|
break;
|
|
12696
|
-
case
|
|
12697
|
-
return _context.abrupt("break",
|
|
12698
|
-
case
|
|
12764
|
+
case 408:
|
|
12765
|
+
return _context.abrupt("break", 455);
|
|
12766
|
+
case 409:
|
|
12699
12767
|
_channel21 = args.channel;
|
|
12700
12768
|
log.info('channel frozen channel ... ', _channel21);
|
|
12701
|
-
return _context.abrupt("break",
|
|
12702
|
-
case
|
|
12769
|
+
return _context.abrupt("break", 455);
|
|
12770
|
+
case 412:
|
|
12703
12771
|
_channel22 = args.channel;
|
|
12704
12772
|
log.info('channel unfrozen channel ... ', _channel22);
|
|
12705
|
-
return _context.abrupt("break",
|
|
12706
|
-
case
|
|
12773
|
+
return _context.abrupt("break", 455);
|
|
12774
|
+
case 415:
|
|
12707
12775
|
_channelId2 = args.channelId, from = args.from, name = args.name;
|
|
12708
12776
|
log.info('channel event received >>>... . . . . . ', args);
|
|
12709
12777
|
if (!(from.id === SceytChatClient.user.id)) {
|
|
12710
|
-
_context.next =
|
|
12778
|
+
_context.next = 419;
|
|
12711
12779
|
break;
|
|
12712
12780
|
}
|
|
12713
|
-
return _context.abrupt("break",
|
|
12714
|
-
case
|
|
12781
|
+
return _context.abrupt("break", 455);
|
|
12782
|
+
case 419:
|
|
12715
12783
|
if (!(name === 'start_typing')) {
|
|
12716
|
-
_context.next =
|
|
12784
|
+
_context.next = 427;
|
|
12717
12785
|
break;
|
|
12718
12786
|
}
|
|
12719
12787
|
if (!usersTimeout[_channelId2]) {
|
|
@@ -12725,27 +12793,27 @@ function watchForEvents() {
|
|
|
12725
12793
|
usersTimeout[_channelId2][from.id] = setTimeout(function () {
|
|
12726
12794
|
channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_typing');
|
|
12727
12795
|
}, 5000);
|
|
12728
|
-
_context.next =
|
|
12796
|
+
_context.next = 425;
|
|
12729
12797
|
return put(switchTypingIndicatorAC(true, _channelId2, from));
|
|
12730
|
-
case
|
|
12731
|
-
_context.next =
|
|
12798
|
+
case 425:
|
|
12799
|
+
_context.next = 445;
|
|
12732
12800
|
break;
|
|
12733
|
-
case
|
|
12801
|
+
case 427:
|
|
12734
12802
|
if (!(name === 'stop_typing')) {
|
|
12735
|
-
_context.next =
|
|
12803
|
+
_context.next = 433;
|
|
12736
12804
|
break;
|
|
12737
12805
|
}
|
|
12738
12806
|
if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
|
|
12739
12807
|
clearTimeout(usersTimeout[_channelId2][from.id]);
|
|
12740
12808
|
}
|
|
12741
|
-
_context.next =
|
|
12809
|
+
_context.next = 431;
|
|
12742
12810
|
return put(switchTypingIndicatorAC(false, _channelId2, from));
|
|
12743
|
-
case
|
|
12744
|
-
_context.next =
|
|
12811
|
+
case 431:
|
|
12812
|
+
_context.next = 445;
|
|
12745
12813
|
break;
|
|
12746
|
-
case
|
|
12814
|
+
case 433:
|
|
12747
12815
|
if (!(name === 'start_recording')) {
|
|
12748
|
-
_context.next =
|
|
12816
|
+
_context.next = 441;
|
|
12749
12817
|
break;
|
|
12750
12818
|
}
|
|
12751
12819
|
if (!usersTimeout[_channelId2]) {
|
|
@@ -12757,40 +12825,40 @@ function watchForEvents() {
|
|
|
12757
12825
|
usersTimeout[_channelId2][from.id] = setTimeout(function () {
|
|
12758
12826
|
channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_recording');
|
|
12759
12827
|
}, 5000);
|
|
12760
|
-
_context.next = 433;
|
|
12761
|
-
return put(switchRecordingIndicatorAC(true, _channelId2, from));
|
|
12762
|
-
case 433:
|
|
12763
12828
|
_context.next = 439;
|
|
12829
|
+
return put(switchRecordingIndicatorAC(true, _channelId2, from));
|
|
12830
|
+
case 439:
|
|
12831
|
+
_context.next = 445;
|
|
12764
12832
|
break;
|
|
12765
|
-
case
|
|
12833
|
+
case 441:
|
|
12766
12834
|
if (!(name === 'stop_recording')) {
|
|
12767
|
-
_context.next =
|
|
12835
|
+
_context.next = 445;
|
|
12768
12836
|
break;
|
|
12769
12837
|
}
|
|
12770
12838
|
if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
|
|
12771
12839
|
clearTimeout(usersTimeout[_channelId2][from.id]);
|
|
12772
12840
|
}
|
|
12773
|
-
_context.next =
|
|
12841
|
+
_context.next = 445;
|
|
12774
12842
|
return put(switchRecordingIndicatorAC(false, _channelId2, from));
|
|
12775
|
-
case
|
|
12776
|
-
return _context.abrupt("break",
|
|
12777
|
-
case
|
|
12843
|
+
case 445:
|
|
12844
|
+
return _context.abrupt("break", 455);
|
|
12845
|
+
case 446:
|
|
12778
12846
|
status = args.status;
|
|
12779
12847
|
log.info('connection status changed . . . . . ', status);
|
|
12780
|
-
_context.next =
|
|
12848
|
+
_context.next = 450;
|
|
12781
12849
|
return put(setConnectionStatusAC(status));
|
|
12782
|
-
case
|
|
12850
|
+
case 450:
|
|
12783
12851
|
if (!(status === CONNECTION_STATUS.CONNECTED)) {
|
|
12784
|
-
_context.next =
|
|
12852
|
+
_context.next = 453;
|
|
12785
12853
|
break;
|
|
12786
12854
|
}
|
|
12787
|
-
_context.next =
|
|
12855
|
+
_context.next = 453;
|
|
12788
12856
|
return put(getRolesAC());
|
|
12789
|
-
case
|
|
12790
|
-
return _context.abrupt("break",
|
|
12791
|
-
case
|
|
12857
|
+
case 453:
|
|
12858
|
+
return _context.abrupt("break", 455);
|
|
12859
|
+
case 454:
|
|
12792
12860
|
log.warn('UNHANDLED EVENT FROM REDUX-SAGA EVENT-CHANNEL');
|
|
12793
|
-
case
|
|
12861
|
+
case 455:
|
|
12794
12862
|
case "end":
|
|
12795
12863
|
return _context.stop();
|
|
12796
12864
|
}
|
|
@@ -12805,7 +12873,7 @@ function watchForEvents() {
|
|
|
12805
12873
|
case "end":
|
|
12806
12874
|
return _context2.stop();
|
|
12807
12875
|
}
|
|
12808
|
-
}, _marked);
|
|
12876
|
+
}, _marked$1);
|
|
12809
12877
|
}
|
|
12810
12878
|
|
|
12811
12879
|
var channelsSelector = function channelsSelector(store) {
|
|
@@ -12883,8 +12951,8 @@ var channelMessageDraftIsRemovedSelector = function channelMessageDraftIsRemoved
|
|
|
12883
12951
|
return store.ChannelReducer.draftIsRemoved;
|
|
12884
12952
|
};
|
|
12885
12953
|
|
|
12886
|
-
var _marked$
|
|
12887
|
-
_marked2 = /*#__PURE__*/_regeneratorRuntime().mark(getChannels),
|
|
12954
|
+
var _marked$2 = /*#__PURE__*/_regeneratorRuntime().mark(createChannel),
|
|
12955
|
+
_marked2$1 = /*#__PURE__*/_regeneratorRuntime().mark(getChannels),
|
|
12888
12956
|
_marked3 = /*#__PURE__*/_regeneratorRuntime().mark(searchChannels),
|
|
12889
12957
|
_marked4 = /*#__PURE__*/_regeneratorRuntime().mark(getChannelsForForward),
|
|
12890
12958
|
_marked5 = /*#__PURE__*/_regeneratorRuntime().mark(searchChannelsForForward),
|
|
@@ -13089,7 +13157,7 @@ function createChannel(action) {
|
|
|
13089
13157
|
case "end":
|
|
13090
13158
|
return _context.stop();
|
|
13091
13159
|
}
|
|
13092
|
-
}, _marked$
|
|
13160
|
+
}, _marked$2, null, [[0, 53]]);
|
|
13093
13161
|
}
|
|
13094
13162
|
function getChannels(action) {
|
|
13095
13163
|
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;
|
|
@@ -13272,7 +13340,7 @@ function getChannels(action) {
|
|
|
13272
13340
|
case "end":
|
|
13273
13341
|
return _context2.stop();
|
|
13274
13342
|
}
|
|
13275
|
-
}, _marked2, null, [[0, 89], [72, 81]]);
|
|
13343
|
+
}, _marked2$1, null, [[0, 89], [72, 81]]);
|
|
13276
13344
|
}
|
|
13277
13345
|
function searchChannels(action) {
|
|
13278
13346
|
var payload, params, contactsMap, SceytChatClient, getFromContacts, searchBy, _params$filter2, _types2, channelQueryBuilder, channelTypesFilter, types, allChannels, publicChannels, chatsGroups, contactsList, contactsWithChannelsMap, lowerCaseSearchBy, channelQuery, channelsData, channelsToAdd;
|
|
@@ -14389,7 +14457,8 @@ function checkUsersStatus() {
|
|
|
14389
14457
|
usersToUpdateMap = {};
|
|
14390
14458
|
update = false;
|
|
14391
14459
|
updatedUsers.forEach(function (updatedUser) {
|
|
14392
|
-
|
|
14460
|
+
var _usersMap$updatedUser, _usersMap$updatedUser2, _usersMap$updatedUser3, _usersMap$updatedUser4, _usersMap$updatedUser5, _usersMap$updatedUser6, _usersMap$updatedUser7, _usersMap$updatedUser8, _usersMap$updatedUser9;
|
|
14461
|
+
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))) {
|
|
14393
14462
|
updateUserOnMap(updatedUser);
|
|
14394
14463
|
usersToUpdateMap[updatedUser.id] = updatedUser;
|
|
14395
14464
|
update = true;
|
|
@@ -15332,8 +15401,8 @@ var getFrame = function getFrame(videoSrc, time) {
|
|
|
15332
15401
|
}
|
|
15333
15402
|
};
|
|
15334
15403
|
|
|
15335
|
-
var _marked$
|
|
15336
|
-
_marked2$
|
|
15404
|
+
var _marked$3 = /*#__PURE__*/_regeneratorRuntime().mark(sendMessage),
|
|
15405
|
+
_marked2$2 = /*#__PURE__*/_regeneratorRuntime().mark(sendTextMessage),
|
|
15337
15406
|
_marked3$1 = /*#__PURE__*/_regeneratorRuntime().mark(forwardMessage),
|
|
15338
15407
|
_marked4$1 = /*#__PURE__*/_regeneratorRuntime().mark(resendMessage),
|
|
15339
15408
|
_marked5$1 = /*#__PURE__*/_regeneratorRuntime().mark(deleteMessage),
|
|
@@ -15931,7 +16000,7 @@ function sendMessage(action) {
|
|
|
15931
16000
|
case "end":
|
|
15932
16001
|
return _context3.stop();
|
|
15933
16002
|
}
|
|
15934
|
-
}, _marked$
|
|
16003
|
+
}, _marked$3, null, [[2, 80]]);
|
|
15935
16004
|
}
|
|
15936
16005
|
function sendTextMessage(action) {
|
|
15937
16006
|
var payload, message, connectionState, channelId, channel, sendMessageTid, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, hasNextMessages, messagesToAdd, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam;
|
|
@@ -16129,7 +16198,7 @@ function sendTextMessage(action) {
|
|
|
16129
16198
|
case "end":
|
|
16130
16199
|
return _context4.stop();
|
|
16131
16200
|
}
|
|
16132
|
-
}, _marked2$
|
|
16201
|
+
}, _marked2$2, null, [[8, 82]]);
|
|
16133
16202
|
}
|
|
16134
16203
|
function forwardMessage(action) {
|
|
16135
16204
|
var payload, message, channelId, connectionState, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam;
|
|
@@ -17659,8 +17728,8 @@ function MessageSaga() {
|
|
|
17659
17728
|
}, _marked15$1);
|
|
17660
17729
|
}
|
|
17661
17730
|
|
|
17662
|
-
var _marked$
|
|
17663
|
-
_marked2$
|
|
17731
|
+
var _marked$4 = /*#__PURE__*/_regeneratorRuntime().mark(getMembers),
|
|
17732
|
+
_marked2$3 = /*#__PURE__*/_regeneratorRuntime().mark(loadMoreMembers),
|
|
17664
17733
|
_marked3$2 = /*#__PURE__*/_regeneratorRuntime().mark(addMembers),
|
|
17665
17734
|
_marked4$2 = /*#__PURE__*/_regeneratorRuntime().mark(kickMemberFromChannel),
|
|
17666
17735
|
_marked5$2 = /*#__PURE__*/_regeneratorRuntime().mark(blockMember),
|
|
@@ -17708,7 +17777,7 @@ function getMembers(action) {
|
|
|
17708
17777
|
case "end":
|
|
17709
17778
|
return _context.stop();
|
|
17710
17779
|
}
|
|
17711
|
-
}, _marked$
|
|
17780
|
+
}, _marked$4, null, [[0, 22]]);
|
|
17712
17781
|
}
|
|
17713
17782
|
function loadMoreMembers(action) {
|
|
17714
17783
|
var payload, limit, membersQuery, _yield$call2, members;
|
|
@@ -17736,16 +17805,19 @@ function loadMoreMembers(action) {
|
|
|
17736
17805
|
_context2.next = 15;
|
|
17737
17806
|
return put(setMembersLoadingStateAC(LOADING_STATE.LOADED));
|
|
17738
17807
|
case 15:
|
|
17739
|
-
_context2.next =
|
|
17740
|
-
|
|
17808
|
+
_context2.next = 17;
|
|
17809
|
+
return updateActiveChannelMembersAdd(members);
|
|
17741
17810
|
case 17:
|
|
17742
|
-
_context2.
|
|
17811
|
+
_context2.next = 22;
|
|
17812
|
+
break;
|
|
17813
|
+
case 19:
|
|
17814
|
+
_context2.prev = 19;
|
|
17743
17815
|
_context2.t0 = _context2["catch"](0);
|
|
17744
|
-
case
|
|
17816
|
+
case 22:
|
|
17745
17817
|
case "end":
|
|
17746
17818
|
return _context2.stop();
|
|
17747
17819
|
}
|
|
17748
|
-
}, _marked2$
|
|
17820
|
+
}, _marked2$3, null, [[0, 19]]);
|
|
17749
17821
|
}
|
|
17750
17822
|
function addMembers(action) {
|
|
17751
17823
|
var payload, members, channelId, channel, membersToAdd, addedMembers, membersIds, messageToSend;
|
|
@@ -17760,7 +17832,7 @@ function addMembers(action) {
|
|
|
17760
17832
|
case 5:
|
|
17761
17833
|
channel = _context3.sent;
|
|
17762
17834
|
if (!channel) {
|
|
17763
|
-
_context3.next =
|
|
17835
|
+
_context3.next = 24;
|
|
17764
17836
|
break;
|
|
17765
17837
|
}
|
|
17766
17838
|
membersToAdd = members.map(function (mem) {
|
|
@@ -17802,17 +17874,20 @@ function addMembers(action) {
|
|
|
17802
17874
|
memberCount: channel.memberCount + addedMembers.length
|
|
17803
17875
|
}));
|
|
17804
17876
|
case 22:
|
|
17805
|
-
_context3.next =
|
|
17806
|
-
|
|
17877
|
+
_context3.next = 24;
|
|
17878
|
+
return updateActiveChannelMembersAdd(addedMembers);
|
|
17807
17879
|
case 24:
|
|
17808
|
-
_context3.
|
|
17880
|
+
_context3.next = 29;
|
|
17881
|
+
break;
|
|
17882
|
+
case 26:
|
|
17883
|
+
_context3.prev = 26;
|
|
17809
17884
|
_context3.t0 = _context3["catch"](0);
|
|
17810
17885
|
log.error('error on add members... ', _context3.t0);
|
|
17811
|
-
case
|
|
17886
|
+
case 29:
|
|
17812
17887
|
case "end":
|
|
17813
17888
|
return _context3.stop();
|
|
17814
17889
|
}
|
|
17815
|
-
}, _marked3$2, null, [[0,
|
|
17890
|
+
}, _marked3$2, null, [[0, 26]]);
|
|
17816
17891
|
}
|
|
17817
17892
|
function kickMemberFromChannel(action) {
|
|
17818
17893
|
var payload, memberId, channelId, channel, removedMembers, membersIds, messageToSend;
|
|
@@ -17861,16 +17936,19 @@ function kickMemberFromChannel(action) {
|
|
|
17861
17936
|
memberCount: channel.memberCount - removedMembers.length
|
|
17862
17937
|
}));
|
|
17863
17938
|
case 20:
|
|
17864
|
-
_context4.next =
|
|
17865
|
-
|
|
17939
|
+
_context4.next = 22;
|
|
17940
|
+
return updateActiveChannelMembersRemove(removedMembers);
|
|
17866
17941
|
case 22:
|
|
17867
|
-
_context4.
|
|
17868
|
-
|
|
17942
|
+
_context4.next = 26;
|
|
17943
|
+
break;
|
|
17869
17944
|
case 24:
|
|
17945
|
+
_context4.prev = 24;
|
|
17946
|
+
_context4.t0 = _context4["catch"](0);
|
|
17947
|
+
case 26:
|
|
17870
17948
|
case "end":
|
|
17871
17949
|
return _context4.stop();
|
|
17872
17950
|
}
|
|
17873
|
-
}, _marked4$2, null, [[0,
|
|
17951
|
+
}, _marked4$2, null, [[0, 24]]);
|
|
17874
17952
|
}
|
|
17875
17953
|
function blockMember(action) {
|
|
17876
17954
|
var payload, memberId, channelId, channel, removedMembers;
|
|
@@ -17899,16 +17977,19 @@ function blockMember(action) {
|
|
|
17899
17977
|
memberCount: channel.memberCount - removedMembers.length
|
|
17900
17978
|
}));
|
|
17901
17979
|
case 14:
|
|
17902
|
-
_context5.next =
|
|
17903
|
-
|
|
17980
|
+
_context5.next = 16;
|
|
17981
|
+
return updateActiveChannelMembersRemove(removedMembers);
|
|
17904
17982
|
case 16:
|
|
17905
|
-
_context5.
|
|
17906
|
-
|
|
17983
|
+
_context5.next = 20;
|
|
17984
|
+
break;
|
|
17907
17985
|
case 18:
|
|
17986
|
+
_context5.prev = 18;
|
|
17987
|
+
_context5.t0 = _context5["catch"](0);
|
|
17988
|
+
case 20:
|
|
17908
17989
|
case "end":
|
|
17909
17990
|
return _context5.stop();
|
|
17910
17991
|
}
|
|
17911
|
-
}, _marked5$2, null, [[0,
|
|
17992
|
+
}, _marked5$2, null, [[0, 18]]);
|
|
17912
17993
|
}
|
|
17913
17994
|
function changeMemberRole(action) {
|
|
17914
17995
|
var payload, channelId, members, channel, updatedMembers;
|
|
@@ -18030,8 +18111,8 @@ function MembersSaga() {
|
|
|
18030
18111
|
}, _marked9$2);
|
|
18031
18112
|
}
|
|
18032
18113
|
|
|
18033
|
-
var _marked$
|
|
18034
|
-
_marked2$
|
|
18114
|
+
var _marked$5 = /*#__PURE__*/_regeneratorRuntime().mark(getContacts),
|
|
18115
|
+
_marked2$4 = /*#__PURE__*/_regeneratorRuntime().mark(blockUser),
|
|
18035
18116
|
_marked3$3 = /*#__PURE__*/_regeneratorRuntime().mark(unblockUser),
|
|
18036
18117
|
_marked4$3 = /*#__PURE__*/_regeneratorRuntime().mark(updateProfile),
|
|
18037
18118
|
_marked5$3 = /*#__PURE__*/_regeneratorRuntime().mark(getUsers),
|
|
@@ -18064,7 +18145,7 @@ function getContacts() {
|
|
|
18064
18145
|
case "end":
|
|
18065
18146
|
return _context.stop();
|
|
18066
18147
|
}
|
|
18067
|
-
}, _marked$
|
|
18148
|
+
}, _marked$5, null, [[0, 11]]);
|
|
18068
18149
|
}
|
|
18069
18150
|
function blockUser(action) {
|
|
18070
18151
|
var SceytChatClient, payload, userIds, blockedUsers, activeChannelId, activeChannel, isDirectChannel, directChannelUser;
|
|
@@ -18126,7 +18207,7 @@ function blockUser(action) {
|
|
|
18126
18207
|
case "end":
|
|
18127
18208
|
return _context2.stop();
|
|
18128
18209
|
}
|
|
18129
|
-
}, _marked2$
|
|
18210
|
+
}, _marked2$4, null, [[0, 21]]);
|
|
18130
18211
|
}
|
|
18131
18212
|
function unblockUser(action) {
|
|
18132
18213
|
var SceytChatClient, payload, userIds, unblockedUsers, activeChannelId, activeChannel, isDirectChannel, directChannelUser;
|
|
@@ -18384,7 +18465,7 @@ function MembersSaga$1() {
|
|
|
18384
18465
|
}, _marked7$3);
|
|
18385
18466
|
}
|
|
18386
18467
|
|
|
18387
|
-
var _marked$
|
|
18468
|
+
var _marked$6 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga);
|
|
18388
18469
|
function rootSaga() {
|
|
18389
18470
|
return _regeneratorRuntime().wrap(function rootSaga$(_context) {
|
|
18390
18471
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -18395,7 +18476,7 @@ function rootSaga() {
|
|
|
18395
18476
|
case "end":
|
|
18396
18477
|
return _context.stop();
|
|
18397
18478
|
}
|
|
18398
|
-
}, _marked$
|
|
18479
|
+
}, _marked$6);
|
|
18399
18480
|
}
|
|
18400
18481
|
|
|
18401
18482
|
var sagaMiddleware = createSagaMiddleware();
|
|
@@ -18870,9 +18951,10 @@ function useUpdatePresence(channel, isVisible) {
|
|
|
18870
18951
|
}
|
|
18871
18952
|
useEffect(function () {
|
|
18872
18953
|
if (userId && isVisible && directChannelUser) {
|
|
18954
|
+
var _usersMap$userId, _usersMap$userId$pres;
|
|
18873
18955
|
if (!usersMap[userId]) {
|
|
18874
18956
|
setUserToMap(directChannelUser);
|
|
18875
|
-
} else if (usersMap[userId].presence.state !== directChannelUser.presence.state) {
|
|
18957
|
+
} 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) {
|
|
18876
18958
|
var _updateUserStatusOnCh;
|
|
18877
18959
|
updateUserOnMap(directChannelUser);
|
|
18878
18960
|
dispatch(updateUserStatusOnChannelAC((_updateUserStatusOnCh = {}, _updateUserStatusOnCh[directChannelUser.id] = directChannelUser, _updateUserStatusOnCh)));
|
|
@@ -18888,7 +18970,8 @@ function useUpdatePresence(channel, isVisible) {
|
|
|
18888
18970
|
}
|
|
18889
18971
|
}, [connectionStatus]);
|
|
18890
18972
|
useEffect(function () {
|
|
18891
|
-
|
|
18973
|
+
var _usersMap$directChann, _usersMap$directChann2;
|
|
18974
|
+
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())) {
|
|
18892
18975
|
var _updateUserStatusOnCh2;
|
|
18893
18976
|
dispatch(updateUserStatusOnChannelAC((_updateUserStatusOnCh2 = {}, _updateUserStatusOnCh2[directChannelUser.id] = directChannelUser, _updateUserStatusOnCh2)));
|
|
18894
18977
|
updateUserOnMap(directChannelUser);
|
|
@@ -21648,7 +21731,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
21648
21731
|
if (getSelectedChannel) {
|
|
21649
21732
|
getSelectedChannel(activeChannel);
|
|
21650
21733
|
}
|
|
21651
|
-
}, [activeChannel]);
|
|
21734
|
+
}, [activeChannel && activeChannel.members && activeChannel.members.length]);
|
|
21652
21735
|
useDidUpdate(function () {
|
|
21653
21736
|
if (closeSearchChannels) {
|
|
21654
21737
|
getMyChannels();
|