@flashphoner/sfusdk 2.0.279 → 2.0.284
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/client.version +1 -1
- package/dist/sdk/constants.d.ts +79 -42
- package/dist/sdk/constants.js +34 -18
- package/dist/sdk/constants.js.map +1 -1
- package/dist/sdk/sfu-extended.d.ts +73 -36
- package/dist/sdk/sfu-extended.js +148 -54
- package/dist/sdk/sfu-extended.js.map +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/sfu_extended.SfuExtended.html +116 -88
- package/docs/enums/constants.AttachmentState.html +2 -2
- package/docs/enums/constants.AuthenticationStatus.html +2 -2
- package/docs/enums/constants.ChannelSendPolicy.html +2 -2
- package/docs/enums/constants.ChatError.html +2 -2
- package/docs/enums/constants.ChatReceivePolicy.html +2 -2
- package/docs/enums/constants.ChatSectionsError.html +2 -2
- package/docs/enums/constants.ChatType.html +2 -2
- package/docs/enums/constants.ConferenceType.html +2 -2
- package/docs/enums/constants.ConnectionType.html +2 -2
- package/docs/enums/constants.ContactError.html +2 -2
- package/docs/enums/constants.DeliveryStatus.html +2 -2
- package/docs/enums/constants.InternalApi.html +10 -5
- package/docs/enums/constants.MeetingSyncEvent.html +10 -10
- package/docs/enums/constants.MessageAttachmentMediaType.html +2 -2
- package/docs/enums/constants.MessageAttachmentType.html +2 -2
- package/docs/enums/constants.MessageState.html +2 -2
- package/docs/enums/constants.MessageTargetEntityType.html +2 -2
- package/docs/enums/constants.Operations.html +2 -2
- package/docs/enums/constants.ParticipantRole.html +2 -2
- package/docs/enums/constants.PresenceStatus.html +5 -0
- package/docs/enums/constants.RemoteSdpType.html +2 -2
- package/docs/enums/constants.RoomError.html +2 -2
- package/docs/enums/constants.RoomEvent.html +42 -42
- package/docs/enums/constants.RoomState.html +2 -2
- package/docs/enums/constants.SfuEvent.html +53 -43
- package/docs/enums/constants.SortOrder.html +2 -2
- package/docs/enums/constants.SpaceError.html +2 -2
- package/docs/enums/constants.SpaceEvent.html +26 -26
- package/docs/enums/constants.State.html +2 -2
- package/docs/enums/constants.StatsType.html +2 -2
- package/docs/enums/constants.TrackType.html +2 -2
- package/docs/enums/constants.UserInfoError.html +2 -2
- package/docs/enums/constants.UserManagementError.html +2 -2
- package/docs/modules/constants.html +12 -7
- package/docs/types/constants.AddRemoveTracks.html +1 -1
- package/docs/types/constants.AddRemoveTracksSync.html +1 -1
- package/docs/types/constants.AddedRoleToMember.html +1 -1
- package/docs/types/constants.Attachment.html +1 -1
- package/docs/types/constants.AttachmentInfo.html +1 -1
- package/docs/types/constants.AttachmentRequest.html +1 -1
- package/docs/types/constants.AttachmentRequestAck.html +1 -1
- package/docs/types/constants.AttachmentStatus.html +1 -1
- package/docs/types/constants.AttachmentStatusEvent.html +1 -1
- package/docs/types/constants.AuthenticationStatusEvent.html +1 -1
- package/docs/types/constants.BannedContact.html +1 -0
- package/docs/types/constants.BitrateTestStatus.html +1 -1
- package/docs/types/constants.BooleanEvent.html +1 -1
- package/docs/types/constants.Calendar.html +1 -1
- package/docs/types/constants.CalendarEvent.html +1 -1
- package/docs/types/constants.CalendarEventEvent.html +1 -1
- package/docs/types/constants.Chat.html +1 -1
- package/docs/types/constants.ChatLoadedEvent.html +1 -1
- package/docs/types/constants.ChatMap.html +1 -1
- package/docs/types/constants.ChatMessagesCount.html +1 -1
- package/docs/types/constants.ChatMessagesEvent.html +1 -1
- package/docs/types/constants.ChatSearchResultEvent.html +1 -1
- package/docs/types/constants.ChatsEvent.html +1 -1
- package/docs/types/constants.ConnectionDetails.html +1 -1
- package/docs/types/constants.ConnectionFailedEvent.html +1 -1
- package/docs/types/constants.Contact.html +1 -0
- package/docs/types/constants.ContactDeleted.html +1 -0
- package/docs/types/constants.ContactUpdated.html +1 -0
- package/docs/types/constants.ControlMessage.html +1 -1
- package/docs/types/constants.ControlMessageEvent.html +1 -1
- package/docs/types/constants.CreatedRoom.html +1 -1
- package/docs/types/constants.EvictedFromRoom.html +1 -1
- package/docs/types/constants.EvictedSync.html +1 -1
- package/docs/types/constants.FirstAndLastChatMessage.html +1 -1
- package/docs/types/constants.FragmentedMessage.html +1 -1
- package/docs/types/constants.FriendInvite.html +1 -0
- package/docs/types/constants.FriendInviteDeleted.html +1 -0
- package/docs/types/constants.InternalMessage.html +1 -1
- package/docs/types/constants.JoinedRoom.html +1 -1
- package/docs/types/constants.JoinedRoomSync.html +1 -1
- package/docs/types/constants.LastReadMessageUpdate.html +1 -1
- package/docs/types/constants.LastReadMessageUpdated.html +1 -1
- package/docs/types/constants.LeftMeetingSync.html +1 -1
- package/docs/types/constants.LeftRoom.html +1 -1
- package/docs/types/constants.LoadMessagesWithMentionsResult.html +1 -1
- package/docs/types/constants.MeetingEndedSync.html +1 -1
- package/docs/types/constants.MeetingNameUpdatedSync.html +1 -1
- package/docs/types/constants.MeetingsPreviewEvent.html +1 -1
- package/docs/types/constants.Message.html +1 -1
- package/docs/types/constants.MessageAttachment.html +1 -1
- package/docs/types/constants.MessageAttachmentData.html +1 -1
- package/docs/types/constants.MessageAttachmentsSearchResult.html +1 -1
- package/docs/types/constants.MessageDeleted.html +1 -1
- package/docs/types/constants.MessageDeliveryStatus.html +1 -1
- package/docs/types/constants.MessageEdited.html +1 -1
- package/docs/types/constants.MessageInfo.html +1 -1
- package/docs/types/constants.MessageStatus.html +1 -1
- package/docs/types/constants.MessageStatusEvent.html +1 -1
- package/docs/types/constants.MessageStatusUpdate.html +1 -1
- package/docs/types/constants.MessageTargetEntityId.html +1 -1
- package/docs/types/constants.MessageWithUploadingAttachments.html +1 -1
- package/docs/types/constants.NewChatEvent.html +1 -1
- package/docs/types/constants.NewContact.html +1 -0
- package/docs/types/constants.NewFriendInvite.html +1 -0
- package/docs/types/constants.NewMeeting.html +1 -1
- package/docs/types/constants.NewSpaceCategoryEvent.html +1 -1
- package/docs/types/constants.NewSpaceChannelEvent.html +1 -1
- package/docs/types/constants.NewSpaceEvent.html +1 -1
- package/docs/types/constants.NewSpaceRoleAdded.html +1 -1
- package/docs/types/constants.NewSpaceThreadEvent.html +1 -1
- package/docs/types/constants.OperationFailed.html +1 -1
- package/docs/types/constants.OperationFailedEvent.html +1 -1
- package/docs/types/constants.Participant.html +1 -1
- package/docs/types/constants.ParticipantAVSMutedEvent.html +1 -1
- package/docs/types/constants.ParticipantConfigEvent.html +1 -1
- package/docs/types/constants.ParticipantRenamed.html +1 -1
- package/docs/types/constants.ParticipantsListEvent.html +1 -1
- package/docs/types/constants.ParticipantsListSyncEvent.html +1 -1
- package/docs/types/constants.PlacedInLobbyEvent.html +1 -1
- package/docs/types/constants.PlacedInWaitingRoomEvent.html +1 -1
- package/docs/types/constants.PublicChannelsEvent.html +1 -1
- package/docs/types/constants.Quality.html +1 -1
- package/docs/types/constants.RemoteSdp.html +1 -1
- package/docs/types/constants.RemoteSdpInfo.html +1 -1
- package/docs/types/constants.RemovedChatEvent.html +1 -1
- package/docs/types/constants.RemovedRoleFromMember.html +1 -1
- package/docs/types/constants.ResetPasswordRequestStatus.html +1 -1
- package/docs/types/constants.RoleAssigned.html +1 -1
- package/docs/types/constants.RolePermissionSectionsEvent.html +1 -1
- package/docs/types/constants.RolesListEvent.html +1 -1
- package/docs/types/constants.RoomAvailable.html +1 -1
- package/docs/types/constants.RoomConfigEvent.html +1 -1
- package/docs/types/constants.RoomExtendedConfig.html +1 -1
- package/docs/types/constants.RoomExtendedParticipantConfig.html +1 -1
- package/docs/types/constants.RoomExtendedParticipantsConfig.html +1 -1
- package/docs/types/constants.RoomExtendedScreenSharingConfig.html +1 -1
- package/docs/types/constants.RoomInfo.html +1 -1
- package/docs/types/constants.RoomMessage.html +1 -1
- package/docs/types/constants.RoomNameUpdated.html +1 -1
- package/docs/types/constants.RoomScreenSharingConfigEvent.html +1 -1
- package/docs/types/constants.SFUMeetingParticipantPreview.html +1 -1
- package/docs/types/constants.SFUMeetingPreview.html +1 -1
- package/docs/types/constants.SfuMessageEvent.html +1 -1
- package/docs/types/constants.SfuSpace.html +1 -1
- package/docs/types/constants.SfuSpaceCategory.html +1 -1
- package/docs/types/constants.SfuSpaceChannel.html +1 -1
- package/docs/types/constants.SfuSpaceChannelAccessRights.html +1 -1
- package/docs/types/constants.SfuSpaceInvite.html +1 -1
- package/docs/types/constants.SfuSpaceMember.html +1 -1
- package/docs/types/constants.SfuSpaceRole.html +1 -1
- package/docs/types/constants.SfuSpaceRolePermission.html +1 -1
- package/docs/types/constants.SfuSpaceRolePermissionSection.html +1 -1
- package/docs/types/constants.SfuSpaceThread.html +1 -1
- package/docs/types/constants.SfuSpaceUserBan.html +1 -1
- package/docs/types/constants.SignUpStatus.html +1 -1
- package/docs/types/constants.SpaceCategoryDeleted.html +1 -1
- package/docs/types/constants.SpaceCategoryUpdated.html +1 -1
- package/docs/types/constants.SpaceChannelDeleted.html +1 -1
- package/docs/types/constants.SpaceChannelMoved.html +1 -1
- package/docs/types/constants.SpaceChannelUpdated.html +1 -1
- package/docs/types/constants.SpaceCreatedEvent.html +1 -1
- package/docs/types/constants.SpaceDeletedEvent.html +1 -1
- package/docs/types/constants.SpaceInviteCreated.html +1 -1
- package/docs/types/constants.SpaceInviteRevoked.html +1 -1
- package/docs/types/constants.SpaceOverviewUpdated.html +1 -1
- package/docs/types/constants.SpaceRoleDeleted.html +1 -1
- package/docs/types/constants.SpaceRoleUpdated.html +1 -1
- package/docs/types/constants.SpaceThreadDeleted.html +1 -1
- package/docs/types/constants.SpaceThreadUpdated.html +1 -1
- package/docs/types/constants.StopScreenSharingEvent.html +1 -1
- package/docs/types/constants.StopTrackEvent.html +1 -1
- package/docs/types/constants.TracksQualityState.html +1 -1
- package/docs/types/constants.UnreadMessagesCountEvent.html +1 -1
- package/docs/types/constants.UnreadMessagesCountUpdate.html +1 -1
- package/docs/types/constants.UpdateChatEvent.html +1 -1
- package/docs/types/constants.UpdateMessagesDeliveryStatusEvent.html +1 -1
- package/docs/types/constants.UploadingAttachmentInfo.html +1 -1
- package/docs/types/constants.UserCalendarEvent.html +1 -1
- package/docs/types/constants.UserContacts.html +1 -0
- package/docs/types/constants.UserContactsEvent.html +1 -0
- package/docs/types/constants.UserEmail.html +1 -1
- package/docs/types/constants.UserHostKey.html +1 -1
- package/docs/types/constants.UserHostKeyChangedEvent.html +1 -1
- package/docs/types/constants.UserId.html +1 -1
- package/docs/types/constants.UserInfo.html +1 -1
- package/docs/types/constants.UserInfoChangedEvent.html +1 -1
- package/docs/types/constants.UserInfoEvent.html +1 -1
- package/docs/types/constants.UserJoinedToSpaceEvent.html +1 -1
- package/docs/types/constants.UserLeftSpace.html +1 -1
- package/docs/types/constants.UserNickname.html +1 -1
- package/docs/types/constants.UserNicknameChangedEvent.html +1 -1
- package/docs/types/constants.UserPassword.html +1 -1
- package/docs/types/constants.UserPhoneNumber.html +1 -1
- package/docs/types/constants.UserPhoneNumberChangedEvent.html +1 -1
- package/docs/types/constants.UserPmiSettings.html +1 -1
- package/docs/types/constants.UserPresenceStatusUpdated.html +1 -0
- package/docs/types/constants.UserRoomsEvent.html +1 -1
- package/docs/types/constants.UserSpacesEvent.html +1 -1
- package/docs/types/constants.UserSpecificChatInfo.html +1 -1
- package/docs/types/constants.UserTimezone.html +1 -1
- package/docs/types/constants.UserTimezoneChangedEvent.html +1 -1
- package/docs/types/constants.WaitingListEvent.html +1 -1
- package/docs/types/constants.WaitingParticipant.html +1 -1
- package/docs/types/constants.WaitingRoomUpdate.html +1 -1
- package/docs/variables/constants.ATTACHMENT_CHUNK_SIZE.html +1 -1
- package/docs/variables/constants.ATTACHMENT_ID_LENGTH.html +1 -1
- package/docs/variables/constants.WS_CONNECTION_TIMEOUT.html +1 -1
- package/docs/variables/constants.WS_PINGS_MISSING_THRESHOLD.html +1 -1
- package/docs/variables/constants.WS_PING_INTERVAL_MS.html +1 -1
- package/package.json +1 -1
- package/docs/enums/constants.UserState.html +0 -4
- package/docs/types/constants.ContactInviteEvent.html +0 -1
- package/docs/types/constants.ContactRemovedEvent.html +0 -1
- package/docs/types/constants.ContactUpdateEvent.html +0 -1
- package/docs/types/constants.Invite.html +0 -1
- package/docs/types/constants.User.html +0 -1
- package/docs/types/constants.UserListEvent.html +0 -1
package/dist/sdk/sfu-extended.js
CHANGED
|
@@ -95,6 +95,8 @@ class SfuExtended {
|
|
|
95
95
|
* @param options.username - The user's username (optional if `authToken` is provided).
|
|
96
96
|
* @param options.password - The user's password (optional if `authToken` is provided).
|
|
97
97
|
* @param options.authToken - The authentication token for direct login (optional if `username` and `password` are provided).
|
|
98
|
+
*
|
|
99
|
+
* After successfully connection user contacts will receive an {@link SfuEvent.USER_PRESENCE_STATUS_UPDATED} with {@link UserPresenceStatusUpdated}
|
|
98
100
|
*/
|
|
99
101
|
connect(options) {
|
|
100
102
|
if (!options) {
|
|
@@ -147,6 +149,8 @@ class SfuExtended {
|
|
|
147
149
|
* When disconnecting, user leaves all active rooms
|
|
148
150
|
*
|
|
149
151
|
* {@link state} changed to {@link State.DISCONNECTED | DISCONNECTED}
|
|
152
|
+
*
|
|
153
|
+
* After disconnection user contacts will receive an {@link SfuEvent.USER_PRESENCE_STATUS_UPDATED} with {@link UserPresenceStatusUpdated}
|
|
150
154
|
*/
|
|
151
155
|
disconnect() {
|
|
152
156
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -752,84 +756,100 @@ class SfuExtended {
|
|
|
752
756
|
});
|
|
753
757
|
}
|
|
754
758
|
/**
|
|
755
|
-
* Get
|
|
759
|
+
* Get user contacts.
|
|
760
|
+
*
|
|
761
|
+
* Returns users who are friends or with whom there are mutual space channels or direct chats, incoming and outgoing friend invites, banned users.
|
|
756
762
|
*/
|
|
757
|
-
|
|
763
|
+
getContacts() {
|
|
758
764
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
759
765
|
const self = this;
|
|
760
766
|
return new Promise(function (resolve, reject) {
|
|
761
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
767
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_CONTACTS, {}, resolve, reject);
|
|
762
768
|
});
|
|
763
769
|
}
|
|
764
770
|
;
|
|
765
771
|
/**
|
|
766
|
-
*
|
|
772
|
+
* Add a friend
|
|
767
773
|
*
|
|
768
|
-
*
|
|
774
|
+
* Sends a friend invite.
|
|
775
|
+
* Users will receive {@link SfuEvent.NEW_OUTGOING_FRIEND_INVITE} and {@link SfuEvent.NEW_INCOMING_FRIEND_INVITE} with {@link NewFriendInvite}.
|
|
769
776
|
*
|
|
770
|
-
*
|
|
777
|
+
* If an invite was sent to this user previously, it will be replaced with a new one.
|
|
778
|
+
* Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted} for previously invite.
|
|
779
|
+
* Users will receive {@link SfuEvent.NEW_OUTGOING_FRIEND_INVITE} and {@link SfuEvent.NEW_INCOMING_FRIEND_INVITE} with {@link NewFriendInvite} for new friend invite.
|
|
780
|
+
*
|
|
781
|
+
* If the user that you are trying to add as a friend has already sent you an invite, sending a counter-invite will automatically add you as friends.
|
|
782
|
+
* Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted} for invites.
|
|
783
|
+
* Users will receive {@link SfuEvent.CONTACT_UPDATED} with {@link ContactUpdated} if they have mutual space channels or direct chats.
|
|
784
|
+
* Will receive {@link SfuEvent.NEW_CONTACT} with {@link NewContact} if haven't.
|
|
771
785
|
*/
|
|
772
|
-
|
|
786
|
+
addFriend(user) {
|
|
773
787
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
774
788
|
const self = this;
|
|
775
789
|
return new Promise(function (resolve, reject) {
|
|
776
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
790
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_FRIEND, {
|
|
791
|
+
userId: user.userId,
|
|
792
|
+
}, resolve, reject);
|
|
777
793
|
});
|
|
778
794
|
}
|
|
779
795
|
/**
|
|
780
|
-
*
|
|
796
|
+
* Remove friend
|
|
781
797
|
*
|
|
782
|
-
* {@link
|
|
798
|
+
* Users will receive {@link SfuEvent.CONTACT_UPDATED} with {@link ContactUpdated} if they have mutual space channels or direct chats.
|
|
799
|
+
* Will receive {@link SfuEvent.CONTACT_DELETED} with {@link ContactDeleted} if haven't.
|
|
783
800
|
*/
|
|
784
|
-
|
|
801
|
+
removeFriend(friend) {
|
|
785
802
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
786
803
|
const self = this;
|
|
787
804
|
return new Promise(function (resolve, reject) {
|
|
788
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
805
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_FRIEND, {
|
|
806
|
+
userId: friend.userId,
|
|
807
|
+
}, resolve, reject);
|
|
789
808
|
});
|
|
790
809
|
}
|
|
791
810
|
/**
|
|
792
|
-
*
|
|
811
|
+
* Revoke friend invite
|
|
793
812
|
*
|
|
794
|
-
* {@link
|
|
813
|
+
* Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted}.
|
|
795
814
|
*/
|
|
796
|
-
|
|
815
|
+
revokeFriendInvite(invite) {
|
|
797
816
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
798
817
|
const self = this;
|
|
799
818
|
return new Promise(function (resolve, reject) {
|
|
800
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
819
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REVOKE_FRIEND_INVITE, {
|
|
820
|
+
inviteId: invite.inviteId,
|
|
821
|
+
}, resolve, reject);
|
|
801
822
|
});
|
|
802
823
|
}
|
|
803
824
|
/**
|
|
804
|
-
*
|
|
805
|
-
*
|
|
806
|
-
* {@link User.confirmed} will be changed to true for both users.
|
|
825
|
+
* Accept friend invite
|
|
807
826
|
*
|
|
808
|
-
*
|
|
827
|
+
* Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted} for invites.
|
|
828
|
+
* Users will receive {@link SfuEvent.CONTACT_UPDATED} with {@link ContactUpdated} if they have mutual space channels or direct chats.
|
|
829
|
+
* Will receive {@link SfuEvent.NEW_CONTACT} with {@link NewContact} if haven't.
|
|
809
830
|
*/
|
|
810
|
-
|
|
831
|
+
acceptFriendInvite(invite) {
|
|
811
832
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
812
833
|
const self = this;
|
|
813
834
|
return new Promise(function (resolve, reject) {
|
|
814
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
815
|
-
|
|
816
|
-
to: invite.to,
|
|
817
|
-
id: invite.id
|
|
835
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ACCEPT_FRIEND_INVITE, {
|
|
836
|
+
inviteId: invite.inviteId,
|
|
818
837
|
}, resolve, reject);
|
|
819
838
|
});
|
|
820
839
|
}
|
|
821
840
|
/**
|
|
822
|
-
*
|
|
841
|
+
* Reject friend invite
|
|
823
842
|
*
|
|
824
|
-
* {@link
|
|
825
|
-
*
|
|
826
|
-
* @param contact.id - user with that userId will receive {@link SfuEvent.CONTACT_REMOVED} with {@link User}
|
|
843
|
+
* Promise will resolve with {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted}.
|
|
844
|
+
* Outgoing friend invite will not delete.
|
|
827
845
|
*/
|
|
828
|
-
|
|
846
|
+
rejectFriendInvite(invite) {
|
|
829
847
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
830
848
|
const self = this;
|
|
831
849
|
return new Promise(function (resolve, reject) {
|
|
832
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
850
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REJECT_FRIEND_INVITE, {
|
|
851
|
+
inviteId: invite.inviteId,
|
|
852
|
+
}, resolve, reject);
|
|
833
853
|
});
|
|
834
854
|
}
|
|
835
855
|
/**
|
|
@@ -989,6 +1009,49 @@ class SfuExtended {
|
|
|
989
1009
|
});
|
|
990
1010
|
}
|
|
991
1011
|
;
|
|
1012
|
+
/**
|
|
1013
|
+
* Update presence status
|
|
1014
|
+
*
|
|
1015
|
+
* Friends and users with whom there are mutual space channels or direct chats will receive {@link SfuEvent.USER_PRESENCE_STATUS_UPDATED} with {@link UserPresenceStatusUpdated}.
|
|
1016
|
+
* The selected status is saved and will persist across subsequent connects. It can be retrieved using the {@link getUserInfo}.
|
|
1017
|
+
*/
|
|
1018
|
+
updatePresenceStatus(status) {
|
|
1019
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1020
|
+
const self = this;
|
|
1021
|
+
return new Promise(function (resolve, reject) {
|
|
1022
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_PRESENCE_STATUS, {
|
|
1023
|
+
status: status
|
|
1024
|
+
}, resolve, reject);
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
1027
|
+
;
|
|
1028
|
+
/**
|
|
1029
|
+
* Update user activity
|
|
1030
|
+
*
|
|
1031
|
+
* Working with selected {@link PresenceStatus.ONLINE} by {@link updatePresenceStatus}.
|
|
1032
|
+
* Does not work with other statuses.
|
|
1033
|
+
*
|
|
1034
|
+
* The user client that called this method will receive {@link UserInfoChangedEvent} with {@link PresenceStatus.ONLINE} or {@link PresenceStatus.IDLE}.
|
|
1035
|
+
* Other user clients will not receive events.
|
|
1036
|
+
*
|
|
1037
|
+
* {@param isActive} = false:
|
|
1038
|
+
* If the user hasn't other connected active clients then user contacts will receive {@link UserPresenceStatusUpdated} with {@link PresenceStatus.IDLE}.
|
|
1039
|
+
* If the user has other connected active clients then user contacts will not receive events.
|
|
1040
|
+
*
|
|
1041
|
+
* {@param isActive} = true:
|
|
1042
|
+
* If all user clients was inactive then user contacts will receive {@link UserPresenceStatusUpdated} with {@link PresenceStatus.ONLINE}.
|
|
1043
|
+
* If the user has at least one active connected client, then the contacts will not receive any events.
|
|
1044
|
+
*/
|
|
1045
|
+
updateActivityStatus(isActive) {
|
|
1046
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1047
|
+
const self = this;
|
|
1048
|
+
return new Promise(function (resolve, reject) {
|
|
1049
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_ACTIVITY_STATUS, {
|
|
1050
|
+
isActive
|
|
1051
|
+
}, resolve, reject);
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
;
|
|
992
1055
|
/**
|
|
993
1056
|
* @deprecated
|
|
994
1057
|
*/
|
|
@@ -1915,11 +1978,6 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
|
|
|
1915
1978
|
__classPrivateFieldGet(this, _SfuExtended_downloadingAttachmentState, "f").push(Object.assign(Object.assign({}, request), { payload: null, internalMessageId: ack.internalMessageId }));
|
|
1916
1979
|
}
|
|
1917
1980
|
}
|
|
1918
|
-
else if (data[0].type === constants_1.InternalApi.USER_LIST) {
|
|
1919
|
-
const userList = data[0];
|
|
1920
|
-
promises_1.default.resolve(data[0].internalMessageId, userList.list);
|
|
1921
|
-
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.USER_LIST, userList.list);
|
|
1922
|
-
}
|
|
1923
1981
|
else if (data[0].type === constants_1.InternalApi.USER_CALENDAR) {
|
|
1924
1982
|
const calendar = data[0];
|
|
1925
1983
|
promises_1.default.resolve(data[0].internalMessageId, calendar.calendar);
|
|
@@ -1961,24 +2019,6 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
|
|
|
1961
2019
|
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_CHAT, chatInfo.info);
|
|
1962
2020
|
}
|
|
1963
2021
|
}
|
|
1964
|
-
else if (data[0].type === constants_1.InternalApi.CONTACT_INVITE) {
|
|
1965
|
-
const invite = data[0];
|
|
1966
|
-
if (!promises_1.default.resolve(data[0].internalMessageId, invite.invite)) {
|
|
1967
|
-
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_INVITE, invite.invite);
|
|
1968
|
-
}
|
|
1969
|
-
}
|
|
1970
|
-
else if (data[0].type === constants_1.InternalApi.CONTACT_UPDATED) {
|
|
1971
|
-
const contact = data[0];
|
|
1972
|
-
if (!promises_1.default.resolve(data[0].internalMessageId, contact.contact)) {
|
|
1973
|
-
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_UPDATE, contact.contact);
|
|
1974
|
-
}
|
|
1975
|
-
}
|
|
1976
|
-
else if (data[0].type === constants_1.InternalApi.CONTACT_REMOVED) {
|
|
1977
|
-
const contact = data[0];
|
|
1978
|
-
if (!promises_1.default.resolve(data[0].internalMessageId, contact.contact)) {
|
|
1979
|
-
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_REMOVED, contact.contact);
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
2022
|
else if (data[0].type === constants_1.InternalApi.CHAT_DELETED) {
|
|
1983
2023
|
const chat = data[0];
|
|
1984
2024
|
if (!promises_1.default.resolve(data[0].internalMessageId, chat.info)) {
|
|
@@ -2386,6 +2426,60 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
|
|
|
2386
2426
|
const event = data[0];
|
|
2387
2427
|
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.MeetingSyncEvent.MEETING_NAME_UPDATED_SYNC, event);
|
|
2388
2428
|
}
|
|
2429
|
+
else if (data[0].type === constants_1.SfuEvent.USER_CONTACTS) {
|
|
2430
|
+
const event = data[0];
|
|
2431
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event.contacts)) {
|
|
2432
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.USER_CONTACTS, event);
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
else if (data[0].type === constants_1.SfuEvent.NEW_CONTACT) {
|
|
2436
|
+
const event = data[0];
|
|
2437
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event.contact)) {
|
|
2438
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_CONTACT, event);
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
else if (data[0].type === constants_1.SfuEvent.CONTACT_UPDATED) {
|
|
2442
|
+
const event = data[0];
|
|
2443
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event.contact)) {
|
|
2444
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_UPDATED, event);
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
else if (data[0].type === constants_1.SfuEvent.CONTACT_DELETED) {
|
|
2448
|
+
const event = data[0];
|
|
2449
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2450
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_DELETED, event);
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
else if (data[0].type === constants_1.SfuEvent.NEW_INCOMING_FRIEND_INVITE) {
|
|
2454
|
+
const event = data[0];
|
|
2455
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2456
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_INCOMING_FRIEND_INVITE, event);
|
|
2457
|
+
}
|
|
2458
|
+
}
|
|
2459
|
+
else if (data[0].type === constants_1.SfuEvent.NEW_OUTGOING_FRIEND_INVITE) {
|
|
2460
|
+
const event = data[0];
|
|
2461
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2462
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_OUTGOING_FRIEND_INVITE, event);
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
else if (data[0].type === constants_1.SfuEvent.INCOMING_FRIEND_INVITE_DELETED) {
|
|
2466
|
+
const event = data[0];
|
|
2467
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2468
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.INCOMING_FRIEND_INVITE_DELETED, event);
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
else if (data[0].type === constants_1.SfuEvent.OUTGOING_FRIEND_INVITE_DELETED) {
|
|
2472
|
+
const event = data[0];
|
|
2473
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2474
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.OUTGOING_FRIEND_INVITE_DELETED, event);
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
else if (data[0].type === constants_1.SfuEvent.USER_PRESENCE_STATUS_UPDATED) {
|
|
2478
|
+
const event = data[0];
|
|
2479
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2480
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.USER_PRESENCE_STATUS_UPDATED, event);
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2389
2483
|
else {
|
|
2390
2484
|
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(data[0].type, data[0]);
|
|
2391
2485
|
}
|