From 456d21c9e7bb9ee4349445ab105d34584d435499 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Dec 2020 02:56:41 +0000 Subject: [PATCH 01/68] Bump ini from 1.3.5 to 1.3.7 Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1a6a0b0fb3..ba2aba1b91 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5058,9 +5058,9 @@ inherits@2, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== ini@^1.3.5, ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + version "1.3.7" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" + integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== inquirer@^7.0.0: version "7.3.2" From 9f8a5f5107c50e3ff1e1bb7ae58a2386f957cf28 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 16 Dec 2020 14:22:44 +0000 Subject: [PATCH 02/68] Upgrade matrix-js-sdk to 9.4.0-rc.1 --- package.json | 2 +- yarn.lock | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b328823b24..44bddbbb53 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.19", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", + "matrix-js-sdk": "9.4.0-rc.1", "matrix-widget-api": "^0.1.0-beta.10", "minimist": "^1.2.5", "pako": "^1.0.11", diff --git a/yarn.lock b/yarn.lock index 1a6a0b0fb3..5d31179fb0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6512,9 +6512,10 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": - version "9.3.0" - resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/ff6612f9d0aa1a7c08b65a0b41c5ab997506016f" +matrix-js-sdk@9.4.0-rc.1: + version "9.4.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.4.0-rc.1.tgz#1aa983e474825b8156033ad83470e1d5690d6588" + integrity sha512-JeHPktQhRL3rl9DCuWBcZgYw3y6p84jKgHs4729tG5MfVVHMdx+n9IsUNPSJeZ/PkgoFpwMJgTiRZX0vszvLAQ== dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 88ef854349a6a19be27f1ea59d642f80fc5fb3bd Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 16 Dec 2020 14:34:25 +0000 Subject: [PATCH 03/68] Prepare changelog for v3.11.0-rc.1 --- CHANGELOG.md | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 151888a17e..fde7c852b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,83 @@ +Changes in [3.11.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.11.0-rc.1) (2020-12-16) +=============================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.10.0...v3.11.0-rc.1) + + * Upgrade JS SDK to 9.4.0-rc.1 + * Translations update from Weblate + [\#5497](https://github.com/matrix-org/matrix-react-sdk/pull/5497) + * Unregister from the dispatcher in CallHandler + [\#5495](https://github.com/matrix-org/matrix-react-sdk/pull/5495) + * Better adhere to MSC process + [\#5496](https://github.com/matrix-org/matrix-react-sdk/pull/5496) + * Use random pickle key on all platforms + [\#5483](https://github.com/matrix-org/matrix-react-sdk/pull/5483) + * Fix mx_MemberList icons + [\#5492](https://github.com/matrix-org/matrix-react-sdk/pull/5492) + * Convert InviteDialog to TypeScript + [\#5491](https://github.com/matrix-org/matrix-react-sdk/pull/5491) + * Add keyboard shortcut for emoji reactions + [\#5425](https://github.com/matrix-org/matrix-react-sdk/pull/5425) + * Run chat effects on events sent by widgets too + [\#5488](https://github.com/matrix-org/matrix-react-sdk/pull/5488) + * Fix being unable to pin widgets + [\#5487](https://github.com/matrix-org/matrix-react-sdk/pull/5487) + * Line 1 / 2 Support + [\#5468](https://github.com/matrix-org/matrix-react-sdk/pull/5468) + * Remove impossible labs feature: sending hidden read receipts + [\#5484](https://github.com/matrix-org/matrix-react-sdk/pull/5484) + * Fix height of Remote Video in call + [\#5456](https://github.com/matrix-org/matrix-react-sdk/pull/5456) + * Add UI for hold functionality + [\#5446](https://github.com/matrix-org/matrix-react-sdk/pull/5446) + * Allow SearchBox to expand to fill width + [\#5411](https://github.com/matrix-org/matrix-react-sdk/pull/5411) + * Use room alias in generated permalink for rooms + [\#5451](https://github.com/matrix-org/matrix-react-sdk/pull/5451) + * Only show confetti if the current room is receiving an appropriate event + [\#5482](https://github.com/matrix-org/matrix-react-sdk/pull/5482) + * Throttle RoomState.members handler to improve performance + [\#5481](https://github.com/matrix-org/matrix-react-sdk/pull/5481) + * Handle manual hs urls better for the server picker + [\#5477](https://github.com/matrix-org/matrix-react-sdk/pull/5477) + * Add Olm as a dev dependency for types + [\#5479](https://github.com/matrix-org/matrix-react-sdk/pull/5479) + * Hide Invite to this room CTA if no permission + [\#5476](https://github.com/matrix-org/matrix-react-sdk/pull/5476) + * Fix width of underline in server picker dialog + [\#5478](https://github.com/matrix-org/matrix-react-sdk/pull/5478) + * Fix confetti room unread state check + [\#5475](https://github.com/matrix-org/matrix-react-sdk/pull/5475) + * Show confetti in a chat room on command or emoji + [\#5140](https://github.com/matrix-org/matrix-react-sdk/pull/5140) + * Fix inverted settings default value + [\#5391](https://github.com/matrix-org/matrix-react-sdk/pull/5391) + * Improve usability of the Server Picker Dialog + [\#5474](https://github.com/matrix-org/matrix-react-sdk/pull/5474) + * Fix typos in some strings + [\#5473](https://github.com/matrix-org/matrix-react-sdk/pull/5473) + * Bump highlight.js from 10.1.2 to 10.4.1 + [\#5472](https://github.com/matrix-org/matrix-react-sdk/pull/5472) + * Remove old app test script path + [\#5471](https://github.com/matrix-org/matrix-react-sdk/pull/5471) + * add support for giving reason when redacting + [\#5260](https://github.com/matrix-org/matrix-react-sdk/pull/5260) + * Add support for Netlify to fetchdep script + [\#5469](https://github.com/matrix-org/matrix-react-sdk/pull/5469) + * Nest other layers inside on automation + [\#5467](https://github.com/matrix-org/matrix-react-sdk/pull/5467) + * Rebrand various CI scripts and modules + [\#5466](https://github.com/matrix-org/matrix-react-sdk/pull/5466) + * Add more widget sanity checking + [\#5462](https://github.com/matrix-org/matrix-react-sdk/pull/5462) + * Fix React complaining about unknown DOM props + [\#5465](https://github.com/matrix-org/matrix-react-sdk/pull/5465) + * Jump to home page when leaving a room + [\#5464](https://github.com/matrix-org/matrix-react-sdk/pull/5464) + * Fix SSO buttons for Social Logins + [\#5463](https://github.com/matrix-org/matrix-react-sdk/pull/5463) + * Social Login and login delight tweaks + [\#5426](https://github.com/matrix-org/matrix-react-sdk/pull/5426) + Changes in [3.10.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.10.0) (2020-12-07) ===================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.10.0-rc.1...v3.10.0) From 68b7538fca592a4018f00292ba9f3633cbae6649 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 16 Dec 2020 14:34:25 +0000 Subject: [PATCH 04/68] v3.11.0-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 44bddbbb53..05d403540e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.10.0", + "version": "3.11.0-rc.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From d2ee89fa744592355468e9bf233eb7cca5ad8b03 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 16 Dec 2020 15:57:56 +0000 Subject: [PATCH 05/68] Upgrade matrix-js-sdk to 9.4.0-rc.2 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 05d403540e..2c32373dd2 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.19", - "matrix-js-sdk": "9.4.0-rc.1", + "matrix-js-sdk": "9.4.0-rc.2", "matrix-widget-api": "^0.1.0-beta.10", "minimist": "^1.2.5", "pako": "^1.0.11", diff --git a/yarn.lock b/yarn.lock index 5d31179fb0..66c4fe2ae1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6512,10 +6512,10 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@9.4.0-rc.1: - version "9.4.0-rc.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.4.0-rc.1.tgz#1aa983e474825b8156033ad83470e1d5690d6588" - integrity sha512-JeHPktQhRL3rl9DCuWBcZgYw3y6p84jKgHs4729tG5MfVVHMdx+n9IsUNPSJeZ/PkgoFpwMJgTiRZX0vszvLAQ== +matrix-js-sdk@9.4.0-rc.2: + version "9.4.0-rc.2" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.4.0-rc.2.tgz#8cd0eb9a76445c63e152ff7c8eb708513a67481e" + integrity sha512-Z2GJ0uv+/0IlwoAyducBBVZUTe4COyKtl6kanZNHK4kSGYZ/8pilTtMBj8fJJtWubOiZ6HxtaLEXrxulOJF+TA== dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 01c3b79458edbcb75274b2642a4c5a0b5c4b4412 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 16 Dec 2020 16:27:15 +0000 Subject: [PATCH 06/68] Prepare changelog for v3.11.0-rc.2 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fde7c852b8..99d0aab14b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Changes in [3.11.0-rc.2](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.11.0-rc.2) (2020-12-16) +=============================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.11.0-rc.1...v3.11.0-rc.2) + + * Upgrade JS SDK to 9.4.0-rc.2 + Changes in [3.11.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.11.0-rc.1) (2020-12-16) =============================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.10.0...v3.11.0-rc.1) From caf795e5c2dcba575a64659036e96b9a4a16f586 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 16 Dec 2020 16:27:16 +0000 Subject: [PATCH 07/68] v3.11.0-rc.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c32373dd2..2a3a2064f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.11.0-rc.1", + "version": "3.11.0-rc.2", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From 1b2cfa5f05d3576612e7bf1e7c72b9d7d9c38163 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 17 Dec 2020 10:34:49 +0000 Subject: [PATCH 08/68] Social Login support both https and mxc icons --- src/components/views/elements/SSOButtons.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/SSOButtons.tsx b/src/components/views/elements/SSOButtons.tsx index 57dd31f9d6..89356ecf5c 100644 --- a/src/components/views/elements/SSOButtons.tsx +++ b/src/components/views/elements/SSOButtons.tsx @@ -45,8 +45,13 @@ const SSOButton: React.FC = ({ }; let icon; - if (idp && idp.icon && idp.icon.startsWith("https://")) { - icon = {label}; + if (typeof idp?.icon === "string" && idp.icon.startsWith("mxc://") || idp.icon.startsWith("https://")) { + icon = {label}; } const classes = classNames("mx_SSOButton", { From f2214c0367c64482953091f3037a05a5099c4467 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 17 Dec 2020 10:43:53 +0000 Subject: [PATCH 09/68] Fix room list help prompt alignment --- res/css/views/rooms/_RoomList.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/res/css/views/rooms/_RoomList.scss b/res/css/views/rooms/_RoomList.scss index 6ea99585d2..b7759d265f 100644 --- a/res/css/views/rooms/_RoomList.scss +++ b/res/css/views/rooms/_RoomList.scss @@ -41,6 +41,8 @@ limitations under the License. padding: 0 0 0 24px; font-size: inherit; margin-top: 8px; + display: block; + text-align: start; &::before { content: ''; From c498609f7994de4139509eecb45c2e7787bdafbb Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 17 Dec 2020 10:47:03 +0000 Subject: [PATCH 10/68] Fix padding in confirmation email registration prompt --- res/css/views/auth/_InteractiveAuthEntryComponents.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/auth/_InteractiveAuthEntryComponents.scss b/res/css/views/auth/_InteractiveAuthEntryComponents.scss index 0a5ac9b2bc..5df73b139f 100644 --- a/res/css/views/auth/_InteractiveAuthEntryComponents.scss +++ b/res/css/views/auth/_InteractiveAuthEntryComponents.scss @@ -15,7 +15,7 @@ limitations under the License. */ .mx_InteractiveAuthEntryComponents_emailWrapper { - padding-right: 60px; + padding-right: 100px; position: relative; margin-top: 32px; margin-bottom: 32px; From 2567fcd045c3888fdbb69901e56ba465053066e9 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 17 Dec 2020 12:02:16 +0000 Subject: [PATCH 11/68] add brackets for operator precedence --- src/components/views/elements/SSOButtons.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/SSOButtons.tsx b/src/components/views/elements/SSOButtons.tsx index 89356ecf5c..2416e76119 100644 --- a/src/components/views/elements/SSOButtons.tsx +++ b/src/components/views/elements/SSOButtons.tsx @@ -45,7 +45,7 @@ const SSOButton: React.FC = ({ }; let icon; - if (typeof idp?.icon === "string" && idp.icon.startsWith("mxc://") || idp.icon.startsWith("https://")) { + if (typeof idp?.icon === "string" && (idp.icon.startsWith("mxc://") || idp.icon.startsWith("https://"))) { icon = Date: Thu, 17 Dec 2020 10:47:03 +0000 Subject: [PATCH 12/68] Fix padding in confirmation email registration prompt --- res/css/views/auth/_InteractiveAuthEntryComponents.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/auth/_InteractiveAuthEntryComponents.scss b/res/css/views/auth/_InteractiveAuthEntryComponents.scss index 0a5ac9b2bc..5df73b139f 100644 --- a/res/css/views/auth/_InteractiveAuthEntryComponents.scss +++ b/res/css/views/auth/_InteractiveAuthEntryComponents.scss @@ -15,7 +15,7 @@ limitations under the License. */ .mx_InteractiveAuthEntryComponents_emailWrapper { - padding-right: 60px; + padding-right: 100px; position: relative; margin-top: 32px; margin-bottom: 32px; From 380b7296922d83e168703372b88fb1339965384e Mon Sep 17 00:00:00 2001 From: nurjinn jafar Date: Thu, 17 Dec 2020 16:57:59 +0100 Subject: [PATCH 13/68] fireworks effect added --- src/effects/fireworks/index.ts | 167 +++++++++++++++++++++++++++++++++ src/effects/index.ts | 17 ++++ src/i18n/strings/en_EN.json | 2 + 3 files changed, 186 insertions(+) create mode 100644 src/effects/fireworks/index.ts diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts new file mode 100644 index 0000000000..7c84e31f1d --- /dev/null +++ b/src/effects/fireworks/index.ts @@ -0,0 +1,167 @@ +/* + Copyright 2020 Nurjin Jafar + Copyright 2020 Nordeck IT + Consulting GmbH. + + 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 ICanvasEffect from '../ICanvasEffect'; + +export type FireworksOptions = { + /** + * the maximum number of the fireworks + */ + maxCount: number, + /** + * the alpha opacity of the fireworks (between 0 and 1, where 1 is opaque and 0 is invisible) + */ + gravity: number, + probability: number, +} + +type FireworksParticle = { + color: string, + x: number, + y: number, + vx: number, + vy: number, + alpha: number, + w: number, + h: number +} + +export const DefaultOptions: FireworksOptions = { + maxCount: 500, + gravity: 0.05, + probability: 0.04, +}; + +export default class Fireworks implements ICanvasEffect { + private readonly options: FireworksOptions; + + constructor(options: { [key: string]: any }) { + this.options = {...DefaultOptions, ...options}; + } + + private context: CanvasRenderingContext2D | null = null; + private supportsAnimationFrame = window.requestAnimationFrame || + function(callback) { + window.setTimeout(callback, 1000/60); + }; + private particles: Array = []; + public isRunning: boolean; + + public start = async (canvas: HTMLCanvasElement, timeout = 4000) => { + if (!canvas) { + return; + } + this.isRunning = true; + this.context = canvas.getContext('2d'); + this.supportsAnimationFrame.call(window, this.updateWorld); + if (timeout) { + window.setTimeout(this.stop, timeout); + } + } + + private updateWorld = () => { + if (!this.isRunning) return; + this.update(); + this.paint(); + this.supportsAnimationFrame.call(window, this.updateWorld); + } + private update = () => { + if (this.particles.length < this.options.maxCount && Math.random() < this.options.probability) { + this.createFirework(); + } + const alive = []; + for (let i=0; i { + if (!this.context || !this.context.canvas) return; + this.context.globalCompositeOperation = 'source-over'; + this.context.fillStyle = "rgba(0,0,0,0.2)"; + this.context.canvas.style.opacity = "0.8"; + this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height); + this.context.globalCompositeOperation = 'lighter'; + for (let i=0; i { + if (!this.context || !this.context.canvas) return; + const width = this.context.canvas.width; + const height = this.context.canvas.height; + const xPoint = Math.random() * (width - 200) + 100; + const yPoint = Math.random() * (height - 200) + 100; + const nFire = Math.random() * 50 + 100; + const color = "rgb("+(~~(Math.random()*200+55))+"," + +(~~(Math.random()*200+55))+","+(~~(Math.random()*200+55))+")"; + for (let i=0; i{}; + particle.color = color; + particle.w = particle.h = Math.random() * 4 + 1; + particle.x = xPoint - particle.w / 2; + particle.y = yPoint - particle.h / 2; + particle.vx = (Math.random()-0.5)*10; + particle.vy = (Math.random()-0.5)*10; + particle.alpha = Math.random()*.5+.5; + const vy = Math.sqrt(25 - particle.vx * particle.vx); + if (Math.abs(particle.vy) > vy) { + particle.vy = particle.vy > 0 ? vy: -vy; + } + this.particles.push(particle); + } + } + + public stop = async () => { + this.isRunning = false; + this.particles = []; + this.context.canvas.style.opacity = "1"; + this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height); + } + + private drawParticle = (particle: FireworksParticle): void => { + if (!this.context || !this.context.canvas) { + return; + } + this.context.save(); + this.context.beginPath(); + + this.context.translate(particle.x + particle.w / 2, particle.y + particle.h / 2); + this.context.arc(0, 0, particle.w, 0, Math.PI * 2); + this.context.fillStyle = particle.color; + this.context.globalAlpha = particle.alpha; + + this.context.closePath(); + this.context.fill(); + this.context.restore(); + } + + + private move = (particle: FireworksParticle) => { + particle.x += particle.vx; + particle.vy += this.options.gravity; + particle.y += particle.vy; + particle.alpha -= 0.01; + return !(particle.x <= -particle.w || particle.x >= screen.width || + particle.y >= screen.height || + particle.alpha <= 0); + } +} diff --git a/src/effects/index.ts b/src/effects/index.ts index 16a0851070..27ed73622f 100644 --- a/src/effects/index.ts +++ b/src/effects/index.ts @@ -64,6 +64,11 @@ type ConfettiOptions = { * use gradient instead of solid particle color */ gradient: boolean, +}; +type FireworksOptions = { + maxCount: number, + gravity: number, + probability: number, } /** @@ -84,6 +89,18 @@ export const CHAT_EFFECTS: Array> = [ gradient: false, }, } as Effect, + { + emojis: ['🎆'], + msgType: 'nic.custom.fireworks', + command: 'fireworks', + description: () => _td("Sends the given message with fireworks"), + fallbackMessage: () => _t("sends fireworks") + "🎆", + options: { + maxCount: 500, + gravity: 0.05, + probability: 0.04, + }, + } as Effect, ]; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 1b5d4b6ec4..6d4c0dad4d 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -848,6 +848,8 @@ "This is your list of users/servers you have blocked - don't leave the room!": "This is your list of users/servers you have blocked - don't leave the room!", "Sends the given message with confetti": "Sends the given message with confetti", "sends confetti": "sends confetti", + "Sends the given message with fireworks": "Sends the given message with fireworks", + "sends fireworks": "sends fireworks", "Video Call": "Video Call", "Voice Call": "Voice Call", "Fill Screen": "Fill Screen", From 8350b4152be03983840922b598d81ada5a793710 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 17 Dec 2020 17:16:00 +0000 Subject: [PATCH 14/68] Import from src in IncomingCallBox.tsx --- src/components/views/voip/IncomingCallBox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/voip/IncomingCallBox.tsx b/src/components/views/voip/IncomingCallBox.tsx index 0403a9eb75..8e1d23e38e 100644 --- a/src/components/views/voip/IncomingCallBox.tsx +++ b/src/components/views/voip/IncomingCallBox.tsx @@ -24,7 +24,7 @@ import { ActionPayload } from '../../../dispatcher/payloads'; import CallHandler from '../../../CallHandler'; import RoomAvatar from '../avatars/RoomAvatar'; import FormButton from '../elements/FormButton'; -import { CallState } from 'matrix-js-sdk/lib/webrtc/call'; +import { CallState } from 'matrix-js-sdk/src/webrtc/call'; interface IProps { } From 98a1b7a2d8bc71bbb274b66e20f18fe6aaefc3f9 Mon Sep 17 00:00:00 2001 From: Emmanouil Kampitakis Date: Thu, 10 Dec 2020 12:19:13 +0100 Subject: [PATCH 15/68] Add the tableflip slashcommand Signed-off-by: Emmanouil Kampitakis --- src/SlashCommands.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index e2ae875ac3..8c86b8bcb6 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -166,6 +166,19 @@ export const Commands = [ }, category: CommandCategories.messages, }), + new Command({ + command: 'tableflip', + args: '', + description: _td('Prepends (╯°□°)╯︵ ┻━┻ to a plain-text message'), + runFn: function(roomId, args) { + let message = '(╯°□°)╯︵ ┻━┻'; + if (args) { + message = message + ' ' + args; + } + return success(MatrixClientPeg.get().sendTextMessage(roomId, message)); + }, + category: CommandCategories.messages, + }), new Command({ command: 'lenny', args: '', From f4d366821404a8cd535cdf47cf6e421d9d25276e Mon Sep 17 00:00:00 2001 From: Emmanouil Kampitakis Date: Thu, 10 Dec 2020 12:19:30 +0100 Subject: [PATCH 16/68] Add the unflip slashcommand Signed-off-by: Emmanouil Kampitakis --- src/SlashCommands.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 8c86b8bcb6..79c21c4af5 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -179,6 +179,19 @@ export const Commands = [ }, category: CommandCategories.messages, }), + new Command({ + command: 'unflip', + args: '', + description: _td('Prepends ┬──┬ ノ( ゜-゜ノ) to a plain-text message'), + runFn: function(roomId, args) { + let message = '┬──┬ ノ( ゜-゜ノ)'; + if (args) { + message = message + ' ' + args; + } + return success(MatrixClientPeg.get().sendTextMessage(roomId, message)); + }, + category: CommandCategories.messages, + }), new Command({ command: 'lenny', args: '', From 2488a8f1eecda73e61b2aed42fe102c10900df7c Mon Sep 17 00:00:00 2001 From: Emmanouil Kampitakis Date: Wed, 16 Dec 2020 11:48:00 +0100 Subject: [PATCH 17/68] Add string-translation for english Signed-off-by: Emmanouil Kampitakis --- src/i18n/strings/en_EN.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index eb1d0a632e..f8ef44763d 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -411,6 +411,8 @@ "Command error": "Command error", "Usage": "Usage", "Prepends ¯\\_(ツ)_/¯ to a plain-text message": "Prepends ¯\\_(ツ)_/¯ to a plain-text message", + "Prepends (╯°□°)╯︵ ┻━┻ to a plain-text message": "Prepends (╯°□°)╯︵ ┻━┻ to a plain-text message", + "Prepends ┬──┬ ノ( ゜-゜ノ) to a plain-text message": "Prepends ┬──┬ ノ( ゜-゜ノ) to a plain-text message", "Prepends ( ͡° ͜ʖ ͡°) to a plain-text message": "Prepends ( ͡° ͜ʖ ͡°) to a plain-text message", "Sends a message as plain text, without interpreting it as markdown": "Sends a message as plain text, without interpreting it as markdown", "Sends a message as html, without interpreting it as markdown": "Sends a message as html, without interpreting it as markdown", From ad32f90beb8b2f8beebb4b547fd97ba6335b1fa6 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 17 Dec 2020 13:09:35 +0000 Subject: [PATCH 18/68] Stop building at local install time This speeds up local development and CI runs by skipping build steps by default. They will now only run when just before publishing. Related to https://github.com/matrix-org/matrix-js-sdk/pull/1552 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b328823b24..b30b430a62 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "typings": "./lib/index.d.ts", "matrix_src_main": "./src/index.js", "scripts": { - "prepare": "yarn build", + "prepublishOnly": "yarn build", "i18n": "matrix-gen-i18n", "prunei18n": "matrix-prune-i18n", "diff-i18n": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && ./scripts/gen-i18n.js && node scripts/compare-file.js src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json", From 3d3490c6d7a771eae9008cdc77e9a07b3dbb1a69 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 17 Dec 2020 15:36:32 +0000 Subject: [PATCH 19/68] For cloned deps, we only need to build types --- scripts/ci/install-deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/install-deps.sh b/scripts/ci/install-deps.sh index 14b5fc5393..8a6f7489a0 100755 --- a/scripts/ci/install-deps.sh +++ b/scripts/ci/install-deps.sh @@ -7,7 +7,7 @@ scripts/fetchdep.sh matrix-org matrix-js-sdk pushd matrix-js-sdk yarn link yarn install $@ -yarn build +yarn build:types popd yarn link matrix-js-sdk From 19cfe44b16d20275abaa8298704dc41d056af76c Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 17 Dec 2020 15:46:32 +0000 Subject: [PATCH 20/68] Types from dependencies are now built explicitly --- scripts/ci/layered.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ci/layered.sh b/scripts/ci/layered.sh index 306f9c9974..78a490f7a8 100755 --- a/scripts/ci/layered.sh +++ b/scripts/ci/layered.sh @@ -14,12 +14,14 @@ scripts/fetchdep.sh matrix-org matrix-js-sdk pushd matrix-js-sdk yarn link yarn install +yarn build:types popd # Now set up the react-sdk yarn link matrix-js-sdk yarn link yarn install +yarn build:types # Finally, set up element-web scripts/fetchdep.sh vector-im element-web From 453575d70acc51b16cb4374b9b9e6fd93a4978af Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 18 Dec 2020 13:46:58 +0000 Subject: [PATCH 21/68] Don't play call end sound for calls that never started --- src/CallHandler.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index fac4d6fc4e..7160657c07 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -341,7 +341,8 @@ export default class CallHandler { title: _t("Answered Elsewhere"), description: _t("The call was answered on another device."), }); - } else { + } else if (oldState !== CallState.Fledgling) { + // don't play the end-call sound for calls that never got off the ground this.play(AudioID.CallEnd); } } From 88d3de710a96d280bd84cd54aa1f6abe3dbd1d77 Mon Sep 17 00:00:00 2001 From: nurjinn jafar Date: Fri, 18 Dec 2020 14:51:58 +0100 Subject: [PATCH 22/68] comments added --- src/effects/fireworks/index.ts | 19 +++++++++++++++++-- src/effects/index.ts | 6 ++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 7c84e31f1d..3cc209eda3 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -19,23 +19,38 @@ import ICanvasEffect from '../ICanvasEffect'; export type FireworksOptions = { /** - * the maximum number of the fireworks + * max fireworks count */ maxCount: number, /** - * the alpha opacity of the fireworks (between 0 and 1, where 1 is opaque and 0 is invisible) + * gravity value that firework adds to shift from it's start position */ gravity: number, probability: number, } type FireworksParticle = { + /** + * color + */ color: string, + /** + * x,y are the point where the particle starts to position on canvas + */ x: number, y: number, + /** + * vx,vy shift values from x and y + */ vx: number, vy: number, + /** + * the alpha opacity of the firework particle (between 0 and 1, where 1 is opaque and 0 is invisible) + */ alpha: number, + /** + * w,h width and height + */ w: number, h: number } diff --git a/src/effects/index.ts b/src/effects/index.ts index 27ed73622f..07aaa5e736 100644 --- a/src/effects/index.ts +++ b/src/effects/index.ts @@ -66,7 +66,13 @@ type ConfettiOptions = { gradient: boolean, }; type FireworksOptions = { + /** + * max fireworks count + */ maxCount: number, + /** + * gravity value that firework adds to shift from it's start position + */ gravity: number, probability: number, } From 23058112713eb06a459cfd727b96d5becee55d07 Mon Sep 17 00:00:00 2001 From: nurjinn jafar Date: Fri, 18 Dec 2020 15:30:50 +0100 Subject: [PATCH 23/68] changed canvas globalCompositeOperation value and removed probability --- src/effects/fireworks/index.ts | 9 +++------ src/effects/index.ts | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 3cc209eda3..b9898b8b22 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -26,7 +26,6 @@ export type FireworksOptions = { * gravity value that firework adds to shift from it's start position */ gravity: number, - probability: number, } type FireworksParticle = { @@ -58,7 +57,6 @@ type FireworksParticle = { export const DefaultOptions: FireworksOptions = { maxCount: 500, gravity: 0.05, - probability: 0.04, }; export default class Fireworks implements ICanvasEffect { @@ -95,7 +93,7 @@ export default class Fireworks implements ICanvasEffect { this.supportsAnimationFrame.call(window, this.updateWorld); } private update = () => { - if (this.particles.length < this.options.maxCount && Math.random() < this.options.probability) { + if (this.particles.length < this.options.maxCount) { this.createFirework(); } const alive = []; @@ -109,9 +107,8 @@ export default class Fireworks implements ICanvasEffect { private paint = () => { if (!this.context || !this.context.canvas) return; - this.context.globalCompositeOperation = 'source-over'; - this.context.fillStyle = "rgba(0,0,0,0.2)"; - this.context.canvas.style.opacity = "0.8"; + this.context.globalCompositeOperation = 'destination-out'; + this.context.fillStyle = "rgba(0,0,0,0.5)"; this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height); this.context.globalCompositeOperation = 'lighter'; for (let i=0; i> = [ options: { maxCount: 500, gravity: 0.05, - probability: 0.04, }, } as Effect, ]; From 3d1327ecec3d601480aac74e03afbc27facc5f09 Mon Sep 17 00:00:00 2001 From: nurjinn jafar Date: Fri, 18 Dec 2020 15:32:44 +0100 Subject: [PATCH 24/68] removed unnecessary opacity --- src/effects/fireworks/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index b9898b8b22..ee32c9ac9c 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -145,7 +145,6 @@ export default class Fireworks implements ICanvasEffect { public stop = async () => { this.isRunning = false; this.particles = []; - this.context.canvas.style.opacity = "1"; this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height); } From b22c28eac9d8bce4c745101df63e25fa795c651e Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 18 Dec 2020 14:49:28 +0000 Subject: [PATCH 25/68] Use TypeScript source for development, swap to build during release This changes the JS SDK to point `main` to TypeScript source and remove any indication of `typings`. For local development and CI workflows, it means many steps can run without building first, which saves lots of time. During release, we still build for Node and browsers as before. The release script adjusts the `main` and `typings` fields before publishing and distribution to point to the built output for those that use them. --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b30b430a62..a3443af38b 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,10 @@ "matrix-gen-i18n": "scripts/gen-i18n.js", "matrix-prune-i18n": "scripts/prune-i18n.js" }, - "main": "./lib/index.js", - "typings": "./lib/index.d.ts", + "main": "./src/index.js", "matrix_src_main": "./src/index.js", + "matrix_lib_main": "./lib/index.js", + "matrix_lib_typings": "./lib/index.d.ts", "scripts": { "prepublishOnly": "yarn build", "i18n": "matrix-gen-i18n", From 50427786f9c268be0d42c6fb16bfd0c4276d79ac Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 18 Dec 2020 14:59:09 +0000 Subject: [PATCH 26/68] Cloned deps do not need any building now --- scripts/ci/install-deps.sh | 1 - scripts/ci/layered.sh | 2 -- 2 files changed, 3 deletions(-) diff --git a/scripts/ci/install-deps.sh b/scripts/ci/install-deps.sh index 8a6f7489a0..bbda74ef9d 100755 --- a/scripts/ci/install-deps.sh +++ b/scripts/ci/install-deps.sh @@ -7,7 +7,6 @@ scripts/fetchdep.sh matrix-org matrix-js-sdk pushd matrix-js-sdk yarn link yarn install $@ -yarn build:types popd yarn link matrix-js-sdk diff --git a/scripts/ci/layered.sh b/scripts/ci/layered.sh index 78a490f7a8..306f9c9974 100755 --- a/scripts/ci/layered.sh +++ b/scripts/ci/layered.sh @@ -14,14 +14,12 @@ scripts/fetchdep.sh matrix-org matrix-js-sdk pushd matrix-js-sdk yarn link yarn install -yarn build:types popd # Now set up the react-sdk yarn link matrix-js-sdk yarn link yarn install -yarn build:types # Finally, set up element-web scripts/fetchdep.sh vector-im element-web From e90e51cc9b269005f52671daa842ff3c61363e84 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 18 Dec 2020 15:13:09 +0000 Subject: [PATCH 27/68] React SDK needs to build the component index --- scripts/ci/layered.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ci/layered.sh b/scripts/ci/layered.sh index 306f9c9974..039f90c7df 100755 --- a/scripts/ci/layered.sh +++ b/scripts/ci/layered.sh @@ -20,6 +20,7 @@ popd yarn link matrix-js-sdk yarn link yarn install +yarn reskindex # Finally, set up element-web scripts/fetchdep.sh vector-im element-web From 63e99ecf934d06b66d33fa2a1f0e7e3857c1eda6 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 18 Dec 2020 18:08:04 +0000 Subject: [PATCH 28/68] Visual fixups for call UI * Add bottom margin on PiP view * Remove avatar blurring & pause icon for held calls * Change background of incoming call box to match PiP view * Put drop shadow & border radius on PiP view & incoming call box rather than the CallContainer they're in (so they each have their own drop shadow / rounded corners). * Add margin between incoming call box and PiP view --- res/css/views/voip/_CallContainer.scss | 7 +++---- res/css/views/voip/_CallView.scss | 10 ++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/res/css/views/voip/_CallContainer.scss b/res/css/views/voip/_CallContainer.scss index eec8a1f188..ae1d37de71 100644 --- a/res/css/views/voip/_CallContainer.scss +++ b/res/css/views/voip/_CallContainer.scss @@ -18,10 +18,7 @@ limitations under the License. position: absolute; right: 20px; bottom: 72px; - border-radius: 8px; - overflow: hidden; z-index: 100; - box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08); // Disable pointer events for Jitsi widgets to function. Direct // calls have their own cursor and behaviour, but we need to make @@ -49,8 +46,10 @@ limitations under the License. .mx_IncomingCallBox { min-width: 250px; - background-color: $primary-bg-color; + background-color: $secondary-accent-color; padding: 8px; + box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08); + border-radius: 8px; pointer-events: initial; // restore pointer events so the user can accept/decline cursor: pointer; diff --git a/res/css/views/voip/_CallView.scss b/res/css/views/voip/_CallView.scss index dbe2c27e41..ad63604818 100644 --- a/res/css/views/voip/_CallView.scss +++ b/res/css/views/voip/_CallView.scss @@ -35,6 +35,10 @@ limitations under the License. .mx_CallView_pip { width: 320px; + padding-bottom: 8px; + margin-top: 10px; + box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08); + border-radius: 8px; .mx_CallView_voice { height: 180px; @@ -84,6 +88,7 @@ limitations under the License. border-radius: 2000px; overflow: hidden; position: relative; + /* Blurred avatar images & pause icon for on-hold removed for now &::after { position: absolute; content: ''; @@ -101,17 +106,21 @@ limitations under the License. .mx_CallView_pip &::after { background-size: 30px; } + */ } + /* .mx_BaseAvatar { filter: blur(20px); overflow: hidden; } + */ } .mx_CallView_voice_secondaryAvatarContainer { border-radius: 2000px; overflow: hidden; position: relative; + /* &::after { position: absolute; content: ''; @@ -129,6 +138,7 @@ limitations under the License. .mx_CallView_pip &::after { background-size: 24px; } + */ } .mx_CallView_voice_holdText { From eab764a3c8b4c76805571234d44b34e2c0f5d39b Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 18 Dec 2020 19:35:41 +0000 Subject: [PATCH 29/68] Vary resume link text Use 'Switch' if unholding that call would hold another --- src/CallHandler.tsx | 12 ++++++++++++ src/components/views/voip/CallView.tsx | 6 ++++-- src/i18n/strings/en_EN.json | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index fac4d6fc4e..8ce0da36dc 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -616,6 +616,18 @@ export default class CallHandler { } } + /** + * @returns true if we are currently in anu call where we haven't put the remote party on hold + */ + hasAnyUnheldCall() { + for (const call of this.calls.values()) { + if (call.state === CallState.Ended) continue; + if (!call.isRemoteOnHold()) return true; + } + + return false; + } + private async startCallApp(roomId: string, type: string) { dis.dispatch({ action: 'appsDrawer', diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index 65ba693b58..495a99d53c 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -19,7 +19,7 @@ import React, { createRef, CSSProperties, ReactNode } from 'react'; import dis from '../../../dispatcher/dispatcher'; import CallHandler from '../../../CallHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; -import { _t } from '../../../languageHandler'; +import { _t, _td } from '../../../languageHandler'; import VideoFeed, { VideoFeedType } from "./VideoFeed"; import RoomAvatar from "../avatars/RoomAvatar"; import { CallState, CallType, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; @@ -423,7 +423,9 @@ export default class CallView extends React.Component { const isOnHold = this.state.isLocalOnHold || this.state.isRemoteOnHold; let onHoldText = null; if (this.state.isRemoteOnHold) { - onHoldText = _t("You held the call Resume", {}, { + const holdString = CallHandler.sharedInstance().hasAnyUnheldCall() ? + _td("You held the call Switch") : _td("You held the call Resume"); + onHoldText = _t(holdString, {}, { a: sub => {sub} , diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index eb1d0a632e..f91576bc4a 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -847,6 +847,7 @@ "This is your list of users/servers you have blocked - don't leave the room!": "This is your list of users/servers you have blocked - don't leave the room!", "Sends the given message with confetti": "Sends the given message with confetti", "sends confetti": "sends confetti", + "You held the call Switch": "You held the call Switch", "You held the call Resume": "You held the call Resume", "%(peerName)s held the call": "%(peerName)s held the call", "Video Call": "Video Call", From aee861956c45f9c7406a1f59fda27d5770fa7f9e Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 18 Dec 2020 19:40:57 +0000 Subject: [PATCH 30/68] Remove secondary call avatar and change 'paused' to 'on hold' --- res/css/views/voip/_CallView.scss | 25 ------------------------- src/components/views/voip/CallView.tsx | 17 +---------------- src/i18n/strings/en_EN.json | 2 +- 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/res/css/views/voip/_CallView.scss b/res/css/views/voip/_CallView.scss index ad63604818..9fcf47cf9e 100644 --- a/res/css/views/voip/_CallView.scss +++ b/res/css/views/voip/_CallView.scss @@ -116,31 +116,6 @@ limitations under the License. */ } -.mx_CallView_voice_secondaryAvatarContainer { - border-radius: 2000px; - overflow: hidden; - position: relative; - /* - &::after { - position: absolute; - content: ''; - width: 100%; - height: 100%; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - background-color: rgba(0, 0, 0, 0.6); - background-image: url('$(res)/img/voip/paused.svg'); - background-position: center; - background-size: 40px; - background-repeat: no-repeat; - } - .mx_CallView_pip &::after { - background-size: 24px; - } - */ -} - .mx_CallView_voice_holdText { height: 20px; padding-top: 20px; diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index 495a99d53c..6748728278 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -480,20 +480,6 @@ export default class CallView extends React.Component { mx_CallView_voice: true, mx_CallView_voice_hold: isOnHold, }); - let secondaryCallAvatar: ReactNode; - - if (this.props.secondaryCall) { - const secAvatarSize = this.props.pipMode ? 40 : 100; - secondaryCallAvatar =
- -
; - } contentView =
@@ -504,7 +490,6 @@ export default class CallView extends React.Component { width={avatarSize} />
- {secondaryCallAvatar}
{onHoldText}
{callControls} @@ -548,7 +533,7 @@ export default class CallView extends React.Component { - {_t("%(name)s paused", { name: secCallRoom.name })} + {_t("%(name)s on hold", { name: secCallRoom.name })} ; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index f91576bc4a..0653aff4c3 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -854,7 +854,7 @@ "Voice Call": "Voice Call", "Fill Screen": "Fill Screen", "Return to call": "Return to call", - "%(name)s paused": "%(name)s paused", + "%(name)s on hold": "%(name)s on hold", "Unknown caller": "Unknown caller", "Incoming voice call": "Incoming voice call", "Incoming video call": "Incoming video call", From 77ce8a9e39b0ba5384e79b680efc04d0794872ce Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 18 Dec 2020 18:39:16 -0700 Subject: [PATCH 31/68] Fix minor lint problems --- src/effects/fireworks/index.ts | 21 +++++++++++---------- src/effects/index.ts | 14 +++++++------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index ee32c9ac9c..8f6cc5d82f 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -21,37 +21,37 @@ export type FireworksOptions = { /** * max fireworks count */ - maxCount: number, + maxCount: number; /** * gravity value that firework adds to shift from it's start position */ - gravity: number, + gravity: number; } type FireworksParticle = { /** * color */ - color: string, + color: string; /** * x,y are the point where the particle starts to position on canvas */ - x: number, - y: number, + x: number; + y: number; /** * vx,vy shift values from x and y */ - vx: number, - vy: number, + vx: number; + vy: number; /** * the alpha opacity of the firework particle (between 0 and 1, where 1 is opaque and 0 is invisible) */ - alpha: number, + alpha: number; /** * w,h width and height */ - w: number, - h: number + w: number; + h: number; } export const DefaultOptions: FireworksOptions = { @@ -92,6 +92,7 @@ export default class Fireworks implements ICanvasEffect { this.paint(); this.supportsAnimationFrame.call(window, this.updateWorld); } + private update = () => { if (this.particles.length < this.options.maxCount) { this.createFirework(); diff --git a/src/effects/index.ts b/src/effects/index.ts index 990d1e68ef..27f1902d7c 100644 --- a/src/effects/index.ts +++ b/src/effects/index.ts @@ -47,33 +47,33 @@ type ConfettiOptions = { /** * max confetti count */ - maxCount: number, + maxCount: number; /** * particle animation speed */ - speed: number, + speed: number; /** * the confetti animation frame interval in milliseconds */ - frameInterval: number, + frameInterval: number; /** * the alpha opacity of the confetti (between 0 and 1, where 1 is opaque and 0 is invisible) */ - alpha: number, + alpha: number; /** * use gradient instead of solid particle color */ - gradient: boolean, + gradient: boolean; }; type FireworksOptions = { /** * max fireworks count */ - maxCount: number, + maxCount: number; /** * gravity value that firework adds to shift from it's start position */ - gravity: number, + gravity: number; } /** From 4ba89cc437e821016e5bb4eb7e08bb1eb8d84d09 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 18 Dec 2020 18:40:11 -0700 Subject: [PATCH 32/68] Lower effect time by 1 second It feels like it runs a bit too long --- src/effects/fireworks/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 8f6cc5d82f..15ba286503 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -74,7 +74,7 @@ export default class Fireworks implements ICanvasEffect { private particles: Array = []; public isRunning: boolean; - public start = async (canvas: HTMLCanvasElement, timeout = 4000) => { + public start = async (canvas: HTMLCanvasElement, timeout = 3000) => { if (!canvas) { return; } From b2825e8718e35e2dadb3a2c0a6b41eef558ccec4 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 18 Dec 2020 18:40:30 -0700 Subject: [PATCH 33/68] Use the same requestAnimationFrame as confetti --- src/effects/fireworks/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 15ba286503..4ca5c59fa7 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -67,10 +67,7 @@ export default class Fireworks implements ICanvasEffect { } private context: CanvasRenderingContext2D | null = null; - private supportsAnimationFrame = window.requestAnimationFrame || - function(callback) { - window.setTimeout(callback, 1000/60); - }; + private supportsAnimationFrame = window.requestAnimationFrame; private particles: Array = []; public isRunning: boolean; From 1f95acc73919325aa3571c87c1f0f19cd46d5c71 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 18 Dec 2020 18:41:01 -0700 Subject: [PATCH 34/68] Run the effect to completion rather than chopping it off --- src/effects/fireworks/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 4ca5c59fa7..96a27531af 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -84,14 +84,14 @@ export default class Fireworks implements ICanvasEffect { } private updateWorld = () => { - if (!this.isRunning) return; + if (!this.isRunning && this.particles.length === 0) return; this.update(); this.paint(); this.supportsAnimationFrame.call(window, this.updateWorld); } private update = () => { - if (this.particles.length < this.options.maxCount) { + if (this.particles.length < this.options.maxCount && this.isRunning) { this.createFirework(); } const alive = []; @@ -142,8 +142,6 @@ export default class Fireworks implements ICanvasEffect { public stop = async () => { this.isRunning = false; - this.particles = []; - this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height); } private drawParticle = (particle: FireworksParticle): void => { From b24a98c6d240556a628fca144c256e10474ddb25 Mon Sep 17 00:00:00 2001 From: nurjinn jafar Date: Thu, 17 Dec 2020 16:57:59 +0100 Subject: [PATCH 35/68] fireworks effect added --- src/effects/fireworks/index.ts | 167 +++++++++++++++++++++++++++++++++ src/effects/index.ts | 17 ++++ src/i18n/strings/en_EN.json | 2 + 3 files changed, 186 insertions(+) create mode 100644 src/effects/fireworks/index.ts diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts new file mode 100644 index 0000000000..7c84e31f1d --- /dev/null +++ b/src/effects/fireworks/index.ts @@ -0,0 +1,167 @@ +/* + Copyright 2020 Nurjin Jafar + Copyright 2020 Nordeck IT + Consulting GmbH. + + 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 ICanvasEffect from '../ICanvasEffect'; + +export type FireworksOptions = { + /** + * the maximum number of the fireworks + */ + maxCount: number, + /** + * the alpha opacity of the fireworks (between 0 and 1, where 1 is opaque and 0 is invisible) + */ + gravity: number, + probability: number, +} + +type FireworksParticle = { + color: string, + x: number, + y: number, + vx: number, + vy: number, + alpha: number, + w: number, + h: number +} + +export const DefaultOptions: FireworksOptions = { + maxCount: 500, + gravity: 0.05, + probability: 0.04, +}; + +export default class Fireworks implements ICanvasEffect { + private readonly options: FireworksOptions; + + constructor(options: { [key: string]: any }) { + this.options = {...DefaultOptions, ...options}; + } + + private context: CanvasRenderingContext2D | null = null; + private supportsAnimationFrame = window.requestAnimationFrame || + function(callback) { + window.setTimeout(callback, 1000/60); + }; + private particles: Array = []; + public isRunning: boolean; + + public start = async (canvas: HTMLCanvasElement, timeout = 4000) => { + if (!canvas) { + return; + } + this.isRunning = true; + this.context = canvas.getContext('2d'); + this.supportsAnimationFrame.call(window, this.updateWorld); + if (timeout) { + window.setTimeout(this.stop, timeout); + } + } + + private updateWorld = () => { + if (!this.isRunning) return; + this.update(); + this.paint(); + this.supportsAnimationFrame.call(window, this.updateWorld); + } + private update = () => { + if (this.particles.length < this.options.maxCount && Math.random() < this.options.probability) { + this.createFirework(); + } + const alive = []; + for (let i=0; i { + if (!this.context || !this.context.canvas) return; + this.context.globalCompositeOperation = 'source-over'; + this.context.fillStyle = "rgba(0,0,0,0.2)"; + this.context.canvas.style.opacity = "0.8"; + this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height); + this.context.globalCompositeOperation = 'lighter'; + for (let i=0; i { + if (!this.context || !this.context.canvas) return; + const width = this.context.canvas.width; + const height = this.context.canvas.height; + const xPoint = Math.random() * (width - 200) + 100; + const yPoint = Math.random() * (height - 200) + 100; + const nFire = Math.random() * 50 + 100; + const color = "rgb("+(~~(Math.random()*200+55))+"," + +(~~(Math.random()*200+55))+","+(~~(Math.random()*200+55))+")"; + for (let i=0; i{}; + particle.color = color; + particle.w = particle.h = Math.random() * 4 + 1; + particle.x = xPoint - particle.w / 2; + particle.y = yPoint - particle.h / 2; + particle.vx = (Math.random()-0.5)*10; + particle.vy = (Math.random()-0.5)*10; + particle.alpha = Math.random()*.5+.5; + const vy = Math.sqrt(25 - particle.vx * particle.vx); + if (Math.abs(particle.vy) > vy) { + particle.vy = particle.vy > 0 ? vy: -vy; + } + this.particles.push(particle); + } + } + + public stop = async () => { + this.isRunning = false; + this.particles = []; + this.context.canvas.style.opacity = "1"; + this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height); + } + + private drawParticle = (particle: FireworksParticle): void => { + if (!this.context || !this.context.canvas) { + return; + } + this.context.save(); + this.context.beginPath(); + + this.context.translate(particle.x + particle.w / 2, particle.y + particle.h / 2); + this.context.arc(0, 0, particle.w, 0, Math.PI * 2); + this.context.fillStyle = particle.color; + this.context.globalAlpha = particle.alpha; + + this.context.closePath(); + this.context.fill(); + this.context.restore(); + } + + + private move = (particle: FireworksParticle) => { + particle.x += particle.vx; + particle.vy += this.options.gravity; + particle.y += particle.vy; + particle.alpha -= 0.01; + return !(particle.x <= -particle.w || particle.x >= screen.width || + particle.y >= screen.height || + particle.alpha <= 0); + } +} diff --git a/src/effects/index.ts b/src/effects/index.ts index 16a0851070..27ed73622f 100644 --- a/src/effects/index.ts +++ b/src/effects/index.ts @@ -64,6 +64,11 @@ type ConfettiOptions = { * use gradient instead of solid particle color */ gradient: boolean, +}; +type FireworksOptions = { + maxCount: number, + gravity: number, + probability: number, } /** @@ -84,6 +89,18 @@ export const CHAT_EFFECTS: Array> = [ gradient: false, }, } as Effect, + { + emojis: ['🎆'], + msgType: 'nic.custom.fireworks', + command: 'fireworks', + description: () => _td("Sends the given message with fireworks"), + fallbackMessage: () => _t("sends fireworks") + "🎆", + options: { + maxCount: 500, + gravity: 0.05, + probability: 0.04, + }, + } as Effect, ]; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index eb1d0a632e..47d0eedf6f 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -849,6 +849,8 @@ "sends confetti": "sends confetti", "You held the call Resume": "You held the call Resume", "%(peerName)s held the call": "%(peerName)s held the call", + "sends fireworks": "sends fireworks", + "Sends the given message with fireworks": "Sends the given message with fireworks", "Video Call": "Video Call", "Voice Call": "Voice Call", "Fill Screen": "Fill Screen", From 4a73402b214bd92002ceb63e9436b427ab9c39b5 Mon Sep 17 00:00:00 2001 From: nurjinn jafar Date: Fri, 18 Dec 2020 14:51:58 +0100 Subject: [PATCH 36/68] comments added --- src/effects/fireworks/index.ts | 19 +++++++++++++++++-- src/effects/index.ts | 6 ++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 7c84e31f1d..3cc209eda3 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -19,23 +19,38 @@ import ICanvasEffect from '../ICanvasEffect'; export type FireworksOptions = { /** - * the maximum number of the fireworks + * max fireworks count */ maxCount: number, /** - * the alpha opacity of the fireworks (between 0 and 1, where 1 is opaque and 0 is invisible) + * gravity value that firework adds to shift from it's start position */ gravity: number, probability: number, } type FireworksParticle = { + /** + * color + */ color: string, + /** + * x,y are the point where the particle starts to position on canvas + */ x: number, y: number, + /** + * vx,vy shift values from x and y + */ vx: number, vy: number, + /** + * the alpha opacity of the firework particle (between 0 and 1, where 1 is opaque and 0 is invisible) + */ alpha: number, + /** + * w,h width and height + */ w: number, h: number } diff --git a/src/effects/index.ts b/src/effects/index.ts index 27ed73622f..07aaa5e736 100644 --- a/src/effects/index.ts +++ b/src/effects/index.ts @@ -66,7 +66,13 @@ type ConfettiOptions = { gradient: boolean, }; type FireworksOptions = { + /** + * max fireworks count + */ maxCount: number, + /** + * gravity value that firework adds to shift from it's start position + */ gravity: number, probability: number, } From 2a2c805031cea506dc9cac76c87a36cc975acdd4 Mon Sep 17 00:00:00 2001 From: nurjinn jafar Date: Fri, 18 Dec 2020 15:30:50 +0100 Subject: [PATCH 37/68] changed canvas globalCompositeOperation value and removed probability --- src/effects/fireworks/index.ts | 9 +++------ src/effects/index.ts | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 3cc209eda3..b9898b8b22 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -26,7 +26,6 @@ export type FireworksOptions = { * gravity value that firework adds to shift from it's start position */ gravity: number, - probability: number, } type FireworksParticle = { @@ -58,7 +57,6 @@ type FireworksParticle = { export const DefaultOptions: FireworksOptions = { maxCount: 500, gravity: 0.05, - probability: 0.04, }; export default class Fireworks implements ICanvasEffect { @@ -95,7 +93,7 @@ export default class Fireworks implements ICanvasEffect { this.supportsAnimationFrame.call(window, this.updateWorld); } private update = () => { - if (this.particles.length < this.options.maxCount && Math.random() < this.options.probability) { + if (this.particles.length < this.options.maxCount) { this.createFirework(); } const alive = []; @@ -109,9 +107,8 @@ export default class Fireworks implements ICanvasEffect { private paint = () => { if (!this.context || !this.context.canvas) return; - this.context.globalCompositeOperation = 'source-over'; - this.context.fillStyle = "rgba(0,0,0,0.2)"; - this.context.canvas.style.opacity = "0.8"; + this.context.globalCompositeOperation = 'destination-out'; + this.context.fillStyle = "rgba(0,0,0,0.5)"; this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height); this.context.globalCompositeOperation = 'lighter'; for (let i=0; i> = [ options: { maxCount: 500, gravity: 0.05, - probability: 0.04, }, } as Effect, ]; From 1fd6809388260a8947578e9b2605824ed7ce786c Mon Sep 17 00:00:00 2001 From: nurjinn jafar Date: Fri, 18 Dec 2020 15:32:44 +0100 Subject: [PATCH 38/68] removed unnecessary opacity --- src/effects/fireworks/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index b9898b8b22..ee32c9ac9c 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -145,7 +145,6 @@ export default class Fireworks implements ICanvasEffect { public stop = async () => { this.isRunning = false; this.particles = []; - this.context.canvas.style.opacity = "1"; this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height); } From a966319c90e83d28bfd0162153236eaf2bc07478 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 18 Dec 2020 18:39:16 -0700 Subject: [PATCH 39/68] Fix minor lint problems --- src/effects/fireworks/index.ts | 21 +++++++++++---------- src/effects/index.ts | 14 +++++++------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index ee32c9ac9c..8f6cc5d82f 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -21,37 +21,37 @@ export type FireworksOptions = { /** * max fireworks count */ - maxCount: number, + maxCount: number; /** * gravity value that firework adds to shift from it's start position */ - gravity: number, + gravity: number; } type FireworksParticle = { /** * color */ - color: string, + color: string; /** * x,y are the point where the particle starts to position on canvas */ - x: number, - y: number, + x: number; + y: number; /** * vx,vy shift values from x and y */ - vx: number, - vy: number, + vx: number; + vy: number; /** * the alpha opacity of the firework particle (between 0 and 1, where 1 is opaque and 0 is invisible) */ - alpha: number, + alpha: number; /** * w,h width and height */ - w: number, - h: number + w: number; + h: number; } export const DefaultOptions: FireworksOptions = { @@ -92,6 +92,7 @@ export default class Fireworks implements ICanvasEffect { this.paint(); this.supportsAnimationFrame.call(window, this.updateWorld); } + private update = () => { if (this.particles.length < this.options.maxCount) { this.createFirework(); diff --git a/src/effects/index.ts b/src/effects/index.ts index 990d1e68ef..27f1902d7c 100644 --- a/src/effects/index.ts +++ b/src/effects/index.ts @@ -47,33 +47,33 @@ type ConfettiOptions = { /** * max confetti count */ - maxCount: number, + maxCount: number; /** * particle animation speed */ - speed: number, + speed: number; /** * the confetti animation frame interval in milliseconds */ - frameInterval: number, + frameInterval: number; /** * the alpha opacity of the confetti (between 0 and 1, where 1 is opaque and 0 is invisible) */ - alpha: number, + alpha: number; /** * use gradient instead of solid particle color */ - gradient: boolean, + gradient: boolean; }; type FireworksOptions = { /** * max fireworks count */ - maxCount: number, + maxCount: number; /** * gravity value that firework adds to shift from it's start position */ - gravity: number, + gravity: number; } /** From ec92be4ec479e26b8f6f316ba6b4f32429969a15 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 18 Dec 2020 18:40:11 -0700 Subject: [PATCH 40/68] Lower effect time by 1 second It feels like it runs a bit too long --- src/effects/fireworks/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 8f6cc5d82f..15ba286503 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -74,7 +74,7 @@ export default class Fireworks implements ICanvasEffect { private particles: Array = []; public isRunning: boolean; - public start = async (canvas: HTMLCanvasElement, timeout = 4000) => { + public start = async (canvas: HTMLCanvasElement, timeout = 3000) => { if (!canvas) { return; } From 4fea266003dcc04b95d0521c22d7160f8d2f7839 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 18 Dec 2020 18:40:30 -0700 Subject: [PATCH 41/68] Use the same requestAnimationFrame as confetti --- src/effects/fireworks/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 15ba286503..4ca5c59fa7 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -67,10 +67,7 @@ export default class Fireworks implements ICanvasEffect { } private context: CanvasRenderingContext2D | null = null; - private supportsAnimationFrame = window.requestAnimationFrame || - function(callback) { - window.setTimeout(callback, 1000/60); - }; + private supportsAnimationFrame = window.requestAnimationFrame; private particles: Array = []; public isRunning: boolean; From ce638e717d9d5c4eee0ad819a158e31c945f69f1 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 18 Dec 2020 18:41:01 -0700 Subject: [PATCH 42/68] Run the effect to completion rather than chopping it off --- src/effects/fireworks/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 4ca5c59fa7..96a27531af 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -84,14 +84,14 @@ export default class Fireworks implements ICanvasEffect { } private updateWorld = () => { - if (!this.isRunning) return; + if (!this.isRunning && this.particles.length === 0) return; this.update(); this.paint(); this.supportsAnimationFrame.call(window, this.updateWorld); } private update = () => { - if (this.particles.length < this.options.maxCount) { + if (this.particles.length < this.options.maxCount && this.isRunning) { this.createFirework(); } const alive = []; @@ -142,8 +142,6 @@ export default class Fireworks implements ICanvasEffect { public stop = async () => { this.isRunning = false; - this.particles = []; - this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height); } private drawParticle = (particle: FireworksParticle): void => { From 5c309042e681d04aaeb73ee152695f0a25d3cfe6 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 18 Dec 2020 18:46:59 -0700 Subject: [PATCH 43/68] fix i18n order --- src/i18n/strings/en_EN.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 47d0eedf6f..b96d767ccb 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -847,10 +847,10 @@ "This is your list of users/servers you have blocked - don't leave the room!": "This is your list of users/servers you have blocked - don't leave the room!", "Sends the given message with confetti": "Sends the given message with confetti", "sends confetti": "sends confetti", + "Sends the given message with fireworks": "Sends the given message with fireworks", + "sends fireworks": "sends fireworks", "You held the call Resume": "You held the call Resume", "%(peerName)s held the call": "%(peerName)s held the call", - "sends fireworks": "sends fireworks", - "Sends the given message with fireworks": "Sends the given message with fireworks", "Video Call": "Video Call", "Voice Call": "Voice Call", "Fill Screen": "Fill Screen", From 9263bf7cdaa1d4b90ef2c753b05e77f3495e5ab3 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 20 Dec 2020 23:29:03 -0700 Subject: [PATCH 44/68] Add a snowfall chat effect (with /snowfall command) --- src/effects/index.ts | 28 ++++++- src/effects/snowfall/index.ts | 151 ++++++++++++++++++++++++++++++++++ src/i18n/strings/en_EN.json | 2 + 3 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 src/effects/snowfall/index.ts diff --git a/src/effects/index.ts b/src/effects/index.ts index 27f1902d7c..a22948ebcf 100644 --- a/src/effects/index.ts +++ b/src/effects/index.ts @@ -75,6 +75,20 @@ type FireworksOptions = { */ gravity: number; } +type SnowfallOptions = { + /** + * The maximum number of snowflakes to render at a given time + */ + maxCount: number; + /** + * The amount of gravity to apply to the snowflakes + */ + gravity: number; + /** + * The amount of drift (horizontal sway) to apply to the snowflakes. Each snowflake varies. + */ + maxDrift: number; +} /** * This configuration defines room effects that can be triggered by custom message types and emojis @@ -99,12 +113,24 @@ export const CHAT_EFFECTS: Array> = [ msgType: 'nic.custom.fireworks', command: 'fireworks', description: () => _td("Sends the given message with fireworks"), - fallbackMessage: () => _t("sends fireworks") + "🎆", + fallbackMessage: () => _t("sends fireworks") + " 🎆", options: { maxCount: 500, gravity: 0.05, }, } as Effect, + { + emojis: ['❄', '🌨'], + msgType: 'io.element.effect.snowfall', + command: 'snowfall', + description: () => _td("Sends the given message with snowfall"), + fallbackMessage: () => _t("sends snowfall") + " ❄", + options: { + maxCount: 200, + gravity: 0.05, + maxDrift: 5, + }, + } as Effect, ]; diff --git a/src/effects/snowfall/index.ts b/src/effects/snowfall/index.ts new file mode 100644 index 0000000000..a91d17379b --- /dev/null +++ b/src/effects/snowfall/index.ts @@ -0,0 +1,151 @@ +/* + Copyright 2020 The 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 ICanvasEffect from '../ICanvasEffect'; +import { arrayFastClone } from "../../utils/arrays"; + +export type SnowfallOptions = { + /** + * The maximum number of snowflakes to render at a given time + */ + maxCount: number; + /** + * The amount of gravity to apply to the snowflakes + */ + gravity: number; + /** + * The amount of drift (horizontal sway) to apply to the snowflakes. Each snowflake varies. + */ + maxDrift: number; +} + +type Snowflake = { + x: number; + y: number; + xCol: number; + diameter: number; + maximumDrift: number; + gravity: number; +} + +export const DefaultOptions: SnowfallOptions = { + maxCount: 200, + gravity: 0.05, + maxDrift: 5, +}; + +const KEY_FRAME_INTERVAL = 15; // 15ms, roughly + +export default class Snowfall implements ICanvasEffect { + private readonly options: SnowfallOptions; + + constructor(options: { [key: string]: any }) { + this.options = {...DefaultOptions, ...options}; + } + + private context: CanvasRenderingContext2D | null = null; + private particles: Array = []; + private lastAnimationTime: number; + + public isRunning: boolean; + + public start = async (canvas: HTMLCanvasElement, timeout = 3000) => { + if (!canvas) { + return; + } + this.context = canvas.getContext('2d'); + this.particles = []; + const count = this.options.maxCount; + while (this.particles.length < count) { + this.particles.push(this.resetParticle({} as Snowflake, canvas.width, canvas.height)); + } + this.isRunning = true; + requestAnimationFrame(this.renderLoop); + if (timeout) { + window.setTimeout(this.stop, timeout); + } + } + + public stop = async () => { + this.isRunning = false; + } + + private resetParticle = (particle: Snowflake, width: number, height: number): Snowflake => { + particle.x = Math.random() * width; + particle.y = Math.random() * -height; + particle.xCol = particle.x; + particle.diameter = (Math.random() * 7) + 4; + particle.maximumDrift = (Math.random() * this.options.maxDrift) + 3.5; + particle.gravity = this.options.gravity + (Math.random() * 6) + 4; + return particle; + } + + private renderLoop = (): void => { + if (!this.context || !this.context.canvas) { + return; + } + if (this.particles.length === 0) { + this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height); + } else { + const timeDelta = Date.now() - this.lastAnimationTime; + if (timeDelta >= KEY_FRAME_INTERVAL || !this.lastAnimationTime) { + // Clear the screen first + this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height); + + this.lastAnimationTime = Date.now(); + this.animateAndRenderSnowflakes(); + } + requestAnimationFrame(this.renderLoop); + } + }; + + private animateAndRenderSnowflakes() { + if (!this.context || !this.context.canvas) { + return; + } + const height = this.context.canvas.height; + for (const particle of arrayFastClone(this.particles)) { + const leftMax = particle.xCol - particle.maximumDrift; + const rightMax = particle.xCol + particle.maximumDrift; + + particle.y += particle.gravity; + + // We treat the drift as a sine function to have a more fluid-like movement instead + // of a pong-like movement off walls of the X column. This means that for + // $x=A\sin(\frac{2\pi}{P}y)$ we use the `maximumDrift` as the amplitude (A) and a + // large multiplier to create a very long waveform through P. + const peakDistance = 75 * particle.maximumDrift; + const PI2 = Math.PI * 2; + particle.x = particle.maximumDrift * Math.sin((PI2 / peakDistance) * particle.y); + particle.x += particle.xCol; // bring the particle to the right place + + const radius = particle.diameter / 2; + this.context.save(); + this.context.beginPath(); + this.context.ellipse(particle.x, particle.y, radius, radius, 0, 0, 360); + this.context.fillStyle = '#eaeaea'; // grey so it shows up on the light theme + this.context.fill(); + this.context.closePath(); + this.context.restore(); + + // Remove any dead snowflakes + const maxBounds = radius * 4; // make sure it's *really* off screen + if (particle.y > (height + maxBounds)) { + const idx = this.particles.indexOf(particle); + this.particles.splice(idx, 1); + } + } + } +} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 2fb70ecdb1..12d8171439 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -851,6 +851,8 @@ "sends confetti": "sends confetti", "Sends the given message with fireworks": "Sends the given message with fireworks", "sends fireworks": "sends fireworks", + "Sends the given message with snowfall": "Sends the given message with snowfall", + "sends snowfall": "sends snowfall", "You held the call Resume": "You held the call Resume", "%(peerName)s held the call": "%(peerName)s held the call", "Video Call": "Video Call", From a0d925b879e67b8f4683b75eb73efc4b7b961d0e Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 20 Dec 2020 23:29:03 -0700 Subject: [PATCH 45/68] Add a snowfall chat effect (with /snowfall command) --- src/effects/index.ts | 28 ++++++- src/effects/snowfall/index.ts | 148 ++++++++++++++++++++++++++++++++++ src/i18n/strings/en_EN.json | 2 + 3 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 src/effects/snowfall/index.ts diff --git a/src/effects/index.ts b/src/effects/index.ts index 27f1902d7c..a22948ebcf 100644 --- a/src/effects/index.ts +++ b/src/effects/index.ts @@ -75,6 +75,20 @@ type FireworksOptions = { */ gravity: number; } +type SnowfallOptions = { + /** + * The maximum number of snowflakes to render at a given time + */ + maxCount: number; + /** + * The amount of gravity to apply to the snowflakes + */ + gravity: number; + /** + * The amount of drift (horizontal sway) to apply to the snowflakes. Each snowflake varies. + */ + maxDrift: number; +} /** * This configuration defines room effects that can be triggered by custom message types and emojis @@ -99,12 +113,24 @@ export const CHAT_EFFECTS: Array> = [ msgType: 'nic.custom.fireworks', command: 'fireworks', description: () => _td("Sends the given message with fireworks"), - fallbackMessage: () => _t("sends fireworks") + "🎆", + fallbackMessage: () => _t("sends fireworks") + " 🎆", options: { maxCount: 500, gravity: 0.05, }, } as Effect, + { + emojis: ['❄', '🌨'], + msgType: 'io.element.effect.snowfall', + command: 'snowfall', + description: () => _td("Sends the given message with snowfall"), + fallbackMessage: () => _t("sends snowfall") + " ❄", + options: { + maxCount: 200, + gravity: 0.05, + maxDrift: 5, + }, + } as Effect, ]; diff --git a/src/effects/snowfall/index.ts b/src/effects/snowfall/index.ts new file mode 100644 index 0000000000..2affb50405 --- /dev/null +++ b/src/effects/snowfall/index.ts @@ -0,0 +1,148 @@ +/* + Copyright 2020 The 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 ICanvasEffect from '../ICanvasEffect'; +import { arrayFastClone } from "../../utils/arrays"; + +export type SnowfallOptions = { + /** + * The maximum number of snowflakes to render at a given time + */ + maxCount: number; + /** + * The amount of gravity to apply to the snowflakes + */ + gravity: number; + /** + * The amount of drift (horizontal sway) to apply to the snowflakes. Each snowflake varies. + */ + maxDrift: number; +} + +type Snowflake = { + x: number; + y: number; + xCol: number; + diameter: number; + maximumDrift: number; + gravity: number; +} + +export const DefaultOptions: SnowfallOptions = { + maxCount: 200, + gravity: 0.05, + maxDrift: 5, +}; + +const KEY_FRAME_INTERVAL = 15; // 15ms, roughly + +export default class Snowfall implements ICanvasEffect { + private readonly options: SnowfallOptions; + + constructor(options: { [key: string]: any }) { + this.options = {...DefaultOptions, ...options}; + } + + private context: CanvasRenderingContext2D | null = null; + private particles: Array = []; + private lastAnimationTime: number; + + public isRunning: boolean; + + public start = async (canvas: HTMLCanvasElement, timeout = 3000) => { + if (!canvas) { + return; + } + this.context = canvas.getContext('2d'); + this.particles = []; + const count = this.options.maxCount; + while (this.particles.length < count) { + this.particles.push(this.resetParticle({} as Snowflake, canvas.width, canvas.height)); + } + this.isRunning = true; + requestAnimationFrame(this.renderLoop); + if (timeout) { + window.setTimeout(this.stop, timeout); + } + } + + public stop = async () => { + this.isRunning = false; + } + + private resetParticle = (particle: Snowflake, width: number, height: number): Snowflake => { + particle.x = Math.random() * width; + particle.y = Math.random() * -height; + particle.xCol = particle.x; + particle.diameter = (Math.random() * 7) + 4; + particle.maximumDrift = (Math.random() * this.options.maxDrift) + 3.5; + particle.gravity = this.options.gravity + (Math.random() * 6) + 4; + return particle; + } + + private renderLoop = (): void => { + if (!this.context || !this.context.canvas) { + return; + } + if (this.particles.length === 0) { + this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height); + } else { + const timeDelta = Date.now() - this.lastAnimationTime; + if (timeDelta >= KEY_FRAME_INTERVAL || !this.lastAnimationTime) { + // Clear the screen first + this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height); + + this.lastAnimationTime = Date.now(); + this.animateAndRenderSnowflakes(); + } + requestAnimationFrame(this.renderLoop); + } + }; + + private animateAndRenderSnowflakes() { + if (!this.context || !this.context.canvas) { + return; + } + const height = this.context.canvas.height; + for (const particle of arrayFastClone(this.particles)) { + particle.y += particle.gravity; + + // We treat the drift as a sine function to have a more fluid-like movement instead + // of a pong-like movement off walls of the X column. This means that for + // $x=A\sin(\frac{2\pi}{P}y)$ we use the `maximumDrift` as the amplitude (A) and a + // large multiplier to create a very long waveform through P. + const peakDistance = 75 * particle.maximumDrift; + const PI2 = Math.PI * 2; + particle.x = particle.maximumDrift * Math.sin((PI2 / peakDistance) * particle.y); + particle.x += particle.xCol; // bring the particle to the right place + + const radius = particle.diameter / 2; + this.context.save(); + this.context.beginPath(); + this.context.ellipse(particle.x, particle.y, radius, radius, 0, 0, 360); + this.context.fillStyle = '#eaeaea'; // grey so it shows up on the light theme + this.context.fill(); + this.context.closePath(); + this.context.restore(); + + // Remove any dead snowflakes + const maxBounds = radius * 4; // make sure it's *really* off screen + if (particle.y > (height + maxBounds)) { + const idx = this.particles.indexOf(particle); + this.particles.splice(idx, 1); + } + } + } +} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index b96d767ccb..556d217837 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -849,6 +849,8 @@ "sends confetti": "sends confetti", "Sends the given message with fireworks": "Sends the given message with fireworks", "sends fireworks": "sends fireworks", + "Sends the given message with snowfall": "Sends the given message with snowfall", + "sends snowfall": "sends snowfall", "You held the call Resume": "You held the call Resume", "%(peerName)s held the call": "%(peerName)s held the call", "Video Call": "Video Call", From d53ee58b18a04bedfdb0db13915f3d3606be0ab5 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 21 Dec 2020 00:18:58 -0700 Subject: [PATCH 46/68] Appease the linter --- src/effects/snowfall/index.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/effects/snowfall/index.ts b/src/effects/snowfall/index.ts index a91d17379b..2affb50405 100644 --- a/src/effects/snowfall/index.ts +++ b/src/effects/snowfall/index.ts @@ -117,9 +117,6 @@ export default class Snowfall implements ICanvasEffect { } const height = this.context.canvas.height; for (const particle of arrayFastClone(this.particles)) { - const leftMax = particle.xCol - particle.maximumDrift; - const rightMax = particle.xCol + particle.maximumDrift; - particle.y += particle.gravity; // We treat the drift as a sine function to have a more fluid-like movement instead From f63572f02b1783940838ed7f2be586d6615f76a5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 18 Dec 2020 18:08:04 +0000 Subject: [PATCH 47/68] Visual fixups for call UI * Add bottom margin on PiP view * Remove avatar blurring & pause icon for held calls * Change background of incoming call box to match PiP view * Put drop shadow & border radius on PiP view & incoming call box rather than the CallContainer they're in (so they each have their own drop shadow / rounded corners). * Add margin between incoming call box and PiP view --- res/css/views/voip/_CallContainer.scss | 7 +++---- res/css/views/voip/_CallView.scss | 10 ++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/res/css/views/voip/_CallContainer.scss b/res/css/views/voip/_CallContainer.scss index eec8a1f188..ae1d37de71 100644 --- a/res/css/views/voip/_CallContainer.scss +++ b/res/css/views/voip/_CallContainer.scss @@ -18,10 +18,7 @@ limitations under the License. position: absolute; right: 20px; bottom: 72px; - border-radius: 8px; - overflow: hidden; z-index: 100; - box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08); // Disable pointer events for Jitsi widgets to function. Direct // calls have their own cursor and behaviour, but we need to make @@ -49,8 +46,10 @@ limitations under the License. .mx_IncomingCallBox { min-width: 250px; - background-color: $primary-bg-color; + background-color: $secondary-accent-color; padding: 8px; + box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08); + border-radius: 8px; pointer-events: initial; // restore pointer events so the user can accept/decline cursor: pointer; diff --git a/res/css/views/voip/_CallView.scss b/res/css/views/voip/_CallView.scss index dbe2c27e41..ad63604818 100644 --- a/res/css/views/voip/_CallView.scss +++ b/res/css/views/voip/_CallView.scss @@ -35,6 +35,10 @@ limitations under the License. .mx_CallView_pip { width: 320px; + padding-bottom: 8px; + margin-top: 10px; + box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08); + border-radius: 8px; .mx_CallView_voice { height: 180px; @@ -84,6 +88,7 @@ limitations under the License. border-radius: 2000px; overflow: hidden; position: relative; + /* Blurred avatar images & pause icon for on-hold removed for now &::after { position: absolute; content: ''; @@ -101,17 +106,21 @@ limitations under the License. .mx_CallView_pip &::after { background-size: 30px; } + */ } + /* .mx_BaseAvatar { filter: blur(20px); overflow: hidden; } + */ } .mx_CallView_voice_secondaryAvatarContainer { border-radius: 2000px; overflow: hidden; position: relative; + /* &::after { position: absolute; content: ''; @@ -129,6 +138,7 @@ limitations under the License. .mx_CallView_pip &::after { background-size: 24px; } + */ } .mx_CallView_voice_holdText { From 7cc00faeb33cd7366046d7381fde9173818a5955 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 18 Dec 2020 19:35:41 +0000 Subject: [PATCH 48/68] Vary resume link text Use 'Switch' if unholding that call would hold another --- src/CallHandler.tsx | 12 ++++++++++++ src/components/views/voip/CallView.tsx | 6 ++++-- src/i18n/strings/en_EN.json | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index fac4d6fc4e..8ce0da36dc 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -616,6 +616,18 @@ export default class CallHandler { } } + /** + * @returns true if we are currently in anu call where we haven't put the remote party on hold + */ + hasAnyUnheldCall() { + for (const call of this.calls.values()) { + if (call.state === CallState.Ended) continue; + if (!call.isRemoteOnHold()) return true; + } + + return false; + } + private async startCallApp(roomId: string, type: string) { dis.dispatch({ action: 'appsDrawer', diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index 65ba693b58..495a99d53c 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -19,7 +19,7 @@ import React, { createRef, CSSProperties, ReactNode } from 'react'; import dis from '../../../dispatcher/dispatcher'; import CallHandler from '../../../CallHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; -import { _t } from '../../../languageHandler'; +import { _t, _td } from '../../../languageHandler'; import VideoFeed, { VideoFeedType } from "./VideoFeed"; import RoomAvatar from "../avatars/RoomAvatar"; import { CallState, CallType, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; @@ -423,7 +423,9 @@ export default class CallView extends React.Component { const isOnHold = this.state.isLocalOnHold || this.state.isRemoteOnHold; let onHoldText = null; if (this.state.isRemoteOnHold) { - onHoldText = _t("You held the call Resume", {}, { + const holdString = CallHandler.sharedInstance().hasAnyUnheldCall() ? + _td("You held the call Switch") : _td("You held the call Resume"); + onHoldText = _t(holdString, {}, { a: sub => {sub} , diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 556d217837..dcaffdfbcd 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -851,6 +851,7 @@ "sends fireworks": "sends fireworks", "Sends the given message with snowfall": "Sends the given message with snowfall", "sends snowfall": "sends snowfall", + "You held the call Switch": "You held the call Switch", "You held the call Resume": "You held the call Resume", "%(peerName)s held the call": "%(peerName)s held the call", "Video Call": "Video Call", From f325df3b6a587c11c205f8fdbefc524f961ea16d Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 18 Dec 2020 19:40:57 +0000 Subject: [PATCH 49/68] Remove secondary call avatar and change 'paused' to 'on hold' --- res/css/views/voip/_CallView.scss | 25 ------------------------- src/components/views/voip/CallView.tsx | 17 +---------------- src/i18n/strings/en_EN.json | 2 +- 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/res/css/views/voip/_CallView.scss b/res/css/views/voip/_CallView.scss index ad63604818..9fcf47cf9e 100644 --- a/res/css/views/voip/_CallView.scss +++ b/res/css/views/voip/_CallView.scss @@ -116,31 +116,6 @@ limitations under the License. */ } -.mx_CallView_voice_secondaryAvatarContainer { - border-radius: 2000px; - overflow: hidden; - position: relative; - /* - &::after { - position: absolute; - content: ''; - width: 100%; - height: 100%; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - background-color: rgba(0, 0, 0, 0.6); - background-image: url('$(res)/img/voip/paused.svg'); - background-position: center; - background-size: 40px; - background-repeat: no-repeat; - } - .mx_CallView_pip &::after { - background-size: 24px; - } - */ -} - .mx_CallView_voice_holdText { height: 20px; padding-top: 20px; diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index 495a99d53c..6748728278 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -480,20 +480,6 @@ export default class CallView extends React.Component { mx_CallView_voice: true, mx_CallView_voice_hold: isOnHold, }); - let secondaryCallAvatar: ReactNode; - - if (this.props.secondaryCall) { - const secAvatarSize = this.props.pipMode ? 40 : 100; - secondaryCallAvatar =
- -
; - } contentView =
@@ -504,7 +490,6 @@ export default class CallView extends React.Component { width={avatarSize} />
- {secondaryCallAvatar}
{onHoldText}
{callControls} @@ -548,7 +533,7 @@ export default class CallView extends React.Component { - {_t("%(name)s paused", { name: secCallRoom.name })} + {_t("%(name)s on hold", { name: secCallRoom.name })} ; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index dcaffdfbcd..470defd2f9 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -858,7 +858,7 @@ "Voice Call": "Voice Call", "Fill Screen": "Fill Screen", "Return to call": "Return to call", - "%(name)s paused": "%(name)s paused", + "%(name)s on hold": "%(name)s on hold", "Unknown caller": "Unknown caller", "Incoming voice call": "Incoming voice call", "Incoming video call": "Incoming video call", From 68c5482c05e6f2cdbc7fbd221930518249516323 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 21 Dec 2020 11:21:41 +0000 Subject: [PATCH 50/68] Comment typo Co-authored-by: J. Ryan Stinnett --- src/CallHandler.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index c41ec6be05..504dae5c84 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -618,7 +618,7 @@ export default class CallHandler { } /** - * @returns true if we are currently in anu call where we haven't put the remote party on hold + * @returns true if we are currently in any call where we haven't put the remote party on hold */ hasAnyUnheldCall() { for (const call of this.calls.values()) { From 189d5bf769253ad9516d0fd203b70c87f4c0f3fc Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 21 Dec 2020 11:21:50 +0000 Subject: [PATCH 51/68] Comment typo Co-authored-by: J. Ryan Stinnett --- src/CallHandler.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index 8ce0da36dc..0468a3917f 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -617,7 +617,7 @@ export default class CallHandler { } /** - * @returns true if we are currently in anu call where we haven't put the remote party on hold + * @returns true if we are currently in any call where we haven't put the remote party on hold */ hasAnyUnheldCall() { for (const call of this.calls.values()) { From 0d4b2f48dc29532a8863f9a35aadc5f13f2e9182 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 21 Dec 2020 11:24:36 +0000 Subject: [PATCH 52/68] Probably better to just remove this --- res/css/views/voip/_CallView.scss | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/res/css/views/voip/_CallView.scss b/res/css/views/voip/_CallView.scss index 9fcf47cf9e..a9b02ff5d8 100644 --- a/res/css/views/voip/_CallView.scss +++ b/res/css/views/voip/_CallView.scss @@ -88,32 +88,7 @@ limitations under the License. border-radius: 2000px; overflow: hidden; position: relative; - /* Blurred avatar images & pause icon for on-hold removed for now - &::after { - position: absolute; - content: ''; - width: 100%; - height: 100%; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - background-color: rgba(0, 0, 0, 0.6); - background-image: url('$(res)/img/voip/paused.svg'); - background-position: center; - background-size: 40px; - background-repeat: no-repeat; - } - .mx_CallView_pip &::after { - background-size: 30px; - } - */ } - /* - .mx_BaseAvatar { - filter: blur(20px); - overflow: hidden; - } - */ } .mx_CallView_voice_holdText { From d851c826e5fe1a43bbdf02776797b6bdca371ec7 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 21 Dec 2020 11:24:36 +0000 Subject: [PATCH 53/68] Probably better to just remove this --- res/css/views/voip/_CallView.scss | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/res/css/views/voip/_CallView.scss b/res/css/views/voip/_CallView.scss index 9fcf47cf9e..a9b02ff5d8 100644 --- a/res/css/views/voip/_CallView.scss +++ b/res/css/views/voip/_CallView.scss @@ -88,32 +88,7 @@ limitations under the License. border-radius: 2000px; overflow: hidden; position: relative; - /* Blurred avatar images & pause icon for on-hold removed for now - &::after { - position: absolute; - content: ''; - width: 100%; - height: 100%; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - background-color: rgba(0, 0, 0, 0.6); - background-image: url('$(res)/img/voip/paused.svg'); - background-position: center; - background-size: 40px; - background-repeat: no-repeat; - } - .mx_CallView_pip &::after { - background-size: 30px; - } - */ } - /* - .mx_BaseAvatar { - filter: blur(20px); - overflow: hidden; - } - */ } .mx_CallView_voice_holdText { From 162a5de82e335ccaebdc25dd41ee85b80420eb02 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Dec 2020 12:46:29 +0000 Subject: [PATCH 54/68] Rename and reformat Element URL pattern This is just a code style cleanup. There are no behaviour changes in this commit. --- src/HtmlUtils.tsx | 2 +- src/linkify-matrix.js | 15 ++++++++------- src/utils/permalinks/Permalinks.js | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx index 2301ad250b..ba0781f0a4 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -163,7 +163,7 @@ const transformTags: IExtendedSanitizeOptions["transformTags"] = { // custom to attribs.target = '_blank'; // by default const transformed = tryTransformPermalinkToLocalHref(attribs.href); - if (transformed !== attribs.href || attribs.href.match(linkifyMatrix.VECTOR_URL_PATTERN)) { + if (transformed !== attribs.href || attribs.href.match(linkifyMatrix.ELEMENT_URL_PATTERN)) { attribs.href = transformed; delete attribs.target; } diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index 77c62ce84d..bee8e95137 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -183,12 +183,13 @@ const escapeRegExp = function(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); }; -// Recognise URLs from both our local vector and official vector as vector. -// anyone else really should be using matrix.to. -matrixLinkify.VECTOR_URL_PATTERN = "^(?:https?://)?(?:" - + escapeRegExp(window.location.host + window.location.pathname) + "|" - + "(?:www\\.)?(?:riot|vector)\\.im/(?:app|beta|staging|develop)/" - + ")(#.*)"; +// Recognise URLs from both our local and official Element deployments. +// Anyone else really should be using matrix.to. +matrixLinkify.ELEMENT_URL_PATTERN = + "^(?:https?://)?(?:" + + escapeRegExp(window.location.host + window.location.pathname) + "|" + + "(?:www\\.)?(?:riot|vector)\\.im/(?:app|beta|staging|develop)/" + + ")(#.*)"; matrixLinkify.MATRIXTO_URL_PATTERN = "^(?:https?://)?(?:www\\.)?matrix\\.to/#/(([#@!+]).*)"; matrixLinkify.MATRIXTO_MD_LINK_PATTERN = @@ -253,7 +254,7 @@ matrixLinkify.options = { target: function(href, type) { if (type === 'url') { const transformed = tryTransformPermalinkToLocalHref(href); - if (transformed !== href || href.match(matrixLinkify.VECTOR_URL_PATTERN)) { + if (transformed !== href || href.match(matrixLinkify.ELEMENT_URL_PATTERN)) { return null; } else { return '_blank'; diff --git a/src/utils/permalinks/Permalinks.js b/src/utils/permalinks/Permalinks.js index 39c5776852..e157ecc55e 100644 --- a/src/utils/permalinks/Permalinks.js +++ b/src/utils/permalinks/Permalinks.js @@ -331,7 +331,7 @@ export function tryTransformPermalinkToLocalHref(permalink: string): string { return permalink; } - const m = permalink.match(matrixLinkify.VECTOR_URL_PATTERN); + const m = permalink.match(matrixLinkify.ELEMENT_URL_PATTERN); if (m) { return m[1]; } @@ -365,7 +365,7 @@ export function getPrimaryPermalinkEntity(permalink: string): string { // If not a permalink, try the vector patterns. if (!permalinkParts) { - const m = permalink.match(matrixLinkify.VECTOR_URL_PATTERN); + const m = permalink.match(matrixLinkify.ELEMENT_URL_PATTERN); if (m) { // A bit of a hack, but it gets the job done const handler = new ElementPermalinkConstructor("http://localhost"); From 5d78418530f9c2f90638ee567a45c2cc3c2616c9 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Dec 2020 13:15:00 +0000 Subject: [PATCH 55/68] Recognise *.element.io links as Element permalinks This ensures all Elements detect permalinks to official deployments as Element and handle them internally. Fixes https://github.com/vector-im/element-web/issues/16005 --- src/linkify-matrix.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index bee8e95137..1a40fde26f 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -188,7 +188,8 @@ const escapeRegExp = function(string) { matrixLinkify.ELEMENT_URL_PATTERN = "^(?:https?://)?(?:" + escapeRegExp(window.location.host + window.location.pathname) + "|" + - "(?:www\\.)?(?:riot|vector)\\.im/(?:app|beta|staging|develop)/" + + "(?:www\\.)?(?:riot|vector)\\.im/(?:app|beta|staging|develop)/|" + + "(?:app|beta|staging|develop)\\.element\\.io/" + ")(#.*)"; matrixLinkify.MATRIXTO_URL_PATTERN = "^(?:https?://)?(?:www\\.)?matrix\\.to/#/(([#@!+]).*)"; From 71cbc8bf29aa62648832f9c4dc20bf9659fd3614 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Dec 2020 12:46:29 +0000 Subject: [PATCH 56/68] Rename and reformat Element URL pattern This is just a code style cleanup. There are no behaviour changes in this commit. --- src/HtmlUtils.tsx | 2 +- src/linkify-matrix.js | 15 ++++++++------- src/utils/permalinks/Permalinks.js | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx index 2301ad250b..ba0781f0a4 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -163,7 +163,7 @@ const transformTags: IExtendedSanitizeOptions["transformTags"] = { // custom to attribs.target = '_blank'; // by default const transformed = tryTransformPermalinkToLocalHref(attribs.href); - if (transformed !== attribs.href || attribs.href.match(linkifyMatrix.VECTOR_URL_PATTERN)) { + if (transformed !== attribs.href || attribs.href.match(linkifyMatrix.ELEMENT_URL_PATTERN)) { attribs.href = transformed; delete attribs.target; } diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index 77c62ce84d..bee8e95137 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -183,12 +183,13 @@ const escapeRegExp = function(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); }; -// Recognise URLs from both our local vector and official vector as vector. -// anyone else really should be using matrix.to. -matrixLinkify.VECTOR_URL_PATTERN = "^(?:https?://)?(?:" - + escapeRegExp(window.location.host + window.location.pathname) + "|" - + "(?:www\\.)?(?:riot|vector)\\.im/(?:app|beta|staging|develop)/" - + ")(#.*)"; +// Recognise URLs from both our local and official Element deployments. +// Anyone else really should be using matrix.to. +matrixLinkify.ELEMENT_URL_PATTERN = + "^(?:https?://)?(?:" + + escapeRegExp(window.location.host + window.location.pathname) + "|" + + "(?:www\\.)?(?:riot|vector)\\.im/(?:app|beta|staging|develop)/" + + ")(#.*)"; matrixLinkify.MATRIXTO_URL_PATTERN = "^(?:https?://)?(?:www\\.)?matrix\\.to/#/(([#@!+]).*)"; matrixLinkify.MATRIXTO_MD_LINK_PATTERN = @@ -253,7 +254,7 @@ matrixLinkify.options = { target: function(href, type) { if (type === 'url') { const transformed = tryTransformPermalinkToLocalHref(href); - if (transformed !== href || href.match(matrixLinkify.VECTOR_URL_PATTERN)) { + if (transformed !== href || href.match(matrixLinkify.ELEMENT_URL_PATTERN)) { return null; } else { return '_blank'; diff --git a/src/utils/permalinks/Permalinks.js b/src/utils/permalinks/Permalinks.js index 39c5776852..e157ecc55e 100644 --- a/src/utils/permalinks/Permalinks.js +++ b/src/utils/permalinks/Permalinks.js @@ -331,7 +331,7 @@ export function tryTransformPermalinkToLocalHref(permalink: string): string { return permalink; } - const m = permalink.match(matrixLinkify.VECTOR_URL_PATTERN); + const m = permalink.match(matrixLinkify.ELEMENT_URL_PATTERN); if (m) { return m[1]; } @@ -365,7 +365,7 @@ export function getPrimaryPermalinkEntity(permalink: string): string { // If not a permalink, try the vector patterns. if (!permalinkParts) { - const m = permalink.match(matrixLinkify.VECTOR_URL_PATTERN); + const m = permalink.match(matrixLinkify.ELEMENT_URL_PATTERN); if (m) { // A bit of a hack, but it gets the job done const handler = new ElementPermalinkConstructor("http://localhost"); From 93e24fae7a5b109dc5b53afdcbe73789e777bc81 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Dec 2020 13:15:00 +0000 Subject: [PATCH 57/68] Recognise *.element.io links as Element permalinks This ensures all Elements detect permalinks to official deployments as Element and handle them internally. Fixes https://github.com/vector-im/element-web/issues/16005 --- src/linkify-matrix.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index bee8e95137..1a40fde26f 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -188,7 +188,8 @@ const escapeRegExp = function(string) { matrixLinkify.ELEMENT_URL_PATTERN = "^(?:https?://)?(?:" + escapeRegExp(window.location.host + window.location.pathname) + "|" + - "(?:www\\.)?(?:riot|vector)\\.im/(?:app|beta|staging|develop)/" + + "(?:www\\.)?(?:riot|vector)\\.im/(?:app|beta|staging|develop)/|" + + "(?:app|beta|staging|develop)\\.element\\.io/" + ")(#.*)"; matrixLinkify.MATRIXTO_URL_PATTERN = "^(?:https?://)?(?:www\\.)?matrix\\.to/#/(([#@!+]).*)"; From 44c705e41c73676f27c96d9c8975330391ffc71a Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Dec 2020 15:24:59 +0000 Subject: [PATCH 58/68] Look for emoji in the body that will be displayed Fixes https://github.com/vector-im/element-web/issues/16013 --- src/HtmlUtils.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx index ba0781f0a4..637c0a2696 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -438,13 +438,14 @@ export function bodyToHtml(content: IContent, highlights: string[], opts: IOpts delete sanitizeParams.textFilter; } + const contentBody = isDisplayedWithHtml ? safeBody : strippedBody; if (opts.returnString) { - return isDisplayedWithHtml ? safeBody : strippedBody; + return contentBody; } let emojiBody = false; if (!opts.disableBigEmoji && bodyHasEmoji) { - let contentBodyTrimmed = strippedBody !== undefined ? strippedBody.trim() : ''; + let contentBodyTrimmed = contentBody !== undefined ? contentBody.trim() : ''; // Ignore spaces in body text. Emojis with spaces in between should // still be counted as purely emoji messages. From 3907826cd627c6365d3ca095114ed234444f6328 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Dec 2020 15:24:59 +0000 Subject: [PATCH 59/68] Look for emoji in the body that will be displayed Fixes https://github.com/vector-im/element-web/issues/16013 --- src/HtmlUtils.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx index 2301ad250b..9e42553dfa 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -438,13 +438,14 @@ export function bodyToHtml(content: IContent, highlights: string[], opts: IOpts delete sanitizeParams.textFilter; } + const contentBody = isDisplayedWithHtml ? safeBody : strippedBody; if (opts.returnString) { - return isDisplayedWithHtml ? safeBody : strippedBody; + return contentBody; } let emojiBody = false; if (!opts.disableBigEmoji && bodyHasEmoji) { - let contentBodyTrimmed = strippedBody !== undefined ? strippedBody.trim() : ''; + let contentBodyTrimmed = contentBody !== undefined ? contentBody.trim() : ''; // Ignore spaces in body text. Emojis with spaces in between should // still be counted as purely emoji messages. From 78e6fb91214af5b833ac25bb81748a99f0bfc61e Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 21 Dec 2020 17:00:39 +0000 Subject: [PATCH 60/68] Upgrade matrix-js-sdk to 9.4.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2a3a2064f2..52c9c3f730 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.19", - "matrix-js-sdk": "9.4.0-rc.2", + "matrix-js-sdk": "9.4.0", "matrix-widget-api": "^0.1.0-beta.10", "minimist": "^1.2.5", "pako": "^1.0.11", diff --git a/yarn.lock b/yarn.lock index 66c4fe2ae1..3c2fcc0949 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6512,10 +6512,10 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@9.4.0-rc.2: - version "9.4.0-rc.2" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.4.0-rc.2.tgz#8cd0eb9a76445c63e152ff7c8eb708513a67481e" - integrity sha512-Z2GJ0uv+/0IlwoAyducBBVZUTe4COyKtl6kanZNHK4kSGYZ/8pilTtMBj8fJJtWubOiZ6HxtaLEXrxulOJF+TA== +matrix-js-sdk@9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.4.0.tgz#86bd3e0d974ea5b1351a40c01d3e0d7d0ca76fe3" + integrity sha512-VN52M1M4VeXCHr9cmdzAwDEcPsIjPSykZQmJG1haL5KG792jT35f95+Vbp7v0c8Mai57vbEhoC8GugA9u+qV7Q== dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 74c33cabcae125f27f3bc5b453e3d06fd2d2729d Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 21 Dec 2020 17:06:40 +0000 Subject: [PATCH 61/68] Prepare changelog for v3.11.0 --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99d0aab14b..3d92148e8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +Changes in [3.11.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.11.0) (2020-12-21) +===================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.11.0-rc.2...v3.11.0) + + * Upgrade JS SDK to 9.4.0 + * [Release] Look for emoji in the body that will be displayed + [\#5519](https://github.com/matrix-org/matrix-react-sdk/pull/5519) + * [Release] Recognise `*.element.io` links as Element permalinks + [\#5516](https://github.com/matrix-org/matrix-react-sdk/pull/5516) + * [Release] Fixes for call UI + [\#5513](https://github.com/matrix-org/matrix-react-sdk/pull/5513) + * [RELEASE] Add a snowfall chat effect (with /snowfall command) + [\#5512](https://github.com/matrix-org/matrix-react-sdk/pull/5512) + * [Release] Fix padding in confirmation email registration prompt + [\#5502](https://github.com/matrix-org/matrix-react-sdk/pull/5502) + Changes in [3.11.0-rc.2](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.11.0-rc.2) (2020-12-16) =============================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.11.0-rc.1...v3.11.0-rc.2) From d23d0b2b42ece6f83a6cc48e5eed638c152424f2 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 21 Dec 2020 17:06:40 +0000 Subject: [PATCH 62/68] v3.11.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 52c9c3f730..81cf8f8873 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.11.0-rc.2", + "version": "3.11.0", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From e551e7ac40a66954e1170528d80b97c34f08342e Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 21 Dec 2020 17:08:51 +0000 Subject: [PATCH 63/68] Reset matrix-js-sdk back to develop branch --- package.json | 2 +- yarn.lock | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 81cf8f8873..e342b9a0e2 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.19", - "matrix-js-sdk": "9.4.0", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", "matrix-widget-api": "^0.1.0-beta.10", "minimist": "^1.2.5", "pako": "^1.0.11", diff --git a/yarn.lock b/yarn.lock index 56bbfb1249..9681f9a7a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6512,10 +6512,9 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@9.4.0: +"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": version "9.4.0" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.4.0.tgz#86bd3e0d974ea5b1351a40c01d3e0d7d0ca76fe3" - integrity sha512-VN52M1M4VeXCHr9cmdzAwDEcPsIjPSykZQmJG1haL5KG792jT35f95+Vbp7v0c8Mai57vbEhoC8GugA9u+qV7Q== + resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/5b1e3537cc8821f508473d98b5d286dedb7ed3ab" dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 9af213817111c65af6fdd8b8b5df8c558e04142e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Dec 2020 17:19:21 +0000 Subject: [PATCH 64/68] Bump node-notifier from 8.0.0 to 8.0.1 Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1. - [Release notes](https://github.com/mikaelbr/node-notifier/releases) - [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md) - [Commits](https://github.com/mikaelbr/node-notifier/compare/v8.0.0...v8.0.1) Signed-off-by: dependabot[bot] --- yarn.lock | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9681f9a7a4..974e44bd2b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6429,6 +6429,13 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -6812,9 +6819,9 @@ node-modules-regexp@^1.0.0: integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= node-notifier@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.0.tgz#a7eee2d51da6d0f7ff5094bc7108c911240c1620" - integrity sha512-46z7DUmcjoYdaWyXouuFNNfUo6eFa94t23c53c+lG/9Cvauk4a98rAUp9672X5dxGdQmLpPzTxzu8f/OeEPaFA== + version "8.0.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.1.tgz#f86e89bbc925f2b068784b31f382afdc6ca56be1" + integrity sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA== dependencies: growly "^1.3.0" is-wsl "^2.2.0" @@ -8354,9 +8361,11 @@ semver@7.0.0: integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== semver@^7.2.1, semver@^7.3.2: - version "7.3.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" - integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== + version "7.3.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" + integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== + dependencies: + lru-cache "^6.0.0" serialize-javascript@^2.1.2: version "2.1.2" @@ -9506,9 +9515,9 @@ uuid@^3.3.2: integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== uuid@^8.3.0: - version "8.3.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31" - integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg== + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== v8-compile-cache@^2.0.3: version "2.1.1" @@ -9798,6 +9807,11 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yargs-parser@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" From ec274196c4dbd755d545fa84ae4b2eeb147fb26d Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 21 Dec 2020 17:32:49 +0000 Subject: [PATCH 65/68] Prepare changlog for v3.11.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d92148e8e..ef31ef886f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Changes in [3.11.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.11.1) (2020-12-21) +===================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.11.0...v3.11.1) + + * Upgrade JS SDK to 9.4.1 + Changes in [3.11.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.11.0) (2020-12-21) ===================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.11.0-rc.2...v3.11.0) From cc0bef7f8d2422967a3d2f55704adc9f7327bd77 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 21 Dec 2020 17:36:46 +0000 Subject: [PATCH 66/68] Upgrade matrix-js-sdk to 9.4.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 81cf8f8873..f0056d1f6f 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.19", - "matrix-js-sdk": "9.4.0", + "matrix-js-sdk": "9.4.1", "matrix-widget-api": "^0.1.0-beta.10", "minimist": "^1.2.5", "pako": "^1.0.11", diff --git a/yarn.lock b/yarn.lock index 3c2fcc0949..452d6fd20b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6512,10 +6512,10 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@9.4.0: - version "9.4.0" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.4.0.tgz#86bd3e0d974ea5b1351a40c01d3e0d7d0ca76fe3" - integrity sha512-VN52M1M4VeXCHr9cmdzAwDEcPsIjPSykZQmJG1haL5KG792jT35f95+Vbp7v0c8Mai57vbEhoC8GugA9u+qV7Q== +matrix-js-sdk@9.4.1: + version "9.4.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.4.1.tgz#dc15ed0a8c2a2b588e2ce5011f881717bc6efd53" + integrity sha512-6iCzKym869OpZnose+g/Xg3GMNrVXn2TFJnlPEy7rshOHeKLVCoFuQcIdApcGftnfh3fi0t3qRuD7o17xt2wiA== dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 5fd39954a1e7ed2dc1e5f04d2c1e8021dac9c12a Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 21 Dec 2020 17:37:29 +0000 Subject: [PATCH 67/68] v3.11.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0056d1f6f..f56e83fdd4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.11.0", + "version": "3.11.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From c4f726932149373e9c4b6d3ef29b62e4ccc2dd78 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 21 Dec 2020 17:52:30 +0000 Subject: [PATCH 68/68] Reset matrix-js-sdk back to develop branch --- package.json | 2 +- yarn.lock | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f56e83fdd4..7086ec2348 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.19", - "matrix-js-sdk": "9.4.1", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", "matrix-widget-api": "^0.1.0-beta.10", "minimist": "^1.2.5", "pako": "^1.0.11", diff --git a/yarn.lock b/yarn.lock index 4d1e54f75e..e053a0a61b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6512,10 +6512,9 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@9.4.1: +"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": version "9.4.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.4.1.tgz#dc15ed0a8c2a2b588e2ce5011f881717bc6efd53" - integrity sha512-6iCzKym869OpZnose+g/Xg3GMNrVXn2TFJnlPEy7rshOHeKLVCoFuQcIdApcGftnfh3fi0t3qRuD7o17xt2wiA== + resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/1717fcf499b943517213f2a81c41ffec0b50748e" dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0"