podchat-browser 12.9.15 → 12.9.16-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 +187 -35
- package/dist/node/chat.js +66 -63
- package/dist/node/lib/call/deviceManager.js +28 -4
- package/dist/node/lib/call/multitrack/callManager.js +12 -8
- package/dist/node/lib/call/multitrack/callUser.js +28 -1
- package/dist/node/lib/chat/threadHistoryMethods.js +5 -2
- package/dist/node/lib/constants.js +2 -0
- package/dist/node/lib/errorHandler.js +4 -0
- package/dist/node/lib/store/history/historyItem.js +78 -43
- package/dist/node/lib/store/history/historyList.js +5 -5
- package/dist/node/lib/store/history/index.js +10 -6
- package/dist/podchat-browser-bundle.js +375 -166
- package/examples/index.html +45 -11
- package/package.json +1 -1
- package/src/buildConfig.json +1 -1
- package/src/call.module.js +178 -33
- package/src/chat.js +62 -59
- package/src/lib/call/deviceManager.js +20 -2
- package/src/lib/call/multitrack/callManager.js +12 -8
- package/src/lib/call/multitrack/callUser.js +23 -1
- package/src/lib/chat/threadHistoryMethods.js +7 -5
- package/src/lib/constants.js +2 -0
- package/src/lib/errorHandler.js +4 -0
- package/src/lib/store/history/historyItem.js +78 -46
- package/src/lib/store/history/historyList.js +4 -8
- package/src/lib/store/history/index.js +12 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"12.9.
|
|
1
|
+
{"version":"12.9.16-snapshot.1","date":"۱۴۰۳/۱۰/۹","VersionInfo":"Release: false, Snapshot: true, Is For Test: true"}
|
package/dist/node/call.module.js
CHANGED
|
@@ -457,7 +457,7 @@ function ChatCall(app, params) {
|
|
|
457
457
|
|
|
458
458
|
|
|
459
459
|
function shouldNotProcessChatMessage(type, threadId) {
|
|
460
|
-
var restrictedMessageTypes = [_constants.chatMessageVOTypes.MUTE_CALL_PARTICIPANT, _constants.chatMessageVOTypes.UNMUTE_CALL_PARTICIPANT, _constants.chatMessageVOTypes.CALL_PARTICIPANT_JOINED, _constants.chatMessageVOTypes.REMOVE_CALL_PARTICIPANT, _constants.chatMessageVOTypes.RECONNECT, _constants.chatMessageVOTypes.TURN_OFF_VIDEO_CALL, _constants.chatMessageVOTypes.TURN_ON_VIDEO_CALL, _constants.chatMessageVOTypes.DESTINED_RECORD_CALL, _constants.chatMessageVOTypes.RECORD_CALL, _constants.chatMessageVOTypes.RECORD_CALL_STARTED, _constants.chatMessageVOTypes.END_RECORD_CALL, _constants.chatMessageVOTypes.TERMINATE_CALL, _constants.chatMessageVOTypes.CALL_STICKER_SYSTEM_MESSAGE, _constants.chatMessageVOTypes.CALL_RECORDING_FAILED // chatMessageVOTypes.END_CALL
|
|
460
|
+
var restrictedMessageTypes = [_constants.chatMessageVOTypes.MUTE_CALL_PARTICIPANT, _constants.chatMessageVOTypes.UNMUTE_CALL_PARTICIPANT, _constants.chatMessageVOTypes.CALL_PARTICIPANT_JOINED, _constants.chatMessageVOTypes.REMOVE_CALL_PARTICIPANT, _constants.chatMessageVOTypes.RECONNECT, _constants.chatMessageVOTypes.TURN_OFF_VIDEO_CALL, _constants.chatMessageVOTypes.TURN_ON_VIDEO_CALL, _constants.chatMessageVOTypes.DESTINED_RECORD_CALL, _constants.chatMessageVOTypes.RECORD_CALL, _constants.chatMessageVOTypes.RECORD_CALL_STARTED, _constants.chatMessageVOTypes.END_RECORD_CALL, _constants.chatMessageVOTypes.TERMINATE_CALL, _constants.chatMessageVOTypes.CALL_STICKER_SYSTEM_MESSAGE, _constants.chatMessageVOTypes.CALL_RECORDING_FAILED, _constants.chatMessageVOTypes.RAISE_HAND, _constants.chatMessageVOTypes.LOWER_HAND // chatMessageVOTypes.END_CALL
|
|
461
461
|
];
|
|
462
462
|
|
|
463
463
|
if ((!app.call.callStopQueue.callStarted || threadId != app.callsManager.currentCallId()) && restrictedMessageTypes.includes(type)) {
|
|
@@ -493,7 +493,8 @@ function ChatCall(app, params) {
|
|
|
493
493
|
messageContent.threadId = threadId;
|
|
494
494
|
app.chatEvents.fireEvent('callEvents', {
|
|
495
495
|
type: 'RECEIVE_CALL',
|
|
496
|
-
result: messageContent
|
|
496
|
+
result: messageContent,
|
|
497
|
+
uniqueId: uniqueId
|
|
497
498
|
});
|
|
498
499
|
|
|
499
500
|
if (messageContent.callId > 0) {
|
|
@@ -502,7 +503,8 @@ function ChatCall(app, params) {
|
|
|
502
503
|
} else {
|
|
503
504
|
app.chatEvents.fireEvent('callEvents', {
|
|
504
505
|
type: 'PARTNER_RECEIVED_YOUR_CALL',
|
|
505
|
-
result: messageContent
|
|
506
|
+
result: messageContent,
|
|
507
|
+
uniqueId: uniqueId
|
|
506
508
|
});
|
|
507
509
|
}
|
|
508
510
|
|
|
@@ -519,7 +521,8 @@ function ChatCall(app, params) {
|
|
|
519
521
|
|
|
520
522
|
app.chatEvents.fireEvent('callEvents', {
|
|
521
523
|
type: 'ACCEPT_CALL',
|
|
522
|
-
result: messageContent
|
|
524
|
+
result: messageContent,
|
|
525
|
+
uniqueId: uniqueId
|
|
523
526
|
});
|
|
524
527
|
break;
|
|
525
528
|
|
|
@@ -536,7 +539,8 @@ function ChatCall(app, params) {
|
|
|
536
539
|
app.chatEvents.fireEvent('callEvents', {
|
|
537
540
|
type: 'REJECT_CALL',
|
|
538
541
|
callId: threadId,
|
|
539
|
-
result: messageContent
|
|
542
|
+
result: messageContent,
|
|
543
|
+
uniqueId: uniqueId
|
|
540
544
|
});
|
|
541
545
|
break;
|
|
542
546
|
|
|
@@ -553,7 +557,8 @@ function ChatCall(app, params) {
|
|
|
553
557
|
app.chatEvents.fireEvent('callEvents', {
|
|
554
558
|
type: 'RECEIVE_CALL',
|
|
555
559
|
callId: threadId,
|
|
556
|
-
result: messageContent
|
|
560
|
+
result: messageContent,
|
|
561
|
+
uniqueId: uniqueId
|
|
557
562
|
}); // if(!currentCallId ) {
|
|
558
563
|
|
|
559
564
|
latestCallRequestId = messageContent.callId; // }
|
|
@@ -561,7 +566,8 @@ function ChatCall(app, params) {
|
|
|
561
566
|
app.chatEvents.fireEvent('callEvents', {
|
|
562
567
|
type: 'PARTNER_RECEIVED_YOUR_CALL',
|
|
563
568
|
callId: threadId,
|
|
564
|
-
result: messageContent
|
|
569
|
+
result: messageContent,
|
|
570
|
+
uniqueId: uniqueId
|
|
565
571
|
});
|
|
566
572
|
}
|
|
567
573
|
|
|
@@ -576,7 +582,8 @@ function ChatCall(app, params) {
|
|
|
576
582
|
app.chatEvents.fireEvent('callEvents', {
|
|
577
583
|
type: 'CALL_STARTED_ELSEWHERE',
|
|
578
584
|
callId: threadId,
|
|
579
|
-
message: 'Call already started somewhere else..., aborting...'
|
|
585
|
+
message: 'Call already started somewhere else..., aborting...',
|
|
586
|
+
uniqueId: uniqueId
|
|
580
587
|
});
|
|
581
588
|
return;
|
|
582
589
|
}
|
|
@@ -609,7 +616,8 @@ function ChatCall(app, params) {
|
|
|
609
616
|
|
|
610
617
|
app.chatEvents.fireEvent('callEvents', {
|
|
611
618
|
type: 'END_CALL',
|
|
612
|
-
result: messageContent
|
|
619
|
+
result: messageContent,
|
|
620
|
+
uniqueId: uniqueId
|
|
613
621
|
});
|
|
614
622
|
app.callsManager.removeItem(threadId); // callStop();
|
|
615
623
|
|
|
@@ -626,7 +634,8 @@ function ChatCall(app, params) {
|
|
|
626
634
|
|
|
627
635
|
app.chatEvents.fireEvent('callEvents', {
|
|
628
636
|
type: 'CALL_ENDED',
|
|
629
|
-
callId: threadId
|
|
637
|
+
callId: threadId,
|
|
638
|
+
uniqueId: uniqueId
|
|
630
639
|
});
|
|
631
640
|
|
|
632
641
|
if (threadId === app.callsManager.currentCallId() && app.call.callStopQueue.callStarted) {
|
|
@@ -659,7 +668,8 @@ function ChatCall(app, params) {
|
|
|
659
668
|
app.chatEvents.fireEvent('callEvents', {
|
|
660
669
|
type: 'CALL_PARTICIPANT_RECONNECTING',
|
|
661
670
|
callId: threadId,
|
|
662
|
-
result: messageContent
|
|
671
|
+
result: messageContent,
|
|
672
|
+
uniqueId: uniqueId
|
|
663
673
|
});
|
|
664
674
|
break;
|
|
665
675
|
|
|
@@ -677,7 +687,8 @@ function ChatCall(app, params) {
|
|
|
677
687
|
app.chatEvents.fireEvent('callEvents', {
|
|
678
688
|
type: 'CALL_PARTICIPANT_CONNECTED',
|
|
679
689
|
callId: threadId,
|
|
680
|
-
result: messageContent
|
|
690
|
+
result: messageContent,
|
|
691
|
+
uniqueId: uniqueId
|
|
681
692
|
});
|
|
682
693
|
|
|
683
694
|
if (callUsers && callUsers[app.store.user.get().id] && callUsers[app.store.user.get().id].video) {
|
|
@@ -699,7 +710,8 @@ function ChatCall(app, params) {
|
|
|
699
710
|
case _constants.chatMessageVOTypes.CONTACT_SYNCED:
|
|
700
711
|
app.chatEvents.fireEvent('contactEvents', {
|
|
701
712
|
type: 'CONTACTS_SYNCED',
|
|
702
|
-
result: messageContent
|
|
713
|
+
result: messageContent,
|
|
714
|
+
uniqueId: uniqueId
|
|
703
715
|
});
|
|
704
716
|
break;
|
|
705
717
|
|
|
@@ -725,7 +737,8 @@ function ChatCall(app, params) {
|
|
|
725
737
|
app.chatEvents.fireEvent('callEvents', {
|
|
726
738
|
type: 'RECEIVE_CALL',
|
|
727
739
|
callId: threadId,
|
|
728
|
-
result: messageContent
|
|
740
|
+
result: messageContent,
|
|
741
|
+
uniqueId: uniqueId
|
|
729
742
|
}); //currentCallId = messageContent.callId;
|
|
730
743
|
|
|
731
744
|
break;
|
|
@@ -773,7 +786,8 @@ function ChatCall(app, params) {
|
|
|
773
786
|
app.chatEvents.fireEvent('callEvents', {
|
|
774
787
|
type: 'CALL_PARTICIPANT_REMOVED',
|
|
775
788
|
callId: threadId,
|
|
776
|
-
result: messageContent
|
|
789
|
+
result: messageContent,
|
|
790
|
+
uniqueId: uniqueId
|
|
777
791
|
});
|
|
778
792
|
break;
|
|
779
793
|
|
|
@@ -789,7 +803,8 @@ function ChatCall(app, params) {
|
|
|
789
803
|
app.chatEvents.fireEvent('callEvents', {
|
|
790
804
|
type: 'TERMINATE_CALL',
|
|
791
805
|
callId: threadId,
|
|
792
|
-
result: messageContent
|
|
806
|
+
result: messageContent,
|
|
807
|
+
uniqueId: uniqueId
|
|
793
808
|
});
|
|
794
809
|
|
|
795
810
|
if (threadId === app.callsManager.currentCallId()) {
|
|
@@ -836,7 +851,8 @@ function ChatCall(app, params) {
|
|
|
836
851
|
app.chatEvents.fireEvent('callEvents', {
|
|
837
852
|
type: 'REJECT_GROUP_CALL',
|
|
838
853
|
callId: threadId,
|
|
839
|
-
result: messageContent
|
|
854
|
+
result: messageContent,
|
|
855
|
+
uniqueId: uniqueId
|
|
840
856
|
});
|
|
841
857
|
break;
|
|
842
858
|
|
|
@@ -862,7 +878,8 @@ function ChatCall(app, params) {
|
|
|
862
878
|
app.chatEvents.fireEvent('callEvents', {
|
|
863
879
|
type: 'CALL_SESSION_CREATED',
|
|
864
880
|
callId: threadId,
|
|
865
|
-
result: messageContent
|
|
881
|
+
result: messageContent,
|
|
882
|
+
uniqueId: uniqueId
|
|
866
883
|
}); // if(!requestedCallId) {
|
|
867
884
|
|
|
868
885
|
app.call.sharedVariables.requestedCallId = messageContent.callId;
|
|
@@ -881,7 +898,7 @@ function ChatCall(app, params) {
|
|
|
881
898
|
}
|
|
882
899
|
|
|
883
900
|
if (!app.call.currentCall()) return;
|
|
884
|
-
app.call.currentCall().handleParticipantVideoOn(messageContent);
|
|
901
|
+
app.call.currentCall().handleParticipantVideoOn(messageContent, threadId, uniqueId);
|
|
885
902
|
break;
|
|
886
903
|
|
|
887
904
|
/**
|
|
@@ -894,7 +911,7 @@ function ChatCall(app, params) {
|
|
|
894
911
|
}
|
|
895
912
|
|
|
896
913
|
if (!app.call.currentCall()) return;
|
|
897
|
-
app.call.currentCall().handleParticipantVideoOff(messageContent);
|
|
914
|
+
app.call.currentCall().handleParticipantVideoOff(messageContent, threadId, uniqueId);
|
|
898
915
|
break;
|
|
899
916
|
|
|
900
917
|
/**
|
|
@@ -913,7 +930,8 @@ function ChatCall(app, params) {
|
|
|
913
930
|
app.chatEvents.fireEvent('callEvents', {
|
|
914
931
|
type: 'START_RECORDING_CALL',
|
|
915
932
|
callId: threadId,
|
|
916
|
-
result: messageContent
|
|
933
|
+
result: messageContent,
|
|
934
|
+
uniqueId: uniqueId
|
|
917
935
|
});
|
|
918
936
|
var user = app.call.currentCallMyUser();
|
|
919
937
|
|
|
@@ -939,7 +957,8 @@ function ChatCall(app, params) {
|
|
|
939
957
|
app.chatEvents.fireEvent('callEvents', {
|
|
940
958
|
type: 'STOP_RECORDING_CALL',
|
|
941
959
|
callId: threadId,
|
|
942
|
-
result: messageContent
|
|
960
|
+
result: messageContent,
|
|
961
|
+
uniqueId: uniqueId
|
|
943
962
|
});
|
|
944
963
|
break;
|
|
945
964
|
|
|
@@ -949,7 +968,7 @@ function ChatCall(app, params) {
|
|
|
949
968
|
|
|
950
969
|
case _constants.chatMessageVOTypes.START_SCREEN_SHARE:
|
|
951
970
|
if (!app.call.currentCall()) return;
|
|
952
|
-
app.call.currentCall().handleStartScreenShare(chatMessage.typeCode, chatMessage.ownerId, messageContent); // if (app.store.messagesCallbacks[uniqueId]) {
|
|
971
|
+
app.call.currentCall().handleStartScreenShare(chatMessage.typeCode, chatMessage.ownerId, messageContent, threadId, uniqueId); // if (app.store.messagesCallbacks[uniqueId]) {
|
|
953
972
|
// app.store.messagesCallbacks[uniqueId](Utility.createReturnData(chatMessage.typeCode, chatMessage.ownerId, false, '', 0, messageContent, contentCount));
|
|
954
973
|
// }
|
|
955
974
|
|
|
@@ -961,7 +980,7 @@ function ChatCall(app, params) {
|
|
|
961
980
|
|
|
962
981
|
case _constants.chatMessageVOTypes.END_SCREEN_SHARE:
|
|
963
982
|
// screenShareInfo.setIAmOwner(false);
|
|
964
|
-
if (app.callsManager.currentCallId()) app.callsManager.get(threadId).handleEndScreenShare(messageContent);
|
|
983
|
+
if (app.callsManager.currentCallId()) app.callsManager.get(threadId).handleEndScreenShare(messageContent, threadId, uniqueId);
|
|
965
984
|
break;
|
|
966
985
|
|
|
967
986
|
/**
|
|
@@ -976,7 +995,8 @@ function ChatCall(app, params) {
|
|
|
976
995
|
app.chatEvents.fireEvent('callEvents', {
|
|
977
996
|
type: 'DELETE_FROM_CALL_LIST',
|
|
978
997
|
callId: threadId,
|
|
979
|
-
result: messageContent
|
|
998
|
+
result: messageContent,
|
|
999
|
+
uniqueId: uniqueId
|
|
980
1000
|
});
|
|
981
1001
|
break;
|
|
982
1002
|
|
|
@@ -993,7 +1013,8 @@ function ChatCall(app, params) {
|
|
|
993
1013
|
app.chatEvents.fireEvent('callEvents', {
|
|
994
1014
|
type: 'START_RECORDING_CALL',
|
|
995
1015
|
callId: threadId,
|
|
996
|
-
result: messageContent
|
|
1016
|
+
result: messageContent,
|
|
1017
|
+
uniqueId: uniqueId
|
|
997
1018
|
});
|
|
998
1019
|
|
|
999
1020
|
if (app.call.currentCall() && !app.call.currentCall().callServerController().isJanus()) {
|
|
@@ -1030,8 +1051,9 @@ function ChatCall(app, params) {
|
|
|
1030
1051
|
app.chatEvents.fireEvent('callEvents', {
|
|
1031
1052
|
type: 'SWITCH_TO_GROUP_CALL',
|
|
1032
1053
|
callId: threadId,
|
|
1033
|
-
result: messageContent
|
|
1034
|
-
|
|
1054
|
+
result: messageContent,
|
|
1055
|
+
//contains: isGroup, callId, threadId
|
|
1056
|
+
uniqueId: uniqueId
|
|
1035
1057
|
});
|
|
1036
1058
|
break;
|
|
1037
1059
|
|
|
@@ -1047,7 +1069,8 @@ function ChatCall(app, params) {
|
|
|
1047
1069
|
app.chatEvents.fireEvent('callEvents', {
|
|
1048
1070
|
type: 'CALL_RECORDING_STARTED',
|
|
1049
1071
|
callId: threadId,
|
|
1050
|
-
result: messageContent
|
|
1072
|
+
result: messageContent,
|
|
1073
|
+
uniqueId: uniqueId
|
|
1051
1074
|
});
|
|
1052
1075
|
|
|
1053
1076
|
if (app.call.currentCall() && !app.call.currentCall().callServerController().isJanus()) {
|
|
@@ -1074,7 +1097,8 @@ function ChatCall(app, params) {
|
|
|
1074
1097
|
app.chatEvents.fireEvent('callEvents', {
|
|
1075
1098
|
type: 'CALL_STICKER',
|
|
1076
1099
|
callId: threadId,
|
|
1077
|
-
result: messageContent
|
|
1100
|
+
result: messageContent,
|
|
1101
|
+
uniqueId: uniqueId
|
|
1078
1102
|
});
|
|
1079
1103
|
break;
|
|
1080
1104
|
|
|
@@ -1112,7 +1136,34 @@ function ChatCall(app, params) {
|
|
|
1112
1136
|
app.chatEvents.fireEvent('callEvents', {
|
|
1113
1137
|
type: 'CALL_RECORDING_FAILED',
|
|
1114
1138
|
callId: threadId,
|
|
1115
|
-
result: messageContent
|
|
1139
|
+
result: messageContent,
|
|
1140
|
+
uniqueId: uniqueId
|
|
1141
|
+
});
|
|
1142
|
+
break;
|
|
1143
|
+
|
|
1144
|
+
/**
|
|
1145
|
+
* Type 257 RAISE_HAND
|
|
1146
|
+
*/
|
|
1147
|
+
|
|
1148
|
+
case _constants.chatMessageVOTypes.RAISE_HAND:
|
|
1149
|
+
app.chatEvents.fireEvent('callEvents', {
|
|
1150
|
+
type: 'RAISE_HAND',
|
|
1151
|
+
callId: threadId,
|
|
1152
|
+
result: messageContent,
|
|
1153
|
+
uniqueId: uniqueId
|
|
1154
|
+
});
|
|
1155
|
+
break;
|
|
1156
|
+
|
|
1157
|
+
/**
|
|
1158
|
+
* Type 258 LOWER_HAND
|
|
1159
|
+
*/
|
|
1160
|
+
|
|
1161
|
+
case _constants.chatMessageVOTypes.LOWER_HAND:
|
|
1162
|
+
app.chatEvents.fireEvent('callEvents', {
|
|
1163
|
+
type: 'LOWER_HAND',
|
|
1164
|
+
callId: threadId,
|
|
1165
|
+
result: messageContent,
|
|
1166
|
+
uniqueId: uniqueId
|
|
1116
1167
|
});
|
|
1117
1168
|
break;
|
|
1118
1169
|
}
|
|
@@ -1128,7 +1179,8 @@ function ChatCall(app, params) {
|
|
|
1128
1179
|
app.chatEvents.fireEvent('callEvents', {
|
|
1129
1180
|
type: 'CALL_STARTED',
|
|
1130
1181
|
callId: threadId,
|
|
1131
|
-
result: messageContent
|
|
1182
|
+
result: messageContent,
|
|
1183
|
+
uniqueId: uniqueId
|
|
1132
1184
|
});
|
|
1133
1185
|
|
|
1134
1186
|
if ((0, _typeof2["default"])(messageContent) === 'object' && messageContent.hasOwnProperty('chatDataDto') && !!messageContent.chatDataDto.kurentoAddress) {
|
|
@@ -1169,6 +1221,24 @@ function ChatCall(app, params) {
|
|
|
1169
1221
|
app.call.deviceManager.getMediaDevices(callback);
|
|
1170
1222
|
};
|
|
1171
1223
|
|
|
1224
|
+
this.replaceVideoStream = function (newStream) {
|
|
1225
|
+
try {
|
|
1226
|
+
app.call.deviceManager.replaceVideoStream(newStream, function () {
|
|
1227
|
+
var call = app.call.currentCall();
|
|
1228
|
+
|
|
1229
|
+
if (call) {
|
|
1230
|
+
app.call.currentCall().sendCallDivs();
|
|
1231
|
+
return;
|
|
1232
|
+
}
|
|
1233
|
+
}); // callback && callback({hasError: false, deviceId: params.deviceId})
|
|
1234
|
+
} catch (e) {
|
|
1235
|
+
raiseCallError({
|
|
1236
|
+
code: _errorHandler.errorList.REPLACE_STREAM_FAILED.code,
|
|
1237
|
+
message: e.message
|
|
1238
|
+
}, null, true);
|
|
1239
|
+
}
|
|
1240
|
+
};
|
|
1241
|
+
|
|
1172
1242
|
this.changeMediaDevice = function (params) {
|
|
1173
1243
|
var call = app.call.currentCall();
|
|
1174
1244
|
|
|
@@ -2620,11 +2690,93 @@ function ChatCall(app, params) {
|
|
|
2620
2690
|
});
|
|
2621
2691
|
};
|
|
2622
2692
|
|
|
2623
|
-
this.
|
|
2624
|
-
|
|
2625
|
-
|
|
2693
|
+
this.raiseHand = function (params) {
|
|
2694
|
+
var call = app.call.currentCall();
|
|
2695
|
+
|
|
2696
|
+
if (!call) {
|
|
2697
|
+
app.errorHandler.raiseError(_errorHandler.errorList.INVALID_CALLID, null, true, {}); // app.chatEvents.fireEvent('error', {
|
|
2698
|
+
// code: 999,
|
|
2699
|
+
// message: 'Call not exists'
|
|
2700
|
+
// });
|
|
2701
|
+
|
|
2702
|
+
return;
|
|
2626
2703
|
}
|
|
2627
2704
|
|
|
2705
|
+
var sendDataContent = {};
|
|
2706
|
+
|
|
2707
|
+
if (params) {
|
|
2708
|
+
if (typeof +params.callId === 'number' && params.callId > 0) {
|
|
2709
|
+
sendDataContent.callId = +params.callId;
|
|
2710
|
+
} else {
|
|
2711
|
+
app.errorHandler.raiseError(_errorHandler.errorList.INVALID_CALLID, null, true, {});
|
|
2712
|
+
/* app.chatEvents.fireEvent('error', {
|
|
2713
|
+
code: 999,
|
|
2714
|
+
message: 'Invalid call id!'
|
|
2715
|
+
}); */
|
|
2716
|
+
|
|
2717
|
+
return;
|
|
2718
|
+
}
|
|
2719
|
+
} else {
|
|
2720
|
+
app.chatEvents.fireEvent('error', {
|
|
2721
|
+
code: 999,
|
|
2722
|
+
message: '[SDK] No params have been sent to resize the video call! Send an object like {width: 640, height: 480}'
|
|
2723
|
+
});
|
|
2724
|
+
return;
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
var sendData = {
|
|
2728
|
+
chatMessageVOType: _constants.chatMessageVOTypes.RAISE_HAND,
|
|
2729
|
+
typeCode: params.typeCode,
|
|
2730
|
+
//params.typeCode,
|
|
2731
|
+
pushMsgType: 3,
|
|
2732
|
+
subjectId: sendDataContent.callId,
|
|
2733
|
+
token: app.sdkParams.token,
|
|
2734
|
+
uniqueId: _utility["default"].generateUUID()
|
|
2735
|
+
};
|
|
2736
|
+
return app.messenger.sendMessage(sendData, {});
|
|
2737
|
+
};
|
|
2738
|
+
|
|
2739
|
+
this.lowerHand = function (params) {
|
|
2740
|
+
var call = app.call.currentCall();
|
|
2741
|
+
|
|
2742
|
+
if (!call) {
|
|
2743
|
+
app.errorHandler.raiseError(_errorHandler.errorList.INVALID_CALLID, null, true, {});
|
|
2744
|
+
return;
|
|
2745
|
+
}
|
|
2746
|
+
|
|
2747
|
+
var sendDataContent = {};
|
|
2748
|
+
|
|
2749
|
+
if (params) {
|
|
2750
|
+
if (typeof +params.callId === 'number' && params.callId > 0) {
|
|
2751
|
+
sendDataContent.callId = +params.callId;
|
|
2752
|
+
} else {
|
|
2753
|
+
app.errorHandler.raiseError(_errorHandler.errorList.INVALID_CALLID, null, true, {});
|
|
2754
|
+
return;
|
|
2755
|
+
}
|
|
2756
|
+
} else {
|
|
2757
|
+
app.chatEvents.fireEvent('error', {
|
|
2758
|
+
code: 999,
|
|
2759
|
+
message: '[SDK] No params have been sent to resize the video call! Send an object like {width: 640, height: 480}'
|
|
2760
|
+
});
|
|
2761
|
+
return;
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
var sendData = {
|
|
2765
|
+
chatMessageVOType: _constants.chatMessageVOTypes.LOWER_HAND,
|
|
2766
|
+
typeCode: params.typeCode,
|
|
2767
|
+
//params.typeCode,
|
|
2768
|
+
pushMsgType: 3,
|
|
2769
|
+
subjectId: sendDataContent.callId,
|
|
2770
|
+
token: app.sdkParams.token,
|
|
2771
|
+
uniqueId: _utility["default"].generateUUID()
|
|
2772
|
+
};
|
|
2773
|
+
return app.messenger.sendMessage(sendData, {});
|
|
2774
|
+
};
|
|
2775
|
+
|
|
2776
|
+
this.deviceManager = function () {
|
|
2777
|
+
// if(!app.call.currentCall()) {
|
|
2778
|
+
// return null;
|
|
2779
|
+
// }
|
|
2628
2780
|
return app.call.deviceManager;
|
|
2629
2781
|
};
|
|
2630
2782
|
|
package/dist/node/chat.js
CHANGED
|
@@ -730,7 +730,7 @@ function Chat(params) {
|
|
|
730
730
|
*/
|
|
731
731
|
|
|
732
732
|
case _constants.chatMessageVOTypes.MESSAGE:
|
|
733
|
-
newMessageHandler(threadId, messageContent, chatMessage);
|
|
733
|
+
newMessageHandler(threadId, messageContent, chatMessage, uniqueId);
|
|
734
734
|
break;
|
|
735
735
|
|
|
736
736
|
/**
|
|
@@ -1191,7 +1191,7 @@ function Chat(params) {
|
|
|
1191
1191
|
*/
|
|
1192
1192
|
|
|
1193
1193
|
case _constants.chatMessageVOTypes.FORWARD_MESSAGE:
|
|
1194
|
-
newMessageHandler(threadId, messageContent, chatMessage);
|
|
1194
|
+
newMessageHandler(threadId, messageContent, chatMessage, uniqueId);
|
|
1195
1195
|
break;
|
|
1196
1196
|
|
|
1197
1197
|
/**
|
|
@@ -1242,7 +1242,7 @@ function Chat(params) {
|
|
|
1242
1242
|
app.store.messagesCallbacks[uniqueId](_utility["default"].createReturnData(chatMessage.typeCode, chatMessage.ownerId, false, '', 0, messageContent, contentCount));
|
|
1243
1243
|
}
|
|
1244
1244
|
|
|
1245
|
-
chatEditMessageHandler(threadId, messageContent, chatMessage, typeCode);
|
|
1245
|
+
chatEditMessageHandler(threadId, messageContent, chatMessage, typeCode, uniqueId);
|
|
1246
1246
|
break;
|
|
1247
1247
|
|
|
1248
1248
|
/**
|
|
@@ -1472,6 +1472,49 @@ function Chat(params) {
|
|
|
1472
1472
|
app.store.messagesCallbacks[uniqueId](_utility["default"].createReturnData(chatMessage.typeCode, chatMessage.ownerId, false, '', 0, messageContent, contentCount));
|
|
1473
1473
|
}
|
|
1474
1474
|
|
|
1475
|
+
if (app.sdkParams.fullResponseObject) {
|
|
1476
|
+
getThreads({
|
|
1477
|
+
threadIds: [messageContent.id],
|
|
1478
|
+
typeCode: typeCode
|
|
1479
|
+
}, function (threadsResult) {
|
|
1480
|
+
var threads = threadsResult.result.threads;
|
|
1481
|
+
|
|
1482
|
+
if (!threadsResult.cache) {
|
|
1483
|
+
app.chatEvents.fireEvent('threadEvents', {
|
|
1484
|
+
type: 'THREAD_PARTICIPANT_JOIN',
|
|
1485
|
+
result: {
|
|
1486
|
+
thread: threads[0],
|
|
1487
|
+
messageContent: messageContent,
|
|
1488
|
+
typeCode: typeCode
|
|
1489
|
+
}
|
|
1490
|
+
});
|
|
1491
|
+
app.chatEvents.fireEvent('threadEvents', {
|
|
1492
|
+
type: 'THREAD_LAST_ACTIVITY_TIME',
|
|
1493
|
+
result: {
|
|
1494
|
+
thread: threads[0],
|
|
1495
|
+
typeCode: typeCode
|
|
1496
|
+
}
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
});
|
|
1500
|
+
} else {
|
|
1501
|
+
app.chatEvents.fireEvent('threadEvents', {
|
|
1502
|
+
type: 'THREAD_PARTICIPANT_JOIN',
|
|
1503
|
+
result: {
|
|
1504
|
+
thread: messageContent,
|
|
1505
|
+
messageContent: messageContent,
|
|
1506
|
+
typeCode: typeCode
|
|
1507
|
+
}
|
|
1508
|
+
});
|
|
1509
|
+
app.chatEvents.fireEvent('threadEvents', {
|
|
1510
|
+
type: 'THREAD_LAST_ACTIVITY_TIME',
|
|
1511
|
+
result: {
|
|
1512
|
+
thread: messageContent,
|
|
1513
|
+
typeCode: typeCode
|
|
1514
|
+
}
|
|
1515
|
+
});
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1475
1518
|
break;
|
|
1476
1519
|
|
|
1477
1520
|
/**
|
|
@@ -2021,6 +2064,8 @@ function Chat(params) {
|
|
|
2021
2064
|
case _constants.chatMessageVOTypes.CALL_STICKER_SYSTEM_MESSAGE:
|
|
2022
2065
|
case _constants.chatMessageVOTypes.INQUIRY_CALL:
|
|
2023
2066
|
case _constants.chatMessageVOTypes.CALL_RECORDING_FAILED:
|
|
2067
|
+
case _constants.chatMessageVOTypes.RAISE_HAND:
|
|
2068
|
+
case _constants.chatMessageVOTypes.LOWER_HAND:
|
|
2024
2069
|
callModule.handleChatMessages(chatMessage, type, messageContent, contentCount, threadId, uniqueId);
|
|
2025
2070
|
break;
|
|
2026
2071
|
|
|
@@ -2594,13 +2639,13 @@ function Chat(params) {
|
|
|
2594
2639
|
* If error code is 21, Token is invalid &
|
|
2595
2640
|
* user should logged out
|
|
2596
2641
|
*/
|
|
2642
|
+
//if (messageContent.code === 21) {
|
|
2643
|
+
// TODO: Temporarily removed due to unknown side-effects
|
|
2644
|
+
// app.messenger.chatState = false;
|
|
2645
|
+
// asyncClient.logout();
|
|
2646
|
+
// clearChatServerCaches();
|
|
2647
|
+
//}
|
|
2597
2648
|
|
|
2598
|
-
|
|
2599
|
-
if (messageContent.code === 21) {// TODO: Temporarily removed due to unknown side-effects
|
|
2600
|
-
// app.messenger.chatState = false;
|
|
2601
|
-
// asyncClient.logout();
|
|
2602
|
-
// clearChatServerCaches();
|
|
2603
|
-
}
|
|
2604
2649
|
/* If the error code is 208, so the user
|
|
2605
2650
|
* has been blocked cause of spam activity
|
|
2606
2651
|
*/
|
|
@@ -2721,7 +2766,7 @@ function Chat(params) {
|
|
|
2721
2766
|
*
|
|
2722
2767
|
* @return {undefined}
|
|
2723
2768
|
*/
|
|
2724
|
-
newMessageHandler = function newMessageHandler(threadId, messageContent, chatMessage) {
|
|
2769
|
+
newMessageHandler = function newMessageHandler(threadId, messageContent, chatMessage, uniqueId) {
|
|
2725
2770
|
var message = (0, _dataFormatters.formatDataToMakeMessage)(threadId, messageContent);
|
|
2726
2771
|
var threadObject = message.conversation;
|
|
2727
2772
|
var lastMessageVoCopy = Object.assign({}, message);
|
|
@@ -2741,7 +2786,8 @@ function Chat(params) {
|
|
|
2741
2786
|
result: {
|
|
2742
2787
|
typeCode: chatMessage.typeCode,
|
|
2743
2788
|
message: stringMsg
|
|
2744
|
-
}
|
|
2789
|
+
},
|
|
2790
|
+
uniqueId: uniqueId
|
|
2745
2791
|
});
|
|
2746
2792
|
app.chatEvents.fireEvent('threadEvents', {
|
|
2747
2793
|
type: 'THREAD_UNREAD_COUNT_UPDATED',
|
|
@@ -2755,19 +2801,10 @@ function Chat(params) {
|
|
|
2755
2801
|
if (!storeThread) {
|
|
2756
2802
|
app.store.threads.save(threadObject);
|
|
2757
2803
|
storeThread = app.store.threads.get(threadObject.id);
|
|
2758
|
-
}
|
|
2759
|
-
// app.store.threads.get(threadObject.id).unreadCount.set();
|
|
2760
|
-
|
|
2804
|
+
}
|
|
2761
2805
|
|
|
2762
2806
|
if (message.ownerId != app.store.user.get().id) {
|
|
2763
|
-
if (!storeThread.unreadCount.get()) storeThread.unreadCount.set(1);else storeThread.unreadCount.increase();
|
|
2764
|
-
// storeThread.unreadCount.set(unreadCount);
|
|
2765
|
-
// } else {
|
|
2766
|
-
// if(!storeThread.unreadCount.get())
|
|
2767
|
-
// storeThread.unreadCount.set(1);
|
|
2768
|
-
// else
|
|
2769
|
-
// storeThread.unreadCount.increase();
|
|
2770
|
-
// }
|
|
2807
|
+
if (!storeThread.unreadCount.get()) storeThread.unreadCount.set(1);else storeThread.unreadCount.increase();
|
|
2771
2808
|
} else {
|
|
2772
2809
|
storeThread.unreadCount.set(0);
|
|
2773
2810
|
}
|
|
@@ -2777,45 +2814,7 @@ function Chat(params) {
|
|
|
2777
2814
|
result: {
|
|
2778
2815
|
thread: threadObject
|
|
2779
2816
|
}
|
|
2780
|
-
});
|
|
2781
|
-
// getThreads({
|
|
2782
|
-
// threadIds: [threadId]
|
|
2783
|
-
// }, function (threadsResult) {
|
|
2784
|
-
// var threads = threadsResult.result.threads;
|
|
2785
|
-
//
|
|
2786
|
-
// app.chatEvents.fireEvent('threadEvents', {
|
|
2787
|
-
// type: 'THREAD_UNREAD_COUNT_UPDATED',
|
|
2788
|
-
// result: {
|
|
2789
|
-
// thread: threads[0],
|
|
2790
|
-
// unreadCount: (threads[0].unreadCount) ? threads[0].unreadCount : 0
|
|
2791
|
-
// }
|
|
2792
|
-
// });
|
|
2793
|
-
//
|
|
2794
|
-
// app.chatEvents.fireEvent('threadEvents', {
|
|
2795
|
-
// type: 'THREAD_LAST_ACTIVITY_TIME',
|
|
2796
|
-
// result: {
|
|
2797
|
-
// thread: threads[0]
|
|
2798
|
-
// }
|
|
2799
|
-
// });
|
|
2800
|
-
//
|
|
2801
|
-
// });
|
|
2802
|
-
// } else {
|
|
2803
|
-
// app.chatEvents.fireEvent('threadEvents', {
|
|
2804
|
-
// type: 'THREAD_LAST_ACTIVITY_TIME',
|
|
2805
|
-
// result: {
|
|
2806
|
-
// thread: threadId
|
|
2807
|
-
// }
|
|
2808
|
-
// });
|
|
2809
|
-
//
|
|
2810
|
-
// app.chatEvents.fireEvent('threadEvents', {
|
|
2811
|
-
// type: 'THREAD_UNREAD_COUNT_UPDATED',
|
|
2812
|
-
// result: {
|
|
2813
|
-
// thread: messageContent.id,
|
|
2814
|
-
// unreadCount: (messageContent.conversation.unreadCount) ? messageContent.conversation.unreadCount : 0
|
|
2815
|
-
// }
|
|
2816
|
-
// });
|
|
2817
|
-
// }
|
|
2818
|
-
|
|
2817
|
+
});
|
|
2819
2818
|
/**
|
|
2820
2819
|
* Update waitQ and remove sent messages from it
|
|
2821
2820
|
*/
|
|
@@ -2835,7 +2834,7 @@ function Chat(params) {
|
|
|
2835
2834
|
*
|
|
2836
2835
|
* @return {undefined}
|
|
2837
2836
|
*/
|
|
2838
|
-
chatEditMessageHandler = function chatEditMessageHandler(threadId, messageContent, chatMessage, typeCode) {
|
|
2837
|
+
chatEditMessageHandler = function chatEditMessageHandler(threadId, messageContent, chatMessage, typeCode, uniqueId) {
|
|
2839
2838
|
var message = (0, _dataFormatters.formatDataToMakeMessage)(threadId, messageContent);
|
|
2840
2839
|
app.store.history.saveMessage(threadId, message);
|
|
2841
2840
|
|
|
@@ -2852,7 +2851,8 @@ function Chat(params) {
|
|
|
2852
2851
|
result: {
|
|
2853
2852
|
typeCode: chatMessage.typeCode,
|
|
2854
2853
|
message: message
|
|
2855
|
-
}
|
|
2854
|
+
},
|
|
2855
|
+
uniqueId: uniqueId
|
|
2856
2856
|
});
|
|
2857
2857
|
|
|
2858
2858
|
if (message.pinned) {
|
|
@@ -9332,6 +9332,7 @@ function Chat(params) {
|
|
|
9332
9332
|
}; // janus and kurento
|
|
9333
9333
|
|
|
9334
9334
|
|
|
9335
|
+
publicized.replaceVideoStream = callModule.replaceVideoStream;
|
|
9335
9336
|
publicized.getDevicesList = callModule.getDevicesList; // get all devices list
|
|
9336
9337
|
|
|
9337
9338
|
publicized.changeMediaDevice = callModule.changeMediaDevice; //mic camera speaker
|
|
@@ -9377,6 +9378,8 @@ function Chat(params) {
|
|
|
9377
9378
|
publicized.currentCall = callModule.currentCall;
|
|
9378
9379
|
publicized.inquiryCallParticipants = callModule.inquiryCallParticipants;
|
|
9379
9380
|
publicized.resetCallStream = callModule.resetCallStream;
|
|
9381
|
+
publicized.raiseHand = callModule.raiseHand;
|
|
9382
|
+
publicized.lowerHand = callModule.lowerHand;
|
|
9380
9383
|
|
|
9381
9384
|
publicized.getMutualGroups = function (params, callback) {
|
|
9382
9385
|
var count = +params.count ? +params.count : 25,
|