podchat-browser 12.9.16 → 12.9.17-snapshot.1
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/dist/node/buildConfig.json +1 -1
- package/dist/node/call.module.js +62 -15
- package/dist/node/chat.js +15 -5
- package/dist/node/lib/chat/call/adminMethods.js +223 -0
- package/dist/node/lib/chat/threadHistoryMethods.js +30 -2
- package/dist/node/lib/constants.js +12 -2
- package/dist/node/lib/store/history/historyItem.js +33 -0
- package/dist/podchat-browser-bundle.js +411 -68
- package/examples/index.html +15 -3
- package/package.json +1 -1
- package/src/buildConfig.json +1 -1
- package/src/call.module.js +53 -8
- package/src/chat.js +18 -4
- package/src/lib/chat/call/adminMethods.js +216 -0
- package/src/lib/chat/threadHistoryMethods.js +33 -11
- package/src/lib/constants.js +12 -1
- package/src/lib/store/history/historyItem.js +23 -1
- package/src/lib/store/history/index.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"12.9.
|
|
1
|
+
{"version":"12.9.17-snapshot.1","date":"۱۴۰۳/۱۰/۳۰","VersionInfo":"Release: false, Snapshot: true, Is For Test: true"}
|
package/dist/node/call.module.js
CHANGED
|
@@ -35,6 +35,8 @@ var _callServerManager = _interopRequireDefault(require("./lib/call/callServerMa
|
|
|
35
35
|
|
|
36
36
|
var _inquiryCallParticipants = _interopRequireDefault(require("./lib/chat/call/inquiryCallParticipants"));
|
|
37
37
|
|
|
38
|
+
var _adminMethods = _interopRequireDefault(require("./lib/chat/call/adminMethods"));
|
|
39
|
+
|
|
38
40
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
41
|
|
|
40
42
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -51,6 +53,7 @@ function ChatCall(app, params) {
|
|
|
51
53
|
var inquiryCallModule = new _inquiryCallParticipants["default"](app);
|
|
52
54
|
app.call.inquiryCallParticipants = inquiryCallModule;
|
|
53
55
|
app.call.deviceManager = new _deviceManager.DeviceManager(app);
|
|
56
|
+
app.call.adminMethods = new _adminMethods["default"](app);
|
|
54
57
|
var callServerController = new _callServerManager["default"](app);
|
|
55
58
|
var //Utility = params.Utility,
|
|
56
59
|
currentModuleInstance = this,
|
|
@@ -73,15 +76,15 @@ function ChatCall(app, params) {
|
|
|
73
76
|
}
|
|
74
77
|
},
|
|
75
78
|
// generalTypeCode = params.typeCode,
|
|
76
|
-
currentCallParams = {},
|
|
77
|
-
|
|
79
|
+
// currentCallParams = {},
|
|
80
|
+
latestCallRequestId = null,
|
|
78
81
|
screenShareInfo = new screenShareStateManager(app),
|
|
79
82
|
//shouldReconnectCallTimeout = null,
|
|
80
|
-
screenShareState = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
|
|
83
|
+
// screenShareState = {
|
|
84
|
+
// started: false,
|
|
85
|
+
// imOwner: false
|
|
86
|
+
// },
|
|
87
|
+
callUsers = {},
|
|
85
88
|
//callServerManager(),
|
|
86
89
|
//callTopicHealthChecker = new peersHealthChecker(),
|
|
87
90
|
//messageTtl = params.messageTtl || 10000,
|
|
@@ -284,6 +287,7 @@ function ChatCall(app, params) {
|
|
|
284
287
|
* - createTime {int}
|
|
285
288
|
* - sendKey {string}
|
|
286
289
|
* - mute {boolean}
|
|
290
|
+
* - roleType {int}
|
|
287
291
|
*/
|
|
288
292
|
var participant = {
|
|
289
293
|
id: messageContent.id,
|
|
@@ -297,7 +301,10 @@ function ChatCall(app, params) {
|
|
|
297
301
|
callStatus: messageContent.callStatus,
|
|
298
302
|
createTime: messageContent.createTime,
|
|
299
303
|
sendKey: messageContent.sendKey,
|
|
300
|
-
mute: messageContent.mute
|
|
304
|
+
mute: messageContent.mute,
|
|
305
|
+
video: messageContent.video,
|
|
306
|
+
raiseHand: messageContent.raiseHand,
|
|
307
|
+
roleType: messageContent.roleType
|
|
301
308
|
}; // Add Chat Participant if exist
|
|
302
309
|
|
|
303
310
|
if (messageContent.participantVO) {
|
|
@@ -1166,6 +1173,30 @@ function ChatCall(app, params) {
|
|
|
1166
1173
|
uniqueId: uniqueId
|
|
1167
1174
|
});
|
|
1168
1175
|
break;
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* Type 260 Switch call to restricted mode
|
|
1179
|
+
*/
|
|
1180
|
+
|
|
1181
|
+
case _constants.chatMessageVOTypes.BAN_CALL_SESSION:
|
|
1182
|
+
app.call.adminMethods.onRestrictCallSession(uniqueId, messageContent, chatMessage, threadId);
|
|
1183
|
+
break;
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* Type 261 Add permission to call participant
|
|
1187
|
+
*/
|
|
1188
|
+
|
|
1189
|
+
case _constants.chatMessageVOTypes.SET_PERMISSION_TO_CALL_PARTICIPANT:
|
|
1190
|
+
app.call.adminMethods.onAddCallParticipantsPermission(uniqueId, messageContent, chatMessage, threadId);
|
|
1191
|
+
break;
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Type 262 Remove permission from call participant
|
|
1195
|
+
*/
|
|
1196
|
+
|
|
1197
|
+
case _constants.chatMessageVOTypes.REMOVE_PERMISSION_FROM_CALL_PARTICIPANT:
|
|
1198
|
+
app.call.adminMethods.onRemoveCallParticipantsPermission(uniqueId, messageContent, chatMessage, threadId);
|
|
1199
|
+
break;
|
|
1169
1200
|
}
|
|
1170
1201
|
};
|
|
1171
1202
|
|
|
@@ -1443,7 +1474,7 @@ function ChatCall(app, params) {
|
|
|
1443
1474
|
};
|
|
1444
1475
|
|
|
1445
1476
|
if (!params) {
|
|
1446
|
-
_context2.next =
|
|
1477
|
+
_context2.next = 21;
|
|
1447
1478
|
break;
|
|
1448
1479
|
}
|
|
1449
1480
|
|
|
@@ -1498,22 +1529,26 @@ function ChatCall(app, params) {
|
|
|
1498
1529
|
return _context2.abrupt("return");
|
|
1499
1530
|
|
|
1500
1531
|
case 16:
|
|
1532
|
+
if (typeof params.isRestricted === 'boolean') {
|
|
1533
|
+
content.restricted = params.isRestricted;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1501
1536
|
if (params.threadInfo && (params.threadInfo.title || params.threadInfo.description || params.threadInfo.metadata || params.threadInfo.uniqueName)) {
|
|
1502
1537
|
content.createCallThreadRequest = params.threadInfo;
|
|
1503
1538
|
}
|
|
1504
1539
|
|
|
1505
1540
|
startCallData.content = JSON.stringify(content);
|
|
1506
|
-
_context2.next =
|
|
1541
|
+
_context2.next = 23;
|
|
1507
1542
|
break;
|
|
1508
1543
|
|
|
1509
|
-
case
|
|
1544
|
+
case 21:
|
|
1510
1545
|
app.chatEvents.fireEvent('error', {
|
|
1511
1546
|
code: 999,
|
|
1512
1547
|
message: '[SDK] No params have been sent to start call!'
|
|
1513
1548
|
});
|
|
1514
1549
|
return _context2.abrupt("return");
|
|
1515
1550
|
|
|
1516
|
-
case
|
|
1551
|
+
case 23:
|
|
1517
1552
|
app.call.joinCallParams.cameraPaused = typeof params.cameraPaused === 'boolean' ? params.cameraPaused : false;
|
|
1518
1553
|
callRequestController.iRequestedCall = true;
|
|
1519
1554
|
app.call.deviceManager.grantUserMediaDevicesPermissions({
|
|
@@ -1555,7 +1590,7 @@ function ChatCall(app, params) {
|
|
|
1555
1590
|
});
|
|
1556
1591
|
});
|
|
1557
1592
|
|
|
1558
|
-
case
|
|
1593
|
+
case 26:
|
|
1559
1594
|
case "end":
|
|
1560
1595
|
return _context2.stop();
|
|
1561
1596
|
}
|
|
@@ -2719,7 +2754,7 @@ function ChatCall(app, params) {
|
|
|
2719
2754
|
} else {
|
|
2720
2755
|
app.chatEvents.fireEvent('error', {
|
|
2721
2756
|
code: 999,
|
|
2722
|
-
message: '[SDK] No params have been sent to
|
|
2757
|
+
message: '[SDK] No params have been sent to raiseHand'
|
|
2723
2758
|
});
|
|
2724
2759
|
return;
|
|
2725
2760
|
}
|
|
@@ -2756,7 +2791,7 @@ function ChatCall(app, params) {
|
|
|
2756
2791
|
} else {
|
|
2757
2792
|
app.chatEvents.fireEvent('error', {
|
|
2758
2793
|
code: 999,
|
|
2759
|
-
message: '[SDK] No params have been sent to
|
|
2794
|
+
message: '[SDK] No params have been sent to lowerHand'
|
|
2760
2795
|
});
|
|
2761
2796
|
return;
|
|
2762
2797
|
}
|
|
@@ -2908,6 +2943,18 @@ function ChatCall(app, params) {
|
|
|
2908
2943
|
} // currentCall().users().get(callUserId)[mediaType + 'TopicManager']().stopStatusPrint();
|
|
2909
2944
|
|
|
2910
2945
|
};
|
|
2946
|
+
|
|
2947
|
+
this.restrictCallSession = function (params) {
|
|
2948
|
+
app.call.adminMethods.restrictCallSession(params);
|
|
2949
|
+
};
|
|
2950
|
+
|
|
2951
|
+
this.addCallParticipantsPermission = function (params) {
|
|
2952
|
+
app.call.adminMethods.addCallParticipantsPermission(params);
|
|
2953
|
+
};
|
|
2954
|
+
|
|
2955
|
+
this.removeCallParticipantsPermission = function (params) {
|
|
2956
|
+
app.call.adminMethods.removeCallParticipantsPermission(params);
|
|
2957
|
+
};
|
|
2911
2958
|
}
|
|
2912
2959
|
|
|
2913
2960
|
var _default = ChatCall;
|
package/dist/node/chat.js
CHANGED
|
@@ -79,7 +79,7 @@ function Chat(params) {
|
|
|
79
79
|
queueSend = params.queueSend,
|
|
80
80
|
queueConnectionTimeout = params.queueConnectionTimeout,
|
|
81
81
|
config = {
|
|
82
|
-
getHistoryCount:
|
|
82
|
+
getHistoryCount: 25
|
|
83
83
|
},
|
|
84
84
|
getUserInfoRetry = 5,
|
|
85
85
|
getUserInfoRetryCount = 0,
|
|
@@ -2066,6 +2066,9 @@ function Chat(params) {
|
|
|
2066
2066
|
case _constants.chatMessageVOTypes.CALL_RECORDING_FAILED:
|
|
2067
2067
|
case _constants.chatMessageVOTypes.RAISE_HAND:
|
|
2068
2068
|
case _constants.chatMessageVOTypes.LOWER_HAND:
|
|
2069
|
+
case _constants.chatMessageVOTypes.BAN_CALL_SESSION:
|
|
2070
|
+
case _constants.chatMessageVOTypes.SET_PERMISSION_TO_CALL_PARTICIPANT:
|
|
2071
|
+
case _constants.chatMessageVOTypes.REMOVE_PERMISSION_FROM_CALL_PARTICIPANT:
|
|
2069
2072
|
callModule.handleChatMessages(chatMessage, type, messageContent, contentCount, threadId, uniqueId);
|
|
2070
2073
|
break;
|
|
2071
2074
|
|
|
@@ -2995,6 +2998,10 @@ function Chat(params) {
|
|
|
2995
2998
|
content.cellphoneNumber = params.cellphoneNumber;
|
|
2996
2999
|
}
|
|
2997
3000
|
|
|
3001
|
+
if (typeof params.archived === 'boolean') {
|
|
3002
|
+
content.archived = params.archived;
|
|
3003
|
+
}
|
|
3004
|
+
|
|
2998
3005
|
if (Array.isArray(params.threadIds)) {
|
|
2999
3006
|
content.threadIds = params.threadIds;
|
|
3000
3007
|
}
|
|
@@ -9200,8 +9207,7 @@ function Chat(params) {
|
|
|
9200
9207
|
typeCode: params.typeCode,
|
|
9201
9208
|
content: {
|
|
9202
9209
|
offset: +params.offset > 0 ? +params.offset : offset,
|
|
9203
|
-
count: +params.count > 0 ? +params.count : wantedCount
|
|
9204
|
-
|
|
9210
|
+
count: +params.count > 0 ? +params.count : wantedCount
|
|
9205
9211
|
},
|
|
9206
9212
|
subjectId: params.threadId
|
|
9207
9213
|
};
|
|
@@ -9392,6 +9398,10 @@ function Chat(params) {
|
|
|
9392
9398
|
publicized.resetCallStream = callModule.resetCallStream;
|
|
9393
9399
|
publicized.raiseHand = callModule.raiseHand;
|
|
9394
9400
|
publicized.lowerHand = callModule.lowerHand;
|
|
9401
|
+
publicized.restrictCallSession = callModule.restrictCallSession;
|
|
9402
|
+
publicized.addCallParticipantsPermission = callModule.addCallParticipantsPermission;
|
|
9403
|
+
publicized.removeCallParticipantsPermission = callModule.removeCallParticipantsPermission;
|
|
9404
|
+
publicized.restrictableCallActions = _constants.restrictableCallActions;
|
|
9395
9405
|
|
|
9396
9406
|
publicized.getMutualGroups = function (params, callback) {
|
|
9397
9407
|
var count = +params.count ? +params.count : 25,
|
|
@@ -9891,8 +9901,8 @@ function Chat(params) {
|
|
|
9891
9901
|
publicized.stopPrintStatus = callModule.stopPrintStatus;
|
|
9892
9902
|
publicized.startPrintStatus = callModule.startPrintStatus;
|
|
9893
9903
|
publicized.addTypeCodeToBusiness = app.typeCodeApiMethods.addTypeCodeToBusiness;
|
|
9894
|
-
publicized.registerTypeCodeInChat = app.typeCodeApiMethods.registerTypeCodeInChat;
|
|
9895
|
-
|
|
9904
|
+
publicized.registerTypeCodeInChat = app.typeCodeApiMethods.registerTypeCodeInChat; // publicized.registerTypeCodeInChat = app.typeCodeApiMethods.registerTypeCodeInChat;
|
|
9905
|
+
|
|
9896
9906
|
publicized.logger = app.logger;
|
|
9897
9907
|
app.store.events.on(app.store.threads.eventsList.UNREAD_COUNT_UPDATED, function (thread) {
|
|
9898
9908
|
app.chatEvents.fireEvent('threadEvents', {
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _constants = require("../../constants");
|
|
9
|
+
|
|
10
|
+
var _errorHandler = require("../../errorHandler");
|
|
11
|
+
|
|
12
|
+
function AdminMethods(app) {
|
|
13
|
+
var publicized = {
|
|
14
|
+
restrictCallSession: function restrictCallSession(params) {
|
|
15
|
+
var call = app.call.currentCall();
|
|
16
|
+
|
|
17
|
+
if (!call) {
|
|
18
|
+
app.errorHandler.raiseError(_errorHandler.errorList.INVALID_CALLID, null, true, {});
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var sendDataContent = {};
|
|
23
|
+
|
|
24
|
+
if (params) {
|
|
25
|
+
if (typeof +params.callId === 'number' && params.callId > 0) {
|
|
26
|
+
sendDataContent.callId = +params.callId;
|
|
27
|
+
} else {
|
|
28
|
+
app.errorHandler.raiseError(_errorHandler.errorList.INVALID_CALLID, null, true, {});
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (typeof params.state === 'boolean') {
|
|
33
|
+
sendDataContent.state = params.state;
|
|
34
|
+
} else {
|
|
35
|
+
app.chatEvents.fireEvent('error', {
|
|
36
|
+
code: 999,
|
|
37
|
+
message: '[SDK] parameter state is not valid. expected value: true|false'
|
|
38
|
+
});
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
app.chatEvents.fireEvent('error', {
|
|
43
|
+
code: 999,
|
|
44
|
+
message: '[SDK] No params have been sent to restrictCallSession'
|
|
45
|
+
});
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var sendData = {
|
|
50
|
+
chatMessageVOType: _constants.chatMessageVOTypes.BAN_CALL_SESSION,
|
|
51
|
+
typeCode: params.typeCode,
|
|
52
|
+
pushMsgType: 3,
|
|
53
|
+
subjectId: sendDataContent.callId,
|
|
54
|
+
token: app.sdkParams.token,
|
|
55
|
+
content: {
|
|
56
|
+
restricted: sendDataContent.state
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return app.messenger.sendMessage(sendData);
|
|
60
|
+
},
|
|
61
|
+
addCallParticipantsPermission: function addCallParticipantsPermission(params) {
|
|
62
|
+
var call = app.call.currentCall();
|
|
63
|
+
|
|
64
|
+
if (!call) {
|
|
65
|
+
app.errorHandler.raiseError(_errorHandler.errorList.INVALID_CALLID, null, true, {});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var sendDataContent = {};
|
|
70
|
+
|
|
71
|
+
if (params) {
|
|
72
|
+
if (typeof +params.callId === 'number' && params.callId > 0) {
|
|
73
|
+
sendDataContent.callId = +params.callId;
|
|
74
|
+
} else {
|
|
75
|
+
app.errorHandler.raiseError(_errorHandler.errorList.INVALID_CALLID, null, true, {});
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (Array.isArray(params.invitees) && params.invitees.length) {
|
|
80
|
+
sendDataContent.invitees = []; //params.invitees;
|
|
81
|
+
|
|
82
|
+
for (var i = 0; i < params.invitees.length; i++) {
|
|
83
|
+
var tempInvitee = params.invitees[i];
|
|
84
|
+
|
|
85
|
+
if (tempInvitee && typeof tempInvitee.idType === "string") {
|
|
86
|
+
tempInvitee.idType = _constants.inviteeVOidTypes[tempInvitee.idType];
|
|
87
|
+
sendDataContent.invitees.push(tempInvitee);
|
|
88
|
+
} else if (tempInvitee) {
|
|
89
|
+
sendDataContent.invitees.push(tempInvitee);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
app.chatEvents.fireEvent('error', {
|
|
94
|
+
code: 999,
|
|
95
|
+
message: '[SDK] invitees list is empty.'
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (Array.isArray(params.allowedCallActions) && params.allowedCallActions.length) {
|
|
101
|
+
sendDataContent.allowedCallActions = params.allowedCallActions;
|
|
102
|
+
} else {
|
|
103
|
+
app.chatEvents.fireEvent('error', {
|
|
104
|
+
code: 999,
|
|
105
|
+
message: '[SDK] allowedCallActions list is empty.'
|
|
106
|
+
});
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
app.chatEvents.fireEvent('error', {
|
|
111
|
+
code: 999,
|
|
112
|
+
message: '[SDK] No params have been sent to addCallParticipantsPermission'
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
var sendData = {
|
|
118
|
+
chatMessageVOType: _constants.chatMessageVOTypes.SET_PERMISSION_TO_CALL_PARTICIPANT,
|
|
119
|
+
typeCode: params.typeCode,
|
|
120
|
+
pushMsgType: 3,
|
|
121
|
+
subjectId: sendDataContent.callId,
|
|
122
|
+
content: sendDataContent,
|
|
123
|
+
token: app.sdkParams.token
|
|
124
|
+
};
|
|
125
|
+
return app.messenger.sendMessage(sendData);
|
|
126
|
+
},
|
|
127
|
+
removeCallParticipantsPermission: function removeCallParticipantsPermission(params) {
|
|
128
|
+
var call = app.call.currentCall();
|
|
129
|
+
|
|
130
|
+
if (!call) {
|
|
131
|
+
app.errorHandler.raiseError(_errorHandler.errorList.INVALID_CALLID, null, true, {});
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
var sendDataContent = {};
|
|
136
|
+
|
|
137
|
+
if (params) {
|
|
138
|
+
if (typeof +params.callId === 'number' && params.callId > 0) {
|
|
139
|
+
sendDataContent.callId = +params.callId;
|
|
140
|
+
} else {
|
|
141
|
+
app.errorHandler.raiseError(_errorHandler.errorList.INVALID_CALLID, null, true, {});
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (Array.isArray(params.invitees) && params.invitees.length) {
|
|
146
|
+
sendDataContent.invitees = []; //params.invitees;
|
|
147
|
+
|
|
148
|
+
for (var i = 0; i < params.invitees.length; i++) {
|
|
149
|
+
var tempInvitee = params.invitees[i];
|
|
150
|
+
|
|
151
|
+
if (tempInvitee && typeof tempInvitee.idType === "string") {
|
|
152
|
+
tempInvitee.idType = _constants.inviteeVOidTypes[tempInvitee.idType];
|
|
153
|
+
sendDataContent.invitees.push(tempInvitee);
|
|
154
|
+
} else if (tempInvitee) {
|
|
155
|
+
sendDataContent.invitees.push(tempInvitee);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
} else {
|
|
159
|
+
app.chatEvents.fireEvent('error', {
|
|
160
|
+
code: 999,
|
|
161
|
+
message: '[SDK] invitees list is empty.'
|
|
162
|
+
});
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (Array.isArray(params.allowedCallActions) && params.allowedCallActions.length) {
|
|
167
|
+
sendDataContent.allowedCallActions = params.allowedCallActions;
|
|
168
|
+
} else {
|
|
169
|
+
app.chatEvents.fireEvent('error', {
|
|
170
|
+
code: 999,
|
|
171
|
+
message: '[SDK] allowedCallActions list is empty.'
|
|
172
|
+
});
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
app.chatEvents.fireEvent('error', {
|
|
177
|
+
code: 999,
|
|
178
|
+
message: '[SDK] No params have been sent to removeCallParticipantsPermission'
|
|
179
|
+
});
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
var sendData = {
|
|
184
|
+
chatMessageVOType: _constants.chatMessageVOTypes.REMOVE_PERMISSION_FROM_CALL_PARTICIPANT,
|
|
185
|
+
typeCode: params.typeCode,
|
|
186
|
+
pushMsgType: 3,
|
|
187
|
+
subjectId: sendDataContent.callId,
|
|
188
|
+
token: app.sdkParams.token,
|
|
189
|
+
content: sendDataContent
|
|
190
|
+
};
|
|
191
|
+
return app.messenger.sendMessage(sendData);
|
|
192
|
+
},
|
|
193
|
+
onRestrictCallSession: function onRestrictCallSession(uniqueId, messageContent, chatMessage, threadId) {
|
|
194
|
+
app.chatEvents.fireEvent('callEvents', {
|
|
195
|
+
type: 'RESTRICT_CALL_ACTIONS',
|
|
196
|
+
typeCode: chatMessage.typeCode,
|
|
197
|
+
callId: threadId,
|
|
198
|
+
result: messageContent,
|
|
199
|
+
uniqueId: uniqueId
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
onAddCallParticipantsPermission: function onAddCallParticipantsPermission(uniqueId, messageContent, chatMessage, threadId) {
|
|
203
|
+
app.chatEvents.fireEvent('callEvents', {
|
|
204
|
+
type: 'ADD_CALL_PARTICIPANTS_PERMISSION',
|
|
205
|
+
callId: threadId,
|
|
206
|
+
result: messageContent,
|
|
207
|
+
uniqueId: uniqueId
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
onRemoveCallParticipantsPermission: function onRemoveCallParticipantsPermission(uniqueId, messageContent, chatMessage, threadId) {
|
|
211
|
+
app.chatEvents.fireEvent('callEvents', {
|
|
212
|
+
type: 'REMOVE_CALL_PARTICIPANTS_PERMISSION',
|
|
213
|
+
callId: threadId,
|
|
214
|
+
result: messageContent,
|
|
215
|
+
uniqueId: uniqueId
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
return publicized;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
var _default = AdminMethods;
|
|
223
|
+
exports["default"] = _default;
|
|
@@ -312,6 +312,29 @@ function ThreadHistoryMethods(app) {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
sendMessageParams.content.size = typeof params.size == 'number' && params.size <= 10 ? params.size : 10;
|
|
315
|
+
var memoryCache = false;
|
|
316
|
+
|
|
317
|
+
if (typeof params.cache === "boolean") {
|
|
318
|
+
memoryCache = params.cache;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (memoryCache && app.store.history.canGetFromCache(params.threadId, sendMessageParams.content)) {
|
|
322
|
+
var retrnData = {
|
|
323
|
+
hasError: false,
|
|
324
|
+
cache: true,
|
|
325
|
+
errorMessage: null,
|
|
326
|
+
errorCode: 0
|
|
327
|
+
},
|
|
328
|
+
res = app.store.history.get(params.threadId).getRangeCacheData(sendMessageParams.content);
|
|
329
|
+
retrnData.result = {
|
|
330
|
+
history: res,
|
|
331
|
+
hasNext: true
|
|
332
|
+
};
|
|
333
|
+
callback && callback(retrnData);
|
|
334
|
+
callback = undefined;
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
|
|
315
338
|
return app.messenger.sendMessage(sendMessageParams, {
|
|
316
339
|
onResult: function onResult(result) {
|
|
317
340
|
var returnData = {
|
|
@@ -324,6 +347,11 @@ function ThreadHistoryMethods(app) {
|
|
|
324
347
|
if (!returnData.hasError) {
|
|
325
348
|
var messageContent = result.result;
|
|
326
349
|
var history = (0, _dataFormatters.reformatThreadHistory)(params.threadId, messageContent);
|
|
350
|
+
|
|
351
|
+
if (memoryCache && app.store.history.isParamsValid(sendMessageParams.content)) {
|
|
352
|
+
app.store.history.saveList(params.threadId, sendMessageParams.content, JSON.parse(JSON.stringify(history)), true);
|
|
353
|
+
}
|
|
354
|
+
|
|
327
355
|
returnData.result = {
|
|
328
356
|
history: history,
|
|
329
357
|
hasNext: true
|
|
@@ -335,9 +363,9 @@ function ThreadHistoryMethods(app) {
|
|
|
335
363
|
});
|
|
336
364
|
}
|
|
337
365
|
|
|
338
|
-
function onGetHistoryByMessageIdRange(uniqueId,
|
|
366
|
+
function onGetHistoryByMessageIdRange(uniqueId, threadId, messageContent, chatMessage) {
|
|
339
367
|
if (app.store.messagesCallbacks[uniqueId]) {
|
|
340
|
-
app.store.messagesCallbacks[uniqueId](_utility["default"].createReturnData(chatMessage.typeCode, chatMessage.ownerId, false, '', 0, messageContent,
|
|
368
|
+
app.store.messagesCallbacks[uniqueId](_utility["default"].createReturnData(chatMessage.typeCode, chatMessage.ownerId, false, '', 0, messageContent, null));
|
|
341
369
|
}
|
|
342
370
|
}
|
|
343
371
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.systemMessageTypes = exports.podspace = exports.inviteeVOidTypes = exports.imageMimeTypes = exports.imageExtentions = exports.customizeReactionTypes = exports.createThreadTypes = exports.chatStickerTypes = exports.chatMessageVOTypes = exports.chatMessageTypes = exports.callStickerTypes = exports.callMetaDataTypes = exports.assistantActionTypes = exports.CHAT_ERRORS = void 0;
|
|
6
|
+
exports.systemMessageTypes = exports.restrictableCallActions = exports.podspace = exports.inviteeVOidTypes = exports.imageMimeTypes = exports.imageExtentions = exports.customizeReactionTypes = exports.createThreadTypes = exports.chatStickerTypes = exports.chatMessageVOTypes = exports.chatMessageTypes = exports.callStickerTypes = exports.callMetaDataTypes = exports.assistantActionTypes = exports.CHAT_ERRORS = void 0;
|
|
7
7
|
var chatMessageVOTypes = {
|
|
8
8
|
CREATE_THREAD: 1,
|
|
9
9
|
MESSAGE: 2,
|
|
@@ -152,6 +152,9 @@ var chatMessageVOTypes = {
|
|
|
152
152
|
GET_HISTORY_BY_MESSAGE_ID_RANGE: 256,
|
|
153
153
|
RAISE_HAND: 257,
|
|
154
154
|
LOWER_HAND: 258,
|
|
155
|
+
BAN_CALL_SESSION: 260,
|
|
156
|
+
SET_PERMISSION_TO_CALL_PARTICIPANT: 261,
|
|
157
|
+
REMOVE_PERMISSION_FROM_CALL_PARTICIPANT: 262,
|
|
155
158
|
ERROR: 999
|
|
156
159
|
};
|
|
157
160
|
exports.chatMessageVOTypes = chatMessageVOTypes;
|
|
@@ -332,4 +335,11 @@ var CHAT_ERRORS = {
|
|
|
332
335
|
// Map Errors
|
|
333
336
|
6700: 'You should Enter a Center Location like {lat: " ", lng: " "}'
|
|
334
337
|
};
|
|
335
|
-
exports.CHAT_ERRORS = CHAT_ERRORS;
|
|
338
|
+
exports.CHAT_ERRORS = CHAT_ERRORS;
|
|
339
|
+
var restrictableCallActions = {
|
|
340
|
+
VIDEO: 113,
|
|
341
|
+
MIC: 98,
|
|
342
|
+
RECORD: 121,
|
|
343
|
+
SCREENSHARE: 123
|
|
344
|
+
};
|
|
345
|
+
exports.restrictableCallActions = restrictableCallActions;
|
|
@@ -80,6 +80,34 @@ function HistoryItem(threadId, params, list) {
|
|
|
80
80
|
|
|
81
81
|
return true;
|
|
82
82
|
},
|
|
83
|
+
getRangeCacheData: function getRangeCacheData(params) {
|
|
84
|
+
var resCachedData = [];
|
|
85
|
+
var cacheData = (0, _toConsumableArray2["default"])(config.list);
|
|
86
|
+
var size = params.size,
|
|
87
|
+
messageId = params.messageId;
|
|
88
|
+
|
|
89
|
+
if (size && messageId) {
|
|
90
|
+
var message = config.list.find(function (item) {
|
|
91
|
+
return item.id === messageId;
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
if (message.timeMiliSeconds) {
|
|
95
|
+
var fromTimeIndex = cacheData.findIndex(function (x) {
|
|
96
|
+
return x.timeMiliSeconds === message.timeMiliSeconds;
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
if (fromTimeIndex >= size) {
|
|
100
|
+
resCachedData = cacheData.slice(fromTimeIndex - size, fromTimeIndex + size + 1);
|
|
101
|
+
|
|
102
|
+
if (!this.checkSequence(resCachedData)) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return resCachedData;
|
|
110
|
+
},
|
|
83
111
|
getCacheData: function getCacheData(params) {
|
|
84
112
|
var count = params.count,
|
|
85
113
|
fromTime = params.fromTime,
|
|
@@ -139,6 +167,11 @@ function HistoryItem(threadId, params, list) {
|
|
|
139
167
|
return resCachedData;
|
|
140
168
|
},
|
|
141
169
|
cacheHasEnoughData: function cacheHasEnoughData(params) {
|
|
170
|
+
// handle range history cache
|
|
171
|
+
if (params.size && params.messageId) {
|
|
172
|
+
return this.getRangeCacheData(params).length === params.size * 2 + 1;
|
|
173
|
+
}
|
|
174
|
+
|
|
142
175
|
var cacheData = this.getCacheData(params);
|
|
143
176
|
return cacheData.length == params.count;
|
|
144
177
|
},
|