podchat-browser 12.9.16-snapshot.0 → 12.9.16
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/changelog.md +12 -0
- package/dist/node/buildConfig.json +1 -1
- package/dist/node/call.module.js +187 -35
- package/dist/node/chat.js +36 -63
- package/dist/node/deprecateMethods.js +5 -0
- 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 +71 -3
- package/dist/node/lib/constants.js +3 -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 +450 -168
- package/examples/index.html +50 -11
- package/package.json +2 -2
- package/src/buildConfig.json +1 -1
- package/src/call.module.js +178 -33
- package/src/chat.js +30 -59
- package/src/deprecateMethods.js +5 -0
- 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 +77 -6
- package/src/lib/constants.js +3 -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
package/changelog.md
CHANGED
|
@@ -5,6 +5,18 @@ to see complete list of changelog please visit [ChangeLog](http://gp.fanapsoft.i
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [12.9.16] 07-01-2024
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Added event THREAD_PARTICIPANT_JOIN for type 39 (joinPublicThread)
|
|
12
|
+
- Added method to let client change stream in sdk
|
|
13
|
+
- Added uniqueId to all important call events (multitrack)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Added stream to grantUserMediaDevicesPermissions callback result
|
|
17
|
+
- Changed multitrack video to get video width from config
|
|
18
|
+
- Added deprecation warning in method changeActiveTypeCode
|
|
19
|
+
|
|
8
20
|
## [12.9.15] 04-12-2024
|
|
9
21
|
|
|
10
22
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"12.9.16
|
|
1
|
+
{"version":"12.9.16","date":"۱۴۰۳/۱۰/۱۸","VersionInfo":"Release: true, Snapshot: false, Is For Test: false"}
|
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
|
/**
|
|
@@ -2064,6 +2064,8 @@ function Chat(params) {
|
|
|
2064
2064
|
case _constants.chatMessageVOTypes.CALL_STICKER_SYSTEM_MESSAGE:
|
|
2065
2065
|
case _constants.chatMessageVOTypes.INQUIRY_CALL:
|
|
2066
2066
|
case _constants.chatMessageVOTypes.CALL_RECORDING_FAILED:
|
|
2067
|
+
case _constants.chatMessageVOTypes.RAISE_HAND:
|
|
2068
|
+
case _constants.chatMessageVOTypes.LOWER_HAND:
|
|
2067
2069
|
callModule.handleChatMessages(chatMessage, type, messageContent, contentCount, threadId, uniqueId);
|
|
2068
2070
|
break;
|
|
2069
2071
|
|
|
@@ -2621,6 +2623,14 @@ function Chat(params) {
|
|
|
2621
2623
|
reactionsMethods.onGetThreadAllowedReactions(uniqueId, threadId, messageContent);
|
|
2622
2624
|
break;
|
|
2623
2625
|
|
|
2626
|
+
/**
|
|
2627
|
+
* Type 256 GET_HISTORY_BY_MESSAGE_ID_RANGE
|
|
2628
|
+
*/
|
|
2629
|
+
|
|
2630
|
+
case _constants.chatMessageVOTypes.GET_HISTORY_BY_MESSAGE_ID_RANGE:
|
|
2631
|
+
app.threadHistory.onGetHistoryByMessageIdRange(uniqueId, threadId, messageContent, chatMessage);
|
|
2632
|
+
break;
|
|
2633
|
+
|
|
2624
2634
|
/**
|
|
2625
2635
|
* Type 999 All unknown errors
|
|
2626
2636
|
*/
|
|
@@ -2637,13 +2647,13 @@ function Chat(params) {
|
|
|
2637
2647
|
* If error code is 21, Token is invalid &
|
|
2638
2648
|
* user should logged out
|
|
2639
2649
|
*/
|
|
2650
|
+
//if (messageContent.code === 21) {
|
|
2651
|
+
// TODO: Temporarily removed due to unknown side-effects
|
|
2652
|
+
// app.messenger.chatState = false;
|
|
2653
|
+
// asyncClient.logout();
|
|
2654
|
+
// clearChatServerCaches();
|
|
2655
|
+
//}
|
|
2640
2656
|
|
|
2641
|
-
|
|
2642
|
-
if (messageContent.code === 21) {// TODO: Temporarily removed due to unknown side-effects
|
|
2643
|
-
// app.messenger.chatState = false;
|
|
2644
|
-
// asyncClient.logout();
|
|
2645
|
-
// clearChatServerCaches();
|
|
2646
|
-
}
|
|
2647
2657
|
/* If the error code is 208, so the user
|
|
2648
2658
|
* has been blocked cause of spam activity
|
|
2649
2659
|
*/
|
|
@@ -2764,7 +2774,7 @@ function Chat(params) {
|
|
|
2764
2774
|
*
|
|
2765
2775
|
* @return {undefined}
|
|
2766
2776
|
*/
|
|
2767
|
-
newMessageHandler = function newMessageHandler(threadId, messageContent, chatMessage) {
|
|
2777
|
+
newMessageHandler = function newMessageHandler(threadId, messageContent, chatMessage, uniqueId) {
|
|
2768
2778
|
var message = (0, _dataFormatters.formatDataToMakeMessage)(threadId, messageContent);
|
|
2769
2779
|
var threadObject = message.conversation;
|
|
2770
2780
|
var lastMessageVoCopy = Object.assign({}, message);
|
|
@@ -2784,7 +2794,8 @@ function Chat(params) {
|
|
|
2784
2794
|
result: {
|
|
2785
2795
|
typeCode: chatMessage.typeCode,
|
|
2786
2796
|
message: stringMsg
|
|
2787
|
-
}
|
|
2797
|
+
},
|
|
2798
|
+
uniqueId: uniqueId
|
|
2788
2799
|
});
|
|
2789
2800
|
app.chatEvents.fireEvent('threadEvents', {
|
|
2790
2801
|
type: 'THREAD_UNREAD_COUNT_UPDATED',
|
|
@@ -2798,19 +2809,10 @@ function Chat(params) {
|
|
|
2798
2809
|
if (!storeThread) {
|
|
2799
2810
|
app.store.threads.save(threadObject);
|
|
2800
2811
|
storeThread = app.store.threads.get(threadObject.id);
|
|
2801
|
-
}
|
|
2802
|
-
// app.store.threads.get(threadObject.id).unreadCount.set();
|
|
2803
|
-
|
|
2812
|
+
}
|
|
2804
2813
|
|
|
2805
2814
|
if (message.ownerId != app.store.user.get().id) {
|
|
2806
|
-
if (!storeThread.unreadCount.get()) storeThread.unreadCount.set(1);else storeThread.unreadCount.increase();
|
|
2807
|
-
// storeThread.unreadCount.set(unreadCount);
|
|
2808
|
-
// } else {
|
|
2809
|
-
// if(!storeThread.unreadCount.get())
|
|
2810
|
-
// storeThread.unreadCount.set(1);
|
|
2811
|
-
// else
|
|
2812
|
-
// storeThread.unreadCount.increase();
|
|
2813
|
-
// }
|
|
2815
|
+
if (!storeThread.unreadCount.get()) storeThread.unreadCount.set(1);else storeThread.unreadCount.increase();
|
|
2814
2816
|
} else {
|
|
2815
2817
|
storeThread.unreadCount.set(0);
|
|
2816
2818
|
}
|
|
@@ -2820,45 +2822,7 @@ function Chat(params) {
|
|
|
2820
2822
|
result: {
|
|
2821
2823
|
thread: threadObject
|
|
2822
2824
|
}
|
|
2823
|
-
});
|
|
2824
|
-
// getThreads({
|
|
2825
|
-
// threadIds: [threadId]
|
|
2826
|
-
// }, function (threadsResult) {
|
|
2827
|
-
// var threads = threadsResult.result.threads;
|
|
2828
|
-
//
|
|
2829
|
-
// app.chatEvents.fireEvent('threadEvents', {
|
|
2830
|
-
// type: 'THREAD_UNREAD_COUNT_UPDATED',
|
|
2831
|
-
// result: {
|
|
2832
|
-
// thread: threads[0],
|
|
2833
|
-
// unreadCount: (threads[0].unreadCount) ? threads[0].unreadCount : 0
|
|
2834
|
-
// }
|
|
2835
|
-
// });
|
|
2836
|
-
//
|
|
2837
|
-
// app.chatEvents.fireEvent('threadEvents', {
|
|
2838
|
-
// type: 'THREAD_LAST_ACTIVITY_TIME',
|
|
2839
|
-
// result: {
|
|
2840
|
-
// thread: threads[0]
|
|
2841
|
-
// }
|
|
2842
|
-
// });
|
|
2843
|
-
//
|
|
2844
|
-
// });
|
|
2845
|
-
// } else {
|
|
2846
|
-
// app.chatEvents.fireEvent('threadEvents', {
|
|
2847
|
-
// type: 'THREAD_LAST_ACTIVITY_TIME',
|
|
2848
|
-
// result: {
|
|
2849
|
-
// thread: threadId
|
|
2850
|
-
// }
|
|
2851
|
-
// });
|
|
2852
|
-
//
|
|
2853
|
-
// app.chatEvents.fireEvent('threadEvents', {
|
|
2854
|
-
// type: 'THREAD_UNREAD_COUNT_UPDATED',
|
|
2855
|
-
// result: {
|
|
2856
|
-
// thread: messageContent.id,
|
|
2857
|
-
// unreadCount: (messageContent.conversation.unreadCount) ? messageContent.conversation.unreadCount : 0
|
|
2858
|
-
// }
|
|
2859
|
-
// });
|
|
2860
|
-
// }
|
|
2861
|
-
|
|
2825
|
+
});
|
|
2862
2826
|
/**
|
|
2863
2827
|
* Update waitQ and remove sent messages from it
|
|
2864
2828
|
*/
|
|
@@ -2878,7 +2842,7 @@ function Chat(params) {
|
|
|
2878
2842
|
*
|
|
2879
2843
|
* @return {undefined}
|
|
2880
2844
|
*/
|
|
2881
|
-
chatEditMessageHandler = function chatEditMessageHandler(threadId, messageContent, chatMessage, typeCode) {
|
|
2845
|
+
chatEditMessageHandler = function chatEditMessageHandler(threadId, messageContent, chatMessage, typeCode, uniqueId) {
|
|
2882
2846
|
var message = (0, _dataFormatters.formatDataToMakeMessage)(threadId, messageContent);
|
|
2883
2847
|
app.store.history.saveMessage(threadId, message);
|
|
2884
2848
|
|
|
@@ -2895,7 +2859,8 @@ function Chat(params) {
|
|
|
2895
2859
|
result: {
|
|
2896
2860
|
typeCode: chatMessage.typeCode,
|
|
2897
2861
|
message: message
|
|
2898
|
-
}
|
|
2862
|
+
},
|
|
2863
|
+
uniqueId: uniqueId
|
|
2899
2864
|
});
|
|
2900
2865
|
|
|
2901
2866
|
if (message.pinned) {
|
|
@@ -6036,6 +6001,10 @@ function Chat(params) {
|
|
|
6036
6001
|
return app.threadHistory.getHistory(params, callback);
|
|
6037
6002
|
};
|
|
6038
6003
|
|
|
6004
|
+
publicized.getHistoryByMessageIdRange = function (params, callback) {
|
|
6005
|
+
return app.threadHistory.getHistoryByMessageIdRange(params, callback);
|
|
6006
|
+
};
|
|
6007
|
+
|
|
6039
6008
|
publicized.getAllMentionedMessages = function (params, callback) {
|
|
6040
6009
|
return app.threadHistory.getHistory({
|
|
6041
6010
|
threadId: params.threadId,
|
|
@@ -9375,6 +9344,7 @@ function Chat(params) {
|
|
|
9375
9344
|
}; // janus and kurento
|
|
9376
9345
|
|
|
9377
9346
|
|
|
9347
|
+
publicized.replaceVideoStream = callModule.replaceVideoStream;
|
|
9378
9348
|
publicized.getDevicesList = callModule.getDevicesList; // get all devices list
|
|
9379
9349
|
|
|
9380
9350
|
publicized.changeMediaDevice = callModule.changeMediaDevice; //mic camera speaker
|
|
@@ -9420,6 +9390,8 @@ function Chat(params) {
|
|
|
9420
9390
|
publicized.currentCall = callModule.currentCall;
|
|
9421
9391
|
publicized.inquiryCallParticipants = callModule.inquiryCallParticipants;
|
|
9422
9392
|
publicized.resetCallStream = callModule.resetCallStream;
|
|
9393
|
+
publicized.raiseHand = callModule.raiseHand;
|
|
9394
|
+
publicized.lowerHand = callModule.lowerHand;
|
|
9423
9395
|
|
|
9424
9396
|
publicized.getMutualGroups = function (params, callback) {
|
|
9425
9397
|
var count = +params.count ? +params.count : 25,
|
|
@@ -9906,6 +9878,7 @@ function Chat(params) {
|
|
|
9906
9878
|
publicized.removeRoleFromUser = removeRoleFromUser;
|
|
9907
9879
|
|
|
9908
9880
|
publicized.changeActiveTypeCode = function (typeCode) {
|
|
9881
|
+
(0, _deprecateMethods.printIsDeprecate)(_deprecateMethods.deprecatedString.changeActiveTypeCode.methodName);
|
|
9909
9882
|
app.typeCodes.setActiveTypeCode(typeCode);
|
|
9910
9883
|
};
|
|
9911
9884
|
|
|
@@ -70,6 +70,11 @@ var deprecatedString = {
|
|
|
70
70
|
deprecationDate: "21/5/2024",
|
|
71
71
|
methodName: "getMessageDeliveredList",
|
|
72
72
|
replacementString: ""
|
|
73
|
+
},
|
|
74
|
+
changeActiveTypeCode: {
|
|
75
|
+
deprecationDate: "5/1/2024",
|
|
76
|
+
methodName: "changeActiveTypeCode",
|
|
77
|
+
replacementString: ""
|
|
73
78
|
}
|
|
74
79
|
};
|
|
75
80
|
exports.deprecatedString = deprecatedString;
|