diff --git a/.vscode/settings.json b/.vscode/settings.json index 6889f44c..5b43834a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.insertSpaces": true, "editor.tabSize": 2 } diff --git a/src/auth/generateRandomName.js b/src/auth/generateRandomName.js index 7e6ff93e..bcd9d0ae 100644 --- a/src/auth/generateRandomName.js +++ b/src/auth/generateRandomName.js @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { uniqueNamesGenerator, adjectives, diff --git a/src/auth/useInteractiveLogin.js b/src/auth/useInteractiveLogin.js index 2b2420aa..6cdd4bd5 100644 --- a/src/auth/useInteractiveLogin.js +++ b/src/auth/useInteractiveLogin.js @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import matrix, { InteractiveAuth } from "matrix-js-sdk/src/browser-index"; import { useState, useCallback } from "react"; import { useClient } from "../ClientContext"; diff --git a/src/auth/useInteractiveRegistration.js b/src/auth/useInteractiveRegistration.js index d0658f73..583df1c0 100644 --- a/src/auth/useInteractiveRegistration.js +++ b/src/auth/useInteractiveRegistration.js @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import matrix, { InteractiveAuth } from "matrix-js-sdk/src/browser-index"; import { useState, useEffect, useCallback, useRef } from "react"; import { useClient } from "../ClientContext"; diff --git a/src/auth/useRecaptcha.js b/src/auth/useRecaptcha.js index d99bea2e..41710bd6 100644 --- a/src/auth/useRecaptcha.js +++ b/src/auth/useRecaptcha.js @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { randomString } from "matrix-js-sdk/src/randomstring"; import { useEffect, useCallback, useRef, useState } from "react"; diff --git a/src/button/Button.jsx b/src/button/Button.jsx index 1e31fde7..85754b37 100644 --- a/src/button/Button.jsx +++ b/src/button/Button.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { forwardRef } from "react"; import classNames from "classnames"; import styles from "./Button.module.css"; diff --git a/src/button/CopyButton.jsx b/src/button/CopyButton.jsx index 17483c5f..b28d693a 100644 --- a/src/button/CopyButton.jsx +++ b/src/button/CopyButton.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from "react"; import useClipboard from "react-use-clipboard"; import { ReactComponent as CheckIcon } from "../icons/Check.svg"; diff --git a/src/button/LinkButton.jsx b/src/button/LinkButton.jsx index 721429d4..561bba47 100644 --- a/src/button/LinkButton.jsx +++ b/src/button/LinkButton.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from "react"; import { Link } from "react-router-dom"; import classNames from "classnames"; diff --git a/src/button/index.js b/src/button/index.js index 0dc793c9..fb2cf8ce 100644 --- a/src/button/index.js +++ b/src/button/index.js @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + export * from "./Button"; export * from "./CopyButton"; export * from "./LinkButton"; diff --git a/src/form/Form.jsx b/src/form/Form.jsx index c46064f6..011fbb26 100644 --- a/src/form/Form.jsx +++ b/src/form/Form.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import classNames from "classnames"; import React, { forwardRef } from "react"; import styles from "./Form.module.css"; diff --git a/src/home/CallList.jsx b/src/home/CallList.jsx index 2e8aae64..e4badf26 100644 --- a/src/home/CallList.jsx +++ b/src/home/CallList.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from "react"; import { Link } from "react-router-dom"; import { CopyButton } from "../button"; diff --git a/src/home/JoinExistingCallModal.jsx b/src/home/JoinExistingCallModal.jsx index 8a749f93..515baca1 100644 --- a/src/home/JoinExistingCallModal.jsx +++ b/src/home/JoinExistingCallModal.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from "react"; import { Modal, ModalContent } from "../Modal"; import { Button } from "../button"; diff --git a/src/home/RegisteredView.jsx b/src/home/RegisteredView.jsx index 0480050c..02d87a17 100644 --- a/src/home/RegisteredView.jsx +++ b/src/home/RegisteredView.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useState, useCallback } from "react"; import { createRoom, roomAliasFromRoomName } from "../matrix-utils"; import { useGroupCallRooms } from "./useGroupCallRooms"; diff --git a/src/home/UnauthenticatedView.jsx b/src/home/UnauthenticatedView.jsx index 82435104..93650b8f 100644 --- a/src/home/UnauthenticatedView.jsx +++ b/src/home/UnauthenticatedView.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useCallback, useState } from "react"; import { Header, HeaderLogo, LeftNav, RightNav } from "../Header"; import { UserMenuContainer } from "../UserMenuContainer"; diff --git a/src/home/useGroupCallRooms.js b/src/home/useGroupCallRooms.js index b0bfbd27..8cd09580 100644 --- a/src/home/useGroupCallRooms.js +++ b/src/home/useGroupCallRooms.js @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { useState, useEffect } from "react"; const tsCache = {}; diff --git a/src/input/AvatarInputField.jsx b/src/input/AvatarInputField.jsx index 9b645b14..0977388b 100644 --- a/src/input/AvatarInputField.jsx +++ b/src/input/AvatarInputField.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { useObjectRef } from "@react-aria/utils"; import React, { useEffect } from "react"; import { useCallback } from "react"; diff --git a/src/input/Input.jsx b/src/input/Input.jsx index 88e0008d..65d6ce3a 100644 --- a/src/input/Input.jsx +++ b/src/input/Input.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { forwardRef } from "react"; import classNames from "classnames"; import styles from "./Input.module.css"; diff --git a/src/input/SelectInput.jsx b/src/input/SelectInput.jsx index 956b9e0a..9cef16e9 100644 --- a/src/input/SelectInput.jsx +++ b/src/input/SelectInput.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useRef } from "react"; import { HiddenSelect, useSelect } from "@react-aria/select"; import { useButton } from "@react-aria/button"; diff --git a/src/input/Toggle.jsx b/src/input/Toggle.jsx index f7423085..b6443c3d 100644 --- a/src/input/Toggle.jsx +++ b/src/input/Toggle.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useCallback, useRef } from "react"; import styles from "./Toggle.module.css"; import { useToggleButton } from "@react-aria/button"; diff --git a/src/popover/Popover.jsx b/src/popover/Popover.jsx index fe32fe6a..09c73aad 100644 --- a/src/popover/Popover.jsx +++ b/src/popover/Popover.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { forwardRef, useRef } from "react"; import { DismissButton, useOverlay } from "@react-aria/overlays"; import { FocusScope } from "@react-aria/focus"; diff --git a/src/popover/PopoverMenu.jsx b/src/popover/PopoverMenu.jsx index 66ed3a77..fe7ee100 100644 --- a/src/popover/PopoverMenu.jsx +++ b/src/popover/PopoverMenu.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { forwardRef, useRef } from "react"; import styles from "./PopoverMenu.module.css"; import { useMenuTriggerState } from "@react-stately/menu"; diff --git a/src/profile/ProfileModal.jsx b/src/profile/ProfileModal.jsx index 1f757dd6..b0dee0e6 100644 --- a/src/profile/ProfileModal.jsx +++ b/src/profile/ProfileModal.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useCallback, useEffect, useState } from "react"; import { Button } from "../button"; import { useProfile } from "./useProfile"; diff --git a/src/profile/useProfile.js b/src/profile/useProfile.js index aab97bf6..74b28703 100644 --- a/src/profile/useProfile.js +++ b/src/profile/useProfile.js @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { useState, useCallback, useEffect } from "react"; import { getAvatarUrl } from "../matrix-utils"; diff --git a/src/room/AudioPreview.jsx b/src/room/AudioPreview.jsx index 7cfd612d..32dfd138 100644 --- a/src/room/AudioPreview.jsx +++ b/src/room/AudioPreview.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from "react"; import styles from "./AudioPreview.module.css"; import { GroupCallState } from "matrix-js-sdk/src/webrtc/groupCall"; diff --git a/src/room/CallEndedView.jsx b/src/room/CallEndedView.jsx index 29cffbfc..5bbd8b84 100644 --- a/src/room/CallEndedView.jsx +++ b/src/room/CallEndedView.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from "react"; import styles from "./CallEndedView.module.css"; import { LinkButton } from "../button"; diff --git a/src/room/FeedbackModal.jsx b/src/room/FeedbackModal.jsx index 84338d64..3bf85171 100644 --- a/src/room/FeedbackModal.jsx +++ b/src/room/FeedbackModal.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useCallback, useEffect } from "react"; import { Modal, ModalContent } from "../Modal"; import { Button } from "../button"; diff --git a/src/room/GridLayoutMenu.jsx b/src/room/GridLayoutMenu.jsx index a7cfd6c7..2a95373c 100644 --- a/src/room/GridLayoutMenu.jsx +++ b/src/room/GridLayoutMenu.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from "react"; import { Button } from "../button"; import { PopoverMenuTrigger } from "../popover/PopoverMenu"; diff --git a/src/room/GroupCallInspector.jsx b/src/room/GroupCallInspector.jsx index b7b03d44..c3188e83 100644 --- a/src/room/GroupCallInspector.jsx +++ b/src/room/GroupCallInspector.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { Resizable } from "re-resizable"; import React, { useEffect, diff --git a/src/room/GroupCallLoader.jsx b/src/room/GroupCallLoader.jsx index 58934d05..dd327f9f 100644 --- a/src/room/GroupCallLoader.jsx +++ b/src/room/GroupCallLoader.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from "react"; import { useLoadGroupCall } from "./useLoadGroupCall"; import { ErrorView, FullScreenView } from "../FullScreenView"; diff --git a/src/room/GroupCallView.jsx b/src/room/GroupCallView.jsx index b8052d6b..0eb6b381 100644 --- a/src/room/GroupCallView.jsx +++ b/src/room/GroupCallView.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useCallback, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; import { GroupCallState } from "matrix-js-sdk/src/webrtc/groupCall"; diff --git a/src/room/InCallView.jsx b/src/room/InCallView.jsx index ea194f06..066e2963 100644 --- a/src/room/InCallView.jsx +++ b/src/room/InCallView.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useCallback, useMemo } from "react"; import styles from "./InCallView.module.css"; import { diff --git a/src/room/InviteModal.jsx b/src/room/InviteModal.jsx index 1036f517..0a7e9ce2 100644 --- a/src/room/InviteModal.jsx +++ b/src/room/InviteModal.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from "react"; import { Modal, ModalContent } from "../Modal"; import { CopyButton } from "../button"; diff --git a/src/room/LobbyView.jsx b/src/room/LobbyView.jsx index 1797cac6..7459e64d 100644 --- a/src/room/LobbyView.jsx +++ b/src/room/LobbyView.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useEffect, useRef } from "react"; import styles from "./LobbyView.module.css"; import { Button, CopyButton } from "../button"; diff --git a/src/room/OverflowMenu.jsx b/src/room/OverflowMenu.jsx index 82e7fbd7..3f92975b 100644 --- a/src/room/OverflowMenu.jsx +++ b/src/room/OverflowMenu.jsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useCallback } from "react"; import { Button } from "../button"; import { Menu } from "../Menu"; diff --git a/src/room/PTTButton.jsx b/src/room/PTTButton.jsx index 6da9b863..8448f96a 100644 --- a/src/room/PTTButton.jsx +++ b/src/room/PTTButton.jsx @@ -1,4 +1,20 @@ -import React from "react"; +/* +Copyright 2022 Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import React, { useCallback, useEffect, useState } from "react"; import classNames from "classnames"; import styles from "./PTTButton.module.css"; import { ReactComponent as MicIcon } from "../icons/Mic.svg"; @@ -14,14 +30,32 @@ export function PTTButton({ startTalking, stopTalking, }) { + const [isHeld, setHeld] = useState(false); + const onDocumentMouseUp = useCallback(() => { + if (isHeld) stopTalking(); + setHeld(false); + }, [isHeld, setHeld]); + + const onButtonMouseDown = useCallback(() => { + setHeld(true); + startTalking(); + }, [setHeld]); + + useEffect(() => { + window.addEventListener("mouseup", onDocumentMouseUp); + + return () => { + window.removeEventListener("mouseup", onDocumentMouseUp); + }; + }, [onDocumentMouseUp]); + return (