Lightweight native Discord client for Windows, Linux and macOS, written in Rust. No Electron, no browser engine.
Rust desktop-appdiscorddiscord-clienteguielectron-alternativelightweightlinuxmacosnative-apprustwindows
RustCord 0.4.39: auto-update, echo cancellation, Arabic and Hebrew, group DM members
VRonGitHubfb0f9240f41f
diff --git a/Cargo.lock b/Cargo.lockindex 091fcf4..bd97f30 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -1149,6 +1149,15 @@ version = "1.0.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48"+[[package]]+name = "core_maths"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30"+dependencies = [+ "libm",+]+[[package]]name = "coreaudio-rs"version = "0.14.2"@@ -1503,6 +1512,7 @@ dependencies = ["quote","rustc_version","syn 2.0.119",+ "unicode-xid",][[package]]@@ -1572,7 +1582,7 @@ dependencies = [[[package]]name = "discord"-version = "0.4.38"+version = "0.4.39"dependencies = ["anyhow","base64 0.22.1",@@ -2011,8 +2021,10 @@ dependencies = ["log","nohash-hasher","parking_lot",+ "rustybuzz","skrifa","ttf-parser",+ "unicode-bidi",][[package]]@@ -3534,6 +3546,12 @@ dependencies = ["windows-link 0.2.1",]+[[package]]+name = "libm"+version = "0.2.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"+[[package]]name = "libmimalloc-sys"version = "0.1.49"@@ -5309,7 +5327,7 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"[[package]]name = "rencord"-version = "0.4.38"+version = "0.4.39"dependencies = ["discord","log",@@ -5488,7 +5506,7 @@ dependencies = [[[package]]name = "rustcord"-version = "0.4.38"+version = "0.4.39"dependencies = ["arboard","base64 0.22.1",@@ -5513,6 +5531,7 @@ dependencies = ["objc2-app-kit 0.3.2","objc2-foundation 0.3.2","rand 0.8.8",+ "raw-window-handle","rencord","reqwest","rfd",@@ -5527,12 +5546,13 @@ dependencies = ["voice","windows 0.58.0","windows-sys 0.59.0",+ "winit","wry",][[package]]name = "rustcord-setup"-version = "0.4.38"+version = "0.4.39"dependencies = ["embed-resource","flate2",@@ -5619,6 +5639,24 @@ version = "1.0.23"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"+[[package]]+name = "rustybuzz"+version = "0.20.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702"+dependencies = [+ "bitflags 2.13.2",+ "bytemuck",+ "core_maths",+ "log",+ "smallvec",+ "ttf-parser",+ "unicode-bidi-mirroring",+ "unicode-ccc",+ "unicode-properties",+ "unicode-script",+]+[[package]]name = "ryu"version = "1.0.23"@@ -6113,6 +6151,82 @@ dependencies = ["windows-sys 0.61.2",]+[[package]]+name = "sonora"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d461e6c9ad112f8728919387a4bc5639fd28631f2070171efad38676e907edd8"+dependencies = [+ "sonora-aec3",+ "sonora-agc2",+ "sonora-common-audio",+ "sonora-ns",+ "sonora-simd",+ "tracing",+]++[[package]]+name = "sonora-aec3"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f2809c3fda13f71deac22d0ddb6c02c493f254d3da2afe59a7e256a8f15bcffe"+dependencies = [+ "sonora-common-audio",+ "sonora-fft",+ "sonora-simd",+]++[[package]]+name = "sonora-agc2"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "501b5dd3f8bdc8c983dc64a131cef22a429f3ff879d6f0007b8bfe46ec7b96aa"+dependencies = [+ "bytemuck",+ "derive_more",+ "sonora-common-audio",+ "sonora-fft",+ "sonora-simd",+ "tracing",+]++[[package]]+name = "sonora-common-audio"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2c05dfa300c14dc8498751ce2c5b87aad2acf1892d4f9d66b92ae2f372a83410"+dependencies = [+ "derive_more",+ "sonora-simd",+]++[[package]]+name = "sonora-fft"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec3529f2cf748f1acc85d9403ffa08a3fe69dec6bf22383910b3bd21aca2fd26"+dependencies = [+ "sonora-simd",+]++[[package]]+name = "sonora-ns"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "31c0a62e78419a174dbf9c9c01943c1ecd8c298a68d15c4fb4906cb19f0428b9"+dependencies = [+ "sonora-fft",+]++[[package]]+name = "sonora-simd"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f939d8e63a2a0baa7555294d7b09c5e3d382f28358755b920e13ad527658c8fa"+dependencies = [+ "cpufeatures 0.3.1",+]+[[package]]name = "soup3"version = "0.5.0"@@ -6966,6 +7080,9 @@ name = "ttf-parser"version = "0.25.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31"+dependencies = [+ "core_maths",+][[package]]name = "tungstenite"@@ -7036,12 +7153,42 @@ version = "2.10.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f"+[[package]]+name = "unicode-bidi"+version = "0.3.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"++[[package]]+name = "unicode-bidi-mirroring"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5dfa6e8c60bb66d49db113e0125ee8711b7647b5579dc7f5f19c42357ed039fe"++[[package]]+name = "unicode-ccc"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e"+[[package]]name = "unicode-ident"version = "1.0.27"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"+[[package]]+name = "unicode-properties"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "993ad287eb20e8ba755312801cfe1413e0f25d604075863acaddca10b04c1833"++[[package]]+name = "unicode-script"+version = "0.5.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aa04c955db05429d464c74d495c1ee677e1866e783a4c3747f9c0cef7756cabf"+[[package]]name = "unicode-segmentation"version = "1.13.3"@@ -7217,6 +7364,7 @@ dependencies = ["serde_json","sha3","socket2",+ "sonora","tokio","tokio-tungstenite 0.30.0","tracing",diff --git a/Cargo.toml b/Cargo.tomlindex 0effd4b..c841bb3 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -3,7 +3,7 @@ resolver = "2"members = ["crates/discord", "crates/rencord", "crates/voice", "apps/rustcord", "apps/setup"][workspace.package]-version = "0.4.38"+version = "0.4.39"edition = "2021"license = "PolyForm-Noncommercial-1.0.0"@@ -24,5 +24,6 @@ hpke-rs = { path = "crates/voice/vendor/hpke-rs" }# egui_glow 0.29.1 with text shaded like Chrome's (see crates/vendor/egui_glow/src/painter.rs).egui_glow = { path = "crates/vendor/egui_glow" }# epaint 0.29.1 with text laid out like a browser: sizes and glyph advances not-# rounded to whole pixels, and GPOS kerning (see crates/vendor/epaint/src/text).+# rounded to whole pixels, GPOS kerning, and shaped, right-to-left Arabic and+# Hebrew (see crates/vendor/epaint/src/text).epaint = { path = "crates/vendor/epaint" }diff --git a/README.md b/README.mdindex ba2145b..b59e5ed 100644--- a/README.md+++ b/README.md@@ -78,7 +78,7 @@ RustCord into Applications. One app for Apple Silicon and Intel Macs, macOS 11 o- πͺΆ **Light:** one native process, idling around 50 MB of RAM in the background and well under 1% CPU.- π **Fast:** your servers are on screen about a third of a second after you start it.- π¨ **Looks like Discord:** Discord's layout, icons, font, colours, Nitro gradient themes and menus, rebuilt natively.-- ποΈ **Voice, video and Go Live:** calls with noise suppression, camera, screen sharing up to 60 fps, soundboard.+- ποΈ **Voice, video and Go Live:** calls with noise suppression and echo cancellation, camera, screen sharing up to 60 fps, soundboard.- π§© **Rencord:** a built-in mod system with ports of popular Vencord plugins, plus Vencord/BetterDiscord themes.- π **Private:** no telemetry, no tracking calls, your token stays in your system's credential store.- π₯οΈ **Windows, Linux and macOS:** a Windows installer, and experimental Linux and macOS builds.@@ -231,7 +231,7 @@ GitHub uses for the releases, and starts the app on a Mac to check it.<summary><b>ποΈ Voice and video</b></summary>- Voice channels and calls: mute, deafen, devices, volumes, Voice Isolation (noise suppression),- ping stats and automatic rejoin+ echo cancellation (WebRTC's AEC3), ping stats and automatic rejoin- Per-person volume (0β200 %) and local mute, plus server mute, deafen and disconnect with permissions- Camera video in calls- Go Live: share a screen or window at 720p, 1080p or source quality, 15β60 fps, with audio on@@ -353,6 +353,9 @@ are declared with `SettingDef::{bool, text, select}` and RustCord draws their UIyour user ID, which is what the RustCord badge is made from, and asks about the profiles youopen in the same form. The registry stores no IDs, but anyone who already knows an ID can askwhether that person uses RustCord and when they were last seen.+- GitHub (api.github.com and its release downloads), for automatic updates: an installed+ RustCord on Windows asks for the latest release a minute after it starts and every 6 hours,+ unless you turn them off in Settings β About. It sends nothing about you or your account.</details>@@ -364,11 +367,18 @@ It installs for your Windows account only, without administrator rights, intoan entry in **Settings β Apps β Installed apps**. A newer installer updates RustCord in placeand keeps your settings and login; it warns before replacing a newer version with an older one.+Its last page asks whether to **keep RustCord up to date automatically** (ticked by default; also+under **Settings β About**). An installed RustCord then looks for a new release on GitHub a minute+after it starts and every 6 hours, downloads its installer, checks it against the published+SHA-256 and installs it silently for the next start; a green **Update Ready!** button in the title+bar restarts into it.+Uninstalling removes the program, its shortcuts and its Installed apps entry. Your settings andlogin stay unless you tick **Also delete my settings, cache and saved login**.-For scripts: `RustCordSetup.exe /S [--dir <folder>] [--no-desktop] [--no-launch]` installs-silently, and `rustcord-uninstall.exe /S [--delete-data]` removes it.+For scripts: `RustCordSetup.exe /S [--dir <folder>] [--no-desktop] [--no-launch]+[--auto-update | --no-auto-update]` installs silently, and `rustcord-uninstall.exe /S [--delete-data]`+removes it.</details>diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdindex 9552763..b4f8867 100644--- a/THIRD_PARTY_NOTICES.md+++ b/THIRD_PARTY_NOTICES.md@@ -121,6 +121,49 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Its FFT dependencies (easyfft, rustfft, realfft and their helpers) are MIT OR Apache-2.0or MIT; see [`crates/voice/NOTICE.md`](crates/voice/NOTICE.md).+## sonora (WebRTC echo cancellation)++Voice & Video's "Echo Cancellation" (`crates/voice/src/echo.rs`) is WebRTC's AEC3, through+[sonora](https://github.com/dignifiedquire/sonora) 0.3.0, a pure-Rust port of WebRTC's audio+processing module (the crates sonora, sonora-aec3, sonora-agc2, sonora-ns,+sonora-common-audio, sonora-fft and sonora-simd):++```+Copyright (c) 2011, The WebRTC Project Authors. All rights reserved.+Copyright (c) 2016, Arun Raghavan and contributors. All rights reserved.+Copyright (c) 2026, dignifiedquire. All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are+met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above copyright+ notice, this list of conditions and the following disclaimer in+ the documentation and/or other materials provided with the+ distribution.++ * Neither the name of Google nor the names of its contributors may+ be used to endorse or promote products derived from this software+ without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+```++Its other dependencies are listed in [`crates/voice/NOTICE.md`](crates/voice/NOTICE.md).+## OpenH264Go Live (screen sharing, `crates/voice`) decodes watched streams, and encodes when no@@ -179,8 +222,11 @@ it does in Chrome:(0.45 in the atlas, 0.40 applied in the shader), LCD subpixel text through dual-sourceblending (GLSL 3.30), and a mipmap bias for downscaled images.- epaint (`src/text`, `src/emoji.rs`, `src/text/hinted.rs`): font sizes and glyph advances are- not rounded to whole pixels, GPOS kerning, TrueType hinting (through skrifa), and colour- emoji glyphs; it gained the skrifa and ttf-parser dependencies for this.+ not rounded to whole pixels, GPOS kerning, TrueType hinting (through skrifa), colour+ emoji glyphs, shaping for Arabic and other joining scripts (through rustybuzz) and+ right-to-left text (through unicode-bidi); it gained the skrifa, ttf-parser, rustybuzz and+ unicode-bidi dependencies for this. rustybuzz (a Rust port of HarfBuzz) and unicode-bidi are+ MIT licensed (unicode-bidi: MIT OR Apache-2.0) and come from crates.io.## Discord's artwork and fontsdiff --git a/apps/rustcord/Cargo.toml b/apps/rustcord/Cargo.tomlindex ac54d39..2c62876 100644--- a/apps/rustcord/Cargo.toml+++ b/apps/rustcord/Cargo.toml@@ -61,6 +61,12 @@ embed-resource = "2"# The embedded web pages are WebKitGTK views there: GTK is started and pumped# by src/linux.rs. The version wry 0.57 uses.gtk = "0.18"+# The window's X connection and winit's Xlib error hook (src/linux.rs): the+# versions eframe 0.29 uses.+winit = { version = "0.30", default-features = false, features = ["x11", "rwh_06"] }+raw-window-handle = "0.6"+# glibc's malloc_trim (src/diagnostics.rs), at the version already in the build.+libc = "0.2"[target.'cfg(target_os = "macos")'.dependencies]# The Process Viewer's memory and processor figures (src/diagnostics.rs).diff --git a/apps/rustcord/fonts/discord-icons-src/build_icon_font.py b/apps/rustcord/fonts/discord-icons-src/build_icon_font.pyindex 7a3021c..aa6c7ae 100644--- a/apps/rustcord/fonts/discord-icons-src/build_icon_font.py+++ b/apps/rustcord/fonts/discord-icons-src/build_icon_font.py@@ -50,6 +50,7 @@ EXTRA = {0xF101D: 'circle_info', 0xF101E: 'arrow_left', 0xF101F: 'arrow_right', 0xF1020: 'eye_slash',0xF1021: 'game_controller', 0xF1022: 'bolt', 0xF1023: 'flame', 0xF1024: 'sprout',0xF1025: 'music', 0xF1026: 'tv', 0xF1027: 'apps', 0xF1028: 'sticker_small',+ 0xF1029: 'crown',}# Segoe code points RustCord still draws with Windows' own icon font. Other# systems have no Segoe, so Discord's nearest icons stand in for these, in adiff --git a/apps/rustcord/fonts/discord-icons-src/discord_icons.json b/apps/rustcord/fonts/discord-icons-src/discord_icons.jsonindex 1c9aa46..7d442d5 100644--- a/apps/rustcord/fonts/discord-icons-src/discord_icons.json+++ b/apps/rustcord/fonts/discord-icons-src/discord_icons.json@@ -1 +1 @@-{"hash": ["EM10.99 3.16A1 1 0 1 0 9 2.84L8.15 8H4a1 1 0 0 0 0 2h3.82l-.67 4H3a1 1 0 1 0 0 2h3.82l-.8 4.84a1 1 0 0 0 1.97.32L8.85 16h4.97l-.8 4.84a1 1 0 0 0 1.97.32l.86-5.16H20a1 1 0 1 0 0-2h-3.82l.67-4H21a1 1 0 1 0 0-2h-3.82l.8-4.84a1 1 0 1 0-1.97-.32L15.15 8h-4.970l.8-4.84ZM14.15 14l.67-4H9.85l-.67 4h4.97Z"], "speaker": ["NM12 3a1 1 0 0 0-1-1h-.06a1 1 0 0 0-.74.32L5.92 7H3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h2.92l4.28 4.68a1 1 0 0 0 .74.32H11a1 1 0 0 0 1-1V3ZM15.1 20.75c-.58.14-1.1-.33-1.1-.92v-.03c0-.5.37-.92.85-1.05a7 7 0 0 0 0-13.5A1.11 1.11 0 0 1 14 4.2v-.03c0-.6.52-1.06 1.1-.92a9 9 0 0 1 0 17.5Z", "NM15.16 16.51c-.57.28-1.16-.2-1.16-.83v-.14c0-.43.28-.8.63-1.020a3 3 0 0 0 0-5.04c-.35-.23-.63-.6-.63-1.02v-.14c0-.63.59-1.1 1.16-.83a5 5 0 0 1 0 9.02Z"], "announcement": ["EM19.56 2a3 3 0 0 0-2.46 1.28 3.85 3.85 0 0 1-1.86 1.42l-8.9 3.18a.5.5 0 0 0-.34.47v10.09a3 3 0 0 0 2.27 2.9l.62.16c1.57.4 3.15-.56 3.55-2.12a.92.92 0 0 1 1.23-.63l2.36.94c.42.27.79.62 1.070 1.03A3 3 0 0 0 19.56 22h.94c.83 0 1.5-.67 1.5-1.5v-17c0-.83-.67-1.5-1.5-1.5h-.94Zm-8.53 15.8L8 16.7v1.73a1 1 0 0 0 .76.97l.62.15c.5.13 1-.17 1.12-.67.1-.41.29-.78.53-1.1Z", "NM2 10c0-1.1.9-2 2-2h.5c.28 0 .5.22.5.5v7a.5.5 0 0 1-.5.5H4a2 2 0 0 1-2-2v-4Z"], "forum": ["NM18.91 12.98a5.45 5.45 0 0 1 2.18 6.2c-.1.33-.09.68.1.96l.83 1.32a1 1 0 0 1-.84 1.54h-5.5A5.6 5.6 0 0 1 10 17.5a5.6 5.6 0 0 1 5.68-5.5c1.2 0 2.32.36 3.23.98Z", "NM19.24 10.86c.32.16.72-.02.74-.38L20 10c0-4.42-4.03-8-9-8s-9 3.58-9 8c0 1.5.47 2.91 1.28 4.11.14.21.12.49-.06.67l-1.51 1.51A1 1 0 0 0 2.4 18h5.1a.5.5 0 0 0 .49-.5c0-4.2 3.5-7.5 7.68-7.5 1.28 0 2.5.3 3.56.86Z"], "stage": ["NM19.61 18.25a1.08 1.08 0 0 1-.07-1.33 9 9 0 1 0-15.07 0c.26.42.25.97-.08 1.33l-.02.02c-.41.44-1.12.43-1.46-.07a11 11 0 1 1 18.17 0c-.33.5-1.04.51-1.45.07l-.02-.02Z", "NM16.83 15.23c.43.47 1.18.42 1.45-.14a7 7 0 1 0-12.57 0c.28.56 1.03.6 1.46.14l.05-.06c.3-.33.35-.81.17-1.23A4.98 4.98 0 0 1 12 7a5 5 0 0 1 4.6 6.94c-.17.42-.13.9.18 1.23l.05.06Z", "NM15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM6.33 20.03c-.25.72.12 1.5.8 1.84a10.96 10.96 0 0 0 9.73 0 1.52 1.52 0 0 0 .8-1.84 6 6 0 0 0-11.33 0Z"], "thread": ["NM12 2.81a1 1 0 0 1 0-1.41l.36-.36a1 1 0 0 1 1.41 0l9.2 9.2a1 1 0 0 1 0 1.4l-.7.7a1 1 0 0 1-1.3.13l-9.54-6.72a1 1 0 0 1-.08-1.58l1-1L12 2.8ZM12 21.2a1 1 0 0 1 0 1.41l-.35.35a1 1 0 0 1-1.41 0l-9.2-9.19a1 1 0 0 1 0-1.41l.7-.7a1 1 0 0 1 1.3-.12l9.54 6.72a1 1 0 0 1 .07 1.58l-1 1 .35.36ZM15.66 16.8a1 1 0 0 1-1.38.28l-8.49-5.66A1 1 0 1 1 6.9 9.76l8.49 5.65a1 1 0 0 1 .27 1.39ZM17.1 14.25a1 1 0 1 0 1.11-1.66L9.73 6.93a1 1 0 0 0-1.11 1.66l8.49 5.66Z"], "chevron_down": ["NM5.3 9.3a1 1 0 0 1 1.4 0l5.3 5.29 5.3-5.3a1 1 0 1 1 1.4 1.42l-6 6a1 1 0 0 1-1.4 0l-6-6a1 1 0 0 1 0-1.42Z"], "inbox": ["EM5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5ZM4 5.5C4 4.67 4.67 4 5.5 4h13c.83 0 1.5.67 1.5 1.5v6c0 .83-.67 1.5-1.5 1.5h-2.65c-.5 0-.85.5-.85 1a3 3 0 1 1-6 0c0-.5-.35-1-.85-1H5.5A1.5 1.5 0 0 1 4 11.5v-6Z"], "help": ["EM12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm-.28-16c-.98 0-1.81.47-2.27 1.14A1 1 0 1 1 7.8 7.01 4.73 4.73 0 0 1 11.72 5c2.5 0 4.65 1.88 4.65 4.38 0 2.1-1.54 3.77-3.52 4.24l.14 1a1 1 0 0 1-1.98.27l-.28-2a1 1 0 0 1 .99-1.14c1.54 0 2.650-1.14 2.65-2.38 0-1.23-1.1-2.37-2.65-2.37ZM13 17.88a1.13 1.13 0 1 1-2.25 0 1.13 1.13 0 0 1 2.25 0Z"], "bell": ["NM9.7 2.89c.18-.07.32-.24.37-.43a2 2 0 0 1 3.86 0c.05.2.19.36.38.43A7 7 0 0 1 19 9.5v2.09c0 .12.05.24.13.33l1.1 1.22a3 3 0 0 1 .77 2.01v.28c0 .67-.34 1.29-.95 1.56-1.31.6-4 1.51-8.05 1.51-4.05 0-6.74-.91-8.05-1.5-.61-.28-.95-.9-.95-1.57v-.28a3 3 0 0 1 .77-2l1.1-1.23a.5.5 0 0 0 .13-.33V9.5a7 7 0 0 1 4.7-6.61ZM9.18 19.84A.16.16 0 0 0 9 20a3 3 0 1 0 6 0c0-.1-.09-.17-.18-.16a24.86 24.86 0 0 1-5.64 0Z"], "pin": ["NM19.38 11.38a3 3 0 0 0 4.24 0l.03-.03a.5.5 0 0 0 0-.7L13.35.35a.5.5 0 0 0-.7 0l-.03.03a3 3 0 0 0 0 4.24L13 5l-2.92 2.92-3.65-.34a2 2 0 0 0-1.6.58l-.62.63a1 1 0 0 0 0 1.42l9.58 9.58a1 1 0 0 0 1.42 0l.63-.63a2 2 0 0 0 .58-1.6l-.34-3.64L19 11l.38.38ZM9.07 17.07a.5.5 0 0 1-.08.77l-5.15 3.43a.5.5 0 0 1-.63-.06l-.42-.42a.5.5 0 0 1-.06-.63L6.16 15a.5.5 0 0 1 .77-.08l2.14 2.14Z"], "members": ["NM14.5 8a3 3 0 1 0-2.7-4.3c-.2.4.06.86.44 1.12a5 5 0 0 1 2.14 3.08c.01.06.06.1.12.1ZM18.44 17.27c.15.43.54.73 1 .73h1.06c.83 0 1.5-.67 1.5-1.5a7.5 7.5 0 0 0-6.5-7.43c-.55-.08-.99.38-1.1.92-.06.3-.15.6-.26.87-.23.58-.05 1.3.47 1.63a9.53 9.53 0 0 1 3.83 4.78ZM12.5 9a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM2 20.5a7.5 7.5 0 0 1 15 0c0 .83-.67 1.5-1.5 1.5a.2.2 0 0 1-.2-.16c-.2-.96-.56-1.87-.88-2.54-.1-.23-.42-.15-.42.1v2.1a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-2.1c0-.25-.31-.33-.42-.1-.32.67-.67 1.58-.88 2.54a.2.2 0 0 1-.2.16A1.5 1.5 0 0 1 2 20.5Z"], "search": ["EM15.62 17.03a9 9 0 1 1 1.41-1.41l4.68 4.67a1 1 0 0 1-1.42 1.42l-4.67-4.68ZM17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"], "invite": ["NM14.5 8a3 3 0 1 0-2.7-4.3c-.2.4.06.86.44 1.12a5 5 0 0 1 2.14 3.08c.01.06.06.1.12.1ZM16.62 13.17c-.22.29-.65.37-.92.14-.34-.3-.7-.57-1.09-.82-.52-.33-.7-1.05-.47-1.63.11-.27.2-.57.26-.87.11-.54.55-1 1.1-.92 1.6.2 3.04.92 4.15 1.98.3.27-.25.95-.65.95a3 3 0 0 0-2.38 1.17ZM15.19 15.61c.13.16.02.39-.19.39a3 3 0 0 0-1.52 5.59c.2.12.26.41.02.41h-8a.5.5 0 0 1-.5-.5v-2.1c0-.25-.31-.33-.42-.1-.32.67-.67 1.58-.88 2.54a.2.2 0 0 1-.2.16A1.5 1.5 0 0 1 2 20.5a7.5 7.5 0 0 1 13.19-4.89ZM9.5 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM15.5 22Z", "NM19 14a1 1 0 0 1 1 1v3h3a1 1 0 0 1 0 2h-3v3a1 1 0 0 1-2 0v-3h-3a1 1 0 1 1 0-2h3v-3a1 1 0 0 1 1-1Z"], "add": ["NM13 3a1 1 0 1 0-2 0v8H3a1 1 0 1 0 0 2h8v8a1 1 0 0 0 2 0v-8h8a1 1 0 0 0 0-2h-8V3Z"], "mic": ["NM12 2a4 4 0 0 0-4 4v4a4 4 0 0 0 8 0V6a4 4 0 0 0-4-4Z", "NM6 10a1 1 0 0 0-2 0 8 8 0 0 0 7 7.94V20H9a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-2v-2.06A8 8 0 0 0 20 10a1 1 0 1 0-2 0 6 6 0 0 1-12 0Z"], "mic_off": ["Nm2.7 22.7 20-20a1 1 0 0 0-1.4-1.4l-20 20a1 1 0 1 0 1.4 1.4ZM10.8 17.32c-.21.21-.1.58.2.62V20H9a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-2v-2.06A8 8 0 0 0 20 10a1 1 0 0 0-2 0c0 1.45-.52 2.79-1.38 3.83l-.02.02A5.99 5.99 0 0 1 12.32 16a.52.52 0 0 0-.34.15l-1.18 1.18ZM15.36 4.52c.15-.15.19-.38.08-.56A4 4 0 0 0 8 6v4c0 .3.03.58.1.86.07.34.49.43.74.18l6.52-6.52ZM5.06 13.98c.16.28.53.31.75.09l.75-.75c.16-.16.19-.4.08-.61A5.97 5.97 0 0 1 6 10a1 1 0 0 0-2 0c0 1.45.39 2.81 1.060 3.98Z"], "headphones": ["NM12 3a9 9 0 0 0-8.95 10h1.87a5 5 0 0 1 4.1 2.13l1.37 1.97a3.1 3.1 0 0 1-.17 3.78 2.85 2.85 0 0 1-3.55.74 11 11 0 1 1 10.66 0c-1.27.71-2.73.23-3.55-.74a3.1 3.1 0 0 1-.17-3.78l1.38-1.97a5 5 0 0 1 4.1-2.13h1.86A9 9 0 0 0 12 3Z"], "headphones_off": ["NM22.7 2.7a1 1 0 0 0-1.4-1.4l-20 20a1 1 0 1 0 1.4 1.4l20-20ZM17.06 2.94a.48.48 0 0 0-.11-.77A11 11 0 0 0 2.18 16.94c.14.3.53.35.76.12l3.2-3.2c.25-.25.15-.68-.2-.76a5 5 0 0 0-1.02-.1H3.05a9 9 0 0 1 12.66-9.2c.2.09.44.05.59-.1l.76-.76ZM20.2 8.28a.52.52 0 0 1 .1-.58l.76-.76a.48.48 0 0 1 .77.11 11 11 0 0 1-4.5 14.57c-1.27.71-2.73.23-3.55-.74a3.1 3.1 0 0 1-.17-3.78l1.38-1.97a5 5 0 0 1 4.1-2.13h1.86a9.1 9.1 0 0 0-.75-4.72ZM10.1 17.9c.25-.25.65-.18.74.14a3.1 3.1 0 0 1-.62 2.84 2.85 2.85 0 0 1-3.55.74.16.16 0 0 1-.04-.25l3.48-3.48Z"], "settings": ["EM10.56 1.1c-.46.05-.7.53-.64.98.18 1.16-.19 2.2-.98 2.53-.8.33-1.79-.15-2.49-1.1-.27-.36-.78-.52-1.14-.24-.77.59-1.45 1.27-2.04 2.04-.28.36-.12.87.24 1.14.96.7 1.43 1.7 1.1 2.49-.33.8-1.37 1.16-2.53.98-.45-.07-.93.18-.99.64a11.1 11.1 0 0 0 0 2.88c.06.46.54.7.99.64 1.16-.18 2.2.19 2.53.98.33.8-.14 1.79-1.1 2.49-.36.27-.52.78-.24 1.14.59.77 1.27 1.45 2.04 2.04.36.28.87.12 1.14-.24.7-.95 1.7-1.43 2.49-1.1.8.33 1.16 1.37.98 2.53-.07.45.18.93.64.99a11.1 11.1 0 0 0 2.88 0c.46-.06.7-.54.64-.99-.18-1.16.19-2.2.98-2.53.8-.33 1.79.14 2.49 1.1.27.36.78.52 1.14.24.77-.59 1.45-1.27 2.04-2.04.28-.36.12-.87-.24-1.14-.96-.7-1.43-1.7-1.1-2.49.33-.8 1.37-1.16 2.53-.98.45.07.93-.18.99-.64a11.1 11.1 0 0 0 0-2.88c-.06-.46-.54-.7-.99-.64-1.16.18-2.2-.19-2.53-.98-.33-.8.14-1.79 1.1-2.49.36-.27.52-.78.24-1.14a11.07 11.07 0 0 0-2.04-2.04c-.36-.28-.87-.12-1.14.24-.7.96-1.7 1.43-2.49 1.1-.8-.33-1.16-1.37-.98-2.53.07-.45-.18-.93-.64-.99a11.1 11.1 0 0 0-2.88 0ZM16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"], "gift": ["EM4 6a4 4 0 0 1 4-4h.09c1.8 0 3.39 1.18 3.91 2.9A4.09 4.09 0 0 1 15.91 2H16a4 4 0 0 1 3.46 6H20a2 2 0 0 1 2 2v1.5a.5.5 0 0 1-.5.5h-19a.5.5 0 0 1-.5-.5V10c0-1.1.9-2 2-2h.54A3.98 3.98 0 0 1 4 6Zm12 2a2 2 0 1 0 0-4h-.09c-.96 0-1.8.65-2.02 1.58L13.29 8H16Zm-5.89-2.42.6 2.42H8a2 2 0 1 1 0-4h.09c.96 0 1.8.65 2.02 1.58Z", "NM3 20c0 1.1.9 2 2 2h5.5a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0-.5.5V20ZM13.5 22a.5.5 0 0 1-.5-.5v-7c0-.28.22-.5.5-.5h7c.28 0 .5.22.5.5V20a2 2 0 0 1-2 2h-5.5Z"], "gif": ["EM5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5Zm2.18 13.87a2.9 2.9 0 0 1-1.66-.49 3.18 3.18 0 0 1-1.12-1.35A4.88 4.88 0 0 1 4 12c0-.75.14-1.42.42-2 .29-.59.7-1.04 1.24-1.37a3.7 3.7 0 0 1 1.95-.5c.64 0 1.21.14 1.72.4.5.28.89.67 1.15 1.16l-1.22.88a1.76 1.76 0 0 0-1.64-1.02c-.66 0-1.17.22-1.52.65a2.74 2.74 0 0 0-.53 1.8c0 .78.18 1.39.53 1.81.35.42.86.64 1.52.64.3 0 .57-.06.81-.16.25-.12.45-.27.58-.47v-.93H7.3v-1.4h3.24v4.23H9.27l-.2-.71c-.43.57-1.060.86-1.89.86Zm6.34-.15h-1.57V8.28h1.57v7.44Zm1.51 0h1.57v-2.83h2.76v-1.42H16.6V9.7H20V8.28h-4.97v7.44Z"], "sticker": ["EM7 3h10a4 4 0 0 1 4 4v6.5a.5.5 0 0 1-.5.5H19a5 5 0 0 0-5 5v1.5a.5.5 0 0 1-.5.5H7a4 4 0 0 1-4-4V7a4 4 0 0 1 4-4Zm-.5 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM19 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm-9.91 2.94a1 1 0 0 0-1.66 1.12 5.5 5.5 0 0 0 9.14 0 1 1 0 0 0-1.66-1.12 3.5 3.5 0 0 1-5.82 0Z", "NM19 16h1.73a3 3 0 0 1-.6.88l-3.25 3.24a3 3 0 0 1-.88.61V19a3 3 0 0 1 3-3Z"], "reaction": ["EM12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22ZM6.5 13a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm11 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm-9.8 1.17a1 1 0 0 1 1.39.27 3.5 3.5 0 0 0 5.82 0 1 1 0 0 1 1.66 1.12 5.5 5.5 0 0 1-9.14 0 1 1 0 0 1 .27-1.4Z"], "edit": ["Nm13.96 5.46 4.58 4.58a1 1 0 0 0 1.42 0l1.38-1.38a2 2 0 0 0 0-2.82l-3.18-3.18a2 2 0 0 0-2.82 0l-1.38 1.38a1 1 0 0 0 0 1.42ZM2.11 20.16l.73-4.22a3 3 0 0 1 .83-1.61l7.87-7.870a1 1 0 0 1 1.42 0l4.58 4.58a1 1 0 0 1 0 1.42l-7.87 7.87a3 3 0 0 1-1.6.83l-4.23.73a1.5 1.5 0 0 1-1.73-1.73Z"], "forward": ["NM21.7 7.3a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4L18.58 9H13a7 7 0 0 0-7 7v4a1 1 0 1 1-2 0v-4a9 9 0 0 1 9-9h5.59l-3.3-3.3a1 1 0 0 1 1.42-1.4l5 5Z"], "more": ["EM4 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"], "reply": ["NM2.3 7.3a1 1 0 0 0 0 1.4l5 5a1 1 0 0 0 1.4-1.4L5.42 9H11a7 7 0 0 1 7 7v4a1 1 0 1 0 2 0v-4a9 9 0 0 0-9-9H5.41l3.3-3.3a1 1 0 0 0-1.42-1.4l-5 5Z"], "close": ["NM17.3 18.7a1 1 0 0 0 1.4-1.4L13.42 12l5.3-5.3a1 1 0 0 0-1.42-1.4L12 10.58l-5.3-5.3a1 1 0 0 0-1.4 1.42L10.58 12l-5.3 5.3a1 1 0 1 0 1.42 1.4L12 13.42l5.3 5.3Z"], "trash": ["NM14.25 1c.41 0 .75.34.75.75V3h5.25c.41 0 .75.34.75.75v.5c0 .41-.34.75-.75.75H3.75A.75.75 0 0 1 3 4.25v-.5c0-.41.34-.75.75-.75H9V1.75c0-.41.34-.75.75-.75h4.5Z", "EM5.06 7a1 1 0 0 0-1 1.06l.76 12.13a3 3 0 0 0 3 2.81h8.36a3 3 0 0 0 3-2.81l.75-12.13a1 1 0 0 0-1-1.06H5.07ZM11 12a1 1 0 1 0-2 0v6a1 1 0 1 0 2 0v-6Zm3-1a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-6a1 1 0 0 1 1-1Z"], "copy": ["NM3 16a1 1 0 0 1-1-1v-5a8 8 0 0 1 8-8h5a1 1 0 0 1 1 1v.5a.5.5 0 0 1-.5.5H10a6 6 0 0 0-6 6v5.5a.5.5 0 0 1-.5.5H3Z", "NM6 18a4 4 0 0 0 4 4h8a4 4 0 0 0 4-4v-4h-3a5 5 0 0 1-5-5V6h-4a4 4 0 0 0-4 4v8Z", "NM21.73 12a3 3 0 0 0-.6-.88l-4.25-4.24a3 3 0 0 0-.88-.61V9a3 3 0 0 0 3 3h2.73Z"], "id": ["NM15.3 14.48c-.46.45-1.08.67-1.86.67h-1.39V9.2h1.39c.78 0 1.4.22 1.86.67.46.45.68 1.22.68 2.31 0 1.1-.22 1.86-.68 2.31Z", "EM5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5Zm1 15h2.04V7.34H6V17Zm4-9.66V17h3.44c1.46 0 2.6-.42 3.38-1.25.8-.83 1.2-2.02 1.2-3.58s-.4-2.75-1.2-3.58c-.79-.83-1.92-1.25-3.38-1.25H10Z"], "link": ["NM16.32 14.72a1 1 0 0 1 0-1.41l2.51-2.51a3.98 3.98 0 0 0-5.62-5.63l-2.52 2.51a1 1 0 0 1-1.41-1.41l2.52-2.52a5.98 5.98 0 0 1 8.45 8.46l-2.52 2.51a1 1 0 0 1-1.41 0ZM7.68 9.29a1 1 0 0 1 0 1.41l-2.52 2.51a3.98 3.98 0 1 0 5.63 5.63l2.51-2.52a1 1 0 0 1 1.42 1.42l-2.52 2.51a5.98 5.98 0 0 1-8.45-8.45l2.51-2.51a1 1 0 0 1 1.42 0Z", "NM14.7 10.7a1 1 0 0 0-1.4-1.4l-4 4a1 1 0 1 0 1.4 1.4l4-4Z"], "mail": ["NM1.16 5.02c-.1.28.04.58.29.74l10.27 6.85a.5.5 0 0 0 .56 0l10.27-6.85c.25-.16.38-.46.29-.74A3 3 0 0 0 20 3H4a3 3 0 0 0-2.84 2.02Z", "NM23 8.8a.5.5 0 0 0-.78-.41l-9.53 6.35c-.42.28-.96.28-1.38 0L1.78 8.39A.5.5 0 0 0 1 8.8V18a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8.8Z"], "friends": ["NM13 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z", "NM3 5v-.75C3 3.56 3.56 3 4.25 3s1.24.56 1.33 1.25C6.12 8.65 9.46 12 13 12h1a8 8 0 0 1 8 8 2 2 0 0 1-2 2 .21.21 0 0 1-.2-.15 7.65 7.65 0 0 0-1.32-2.3c-.15-.2-.42-.06-.39.17l.25 2c.02.15-.1.28-.25.28H9a2 2 0 0 1-2-2v-2.22c0-1.57-.67-3.05-1.53-4.37A15.85 15.85 0 0 1 3 5Z"], "nitro": ["NM16.23 12c0 1.29-.95 2.25-2.22 2.25A2.18 2.18 0 0 1 11.8 12c0-1.29.95-2.25 2.22-2.25 1.27 0 2.22.96 2.22 2.25ZM23 12c0 5.01-4 9-8.99 9a8.93 8.93 0 0 1-8.75-6.9H3.34l-.9-4.2H5.3c.26-.96.68-1.89 1.21-2.7H1.89L1 3h12.74C19.13 3 23 6.99 23 12Zm-4.26 0c0-2.67-2.1-4.8-4.73-4.8A4.74 4.74 0 0 0 9.28 12c0 2.67 2.1 4.8 4.73 4.8a4.74 4.74 0 0 0 4.73-4.8Z"], "shop": ["NM2.63 4.19A3 3 0 0 1 5.53 2H7a1 1 0 0 1 1 1v3.98a3.07 3.07 0 0 1-.3 1.35A2.97 2.97 0 0 1 4.98 10c-2 0-3.44-1.9-2.9-3.83l.55-1.98ZM10 2a1 1 0 0 0-1 1v4a3 3 0 0 0 3 3 3 3 0 0 0 3-2.97V3a1 1 0 0 0-1-1h-4ZM17 2a1 1 0 0 0-1 1v3.98a3.65 3.65 0 0 0 0 .05A2.95 2.95 0 0 0 19.02 10c2 0 3.44-1.9 2.9-3.83l-.55-1.98A3 3 0 0 0 18.47 2H17Z", "NM21 11.42V19a3 3 0 0 1-3 3h-2.75a.25.25 0 0 1-.25-.25V16a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v5.75c0 .14-.11.25-.25.25H6a3 3 0 0 1-3-3v-7.58c0-.18.2-.3.37-.24a4.46 4.46 0 0 0 4.94-1.1c.1-.12.3-.12.4 0a4.49 4.49 0 0 0 6.58 0c.1-.12.3-.12.4 0a4.45 4.45 0 0 0 4.94 1.1c.17-.07.37.06.37.24Z"], "quests": ["NM7.5 21.7a8.95 8.95 0 0 1 9 0 1 1 0 0 0 1-1.73c-.6-.35-1.24-.64-1.9-.87.54-.3 1.05-.65 1.52-1.07a3.98 3.98 0 0 0 5.49-1.8.77.77 0 0 0-.24-.95 3.98 3.98 0 0 0-2.02-.76A4 4 0 0 0 23 10.47a.76.76 0 0 0-.71-.71 4.06 4.06 0 0 0-1.6.22 3.99 3.99 0 0 0 .54-5.35.77.77 0 0 0-.95-.24c-.75.36-1.37.95-1.77 1.67V6a4 4 0 0 0-4.9-3.9.77.77 0 0 0-.6.72 4 4 0 0 0 3.7 4.17c.89 1.3 1.3 2.95 1.3 4.51 0 3.66-2.75 6.5-6 6.5s-6-2.84-6-6.5c0-1.56.41-3.21 1.3-4.51A4 4 0 0 0 11 2.82a.77.77 0 0 0-.6-.72 4.01 4.01 0 0 0-4.9 3.96A4.02 4.02 0 0 0 3.73 4.4a.77.77 0 0 0-.95.24 3.98 3.98 0 0 0 .55 5.35 4 4 0 0 0-1.6-.22.76.76 0 0 0-.72.71l-.01.28a4 4 0 0 0 2.65 3.77c-.75.06-1.45.33-2.02.76-.3.22-.4.62-.24.95a4 4 0 0 0 5.49 1.8c.47.42.98.78 1.53 1.07-.67.23-1.3.52-1.91.87a1 1 0 1 0 1 1.73Z"], "screen": ["NM5 2a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5ZM13.5 20a.5.5 0 0 1-.5-.5v-2a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v2a.5.5 0 0 1-.5.5H9a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-1.5Z"], "hang_up": ["Nm21.5 16.6-.13.14a.88.88 0 0 1-.97.2l-4.09-1.7a.99.99 0 0 1-.57-1.18l.73-2.7c-2.24-3-6.7-3-8.94 0l.7 2.1a.99.99 0 0 1-.48 1.19l-4.13 2.2a.87.87 0 0 1-1.03-.15l-.1-.1a5.18 5.18 0 0 1-.32-6.92 12.67 12.67 0 0 1 19.66 0 5.18 5.18 0 0 1-.32 6.92Z"], "soundboard": ["NM14.24 1.03a1 1 0 0 1 .73 1.21l-1 4a1 1 0 1 1-1.94-.48l1-4a1 1 0 0 1 1.21-.73ZM20.7 4.7a1 1 0 0 0-1.4-1.4l-4 4a1 1 0 0 0 1.4 1.4l4-4Z", "EM15.14 20.14c1.78-1.78.7-5.75-2.42-8.86-3.11-3.12-7.08-4.2-8.86-2.42A3.13 3.13 0 0 0 3 11V11l-1.16 8.92a2 2 0 0 0 2.24 2.24L13 21c.86-.04 1.6-.32 2.14-.86Zm-1.3-3.4a9.61 9.61 0 0 0-2.53-4.05 9.61 9.61 0 0 0-4.05-2.53c-1.27-.35-1.82-.05-1.99.11-.16.17-.46.72-.11 2a9.61 9.61 0 0 0 2.53 4.04 9.61 9.61 0 0 0 4.05 2.53c1.27.35 1.82.05 1.99-.11.16-.17.46-.72.11-2Z", "NM7.05 3.32a1 1 0 0 1 1.9-.64l1 3a1 1 0 0 1-1.9.64l-1-3ZM22.97 9.76a1 1 0 0 0-1.21-.73l-4 1a1 1 0 1 0 .48 1.94l4-1a1 1 0 0 0 .73-1.21ZM20.68 16.95a1 1 0 0 0 .64-1.9l-3-1a1 1 0 0 0-.64 1.9l3 1Z"], "waveform": ["NM7 2a1 1 0 0 0-1 1v18a1 1 0 1 0 2 0V3a1 1 0 0 0-1-1ZM11 6a1 1 0 1 1 2 0v12a1 1 0 1 1-2 0V6ZM1 8a1 1 0 0 1 2 0v8a1 1 0 1 1-2 0V8ZM16 5a1 1 0 1 1 2 0v14a1 1 0 1 1-2 0V5ZM22 8a1 1 0 0 0-1 1v6a1 1 0 1 0 2 0V9a1 1 0 0 0-1-1Z"], "signal": ["NM2 3a1 1 0 0 1 1-1 19 19 0 0 1 19 19 1 1 0 1 1-2 0A17 17 0 0 0 3 4a1 1 0 0 1-1-1Z", "NM2 8a1 1 0 0 1 1-1 14 14 0 0 1 14 14 1 1 0 1 1-2 0A12 12 0 0 0 3 9a1 1 0 0 1-1-1Z", "NM3 12a1 1 0 1 0 0 2 7 7 0 0 1 7 7 1 1 0 1 0 2 0 9 9 0 0 0-9-9ZM2 17.83c0-.46.37-.83.83-.83C5.13 17 7 18.87 7 21.17c0 .46-.37.83-.83.83H3a1 1 0 0 1-1-1v-3.17Z"], "video": ["NM4 4a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h11a3 3 0 0 0 3-3v-2.12a1 1 0 0 0 .55.9l3 1.5a1 1 0 0 0 1.45-.9V7.62a1 1 0 0 0-1.45-.9l-3 1.5a1 1 0 0 0-.55.9V7a3 3 0 0 0-3-3H4Z"], "calendar": ["NM7 1a1 1 0 0 1 1 1v.75c0 .14.11.25.25.25h7.5c.14 0 .25-.11.25-.25V2a1 1 0 1 1 2 0v.75c0 .14.11.25.25.25H19a3 3 0 0 1 3 3 1 1 0 0 1-1 1H3a1 1 0 0 1-1-1 3 3 0 0 1 3-3h.75c.14 0 .25-.11.25-.25V2a1 1 0 0 1 1-1Z", "EM2 10a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v9a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3v-9Zm3.5 2a.5.5 0 0 0-.5.5v3c0 .28.22.5.5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3Z"], "boost": ["NM11.02 1.36c.56-.48 1.4-.48 1.96 0l6.48 5.45c.34.29.54.71.54 1.16v8.23c-.05.38-.24.74-.54 1l-6.48 5.44c-.53.45-1.3.48-1.86.09l-.1-.09-6.48-5.45c-.3-.25-.49-.6-.53-1L4 16.04V7.97c0-.45.2-.87.54-1.16l6.48-5.45ZM6.36 7.89a1 1 0 0 0-.36.76v6.7c0 .29.13.57.36.76l5 4.2a1 1 0 0 0 1.28 0l5-4.2a1 1 0 0 0 .36-.77V8.65a1 1 0 0 0-.36-.76l-5-4.2a1 1 0 0 0-1.28 0l-5 4.2Z", "NM11.36 6.3a1 1 0 0 1 1.28 0l3 2.52a1 1 0 0 1 .36.76v4.84a1 1 0 0 1-.36.76l-3 2.53a1 1 0 0 1-1.28 0l-3-2.53a1 1 0 0 1-.36-.76V9.58a1 1 0 0 1 .36-.76l3-2.53Z"], "check": ["NM21.7 5.3a1 1 0 0 1 0 1.4l-12 12a1 1 0 0 1-1.4 0l-6-6a1 1 0 1 1 1.4-1.4L9 16.58l11.3-11.3a1 1 0 0 1 1.4 0Z"], "star": ["NM10.81 2.86c.38-1.15 2-1.15 2.38 0l1.89 5.83h6.12c1.2 0 1.71 1.54.73 2.25l-4.95 3.6 1.9 5.82a1.25 1.25 0 0 1-1.93 1.4L12 18.16l-4.95 3.6c-.98.7-2.3-.25-1.92-1.4l1.89-5.82-4.95-3.6a1.25 1.25 0 0 1 .73-2.25h6.12l1.9-5.83Z"], "lock": ["EM6 9h1V6a5 5 0 0 1 10 0v3h1a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3Zm9-3v3H9V6a3 3 0 1 1 6 0Zm-1 8a2 2 0 0 1-1 1.73V18a1 1 0 1 1-2 0v-2.27A2 2 0 1 1 14 14Z"], "eye": ["NM15.56 11.77c.2-.1.44.02.44.23a4 4 0 1 1-4-4c.21 0 .33.25.23.44a2.5 2.5 0 0 0 3.32 3.32Z", "EM22.89 11.7c.07.2.07.4 0 .6C22.27 13.9 19.1 21 12 21c-7.11 0-10.27-7.11-10.89-8.7a.83.83 0 0 1 0-.6C1.73 10.1 4.9 3 12 3c7.11 0 10.27 7.11 10.89 8.7Zm-4.5-3.62A15.11 15.11 0 0 1 20.85 12c-.38.88-1.18 2.47-2.46 3.92C16.87 17.62 14.8 19 12 19c-2.8 0-4.87-1.38-6.39-3.08A15.11 15.11 0 0 1 3.15 12c.38-.88 1.18-2.47 2.46-3.92C7.13 6.38 9.2 5 12 5c2.8 0 4.87 1.38 6.39 3.08Z"], "image": ["EM2 5a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v14a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V5Zm13.35 8.13 3.5 4.67c.37.5.02 1.2-.6 1.2H5.81a.75.75 0 0 1-.59-1.22l1.86-2.32a1.5 1.5 0 0 1 2.34 0l.5.64 2.23-2.97a2 2 0 0 1 3.2 0ZM10.2 5.98c.23-.91-.88-1.55-1.55-.9a.93.93 0 0 1-1.3 0c-.67-.65-1.78-.01-1.55.9a.93.93 0 0 1-.65 1.12c-.9.26-.9 1.54 0 1.8.48.14.77.63.65 1.12-.23.91.88 1.55 1.55.9a.93.93 0 0 1 1.3 0c.67.65 1.78.01 1.55-.9a.93.93 0 0 1 .65-1.12c.9-.26.9-1.54 0-1.8a.93.93 0 0 1-.65-1.12Z"], "file": ["NM18 22H6a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h7.5c.28 0 .5.22.5.5V5a5 5 0 0 0 5 5h2.5c.28 0 .5.22.5.5V18a4 4 0 0 1-4 4Z", "NM21.7 7.94c.01.03 0 .06-.04.06H19a3 3 0 0 1-3-3V2.34c0-.03.03-.05.06-.04a3 3 0 0 1 .82.58l4.24 4.24a3 3 0 0 1 .58.82Z"], "shield": ["NM17.05 8.76a4.7 4.7 0 0 1-1.29-.88c-.36-.33-.7-.73-.88-1.13-.33-.73-.16-.77-1.08-.77h-3.64c-.91 0-.74.04-1.08.77a4.94 4.94 0 0 1-2.17 2.01c-.74.33-.85.14-.86.82 0 .88-.22 3.34 1.78 5.19a13.68 13.68 0 0 0 3.98 2.47c.09.03.08.04.17.04.09 0 .08 0 .17-.04.76-.25 2.67-1.25 3.98-2.47 2-1.85 1.78-4.3 1.78-5.19-.01-.68-.12-.49-.86-.82Z", "NM19.91 5.41c-.84 0-1.52-.65-1.52-1.46v-.3c0-.9-.77-1.65-1.71-1.65H7.31c-.94 0-1.71.74-1.71 1.65v.3c0 .81-.68 1.46-1.52 1.46H3.7c-.94 0-1.7.73-1.7 1.64v3.52l.01.49c.05 3.11.94 4.69 2.92 6.63C6.72 19.46 11.58 22 11.99 22c.41 0 5.27-2.54 7.060-4.31 1.98-1.95 2.92-3.53 2.92-6.63L22 7.05c0-.9-.76-1.64-1.7-1.64h-.39Zm-2.18 10.74a21.76 21.76 0 0 1-5.58 3.38c-.1.03-.2.03-.31 0a21.76 21.76 0 0 1-5.58-3.38c-1.15-1.08-2.12-2.37-2.12-5.29v-.33l.03-2.57c0-.31.26-.57.59-.57a2.88 2.88 0 0 0 2.89-2.8v-.03c0-.3.26-.55.59-.55h7.56c.32 0 .59.25.59.55v.03c0 1.53 1.3 2.77 2.89 2.8.32 0 .59.26.59.57l.03 2.57v.34c0 2.92-.98 4.2-2.14 5.28h-.03Z"], "door_exit": ["NM9 12a1 1 0 0 1 1 1v2a1 1 0 1 1-2 0v-2a1 1 0 0 1 1-1Z", "EM2.75 3.02A3 3 0 0 1 5 2h10a3 3 0 0 1 3 3v7.64c0 .44-.55.7-.95.55a3 3 0 0 0-3.17 4.93l.02.03a.5.5 0 0 1-.35.85h-.05a.5.5 0 0 0-.5.5 2.5 2.5 0 0 1-3.68 2.2l-5.8-3.09A3 3 0 0 1 2 16V5a3 3 0 0 1 .76-1.98Zm1.3 1.95A.04.04 0 0 0 4 5v11c0 .36.2.68.49.86l5.77 3.08a.5.5 0 0 0 .74-.44V8.02a.5.5 0 0 0-.32-.46l-6.63-2.6Z", "NM15.3 16.7a1 1 0 0 1 1.4-1.4l4.3 4.29V16a1 1 0 1 1 2 0v6a1 1 0 0 1-1 1h-6a1 1 0 1 1 0-2h3.59l-4.3-4.3Z"], "user_plus": ["NM19 14a1 1 0 0 1 1 1v3h3a1 1 0 0 1 0 2h-3v3a1 1 0 0 1-2 0v-3h-3a1 1 0 1 1 0-2h3v-3a1 1 0 0 1 1-1Z", "NM16.83 12.93c.26-.27.26-.75-.08-.92A9.5 9.5 0 0 0 12.47 11h-.94A9.53 9.53 0 0 0 2 20.53c0 .81.66 1.47 1.47 1.47h.22c.24 0 .44-.17.5-.4.29-1.12.84-2.17 1.32-2.91.14-.21.43-.1.4.15l-.26 2.61c-.02.3.2.55.5.55h7.64c.12 0 .17-.31.06-.36C12.82 21.14 12 20.22 12 19a3 3 0 0 1 3-3h.5a.5.5 0 0 0 .5-.5V15c0-.8.31-1.53.83-2.07ZM12 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"], "text_lock": ["EM16 4h.5v-.5a2.5 2.5 0 0 1 5 0V4h.5a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm4-.5V4h-2v-.5a1 1 0 1 1 2 0Z", "NM12.5 8c.28 0 .5.22.5.5V9c0 .1 0 .2.02.31.03.34-.21.69-.56.69H9.85l-.67 4h4.97l.28-1.68c.06-.34.44-.52.77-.43a3 3 0 0 0 .8.11c.27 0 .47.24.43.5l-.25 1.5H20a1 1 0 1 1 0 2h-4.15l-.86 5.16a1 1 0 0 1-1.98-.32l.8-4.84H8.86l-.86 5.16A1 1 0 0 1 6 20.84L6.82 16H3a1 1 0 1 1 0-2h4.15l.67-4H4a1 1 0 1 1 0-2h4.15l.86-5.16a1 1 0 1 1 1.98.32L10.19 8h2.31Z"], "voice_lock": ["EM16 4h.5v-.5a2.5 2.5 0 0 1 5 0V4h.5a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm4-.5V4h-2v-.5a1 1 0 1 1 2 0Z", "NM11 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1h-.06a1 1 0 0 1-.74-.32L5.92 17H3a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h2.92l4.28-4.68a1 1 0 0 1 .74-.32H11ZM20.5 12c-.28 0-.5.22-.52.5a7 7 0 0 1-5.13 6.25c-.48.13-.85.55-.85 1.05v.03c0 .6.52 1.06 1.1.92a9 9 0 0 0 6.89-8.25.48.48 0 0 0-.49-.5h-1ZM16.5 12c-.28 0-.5.23-.54.5a3 3 0 0 1-1.33 2.02c-.35.23-.63.6-.63 1.02v.14c0 .63.59 1.1 1.16.83a5 5 0 0 0 2.82-4.01c.02-.28-.2-.5-.48-.5h-1Z"], "bell_slash": ["NM1.3 21.3a1 1 0 1 0 1.4 1.4l20-20a1 1 0 0 0-1.4-1.4l-20 20ZM3.13 16.13c.11.27.46.28.66.08L15.73 4.27a.47.47 0 0 0-.07-.74 6.97 6.97 0 0 0-1.35-.64.62.62 0 0 1-.38-.43 2 2 0 0 0-3.86 0 .62.62 0 0 1-.38.43A7 7 0 0 0 5 9.5v2.09a.5.5 0 0 1-.13.33l-1.1 1.22A3 3 0 0 0 3 15.15v.28c0 .24.04.48.13.7ZM18.64 9.36c.13-.13.36-.05.36.14v2.09c0 .12.05.24.13.33l1.1 1.22a3 3 0 0 1 .77 2.01v.28c0 .67-.34 1.29-.95 1.56-1.31.6-4 1.51-8.05 1.51-.46 0-.9-.01-1.33-.03a.48.48 0 0 1-.3-.83l8.27-8.28ZM9.18 19.84A.16.16 0 0 0 9 20a3 3 0 1 0 6 0c0-.1-.09-.17-.18-.16a24.84 24.84 0 0 1-5.64 0Z"], "announcement_lock": ["EM16 4h.5v-.5a2.5 2.5 0 0 1 5 0V4h.5a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm4-.5V4h-2v-.5a1 1 0 1 1 2 0Z", "EM12.33 5.74a.5.5 0 0 1 .67.47V9a3 3 0 0 0 3 3h5.5c.28 0 .5.22.5.5v8c0 .83-.67 1.5-1.5 1.5h-.94a3 3 0 0 1-2.46-1.28 3.86 3.86 0 0 0-1.07-1.03l-2.36-.94a.92.92 0 0 0-1.23.63 2.92 2.92 0 0 1-3.55 2.12l-.62-.15A3 3 0 0 1 6 18.44V8.35c0-.2.13-.4.33-.47l6-2.14Zm-1.3 12.06L8 16.7v1.73a1 1 0 0 0 .76.97l.62.15c.5.13 1-.17 1.12-.67.1-.41.29-.78.53-1.1Z", "NM2 10c0-1.1.9-2 2-2h.5c.28 0 .5.22.5.5v7a.5.5 0 0 1-.5.5H4a2 2 0 0 1-2-2v-4Z"], "forum_lock": ["EM16 4h.5v-.5a2.5 2.5 0 0 1 5 0V4h.5a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm4-.5V4h-2v-.5a1 1 0 1 1 2 0Z", "NM13.58 3.23c.24-.33.16-.86-.24-.96C12.59 2.1 11.8 2 11 2c-4.97 0-9 3.58-9 8 0 1.5.47 2.91 1.28 4.11.14.21.12.49-.06.67l-1.51 1.51A1 1 0 0 0 2.4 18h5.1a.5.5 0 0 0 .49-.5c0-3.170 2-5.82 4.77-6.94.29-.11.43-.45.34-.75A3 3 0 0 1 13 9V5c0-.66.22-1.28.58-1.77ZM18.91 12.98a5.45 5.45 0 0 1 2.18 6.2c-.1.33-.09.68.1.96l.83 1.32a1 1 0 0 1-.84 1.54h-5.5A5.6 5.6 0 0 1 10 17.5a5.6 5.6 0 0 1 5.68-5.5c1.2 0 2.32.36 3.23.98Z"], "phone_call": ["NM2 7.4A5.4 5.4 0 0 1 7.4 2c.36 0 .7.22.83.55l1.93 4.64a1 1 0 0 1-.43 1.25L7 10a8.52 8.52 0 0 0 7 7l1.12-2.24a1 1 0 0 1 1.19-.51l5.06 1.56c.38.11.63.46.63.85C22 19.6 19.6 22 16.66 22h-.37C8.39 22 2 15.6 2 7.71V7.4ZM13 3a1 1 0 0 1 1-1 8 8 0 0 1 8 8 1 1 0 1 1-2 0 6 6 0 0 0-6-6 1 1 0 0 1-1-1Z", "NM13 7a1 1 0 0 1 1-1 4 4 0 0 1 4 4 1 1 0 1 1-2 0 2 2 0 0 0-2-2 1 1 0 0 1-1-1Z"], "group_plus": ["NM14.5 8a3 3 0 1 0-2.7-4.3c-.2.4.06.86.44 1.12a5 5 0 0 1 2.14 3.08c.01.06.06.1.12.1ZM16.62 13.17c-.22.29-.65.37-.92.14-.34-.3-.7-.57-1.09-.82-.52-.33-.7-1.05-.47-1.63.11-.27.2-.57.26-.87.11-.54.55-1 1.1-.92 1.6.2 3.04.92 4.15 1.98.3.27-.25.95-.65.95a3 3 0 0 0-2.38 1.17ZM15.19 15.61c.13.16.02.39-.19.39a3 3 0 0 0-1.52 5.59c.2.12.26.41.02.41h-8a.5.5 0 0 1-.5-.5v-2.1c0-.25-.31-.33-.42-.1-.32.67-.67 1.58-.88 2.54a.2.2 0 0 1-.2.16A1.5 1.5 0 0 1 2 20.5a7.5 7.5 0 0 1 13.19-4.89ZM9.5 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z", "NM19 14a1 1 0 0 1 1 1v3h3a1 1 0 0 1 0 2h-3v3a1 1 0 0 1-2 0v-3h-3a1 1 0 1 1 0-2h3v-3a1 1 0 0 1 1-1Z"], "user_circle": ["EM23 12.38c-.02.38-.45.58-.78.4a6.97 6.97 0 0 0-6.27-.08.54.54 0 0 1-.44 0 8.97 8.97 0 0 0-11.16 3.55c-.1.15-.1.35 0 .5.37.58.8 1.13 1.28 1.61.24.24.64.15.8-.15.19-.38.39-.73.58-1.02.14-.21.43-.1.4.15l-.19 1.96c-.02.19.07.37.23.47A8.96 8.96 0 0 0 12 21a.4.4 0 0 1 .38.27c.1.33.25.65.4.95.18.34-.02.76-.4.77L12 23a11 11 0 1 1 11-10.62ZM15.5 7.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z", "NM24 19a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"], "threads": ["NM12 2.81a1 1 0 0 1 0-1.41l.36-.36a1 1 0 0 1 1.41 0l9.2 9.2a1 1 0 0 1 0 1.4l-.7.7a1 1 0 0 1-1.3.13l-9.54-6.72a1 1 0 0 1-.08-1.58l1-1L12 2.8ZM12 21.2a1 1 0 0 1 0 1.41l-.35.35a1 1 0 0 1-1.41 0l-9.2-9.19a1 1 0 0 1 0-1.41l.7-.7a1 1 0 0 1 1.3-.12l9.54 6.72a1 1 0 0 1 .07 1.58l-1 1 .35.36ZM15.66 16.8a1 1 0 0 1-1.38.28l-8.49-5.66A1 1 0 1 1 6.9 9.76l8.49 5.65a1 1 0 0 1 .27 1.39ZM17.1 14.25a1 1 0 1 0 1.11-1.66L9.73 6.93a1 1 0 0 0-1.11 1.66l8.49 5.66Z"], "badge": ["NM10.89 11.79A3 3 0 1 0 13.1 6.2a3 3 0 0 0-2.22 5.58Z", "EM11.91 16.43a.66.66 0 0 0-.16.08 3.16 3.16 0 0 1-2.85.27 3.14 3.14 0 0 1-1.88-2.16.67.67 0 0 0-.5-.49A3.14 3.14 0 0 1 4.5 9.45a.67.67 0 0 0 0-.7 3.14 3.14 0 0 1 1.88-4.73.67.67 0 0 0 .49-.5 3.14 3.14 0 0 1 4.68-2.02c.22.13.5.13.7 0a3.14 3.14 0 0 1 4.73 1.88c.07.24.26.44.5.49a3.14 3.14 0 0 1 2.02 4.68.67.67 0 0 0 0 .7 3.14 3.14 0 0 1-1.88 4.73.67.67 0 0 0-.49.5 3.14 3.14 0 0 1-4.68 2.02.66.66 0 0 0-.54-.07Zm-1.76-2.79a5 5 0 1 0 3.7-9.28 5 5 0 0 0-3.7 9.28Z", "NM12.11 17.46a4.13 4.13 0 0 1-5.35-1.1l-.57 5.5a1 1 0 0 0 1.47.99l4.1-2.22a.5.5 0 0 1 .48 0l4.1 2.22a1 1 0 0 0 1.47-.98l-.56-5.42a4.12 4.12 0 0 1-5.14 1Z"], "orbs": ["NM11.75 7.57a5.12 5.12 0 0 1-3.86 3.87.42.42 0 0 0 0 .82 5.1 5.1 0 0 1 3.86 3.86.42.42 0 0 0 .81 0 5.12 5.12 0 0 1 3.87-3.86.42.42 0 0 0 0-.82 5.15 5.15 0 0 1-3.87-3.86.42.42 0 0 0-.81-.01Z", "EM11.64.22c.3-.12.62-.12.91 0l7.49 3.1c.29.12.52.35.64.64l3.1 7.49c.12.29.12.62 0 .9l-3.1 7.5c-.12.28-.35.51-.64.63l-7.49 3.1c-.29.13-.62.13-.9 0l-7.5-3.1c-.28-.12-.52-.35-.64-.64l-3.1-7.48c-.12-.3-.12-.62 0-.91l3.1-7.49c.12-.29.36-.52.65-.64l7.48-3.1ZM20.6 11.5 12.5 3.4a.56.56 0 0 0-.8 0l-8.1 8.1a.56.56 0 0 0 0 .8l8.1 8.1c.22.22.57.22.8 0l8.1-8.1a.56.56 0 0 0 0-.8Zm-8.85-3.94a5.12 5.12 0 0 1-3.86 3.87.42.42 0 0 0 0 .82 5.1 5.1 0 0 1 3.86 3.86.42.42 0 0 0 .81 0 5.12 5.12 0 0 1 3.87-3.86.42.42 0 0 0 0-.82 5.15 5.15 0 0 1-3.87-3.86.42.42 0 0 0-.81-.01Z"], "user_circle_filled": ["EM18.46 20.9a12.65 12.65 0 0 1-1.46.9 10.95 10.95 0 0 1-10 0 11 11 0 1 1 11.46-.9Zm-1.65-1.3a8.96 8.96 0 0 1-9.62 0l.23-2.26c.02-.25-.27-.36-.41-.15-.29.45-.6 1.01-.88 1.63A9.04 9.04 0 0 1 4.2 16.5a9 9 0 0 1 15.6 0 9.04 9.04 0 0 1-1.93 2.32c-.27-.62-.59-1.18-.88-1.63-.14-.21-.43-.1-.4.15l.22 2.27ZM12 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"], "chevron_small_right": ["NM9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"], "circle_info": ["EM23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-9.5-4.75a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm-.77 3.96a1 1 0 1 0-1.96-.42l-1.04 4.86a2.77 2.77 0 0 0 4.31 2.83l.24-.17a1 1 0 1 0-1.16-1.62l-.24.17a.77.77 0 0 1-1.2-.79l1.05-4.86Z"], "arrow_left": ["NM3.3 11.3a1 1 0 0 0 0 1.4l8 8a1 1 0 1 0 1.4-1.4L6.42 13H20a1 1 0 1 0 0-2H6.41l6.3-6.3a1 1 0 0 0-1.42-1.4l-8 8Z"], "arrow_right": ["NM20.7 12.7a1 1 0 0 0 0-1.4l-8-8a1 1 0 1 0-1.4 1.4l6.29 6.3H4a1 1 0 1 0 0 2h13.59l-6.3 6.3a1 1 0 0 0 1.42 1.4l8-8Z"], "eye_slash": ["NM1.3 21.3a1 1 0 1 0 1.4 1.4l20-20a1 1 0 0 0-1.4-1.4l-20 20ZM3.16 16.05c.18.24.53.26.74.05l.72-.72c.18-.18.2-.45.05-.66a15.7 15.7 0 0 1-1.43-2.52.48.48 0 0 1 0-.4c.4-.9 1.18-2.37 2.37-3.72C7.13 6.38 9.2 5 12 5c.82 0 1.58.12 2.28.33.18.05.38 0 .52-.13l.8-.8c.25-.25.18-.67-.15-.79A9.79 9.79 0 0 0 12 3C4.89 3 1.73 10.11 1.11 11.7a.83.83 0 0 0 0 .6c.25.64.9 2.15 2.05 3.75Z", "NM8.18 10.81c-.13.43.36.65.67.34l2.3-2.3c.31-.31.09-.8-.34-.67a4 4 0 0 0-2.63 2.63ZM12.85 15.15c-.31.31-.09.8.34.67a4.01 4.01 0 0 0 2.63-2.63c.13-.43-.36-.65-.67-.34l-2.3 2.3Z", "NM9.72 18.67a.52.52 0 0 0-.52.13l-.8.8c-.25.25-.18.67.15.79 1.03.38 2.18.61 3.45.61 7.11 0 10.27-7.11 10.89-8.7a.83.83 0 0 0 0-.6c-.25-.64-.9-2.15-2.05-3.75a.49.49 0 0 0-.74-.05l-.72.72a.51.51 0 0 0-.05.66 15.7 15.7 0 0 1 1.43 2.52c.06.13.06.27 0 .4-.4.9-1.18 2.37-2.37 3.72C16.87 17.62 14.8 19 12 19c-.82 0-1.58-.12-2.28-.33Z"], "game_controller": ["EM20.97 4.06c0 .18.08.35.24.43.55.28.9.82 1.04 1.42.3 1.24.75 3.7.75 7.09v4.91a3.09 3.09 0 0 1-5.85 1.38l-1.76-3.51a1.09 1.09 0 0 0-1.23-.55c-.57.13-1.36.27-2.16.27s-1.6-.14-2.16-.27c-.49-.11-1 .1-1.23.55l-1.76 3.51A3.09 3.09 0 0 1 1 17.91V13c0-3.38.46-5.85.75-7.1.15-.6.49-1.13 1.04-1.4a.47.47 0 0 0 .24-.44c0-.7.48-1.32 1.2-1.47l2.93-.62c.5-.1 1 .06 1.36.4.35.34.78.71 1.28.68a42.4 42.4 0 0 1 4.4 0c.5.03.93-.34 1.28-.69.35-.33.86-.5 1.36-.39l2.94.62c.7.15 1.19.78 1.19 1.47ZM20 7.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM15.5 12a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM5 7a1 1 0 0 1 2 0v1h1a1 1 0 0 1 0 2H7v1a1 1 0 1 1-2 0v-1H4a1 1 0 1 1 0-2h1V7Z"], "bolt": ["NM7.65 21.75a1 1 0 0 0 1.64.96l11.24-9.96a1 1 0 0 0-.66-1.75h-4.81a.5.5 0 0 1-.5-.6l1.79-8.15a1 1 0 0 0-1.64-.96L3.47 11.25A1 1 0 0 0 4.13 13h4.81c.32 0 .56.3.5.6l-1.79 8.15Z"], "flame": ["EM3 14a9 9 0 1 0 18 0c0-2.63-.61-5.22-1.79-7.58L18.2 4.38a.7.7 0 0 0-1.3.18l-.78 3.9a.66.66 0 0 1-1.27.11L12.22 1.6a.9.9 0 0 0-1.48-.33l-4.2 4.2A12.07 12.07 0 0 0 3 14Zm9.26-.84a.57.57 0 0 0-1-.23L9.6 15a3.08 3.08 0 1 0 5.12.48c-.14-.26-.5-.28-.71-.06L13 16.5l-.74-3.34Z"], "sprout": ["NM11.33 13.68c.41.27.93.27 1.34 0 1.73-1.1 6.2-4.3 6.2-8.02 0-2.02-1.6-3.66-3.59-3.66-1.46 0-2.42.58-3.28 1.44A4.33 4.33 0 0 0 8.72 2a3.63 3.63 0 0 0-3.6 3.66c0 3.72 4.48 6.92 6.2 8.02Z", "NM3.93 13.84a.94.94 0 0 0-.93.94 5.6 5.6 0 0 0 6.48 5.6l1.02-.18v1.27c0 .85.67 1.53 1.5 1.53s1.5-.68 1.5-1.53V20.2l1.02.17A5.6 5.6 0 0 0 21 14.78a.94.94 0 0 0-.93-.94h-2.24a5.6 5.6 0 0 0-4.89 2.9L12 18.41l-.94-1.69a5.6 5.6 0 0 0-4.89-2.9H3.93Z"], "music": ["NM8.65 1.51A2 2 0 0 0 6 3.41v9.88A3.98 3.98 0 0 0 4.5 13C2.57 13 1 14.34 1 16s1.57 3 3.5 3S8 17.66 8 16V5.4l11 3.81v7.08a3.98 3.98 0 0 0-1.5-.29c-1.93 0-3.5 1.34-3.5 3s1.57 3 3.5 3 3.5-1.34 3.5-3V7.03c0-.74-.47-1.4-1.18-1.65L8.65 1.51Z"], "tv": ["NM4 3a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3H4ZM6 20a1 1 0 1 0 0 2h12a1 1 0 1 0 0-2H6Z"], "apps": ["NM2.06 7.61c-.25.95.31 1.92 1.26 2.18l4.3 1.15c.94.25 1.91-.31 2.17-1.26l1.15-4.3c.25-.94-.31-1.91-1.26-2.17l-4.3-1.15c-.94-.25-1.91.31-2.17 1.26l-1.15 4.3ZM12.98 7.87a2 2 0 0 0 1.75 2.95H20a2 2 0 0 0 1.76-2.95l-2.63-4.83a2 2 0 0 0-3.51 0l-2.63 4.83ZM5.86 13.27a.89.89 0 0 1 1.28 0l.75.77a.9.9 0 0 0 .54.26l1.06.12c.5.06.85.52.8 1.02l-.13 1.08c-.02.2.03.42.14.6l.56.92c.27.43.14 1-.28 1.26l-.9.58a.92.92 0 0 0-.37.48l-.36 1.02a.9.9 0 0 1-1.15.57l-1-.36a.89.89 0 0 0-.6 0l-1 .36a.9.9 0 0 1-1.15-.57l-.36-1.02a.92.92 0 0 0-.37-.48l-.9-.58a.93.93 0 0 1-.28-1.26l.56-.93c.11-.17.16-.38.14-.59l-.12-1.08c-.06-.5.3-.96.8-1.02l1.05-.12a.9.9 0 0 0 .54-.26l.75-.77ZM18.52 13.71a1.1 1.1 0 0 0-2.04 0l-.46 1.24c-.19.5-.57.88-1.07 1.07l-1.24.46a1.1 1.1 0 0 0 0 2.04l1.24.46c.5.19.88.57 1.07 1.07l.46 1.24c.35.95 1.7.95 2.04 0l.46-1.24c.19-.5.57-.88 1.07-1.07l1.24-.46a1.1 1.1 0 0 0 0-2.04l-1.24-.46a1.8 1.8 0 0 1-1.07-1.07l-.46-1.24Z"], "sticker_small": ["EM7 3h10a4 4 0 0 1 4 4v6.5a.5.5 0 0 1-.5.5H19a5 5 0 0 0-5 5v1.5a.5.5 0 0 1-.5.5H7a4 4 0 0 1-4-4V7a4 4 0 0 1 4-4Zm-.5 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM19 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm-9.91 2.94a1 1 0 0 0-1.66 1.12 5.5 5.5 0 0 0 9.14 0 1 1 0 0 0-1.66-1.12 3.5 3.5 0 0 1-5.82 0Z", "NM19 16h1.73a3 3 0 0 1-.6.88l-3.25 3.24a3 3 0 0 1-.88.61V19a3 3 0 0 1 3-3Z"], "pin_slash": ["NM22.7 2.7a1 1 0 0 0-1.4-1.4l-20 20a1 1 0 1 0 1.4 1.4l20-20ZM4.5 1h13.17a.5.5 0 0 1 .36.85L4.62 15.25c-.2.22-.56.2-.6-.1A1 1 0 0 1 4 15v-.95a2 2 0 0 1 .61-1.44L8 9.35V5h-.91C5.39 5 4 3.48 4 1.6v-.1c0-.28.22-.5.5-.5ZM17.77 11.05a.5.5 0 0 0-.7 0l-4.1 4.1a.5.5 0 0 0 .36.85H19a1 1 0 0 0 1-1v-.95a2 2 0 0 0-.61-1.44l-1.62-1.56ZM11.08 17.25a.5.5 0 0 0-.36.15l-.36.37a.5.5 0 0 0-.14.46l.99 4.38a.5.5 0 0 0 .49.39h.6a.5.5 0 0 0 .49-.39l1.07-4.75a.5.5 0 0 0-.49-.61h-2.3Z"], "download": ["NM12 2a1 1 0 0 1 1 1v10.59l3.3-3.3a1 1 0 1 1 1.4 1.42l-5 5a1 1 0 0 1-1.4 0l-5-5a1 1 0 1 1 1.4-1.42l3.3 3.3V3a1 1 0 0 1 1-1ZM3 20a1 1 0 1 0 0 2h18a1 1 0 1 0 0-2H3Z"], "window_launch": ["NM15 2a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V4.41l-4.3 4.3a1 1 0 1 1-1.4-1.42L19.58 3H16a1 1 0 0 1-1-1Z", "NM5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 1 0-2 0v6a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h6a1 1 0 1 0 0-2H5Z"], "puzzle_piece": ["NM16 4a3 3 0 1 1-5.98-.31c.03-.35-.21-.69-.56-.69H7a3 3 0 0 0-3 3v2.5c0 .28-.23.5-.5.54a3 3 0 0 0 0 5.92c.27.04.5.26.5.54V18a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3h-2.46c-.35 0-.6.34-.56.69L16 4Z"], "chat": ["NM12 22a10 10 0 1 0-8.45-4.64c.13.19.11.44-.04.61l-2.06 2.37A1 1 0 0 0 2.2 22H12Z"], "folder": ["NM2 5a3 3 0 0 1 3-3h3.93a2 2 0 0 1 1.66.9L12 5h7a3 3 0 0 1 3 3v11a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V5Z"], "play": ["NM9.25 3.35C7.87 2.45 6 3.38 6 4.96v14.08c0 1.58 1.87 2.5 3.25 1.61l10.85-7.04a1.9 1.9 0 0 0 0-3.22L9.25 3.35Z"], "pause": ["NM6 4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H6ZM15 4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-3Z"], "speaker_x": ["NM12 3a1 1 0 0 0-1-1h-.06a1 1 0 0 0-.74.32L5.92 7H3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h2.92l4.28 4.68a1 1 0 0 0 .74.32H11a1 1 0 0 0 1-1V3ZM22.7 8.3a1 1 0 0 0-1.4 0L19 10.58l-2.3-2.3a1 1 0 1 0-1.4 1.42L17.58 12l-2.3 2.3a1 1 0 0 0 1.42 1.4L19 13.42l2.3 2.3a1 1 0 0 0 1.4-1.42L20.42 12l2.3-2.3a1 1 0 0 0 0-1.4Z"]}\ No newline at end of file+{"hash": ["EM10.99 3.16A1 1 0 1 0 9 2.84L8.15 8H4a1 1 0 0 0 0 2h3.82l-.67 4H3a1 1 0 1 0 0 2h3.82l-.8 4.84a1 1 0 0 0 1.97.32L8.85 16h4.97l-.8 4.84a1 1 0 0 0 1.97.32l.86-5.16H20a1 1 0 1 0 0-2h-3.82l.67-4H21a1 1 0 1 0 0-2h-3.82l.8-4.84a1 1 0 1 0-1.97-.32L15.15 8h-4.970l.8-4.84ZM14.15 14l.67-4H9.85l-.67 4h4.97Z"], "speaker": ["NM12 3a1 1 0 0 0-1-1h-.06a1 1 0 0 0-.74.32L5.92 7H3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h2.92l4.28 4.68a1 1 0 0 0 .74.32H11a1 1 0 0 0 1-1V3ZM15.1 20.75c-.58.14-1.1-.33-1.1-.92v-.03c0-.5.37-.92.85-1.05a7 7 0 0 0 0-13.5A1.11 1.11 0 0 1 14 4.2v-.03c0-.6.52-1.06 1.1-.92a9 9 0 0 1 0 17.5Z", "NM15.16 16.51c-.57.28-1.16-.2-1.16-.83v-.14c0-.43.28-.8.63-1.020a3 3 0 0 0 0-5.04c-.35-.23-.63-.6-.63-1.02v-.14c0-.63.59-1.1 1.16-.83a5 5 0 0 1 0 9.02Z"], "announcement": ["EM19.56 2a3 3 0 0 0-2.46 1.28 3.85 3.85 0 0 1-1.86 1.42l-8.9 3.18a.5.5 0 0 0-.34.47v10.09a3 3 0 0 0 2.27 2.9l.62.16c1.57.4 3.15-.56 3.55-2.12a.92.92 0 0 1 1.23-.63l2.36.94c.42.27.79.62 1.070 1.03A3 3 0 0 0 19.56 22h.94c.83 0 1.5-.67 1.5-1.5v-17c0-.83-.67-1.5-1.5-1.5h-.94Zm-8.53 15.8L8 16.7v1.73a1 1 0 0 0 .76.97l.62.15c.5.13 1-.17 1.12-.67.1-.41.29-.78.53-1.1Z", "NM2 10c0-1.1.9-2 2-2h.5c.28 0 .5.22.5.5v7a.5.5 0 0 1-.5.5H4a2 2 0 0 1-2-2v-4Z"], "forum": ["NM18.91 12.98a5.45 5.45 0 0 1 2.18 6.2c-.1.33-.09.68.1.96l.83 1.32a1 1 0 0 1-.84 1.54h-5.5A5.6 5.6 0 0 1 10 17.5a5.6 5.6 0 0 1 5.68-5.5c1.2 0 2.32.36 3.23.98Z", "NM19.24 10.86c.32.16.72-.02.74-.38L20 10c0-4.42-4.03-8-9-8s-9 3.58-9 8c0 1.5.47 2.91 1.28 4.11.14.21.12.49-.06.67l-1.51 1.51A1 1 0 0 0 2.4 18h5.1a.5.5 0 0 0 .49-.5c0-4.2 3.5-7.5 7.68-7.5 1.28 0 2.5.3 3.56.86Z"], "stage": ["NM19.61 18.25a1.08 1.08 0 0 1-.07-1.33 9 9 0 1 0-15.07 0c.26.42.25.97-.08 1.33l-.02.02c-.41.44-1.12.43-1.46-.07a11 11 0 1 1 18.17 0c-.33.5-1.04.51-1.45.07l-.02-.02Z", "NM16.83 15.23c.43.47 1.18.42 1.45-.14a7 7 0 1 0-12.57 0c.28.56 1.03.6 1.46.14l.05-.06c.3-.33.35-.81.17-1.23A4.98 4.98 0 0 1 12 7a5 5 0 0 1 4.6 6.94c-.17.42-.13.9.18 1.23l.05.06Z", "NM15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM6.33 20.03c-.25.72.12 1.5.8 1.84a10.96 10.96 0 0 0 9.73 0 1.52 1.52 0 0 0 .8-1.84 6 6 0 0 0-11.33 0Z"], "thread": ["NM12 2.81a1 1 0 0 1 0-1.41l.36-.36a1 1 0 0 1 1.41 0l9.2 9.2a1 1 0 0 1 0 1.4l-.7.7a1 1 0 0 1-1.3.13l-9.54-6.72a1 1 0 0 1-.08-1.58l1-1L12 2.8ZM12 21.2a1 1 0 0 1 0 1.41l-.35.35a1 1 0 0 1-1.41 0l-9.2-9.19a1 1 0 0 1 0-1.41l.7-.7a1 1 0 0 1 1.3-.12l9.54 6.72a1 1 0 0 1 .07 1.58l-1 1 .35.36ZM15.66 16.8a1 1 0 0 1-1.38.28l-8.49-5.66A1 1 0 1 1 6.9 9.76l8.49 5.65a1 1 0 0 1 .27 1.39ZM17.1 14.25a1 1 0 1 0 1.11-1.66L9.73 6.93a1 1 0 0 0-1.11 1.66l8.49 5.66Z"], "chevron_down": ["NM5.3 9.3a1 1 0 0 1 1.4 0l5.3 5.29 5.3-5.3a1 1 0 1 1 1.4 1.42l-6 6a1 1 0 0 1-1.4 0l-6-6a1 1 0 0 1 0-1.42Z"], "inbox": ["EM5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5ZM4 5.5C4 4.67 4.67 4 5.5 4h13c.83 0 1.5.67 1.5 1.5v6c0 .83-.67 1.5-1.5 1.5h-2.65c-.5 0-.85.5-.85 1a3 3 0 1 1-6 0c0-.5-.35-1-.85-1H5.5A1.5 1.5 0 0 1 4 11.5v-6Z"], "help": ["EM12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm-.28-16c-.98 0-1.81.47-2.27 1.14A1 1 0 1 1 7.8 7.01 4.73 4.73 0 0 1 11.72 5c2.5 0 4.65 1.88 4.65 4.38 0 2.1-1.54 3.77-3.52 4.24l.14 1a1 1 0 0 1-1.98.27l-.28-2a1 1 0 0 1 .99-1.14c1.54 0 2.650-1.14 2.65-2.38 0-1.23-1.1-2.37-2.65-2.37ZM13 17.88a1.13 1.13 0 1 1-2.25 0 1.13 1.13 0 0 1 2.25 0Z"], "bell": ["NM9.7 2.89c.18-.07.32-.24.37-.43a2 2 0 0 1 3.86 0c.05.2.19.36.38.43A7 7 0 0 1 19 9.5v2.09c0 .12.05.24.13.33l1.1 1.22a3 3 0 0 1 .77 2.01v.28c0 .67-.34 1.29-.95 1.56-1.31.6-4 1.51-8.05 1.51-4.05 0-6.74-.91-8.05-1.5-.61-.28-.95-.9-.95-1.57v-.28a3 3 0 0 1 .77-2l1.1-1.23a.5.5 0 0 0 .13-.33V9.5a7 7 0 0 1 4.7-6.61ZM9.18 19.84A.16.16 0 0 0 9 20a3 3 0 1 0 6 0c0-.1-.09-.17-.18-.16a24.86 24.86 0 0 1-5.64 0Z"], "pin": ["NM19.38 11.38a3 3 0 0 0 4.24 0l.03-.03a.5.5 0 0 0 0-.7L13.35.35a.5.5 0 0 0-.7 0l-.03.03a3 3 0 0 0 0 4.24L13 5l-2.92 2.92-3.65-.34a2 2 0 0 0-1.6.58l-.62.63a1 1 0 0 0 0 1.42l9.58 9.58a1 1 0 0 0 1.42 0l.63-.63a2 2 0 0 0 .58-1.6l-.34-3.64L19 11l.38.38ZM9.07 17.07a.5.5 0 0 1-.08.77l-5.15 3.43a.5.5 0 0 1-.63-.06l-.42-.42a.5.5 0 0 1-.06-.63L6.16 15a.5.5 0 0 1 .77-.08l2.14 2.14Z"], "members": ["NM14.5 8a3 3 0 1 0-2.7-4.3c-.2.4.06.86.44 1.12a5 5 0 0 1 2.14 3.08c.01.06.06.1.12.1ZM18.44 17.27c.15.43.54.73 1 .73h1.06c.83 0 1.5-.67 1.5-1.5a7.5 7.5 0 0 0-6.5-7.43c-.55-.08-.99.38-1.1.92-.06.3-.15.6-.26.87-.23.58-.05 1.3.47 1.63a9.53 9.53 0 0 1 3.83 4.78ZM12.5 9a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM2 20.5a7.5 7.5 0 0 1 15 0c0 .83-.67 1.5-1.5 1.5a.2.2 0 0 1-.2-.16c-.2-.96-.56-1.87-.88-2.54-.1-.23-.42-.15-.42.1v2.1a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-2.1c0-.25-.31-.33-.42-.1-.32.67-.67 1.58-.88 2.54a.2.2 0 0 1-.2.16A1.5 1.5 0 0 1 2 20.5Z"], "search": ["EM15.62 17.03a9 9 0 1 1 1.41-1.41l4.68 4.67a1 1 0 0 1-1.42 1.42l-4.67-4.68ZM17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"], "invite": ["NM14.5 8a3 3 0 1 0-2.7-4.3c-.2.4.06.86.44 1.12a5 5 0 0 1 2.14 3.08c.01.06.06.1.12.1ZM16.62 13.17c-.22.29-.65.37-.92.14-.34-.3-.7-.57-1.09-.82-.52-.33-.7-1.05-.47-1.63.11-.27.2-.57.26-.87.11-.54.55-1 1.1-.92 1.6.2 3.04.92 4.15 1.98.3.27-.25.95-.65.95a3 3 0 0 0-2.38 1.17ZM15.19 15.61c.13.16.02.39-.19.39a3 3 0 0 0-1.52 5.59c.2.12.26.41.02.41h-8a.5.5 0 0 1-.5-.5v-2.1c0-.25-.31-.33-.42-.1-.32.67-.67 1.58-.88 2.54a.2.2 0 0 1-.2.16A1.5 1.5 0 0 1 2 20.5a7.5 7.5 0 0 1 13.19-4.89ZM9.5 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM15.5 22Z", "NM19 14a1 1 0 0 1 1 1v3h3a1 1 0 0 1 0 2h-3v3a1 1 0 0 1-2 0v-3h-3a1 1 0 1 1 0-2h3v-3a1 1 0 0 1 1-1Z"], "add": ["NM13 3a1 1 0 1 0-2 0v8H3a1 1 0 1 0 0 2h8v8a1 1 0 0 0 2 0v-8h8a1 1 0 0 0 0-2h-8V3Z"], "mic": ["NM12 2a4 4 0 0 0-4 4v4a4 4 0 0 0 8 0V6a4 4 0 0 0-4-4Z", "NM6 10a1 1 0 0 0-2 0 8 8 0 0 0 7 7.94V20H9a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-2v-2.06A8 8 0 0 0 20 10a1 1 0 1 0-2 0 6 6 0 0 1-12 0Z"], "mic_off": ["Nm2.7 22.7 20-20a1 1 0 0 0-1.4-1.4l-20 20a1 1 0 1 0 1.4 1.4ZM10.8 17.32c-.21.21-.1.58.2.62V20H9a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-2v-2.06A8 8 0 0 0 20 10a1 1 0 0 0-2 0c0 1.45-.52 2.79-1.38 3.83l-.02.02A5.99 5.99 0 0 1 12.32 16a.52.52 0 0 0-.34.15l-1.18 1.18ZM15.36 4.52c.15-.15.19-.38.08-.56A4 4 0 0 0 8 6v4c0 .3.03.58.1.86.07.34.49.43.74.18l6.52-6.52ZM5.06 13.98c.16.28.53.31.75.09l.75-.75c.16-.16.19-.4.08-.61A5.97 5.97 0 0 1 6 10a1 1 0 0 0-2 0c0 1.45.39 2.81 1.060 3.98Z"], "headphones": ["NM12 3a9 9 0 0 0-8.95 10h1.87a5 5 0 0 1 4.1 2.13l1.37 1.97a3.1 3.1 0 0 1-.17 3.78 2.85 2.85 0 0 1-3.55.74 11 11 0 1 1 10.66 0c-1.27.71-2.73.23-3.55-.74a3.1 3.1 0 0 1-.17-3.78l1.38-1.97a5 5 0 0 1 4.1-2.13h1.86A9 9 0 0 0 12 3Z"], "headphones_off": ["NM22.7 2.7a1 1 0 0 0-1.4-1.4l-20 20a1 1 0 1 0 1.4 1.4l20-20ZM17.06 2.94a.48.48 0 0 0-.11-.77A11 11 0 0 0 2.18 16.94c.14.3.53.35.76.12l3.2-3.2c.25-.25.15-.68-.2-.76a5 5 0 0 0-1.02-.1H3.05a9 9 0 0 1 12.66-9.2c.2.09.44.05.59-.1l.76-.76ZM20.2 8.28a.52.52 0 0 1 .1-.58l.76-.76a.48.48 0 0 1 .77.11 11 11 0 0 1-4.5 14.57c-1.27.71-2.73.23-3.55-.74a3.1 3.1 0 0 1-.17-3.78l1.38-1.97a5 5 0 0 1 4.1-2.13h1.86a9.1 9.1 0 0 0-.75-4.72ZM10.1 17.9c.25-.25.65-.18.74.14a3.1 3.1 0 0 1-.62 2.84 2.85 2.85 0 0 1-3.55.74.16.16 0 0 1-.04-.25l3.48-3.48Z"], "settings": ["EM10.56 1.1c-.46.05-.7.53-.64.98.18 1.16-.19 2.2-.98 2.53-.8.33-1.79-.15-2.49-1.1-.27-.36-.78-.52-1.14-.24-.77.59-1.45 1.27-2.04 2.04-.28.36-.12.87.24 1.14.96.7 1.43 1.7 1.1 2.49-.33.8-1.37 1.16-2.53.98-.45-.07-.93.18-.99.64a11.1 11.1 0 0 0 0 2.88c.06.46.54.7.99.64 1.16-.18 2.2.19 2.53.98.33.8-.14 1.79-1.1 2.49-.36.27-.52.78-.24 1.14.59.77 1.27 1.45 2.04 2.04.36.28.87.12 1.14-.24.7-.95 1.7-1.43 2.49-1.1.8.33 1.16 1.37.98 2.53-.07.45.18.93.64.99a11.1 11.1 0 0 0 2.88 0c.46-.06.7-.54.64-.99-.18-1.16.19-2.2.98-2.53.8-.33 1.79.14 2.49 1.1.27.36.78.52 1.14.24.77-.59 1.45-1.27 2.04-2.04.28-.36.12-.87-.24-1.14-.96-.7-1.43-1.7-1.1-2.49.33-.8 1.37-1.16 2.53-.98.45.07.93-.18.99-.64a11.1 11.1 0 0 0 0-2.88c-.06-.46-.54-.7-.99-.64-1.16.18-2.2-.19-2.53-.98-.33-.8.14-1.79 1.1-2.49.36-.27.52-.78.24-1.14a11.07 11.07 0 0 0-2.04-2.04c-.36-.28-.87-.12-1.14.24-.7.96-1.7 1.43-2.49 1.1-.8-.33-1.16-1.37-.98-2.53.07-.45-.18-.93-.64-.99a11.1 11.1 0 0 0-2.88 0ZM16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"], "gift": ["EM4 6a4 4 0 0 1 4-4h.09c1.8 0 3.39 1.18 3.91 2.9A4.09 4.09 0 0 1 15.91 2H16a4 4 0 0 1 3.46 6H20a2 2 0 0 1 2 2v1.5a.5.5 0 0 1-.5.5h-19a.5.5 0 0 1-.5-.5V10c0-1.1.9-2 2-2h.54A3.98 3.98 0 0 1 4 6Zm12 2a2 2 0 1 0 0-4h-.09c-.96 0-1.8.65-2.02 1.58L13.29 8H16Zm-5.89-2.42.6 2.42H8a2 2 0 1 1 0-4h.09c.96 0 1.8.65 2.02 1.58Z", "NM3 20c0 1.1.9 2 2 2h5.5a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0-.5.5V20ZM13.5 22a.5.5 0 0 1-.5-.5v-7c0-.28.22-.5.5-.5h7c.28 0 .5.22.5.5V20a2 2 0 0 1-2 2h-5.5Z"], "gif": ["EM5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5Zm2.18 13.87a2.9 2.9 0 0 1-1.66-.49 3.18 3.18 0 0 1-1.12-1.35A4.88 4.88 0 0 1 4 12c0-.75.14-1.42.42-2 .29-.59.7-1.04 1.24-1.37a3.7 3.7 0 0 1 1.95-.5c.64 0 1.21.14 1.72.4.5.28.89.67 1.15 1.16l-1.22.88a1.76 1.76 0 0 0-1.64-1.02c-.66 0-1.17.22-1.52.65a2.74 2.74 0 0 0-.53 1.8c0 .78.18 1.39.53 1.81.35.42.86.64 1.52.64.3 0 .57-.06.81-.16.25-.12.45-.27.58-.47v-.93H7.3v-1.4h3.24v4.23H9.27l-.2-.71c-.43.57-1.060.86-1.89.86Zm6.34-.15h-1.57V8.28h1.57v7.44Zm1.51 0h1.57v-2.83h2.76v-1.42H16.6V9.7H20V8.28h-4.97v7.44Z"], "sticker": ["EM7 3h10a4 4 0 0 1 4 4v6.5a.5.5 0 0 1-.5.5H19a5 5 0 0 0-5 5v1.5a.5.5 0 0 1-.5.5H7a4 4 0 0 1-4-4V7a4 4 0 0 1 4-4Zm-.5 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM19 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm-9.91 2.94a1 1 0 0 0-1.66 1.12 5.5 5.5 0 0 0 9.14 0 1 1 0 0 0-1.66-1.12 3.5 3.5 0 0 1-5.82 0Z", "NM19 16h1.73a3 3 0 0 1-.6.88l-3.25 3.24a3 3 0 0 1-.88.61V19a3 3 0 0 1 3-3Z"], "reaction": ["EM12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22ZM6.5 13a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm11 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm-9.8 1.17a1 1 0 0 1 1.39.27 3.5 3.5 0 0 0 5.82 0 1 1 0 0 1 1.66 1.12 5.5 5.5 0 0 1-9.14 0 1 1 0 0 1 .27-1.4Z"], "edit": ["Nm13.96 5.46 4.58 4.58a1 1 0 0 0 1.42 0l1.38-1.38a2 2 0 0 0 0-2.82l-3.18-3.18a2 2 0 0 0-2.82 0l-1.38 1.38a1 1 0 0 0 0 1.42ZM2.11 20.16l.73-4.22a3 3 0 0 1 .83-1.61l7.87-7.870a1 1 0 0 1 1.42 0l4.58 4.58a1 1 0 0 1 0 1.42l-7.87 7.87a3 3 0 0 1-1.6.83l-4.23.73a1.5 1.5 0 0 1-1.73-1.73Z"], "forward": ["NM21.7 7.3a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4L18.58 9H13a7 7 0 0 0-7 7v4a1 1 0 1 1-2 0v-4a9 9 0 0 1 9-9h5.59l-3.3-3.3a1 1 0 0 1 1.42-1.4l5 5Z"], "more": ["EM4 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"], "reply": ["NM2.3 7.3a1 1 0 0 0 0 1.4l5 5a1 1 0 0 0 1.4-1.4L5.42 9H11a7 7 0 0 1 7 7v4a1 1 0 1 0 2 0v-4a9 9 0 0 0-9-9H5.41l3.3-3.3a1 1 0 0 0-1.42-1.4l-5 5Z"], "close": ["NM17.3 18.7a1 1 0 0 0 1.4-1.4L13.42 12l5.3-5.3a1 1 0 0 0-1.42-1.4L12 10.58l-5.3-5.3a1 1 0 0 0-1.4 1.42L10.58 12l-5.3 5.3a1 1 0 1 0 1.42 1.4L12 13.42l5.3 5.3Z"], "trash": ["NM14.25 1c.41 0 .75.34.75.75V3h5.25c.41 0 .75.34.75.75v.5c0 .41-.34.75-.75.75H3.75A.75.75 0 0 1 3 4.25v-.5c0-.41.34-.75.75-.75H9V1.75c0-.41.34-.75.75-.75h4.5Z", "EM5.06 7a1 1 0 0 0-1 1.06l.76 12.13a3 3 0 0 0 3 2.81h8.36a3 3 0 0 0 3-2.81l.75-12.13a1 1 0 0 0-1-1.06H5.07ZM11 12a1 1 0 1 0-2 0v6a1 1 0 1 0 2 0v-6Zm3-1a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-6a1 1 0 0 1 1-1Z"], "copy": ["NM3 16a1 1 0 0 1-1-1v-5a8 8 0 0 1 8-8h5a1 1 0 0 1 1 1v.5a.5.5 0 0 1-.5.5H10a6 6 0 0 0-6 6v5.5a.5.5 0 0 1-.5.5H3Z", "NM6 18a4 4 0 0 0 4 4h8a4 4 0 0 0 4-4v-4h-3a5 5 0 0 1-5-5V6h-4a4 4 0 0 0-4 4v8Z", "NM21.73 12a3 3 0 0 0-.6-.88l-4.25-4.24a3 3 0 0 0-.88-.61V9a3 3 0 0 0 3 3h2.73Z"], "id": ["NM15.3 14.48c-.46.45-1.08.67-1.86.67h-1.39V9.2h1.39c.78 0 1.4.22 1.86.67.46.45.68 1.22.68 2.31 0 1.1-.22 1.86-.68 2.31Z", "EM5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5Zm1 15h2.04V7.34H6V17Zm4-9.66V17h3.44c1.46 0 2.6-.42 3.38-1.25.8-.83 1.2-2.02 1.2-3.58s-.4-2.75-1.2-3.58c-.79-.83-1.92-1.25-3.38-1.25H10Z"], "link": ["NM16.32 14.72a1 1 0 0 1 0-1.41l2.51-2.51a3.98 3.98 0 0 0-5.62-5.63l-2.52 2.51a1 1 0 0 1-1.41-1.41l2.52-2.52a5.98 5.98 0 0 1 8.45 8.46l-2.52 2.51a1 1 0 0 1-1.41 0ZM7.68 9.29a1 1 0 0 1 0 1.41l-2.52 2.51a3.98 3.98 0 1 0 5.63 5.63l2.51-2.52a1 1 0 0 1 1.42 1.42l-2.52 2.51a5.98 5.98 0 0 1-8.45-8.45l2.51-2.51a1 1 0 0 1 1.42 0Z", "NM14.7 10.7a1 1 0 0 0-1.4-1.4l-4 4a1 1 0 1 0 1.4 1.4l4-4Z"], "mail": ["NM1.16 5.02c-.1.28.04.58.29.74l10.27 6.85a.5.5 0 0 0 .56 0l10.27-6.85c.25-.16.38-.46.29-.74A3 3 0 0 0 20 3H4a3 3 0 0 0-2.84 2.02Z", "NM23 8.8a.5.5 0 0 0-.78-.41l-9.53 6.35c-.42.28-.96.28-1.38 0L1.78 8.39A.5.5 0 0 0 1 8.8V18a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8.8Z"], "friends": ["NM13 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z", "NM3 5v-.75C3 3.56 3.56 3 4.25 3s1.24.56 1.33 1.25C6.12 8.65 9.46 12 13 12h1a8 8 0 0 1 8 8 2 2 0 0 1-2 2 .21.21 0 0 1-.2-.15 7.65 7.65 0 0 0-1.32-2.3c-.15-.2-.42-.06-.39.17l.25 2c.02.15-.1.28-.25.28H9a2 2 0 0 1-2-2v-2.22c0-1.57-.67-3.05-1.53-4.37A15.85 15.85 0 0 1 3 5Z"], "nitro": ["NM16.23 12c0 1.29-.95 2.25-2.22 2.25A2.18 2.18 0 0 1 11.8 12c0-1.29.95-2.25 2.22-2.25 1.27 0 2.22.96 2.22 2.25ZM23 12c0 5.01-4 9-8.99 9a8.93 8.93 0 0 1-8.75-6.9H3.34l-.9-4.2H5.3c.26-.96.68-1.89 1.21-2.7H1.89L1 3h12.74C19.13 3 23 6.99 23 12Zm-4.26 0c0-2.67-2.1-4.8-4.73-4.8A4.74 4.74 0 0 0 9.28 12c0 2.67 2.1 4.8 4.73 4.8a4.74 4.74 0 0 0 4.73-4.8Z"], "shop": ["NM2.63 4.19A3 3 0 0 1 5.53 2H7a1 1 0 0 1 1 1v3.98a3.07 3.07 0 0 1-.3 1.35A2.97 2.97 0 0 1 4.98 10c-2 0-3.44-1.9-2.9-3.83l.55-1.98ZM10 2a1 1 0 0 0-1 1v4a3 3 0 0 0 3 3 3 3 0 0 0 3-2.97V3a1 1 0 0 0-1-1h-4ZM17 2a1 1 0 0 0-1 1v3.98a3.65 3.65 0 0 0 0 .05A2.95 2.95 0 0 0 19.02 10c2 0 3.44-1.9 2.9-3.83l-.55-1.98A3 3 0 0 0 18.47 2H17Z", "NM21 11.42V19a3 3 0 0 1-3 3h-2.75a.25.25 0 0 1-.25-.25V16a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v5.75c0 .14-.11.25-.25.25H6a3 3 0 0 1-3-3v-7.58c0-.18.2-.3.37-.24a4.46 4.46 0 0 0 4.94-1.1c.1-.12.3-.12.4 0a4.49 4.49 0 0 0 6.58 0c.1-.12.3-.12.4 0a4.45 4.45 0 0 0 4.94 1.1c.17-.07.37.06.37.24Z"], "quests": ["NM7.5 21.7a8.95 8.95 0 0 1 9 0 1 1 0 0 0 1-1.73c-.6-.35-1.24-.64-1.9-.87.54-.3 1.05-.65 1.52-1.07a3.98 3.98 0 0 0 5.49-1.8.77.77 0 0 0-.24-.95 3.98 3.98 0 0 0-2.02-.76A4 4 0 0 0 23 10.47a.76.76 0 0 0-.71-.71 4.06 4.06 0 0 0-1.6.22 3.99 3.99 0 0 0 .54-5.35.77.77 0 0 0-.95-.24c-.75.36-1.37.95-1.77 1.67V6a4 4 0 0 0-4.9-3.9.77.77 0 0 0-.6.72 4 4 0 0 0 3.7 4.17c.89 1.3 1.3 2.95 1.3 4.51 0 3.66-2.75 6.5-6 6.5s-6-2.84-6-6.5c0-1.56.41-3.21 1.3-4.51A4 4 0 0 0 11 2.82a.77.77 0 0 0-.6-.72 4.01 4.01 0 0 0-4.9 3.96A4.02 4.02 0 0 0 3.73 4.4a.77.77 0 0 0-.95.24 3.98 3.98 0 0 0 .55 5.35 4 4 0 0 0-1.6-.22.76.76 0 0 0-.72.71l-.01.28a4 4 0 0 0 2.65 3.77c-.75.06-1.45.33-2.02.76-.3.22-.4.62-.24.95a4 4 0 0 0 5.49 1.8c.47.42.98.78 1.53 1.07-.67.23-1.3.52-1.91.87a1 1 0 1 0 1 1.73Z"], "screen": ["NM5 2a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5ZM13.5 20a.5.5 0 0 1-.5-.5v-2a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v2a.5.5 0 0 1-.5.5H9a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-1.5Z"], "hang_up": ["Nm21.5 16.6-.13.14a.88.88 0 0 1-.97.2l-4.09-1.7a.99.99 0 0 1-.57-1.18l.73-2.7c-2.24-3-6.7-3-8.94 0l.7 2.1a.99.99 0 0 1-.48 1.19l-4.13 2.2a.87.87 0 0 1-1.03-.15l-.1-.1a5.18 5.18 0 0 1-.32-6.92 12.67 12.67 0 0 1 19.66 0 5.18 5.18 0 0 1-.32 6.92Z"], "soundboard": ["NM14.24 1.03a1 1 0 0 1 .73 1.21l-1 4a1 1 0 1 1-1.94-.48l1-4a1 1 0 0 1 1.21-.73ZM20.7 4.7a1 1 0 0 0-1.4-1.4l-4 4a1 1 0 0 0 1.4 1.4l4-4Z", "EM15.14 20.14c1.78-1.78.7-5.75-2.42-8.86-3.11-3.12-7.08-4.2-8.86-2.42A3.13 3.13 0 0 0 3 11V11l-1.16 8.92a2 2 0 0 0 2.24 2.24L13 21c.86-.04 1.6-.32 2.14-.86Zm-1.3-3.4a9.61 9.61 0 0 0-2.53-4.05 9.61 9.61 0 0 0-4.05-2.53c-1.27-.35-1.82-.05-1.99.11-.16.17-.46.72-.11 2a9.61 9.61 0 0 0 2.53 4.04 9.61 9.61 0 0 0 4.05 2.53c1.27.35 1.82.05 1.99-.11.16-.17.46-.72.11-2Z", "NM7.05 3.32a1 1 0 0 1 1.9-.64l1 3a1 1 0 0 1-1.9.64l-1-3ZM22.97 9.76a1 1 0 0 0-1.21-.73l-4 1a1 1 0 1 0 .48 1.94l4-1a1 1 0 0 0 .73-1.21ZM20.68 16.95a1 1 0 0 0 .64-1.9l-3-1a1 1 0 0 0-.64 1.9l3 1Z"], "waveform": ["NM7 2a1 1 0 0 0-1 1v18a1 1 0 1 0 2 0V3a1 1 0 0 0-1-1ZM11 6a1 1 0 1 1 2 0v12a1 1 0 1 1-2 0V6ZM1 8a1 1 0 0 1 2 0v8a1 1 0 1 1-2 0V8ZM16 5a1 1 0 1 1 2 0v14a1 1 0 1 1-2 0V5ZM22 8a1 1 0 0 0-1 1v6a1 1 0 1 0 2 0V9a1 1 0 0 0-1-1Z"], "signal": ["NM2 3a1 1 0 0 1 1-1 19 19 0 0 1 19 19 1 1 0 1 1-2 0A17 17 0 0 0 3 4a1 1 0 0 1-1-1Z", "NM2 8a1 1 0 0 1 1-1 14 14 0 0 1 14 14 1 1 0 1 1-2 0A12 12 0 0 0 3 9a1 1 0 0 1-1-1Z", "NM3 12a1 1 0 1 0 0 2 7 7 0 0 1 7 7 1 1 0 1 0 2 0 9 9 0 0 0-9-9ZM2 17.83c0-.46.37-.83.83-.83C5.13 17 7 18.87 7 21.17c0 .46-.37.83-.83.83H3a1 1 0 0 1-1-1v-3.17Z"], "video": ["NM4 4a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h11a3 3 0 0 0 3-3v-2.12a1 1 0 0 0 .55.9l3 1.5a1 1 0 0 0 1.45-.9V7.62a1 1 0 0 0-1.45-.9l-3 1.5a1 1 0 0 0-.55.9V7a3 3 0 0 0-3-3H4Z"], "calendar": ["NM7 1a1 1 0 0 1 1 1v.75c0 .14.11.25.25.25h7.5c.14 0 .25-.11.25-.25V2a1 1 0 1 1 2 0v.75c0 .14.11.25.25.25H19a3 3 0 0 1 3 3 1 1 0 0 1-1 1H3a1 1 0 0 1-1-1 3 3 0 0 1 3-3h.75c.14 0 .25-.11.25-.25V2a1 1 0 0 1 1-1Z", "EM2 10a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v9a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3v-9Zm3.5 2a.5.5 0 0 0-.5.5v3c0 .28.22.5.5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3Z"], "boost": ["NM11.02 1.36c.56-.48 1.4-.48 1.96 0l6.48 5.45c.34.29.54.71.54 1.16v8.23c-.05.38-.24.74-.54 1l-6.48 5.44c-.53.45-1.3.48-1.86.09l-.1-.09-6.48-5.45c-.3-.25-.49-.6-.53-1L4 16.04V7.97c0-.45.2-.87.54-1.16l6.48-5.45ZM6.36 7.89a1 1 0 0 0-.36.76v6.7c0 .29.13.57.36.76l5 4.2a1 1 0 0 0 1.28 0l5-4.2a1 1 0 0 0 .36-.77V8.65a1 1 0 0 0-.36-.76l-5-4.2a1 1 0 0 0-1.28 0l-5 4.2Z", "NM11.36 6.3a1 1 0 0 1 1.28 0l3 2.52a1 1 0 0 1 .36.76v4.84a1 1 0 0 1-.36.76l-3 2.53a1 1 0 0 1-1.28 0l-3-2.53a1 1 0 0 1-.36-.76V9.58a1 1 0 0 1 .36-.76l3-2.53Z"], "check": ["NM21.7 5.3a1 1 0 0 1 0 1.4l-12 12a1 1 0 0 1-1.4 0l-6-6a1 1 0 1 1 1.4-1.4L9 16.58l11.3-11.3a1 1 0 0 1 1.4 0Z"], "star": ["NM10.81 2.86c.38-1.15 2-1.15 2.38 0l1.89 5.83h6.12c1.2 0 1.71 1.54.73 2.25l-4.95 3.6 1.9 5.82a1.25 1.25 0 0 1-1.93 1.4L12 18.16l-4.95 3.6c-.98.7-2.3-.25-1.92-1.4l1.89-5.82-4.95-3.6a1.25 1.25 0 0 1 .73-2.25h6.12l1.9-5.83Z"], "lock": ["EM6 9h1V6a5 5 0 0 1 10 0v3h1a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3Zm9-3v3H9V6a3 3 0 1 1 6 0Zm-1 8a2 2 0 0 1-1 1.73V18a1 1 0 1 1-2 0v-2.27A2 2 0 1 1 14 14Z"], "eye": ["NM15.56 11.77c.2-.1.44.02.44.23a4 4 0 1 1-4-4c.21 0 .33.25.23.44a2.5 2.5 0 0 0 3.32 3.32Z", "EM22.89 11.7c.07.2.07.4 0 .6C22.27 13.9 19.1 21 12 21c-7.11 0-10.27-7.11-10.89-8.7a.83.83 0 0 1 0-.6C1.73 10.1 4.9 3 12 3c7.11 0 10.27 7.11 10.89 8.7Zm-4.5-3.62A15.11 15.11 0 0 1 20.85 12c-.38.88-1.18 2.47-2.46 3.92C16.87 17.62 14.8 19 12 19c-2.8 0-4.87-1.38-6.39-3.08A15.11 15.11 0 0 1 3.15 12c.38-.88 1.18-2.47 2.46-3.92C7.13 6.38 9.2 5 12 5c2.8 0 4.87 1.38 6.39 3.08Z"], "image": ["EM2 5a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v14a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V5Zm13.35 8.13 3.5 4.67c.37.5.02 1.2-.6 1.2H5.81a.75.75 0 0 1-.59-1.22l1.86-2.32a1.5 1.5 0 0 1 2.34 0l.5.64 2.23-2.97a2 2 0 0 1 3.2 0ZM10.2 5.98c.23-.91-.88-1.55-1.55-.9a.93.93 0 0 1-1.3 0c-.67-.65-1.78-.01-1.55.9a.93.93 0 0 1-.65 1.12c-.9.26-.9 1.54 0 1.8.48.14.77.63.65 1.12-.23.91.88 1.55 1.55.9a.93.93 0 0 1 1.3 0c.67.65 1.78.01 1.55-.9a.93.93 0 0 1 .65-1.12c.9-.26.9-1.54 0-1.8a.93.93 0 0 1-.65-1.12Z"], "file": ["NM18 22H6a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h7.5c.28 0 .5.22.5.5V5a5 5 0 0 0 5 5h2.5c.28 0 .5.22.5.5V18a4 4 0 0 1-4 4Z", "NM21.7 7.94c.01.03 0 .06-.04.06H19a3 3 0 0 1-3-3V2.34c0-.03.03-.05.06-.04a3 3 0 0 1 .82.58l4.24 4.24a3 3 0 0 1 .58.82Z"], "shield": ["NM17.05 8.76a4.7 4.7 0 0 1-1.29-.88c-.36-.33-.7-.73-.88-1.13-.33-.73-.16-.77-1.08-.77h-3.64c-.91 0-.74.04-1.08.77a4.94 4.94 0 0 1-2.17 2.01c-.74.33-.85.14-.86.82 0 .88-.22 3.34 1.78 5.19a13.68 13.68 0 0 0 3.98 2.47c.09.03.08.04.17.04.09 0 .08 0 .17-.04.76-.25 2.67-1.25 3.98-2.47 2-1.85 1.78-4.3 1.78-5.19-.01-.68-.12-.49-.86-.82Z", "NM19.91 5.41c-.84 0-1.52-.65-1.52-1.46v-.3c0-.9-.77-1.65-1.71-1.65H7.31c-.94 0-1.71.74-1.71 1.65v.3c0 .81-.68 1.46-1.52 1.46H3.7c-.94 0-1.7.73-1.7 1.64v3.52l.01.49c.05 3.11.94 4.69 2.92 6.63C6.72 19.46 11.58 22 11.99 22c.41 0 5.27-2.54 7.060-4.31 1.98-1.95 2.92-3.53 2.92-6.63L22 7.05c0-.9-.76-1.64-1.7-1.64h-.39Zm-2.18 10.74a21.76 21.76 0 0 1-5.58 3.38c-.1.03-.2.03-.31 0a21.76 21.76 0 0 1-5.58-3.38c-1.15-1.08-2.12-2.37-2.12-5.29v-.33l.03-2.57c0-.31.26-.57.59-.57a2.88 2.88 0 0 0 2.89-2.8v-.03c0-.3.26-.55.59-.55h7.56c.32 0 .59.25.59.55v.03c0 1.53 1.3 2.77 2.89 2.8.32 0 .59.26.59.57l.03 2.57v.34c0 2.92-.98 4.2-2.14 5.28h-.03Z"], "door_exit": ["NM9 12a1 1 0 0 1 1 1v2a1 1 0 1 1-2 0v-2a1 1 0 0 1 1-1Z", "EM2.75 3.02A3 3 0 0 1 5 2h10a3 3 0 0 1 3 3v7.64c0 .44-.55.7-.95.55a3 3 0 0 0-3.17 4.93l.02.03a.5.5 0 0 1-.35.85h-.05a.5.5 0 0 0-.5.5 2.5 2.5 0 0 1-3.68 2.2l-5.8-3.09A3 3 0 0 1 2 16V5a3 3 0 0 1 .76-1.98Zm1.3 1.95A.04.04 0 0 0 4 5v11c0 .36.2.68.49.86l5.77 3.08a.5.5 0 0 0 .74-.44V8.02a.5.5 0 0 0-.32-.46l-6.63-2.6Z", "NM15.3 16.7a1 1 0 0 1 1.4-1.4l4.3 4.29V16a1 1 0 1 1 2 0v6a1 1 0 0 1-1 1h-6a1 1 0 1 1 0-2h3.59l-4.3-4.3Z"], "user_plus": ["NM19 14a1 1 0 0 1 1 1v3h3a1 1 0 0 1 0 2h-3v3a1 1 0 0 1-2 0v-3h-3a1 1 0 1 1 0-2h3v-3a1 1 0 0 1 1-1Z", "NM16.83 12.93c.26-.27.26-.75-.08-.92A9.5 9.5 0 0 0 12.47 11h-.94A9.53 9.53 0 0 0 2 20.53c0 .81.66 1.47 1.47 1.47h.22c.24 0 .44-.17.5-.4.29-1.12.84-2.17 1.32-2.91.14-.21.43-.1.4.15l-.26 2.61c-.02.3.2.55.5.55h7.64c.12 0 .17-.31.06-.36C12.82 21.14 12 20.22 12 19a3 3 0 0 1 3-3h.5a.5.5 0 0 0 .5-.5V15c0-.8.31-1.53.83-2.07ZM12 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"], "text_lock": ["EM16 4h.5v-.5a2.5 2.5 0 0 1 5 0V4h.5a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm4-.5V4h-2v-.5a1 1 0 1 1 2 0Z", "NM12.5 8c.28 0 .5.22.5.5V9c0 .1 0 .2.02.31.03.34-.21.69-.56.69H9.85l-.67 4h4.97l.28-1.68c.06-.34.44-.52.77-.43a3 3 0 0 0 .8.11c.27 0 .47.24.43.5l-.25 1.5H20a1 1 0 1 1 0 2h-4.15l-.86 5.16a1 1 0 0 1-1.98-.32l.8-4.84H8.86l-.86 5.16A1 1 0 0 1 6 20.84L6.82 16H3a1 1 0 1 1 0-2h4.15l.67-4H4a1 1 0 1 1 0-2h4.15l.86-5.16a1 1 0 1 1 1.98.32L10.19 8h2.31Z"], "voice_lock": ["EM16 4h.5v-.5a2.5 2.5 0 0 1 5 0V4h.5a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm4-.5V4h-2v-.5a1 1 0 1 1 2 0Z", "NM11 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1h-.06a1 1 0 0 1-.74-.32L5.92 17H3a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h2.92l4.28-4.68a1 1 0 0 1 .74-.32H11ZM20.5 12c-.28 0-.5.22-.52.5a7 7 0 0 1-5.13 6.25c-.48.13-.85.55-.85 1.05v.03c0 .6.52 1.06 1.1.92a9 9 0 0 0 6.89-8.25.48.48 0 0 0-.49-.5h-1ZM16.5 12c-.28 0-.5.23-.54.5a3 3 0 0 1-1.33 2.02c-.35.23-.63.6-.63 1.02v.14c0 .63.59 1.1 1.16.83a5 5 0 0 0 2.82-4.01c.02-.28-.2-.5-.48-.5h-1Z"], "bell_slash": ["NM1.3 21.3a1 1 0 1 0 1.4 1.4l20-20a1 1 0 0 0-1.4-1.4l-20 20ZM3.13 16.13c.11.27.46.28.66.08L15.73 4.27a.47.47 0 0 0-.07-.74 6.97 6.97 0 0 0-1.35-.64.62.62 0 0 1-.38-.43 2 2 0 0 0-3.86 0 .62.62 0 0 1-.38.43A7 7 0 0 0 5 9.5v2.09a.5.5 0 0 1-.13.33l-1.1 1.22A3 3 0 0 0 3 15.15v.28c0 .24.04.48.13.7ZM18.64 9.36c.13-.13.36-.05.36.14v2.09c0 .12.05.24.13.33l1.1 1.22a3 3 0 0 1 .77 2.01v.28c0 .67-.34 1.29-.95 1.56-1.31.6-4 1.51-8.05 1.51-.46 0-.9-.01-1.33-.03a.48.48 0 0 1-.3-.83l8.27-8.28ZM9.18 19.84A.16.16 0 0 0 9 20a3 3 0 1 0 6 0c0-.1-.09-.17-.18-.16a24.84 24.84 0 0 1-5.64 0Z"], "announcement_lock": ["EM16 4h.5v-.5a2.5 2.5 0 0 1 5 0V4h.5a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm4-.5V4h-2v-.5a1 1 0 1 1 2 0Z", "EM12.33 5.74a.5.5 0 0 1 .67.47V9a3 3 0 0 0 3 3h5.5c.28 0 .5.22.5.5v8c0 .83-.67 1.5-1.5 1.5h-.94a3 3 0 0 1-2.46-1.28 3.86 3.86 0 0 0-1.07-1.03l-2.36-.94a.92.92 0 0 0-1.23.63 2.92 2.92 0 0 1-3.55 2.12l-.62-.15A3 3 0 0 1 6 18.44V8.35c0-.2.13-.4.33-.47l6-2.14Zm-1.3 12.06L8 16.7v1.73a1 1 0 0 0 .76.97l.62.15c.5.13 1-.17 1.12-.67.1-.41.29-.78.53-1.1Z", "NM2 10c0-1.1.9-2 2-2h.5c.28 0 .5.22.5.5v7a.5.5 0 0 1-.5.5H4a2 2 0 0 1-2-2v-4Z"], "forum_lock": ["EM16 4h.5v-.5a2.5 2.5 0 0 1 5 0V4h.5a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm4-.5V4h-2v-.5a1 1 0 1 1 2 0Z", "NM13.58 3.23c.24-.33.16-.86-.24-.96C12.59 2.1 11.8 2 11 2c-4.97 0-9 3.58-9 8 0 1.5.47 2.91 1.28 4.11.14.21.12.49-.06.67l-1.51 1.51A1 1 0 0 0 2.4 18h5.1a.5.5 0 0 0 .49-.5c0-3.170 2-5.82 4.77-6.94.29-.11.43-.45.34-.75A3 3 0 0 1 13 9V5c0-.66.22-1.28.58-1.77ZM18.91 12.98a5.45 5.45 0 0 1 2.18 6.2c-.1.33-.09.68.1.96l.83 1.32a1 1 0 0 1-.84 1.54h-5.5A5.6 5.6 0 0 1 10 17.5a5.6 5.6 0 0 1 5.68-5.5c1.2 0 2.32.36 3.23.98Z"], "phone_call": ["NM2 7.4A5.4 5.4 0 0 1 7.4 2c.36 0 .7.22.83.55l1.93 4.64a1 1 0 0 1-.43 1.25L7 10a8.52 8.52 0 0 0 7 7l1.12-2.24a1 1 0 0 1 1.19-.51l5.06 1.56c.38.11.63.46.63.85C22 19.6 19.6 22 16.66 22h-.37C8.39 22 2 15.6 2 7.71V7.4ZM13 3a1 1 0 0 1 1-1 8 8 0 0 1 8 8 1 1 0 1 1-2 0 6 6 0 0 0-6-6 1 1 0 0 1-1-1Z", "NM13 7a1 1 0 0 1 1-1 4 4 0 0 1 4 4 1 1 0 1 1-2 0 2 2 0 0 0-2-2 1 1 0 0 1-1-1Z"], "group_plus": ["NM14.5 8a3 3 0 1 0-2.7-4.3c-.2.4.06.86.44 1.12a5 5 0 0 1 2.14 3.08c.01.06.06.1.12.1ZM16.62 13.17c-.22.29-.65.37-.92.14-.34-.3-.7-.57-1.09-.82-.52-.33-.7-1.05-.47-1.63.11-.27.2-.57.26-.87.11-.54.55-1 1.1-.92 1.6.2 3.04.92 4.15 1.98.3.27-.25.95-.65.95a3 3 0 0 0-2.38 1.17ZM15.19 15.61c.13.16.02.39-.19.39a3 3 0 0 0-1.52 5.59c.2.12.26.41.02.41h-8a.5.5 0 0 1-.5-.5v-2.1c0-.25-.31-.33-.42-.1-.32.67-.67 1.58-.88 2.54a.2.2 0 0 1-.2.16A1.5 1.5 0 0 1 2 20.5a7.5 7.5 0 0 1 13.19-4.89ZM9.5 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z", "NM19 14a1 1 0 0 1 1 1v3h3a1 1 0 0 1 0 2h-3v3a1 1 0 0 1-2 0v-3h-3a1 1 0 1 1 0-2h3v-3a1 1 0 0 1 1-1Z"], "user_circle": ["EM23 12.38c-.02.38-.45.58-.78.4a6.97 6.97 0 0 0-6.27-.08.54.54 0 0 1-.44 0 8.97 8.97 0 0 0-11.16 3.55c-.1.15-.1.35 0 .5.37.58.8 1.13 1.28 1.61.24.24.64.15.8-.15.19-.38.39-.73.58-1.02.14-.21.43-.1.4.15l-.19 1.96c-.02.19.07.37.23.47A8.96 8.96 0 0 0 12 21a.4.4 0 0 1 .38.27c.1.33.25.65.4.95.18.34-.02.76-.4.77L12 23a11 11 0 1 1 11-10.62ZM15.5 7.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z", "NM24 19a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"], "threads": ["NM12 2.81a1 1 0 0 1 0-1.41l.36-.36a1 1 0 0 1 1.41 0l9.2 9.2a1 1 0 0 1 0 1.4l-.7.7a1 1 0 0 1-1.3.13l-9.54-6.72a1 1 0 0 1-.08-1.58l1-1L12 2.8ZM12 21.2a1 1 0 0 1 0 1.41l-.35.35a1 1 0 0 1-1.41 0l-9.2-9.19a1 1 0 0 1 0-1.41l.7-.7a1 1 0 0 1 1.3-.12l9.54 6.72a1 1 0 0 1 .07 1.58l-1 1 .35.36ZM15.66 16.8a1 1 0 0 1-1.38.28l-8.49-5.66A1 1 0 1 1 6.9 9.76l8.49 5.65a1 1 0 0 1 .27 1.39ZM17.1 14.25a1 1 0 1 0 1.11-1.66L9.73 6.93a1 1 0 0 0-1.11 1.66l8.49 5.66Z"], "badge": ["NM10.89 11.79A3 3 0 1 0 13.1 6.2a3 3 0 0 0-2.22 5.58Z", "EM11.91 16.43a.66.66 0 0 0-.16.08 3.16 3.16 0 0 1-2.85.27 3.14 3.14 0 0 1-1.88-2.16.67.67 0 0 0-.5-.49A3.14 3.14 0 0 1 4.5 9.45a.67.67 0 0 0 0-.7 3.14 3.14 0 0 1 1.88-4.73.67.67 0 0 0 .49-.5 3.14 3.14 0 0 1 4.68-2.02c.22.13.5.13.7 0a3.14 3.14 0 0 1 4.73 1.88c.07.24.26.44.5.49a3.14 3.14 0 0 1 2.02 4.68.67.67 0 0 0 0 .7 3.14 3.14 0 0 1-1.88 4.73.67.67 0 0 0-.49.5 3.14 3.14 0 0 1-4.68 2.02.66.66 0 0 0-.54-.07Zm-1.76-2.79a5 5 0 1 0 3.7-9.28 5 5 0 0 0-3.7 9.28Z", "NM12.11 17.46a4.13 4.13 0 0 1-5.35-1.1l-.57 5.5a1 1 0 0 0 1.47.99l4.1-2.22a.5.5 0 0 1 .48 0l4.1 2.22a1 1 0 0 0 1.47-.98l-.56-5.42a4.12 4.12 0 0 1-5.14 1Z"], "orbs": ["NM11.75 7.57a5.12 5.12 0 0 1-3.86 3.87.42.42 0 0 0 0 .82 5.1 5.1 0 0 1 3.86 3.86.42.42 0 0 0 .81 0 5.12 5.12 0 0 1 3.87-3.86.42.42 0 0 0 0-.82 5.15 5.15 0 0 1-3.87-3.86.42.42 0 0 0-.81-.01Z", "EM11.64.22c.3-.12.62-.12.91 0l7.49 3.1c.29.12.52.35.64.64l3.1 7.49c.12.29.12.62 0 .9l-3.1 7.5c-.12.28-.35.51-.64.63l-7.49 3.1c-.29.13-.62.13-.9 0l-7.5-3.1c-.28-.12-.52-.35-.64-.64l-3.1-7.48c-.12-.3-.12-.62 0-.91l3.1-7.49c.12-.29.36-.52.65-.64l7.48-3.1ZM20.6 11.5 12.5 3.4a.56.56 0 0 0-.8 0l-8.1 8.1a.56.56 0 0 0 0 .8l8.1 8.1c.22.22.57.22.8 0l8.1-8.1a.56.56 0 0 0 0-.8Zm-8.85-3.94a5.12 5.12 0 0 1-3.86 3.87.42.42 0 0 0 0 .82 5.1 5.1 0 0 1 3.86 3.86.42.42 0 0 0 .81 0 5.12 5.12 0 0 1 3.87-3.86.42.42 0 0 0 0-.82 5.15 5.15 0 0 1-3.87-3.86.42.42 0 0 0-.81-.01Z"], "user_circle_filled": ["EM18.46 20.9a12.65 12.65 0 0 1-1.46.9 10.95 10.95 0 0 1-10 0 11 11 0 1 1 11.46-.9Zm-1.65-1.3a8.96 8.96 0 0 1-9.62 0l.23-2.26c.02-.25-.27-.36-.41-.15-.29.45-.6 1.01-.88 1.63A9.04 9.04 0 0 1 4.2 16.5a9 9 0 0 1 15.6 0 9.04 9.04 0 0 1-1.93 2.32c-.27-.62-.59-1.18-.88-1.63-.14-.21-.43-.1-.4.15l.22 2.27ZM12 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"], "chevron_small_right": ["NM9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"], "circle_info": ["EM23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-9.5-4.75a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm-.77 3.96a1 1 0 1 0-1.96-.42l-1.04 4.86a2.77 2.77 0 0 0 4.31 2.83l.24-.17a1 1 0 1 0-1.16-1.62l-.24.17a.77.77 0 0 1-1.2-.79l1.05-4.86Z"], "arrow_left": ["NM3.3 11.3a1 1 0 0 0 0 1.4l8 8a1 1 0 1 0 1.4-1.4L6.42 13H20a1 1 0 1 0 0-2H6.41l6.3-6.3a1 1 0 0 0-1.42-1.4l-8 8Z"], "arrow_right": ["NM20.7 12.7a1 1 0 0 0 0-1.4l-8-8a1 1 0 1 0-1.4 1.4l6.29 6.3H4a1 1 0 1 0 0 2h13.59l-6.3 6.3a1 1 0 0 0 1.42 1.4l8-8Z"], "eye_slash": ["NM1.3 21.3a1 1 0 1 0 1.4 1.4l20-20a1 1 0 0 0-1.4-1.4l-20 20ZM3.16 16.05c.18.24.53.26.74.05l.72-.72c.18-.18.2-.45.05-.66a15.7 15.7 0 0 1-1.43-2.52.48.48 0 0 1 0-.4c.4-.9 1.18-2.37 2.37-3.72C7.13 6.38 9.2 5 12 5c.82 0 1.58.12 2.28.33.18.05.38 0 .52-.13l.8-.8c.25-.25.18-.67-.15-.79A9.79 9.79 0 0 0 12 3C4.89 3 1.73 10.11 1.11 11.7a.83.83 0 0 0 0 .6c.25.64.9 2.15 2.05 3.75Z", "NM8.18 10.81c-.13.43.36.65.67.34l2.3-2.3c.31-.31.09-.8-.34-.67a4 4 0 0 0-2.63 2.63ZM12.85 15.15c-.31.31-.09.8.34.67a4.01 4.01 0 0 0 2.63-2.63c.13-.43-.36-.65-.67-.34l-2.3 2.3Z", "NM9.72 18.67a.52.52 0 0 0-.52.13l-.8.8c-.25.25-.18.67.15.79 1.03.38 2.18.61 3.45.61 7.11 0 10.27-7.11 10.89-8.7a.83.83 0 0 0 0-.6c-.25-.64-.9-2.15-2.05-3.75a.49.49 0 0 0-.74-.05l-.72.72a.51.51 0 0 0-.05.66 15.7 15.7 0 0 1 1.43 2.52c.06.13.06.27 0 .4-.4.9-1.18 2.37-2.37 3.72C16.87 17.62 14.8 19 12 19c-.82 0-1.58-.12-2.28-.33Z"], "game_controller": ["EM20.97 4.06c0 .18.08.35.24.43.55.28.9.82 1.04 1.42.3 1.24.75 3.7.75 7.09v4.91a3.09 3.09 0 0 1-5.85 1.38l-1.76-3.51a1.09 1.09 0 0 0-1.23-.55c-.57.13-1.36.27-2.16.27s-1.6-.14-2.16-.27c-.49-.11-1 .1-1.23.55l-1.76 3.51A3.09 3.09 0 0 1 1 17.91V13c0-3.38.46-5.85.75-7.1.15-.6.49-1.13 1.04-1.4a.47.47 0 0 0 .24-.44c0-.7.48-1.32 1.2-1.47l2.93-.62c.5-.1 1 .06 1.36.4.35.34.78.71 1.28.68a42.4 42.4 0 0 1 4.4 0c.5.03.93-.34 1.28-.69.35-.33.86-.5 1.36-.39l2.94.62c.7.15 1.19.78 1.19 1.47ZM20 7.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM15.5 12a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM5 7a1 1 0 0 1 2 0v1h1a1 1 0 0 1 0 2H7v1a1 1 0 1 1-2 0v-1H4a1 1 0 1 1 0-2h1V7Z"], "bolt": ["NM7.65 21.75a1 1 0 0 0 1.64.96l11.24-9.96a1 1 0 0 0-.66-1.75h-4.81a.5.5 0 0 1-.5-.6l1.79-8.15a1 1 0 0 0-1.64-.96L3.47 11.25A1 1 0 0 0 4.13 13h4.81c.32 0 .56.3.5.6l-1.79 8.15Z"], "flame": ["EM3 14a9 9 0 1 0 18 0c0-2.63-.61-5.22-1.79-7.58L18.2 4.38a.7.7 0 0 0-1.3.18l-.78 3.9a.66.66 0 0 1-1.27.11L12.22 1.6a.9.9 0 0 0-1.48-.33l-4.2 4.2A12.07 12.07 0 0 0 3 14Zm9.26-.84a.57.57 0 0 0-1-.23L9.6 15a3.08 3.08 0 1 0 5.12.48c-.14-.26-.5-.28-.71-.06L13 16.5l-.74-3.34Z"], "sprout": ["NM11.33 13.68c.41.27.93.27 1.34 0 1.73-1.1 6.2-4.3 6.2-8.02 0-2.02-1.6-3.66-3.59-3.66-1.46 0-2.42.58-3.28 1.44A4.33 4.33 0 0 0 8.72 2a3.63 3.63 0 0 0-3.6 3.66c0 3.72 4.48 6.92 6.2 8.02Z", "NM3.93 13.84a.94.94 0 0 0-.93.94 5.6 5.6 0 0 0 6.48 5.6l1.02-.18v1.27c0 .85.67 1.53 1.5 1.53s1.5-.68 1.5-1.53V20.2l1.02.17A5.6 5.6 0 0 0 21 14.78a.94.94 0 0 0-.93-.94h-2.24a5.6 5.6 0 0 0-4.89 2.9L12 18.41l-.94-1.69a5.6 5.6 0 0 0-4.89-2.9H3.93Z"], "music": ["NM8.65 1.51A2 2 0 0 0 6 3.41v9.88A3.98 3.98 0 0 0 4.5 13C2.57 13 1 14.34 1 16s1.57 3 3.5 3S8 17.66 8 16V5.4l11 3.81v7.08a3.98 3.98 0 0 0-1.5-.29c-1.93 0-3.5 1.34-3.5 3s1.57 3 3.5 3 3.5-1.34 3.5-3V7.03c0-.74-.47-1.4-1.18-1.65L8.65 1.51Z"], "tv": ["NM4 3a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3H4ZM6 20a1 1 0 1 0 0 2h12a1 1 0 1 0 0-2H6Z"], "apps": ["NM2.06 7.61c-.25.95.31 1.92 1.26 2.18l4.3 1.15c.94.25 1.91-.31 2.17-1.26l1.15-4.3c.25-.94-.31-1.91-1.26-2.17l-4.3-1.15c-.94-.25-1.91.31-2.17 1.26l-1.15 4.3ZM12.98 7.87a2 2 0 0 0 1.75 2.95H20a2 2 0 0 0 1.76-2.95l-2.63-4.83a2 2 0 0 0-3.51 0l-2.63 4.83ZM5.86 13.27a.89.89 0 0 1 1.28 0l.75.77a.9.9 0 0 0 .54.26l1.06.12c.5.06.85.52.8 1.02l-.13 1.08c-.02.2.03.42.14.6l.56.92c.27.43.14 1-.28 1.26l-.9.58a.92.92 0 0 0-.37.48l-.36 1.02a.9.9 0 0 1-1.15.57l-1-.36a.89.89 0 0 0-.6 0l-1 .36a.9.9 0 0 1-1.15-.57l-.36-1.02a.92.92 0 0 0-.37-.48l-.9-.58a.93.93 0 0 1-.28-1.26l.56-.93c.11-.17.16-.38.14-.59l-.12-1.08c-.06-.5.3-.96.8-1.02l1.05-.12a.9.9 0 0 0 .54-.26l.75-.77ZM18.52 13.71a1.1 1.1 0 0 0-2.04 0l-.46 1.24c-.19.5-.57.88-1.07 1.07l-1.24.46a1.1 1.1 0 0 0 0 2.04l1.24.46c.5.19.88.57 1.07 1.07l.46 1.24c.35.95 1.7.95 2.04 0l.46-1.24c.19-.5.57-.88 1.07-1.07l1.24-.46a1.1 1.1 0 0 0 0-2.04l-1.24-.46a1.8 1.8 0 0 1-1.07-1.07l-.46-1.24Z"], "sticker_small": ["EM7 3h10a4 4 0 0 1 4 4v6.5a.5.5 0 0 1-.5.5H19a5 5 0 0 0-5 5v1.5a.5.5 0 0 1-.5.5H7a4 4 0 0 1-4-4V7a4 4 0 0 1 4-4Zm-.5 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM19 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm-9.91 2.94a1 1 0 0 0-1.66 1.12 5.5 5.5 0 0 0 9.14 0 1 1 0 0 0-1.66-1.12 3.5 3.5 0 0 1-5.82 0Z", "NM19 16h1.73a3 3 0 0 1-.6.88l-3.25 3.24a3 3 0 0 1-.88.61V19a3 3 0 0 1 3-3Z"], "pin_slash": ["NM22.7 2.7a1 1 0 0 0-1.4-1.4l-20 20a1 1 0 1 0 1.4 1.4l20-20ZM4.5 1h13.17a.5.5 0 0 1 .36.85L4.62 15.25c-.2.22-.56.2-.6-.1A1 1 0 0 1 4 15v-.95a2 2 0 0 1 .61-1.44L8 9.35V5h-.91C5.39 5 4 3.48 4 1.6v-.1c0-.28.22-.5.5-.5ZM17.77 11.05a.5.5 0 0 0-.7 0l-4.1 4.1a.5.5 0 0 0 .36.85H19a1 1 0 0 0 1-1v-.95a2 2 0 0 0-.61-1.44l-1.62-1.56ZM11.08 17.25a.5.5 0 0 0-.36.15l-.36.37a.5.5 0 0 0-.14.46l.99 4.38a.5.5 0 0 0 .49.39h.6a.5.5 0 0 0 .49-.39l1.07-4.75a.5.5 0 0 0-.49-.61h-2.3Z"], "download": ["NM12 2a1 1 0 0 1 1 1v10.59l3.3-3.3a1 1 0 1 1 1.4 1.42l-5 5a1 1 0 0 1-1.4 0l-5-5a1 1 0 1 1 1.4-1.42l3.3 3.3V3a1 1 0 0 1 1-1ZM3 20a1 1 0 1 0 0 2h18a1 1 0 1 0 0-2H3Z"], "window_launch": ["NM15 2a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V4.41l-4.3 4.3a1 1 0 1 1-1.4-1.42L19.58 3H16a1 1 0 0 1-1-1Z", "NM5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 1 0-2 0v6a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h6a1 1 0 1 0 0-2H5Z"], "puzzle_piece": ["NM16 4a3 3 0 1 1-5.98-.31c.03-.35-.21-.69-.56-.69H7a3 3 0 0 0-3 3v2.5c0 .28-.23.5-.5.54a3 3 0 0 0 0 5.92c.27.04.5.26.5.54V18a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3h-2.46c-.35 0-.6.34-.56.69L16 4Z"], "chat": ["NM12 22a10 10 0 1 0-8.45-4.64c.13.19.11.44-.04.61l-2.06 2.37A1 1 0 0 0 2.2 22H12Z"], "folder": ["NM2 5a3 3 0 0 1 3-3h3.93a2 2 0 0 1 1.66.9L12 5h7a3 3 0 0 1 3 3v11a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V5Z"], "play": ["NM9.25 3.35C7.87 2.45 6 3.38 6 4.96v14.08c0 1.58 1.87 2.5 3.25 1.61l10.85-7.04a1.9 1.9 0 0 0 0-3.22L9.25 3.35Z"], "pause": ["NM6 4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H6ZM15 4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-3Z"], "speaker_x": ["NM12 3a1 1 0 0 0-1-1h-.06a1 1 0 0 0-.74.32L5.92 7H3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h2.92l4.28 4.68a1 1 0 0 0 .74.32H11a1 1 0 0 0 1-1V3ZM22.7 8.3a1 1 0 0 0-1.4 0L19 10.58l-2.3-2.3a1 1 0 1 0-1.4 1.42L17.58 12l-2.3 2.3a1 1 0 0 0 1.42 1.4L19 13.42l2.3 2.3a1 1 0 0 0 1.4-1.42L20.42 12l2.3-2.3a1 1 0 0 0 0-1.4Z"], "crown": ["NM5 18a1 1 0 0 0-1 1 3 3 0 0 0 3 3h10a3 3 0 0 0 3-3 1 1 0 0 0-1-1H5ZM3.04 7.76a1 1 0 0 0-1.52 1.15l2.25 6.42a1 1 0 0 0 .94.67h14.55a1 1 0 0 0 .95-.71l1.94-6.45a1 1 0 0 0-1.55-1.1l-4.11 3-3.55-5.33.82-.82a.83.83 0 0 0 0-1.18l-1.17-1.17a.83.83 0 0 0-1.18 0l-1.17 1.17a.83.83 0 0 0 0 1.18l.82.82-3.61 5.42-4.41-3.07Z"]}\ No newline at end of filediff --git a/apps/rustcord/fonts/discord-icons.ttf b/apps/rustcord/fonts/discord-icons.ttfindex 939803f..45f6621 100644Binary files a/apps/rustcord/fonts/discord-icons.ttf and b/apps/rustcord/fonts/discord-icons.ttf differdiff --git a/apps/rustcord/src/app.rs b/apps/rustcord/src/app.rsindex 7f6b02c..f50fa55 100644--- a/apps/rustcord/src/app.rs+++ b/apps/rustcord/src/app.rs@@ -209,6 +209,8 @@ pub struct RustCord {pub channel_drag: Option<Id>,/// Server or folder being dragged on the server rail.pub rail_drag: Option<RailDrag>,+ /// Middle-click autoscroll (see ui/autoscroll.rs).+ pub autoscroll: crate::ui::autoscroll::Autoscroll,/// Server pages from the channel list header (Members, Server Boosts,/// Server Shop) and the Events popup.pub guild_pages: crate::ui::guild_pages::GuildPages,@@ -268,6 +270,12 @@ pub struct RustCord {pub retired_login_view: Option<(crate::login_view::LoginView, Instant)>,/// Member list on the right (server channels).pub show_members: bool,+ /// Member list on the right in group DMs (Discord keeps the two apart).+ pub show_group_members: bool,+ /// The "Invite to Group DM" / "Add Friends to DM" dialog.+ pub group_invite: Option<crate::ui::group_dm::GroupInvite>,+ /// People being added to a group DM, until Discord answers.+ pub group_adds: Vec<Id>,/// How many 100-member windows we've subscribed to, per channel.pub member_windows: HashMap<Id, usize>,/// Pinned messages popout: (channel, anchor, loaded result).@@ -385,6 +393,9 @@ pub struct RustCord {pub calls: std::collections::HashMap<Id, crate::voice_call::DmCall>,/// A call we started: ring the others once our side is connected.pub ring_when_connected: Option<Id>,+ /// A video call we started (the DM header's camera button): turn the+ /// camera on once our side is connected.+ pub camera_when_connected: Option<Id>,/// The call the last run closed in, offered by the "Reconnect" notice.pub last_call: Option<crate::ui::voice_notice::LastCall>,/// The call `last-call.json` holds now.@@ -433,6 +444,10 @@ pub struct RustCord {device_theme_at: Option<Instant>,/// The notification-area icon's picks (Open, About, Reset, Restart, Quit).tray: Option<std::sync::mpsc::Receiver<crate::tray::TrayAction>>,+ /// Automatic updates (an installed copy on Windows only).+ pub updater: Option<crate::updater::Updater>,+ /// Discord's "Briefly leave voice?" before restarting into an update.+ pub update_confirm: bool,/// Windows 11 corner rounding asked for (once the window exists).corners_rounded: bool,pub apps_requested: HashSet<Id>,@@ -592,6 +607,7 @@ impl RustCord {compose: Default::default(),channel_drag: None,rail_drag: None,+ autoscroll: Default::default(),guild_pages: Default::default(),pending_dm: None,audio: Default::default(),@@ -623,6 +639,9 @@ impl RustCord {login_opened_at: None,retired_login_view: None,show_members: true,+ show_group_members: true,+ group_invite: None,+ group_adds: Vec::new(),member_windows: HashMap::new(),pins: None,pins_opened: 0,@@ -683,6 +702,7 @@ impl RustCord {voice: None,calls: Default::default(),ring_when_connected: None,+ camera_when_connected: None,last_call,last_call_saved: last_call,call_check: None,@@ -723,6 +743,8 @@ impl RustCord {notified: None,device_theme_at: None,tray: crate::tray::start(cc.egui_ctx.clone()),+ updater: crate::updater::Updater::start(&cc.egui_ctx),+ update_confirm: false,corners_rounded: false,apps_requested: HashSet::new(),search: None,@@ -947,8 +969,10 @@ impl RustCord {}/// Start a fresh RustCord and close this one (the new one takes over).- fn restart(&mut self, ctx: &egui::Context) {- if let Ok(exe) = std::env::current_exe() {+ /// An installed copy starts the installed program: after an update, the+ /// new version.+ pub fn restart(&mut self, ctx: &egui::Context) {+ if let Some(exe) = self.updater.as_ref().map(|u| u.exe()).or_else(|| std::env::current_exe().ok()) {let args: Vec<String> = std::env::args().skip(1).collect();let mut cmd = std::process::Command::new(exe);cmd.args(args).env_remove("RUSTCORD_KEEP_OTHERS");@@ -1614,6 +1638,8 @@ impl RustCord {}}"CHANNEL_CREATE" | "CHANNEL_UPDATE" | "THREAD_CREATE" | "THREAD_UPDATE" => self.store.upsert_channel(&d),+ "CHANNEL_RECIPIENT_ADD" => self.store.group_recipient(&d, true),+ "CHANNEL_RECIPIENT_REMOVE" => self.store.group_recipient(&d, false),"CHANNEL_DELETE" | "THREAD_DELETE" => {// An open thread that was deleted: back to its channel.let id = Id::from_value(&d["id"]);@@ -2069,6 +2095,11 @@ impl RustCord {self.stranger_confirm = self.store.me_id();return;}+ // "Briefly leave voice?" before an update; confirming only shows a toast.+ "update-confirm" => {+ self.update_confirm = true;+ return;+ }// The captcha dialog with hCaptcha's public test key (it passes without a// puzzle); nothing is sent to Discord."captcha" => {@@ -3513,6 +3544,12 @@ fn dev_input(raw: &mut egui::RawInput) {raw.events.push(egui::Event::PointerMoved(pos));raw.events.push(egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed: false, modifiers });}+ // `mdown x y` / `mup x y`: the middle button (autoscroll).+ ("mdown" | "mup", [x, y, ..]) => {+ let pos = egui::pos2(*x, *y);+ raw.events.push(egui::Event::PointerMoved(pos));+ raw.events.push(egui::Event::PointerButton { pos, button: egui::PointerButton::Middle, pressed: cmd == "mdown", modifiers });+ }("scroll", [x, y, dy, ..]) => {raw.events.push(egui::Event::PointerMoved(egui::pos2(*x, *y)));raw.events.push(egui::Event::MouseWheel { unit: egui::MouseWheelUnit::Line, delta: egui::vec2(0.0, *dy), modifiers });@@ -3684,6 +3721,7 @@ impl eframe::App for RustCord {raw.focused = true;}dev_input(raw);+ self.autoscroll.filter(raw, !crate::hotkey::is_push_to_talk(crate::hotkey::MIDDLE_BUTTON));}fn on_exit(&mut self, _gl: Option<&eframe::glow::Context>) {@@ -3770,6 +3808,7 @@ impl eframe::App for RustCord {let t = self.theme.clone();crate::ui::paint_theme_surface(ctx, &ctx.layer_painter(egui::LayerId::background()), ctx.screen_rect(), 0.0, crate::ui::surface::FRAME, &t);}+ self.autoscroll.before_ui(ctx);self.title_bar(ctx);match self.screen {Screen::Login => self.login_ui(ctx),@@ -3812,6 +3851,7 @@ impl eframe::App for RustCord {self.toasts_ui(ctx);// Everything floating is drawn: ease in what just opened, out what closed.crate::ui::motion::end_frame(ctx);+ self.autoscroll.after_ui(ctx);// Typing indicators and toasts expire on their own; the audio seek bar moves.// With nothing on screen that changes by itself (no toast, nobody// typing, no call or stream), a slow heartbeat is enough: everythingdiff --git a/apps/rustcord/src/backend.rs b/apps/rustcord/src/backend.rsindex 39395f6..54b71ad 100644--- a/apps/rustcord/src/backend.rs+++ b/apps/rustcord/src/backend.rs@@ -360,7 +360,7 @@ impl Emitter {Event::Gateway(GatewayEvent::Dispatch { name, .. }) => match name.as_str() {"READY" | "READY_SUPPLEMENTAL" | "RESUMED" | "VOICE_CHANNEL_EFFECT_SEND" => Some(0),"MESSAGE_CREATE" | "MESSAGE_UPDATE" | "MESSAGE_DELETE" | "MESSAGE_DELETE_BULK" | "MESSAGE_ACK"- | "TYPING_START" | "CHANNEL_CREATE" | "CHANNEL_UPDATE" | "CHANNEL_DELETE" | "THREAD_CREATE" | "THREAD_UPDATE" | "THREAD_DELETE" | "CHANNEL_PINS_UPDATE"+ | "TYPING_START" | "CHANNEL_CREATE" | "CHANNEL_UPDATE" | "CHANNEL_DELETE" | "CHANNEL_RECIPIENT_ADD" | "CHANNEL_RECIPIENT_REMOVE" | "THREAD_CREATE" | "THREAD_UPDATE" | "THREAD_DELETE" | "CHANNEL_PINS_UPDATE"| "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_MEMBERS_CHUNK" | "GUILD_MEMBER_LIST_UPDATE"| "VOICE_STATE_UPDATE" | "VOICE_SERVER_UPDATE" | "RELATIONSHIP_ADD" | "RELATIONSHIP_UPDATE"| "RELATIONSHIP_REMOVE" | "INTERACTION_FAILURE" | "MESSAGE_POLL_VOTE_ADD" | "MESSAGE_POLL_VOTE_REMOVE" => Some(100),diff --git a/apps/rustcord/src/diagnostics.rs b/apps/rustcord/src/diagnostics.rsindex a8f8bf3..fc870fd 100644--- a/apps/rustcord/src/diagnostics.rs+++ b/apps/rustcord/src/diagnostics.rs@@ -229,10 +229,18 @@ pub fn heap_summary() -> String {format!("process: rss {:.0} MB (peak {:.0}), commit {:.0} MB (peak {:.0})", mb(rss), mb(peak_rss), mb(commit), mb(peak_commit))}-/// Hand memory the allocator is holding but not using back to Windows.+/// Hand memory the allocator is holding but not using back to the system./// Cheap when there is nothing to return; called while the app is idle.pub fn release_unused_memory() {unsafe { libmimalloc_sys::mi_collect(true) };+ // On Linux the C libraries (GTK, the graphics driver, fontconfig) allocate+ // with glibc's malloc, which keeps what they free for reuse rather than+ // returning it; this hands those pages back too.+ // SAFETY: malloc_trim only releases free memory; any thread may call it.+ #[cfg(all(target_os = "linux", target_env = "gnu"))]+ unsafe {+ libc::malloc_trim(0);+ }}/// How much of RustCord is in RAM right now (its working set), in MB.diff --git a/apps/rustcord/src/hotkey.rs b/apps/rustcord/src/hotkey.rsindex 4cbd131..a325e23 100644--- a/apps/rustcord/src/hotkey.rs+++ b/apps/rustcord/src/hotkey.rs@@ -34,11 +34,19 @@ pub fn any_pressed() -> Option<u32> {(4..=254u32).filter(|vk| !matches!(vk, 7 | 0x10..=0x12)).find(|vk| pressed(*vk))}+/// The middle mouse button's code.+pub const MIDDLE_BUTTON: u32 = 4;++/// Whether `vk` is the Push-to-Talk key right now.+pub fn is_push_to_talk(vk: u32) -> bool {+ vk != 0 && PTT_KEY.load(Ordering::Acquire) == vk+}+/// What to call a key in the settings.pub fn name(vk: u32) -> String {match vk {0 => "None".into(),- 4 => "Middle Mouse".into(),+ MIDDLE_BUTTON => "Middle Mouse".into(),5 => "Mouse 4".into(),6 => "Mouse 5".into(),0x08 => "Backspace".into(),diff --git a/apps/rustcord/src/linux.rs b/apps/rustcord/src/linux.rsindex a5bb182..7101f56 100644--- a/apps/rustcord/src/linux.rs+++ b/apps/rustcord/src/linux.rs@@ -15,6 +15,13 @@ static FORCED_X11: AtomicBool = AtomicBool::new(false);/// environment isn't safe once one does): winit and GTK pick Wayland when they/// can, and the child web views need X11.pub fn prefer_x11() {+ // WebKitGTK's DMA-BUF renderer fails inside an X11 window on some setups+ // (NVIDIA under XWayland: GLXBadWindow as the login page opens, issue+ // #15); its older renderer draws the pages fine. A value the person set+ // themselves is kept.+ if std::env::var_os("WEBKIT_DISABLE_DMABUF_RENDERER").is_none() {+ std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");+ }if std::env::var_os("WAYLAND_DISPLAY").is_some() && std::env::var_os("DISPLAY").is_some() {std::env::remove_var("WAYLAND_DISPLAY");std::env::set_var("GDK_BACKEND", "x11");@@ -34,6 +41,29 @@ pub fn init() {}}+/// As the window opens: X errors on any connection but the window's own are+/// left to GTK (the embedded web pages talk to X through a connection of+/// their own). Xlib has a single error handler for the whole process, winit's,+/// and winit keeps the last error it sees for its own next check; a stray+/// error from WebKitGTK as the login page opened (GLXBadWindow under+/// XWayland) made winit panic with "Failed to focus input context".+pub fn keep_x_errors_apart(cc: &eframe::CreationContext<'_>) {+ use raw_window_handle::{HasDisplayHandle, RawDisplayHandle};+ let Ok(handle) = cc.display_handle() else { return };+ let RawDisplayHandle::Xlib(xlib) = handle.as_raw() else { return };+ let Some(display) = xlib.display else { return };+ // (As a number: the hook must be Send, and only compares it.)+ let window_display = display.as_ptr() as usize;+ static LOGGED: AtomicBool = AtomicBool::new(false);+ winit::platform::x11::register_xlib_error_hook(Box::new(move |display, _event| {+ let others = display as usize != window_display;+ if others && !LOGGED.swap(true, Ordering::Relaxed) {+ log::info!("linux: an X error on the web pages' connection was left to GTK");+ }+ others+ }));+}+/// `Err` with a message for the person when web pages can't be shown.pub fn web_pages_available() -> Result<(), String> {if GTK_READY.load(Ordering::Relaxed) {diff --git a/apps/rustcord/src/main.rs b/apps/rustcord/src/main.rsindex b90c8c3..3606c3d 100644--- a/apps/rustcord/src/main.rs+++ b/apps/rustcord/src/main.rs@@ -38,6 +38,7 @@ mod media_copy;mod store;mod style;mod ui;+mod updater;mod video;use eframe::egui;@@ -102,7 +103,11 @@ fn main() -> eframe::Result<()> {let result = eframe::run_native("RustCord",options,- Box::new(move |cc| Ok(Box::new(app::RustCord::new(cc, demo, backend, launch)))),+ Box::new(move |cc| {+ #[cfg(target_os = "linux")]+ linux::keep_x_errors_apart(cc);+ Ok(Box::new(app::RustCord::new(cc, demo, backend, launch)))+ }),);// No icon left behind in the notification area.tray::remove();diff --git a/apps/rustcord/src/store.rs b/apps/rustcord/src/store.rsindex 9a7c68b..140f6a0 100644--- a/apps/rustcord/src/store.rs+++ b/apps/rustcord/src/store.rs@@ -645,6 +645,17 @@ impl Store {self.channels.insert(ch.id, ch);}+ /// CHANNEL_RECIPIENT_ADD / CHANNEL_RECIPIENT_REMOVE: someone joined or+ /// left a group DM (`{channel_id, user}`).+ pub fn group_recipient(&mut self, v: &Value, added: bool) {+ let (Some(channel), Ok(user)) = (Id::from_value(&v["channel_id"]), User::deserialize(&v["user"])) else { return };+ let Some(ch) = self.channels.get_mut(&channel) else { return };+ ch.recipients.retain(|u| u.id != user.id);+ if added && Some(user.id) != self.me.as_ref().map(|m| m.id) {+ ch.recipients.push(user);+ }+ }+pub fn remove_channel(&mut self, v: &Value) {let Some(id) = Id::from_value(&v["id"]) else { return };if let Some(ch) = self.channels.remove(&id) {diff --git a/apps/rustcord/src/style.rs b/apps/rustcord/src/style.rsindex cc426e0..4d910cc 100644--- a/apps/rustcord/src/style.rs+++ b/apps/rustcord/src/style.rs@@ -868,6 +868,16 @@ pub fn install_fonts(ctx: &egui::Context) {fonts.families.entry(FontFamily::Proportional).or_default().insert(0, "gg-sans".into());primary_pos = 1;}+ // Hebrew and Arabic come from Arial, as in Chrome with Discord's font list+ // ("gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial): gg sans+ // has neither, and on Windows Arial is the first of the rest that does.+ #[cfg(windows)]+ if let Some(data) = font_file("C:\\Windows\\Fonts\\arial.ttf") {+ fonts.font_data.insert(ARIAL_RTL.into(), data.only(hebrew_or_arabic));+ fonts.families.entry(FontFamily::Proportional).or_default().insert(primary_pos, ARIAL_RTL.into());+ fonts.families.entry(FontFamily::Monospace).or_default().push(ARIAL_RTL.into());+ primary_pos += 1;+ }// Code blocks and `inline code` in gg sans mono, like Discord.if let Some((_, _, mono)) = EMBEDDED_GG_SANS {fonts.font_data.insert("gg-sans-mono".into(), FontData::from_static(mono));@@ -898,6 +908,10 @@ pub fn install_fonts(ctx: &egui::Context) {fonts.font_data.insert("segoe-ui-bold".into(), data);bold.insert(0, "segoe-ui-bold".into());}+ if let Some(data) = font_file("C:\\Windows\\Fonts\\arialbd.ttf") {+ fonts.font_data.insert("arial-rtl-bold".into(), data.only(hebrew_or_arabic));+ bold.insert(0, "arial-rtl-bold".into());+ }}let heavy = gg_heavy.as_ref().and_then(|p| font_file(&p.to_string_lossy())).or_else(|| EMBEDDED_GG_SANS.map(|(_, semibold, _)| FontData::from_static(semibold)));if let Some(data) = heavy {@@ -975,6 +989,15 @@ pub fn install_fonts(ctx: &egui::Context) {ctx.set_fonts(fonts);}+/// Arial, for Hebrew and Arabic only (see `install_fonts`).+#[cfg(windows)]+const ARIAL_RTL: &str = "arial-rtl";++/// Hebrew and Arabic letters, marks, digits and presentation forms.+fn hebrew_or_arabic(c: char) -> bool {+ matches!(c as u32, 0x0590..=0x06FF | 0x0750..=0x077F | 0x08A0..=0x08FF | 0xFB1D..=0xFDFF | 0xFE70..=0xFEFE)+}+pub const BOLD: &str = "bold";pub const MEDIUM: &str = "medium";pub const STRONG: &str = "strong";@@ -1064,6 +1087,8 @@ pub mod icon {pub const TV: &str = "\u{F1026}";pub const APPS: &str = "\u{F1027}";pub const STICKER_SMALL: &str = "\u{F1028}";+ /// CrownIcon: the group owner in a group DM's member list.+ pub const CROWN: &str = "\u{F1029}";pub const INVITE: &str = "\u{E8FA}";pub const MIC_OFF: &str = "\u{F781}";pub const DEAFENED: &str = "\u{F100F}";@@ -1239,7 +1264,9 @@ mod tests {let mut sum = 0.0;for y in uv.min[1]..uv.max[1] {for x in uv.min[0]..uv.max[0] {- sum += image.pixels[y as usize * image.size[0] + x as usize];+ // (The atlas keeps opacity: back to coverage.)+ let opacity = image.pixels[y as usize * image.size[0] + x as usize];+ sum += (opacity as f32 / 255.0).powf(1.0 / eframe::egui::epaint::FontImage::GAMMA);}}sum@@ -1258,4 +1285,81 @@ mod tests {}}}++ /// A right-to-left word inside left-to-right text runs right to left,+ /// and the cursor goes on the side of a character it starts on. (egui's+ /// own fonts have no Hebrew: its letters are replacement boxes, which is+ /// enough for their order.)+ #[test]+ fn right_to_left_text_is_reordered() {+ let fonts = Fonts::new(1.0, 1024, FontDefinitions::default());+ let text = "ab \u{5d0}\u{5d1}\u{5d2} cd";+ let galley = fonts.layout_job(LayoutJob::single_section(text.into(), TextFormat::default()));+ let row = &galley.rows[0];+ assert_eq!(row.text(), text);+ let x: Vec<f32> = row.glyphs.iter().map(|g| g.pos.x).collect();+ assert!(x[0] < x[1] && x[1] < x[2] && x[2] < x[5] && x[5] < x[4] && x[4] < x[3] && x[3] < x[6], "{x:?}");+ assert!(row.glyphs[3].is_rtl() && !row.glyphs[0].is_rtl() && !row.glyphs[6].is_rtl());+ assert_eq!(row.x_offset(3), row.glyphs[3].max_x());+ // A right-to-left letter's right half is before it, its left half after.+ assert_eq!(row.char_at(row.glyphs[3].max_x() - 0.5), 3);+ assert_eq!(row.char_at(row.glyphs[3].pos.x + 0.5), 4);+ assert_eq!(row.char_at(row.glyphs[5].pos.x + 0.5), 6);++ // Left-to-right text keeps its order and level.+ let galley = fonts.layout_job(LayoutJob::single_section("Hello, world".into(), TextFormat::default()));+ assert!(galley.rows[0].glyphs.iter().all(|g| g.bidi_level == 0));+ assert!(galley.rows[0].glyphs.windows(2).all(|w| w[0].pos.x < w[1].pos.x));+ }++ /// Arabic letters join (issue #13: a word came out as separate letters):+ /// shaped, from Arial as in Chrome, and laid out right to left.+ #[cfg(windows)]+ #[test]+ fn arabic_letters_join() {+ let ctx = eframe::egui::Context::default();+ super::install_fonts(&ctx);+ let _ = ctx.run(Default::default(), |_| {});+ let format = TextFormat { font_id: FontId::proportional(16.0), ..Default::default() };+ let layout = |text: &str| ctx.fonts(|f| f.layout_job(LayoutJob::single_section(text.into(), format.clone())));++ let word = "\u{633}\u{644}\u{627}\u{645}"; // salam+ let galley = layout(word);+ let row = &galley.rows[0];+ assert_eq!(row.text(), word);+ assert!(row.glyphs.iter().all(|g| g.is_rtl()));+ // The first letter is the rightmost.+ let lefts: Vec<f32> = row.glyphs.iter().filter(|g| 0.0 < g.advance_width).map(|g| g.pos.x).collect();+ assert!(lefts.windows(2).all(|w| w[0] > w[1]), "{lefts:?}");+ // Joined letters take other forms, so other widths, than alone.+ let alone: f32 = word.chars().map(|c| layout(&c.to_string()).rows[0].glyphs[0].advance_width).sum();+ let joined: f32 = row.glyphs.iter().map(|g| g.advance_width).sum();+ assert!((joined - alone).abs() > 1.0, "joined {joined}, alone {alone}");+ // As wide as Chrome draws it with Discord's font list (measured on+ // Discord web: 30.188 px).+ let galley = layout("\u{645}\u{631}\u{62d}\u{628}\u{627}");+ assert!((galley.rows[0].rect.width() - 30.188).abs() < 0.6, "{}", galley.rows[0].rect.width());+ }++ /// Arabic, Latin, Hebrew and digits in one line land where Chrome puts+ /// them (Discord web's message font, measured 2026-12-03: the left edge+ /// of each character below).+ #[cfg(windows)]+ #[test]+ fn mixed_directions_match_chrome() {+ let ctx = eframe::egui::Context::default();+ super::install_fonts(&ctx);+ let _ = ctx.run(Default::default(), |_| {});+ let format = TextFormat { font_id: FontId::proportional(16.0), ..Default::default() };+ let text = "\u{645}\u{631}\u{62d}\u{628}\u{627} \u{628}\u{627}\u{644}\u{639}\u{627}\u{644}\u{645}\u{60c} \u{643}\u{64a}\u{641} \u{62d}\u{627}\u{644}\u{643}\u{61f} \u{2014} Hello \u{5e9}\u{5dc}\u{5d5}\u{5dd} \u{5e2}\u{5d5}\u{5dc}\u{5dd} 123";+ let galley = ctx.fonts(|f| f.layout_job(LayoutJob::single_section(text.into(), format)));+ let row = &galley.rows[0];+ let left = |c: char| {+ let i = text.chars().position(|x| x == c).unwrap();+ row.glyphs[i].pos.x+ };+ for (c, chrome) in [('\u{61f}', 0.0), ('\u{645}', 122.7), ('\u{2014}', 132.6), ('H', 148.7), ('1', 187.3), ('\u{5e2}', 234.5), ('\u{5e9}', 267.4)] {+ assert!((left(c) - chrome).abs() < 2.5, "{c:?} at {} (Chrome {chrome})", left(c));+ }+ }}diff --git a/apps/rustcord/src/ui/autoscroll.rs b/apps/rustcord/src/ui/autoscroll.rsnew file mode 100644index 0000000..3655b6d--- /dev/null+++ b/apps/rustcord/src/ui/autoscroll.rs@@ -0,0 +1,325 @@+//! Middle-click autoscroll, as Chrome does it on Windows (so as Discord does+//! in the browser): press the middle button over something that scrolls and+//! move the pointer away from that point to scroll, faster the further away.+//! Letting go after moving stops it; a click without moving leaves it on+//! until the next click (which does nothing else) or Esc.+//!+//! It works below the widgets, so every list scrolls this way without+//! knowing about it. While it's on, egui is shown the pointer resting where+//! the button went down: the list under that point stays the hovered one and+//! nothing else lights up (Chrome doesn't hover either). Each frame then+//! feeds that list its distance as if a wheel had turned.++use eframe::egui::{self, Color32, Context, CursorIcon, Event, Key, PointerButton, Pos2, RawInput, Shape, Stroke, Vec2};++/// Chromium's dead zone around the click (`kNoMiddleClickAutoscrollRadius`),+/// per axis, in CSS pixels (egui points here).+const DEAD_ZONE: f32 = 15.0;++/// A scroll too small to move anything (it vanishes against any offset+/// above about 1e-23), asking whether the list under the click scrolls that+/// way: one that can takes it out of the frame's input.+const PROBE: f32 = 1e-30;++#[derive(Default)]+pub struct Autoscroll {+ on: Option<Active>,+ /// The button whose press ended autoscroll: its release is kept from egui too.+ swallow_release: Option<PointerButton>,+ /// Where the pointer really is, for egui's next frame, once autoscroll+ /// ended outside of the input (nothing under the click scrolled).+ give_back: Option<Event>,+}++struct Active {+ origin: Pos2,+ /// Where the pointer really is.+ pointer: Pos2,+ /// The pointer left the window (it carries on scrolling meanwhile).+ outside: bool,+ mode: Mode,+ /// Which ways (x, y) the list under the click scrolls; `None` while+ /// finding out.+ axes: Option<[bool; 2]>,+ /// Finding out: the ways found so far, this frame's probe, how many sent.+ found: [bool; 2],+ probe: Vec2,+ probes: u8,+ /// The last frame's time, while it was scrolling.+ scrolled_at: Option<f64>,+}++#[derive(Clone, Copy, PartialEq, Debug)]+enum Mode {+ /// Just pressed, still inside the dead zone.+ Initial,+ /// Moved out of the dead zone while held: letting go stops.+ Holding,+ /// Let go without moving: on until the next click.+ Toggled,+}++impl Active {+ /// Where the pointer is, for egui once autoscroll is over.+ fn pointer_event(&self) -> Event {+ if self.outside {+ Event::PointerGone+ } else {+ Event::PointerMoved(self.pointer)+ }+ }+}++impl Autoscroll {+ /// From `raw_input_hook`: starts and stops autoscroll and keeps from egui+ /// the input it uses. `enabled` is false while the middle button is the+ /// Push-to-Talk key (holding it to talk mustn't scroll anything).+ pub fn filter(&mut self, raw: &mut RawInput, enabled: bool) {+ let events = std::mem::take(&mut raw.events);+ raw.events.extend(self.give_back.take());+ for e in events {+ self.event(e, enabled, &mut raw.events);+ }+ }++ fn event(&mut self, e: Event, enabled: bool, out: &mut Vec<Event>) {+ let Some(a) = &mut self.on else {+ match e {+ // (RustCord has no other use for the middle button.)+ Event::PointerButton { button: PointerButton::Middle, pressed, pos, .. } if enabled => {+ if pressed {+ self.on = Some(Active { origin: pos, pointer: pos, outside: false, mode: Mode::Initial, axes: None, found: [false; 2], probe: Vec2::ZERO, probes: 0, scrolled_at: None });+ out.push(Event::PointerMoved(pos));+ }+ }+ Event::PointerButton { button, pressed: false, .. } if self.swallow_release == Some(button) => self.swallow_release = None,+ e => out.push(e),+ }+ return;+ };+ match e {+ Event::PointerMoved(p) => {+ (a.pointer, a.outside) = (p, false);+ let d = p - a.origin;+ if a.mode == Mode::Initial && (d.x.abs() > DEAD_ZONE || d.y.abs() > DEAD_ZONE) {+ a.mode = Mode::Holding;+ }+ }+ // Out of the window it carries on, as in Chrome.+ Event::PointerGone => a.outside = true,+ // Any press stops it and does nothing else.+ Event::PointerButton { button, pressed: true, .. } => {+ if button != PointerButton::Middle {+ self.swallow_release = Some(button);+ }+ self.stop(out);+ }+ Event::PointerButton { button, pressed: false, .. } => {+ match a.mode {+ Mode::Initial if button == PointerButton::Middle => a.mode = Mode::Toggled,+ Mode::Holding => self.stop(out),+ _ => {}+ }+ // (A button held down from before still lets go in egui.)+ if button != PointerButton::Middle {+ out.push(e);+ }+ }+ Event::Key { key: Key::Escape, pressed: true, .. } => self.stop(out),+ Event::WindowFocused(false) => {+ self.stop(out);+ out.push(e);+ }+ e => out.push(e),+ }+ }++ fn stop(&mut self, out: &mut Vec<Event>) {+ if let Some(a) = self.on.take() {+ out.push(a.pointer_event());+ }+ }++ /// Before the frame's UI: this frame's scroll, or while it's finding out+ /// whether anything under the click scrolls, the probe.+ pub fn before_ui(&mut self, ctx: &Context) {+ let Some(a) = &mut self.on else { return };+ let delta = match a.axes {+ None => {+ // Up and left first, then the other way for what didn't move+ // (a list at its top can't scroll up).+ let sign = if a.probes == 0 { PROBE } else { -PROBE };+ a.probes += 1;+ a.probe = Vec2::new(if a.found[0] { 0.0 } else { sign }, if a.found[1] { 0.0 } else { sign });+ ctx.request_repaint();+ a.probe+ }+ Some([x, y]) => {+ let v = velocity(a.pointer - a.origin);+ let v = Vec2::new(if x { v.x } else { 0.0 }, if y { v.y } else { 0.0 });+ let now = ctx.input(|i| i.time);+ // (From the frame before, but only if that one was scrolling+ // too: nothing redraws while the pointer rests near the click.)+ let dt = a.scrolled_at.map_or(0.0, |t| (now - t).clamp(0.0, 0.1) as f32);+ a.scrolled_at = (v != Vec2::ZERO).then_some(now);+ if v == Vec2::ZERO {+ return;+ }+ ctx.request_repaint();+ // (A wheel's delta points the other way.)+ -v * dt+ }+ };+ ctx.input_mut(|i| i.smooth_scroll_delta += delta);+ }++ /// After the frame's UI: what the probe found, then the cursor and the+ /// mark where the click was.+ pub fn after_ui(&mut self, ctx: &Context) {+ let Some(a) = &mut self.on else { return };+ if a.axes.is_none() {+ let left = ctx.input(|i| i.smooth_scroll_delta);+ a.found[0] |= a.probe.x != 0.0 && left.x == 0.0;+ a.found[1] |= a.probe.y != 0.0 && left.y == 0.0;+ if a.found != [true; 2] && a.probes < 2 {+ return;+ }+ if a.found == [false; 2] {+ // Nothing there scrolls: as if the button had done nothing.+ self.give_back = Some(a.pointer_event());+ self.on = None;+ ctx.request_repaint();+ return;+ }+ a.axes = Some(a.found);+ }+ let Some(axes) = a.axes else { return };+ ctx.set_cursor_icon(cursor(a.pointer - a.origin, axes));+ paint_mark(ctx, a.origin, axes);+ }+}++/// Chromium's speed for the pointer `d` away from the click, per axis, in+/// points a second: |d|^2.2 Γ 0.000008 a millisecond, none inside the dead+/// zone (`AutoscrollController::HandleMouseMoveForMiddleClickAutoscroll`).+fn velocity(d: Vec2) -> Vec2 {+ let axis = |d: f32| if d.abs() <= DEAD_ZONE { 0.0 } else { d.signum() * d.abs().powf(2.2) * 0.008 };+ Vec2::new(axis(d.x), axis(d.y))+}++/// Chromium's cursor: the way it's scrolling (of the ways the list scrolls),+/// else the ways it can.+fn cursor(d: Vec2, [x, y]: [bool; 2]) -> CursorIcon {+ let (north, south) = (y && d.y < -DEAD_ZONE, y && d.y > DEAD_ZONE);+ let (east, west) = (x && d.x > DEAD_ZONE, x && d.x < -DEAD_ZONE);+ if north || south {+ match (north, east, west) {+ (true, true, _) => CursorIcon::ResizeNorthEast,+ (true, _, true) => CursorIcon::ResizeNorthWest,+ (true, ..) => CursorIcon::ResizeNorth,+ (false, true, _) => CursorIcon::ResizeSouthEast,+ (false, _, true) => CursorIcon::ResizeSouthWest,+ (false, ..) => CursorIcon::ResizeSouth,+ }+ } else if east {+ CursorIcon::ResizeEast+ } else if west {+ CursorIcon::ResizeWest+ } else {+ match (x, y) {+ (false, _) => CursorIcon::ResizeVertical,+ (_, false) => CursorIcon::ResizeHorizontal,+ _ => CursorIcon::AllScroll,+ }+ }+}++/// The mark Chrome leaves at the click: a white disc with a dot, and arrows+/// the ways the list scrolls.+fn paint_mark(ctx: &Context, at: Pos2, [x, y]: [bool; 2]) {+ let painter = ctx.layer_painter(egui::LayerId::new(egui::Order::Tooltip, egui::Id::new("autoscroll_mark")));+ let ink = Color32::from_gray(64);+ painter.circle(at, 13.0, Color32::from_white_alpha(240), Stroke::new(1.0_f32, Color32::from_gray(150)));+ painter.circle_filled(at, 2.0, ink);+ let arrow = |dir: Vec2| {+ let (tip, base, side) = (at + dir * 10.0, at + dir * 5.5, dir.rot90() * 4.0);+ painter.add(Shape::convex_polygon(vec![tip, base + side, base - side], ink, Stroke::NONE));+ };+ if y {+ arrow(Vec2::UP);+ arrow(Vec2::DOWN);+ }+ if x {+ arrow(Vec2::LEFT);+ arrow(Vec2::RIGHT);+ }+}++#[cfg(test)]+mod tests {+ use super::*;+ use eframe::egui::{pos2, vec2, Modifiers};++ fn button(button: PointerButton, pressed: bool, pos: Pos2) -> Event {+ Event::PointerButton { pos, button, pressed, modifiers: Modifiers::NONE }+ }++ /// Runs events through the filter: what egui gets.+ fn feed(s: &mut Autoscroll, events: Vec<Event>) -> Vec<Event> {+ let mut raw = RawInput { events, ..Default::default() };+ s.filter(&mut raw, true);+ raw.events+ }++ #[test]+ fn speed_follows_chromium() {+ assert_eq!(velocity(vec2(15.0, -15.0)), Vec2::ZERO);+ let v = velocity(vec2(0.0, 100.0));+ assert!((v.y - 201.0).abs() < 1.0 && v.x == 0.0, "{v:?}");+ assert!(velocity(vec2(-300.0, 0.0)).x < -2000.0);+ }++ #[test]+ fn a_click_without_moving_stays_on_until_the_next_click() {+ let mut s = Autoscroll::default();+ let at = pos2(100.0, 100.0);+ assert_eq!(feed(&mut s, vec![button(PointerButton::Middle, true, at), button(PointerButton::Middle, false, at)]), vec![Event::PointerMoved(at)]);+ assert_eq!(s.on.as_ref().map(|a| a.mode), Some(Mode::Toggled));+ // Moving scrolls; egui keeps seeing the pointer at the click.+ assert!(feed(&mut s, vec![Event::PointerMoved(pos2(100.0, 300.0))]).is_empty());+ // The click that stops it reaches nothing, its release neither.+ let gone = feed(&mut s, vec![button(PointerButton::Primary, true, pos2(100.0, 300.0))]);+ assert_eq!(gone, vec![Event::PointerMoved(pos2(100.0, 300.0))]);+ assert!(s.on.is_none());+ assert!(feed(&mut s, vec![button(PointerButton::Primary, false, pos2(100.0, 300.0))]).is_empty());+ assert!(!feed(&mut s, vec![button(PointerButton::Primary, true, at)]).is_empty());+ }++ #[test]+ fn letting_go_after_moving_stops() {+ let mut s = Autoscroll::default();+ let at = pos2(50.0, 50.0);+ feed(&mut s, vec![button(PointerButton::Middle, true, at), Event::PointerMoved(pos2(50.0, 90.0))]);+ assert_eq!(s.on.as_ref().map(|a| a.mode), Some(Mode::Holding));+ assert_eq!(feed(&mut s, vec![button(PointerButton::Middle, false, pos2(50.0, 90.0))]), vec![Event::PointerMoved(pos2(50.0, 90.0))]);+ assert!(s.on.is_none());+ }++ #[test]+ fn push_to_talk_on_the_middle_button_keeps_it_off() {+ let mut s = Autoscroll::default();+ let press = button(PointerButton::Middle, true, pos2(1.0, 1.0));+ let mut raw = RawInput { events: vec![press.clone()], ..Default::default() };+ s.filter(&mut raw, false);+ assert_eq!(raw.events, vec![press]);+ assert!(s.on.is_none());+ }++ #[test]+ fn cursor_points_the_way_it_scrolls() {+ assert_eq!(cursor(vec2(0.0, 40.0), [false, true]), CursorIcon::ResizeSouth);+ assert_eq!(cursor(vec2(40.0, -40.0), [true, true]), CursorIcon::ResizeNorthEast);+ assert_eq!(cursor(vec2(40.0, 0.0), [false, true]), CursorIcon::ResizeVertical);+ assert_eq!(cursor(vec2(3.0, 3.0), [true, true]), CursorIcon::AllScroll);+ }+}diff --git a/apps/rustcord/src/ui/chat.rs b/apps/rustcord/src/ui/chat.rsindex 90ebf3a..6fa6c34 100644--- a/apps/rustcord/src/ui/chat.rs+++ b/apps/rustcord/src/ui/chat.rs@@ -721,11 +721,14 @@ impl RustCord {let (mut open_pins, mut toggle_members, mut do_search, mut toggle_profile) = (false, false, false, false);let mut open_notify: Option<Rect> = None;- let mut start_call = false;+ let (mut start_call, mut start_video, mut toggle_group_members, mut open_invite) = (false, false, false, false);let mut open_threads: Option<Pos2> = None;let mut go_parent: Option<Id> = None;let is_forum = channel_kind::is_forum(channel.kind);let is_dm = channel.kind == channel_kind::DM;+ let is_group = channel.kind == channel_kind::GROUP_DM;+ // Calls and adding people: DMs and group DMs with people (not Discord's system DM).+ let with_people = channel.guild_id.is_none() && !channel.recipients.first().is_some_and(|u| u.system);// Discord: "Search <server>", and in a DM the other person's username.let place = match channel.guild_id.and_then(|g| self.store.guilds.get(&g)) {Some(g) => g.guild.name.clone(),@@ -833,6 +836,9 @@ impl RustCord {if channel.guild_id.is_some() {let r = header_icon(ui, &t, icon::PEOPLE, self.show_members, if self.show_members { "Hide Member List" } else { "Show Member List" });toggle_members = r.clicked();+ } else if is_group {+ let on = self.show_group_members;+ toggle_group_members = header_icon(ui, &t, icon::PEOPLE, on, if on { "Hide Member List" } else { "Show Member List" }).clicked();} else if is_dm {// Discord offers the profile panel only in a window at// least 1132 px wide (greyed out, "(Unavailable)", below).@@ -846,6 +852,12 @@ impl RustCord {b.on_hover_text("Show User Profile (Unavailable)");}}+ // Discord: "Invite to Group DM", or in a DM "Add Friends to DM"+ // (a new group with them); not with bots.+ if with_people && (is_group || channel.recipients.first().is_some_and(|u| !u.bot)) {+ let tip = if is_group { "Invite to Group DM" } else { "Add Friends to DM" };+ open_invite = header_icon(ui, &t, icon::GROUP_PLUS, self.group_invite_open(ch), tip).clicked();+ }// (A forum has posts, not messages: nothing to pin.)if !is_forum {let r = header_icon(ui, &t, icon::PIN, self.pins.is_some(), "Pinned Messages");@@ -853,10 +865,15 @@ impl RustCord {ui.ctx().data_mut(|d| d.insert_temp(super::members::pins_button_id(), r.rect));open_pins = r.clicked();}- // DMs and group DMs: Discord's "Start Voice Call" (joins the- // call; Discord rings the others).- if channel.guild_id.is_none() && !channel.recipients.first().is_some_and(|u| u.system) {+ // DMs and group DMs: Discord's "Start Video Call" and "Start+ // Voice Call" (joins the call; Discord rings the others). The+ // camera is Windows-only in RustCord so far.+ if with_people {let in_call = self.voice.as_ref().is_some_and(|v| v.channel == ch);+ if cfg!(windows) {+ let filming = in_call && self.camera.on.is_some();+ start_video = header_icon(ui, &t, crate::camera::CAMERA, filming, "Start Video Call").clicked();+ }start_call = header_icon(ui, &t, icon::PHONE_CALL, in_call, if in_call { "Show Call" } else { "Start Voice Call" }).clicked();}// Discord's bell: mute the channel, or change its notifications.@@ -884,6 +901,19 @@ impl RustCord {if toggle_members {self.show_members = !self.show_members;}+ if toggle_group_members {+ self.show_group_members = !self.show_group_members;+ }+ if open_invite {+ if self.group_invite_open(ch) {+ self.group_invite = None;+ } else {+ self.open_group_invite(ch);+ }+ }+ if start_video {+ self.start_dm_video_call(ch);+ }if let Some(parent) = go_parent {self.select_channel(Some(parent));return;diff --git a/apps/rustcord/src/ui/group_dm.rs b/apps/rustcord/src/ui/group_dm.rsnew file mode 100644index 0000000..2a4be1b--- /dev/null+++ b/apps/rustcord/src/ui/group_dm.rs@@ -0,0 +1,369 @@+//! Group DMs: the member list beside the chat and Discord's "Invite to Group+//! DM" dialog (also "Add Friends to DM" in a one-to-one DM, which starts a+//! new group). Measured on Discord web, 2026-12-03.++use super::{paint_avatar, paint_status_dot};+use crate::app::RustCord;+use crate::style::{icon, icon_font, medium, rgba};+use discord::model::{channel_kind, Id, User};+use eframe::egui::{self, pos2, vec2, Align2, Color32, CursorIcon, FontId, Key, Margin, Rect, ScrollArea, Sense, Stroke, TextEdit, Ui};+use serde_json::json;++/// Discord's limit: ten people in a group DM, you included.+const MAX_MEMBERS: usize = 10;+/// The owner's crown (`--icon-feedback-warning`, read from the page).+const CROWN: Color32 = Color32::from_rgb(206, 129, 0);+const BRAND: Color32 = Color32::from_rgb(0x58, 0x65, 0xf2);+const BRAND_HOVER: Color32 = Color32::from_rgb(0x47, 0x52, 0xc4);+/// The dialog's width and the API tag of a new group.+const DIALOG_W: f32 = 478.0;+const CREATE_TAG: &str = "group-dm-create";++/// The invite dialog while it is up.+pub struct GroupInvite {+ /// The DM or group DM it was opened from.+ channel: Id,+ search: String,+ picked: Vec<Id>,+ /// Frame it opened on (the search field takes the focus then).+ opened: u64,+}++fn add_tag(user: Id) -> String {+ format!("group-dm-add:{user}")+}++impl RustCord {+ /// Who is in the group: its recipients and you, by username (as Discord+ /// lists them).+ fn group_members(&self, ch: Id) -> Vec<User> {+ let Some(channel) = self.store.channels.get(&ch) else { return Vec::new() };+ let mut people: Vec<User> = channel.recipients.clone();+ if let Some(me) = self.store.me.clone().filter(|me| !people.iter().any(|u| u.id == me.id)) {+ people.push(me);+ }+ people.sort_by_cached_key(|u| u.username.to_lowercase());+ people+ }++ /// Discord's group DM member list: "MembersβN" (14/18 medium, 20 px down,+ /// 16 px in), one 42 px row per person (44 with a status line), offline+ /// people at 30 % until hovered, a crown after the owner's name, and an+ /// "Invite to Group DM" button under the list while there is room.+ pub fn group_member_list_ui(&mut self, ui: &mut Ui, ch: Id) {+ let t = self.theme.clone();+ let people = self.group_members(ch);+ let owner = self.store.channels.get(&ch).and_then(|c| c.owner_id);+ let me = self.store.me_id();+ let mut open: Option<(User, egui::Pos2)> = None;+ let mut invite = false;+ ScrollArea::vertical().id_salt(("group_members", ch.0)).auto_shrink([false, false]).show(ui, |ui| {+ ui.spacing_mut().item_spacing.y = 0.0;+ ui.add_space(20.0);+ let (r, _) = ui.allocate_exact_size(vec2(ui.available_width(), 18.0), Sense::hover());+ ui.painter().text(pos2(r.left() + 16.0, r.center().y), Align2::LEFT_CENTER, format!("Membersβ{}", people.len()), medium(14.0), t.channel_default);+ ui.add_space(4.0);+ for user in &people {+ let status = self.store.dot_status(user.id).to_string();+ let sub = if Some(user.id) == me {+ self.custom_status_of(user.id).map(|custom| super::SubLine::Status { activity: None, more: 0, custom: Some(custom) })+ } else {+ self.store.presences.get(&user.id).and_then(super::SubLine::of)+ };+ let height = super::dense(if sub.is_some() { 44.0 } else { 42.0 });+ let (rect, resp) = ui.allocate_exact_size(vec2(ui.available_width(), height), Sense::click());+ if !ui.is_rect_visible(rect) {+ continue;+ }+ let resp = resp.on_hover_cursor(CursorIcon::PointingHand);+ let inner = rect.shrink2(vec2(8.0, 1.0));+ if resp.hovered() {+ ui.painter().rect_filled(inner, 8.0, t.bg_hover);+ self.profiles_wanted.borrow_mut().push((user.id, None));+ }+ let dim = status == "offline" && !resp.hovered();+ let opacity = ui.opacity();+ if dim {+ ui.multiply_opacity(0.3);+ }+ let av = Rect::from_center_size(pos2(inner.left() + 24.0, inner.center().y), vec2(32.0, 32.0));+ let name = self.store.nick_in(None, Some(ch), user.id).unwrap_or_else(|| user.display_name().to_string());+ paint_avatar(ui, av, Some(super::avatar_uri(user, 64, resp.hovered())), &name);+ if let Some(deco) = super::decoration_uri(user, resp.hovered()) {+ egui::Image::new(deco).paint_at(ui, av.expand(av.width() * 0.1));+ }+ if !dim {+ paint_status_dot(ui, av.right_bottom() - vec2(3.0, 3.0), 5.0, &status, if resp.hovered() { t.bg_hover } else { t.bg_primary });+ }+ let painter = ui.painter_at(inner.with_max_x(inner.right() - 4.0));+ let font = super::name_font(user, medium(16.0));+ let color = super::name_style_colors(user).and_then(|c| c.first().copied()).map_or(t.interactive_normal, |c| Color32::from_rgb((c >> 16) as u8, (c >> 8) as u8, c as u8));+ let y = if sub.is_some() { inner.center().y - 8.0 } else { inner.center().y };+ let galley = painter.layout_no_wrap(name, font, color);+ let name_w = galley.size().x;+ painter.galley(pos2(av.right() + 12.0, y - galley.size().y / 2.0), galley, color);+ let mut x = av.right() + 12.0 + name_w + 4.0;+ if owner == Some(user.id) {+ let crown = Rect::from_min_size(pos2(x, y - 7.0), vec2(14.0, 14.0));+ painter.text(crown.center(), Align2::CENTER_CENTER, icon::CROWN, icon_font(14.0), CROWN);+ if ui.rect_contains_pointer(crown) {+ resp.clone().on_hover_text("Group Owner");+ }+ x = crown.right() + 4.0;+ }+ if let Some(right) = super::paint_bot_badge(&painter, x, y, user, &t) {+ x = right + 4.0;+ }+ if let Some((tag, badge)) = user.server_tag() {+ super::paint_tag_chip(ui, &painter, x, y, &tag, badge.as_deref(), &t);+ }+ if let Some(sub) = &sub {+ sub.paint(ui, &painter, pos2(av.right() + 12.0, inner.center().y + 9.0), t.text_muted);+ }+ ui.set_opacity(opacity);+ if resp.clicked() {+ open = Some((user.clone(), rect.left_top()));+ }+ }+ // Discord: 16 px under the list, 16 px in from the left, 8 from+ // the right: a 40 px button with the icon before its label.+ if people.len() < MAX_MEMBERS {+ ui.add_space(16.0);+ let (row, _) = ui.allocate_exact_size(vec2(ui.available_width(), 40.0), Sense::hover());+ let r = Rect::from_min_max(pos2(row.left() + 16.0, row.top()), pos2(row.right() - 8.0, row.bottom()));+ let resp = ui.interact(r, egui::Id::new(("group_invite_button", ch.0)), Sense::click()).on_hover_cursor(CursorIcon::PointingHand);+ let fill = if resp.hovered() { rgba(151, 151, 159, 51) } else { rgba(151, 151, 159, 31) };+ ui.painter().rect(r, 8.0, fill, Stroke::new(1.0_f32, rgba(151, 151, 159, 41)));+ let label = ui.painter().layout_no_wrap("Invite to Group DM".into(), medium(16.0), t.text_normal);+ let left = r.center().x - (20.0 + 8.0 + label.size().x) / 2.0;+ super::paint_icon(ui.painter(), Rect::from_min_size(pos2(left, r.center().y - 10.0), vec2(20.0, 20.0)), icon::GROUP_PLUS, t.text_normal);+ ui.painter().galley(pos2(left + 28.0, r.center().y - label.size().y / 2.0), label, t.text_normal);+ invite = resp.clicked();+ }+ ui.add_space(super::USER_PANEL_SPACE / 2.0);+ });+ if let Some((user, at)) = open {+ self.open_profile(user, None, at - vec2(352.0, 0.0));+ }+ if invite {+ self.open_group_invite(ch);+ }+ }++ /// The header's "Invite to Group DM" / "Add Friends to DM" button.+ pub fn open_group_invite(&mut self, channel: Id) {+ self.group_invite = Some(GroupInvite { channel, search: String::new(), picked: Vec::new(), opened: self.ctx.cumulative_pass_nr() });+ }++ pub fn group_invite_open(&self, channel: Id) -> bool {+ self.group_invite.as_ref().is_some_and(|d| d.channel == channel)+ }++ /// Friends who could be added: not in the conversation yet, matching the+ /// search, the ones you talk to most recently first (by your DM with them).+ fn invite_candidates(&self, channel: Id, search: &str) -> Vec<User> {+ let present: Vec<Id> = self.store.channels.get(&channel).map(|c| c.recipients.iter().map(|u| u.id).collect()).unwrap_or_default();+ let recent: std::collections::HashMap<Id, Id> = self+ .store+ .channels+ .values()+ .filter(|c| c.kind == channel_kind::DM)+ .filter_map(|c| Some((c.recipients.first()?.id, c.last_message_id?)))+ .collect();+ let query = search.trim().to_lowercase();+ let mut friends: Vec<User> = self+ .store+ .relationships+ .values()+ .filter(|r| r.kind == 1 && !present.contains(&r.id))+ .filter_map(|r| self.store.users.get(&r.id).cloned().or_else(|| r.user.clone()))+ .filter(|u| {+ query.is_empty()+ || u.username.to_lowercase().contains(&query)+ || u.display_name().to_lowercase().contains(&query)+ || self.store.friend_nickname(u.id).is_some_and(|n| n.to_lowercase().contains(&query))+ })+ .collect();+ friends.sort_by_cached_key(|u| (std::cmp::Reverse(recent.get(&u.id).copied()), u.display_name().to_lowercase()));+ friends+ }++ /// Discord's dialog (2026-12-03): 478 px, 20/24 semibold title and the+ /// 16/20 "You can add N more people." under it; a search field beside a+ /// 100 Γ 40 Add button, a 12/16 hint, then the friends in 48 px rows+ /// (32 px avatar, name over username, a 20 px check box on the right).+ /// Discord's invite-link footer is left out: opening it creates a link.+ pub fn group_invite_ui(&mut self, ctx: &egui::Context) {+ self.group_invite_results();+ let Some(dialog) = self.group_invite.as_ref() else { return };+ let ch = dialog.channel;+ let Some(channel) = self.store.channels.get(&ch).cloned() else {+ self.group_invite = None;+ return;+ };+ let t = self.theme.clone();+ let is_group = channel.kind == channel_kind::GROUP_DM;+ // A new group from a DM holds you, them and whoever is picked.+ let room = MAX_MEMBERS.saturating_sub(channel.recipients.len() + 1);+ let candidates = self.invite_candidates(ch, &dialog.search);+ let creating = self.api_pending.contains(CREATE_TAG);+ let search_id = egui::Id::new(("group_invite_search", ch.0));+ if ctx.cumulative_pass_nr() <= dialog.opened + 1 {+ ctx.memory_mut(|m| m.request_focus(search_id));+ }+ let mut close = ctx.input(|i| i.key_pressed(Key::Escape));+ let mut add = false;+ let dialog = self.group_invite.as_mut().expect("checked above");+ let picked_now = dialog.picked.len();+ let left_to_add = room.saturating_sub(picked_now);+ close |= super::guild_pages::modal_frame(ctx, &t, "group_invite", DIALOG_W, |ui| {+ let (head, _) = ui.allocate_exact_size(vec2(DIALOG_W, 24.0 + 24.0 + 8.0 + 20.0), Sense::hover());+ let left = head.left() + 24.0;+ let title = if is_group { "Invite to Group DM" } else { "Add Friends to DM" };+ ui.painter().text(pos2(left, head.top() + 36.0), Align2::LEFT_CENTER, title, super::guild_pages::strong(20.0), t.header_primary);+ let x = Rect::from_min_size(pos2(head.right() - 8.0 - 40.0, head.top() + 8.0), vec2(40.0, 40.0));+ let xr = ui.interact(x, egui::Id::new("group_invite_close"), Sense::click()).on_hover_cursor(CursorIcon::PointingHand);+ if xr.hovered() {+ ui.painter().rect_filled(x, 8.0, t.bg_hover);+ }+ ui.painter().text(x.center(), Align2::CENTER_CENTER, icon::CLOSE, icon_font(14.0), if xr.hovered() { t.header_primary } else { t.interactive_normal });+ close |= xr.clicked();+ let room_line = match left_to_add {+ 0 => "This group has reached its limit of 10 members.".to_string(),+ 1 => "You can add 1 more person.".to_string(),+ n => format!("You can add {n} more people."),+ };+ ui.painter().text(pos2(left, head.bottom() - 10.0), Align2::LEFT_CENTER, room_line, FontId::proportional(16.0), t.header_secondary);++ // Search field and Add.+ ui.add_space(24.0);+ let (row, _) = ui.allocate_exact_size(vec2(DIALOG_W, 40.0), Sense::hover());+ let button = Rect::from_min_size(pos2(row.right() - 24.0 - 100.0, row.top()), vec2(100.0, 40.0));+ let field = Rect::from_min_max(pos2(left, row.top()), pos2(button.left() - 8.0, row.bottom()));+ let focused = ui.memory(|m| m.has_focus(search_id));+ ui.painter().rect(field, 8.0, Color32::from_black_alpha(31), Stroke::new(1.0_f32, if focused { t.text_link } else { rgba(151, 151, 159, 61) }));+ let edit = TextEdit::singleline(&mut dialog.search)+ .id(search_id)+ .frame(false)+ .margin(Margin::symmetric(0.0, 0.0))+ .hint_text(egui::RichText::new("Search").color(t.text_muted))+ .font(FontId::proportional(16.0))+ .text_color(t.text_normal)+ .vertical_align(egui::Align::Center);+ let resp = ui.put(field.shrink2(vec2(10.0, 1.0)), edit);+ let enabled = !dialog.picked.is_empty() && !creating;+ let br = ui.interact(button, egui::Id::new("group_invite_add"), if enabled { Sense::click() } else { Sense::hover() });+ let fill = if enabled && br.hovered() { BRAND_HOVER } else { BRAND };+ ui.painter().rect(button, 8.0, if enabled { fill } else { fill.gamma_multiply(0.5) }, Stroke::new(1.0_f32, rgba(255, 255, 255, 20)));+ let label = if is_group { "Add" } else { "Create" };+ ui.painter().text(button.center(), Align2::CENTER_CENTER, label, medium(16.0), if enabled { Color32::WHITE } else { Color32::from_white_alpha(128) });+ add |= enabled && (br.on_hover_cursor(CursorIcon::PointingHand).clicked() || (resp.lost_focus() && ui.input(|i| i.key_pressed(Key::Enter))));+ ui.add_space(6.0);+ let (hint, _) = ui.allocate_exact_size(vec2(DIALOG_W, 16.0), Sense::hover());+ ui.painter().text(pos2(left, hint.center().y), Align2::LEFT_CENTER, "Add friends to group DMs.", FontId::proportional(12.0), t.header_secondary);+ ui.add_space(12.0);++ // The friends.+ ScrollArea::vertical().id_salt("group_invite_list").max_height(340.0).min_scrolled_height(340.0_f32.min(48.0 * candidates.len().max(1) as f32)).show(ui, |ui| {+ ui.spacing_mut().item_spacing.y = 0.0;+ if candidates.is_empty() {+ let (r, _) = ui.allocate_exact_size(vec2(DIALOG_W, 48.0), Sense::hover());+ let text = if dialog.search.trim().is_empty() { "All your friends are here already." } else { "No friends found." };+ ui.painter().text(r.center(), Align2::CENTER_CENTER, text, FontId::proportional(14.0), t.text_muted);+ }+ for user in &candidates {+ let (row, _) = ui.allocate_exact_size(vec2(DIALOG_W, 48.0), Sense::hover());+ let r = Rect::from_min_max(pos2(row.left() + 16.0, row.top()), pos2(row.right() - 16.0, row.bottom()));+ if !ui.is_rect_visible(r) {+ continue;+ }+ let on = dialog.picked.contains(&user.id);+ let can = on || dialog.picked.len() < room;+ let resp = ui.interact(r, egui::Id::new(("group_invite_row", user.id.0)), if can { Sense::click() } else { Sense::hover() });+ if resp.hovered() && can {+ ui.painter().rect_filled(r, 8.0, rgba(79, 80, 90, 77));+ }+ let av = Rect::from_min_size(pos2(r.left() + 8.0, r.center().y - 16.0), vec2(32.0, 32.0));+ let name = self.store.friend_nickname(user.id).map(String::from).unwrap_or_else(|| user.display_name().to_string());+ paint_avatar(ui, av, Some(super::avatar_uri(user, 64, false)), &name);+ paint_status_dot(ui, av.right_bottom() - vec2(3.0, 3.0), 5.0, self.store.dot_status(user.id), if resp.hovered() && can { t.bg_hover } else { t.surface_high });+ let painter = ui.painter_at(r.with_max_x(r.right() - 40.0));+ painter.text(pos2(av.right() + 8.0, r.top() + 16.0), Align2::LEFT_CENTER, &name, medium(16.0), t.header_primary);+ painter.text(pos2(av.right() + 8.0, r.top() + 34.0), Align2::LEFT_CENTER, &user.username, FontId::proportional(12.0), rgba(129, 130, 138, 255));+ let b = Rect::from_center_size(pos2(r.right() - 18.0, r.center().y), vec2(20.0, 20.0));+ if on {+ ui.painter().rect_filled(b, 6.0, BRAND);+ ui.painter().text(b.center(), Align2::CENTER_CENTER, icon::CHECK, icon_font(12.0), Color32::WHITE);+ } else {+ let edge = if can { if resp.hovered() { t.interactive_hover } else { t.interactive_normal } } else { t.interactive_muted };+ ui.painter().rect_stroke(b, 6.0, Stroke::new(1.0_f32, edge));+ }+ if resp.on_hover_cursor(if can { CursorIcon::PointingHand } else { CursorIcon::NotAllowed }).clicked() {+ if on {+ dialog.picked.retain(|id| *id != user.id);+ } else {+ dialog.picked.push(user.id);+ }+ }+ }+ });+ ui.add_space(16.0);+ });++ if add {+ let picked = dialog.picked.clone();+ if is_group {+ // One request per person, as Discord's client does.+ for user in &picked {+ log::info!("group dm: adding {user} to {ch}");+ self.api(&add_tag(*user), reqwest::Method::PUT, format!("/channels/{ch}/recipients/{user}"), None);+ }+ self.group_adds.extend(picked);+ self.group_invite = None;+ } else {+ let mut recipients: Vec<Id> = channel.recipients.iter().map(|u| u.id).collect();+ recipients.extend(picked);+ log::info!("group dm: starting a group of {} from {ch}", recipients.len() + 1);+ self.api(CREATE_TAG, reqwest::Method::POST, "/users/@me/channels", Some(json!({ "recipients": recipients })));+ }+ } else if close {+ ctx.memory_mut(|m| m.surrender_focus(search_id));+ self.group_invite = None;+ }+ }++ /// Answers to Add (a toast for anyone who couldn't be added; Discord's+ /// CHANNEL_RECIPIENT_ADD updates the list) and to a new group (opened+ /// as soon as it exists).+ fn group_invite_results(&mut self) {+ let mut failed = Vec::new();+ let mut i = 0;+ while i < self.group_adds.len() {+ let user = self.group_adds[i];+ match self.api_take(&add_tag(user)) {+ Some(result) => {+ if let Err(e) = result {+ failed.push(e);+ }+ self.group_adds.swap_remove(i);+ }+ None => i += 1,+ }+ }+ if let Some(e) = failed.first() {+ self.toast(format!("Couldn't add {} to the group: {e}", if failed.len() == 1 { "them".to_string() } else { format!("{} people", failed.len()) }), true);+ }+ match self.api_take(CREATE_TAG) {+ Some(Ok(v)) => {+ self.group_invite = None;+ self.store.upsert_channel(&v);+ if let Some(id) = Id::from_value(&v["id"]) {+ self.current_guild = None;+ self.select_channel(Some(id));+ }+ }+ Some(Err(e)) => self.toast(format!("Couldn't create the group: {e}"), true),+ None => {}+ }+ }+}diff --git a/apps/rustcord/src/ui/mod.rs b/apps/rustcord/src/ui/mod.rsindex 9c46ae3..00e9eba 100644--- a/apps/rustcord/src/ui/mod.rs+++ b/apps/rustcord/src/ui/mod.rs@@ -43,6 +43,8 @@ pub mod switch_accounts;pub mod moderation;pub mod guild_menu;pub mod channel_menu;+pub mod group_dm;+pub mod autoscroll;pub mod add_server;pub mod request_log;mod experimental;@@ -51,6 +53,7 @@ pub mod leaving;pub mod spotify_player;pub mod app_directory;pub mod voice_notice;+pub mod updates;use crate::app::{RustCord, Screen};use crate::style::{color_for, icon, icon_font, Theme};@@ -174,6 +177,24 @@ impl RustCord {}}}+ // Discord's update button, green, left of them: clickable once+ // the update is installed, greyed while it downloads.+ let mut update = false;+ if let Some(ready) = self.updater.as_ref().and_then(|u| u.title_bar_button()) {+ let r = Rect::from_center_size(pos2(x - 14.0, bar.center().y), vec2(28.0, 24.0));+ x -= 32.0;+ let b = ui.interact(r, egui::Id::new("title_update"), Sense::click());+ if ready && b.hovered() {+ ui.painter().rect_filled(r, 4.0, t.bg_hover);+ }+ let green = updates::GREEN;+ ui.painter().text(r.center(), Align2::CENTER_CENTER, icon::DOWNLOAD, icon_font(15.0), if ready { green } else { green.gamma_multiply(0.5) });+ let b = b.on_hover_text(if ready { updates::READY } else { updates::DOWNLOADING });+ update = ready && b.on_hover_cursor(egui::CursorIcon::PointingHand).clicked();+ }+ if update {+ self.install_update(ctx);+ }// Back / forward, far left (on macOS after the traffic lights,// which full screen hides).let traffic_lights = cfg!(target_os = "macos") && !ctx.input(|i| i.viewport().fullscreen.unwrap_or(false));@@ -386,7 +407,9 @@ impl RustCord {self.soundboard_ui(ctx);self.pins_popout(ctx);self.stranger_confirm_ui(ctx);+ self.update_confirm_ui(ctx);self.friend_nickname_ui(ctx);+ self.group_invite_ui(ctx);self.bot_modal_ui(ctx);self.threads_popout_ui(ctx);self.inbox_popout(ctx);@@ -436,8 +459,8 @@ impl RustCord {/// The refreshed user panel: a card floating over the bottom of the server/// and channel lists./// Under the chat header, on the right: the member list (server text- /// channels) or the DM's profile, unless search / a new thread has the- /// window's right side.+ /// channels and group DMs) or the DM's profile, unless search / a new+ /// thread has the window's right side.pub(crate) fn chat_side_panel(&mut self, ui: &mut Ui) {let t = self.theme.clone();if self.search.is_some() || self.compose.new_thread.as_ref().is_some_and(|d| Some(d.channel) == self.current_channel) {@@ -445,8 +468,21 @@ impl RustCord {}let in_guild_text = self.current_guild.is_some()&& self.current_channel.and_then(|c| self.store.channels.get(&c)).is_some_and(|c| channel_kind::is_text(c.kind));+ let group = self.current_channel.filter(|c| self.store.channels.get(c).is_some_and(|c| c.kind == channel_kind::GROUP_DM));let ctx = ui.ctx().clone();- if in_guild_text && self.show_members {+ if let Some(ch) = group.filter(|_| self.show_group_members) {+ SidePanel::right("group_members")+ .exact_width(MEMBERS)+ .resizable(false)+ .show_separator_line(false)+ .frame(Frame::none().fill(t.page(t.bg_primary)))+ .show_inside(ui, |ui| {+ paint_theme_surface(&ctx, ui.painter(), ui.max_rect(), 0.0, surface::CHAT, &t);+ let r = ui.max_rect();+ ui.painter().vline(r.left() + 0.5, r.y_range(), Stroke::new(1.0_f32, t.border_subtle));+ self.group_member_list_ui(ui, ch)+ });+ } else if in_guild_text && self.show_members {SidePanel::right("member_list").exact_width(MEMBERS).resizable(false)@@ -1198,17 +1234,37 @@ pub fn sized(url: &str, size: u32) -> String {}pub fn paint_squircle_image(ui: &Ui, r: Rect, uri: &str) -> bool {+ // On whole pixels: a picture fetched at the size it's drawn is then+ // sampled texel for pixel. At a fractional position (a list scrolled by+ // a fraction, as touchpads and smooth scrolling leave it) every pixel+ // blends two texels and the icon goes soft.+ let r = ui.painter().round_rect_to_pixels(r);let Ok(egui::load::TexturePoll::Ready { texture }) = egui::Image::new(uri.to_string()).texture_options(SMOOTH).load_for_size(ui.ctx(), r.size()) else { return false };let mut mesh = egui::Mesh::with_texture(texture.id);let uv = |p: egui::Pos2| pos2((p.x - r.left()) / r.width(), (p.y - r.top()) / r.height());mesh.vertices.push(egui::epaint::Vertex { pos: r.center(), uv: uv(r.center()), color: Color32::WHITE });+ // The edge is feathered the way egui antialiases its own shapes: opaque+ // half a pixel inside the outline, transparent half a pixel outside. (A+ // bare mesh has hard, stair-stepped edges.)let outline = squircle(r);- for p in &outline {- mesh.vertices.push(egui::epaint::Vertex { pos: *p, uv: uv(*p), color: Color32::WHITE });- }- let n = outline.len() as u32;+ let n = outline.len();+ let feather = 0.5 / ui.ctx().pixels_per_point();for i in 0..n {- mesh.add_triangle(0, 1 + i, 1 + (i + 1) % n);+ let (prev, p, next) = (outline[(i + n - 1) % n], outline[i], outline[(i + 1) % n]);+ // The outline runs clockwise on screen: the outward normal of a+ // direction (x, y) is (y, βx).+ let d = (next - prev).normalized();+ let out = vec2(d.y, -d.x) * feather;+ mesh.vertices.push(egui::epaint::Vertex { pos: p - out, uv: uv(p - out), color: Color32::WHITE });+ mesh.vertices.push(egui::epaint::Vertex { pos: p + out, uv: uv(p + out), color: Color32::TRANSPARENT });+ }+ let n = n as u32;+ for i in 0..n {+ let j = (i + 1) % n;+ let (inner_i, outer_i, inner_j, outer_j) = (1 + 2 * i, 2 + 2 * i, 1 + 2 * j, 2 + 2 * j);+ mesh.add_triangle(0, inner_i, inner_j);+ mesh.add_triangle(inner_i, outer_i, outer_j);+ mesh.add_triangle(inner_i, outer_j, inner_j);}ui.painter().add(egui::Shape::mesh(mesh));truediff --git a/apps/rustcord/src/ui/process_viewer.rs b/apps/rustcord/src/ui/process_viewer.rsindex fd00c90..87c7094 100644--- a/apps/rustcord/src/ui/process_viewer.rs+++ b/apps/rustcord/src/ui/process_viewer.rs@@ -2,7 +2,7 @@//! now. Its own process and the helpers it started (the embedded browser//! behind the login page and embed players), with memory, processor use and//! threads for each, the last minute as graphs, and a button that hands-//! unused memory back to Windows.+//! unused memory back to the system.//!//! Nothing is sampled unless the page is open; then once a second.@@ -18,6 +18,22 @@ use eframe::egui::{self, pos2, vec2, Align2, Color32, FontFamily, FontId, Rect,const HISTORY: usize = 60;const SAMPLE_EVERY: Duration = Duration::from_secs(1);+/// The system's name and its own process monitor, for the explanations.+const SYSTEM: &str = if cfg!(windows) {+ "Windows"+} else if cfg!(target_os = "macos") {+ "macOS"+} else {+ "the system"+};+const MONITOR: &str = if cfg!(windows) {+ "Task Manager"+} else if cfg!(target_os = "macos") {+ "Activity Monitor"+} else {+ "your system monitor"+};+fn strong(size: f32) -> FontId {FontId::new(size, FontFamily::Name(crate::style::BOLD.into()))}@@ -169,10 +185,10 @@ impl RustCord {let (row, _) = ui.allocate_exact_size(vec2(width, 72.0), Sense::hover());let w = (width - gap * 3.0) / 4.0;let tiles = [- (mb(total_memory), "Memory", "RAM only RustCord is using. This is the figure Task Manager shows."),- (mb(total_in_ram), "In RAM, with shared", "Everything of RustCord's that is in RAM, including program files and fonts that Windows shares with other apps."),- (percent(total_cpu), "Processor", "Share of the whole processor used over the last second."),- (threads.to_string(), "Threads", "Threads across RustCord and its helpers."),+ (mb(total_memory), "Memory", format!("RAM only RustCord is using. This is the figure {MONITOR} shows.")),+ (mb(total_in_ram), "In RAM, with shared", format!("Everything of RustCord's that is in RAM, including program files and fonts that {SYSTEM} shares with other apps.")),+ (percent(total_cpu), "Processor", "Share of the whole processor used over the last second.".to_string()),+ (threads.to_string(), "Threads", "Threads across RustCord and its helpers.".to_string()),];for (i, (value, label, hint)) in tiles.iter().enumerate() {let r = Rect::from_min_size(pos2(row.left() + (w + gap) * i as f32, row.top()), vec2(w, 72.0));@@ -237,11 +253,11 @@ impl RustCord {let up = ui.input(|i| i.time) as u64;let uptime = if up >= 3600 { format!("{} h {} min", up / 3600, up % 3600 / 60) } else if up >= 60 { format!("{} min {} s", up / 60, up % 60) } else { format!("{up} s") };let rows = [- ("Reserved memory (commit)", mb(me.committed), "Memory Windows has set aside for RustCord, whether it is in RAM or not."),- ("Most in RAM since it started", mb(me.peak_working_set), "The highest the \"In RAM, with shared\" figure has been."),- ("Processor time used", format!("{:.1} s", me.cpu_seconds), "Total processor time since RustCord started."),- ("Handles", me.handles.to_string(), "Open files, connections and other system objects."),- ("Running for", uptime, ""),+ ("Reserved memory (commit)", mb(me.committed), format!("Memory {SYSTEM} has set aside for RustCord, whether it is in RAM or not.")),+ ("Most in RAM since it started", mb(me.peak_working_set), "The highest the \"In RAM, with shared\" figure has been.".to_string()),+ ("Processor time used", format!("{:.1} s", me.cpu_seconds), "Total processor time since RustCord started.".to_string()),+ ("Handles", me.handles.to_string(), "Open files, connections and other system objects.".to_string()),+ ("Running for", uptime, String::new()),];for (label, value, hint) in rows {let (r, resp) = ui.allocate_exact_size(vec2(width, 32.0), Sense::hover());@@ -263,12 +279,12 @@ impl RustCord {free = ui.add(button).on_hover_cursor(egui::CursorIcon::PointingHand).clicked();ui.add_space(8.0);if let Some((freed, _)) = pv.freed.filter(|(_, at)| at.elapsed() < Duration::from_secs(8)) {- let text = if freed > 0 { format!("Handed {freed} MB back to Windows.") } else { "Nothing more to hand back.".to_string() };+ let text = if freed > 0 { format!("Handed {freed} MB back to {SYSTEM}.") } else { "Nothing more to hand back.".to_string() };ui.label(RichText::new(text).size(14.0).color(t.text_muted));}});ui.add_space(6.0);- ui.add(egui::Label::new(RichText::new("Hands memory RustCord isn't using back to Windows. RustCord also does this by itself when it has been quiet for a while.").size(13.0).color(t.text_muted)).wrap());+ ui.add(egui::Label::new(RichText::new(format!("Hands memory RustCord isn't using back to {SYSTEM}. RustCord also does this by itself when it has been quiet for a while.")).size(13.0).color(t.text_muted)).wrap());if free {let before = crate::diagnostics::working_set_mb() as i64;crate::diagnostics::release_unused_memory();diff --git a/apps/rustcord/src/ui/settings.rs b/apps/rustcord/src/ui/settings.rsindex 58863ca..3c3de50 100644--- a/apps/rustcord/src/ui/settings.rs+++ b/apps/rustcord/src/ui/settings.rs@@ -918,7 +918,7 @@ impl RustCord {SettingsTab::Experimental => self.experimental_tab(ui, &t),SettingsTab::Plugins => self.plugins_tab(ui, &t),SettingsTab::Themes => self.themes_tab(ui, &t),- SettingsTab::About => about_tab(ui, &t),+ SettingsTab::About => self.about_tab(ui, &t),}ui.add_space(64.0);});@@ -3247,12 +3247,15 @@ impl RustCord {if let Some(v) = toggle_row(ui, t, "Noise Suppression", "Reduces background noise from your microphone.", iso) {self.voice_ui.set_voice_isolation(v);}+ if let Some(v) = toggle_row(ui, t, "Echo Cancellation", "", self.voice_ui.prefs.echo_cancellation) {+ self.voice_ui.prefs.echo_cancellation = v;+ self.voice_ui.changed();+ }if let Some(v) = toggle_row(ui, t, "Automatic Gain Control", "Raises a quiet microphone to a steady speaking level.", self.voice_ui.prefs.automatic_gain_control) {self.voice_ui.prefs.automatic_gain_control = v;self.voice_ui.changed();}}- locked_row(ui, t, "Echo Cancellation", "", Locked::Soon);subheading(ui, t, "Input Mode");let ptt = self.voice_ui.prefs.push_to_talk;for (on, title, desc) in [@@ -3447,26 +3450,70 @@ fn mic_meter(ui: &mut Ui, level_db: f32, threshold_db: f32, width: f32) {}}-fn about_tab(ui: &mut Ui, t: &Theme) {- ui.horizontal(|ui| {- ui.add(egui::Image::new(super::badges::rustcord_icon()).fit_to_exact_size(vec2(64.0, 64.0)));- ui.add_space(12.0);- ui.vertical(|ui| {- ui.add_space(10.0);- ui.label(RichText::new("RustCord").font(strong(24.0)).color(t.header_primary));- ui.label(RichText::new(concat!("Version ", env!("CARGO_PKG_VERSION"))).size(14.0).color(t.text_muted));+impl RustCord {+ fn about_tab(&mut self, ui: &mut Ui, t: &Theme) {+ ui.horizontal(|ui| {+ ui.add(egui::Image::new(super::badges::rustcord_icon()).fit_to_exact_size(vec2(64.0, 64.0)));+ ui.add_space(12.0);+ ui.vertical(|ui| {+ ui.add_space(10.0);+ ui.label(RichText::new("RustCord").font(strong(24.0)).color(t.header_primary));+ ui.label(RichText::new(concat!("Version ", env!("CARGO_PKG_VERSION"))).size(14.0).color(t.text_muted));+ });});- });- ui.add_space(16.0);- ui.label("A native Discord client written in Rust with egui. No Electron, no web runtime.");- ui.add_space(8.0);- ui.label(- "Rencord is RustCord's mod system, inspired by Vencord. Turn its plugins on and off under Rencord Plugins.",- );- ui.add_space(12.0);- ui.label(- RichText::new("Unofficial and not endorsed by Discord. Third-party clients are against Discord's Terms of Service; use at your own risk.").color(t.text_muted),- );+ ui.add_space(16.0);+ ui.label("A native Discord client written in Rust with egui. No Electron, no web runtime.");+ ui.add_space(8.0);+ ui.label(+ "Rencord is RustCord's mod system, inspired by Vencord. Turn its plugins on and off under Rencord Plugins.",+ );+ ui.add_space(12.0);+ ui.label(+ RichText::new("Unofficial and not endorsed by Discord. Third-party clients are against Discord's Terms of Service; use at your own risk.").color(t.text_muted),+ );+ divider(ui, t);+ subheading(ui, t, "Updates");+ let Some(updater) = &mut self.updater else {+ note(ui, t, "This copy of RustCord wasn't installed with RustCordSetup, so it doesn't update itself. New versions are on GitHub.");+ if secondary_button(ui, t, "Open Releases").clicked() {+ ui.ctx().open_url(egui::OpenUrl::new_tab(crate::updater::RELEASES_PAGE));+ }+ return;+ };+ let desc = "New versions are downloaded in the background and installed for the next time RustCord starts. RustCord looks for them on GitHub a minute after it starts and every 6 hours.";+ if let Some(on) = toggle_row(ui, t, "Update automatically", desc, updater.enabled()) {+ updater.set_enabled(on);+ }+ let status = updater.status();+ let ready = matches!(status, crate::updater::Status::Ready(_));+ let (title, desc) = update_status(&status, updater.enabled());+ if button_row(ui, t, &title, &desc, if ready { "Restart" } else { "Check for Updates" }, false) && !status.busy() {+ if ready {+ self.install_update(ui.ctx());+ } else {+ updater.check_now();+ }+ }+ }+}++/// Settings β About's line about updates: (title, description).+fn update_status(status: &crate::updater::Status, automatic: bool) -> (String, String) {+ use crate::updater::Status;+ let mb = |bytes: u64| bytes as f64 / (1024.0 * 1024.0);+ match status {+ Status::Idle if automatic => (concat!("RustCord ", env!("CARGO_PKG_VERSION")).into(), "Not checked for a newer version yet.".into()),+ Status::Idle => (concat!("RustCord ", env!("CARGO_PKG_VERSION")).into(), "Automatic updates are off.".into()),+ Status::Checking => ("Checking for updates\u{2026}".into(), String::new()),+ Status::UpToDate(at) => {+ let clock = if super::hour24() { at.format("%H:%M") } else { at.format("%-I:%M %p") };+ ("RustCord is up to date".into(), format!("Checked at {clock}."))+ }+ Status::Downloading { version, done, total } => (format!("Downloading RustCord {version}\u{2026}"), format!("{:.1} of {:.1} MB", mb(*done), mb(*total))),+ Status::Installing(version) => (format!("Installing RustCord {version}\u{2026}"), String::new()),+ Status::Ready(version) => (format!("RustCord {version} is ready"), "It's installed and starts the next time RustCord does. Restart to use it now.".into()),+ Status::Failed(e) => ("Couldn't update".into(), format!("{e}.")),+ }}diff --git a/apps/rustcord/src/ui/sidebar.rs b/apps/rustcord/src/ui/sidebar.rsindex 7ee1119..e95f89e 100644--- a/apps/rustcord/src/ui/sidebar.rs+++ b/apps/rustcord/src/ui/sidebar.rs@@ -266,7 +266,8 @@ fn folder_tile(ui: &mut Ui, t: &Theme, color: Color32, icons: &[(Option<String>,let (cx, cy) = ((i % 2) as f32, (i / 2) as f32);let r = Rect::from_min_size(tile.min + vec2(4.0 + cx * 17.0, 4.0 + cy * 17.0), vec2(15.0, 15.0));match url {- Some(u) => egui::Image::new(super::sized(u, mini_px)).texture_options(super::SMOOTH).rounding(7.5).paint_at(ui, r),+ // (On whole pixels, like the full-size icons: sharp after any scroll.)+ Some(u) => egui::Image::new(super::sized(u, mini_px)).texture_options(super::SMOOTH).rounding(7.5).paint_at(ui, ui.painter().round_rect_to_pixels(r)),None => {ui.painter().circle_filled(r.center(), 7.5, t.bg_primary);let c: String = label.chars().take(1).collect();diff --git a/apps/rustcord/src/ui/updates.rs b/apps/rustcord/src/ui/updates.rsnew file mode 100644index 0000000..769eb61--- /dev/null+++ b/apps/rustcord/src/ui/updates.rs@@ -0,0 +1,95 @@+//! The update that is ready (see `crate::updater`): Discord's green download+//! button in the title bar ("Update Ready!") restarts into it, after Discord's+//! "Briefly leave voice?" when you're in a call.++use crate::app::RustCord;+use crate::style::{icon, icon_font, medium, overlay, rgba};+use eframe::egui::{self, pos2, vec2, Align2, Color32, CursorIcon, FontId, Key, Rect, Sense, Stroke};++/// Discord's `GREEN_360`, the button's colour (Discord web, 2026-12-03).+pub const GREEN: Color32 = Color32::from_rgb(0x3d, 0x9e, 0x60);+/// The "critical-primary" confirm button, and hovered.+const CRITICAL: Color32 = Color32::from_rgb(0xd2, 0x2d, 0x39);+const CRITICAL_HOVER: Color32 = Color32::from_rgb(0xa9, 0x23, 0x2e);++/// Discord's strings (its desktop app's, in its web client), with RustCord+/// for Discord.+pub const READY: &str = "Update Ready!";+pub const DOWNLOADING: &str = "Downloading Update";+const LEAVE_TITLE: &str = "Briefly leave voice?";+const LEAVE_BODY: &str = "Updating RustCord while in a voice channel will cause you to leave briefly. You\u{2019}re probably going to update anyway but, you know, just warning you.";+const LEAVE_CONFIRM: &str = "Update anyway!";++fn strong(size: f32) -> FontId {+ FontId::new(size, egui::FontFamily::Name(crate::style::BOLD.into()))+}++impl RustCord {+ /// The title bar button or Settings' "Restart": restart into the update,+ /// asking first during a call.+ pub fn install_update(&mut self, ctx: &egui::Context) {+ if self.voice.is_some() || self.go_live.is_some() || self.watching.is_some() {+ self.update_confirm = true;+ } else {+ log::info!("updater: restarting into the new version");+ self.restart(ctx);+ }+ }++ /// "Briefly leave voice?", laid out as Discord's other confirmations+ /// (see `stranger_confirm_ui`), with its red confirm button. Enter+ /// updates; Esc, β or a click on the dimmed window cancels.+ pub fn update_confirm_ui(&mut self, ctx: &egui::Context) {+ if !self.update_confirm {+ return;+ }+ let t = self.theme.clone();+ const W: f32 = 398.0;+ let ok_id = egui::Id::new("update_confirm_ok");+ let mut cancel = ctx.input(|i| i.key_pressed(Key::Escape));+ let mut confirm = ctx.memory(|m| m.has_focus(ok_id)) && ctx.input(|i| i.key_pressed(Key::Enter));+ cancel |= super::guild_pages::modal_frame(ctx, &t, "update_confirm", W, |ui| {+ let mut job = egui::text::LayoutJob::single_section(+ LEAVE_BODY.into(),+ egui::TextFormat { font_id: FontId::proportional(16.0), color: t.header_secondary, line_height: Some(20.0), ..Default::default() },+ );+ job.wrap.max_width = W - 48.0;+ let body = ui.fonts(|f| f.layout_job(job));+ let h = 24.0 + 24.0 + 8.0 + body.size().y + 8.0 + 16.0 + 40.0 + 8.0 + 16.0;+ let (r, _) = ui.allocate_exact_size(vec2(W, h), Sense::hover());+ ui.painter().text(pos2(r.left() + 24.0, r.top() + 36.0), Align2::LEFT_CENTER, LEAVE_TITLE, strong(20.0), t.header_primary);+ let x = Rect::from_min_size(pos2(r.right() - 8.0 - 40.0, r.top() + 8.0), vec2(40.0, 40.0));+ let xr = ui.interact(x, egui::Id::new("update_confirm_close"), Sense::click()).on_hover_cursor(CursorIcon::PointingHand);+ if xr.hovered() {+ ui.painter().rect_filled(x, 8.0, t.bg_hover);+ }+ ui.painter().text(x.center(), Align2::CENTER_CENTER, icon::CLOSE, icon_font(14.0), if xr.hovered() { t.header_primary } else { t.interactive_normal });+ cancel |= xr.clicked();+ ui.painter().galley(pos2(r.left() + 24.0, r.top() + 56.0), body, t.header_secondary);+ let bw = (W - 48.0 - 8.0) / 2.0;+ let no = Rect::from_min_size(pos2(r.left() + 24.0, r.bottom() - 24.0 - 40.0), vec2(bw, 40.0));+ let yes = no.translate(vec2(bw + 8.0, 0.0));+ let nr = ui.interact(no, egui::Id::new("update_confirm_cancel"), Sense::click()).on_hover_cursor(CursorIcon::PointingHand);+ ui.painter().rect(no, 8.0, overlay(if nr.hovered() { 0.2 } else { 0.12 }), Stroke::new(1.0_f32, rgba(151, 151, 159, 10)));+ ui.painter().text(no.center(), Align2::CENTER_CENTER, "Cancel", medium(16.0), t.header_primary);+ cancel |= nr.clicked();+ let yr = ui.interact(yes, ok_id, Sense::click()).on_hover_cursor(CursorIcon::PointingHand);+ ui.painter().rect(yes, 8.0, if yr.hovered() { CRITICAL_HOVER } else { CRITICAL }, Stroke::new(1.0_f32, rgba(255, 255, 255, 20)));+ ui.painter().text(yes.center(), Align2::CENTER_CENTER, LEAVE_CONFIRM, medium(16.0), Color32::WHITE);+ confirm |= yr.clicked();+ });+ if confirm || cancel {+ ctx.memory_mut(|m| m.surrender_focus(ok_id));+ self.update_confirm = false;+ } else {+ ctx.memory_mut(|m| m.request_focus(ok_id));+ }+ if confirm && crate::diagnostics::dev_var("RUSTCORD_DEV_VIEW").as_deref() == Ok("update-confirm") {+ self.toast("Update anyway (test): nothing restarted.", false);+ } else if confirm {+ log::info!("updater: leaving the call to restart into the new version");+ self.leave_voice();+ self.restart(ctx);+ }+ }+}diff --git a/apps/rustcord/src/updater.rs b/apps/rustcord/src/updater.rsnew file mode 100644index 0000000..c061a25--- /dev/null+++ b/apps/rustcord/src/updater.rs@@ -0,0 +1,326 @@+//! Automatic updates, for a RustCord installed with RustCordSetup on Windows.+//!+//! A minute after it starts, and every six hours after that, RustCord asks+//! GitHub for its latest release. A newer version's installer is downloaded,+//! checked against the SHA-256 published beside it and run silently: the new+//! version is in place for the next start (the running program is moved+//! aside, as `rustcord.old`), and the title bar shows Discord's green+//! "Update Ready!" button, which restarts into it.+//!+//! Whether it does this is one registry value, `HKCU\Software\RustCord\+//! AutoUpdate` (0 = off, missing = on), set on the installer's last page and+//! in Settings β About. "Check for Updates" there works either way. Copies+//! that weren't installed (development builds, the Linux and macOS builds)+//! never check.++use std::path::{Path, PathBuf};+use std::sync::mpsc::{Receiver, RecvTimeoutError, Sender};+use std::sync::{Arc, Mutex};+use std::time::{Duration, Instant};++/// The latest published (not draft, not pre-release) release.+const LATEST: &str = "https://api.github.com/repos/VRonGitHub/RustCord/releases/latest";+/// Where installers are downloaded from (nothing else is run).+const DOWNLOADS: &str = "https://github.com/VRonGitHub/RustCord/releases/download/";+pub const RELEASES_PAGE: &str = "https://github.com/VRonGitHub/RustCord/releases";+const FIRST_CHECK: Duration = Duration::from_secs(60);+const EVERY: Duration = Duration::from_secs(6 * 3600);+const EXE: &str = "rustcord.exe";+const UNINSTALLER: &str = "rustcord-uninstall.exe";++#[derive(Clone, PartialEq)]+pub enum Status {+ /// Not checked yet.+ Idle,+ Checking,+ /// Nothing newer, as of then.+ UpToDate(chrono::DateTime<chrono::Local>),+ Downloading { version: String, done: u64, total: u64 },+ Installing(String),+ /// Installed: RustCord starts as this version from now on.+ Ready(String),+ Failed(String),+}++impl Status {+ /// Checking, downloading or installing.+ pub fn busy(&self) -> bool {+ matches!(self, Self::Checking | Self::Downloading { .. } | Self::Installing(_))+ }+}++pub struct Updater {+ status: Arc<Mutex<Status>>,+ enabled: bool,+ check_now: Sender<()>,+ dir: PathBuf,+}++impl Updater {+ /// Start checking in the background, if this copy was installed (the+ /// uninstaller sits beside it). None otherwise.+ pub fn start(ctx: &eframe::egui::Context) -> Option<Self> {+ if !cfg!(windows) {+ return None;+ }+ // Dev aid (`RUSTCORD_DEV_UPDATE_FROM=<version>`): a development build+ // acts as the installed copy at that version, checking right away,+ // so an update can be tried from start to end (it goes to the real+ // install, in %LOCALAPPDATA%\Programs\RustCord).+ let pretend = crate::diagnostics::dev_var("RUSTCORD_DEV_UPDATE_FROM").ok();+ let dir = if pretend.is_some() {+ PathBuf::from(std::env::var_os("LOCALAPPDATA")?).join("Programs").join("RustCord")+ } else {+ let exe = std::env::current_exe().ok()?;+ if !exe.file_name().is_some_and(|n| n.eq_ignore_ascii_case(EXE)) {+ return None;+ }+ exe.parent()?.to_path_buf()+ };+ if !dir.join(UNINSTALLER).exists() {+ return None;+ }+ let first = if pretend.is_some() { Duration::from_secs(5) } else { FIRST_CHECK };+ let version = pretend.unwrap_or_else(|| env!("CARGO_PKG_VERSION").to_string());+ let status = Arc::new(Mutex::new(Status::Idle));+ let (check_now, wake) = std::sync::mpsc::channel();+ let (shared, ctx, folder) = (status.clone(), ctx.clone(), dir.clone());+ std::thread::Builder::new().name("updater".into()).spawn(move || run(&shared, &wake, &ctx, &folder, version, first)).ok()?;+ Some(Self { status, enabled: enabled(), check_now, dir })+ }++ pub fn status(&self) -> Status {+ self.status.lock().map(|s| s.clone()).unwrap_or(Status::Idle)+ }++ pub fn enabled(&self) -> bool {+ self.enabled+ }++ /// Turn automatic updates on or off (turning them on checks right away).+ pub fn set_enabled(&mut self, on: bool) {+ self.enabled = on;+ set_enabled(on);+ log::info!("updater: automatic updates turned {}", if on { "on" } else { "off" });+ if on && !self.status().busy() {+ let _ = self.check_now.send(());+ }+ }++ /// "Check for Updates": also installs what it finds, when updates are off.+ pub fn check_now(&self) {+ if !self.status().busy() {+ let _ = self.check_now.send(());+ }+ }++ /// The title bar's button: Some(true) when an update is ready, Some(false)+ /// while one is being fetched.+ pub fn title_bar_button(&self) -> Option<bool> {+ match self.status() {+ Status::Ready(_) => Some(true),+ Status::Downloading { .. } | Status::Installing(_) => Some(false),+ _ => None,+ }+ }++ /// The installed program (the new version, once one is ready).+ pub fn exe(&self) -> PathBuf {+ self.dir.join(EXE)+ }+}++/// The background thread: `installed` is the running version, and the first+/// check comes after `first`.+fn run(status: &Mutex<Status>, wake: &Receiver<()>, ctx: &eframe::egui::Context, dir: &Path, mut installed: String, first: Duration) {+ let set = |s: Status| {+ if let Ok(mut current) = status.lock() {+ *current = s;+ }+ ctx.request_repaint();+ };+ let Ok(runtime) = tokio::runtime::Builder::new_current_thread().enable_all().build() else { return };+ let Ok(client) = reqwest::Client::builder().timeout(Duration::from_secs(60)).user_agent("RustCord").build() else { return };+ // The program the last update moved aside (it was running then).+ let _ = std::fs::remove_file(dir.join("rustcord.old"));+ let mut next = Instant::now() + first;+ loop {+ let asked = match wake.recv_timeout(next.saturating_duration_since(Instant::now())) {+ Ok(()) => true,+ Err(RecvTimeoutError::Timeout) => false,+ Err(RecvTimeoutError::Disconnected) => return,+ };+ if !asked {+ next = Instant::now() + EVERY;+ if !enabled() {+ continue;+ }+ }+ let ready = status.lock().ok().and_then(|s| if let Status::Ready(v) = &*s { Some(v.clone()) } else { None });+ set(Status::Checking);+ match runtime.block_on(update(&client, dir, &installed, &set)) {+ Ok(Some(version)) => {+ log::info!("updater: RustCord {version} is installed and starts next time");+ installed = version.clone();+ set(Status::Ready(version));+ }+ // (An update that is ready stays ready.)+ Ok(None) => set(ready.map_or_else(|| Status::UpToDate(chrono::Local::now()), Status::Ready)),+ Err(e) => {+ log::warn!("updater: {e}");+ set(ready.map_or(Status::Failed(e), Status::Ready));+ }+ }+ }+}++/// Install the latest release if it is newer than `installed`: its version+/// when it was.+async fn update(client: &reqwest::Client, dir: &Path, installed: &str, set: &impl Fn(Status)) -> Result<Option<String>, String> {+ let offline = |e: reqwest::Error| format!("Couldn't reach GitHub ({e})");+ let release: serde_json::Value = client+ .get(LATEST)+ .header("Accept", "application/vnd.github+json")+ .send()+ .await+ .and_then(|r| r.error_for_status())+ .map_err(offline)?+ .json()+ .await+ .map_err(offline)?;+ let version = release["tag_name"].as_str().map(|t| t.trim_start_matches('v').to_string()).ok_or("GitHub's answer had no version in it")?;+ if !newer(&version, installed) {+ return Ok(None);+ }+ let name = format!("RustCordSetup-{version}.exe");+ let asset = |file: &str| {+ release["assets"].as_array().into_iter().flatten().find(|a| a["name"] == file).and_then(|a| Some((a["browser_download_url"].as_str()?.to_string(), a["size"].as_u64().unwrap_or(0))))+ };+ let (Some((url, size)), Some((sum_url, _))) = (asset(&name), asset(&format!("{name}.sha256"))) else {+ return Err(format!("RustCord {version} has no Windows installer yet"));+ };+ if !url.starts_with(DOWNLOADS) || !sum_url.starts_with(DOWNLOADS) {+ return Err(format!("RustCord {version}'s installer isn't on RustCord's release page"));+ }+ let failed = |e: reqwest::Error| format!("Couldn't download RustCord {version} ({e})");+ let sums = client.get(&sum_url).send().await.and_then(|r| r.error_for_status()).map_err(failed)?.text().await.map_err(failed)?;+ let expected = sums.split_whitespace().next().filter(|h| h.len() == 64).ok_or(format!("RustCord {version}'s checksum file is unreadable"))?.to_ascii_lowercase();++ log::info!("updater: downloading RustCord {version}");+ let file = std::env::temp_dir().join(&name);+ let mut response = client.get(&url).timeout(Duration::from_secs(30 * 60)).send().await.and_then(|r| r.error_for_status()).map_err(failed)?;+ let total = response.content_length().unwrap_or(size);+ let downloaded = async {+ use sha2::Digest;+ use std::io::Write;+ let mut out = std::fs::File::create(&file).map_err(|e| format!("Couldn't save the download ({e})"))?;+ let mut hash = sha2::Sha256::new();+ let mut done = 0u64;+ let mut shown = u64::MAX;+ while let Some(chunk) = response.chunk().await.map_err(failed)? {+ out.write_all(&chunk).map_err(|e| format!("Couldn't save the download ({e})"))?;+ hash.update(&chunk);+ done += chunk.len() as u64;+ // (The page shows whole percents: no repaint for less.)+ let percent = done * 100 / total.max(1);+ if percent != shown {+ shown = percent;+ set(Status::Downloading { version: version.clone(), done, total });+ }+ }+ out.flush().map_err(|e| format!("Couldn't save the download ({e})"))?;+ let got: String = hash.finalize().iter().map(|b| format!("{b:02x}")).collect();+ if got == expected {+ Ok(())+ } else {+ Err(format!("RustCord {version}'s download was damaged (its checksum doesn't match)"))+ }+ }+ .await;+ if let Err(e) = downloaded {+ let _ = std::fs::remove_file(&file);+ return Err(e);+ }++ // The installer's silent mode: it keeps the shortcuts and the settings,+ // and moves the running program aside instead of closing it.+ set(Status::Installing(version.clone()));+ log::info!("updater: installing RustCord {version}");+ let mut setup = std::process::Command::new(&file);+ setup.arg("/S").arg("--dir").arg(dir);+ #[cfg(windows)]+ {+ use std::os::windows::process::CommandExt;+ setup.creation_flags(0x0800_0000); // CREATE_NO_WINDOW+ }+ let result = setup.status();+ let _ = std::fs::remove_file(&file);+ match result {+ Ok(s) if s.success() => Ok(Some(version)),+ Ok(s) => Err(format!("RustCord {version}'s installer failed (exit code {})", s.code().unwrap_or(-1))),+ Err(e) => Err(format!("Couldn't start RustCord {version}'s installer ({e})")),+ }+}++/// Is version `a` newer than `b`? ("0.10.0" is newer than "0.9.2".)+fn newer(a: &str, b: &str) -> bool {+ let parts = |v: &str| v.split('.').map(|p| p.trim().parse::<u64>().unwrap_or(0)).collect::<Vec<_>>();+ let (mut a, mut b) = (parts(a), parts(b));+ let len = a.len().max(b.len());+ a.resize(len, 0);+ b.resize(len, 0);+ a > b+}++#[cfg(windows)]+fn registry_names() -> (Vec<u16>, Vec<u16>) {+ let wide = |s: &str| s.encode_utf16().chain(Some(0)).collect::<Vec<u16>>();+ (wide("Software\\RustCord"), wide("AutoUpdate"))+}++/// Automatic updates are on (the installer's choice, or Settings').+#[cfg(windows)]+fn enabled() -> bool {+ use windows_sys::Win32::System::Registry::{RegGetValueW, HKEY_CURRENT_USER, RRF_RT_REG_DWORD};+ let (key, name) = registry_names();+ let mut value = 1u32;+ let mut size = 4u32;+ // SAFETY: NUL-terminated names; a DWORD and its size in bytes.+ let read = unsafe { RegGetValueW(HKEY_CURRENT_USER, key.as_ptr(), name.as_ptr(), RRF_RT_REG_DWORD, std::ptr::null_mut(), (&mut value as *mut u32).cast(), &mut size) };+ read != 0 || value != 0+}++#[cfg(windows)]+fn set_enabled(on: bool) {+ use windows_sys::Win32::System::Registry::{RegSetKeyValueW, HKEY_CURRENT_USER, REG_DWORD};+ let (key, name) = registry_names();+ let value = u32::from(on);+ // SAFETY: NUL-terminated names; a DWORD and its size in bytes.+ let written = unsafe { RegSetKeyValueW(HKEY_CURRENT_USER, key.as_ptr(), name.as_ptr(), REG_DWORD, (&value as *const u32).cast(), 4) };+ if written != 0 {+ log::warn!("updater: couldn't save the setting (error {written})");+ }+}++#[cfg(not(windows))]+fn enabled() -> bool {+ false+}++#[cfg(not(windows))]+fn set_enabled(_on: bool) {}++#[cfg(test)]+mod tests {+ use super::newer;++ #[test]+ fn versions_compare_by_number() {+ assert!(newer("0.4.39", "0.4.38"));+ assert!(newer("0.10.0", "0.9.2"));+ assert!(newer("1.0", "0.99.99"));+ assert!(!newer("0.4.38", "0.4.38"));+ assert!(!newer("0.4.38", "0.4.39"));+ assert!(!newer("0.4", "0.4.0"));+ }+}diff --git a/apps/rustcord/src/voice_call.rs b/apps/rustcord/src/voice_call.rsindex ab876b8..951b1b5 100644--- a/apps/rustcord/src/voice_call.rs+++ b/apps/rustcord/src/voice_call.rs@@ -176,6 +176,9 @@ pub struct VoicePrefs {/// Input Profile β Custom's "Automatic Gain Control"; the other profiles decide it/// (on with Voice Isolation, off in Studio), as in Discord.pub automatic_gain_control: bool,+ /// Input Profile β Custom's "Echo Cancellation"; the other profiles decide it (on with+ /// Voice Isolation, off in Studio), as in Discord.+ pub echo_cancellation: bool,/// "Listen to Microphone": hear your own microphone while a call captures it.pub listen_to_mic: bool,/// Input sensitivity: the level (dBFS, -70 to 0) above which your microphone is sent.@@ -221,6 +224,7 @@ impl Default for VoicePrefs {output_volume: 100.0,voice_isolation: true,automatic_gain_control: true,+ echo_cancellation: true,listen_to_mic: false,input_sensitivity: voice::SPEAKING_THRESHOLD_DB,sounds: true,@@ -249,6 +253,7 @@ impl VoicePrefs {input_volume: self.input_volume / 100.0,output_volume: self.output_volume / 100.0,voice_isolation: self.voice_isolation,+ echo_cancellation: if self.custom_profile { self.echo_cancellation } else { self.voice_isolation },automatic_gain_control: if self.custom_profile { self.automatic_gain_control } else { self.voice_isolation },listen_to_mic: self.listen_to_mic,input_sensitivity_db: self.input_sensitivity,@@ -469,6 +474,23 @@ impl RustCord {self.calls.insert(channel, DmCall { ringing });}+ /// The DM header's video call button: the call, with the camera on once+ /// we're connected (Windows only, where RustCord has a camera).+ pub fn start_dm_video_call(&mut self, channel: Id) {+ let already_in = self.voice.as_ref().is_some_and(|v| v.channel == channel);+ self.start_dm_call(channel);+ if self.demo {+ return;+ }+ if already_in {+ if self.camera.on.is_none() && !self.camera.pending {+ self.toggle_camera();+ }+ } else {+ self.camera_when_connected = Some(channel);+ }+ }+/// The DM header's call button: start the call (Discord rings the others once our/// side is up), or join / show the one that's running.pub fn start_dm_call(&mut self, channel: Id) {@@ -549,6 +571,18 @@ impl RustCord {_ => self.ring_when_connected = None,}}+ if let Some(channel) = self.camera_when_connected {+ match self.voice.as_ref() {+ Some(v) if v.channel == channel && v.connected => {+ self.camera_when_connected = None;+ if self.camera.on.is_none() && !self.camera.pending {+ self.toggle_camera();+ }+ }+ Some(v) if v.channel == channel => {}+ _ => self.camera_when_connected = None,+ }+ }if let Some(answer) = self.api_take("call-check") {if let Some(channel) = self.call_check.take() {match answer {@@ -712,6 +746,7 @@ impl RustCord {pub fn leave_voice(&mut self) {self.ring_when_connected = None;+ self.camera_when_connected = None;self.end_streams();let Some(v) = self.voice.take() else { return };log::info!("voice: leaving channel {}", v.channel);@@ -1335,5 +1370,12 @@ mod tests {assert!(p.voice_isolation && p.input_device.is_none() && p.sounds);let a = p.audio();assert_eq!((a.input_volume, a.output_volume), (1.0, 1.5));+ // Echo Cancellation: on with Voice Isolation (the default), off in Studio, and+ // Custom's own switch.+ assert!(a.echo_cancellation);+ let studio = VoicePrefs { voice_isolation: false, ..p.clone() };+ assert!(!studio.audio().echo_cancellation);+ let custom = VoicePrefs { custom_profile: true, voice_isolation: false, echo_cancellation: true, ..p };+ assert!(custom.audio().echo_cancellation);}}diff --git a/apps/setup/src/lib.rs b/apps/setup/src/lib.rsindex a062347..56461ff 100644--- a/apps/setup/src/lib.rs+++ b/apps/setup/src/lib.rs@@ -16,7 +16,7 @@ use windows::Win32::System::Com::{CoCreateInstance, CoInitializeEx, CoTaskMemFreuse windows::Win32::System::Diagnostics::ToolHelp::{CreateToolhelp32Snapshot, Process32FirstW, Process32NextW, PROCESSENTRY32W, TH32CS_SNAPPROCESS};use windows::Win32::System::LibraryLoader::{GetModuleHandleW, SetDefaultDllDirectories, LOAD_LIBRARY_SEARCH_SYSTEM32};use windows::Win32::System::Registry::{- RegCloseKey, RegCreateKeyExW, RegDeleteTreeW, RegGetValueW, RegSetValueExW, HKEY, HKEY_CURRENT_USER, KEY_WRITE, REG_DWORD, REG_OPTION_NON_VOLATILE, REG_SZ, REG_VALUE_TYPE, RRF_RT_REG_SZ,+ RegCloseKey, RegCreateKeyExW, RegDeleteTreeW, RegGetValueW, RegSetValueExW, HKEY, HKEY_CURRENT_USER, KEY_WRITE, REG_DWORD, REG_OPTION_NON_VOLATILE, REG_SZ, REG_VALUE_TYPE, RRF_RT_REG_DWORD, RRF_RT_REG_SZ,};use windows::Win32::System::Threading::{OpenProcess, QueryFullProcessImageNameW, PROCESS_NAME_WIN32, PROCESS_QUERY_LIMITED_INFORMATION};use windows::Win32::UI::Controls::{@@ -35,6 +35,10 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION");pub const EXE: &str = "rustcord.exe";pub const UNINSTALLER: &str = "rustcord-uninstall.exe";const UNINSTALL_KEY: &str = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\RustCord";+/// What the installer and RustCord both read: `AutoUpdate` (a DWORD, 0 = off;+/// missing = on).+const SETTINGS_KEY: &str = "Software\\RustCord";+const AUTO_UPDATE: &str = "AutoUpdate";/// RustCord's Discord logins in Windows' Credential Manager: one per account,/// `discord-token:<id>.RustCord` (and `discord-token.RustCord` from single-/// login versions). Found by this prefix and suffix.@@ -53,6 +57,9 @@ pub struct Options {pub no_desktop: bool,/// `--no-launch`: don't offer to start RustCord afterwards.pub no_launch: bool,+ /// `--auto-update` / `--no-auto-update`: whether RustCord updates itself+ /// (a silent install otherwise keeps what was chosen before).+ pub auto_update: Option<bool>,/// Uninstaller: also delete settings, cache and the saved login.pub delete_data: bool,/// Uninstaller only: the copy in %TEMP% removing this folder.@@ -61,7 +68,7 @@ pub struct Options {impl Options {pub fn from_args() -> Self {- let mut o = Self { silent: false, dir: None, no_desktop: false, no_launch: false, delete_data: false, remove: None };+ let mut o = Self { silent: false, dir: None, no_desktop: false, no_launch: false, auto_update: None, delete_data: false, remove: None };let mut args = std::env::args().skip(1);while let Some(a) = args.next() {match a.to_ascii_lowercase().as_str() {@@ -69,6 +76,8 @@ impl Options {"--dir" => o.dir = args.next().map(|d| absolute(Path::new(&d))),"--no-desktop" => o.no_desktop = true,"--no-launch" => o.no_launch = true,+ "--auto-update" => o.auto_update = Some(true),+ "--no-auto-update" => o.auto_update = Some(false),"--delete-data" => o.delete_data = true,"--remove" => o.remove = args.next().map(PathBuf::from),_ => {}@@ -201,6 +210,34 @@ pub fn unregister_uninstaller() {}}+/// Whether RustCord keeps itself up to date (on unless turned off, in the+/// installer or in RustCord's Settings β About).+pub fn auto_update() -> bool {+ let mut value = 1u32;+ let mut bytes = 4u32;+ // SAFETY: a DWORD and its size in bytes.+ let read = unsafe {+ RegGetValueW(HKEY_CURRENT_USER, &HSTRING::from(SETTINGS_KEY), &HSTRING::from(AUTO_UPDATE), RRF_RT_REG_DWORD, None, Some((&mut value as *mut u32).cast()), Some(&mut bytes))+ };+ read.is_err() || value != 0+}++pub fn set_auto_update(on: bool) -> Result<(), String> {+ let mut key = HKEY::default();+ // SAFETY: creates (or opens) RustCord's own key under the user's hive.+ unsafe {+ RegCreateKeyExW(HKEY_CURRENT_USER, &HSTRING::from(SETTINGS_KEY), 0, PCWSTR::null(), REG_OPTION_NON_VOLATILE, KEY_WRITE, None, &mut key, None)+ .ok()+ .map_err(|e| e.to_string())?;+ }+ let result = set_value(key, AUTO_UPDATE, REG_DWORD, &u32::from(on).to_le_bytes());+ // SAFETY: the key opened above.+ unsafe {+ let _ = RegCloseKey(key);+ }+ result+}+/// A text value of the Installed apps entry, if RustCord is installed.fn registered(value: &str) -> Option<String> {let mut buf = [0u16; 1024];@@ -299,8 +336,8 @@ pub fn close_running(dir: &Path) -> bool {}/// Delete what RustCord saved for this user: settings and cache (the-/// `RustCord` folders under %APPDATA% and %LOCALAPPDATA%) and the Discord-/// login in Windows' Credential Manager.+/// `RustCord` folders under %APPDATA% and %LOCALAPPDATA%, and its registry+/// key) and the Discord login in Windows' Credential Manager.pub fn delete_user_data() {let root = |var: &str| std::env::var_os(var).map(PathBuf::from).filter(|p| p.is_absolute());let roaming = root("APPDATA");@@ -311,6 +348,10 @@ pub fn delete_user_data() {// somewhere else (a sandbox, a test), it isn't this run's to delete.if let (Some(roaming), Some(real)) = (roaming, known_folder(&FOLDERID_RoamingAppData)) {if same_path(&roaming, &real) {+ // SAFETY: removes only RustCord's own key.+ unsafe {+ let _ = RegDeleteTreeW(HKEY_CURRENT_USER, &HSTRING::from(SETTINGS_KEY));+ }for target in saved_logins() {// SAFETY: a valid, NUL-terminated name.unsafe {diff --git a/apps/setup/src/main.rs b/apps/setup/src/main.rsindex e1bba8a..6317011 100644--- a/apps/setup/src/main.rs+++ b/apps/setup/src/main.rs@@ -1,9 +1,10 @@//! RustCordSetup.exe: installs RustCord for the current user.//!//! Double-click it for a window that asks where to install and whether to add-//! a desktop shortcut, shows its progress and offers to start RustCord; or-//! run it from a script:+//! a desktop shortcut, shows its progress, asks whether RustCord should keep+//! itself up to date and offers to start it; or run it from a script://! RustCordSetup.exe /S [--dir <folder>] [--no-desktop] [--no-launch]+//! [--auto-update | --no-auto-update]//! Running it again over an existing install updates it. The window closes a//! running RustCord first; a silent update leaves it open, and the new//! version starts the next time RustCord does.@@ -141,6 +142,7 @@ mod setup {const BROWSE: i32 = 101;const FINISH: i32 = 102;const CLOSE: i32 = 103;+ const LAUNCH: i32 = 104;enum Stage {Asking,@@ -153,6 +155,8 @@ mod setup {dir: PathBuf,updating: bool,desktop: bool,+ /// RustCord updates itself (asked on the last page).+ auto_update: bool,/// Offer to start RustCord at the end.offer_launch: bool,stage: Stage,@@ -193,12 +197,9 @@ RustCord is open: it is closed first." };fn finished(&self) -> Page {let heading = format!("{APP} {VERSION} is installed");let text = if self.desktop { "You'll find it in the Start menu and on your desktop." } else { "You'll find it in the Start menu." };- let page = Page::new(Icon::App, heading, text).button(FINISH, "Finish");- if self.offer_launch {- page.checkbox(&format!("Start {APP} now"), true)- } else {- page- }+ let page = Page::new(Icon::App, heading, text);+ let page = if self.offer_launch { page.button(LAUNCH, &format!("Start {APP}")).button(FINISH, "Close") } else { page.button(FINISH, "Finish") };+ page.checkbox(&format!("Keep {APP} up to date automatically"), self.auto_update)}}@@ -243,8 +244,10 @@ RustCord is open: it is closed first." };}fn checkbox(&mut self, ticked: bool) {- if let Stage::Asking = self.stage {- self.desktop = ticked;+ match self.stage {+ Stage::Asking => self.desktop = ticked,+ Stage::Done => self.auto_update = ticked,+ _ => {}}}@@ -283,19 +286,26 @@ RustCord is open: it is closed first." };}std::process::exit(1);};- if opts.silent {- let installed = install(&dir, !opts.no_desktop, false, &Job::default());- std::process::exit(if installed.is_ok() { 0 } else { 1 });- }let updating = dir.join(EXE).exists();// An update doesn't bring back a desktop shortcut that was deleted.let desktop = !opts.no_desktop && (!updating || desktop_link().is_some_and(|l| l.exists()));- let mut wizard = Wizard { dir, updating, desktop, offer_launch: !opts.no_launch, stage: Stage::Asking };+ if opts.silent {+ // (RustCord's own updates come this way: what was chosen before is kept.)+ let installed = install(&dir, desktop, false, &Job::default());+ if let (Ok(()), Some(on)) = (&installed, opts.auto_update) {+ let _ = set_auto_update(on);+ }+ std::process::exit(if installed.is_ok() { 0 } else { 1 });+ }+ let auto_update = opts.auto_update.unwrap_or_else(auto_update);+ let mut wizard = Wizard { dir, updating, desktop, auto_update, offer_launch: !opts.no_launch, stage: Stage::Asking };let first = wizard.asking();- let (button, ticked) = run(first, &mut wizard);+ let (button, _) = run(first, &mut wizard);match wizard.stage {Stage::Done => {- if button == FINISH && wizard.offer_launch && ticked {+ // Saved before RustCord starts: it reads this as it opens.+ let _ = set_auto_update(wizard.auto_update);+ if button == LAUNCH {let _ = std::process::Command::new(wizard.dir.join(EXE)).current_dir(&wizard.dir).spawn();}}diff --git a/crates/discord/src/model.rs b/crates/discord/src/model.rsindex d35b323..5ae0c09 100644--- a/crates/discord/src/model.rs+++ b/crates/discord/src/model.rs@@ -1064,7 +1064,7 @@ pub struct Channel {/// not see, sent with its name blanked.#[serde(deserialize_with = "null_default")]pub flags: u32,- /// Threads: who started it.+ /// Threads: who started it. Group DMs: the group's owner.pub owner_id: Option<Id>,/// Threads: archived / locked.pub thread_metadata: Option<ThreadMetadata>,diff --git a/crates/vendor/egui_glow/src/painter.rs b/crates/vendor/egui_glow/src/painter.rsindex 1e62b05..92ccd87 100644--- a/crates/vendor/egui_glow/src/painter.rs+++ b/crates/vendor/egui_glow/src/painter.rs@@ -599,13 +599,9 @@ impl Painter {let data: Vec<u8> = {crate::profile_scope!("font -> sRGBA");- // RustCord: coverage gamma 0.45 instead of epaint's 0.55, so- // text has the weight Chrome gives Discord's (measured against- // the web client: same ink at the same colour).- image- .srgba_pixels(Some(0.45))- .flat_map(|a| a.to_array())- .collect()+ // RustCord: the atlas already holds each texel's opacity+ // (coverage gamma 0.45, see `FontImage::GAMMA`).+ image.pixels.iter().flat_map(|&a| [a, a, a, a]).collect()};if tex_id == egui::TextureId::default() && delta.pos.is_none() {diff --git a/crates/vendor/epaint/Cargo.toml b/crates/vendor/epaint/Cargo.tomlindex 57f5d26..f81bd1c 100644--- a/crates/vendor/epaint/Cargo.toml+++ b/crates/vendor/epaint/Cargo.toml@@ -57,6 +57,15 @@ version = "0.1.8"[dependencies.ttf-parser]version = "0.25"+# RustCord: shaping (HarfBuzz's rules, in Rust) for scripts whose letters+# join and change shape with their neighbours, such as Arabic.+[dependencies.rustybuzz]+version = "0.20"++# RustCord: the Unicode bidirectional algorithm, for right-to-left text.+[dependencies.unicode-bidi]+version = "0.3"+[dependencies.ahash]version = "0.8.11"features = [diff --git a/crates/vendor/epaint/src/image.rs b/crates/vendor/epaint/src/image.rsindex 454969d..9c60029 100644--- a/crates/vendor/epaint/src/image.rs+++ b/crates/vendor/epaint/src/image.rs@@ -264,26 +264,51 @@ impl std::fmt::Debug for ColorImage {/// Each value represents "coverage", i.e. how much a texel is covered by a character.////// This is roughly interpreted as the opacity of a white image.+///+/// RustCord: one byte per texel, holding the opacity the texture gets+/// (coverage shaped by [`Self::GAMMA`]) rather than the coverage as an `f32`.+/// The painter used to make exactly that byte while uploading, so text looks+/// the same, and the atlas takes a quarter of the memory (8192 texels wide, it+/// grows by 8 MB at a time instead of 32).#[derive(Clone, Default, PartialEq)]#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]pub struct FontImage {/// width, heightpub size: [usize; 2],- /// The coverage value.+ /// The opacity of each texel, from [`Self::opacity`].////// Often you want to use [`Self::srgba_pixels`] instead.- pub pixels: Vec<f32>,+ pub pixels: Vec<u8>,}impl FontImage {+ /// RustCord: coverage gamma 0.45 instead of epaint's 0.55, so text has+ /// the weight Chrome gives Discord's (measured against the web client:+ /// same ink at the same colour).+ pub const GAMMA: f32 = 0.45;+pub fn new(size: [usize; 2]) -> Self {Self {size,- pixels: vec![0.0; size[0] * size[1]],+ pixels: vec![0; size[0] * size[1]],}}+ /// The stored opacity for a coverage from 0 to 1.+ #[inline]+ pub fn opacity(coverage: f32) -> u8 {+ fast_round(coverage.powf(Self::GAMMA) * 255.0)+ }++ /// Set a texel's coverage (0 to 1).+ #[inline]+ pub fn set(&mut self, (x, y): (usize, usize), coverage: f32) {+ let [w, h] = self.size;+ assert!(x < w && y < h);+ self.pixels[y * w + x] = Self::opacity(coverage);+ }+#[inline]pub fn width(&self) -> usize {self.size[0]@@ -295,19 +320,10 @@ impl FontImage {}/// Returns the textures as `sRGBA` premultiplied pixels, row by row, top to bottom.- ///- /// `gamma` should normally be set to `None`.- ///- /// If you are having problems with text looking skinny and pixelated, try using a low gamma, e.g. `0.4`.#[inline]- pub fn srgba_pixels(&self, gamma: Option<f32>) -> impl ExactSizeIterator<Item = Color32> + '_ {- let gamma = gamma.unwrap_or(0.55); // TODO(emilk): this default coverage gamma is a magic constant, chosen by eye. I don't even know why we need it.- self.pixels.iter().map(move |coverage| {- let alpha = coverage.powf(gamma);- // We want to multiply with `vec4(alpha)` in the fragment shader:- let a = fast_round(alpha * 255.0);- Color32::from_rgba_premultiplied(a, a, a, a)- })+ pub fn srgba_pixels(&self) -> impl ExactSizeIterator<Item = Color32> + '_ {+ // We want to multiply with `vec4(alpha)` in the fragment shader:+ self.pixels.iter().map(|&a| Color32::from_rgba_premultiplied(a, a, a, a))}/// Clone a sub-region as a new image.@@ -328,26 +344,6 @@ impl FontImage {}}-impl std::ops::Index<(usize, usize)> for FontImage {- type Output = f32;-- #[inline]- fn index(&self, (x, y): (usize, usize)) -> &f32 {- let [w, h] = self.size;- assert!(x < w && y < h);- &self.pixels[y * w + x]- }-}--impl std::ops::IndexMut<(usize, usize)> for FontImage {- #[inline]- fn index_mut(&mut self, (x, y): (usize, usize)) -> &mut f32 {- let [w, h] = self.size;- assert!(x < w && y < h);- &mut self.pixels[y * w + x]- }-}-impl From<FontImage> for ImageData {#[inline(always)]fn from(image: FontImage) -> Self {diff --git a/crates/vendor/epaint/src/text/font.rs b/crates/vendor/epaint/src/text/font.rsindex 62de466..ed42b40 100644--- a/crates/vendor/epaint/src/text/font.rs+++ b/crates/vendor/epaint/src/text/font.rs@@ -67,12 +67,39 @@ impl Default for GlyphInfo {// ----------------------------------------------------------------------------+/// RustCord: empty texture columns around a glyph's image in the atlas: on+/// the left two for the layout's shift by a third of a pixel and two for the+/// shader's filter taps, on the right two for the filter.+const MARGIN_LEFT: usize = 4;+const MARGIN_RIGHT: usize = 2;++/// RustCord: one cluster of shaped text (see [`FontImpl::shape_run`]): the+/// characters that make one picture, such as an Arabic letter in the form+/// its neighbours give it, with its marks.+#[derive(Clone, Copy, Debug)]+pub(crate) struct ShapedCluster {+ /// Bytes of the text it stands for.+ pub byte_len: usize,++ /// Unit: points.+ pub advance_width: f32,++ /// The cluster's picture, placed from the pen as a glyph's is.+ pub uv_rect: UvRect,+}+/// A specific font with a size./// The interface uses points as the unit for everything.pub struct FontImpl {name: String,ab_glyph_font: ab_glyph::FontArc,+ /// Face index in the font file (non-zero within a `.ttc` collection).+ index: u32,++ /// RustCord: see [`crate::text::FontData::only`].+ only: Option<fn(char) -> bool>,+/// Maximum character height. RustCord: not rounded to whole pixels, so/// text is exactly as wide as a browser lays it out.scale_in_pixels: f32,@@ -100,6 +127,16 @@ pub struct FontImpl {ascent: f32,pixels_per_point: f32,glyph_info_cache: RwLock<ahash::HashMap<char, GlyphInfo>>, // TODO(emilk): standard Mutex++ /// RustCord: the shaper for this font's `'static` bytes (see+ /// `shape_run`), made on first use.+ shaper: std::sync::OnceLock<Option<rustybuzz::Face<'static>>>,++ /// RustCord: clusters already drawn into the atlas, by their glyphs and+ /// where those sit (in thirds of a pixel across), so a letter form that+ /// comes again reuses its picture.+ shaped_cache: RwLock<ahash::HashMap<Vec<(u16, i32, i32)>, UvRect>>,+atlas: Arc<Mutex<TextureAtlas>>,}@@ -109,6 +146,8 @@ impl FontImpl {pixels_per_point: f32,name: String,ab_glyph_font: ab_glyph::FontArc,+ index: u32,+ only: Option<fn(char) -> bool>,scale_in_pixels: f32,tweak: FontTweak,hinting: Option<(&'static [u8], u32, f32)>,@@ -154,6 +193,8 @@ impl FontImpl {Self {name,ab_glyph_font,+ index,+ only,scale_in_pixels,kern_cache: Default::default(),gray,@@ -164,6 +205,8 @@ impl FontImpl {ascent: ascent + baseline_offset,pixels_per_point,glyph_info_cache: Default::default(),+ shaper: std::sync::OnceLock::new(),+ shaped_cache: Default::default(),atlas,}}@@ -174,6 +217,10 @@ impl FontImpl {fn ignore_character(&self, chr: char) -> bool {use crate::text::FontDefinitions;+ if self.only.is_some_and(|only| !only(chr)) {+ return true;+ }+if !FontDefinitions::builtin_font_names().contains(&self.name.as_str()) {return false;}@@ -311,39 +358,23 @@ impl FontImpl {self.ascent}- /// RustCord: glyphs are rasterised three times as wide as they are drawn,- /// one atlas texel per LCD subpixel (the shader filters three texels into- /// each pixel's red, green and blue, or into one coverage for grayscale).- /// The image is aligned to whole pixels, with room on the left for the- /// layout to shift it by a third or two thirds of a pixel (it moves the- /// glyph's texture coordinates by one or two texels), so one image serves- /// every subpixel position.- fn allocate_glyph(&self, glyph_id: ab_glyph::GlyphId) -> GlyphInfo {- assert!(glyph_id.0 != 0);- use ab_glyph::{Font as _, ScaleFont};-- /// Empty texels left of the image: two for the shift, two for the- /// shader's filter taps.- const MARGIN_LEFT: usize = 4;- const MARGIN_RIGHT: usize = 2;-- let glyph = glyph_id.with_scale_and_position(- ab_glyph::PxScale {- x: self.scale_in_pixels * 3.0,- y: self.scale_in_pixels,- },- ab_glyph::Point { x: 0.0, y: 0.0 },- );-- // The glyph's coverage, three samples per pixel across: from the- // font's hinted outline when it has one (see `super::hinted`), else- // from the plain outline.- let raster = self- .hinted+ /// RustCord: a glyph's coverage, three samples per pixel across: from the+ /// font's hinted outline when it has one (see `super::hinted`), else from+ /// the plain outline.+ fn raster_glyph(&self, glyph_id: ab_glyph::GlyphId) -> Option<super::hinted::Raster> {+ use ab_glyph::Font as _;+ self.hinted.get_or_init(|| self.hinting.and_then(|(bytes, index, pixels_per_em)| super::hinted::Hinted::new(bytes, index, pixels_per_em))).as_ref().and_then(|h| h.raster(glyph_id.0, 3.0)).or_else(|| {+ let glyph = glyph_id.with_scale_and_position(+ ab_glyph::PxScale {+ x: self.scale_in_pixels * 3.0,+ y: self.scale_in_pixels,+ },+ ab_glyph::Point { x: 0.0, y: 0.0 },+ );let glyph = self.ab_glyph_font.outline_glyph(glyph)?;let bb = glyph.px_bounds();let (width, height) = (bb.width() as usize, bb.height() as usize);@@ -354,9 +385,21 @@ impl FontImpl {}});Some(super::hinted::Raster { min_x: bb.min.x as i32, min_y: bb.min.y as i32, width, height, coverage })- });+ })+ }- let uv_rect = raster.map(|raster| {+ /// RustCord: glyphs are rasterised three times as wide as they are drawn,+ /// one atlas texel per LCD subpixel (the shader filters three texels into+ /// each pixel's red, green and blue, or into one coverage for grayscale).+ /// The image is aligned to whole pixels, with room on the left for the+ /// layout to shift it by a third or two thirds of a pixel (it moves the+ /// glyph's texture coordinates by one or two texels), so one image serves+ /// every subpixel position.+ fn allocate_glyph(&self, glyph_id: ab_glyph::GlyphId) -> GlyphInfo {+ assert!(glyph_id.0 != 0);+ use ab_glyph::{Font as _, ScaleFont};++ let uv_rect = self.raster_glyph(glyph_id).map(|raster| {let sub_width = raster.width;let glyph_height = raster.height;if sub_width == 0 || glyph_height == 0 {@@ -383,7 +426,7 @@ impl FontImpl {for x in 0..sub_width {let v = raster.coverage[y * sub_width + x];if 0.0 < v {- image[(glyph_pos.0 + inset + x, glyph_pos.1 + y)] = v;+ image.set((glyph_pos.0 + inset + x, glyph_pos.1 + y), v);}}}@@ -419,6 +462,160 @@ impl FontImpl {uv_rect,}}++ /// RustCord: does this font draw `c`? Like [`Self::glyph_info`] without+ /// putting anything in the atlas.+ pub(crate) fn covers(&self, c: char) -> bool {+ use ab_glyph::Font as _;+ !self.ignore_character(c) && (invisible_char(c) || self.ab_glyph_font.glyph_id(c).0 != 0)+ }++ /// RustCord: shapes a run of text the way HarfBuzz does (its letters take+ /// the forms their neighbours call for, marks go on their letters) and+ /// draws each cluster as one picture. The clusters come in the text's+ /// order, whichever way the script runs; `None` if the font can't be+ /// read for shaping.+ pub(crate) fn shape_run(&self, text: &str) -> Option<Vec<ShapedCluster>> {+ use ab_glyph::Font as _;+ let shaper = self.shaper.get_or_init(|| self.hinting.and_then(|(bytes, index, _)| rustybuzz::Face::from_slice(bytes, index)));+ match shaper {+ Some(face) => Some(self.shape_with(face, text)),+ // A font whose bytes aren't `'static` is read for each run.+ None => rustybuzz::Face::from_slice(self.ab_glyph_font.font_data(), self.index).map(|face| self.shape_with(&face, text)),+ }+ }++ fn shape_with(&self, face: &rustybuzz::Face<'_>, text: &str) -> Vec<ShapedCluster> {+ use ab_glyph::Font as _;++ let mut buffer = rustybuzz::UnicodeBuffer::new();+ buffer.push_str(text);+ buffer.guess_segment_properties();+ let shaped = rustybuzz::shape(face, &[], buffer);++ // HarfBuzz works in font units; ab_glyph's scale is the font's+ // unscaled height in pixels, so divide by that rather than the em.+ let units_to_px = self.scale_in_pixels / self.ab_glyph_font.height_unscaled();++ /// A cluster as it comes out: glyphs (id, x from the cluster's left+ /// edge, y down from the baseline, in pixels) left to right.+ struct Cluster {+ start: usize,+ left: f32,+ right: f32,+ glyphs: Vec<(u16, f32, f32)>,+ }+ let mut clusters: Vec<Cluster> = Vec::new();+ let mut pen = 0.0_f32;+ for (info, position) in shaped.glyph_infos().iter().zip(shaped.glyph_positions()) {+ let start = info.cluster as usize;+ if clusters.last().map_or(true, |c| c.start != start) {+ clusters.push(Cluster { start, left: pen, right: pen, glyphs: Vec::new() });+ }+ let cluster = clusters.last_mut().unwrap();+ let x = pen + position.x_offset as f32 * units_to_px - cluster.left;+ // HarfBuzz counts y up, the screen down.+ let y = -(position.y_offset as f32) * units_to_px;+ cluster.glyphs.push((info.glyph_id as u16, x, y));+ pen += position.x_advance as f32 * units_to_px;+ cluster.right = pen;+ }+ // Right-to-left text comes out right to left: put it in text order.+ clusters.sort_by_key(|c| c.start);++ let mut out = Vec::with_capacity(clusters.len());+ let mut covered = 0;+ for (i, cluster) in clusters.iter().enumerate() {+ let end = clusters.get(i + 1).map_or(text.len(), |next| next.start);+ if covered < cluster.start {+ // Characters the shaper dropped keep their place, at no width.+ out.push(ShapedCluster { byte_len: cluster.start - covered, advance_width: 0.0, uv_rect: UvRect::default() });+ }+ out.push(ShapedCluster {+ byte_len: end - cluster.start,+ advance_width: (cluster.right - cluster.left) / self.pixels_per_point,+ uv_rect: self.allocate_cluster(&cluster.glyphs),+ });+ covered = end;+ }+ if covered < text.len() {+ out.push(ShapedCluster { byte_len: text.len() - covered, advance_width: 0.0, uv_rect: UvRect::default() });+ }+ out+ }++ /// RustCord: draws a cluster's glyphs, each where the shaper put it, into+ /// one atlas image (laid out as `allocate_glyph`'s, so the layout shifts+ /// it by thirds of a pixel the same way).+ fn allocate_cluster(&self, glyphs: &[(u16, f32, f32)]) -> UvRect {+ // Where each glyph sits, in thirds of a pixel across and pixels down.+ let placed: Vec<(u16, i32, i32)> =+ glyphs.iter().map(|&(id, x, y)| (id, (x * 3.0).round() as i32, y.round() as i32)).collect();+ if let Some(uv_rect) = self.shaped_cache.read().get(&placed) {+ return *uv_rect;+ }++ let rasters: Vec<(super::hinted::Raster, i32, i32)> = placed+ .iter()+ .filter(|&&(id, _, _)| id != 0)+ .filter_map(|&(id, dx, dy)| self.raster_glyph(ab_glyph::GlyphId(id)).map(|r| (r, dx, dy)))+ .filter(|(r, _, _)| r.width > 0 && r.height > 0)+ .collect();+ let sub_min = rasters.iter().map(|(r, dx, _)| r.min_x + dx).min();+ let sub_max = rasters.iter().map(|(r, dx, _)| r.min_x + dx + r.width as i32).max();+ let min_y = rasters.iter().map(|(r, _, dy)| r.min_y + dy).min();+ let max_y = rasters.iter().map(|(r, _, dy)| r.min_y + dy + r.height as i32).max();++ let uv_rect = match (sub_min, sub_max, min_y, max_y) {+ (Some(sub_min), Some(sub_max), Some(min_y), Some(max_y)) => {+ // As in `allocate_glyph`: whole pixels, with room for the+ // filter around the ink.+ let left = (sub_min - 2).div_euclid(3);+ let right = (sub_max + 4 + 2).div_euclid(3);+ let glyph_width = (right - left) as usize;+ let glyph_height = (max_y - min_y) as usize;+ let glyph_pos = {+ let atlas = &mut self.atlas.lock();+ let (pos, image) = atlas.allocate((MARGIN_LEFT + 3 * glyph_width + MARGIN_RIGHT, glyph_height));+ let glyph_pos = (pos.0 + MARGIN_LEFT, pos.1);+ // Overlapping strokes (a mark on its letter) cover as one+ // shape would: combined as coverage first, then stored.+ let sub_width = 3 * glyph_width;+ let mut coverage = vec![0.0_f32; sub_width * glyph_height];+ for (raster, dx, dy) in &rasters {+ let x0 = (raster.min_x + dx - 3 * left) as usize;+ let y0 = (raster.min_y + dy - min_y) as usize;+ for y in 0..raster.height {+ for x in 0..raster.width {+ let v = raster.coverage[y * raster.width + x];+ if 0.0 < v && x0 + x < sub_width {+ if let Some(c) = coverage.get_mut((y0 + y) * sub_width + x0 + x) {+ *c = 1.0 - (1.0 - *c) * (1.0 - v);+ }+ }+ }+ }+ }+ for (i, &c) in coverage.iter().enumerate() {+ if 0.0 < c {+ image.set((glyph_pos.0 + i % sub_width, glyph_pos.1 + i / sub_width), c);+ }+ }+ glyph_pos+ };+ UvRect {+ offset: vec2(left as f32, min_y as f32) / self.pixels_per_point + self.y_offset_in_points * Vec2::Y,+ size: vec2(glyph_width as f32, glyph_height as f32) / self.pixels_per_point,+ min: [glyph_pos.0 as u16, glyph_pos.1 as u16],+ max: [(glyph_pos.0 + 3 * glyph_width) as u16, (glyph_pos.1 + glyph_height) as u16],+ gray: self.gray,+ }+ }+ _ => UvRect::default(),+ };+ self.shaped_cache.write().insert(placed, uv_rect);+ uv_rect+ }}type FontIndex = usize;@@ -497,6 +694,12 @@ impl Font {self.glyph_info(crate::text::PASSWORD_REPLACEMENT_CHAR);}+ /// RustCord: the first font of the family that draws `c` (see+ /// [`FontImpl::covers`]).+ pub(crate) fn font_impl_for(&self, c: char) -> Option<&FontImpl> {+ self.fonts.iter().find(|font| font.covers(c)).map(|font| &**font)+ }+/// All supported characters, and in which font they are available in.pub fn characters(&mut self) -> &BTreeMap<char, Vec<String>> {self.characters.get_or_insert_with(|| {diff --git a/crates/vendor/epaint/src/text/fonts.rs b/crates/vendor/epaint/src/text/fonts.rsindex 40b8d5a..e6f2917 100644--- a/crates/vendor/epaint/src/text/fonts.rs+++ b/crates/vendor/epaint/src/text/fonts.rs@@ -108,7 +108,7 @@ impl std::fmt::Display for FontFamily {// ----------------------------------------------------------------------------/// A `.ttf` or `.otf` file and a font face index.-#[derive(Clone, Debug, PartialEq)]+#[derive(Clone, Debug)]#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]pub struct FontData {/// The content of a `.ttf` or `.otf` file.@@ -120,6 +120,12 @@ pub struct FontData {/// Extra scale and vertical tweak to apply to all text of this font.pub tweak: FontTweak,++ /// RustCord: when set, only the characters this accepts are taken from+ /// this font; the rest fall through to the next font of the family (a+ /// fallback for some scripts only).+ #[cfg_attr(feature = "serde", serde(skip))]+ pub only: Option<fn(char) -> bool>,}impl FontData {@@ -128,6 +134,7 @@ impl FontData {font: std::borrow::Cow::Borrowed(font),index: 0,tweak: Default::default(),+ only: None,}}@@ -136,12 +143,28 @@ impl FontData {font: std::borrow::Cow::Owned(font),index: 0,tweak: Default::default(),+ only: None,}}pub fn tweak(self, tweak: FontTweak) -> Self {Self { tweak, ..self }}++ /// RustCord: see [`Self::only`].+ pub fn only(self, only: fn(char) -> bool) -> Self {+ Self { only: Some(only), ..self }+ }+}++impl PartialEq for FontData {+ fn eq(&self, other: &Self) -> bool {+ // The filters by address: at worst equal fonts count as changed.+ self.font == other.font+ && self.index == other.index+ && self.tweak == other.tweak+ && self.only.map(|f| f as usize) == other.only.map(|f| f as usize)+ }}// ----------------------------------------------------------------------------@@ -741,7 +764,8 @@ impl GalleyCache {struct FontImplCache {atlas: Arc<Mutex<TextureAtlas>>,pixels_per_point: f32,- ab_glyph_fonts: BTreeMap<String, (FontTweak, ab_glyph::FontArc)>,+ /// The parsed fonts, with their tweak, face index and character filter.+ ab_glyph_fonts: BTreeMap<String, (FontTweak, ab_glyph::FontArc, u32, Option<fn(char) -> bool>)>,/// RustCord: the bytes (and face index) of fonts with `'static` data.static_fonts: BTreeMap<String, (&'static [u8], u32)>,@@ -759,9 +783,8 @@ impl FontImplCache {let ab_glyph_fonts = font_data.iter().map(|(name, font_data)| {- let tweak = font_data.tweak;let ab_glyph = ab_glyph_font_from_font_data(name, font_data);- (name.clone(), (tweak, ab_glyph))+ (name.clone(), (font_data.tweak, ab_glyph, font_data.index, font_data.only))}).collect();// RustCord: fonts compiled into the program can be hinted (their@@ -786,7 +809,7 @@ impl FontImplCache {pub fn font_impl(&mut self, scale_in_points: f32, font_name: &str) -> Arc<FontImpl> {use ab_glyph::Font as _;- let (tweak, ab_glyph_font) = self+ let (tweak, ab_glyph_font, index, only) = self.ab_glyph_fonts.get(font_name).unwrap_or_else(|| panic!("No font data found for {font_name:?}"))@@ -815,6 +838,8 @@ impl FontImplCache {self.pixels_per_point,font_name.to_owned(),ab_glyph_font,+ index,+ only,scale_in_pixels,tweak,hinting,diff --git a/crates/vendor/epaint/src/text/text_layout.rs b/crates/vendor/epaint/src/text/text_layout.rsindex 8c9483b..1e73c90 100644--- a/crates/vendor/epaint/src/text/text_layout.rs+++ b/crates/vendor/epaint/src/text/text_layout.rs@@ -3,7 +3,11 @@ use std::sync::Arc;use emath::{pos2, vec2, Align, NumExt, Pos2, Rect, Vec2};-use crate::{stroke::PathStroke, text::font::Font, Color32, Mesh, Stroke, Vertex};+use crate::{+ stroke::PathStroke,+ text::font::{Font, UvRect},+ Color32, Mesh, Stroke, Vertex,+};use super::{FontsImpl, Galley, Glyph, LayoutJob, LayoutSection, Row, RowVisuals};@@ -90,6 +94,9 @@ pub fn layout(fonts: &mut FontsImpl, job: Arc<LayoutJob>) -> Galley {for (section_index, section) in job.sections.iter().enumerate() {layout_section(fonts, &job, section_index as u32, section, &mut paragraphs);}+ for paragraph in &mut paragraphs {+ resolve_bidi_levels(paragraph);+ }let point_scale = PointScale::new(fonts.pixels_per_point());@@ -103,6 +110,9 @@ pub fn layout(fonts: &mut FontsImpl, job: Arc<LayoutJob>) -> Galley {}}}+ for row in &mut rows {+ reorder_bidi_row(point_scale, row);+ }let justify = job.justify && job.wrap.max_width.is_finite();@@ -166,8 +176,20 @@ fn layout_section(let emoji_chars: Vec<char> = if emoji { section_text.chars().collect() } else { Vec::new() };// Characters left of the sequence being skipped.let mut emoji_rest = 0usize;+ // RustCord: where the shaped run being skipped ends.+ let mut shaped_end = 0;- for (chr_index, chr) in section_text.chars().enumerate() {+ for (chr_index, (byte, chr)) in section_text.char_indices().enumerate() {+ if byte < shaped_end {+ continue; // laid out with its run+ }+ if emoji_rest == 0 && starts_shaped_run(chr) {+ if let Some(end) = layout_shaped_run(font, section_text, byte, paragraph, line_height, section_index) {+ shaped_end = end;+ last_glyph_id = None;+ continue;+ }+ }if job.break_on_newline && chr == '\n' {emoji_rest = 0;out_paragraphs.push(Paragraph::from_section_index(section_index));@@ -193,6 +215,8 @@ fn layout_section(font_ascent: font.ascent(),uv_rect: Default::default(),section_index,+ bidi_level: 0,+ unsnapped: false,});paragraph.cursor_x += advance_width;last_glyph_id = None;@@ -205,22 +229,8 @@ fn layout_section(}}- // RustCord: subpixel positioning. The glyph sits on the whole pixel- // left of the pen, shifted right by the nearest third of a pixel- // of the remainder: glyph images have a texel per LCD subpixel- // (see `FontImpl::allocate_glyph`), so that is one or two texels.- let x_pixels = paragraph.cursor_x * pixels_per_point;- let mut x_whole = x_pixels.floor();- let mut third = ((x_pixels - x_whole) * 3.0).round() as u16;- if third >= 3 {- third = 0;- x_whole += 1.0;- }let mut uv_rect = glyph_info.uv_rect;- if third != 0 && !uv_rect.is_nothing() && uv_rect.min[0] >= third {- uv_rect.min[0] -= third;- uv_rect.max[0] -= third;- }+ let x_whole = place_on_pixel_grid(paragraph.cursor_x * pixels_per_point, &mut uv_rect);paragraph.glyphs.push(Glyph {chr,@@ -233,6 +243,8 @@ fn layout_section(font_ascent: font.ascent(),uv_rect,section_index,+ bidi_level: 0,+ unsnapped: false,});// RustCord: the pen keeps its fractional position (each glyph is@@ -244,6 +256,149 @@ fn layout_section(}}+/// RustCord: subpixel positioning. A glyph sits on the whole pixel left of+/// the pen (`x_pixels`), shifted right by the nearest third of a pixel of the+/// remainder: glyph images have a texel per LCD subpixel (see+/// `FontImpl::allocate_glyph`), so that is one or two texels. Returns the+/// whole pixel.+fn place_on_pixel_grid(x_pixels: f32, uv_rect: &mut UvRect) -> f32 {+ let mut x_whole = x_pixels.floor();+ let mut third = ((x_pixels - x_whole) * 3.0).round() as u16;+ if third >= 3 {+ third = 0;+ x_whole += 1.0;+ }+ if third != 0 && !uv_rect.is_nothing() && uv_rect.min[0] >= third {+ uv_rect.min[0] -= third;+ uv_rect.max[0] -= third;+ }+ x_whole+}++/// RustCord: a letter of a script whose letters join (bidi class AL: Arabic,+/// Syriac, Thaana, N'Ko), which starts a run laid out by+/// [`layout_shaped_run`].+fn starts_shaped_run(c: char) -> bool {+ c >= '\u{600}' && unicode_bidi::bidi_class(c) == unicode_bidi::BidiClass::AL+}++/// RustCord: what a shaped run goes on with: more such letters, the marks on+/// them and the joiners between them.+fn continues_shaped_run(c: char) -> bool {+ use unicode_bidi::BidiClass::{AL, NSM};+ matches!(c, '\u{200C}' | '\u{200D}') || matches!(unicode_bidi::bidi_class(c), AL | NSM)+}++/// RustCord: lays out a run of joining letters from `start` as a whole+/// (laid out a character at a time they would all take their standalone+/// forms): shaped (see `FontImpl::shape_run`), one glyph per character in the+/// text's order, the first of each cluster carrying its picture and width and+/// the rest none. They are placed on the pixel grid by [`reorder_bidi_row`].+/// Returns where the run ends, or `None` when no font draws its first letter.+fn layout_shaped_run(+ font: &Font,+ text: &str,+ start: usize,+ paragraph: &mut Paragraph,+ line_height: f32,+ section_index: u32,+) -> Option<usize> {+ let font_impl = font.font_impl_for(text[start..].chars().next()?)?;+ // As far as this font draws it.+ let end = text[start..]+ .char_indices()+ .find(|&(_, c)| !(continues_shaped_run(c) && font_impl.covers(c)))+ .map_or(text.len(), |(i, _)| start + i);+ let clusters = font_impl.shape_run(&text[start..end])?;++ let mut byte = start;+ for cluster in clusters {+ let cluster_end = (byte + cluster.byte_len).min(end);+ for (i, chr) in text[byte..cluster_end].chars().enumerate() {+ let first = i == 0;+ paragraph.glyphs.push(Glyph {+ chr,+ pos: pos2(paragraph.cursor_x, f32::NAN),+ advance_width: if first { cluster.advance_width } else { 0.0 },+ line_height,+ font_impl_height: font_impl.row_height(),+ font_impl_ascent: font_impl.ascent(),+ font_height: font.row_height(),+ font_ascent: font.ascent(),+ uv_rect: if first { cluster.uv_rect } else { UvRect::default() },+ section_index,+ bidi_level: 0,+ unsnapped: true,+ });+ }+ paragraph.cursor_x += cluster.advance_width;+ byte = cluster_end;+ }+ Some(end)+}++/// RustCord: the Unicode bidirectional algorithm over a paragraph that has+/// right-to-left text, with a left-to-right base direction as Discord's+/// messages have (no `dir`): each glyph gets its level, for+/// [`reorder_bidi_row`]. Other paragraphs keep level 0 and cost one compare+/// per character.+fn resolve_bidi_levels(paragraph: &mut Paragraph) {+ use unicode_bidi::BidiClass::{AL, R, RLE, RLI, RLO};+ let rtl = |c: char| c >= '\u{590}' && matches!(unicode_bidi::bidi_class(c), R | AL | RLE | RLO | RLI);+ if !paragraph.glyphs.iter().any(|g| rtl(g.chr)) {+ return;+ }+ let text: String = paragraph.glyphs.iter().map(|g| g.chr).collect();+ let info = unicode_bidi::BidiInfo::new(&text, Some(unicode_bidi::Level::ltr()));+ for (glyph, (byte, _)) in paragraph.glyphs.iter_mut().zip(text.char_indices()) {+ glyph.bidi_level = info.levels[byte].number();+ }+}++/// RustCord: puts a row with right-to-left text in visual order (rules L1+/// and L2 of the bidirectional algorithm). Only positions change: the glyphs+/// stay in the text's order, for the cursor and selection. A left-to-right+/// stretch keeps its spacing (kerning) and moves by whole pixels; other+/// glyphs go one after another, shaped clusters to the nearest third of a+/// pixel so joined letters meet.+fn reorder_bidi_row(point_scale: PointScale, row: &mut Row) {+ if !row.glyphs.iter().any(Glyph::is_rtl) {+ return;+ }+ // L1: whitespace that ends the row takes the paragraph's level.+ for glyph in row.glyphs.iter_mut().rev().take_while(|g| g.chr.is_whitespace()) {+ glyph.bidi_level = 0;+ }+ let levels: Vec<unicode_bidi::Level> = row+ .glyphs+ .iter()+ .map(|g| unicode_bidi::Level::new(g.bidi_level).unwrap_or_else(|_| unicode_bidi::Level::ltr()))+ .collect();+ let order = unicode_bidi::BidiInfo::reorder_visual(&levels);+ let logical_x: Vec<f32> = row.glyphs.iter().map(|g| g.pos.x).collect();+ let pixels_per_point = point_scale.pixels_per_point();++ let mut pen = row.rect.min.x;+ for (k, &i) in order.iter().enumerate() {+ let glyph = &mut row.glyphs[i];+ // The room it takes: up to the next glyph when that comes next in+ // the text too, else its advance.+ let width = if !glyph.is_rtl() && order.get(k + 1) == Some(&(i + 1)) {+ logical_x[i + 1] - logical_x[i]+ } else {+ glyph.advance_width+ };+ if glyph.unsnapped {+ glyph.pos.x = place_on_pixel_grid(pen * pixels_per_point, &mut glyph.uv_rect) / pixels_per_point;+ glyph.unsnapped = false;+ } else {+ glyph.pos.x = point_scale.round_to_pixel(pen);+ }+ pen += width;+ }+ row.rect.max.x = row.glyphs.iter().map(Glyph::max_x).fold(row.rect.min.x, f32::max);+}+/// We ignore y at this stagefn rect_from_x_range(x_range: RangeInclusive<f32>) -> Rect {Rect::from_x_y_ranges(x_range, 0.0..=0.0)@@ -459,6 +614,8 @@ fn replace_last_glyph_with_overflow_character(font_ascent: font.ascent(),uv_rect: replacement_glyph_info.uv_rect,section_index,+ bidi_level: 0,+ unsnapped: false,});} else {let section_index = row.section_index_at_start;@@ -481,6 +638,8 @@ fn replace_last_glyph_with_overflow_character(font_ascent: font.ascent(),uv_rect: replacement_glyph_info.uv_rect,section_index,+ bidi_level: 0,+ unsnapped: false,});}@@ -587,8 +746,21 @@ fn halign_and_justify_row(let num_glyphs_in_range = glyph_range.1 - glyph_range.0;assert!(num_glyphs_in_range > 0);- let original_min_x = row.glyphs[glyph_range.0].logical_rect().min.x;- let original_max_x = row.glyphs[glyph_range.1 - 1].logical_rect().max.x;+ // RustCord: with right-to-left text the row's first and last characters+ // needn't be at its ends (and it isn't justified).+ let bidi = row.glyphs.iter().any(Glyph::is_rtl);+ let justify = justify && !bidi;+ let (original_min_x, original_max_x) = if bidi {+ row.glyphs[glyph_range.0..glyph_range.1]+ .iter()+ .map(Glyph::logical_rect)+ .fold((f32::INFINITY, f32::NEG_INFINITY), |(min, max), r| (min.min(r.min.x), max.max(r.max.x)))+ } else {+ (+ row.glyphs[glyph_range.0].logical_rect().min.x,+ row.glyphs[glyph_range.1 - 1].logical_rect().max.x,+ )+ };let original_width = original_max_x - original_min_x;let target_width = if justify && num_glyphs_in_range > 1 {@@ -765,8 +937,23 @@ fn tessellate_row(mesh.reserve_triangles(row.glyphs.len() * 2);mesh.reserve_vertices(row.glyphs.len() * 4);+ // RustCord: backgrounds and lines go across the row in visual order.+ let visual;+ let glyphs = if (format_summary.any_background || format_summary.any_underline || format_summary.any_strikethrough)+ && row.glyphs.iter().any(Glyph::is_rtl)+ {+ visual = {+ let mut glyphs = row.glyphs.clone();+ glyphs.sort_by(|a, b| a.pos.x.total_cmp(&b.pos.x).then(a.max_x().total_cmp(&b.max_x())));+ glyphs+ };+ &visual+ } else {+ &row.glyphs+ };+if format_summary.any_background {- add_row_backgrounds(job, row, &mut mesh);+ add_row_backgrounds(job, glyphs, &mut mesh);}let glyph_index_start = mesh.indices.len();@@ -775,7 +962,7 @@ fn tessellate_row(let glyph_vertex_end = mesh.vertices.len();if format_summary.any_underline {- add_row_hline(point_scale, row, &mut mesh, |glyph| {+ add_row_hline(point_scale, glyphs, &mut mesh, |glyph| {let format = &job.sections[glyph.section_index as usize].format;let stroke = format.underline;// RustCord: just under the baseline, on whole pixels, where a@@ -788,7 +975,7 @@ fn tessellate_row(}if format_summary.any_strikethrough {- add_row_hline(point_scale, row, &mut mesh, |glyph| {+ add_row_hline(point_scale, glyphs, &mut mesh, |glyph| {let format = &job.sections[glyph.section_index as usize].format;let stroke = format.strikethrough;let y = glyph.logical_rect().center().y;@@ -808,8 +995,8 @@ fn tessellate_row(/// Create background for glyphs that have them./// Creates as few rectangular regions as possible.-fn add_row_backgrounds(job: &LayoutJob, row: &Row, mesh: &mut Mesh) {- if row.glyphs.is_empty() {+fn add_row_backgrounds(job: &LayoutJob, glyphs: &[Glyph], mesh: &mut Mesh) {+ if glyphs.is_empty() {return;}@@ -824,7 +1011,7 @@ fn add_row_backgrounds(job: &LayoutJob, row: &Row, mesh: &mut Mesh) {let mut run_start = None;let mut last_rect = Rect::NAN;- for glyph in &row.glyphs {+ for glyph in glyphs {let format = &job.sections[glyph.section_index as usize].format;let color = format.background;let rect = glyph.logical_rect();@@ -909,7 +1096,7 @@ fn tessellate_glyphs(point_scale: PointScale, job: &LayoutJob, row: &Row, mesh:/// Add a horizontal line over a row of glyphs with a stroke and y decided by a callback.fn add_row_hline(point_scale: PointScale,- row: &Row,+ glyphs: &[Glyph],mesh: &mut Mesh,stroke_and_y: impl Fn(&Glyph) -> (Stroke, f32),) {@@ -922,7 +1109,7 @@ fn add_row_hline(let mut line_start = None;let mut last_right_x = f32::NAN;- for glyph in &row.glyphs {+ for glyph in glyphs {let (stroke, y) = stroke_and_y(glyph);if stroke == Stroke::NONE {diff --git a/crates/vendor/epaint/src/text/text_layout_types.rs b/crates/vendor/epaint/src/text/text_layout_types.rsindex 17826e6..9f2f0d4 100644--- a/crates/vendor/epaint/src/text/text_layout_types.rs+++ b/crates/vendor/epaint/src/text/text_layout_types.rs@@ -634,9 +634,24 @@ pub struct Glyph {/// Index into [`LayoutJob::sections`]. Decides color etc.pub section_index: u32,++ /// RustCord: the Unicode bidirectional level. Odd levels run right to+ /// left: the character then starts at its glyph's right edge.+ pub bidi_level: u8,++ /// RustCord: part of a shaped cluster that isn't placed on the pixel grid+ /// yet (that happens once its row is in visual order): `pos.x` is still the+ /// exact pen position and `uv_rect` isn't shifted to it.+ pub(crate) unsnapped: bool,}impl Glyph {+ /// RustCord: laid out right to left (see [`Self::bidi_level`]).+ #[inline]+ pub fn is_rtl(&self) -> bool {+ self.bidi_level % 2 == 1+ }+#[inline]pub fn size(&self) -> Vec2 {Vec2::new(self.advance_width, self.line_height)@@ -692,6 +707,9 @@ impl Row {/// Closest char at the desired x coordinate./// Returns something in the range `[0, char_count_excluding_newline()]`.pub fn char_at(&self, desired_x: f32) -> usize {+ if self.glyphs.iter().any(Glyph::is_rtl) {+ return self.char_at_bidi(desired_x);+ }for (i, glyph) in self.glyphs.iter().enumerate() {if desired_x < glyph.logical_rect().center().x {return i;@@ -700,11 +718,42 @@ impl Row {self.char_count_excluding_newline()}- pub fn x_offset(&self, column: usize) -> f32 {- if let Some(glyph) = self.glyphs.get(column) {- glyph.pos.x+ /// RustCord: [`Self::char_at`] for a row with right-to-left text, where+ /// the characters aren't in order across: the glyph nearest `desired_x`,+ /// then the side of it the cursor goes (the start of a right-to-left+ /// character is on its right).+ fn char_at_bidi(&self, desired_x: f32) -> usize {+ let nearest = self+ .glyphs+ .iter()+ .enumerate()+ .filter(|(_, g)| 0.0 < g.advance_width)+ .map(|(i, g)| (i, (g.pos.x - desired_x).max(desired_x - g.max_x()).max(0.0)))+ .min_by(|a, b| a.1.total_cmp(&b.1));+ let Some((i, _)) = nearest else { return 0 };+ let glyph = &self.glyphs[i];+ if (desired_x < glyph.logical_rect().center().x) != glyph.is_rtl() {+ i} else {- self.rect.right()+ // After the glyph, and after the rest of its cluster (no width).+ let mut end = i + 1;+ while self.glyphs.get(end).is_some_and(|g| g.advance_width == 0.0) {+ end += 1;+ }+ end+ }+ }++ pub fn x_offset(&self, column: usize) -> f32 {+ // RustCord: a right-to-left character starts at its right edge, and a+ // row ending in one ends at that character's left edge.+ match self.glyphs.get(column) {+ Some(glyph) if glyph.is_rtl() => glyph.max_x(),+ Some(glyph) => glyph.pos.x,+ None => match self.glyphs.last() {+ Some(last) if last.is_rtl() => last.pos.x,+ _ => self.rect.right(),+ },}}}diff --git a/crates/vendor/epaint/src/texture_atlas.rs b/crates/vendor/epaint/src/texture_atlas.rsindex 8d05a1f..3d3b195 100644--- a/crates/vendor/epaint/src/texture_atlas.rs+++ b/crates/vendor/epaint/src/texture_atlas.rs@@ -89,7 +89,7 @@ impl TextureAtlas {// Make the top left pixel fully white for `WHITE_UV`, i.e. painting something with solid color:let (pos, image) = atlas.allocate((1, 1));assert_eq!(pos, (0, 0));- image[pos] = 1.0;+ image.set(pos, 1.0);// Allocate a series of anti-aliased discs used to render small filled circles:// TODO(emilk): these circles can be packed A LOT better.@@ -111,8 +111,7 @@ impl TextureAtlas {let distance_to_center = ((dx * dx + dy * dy) as f32).sqrt();let coverage =remap_clamp(distance_to_center, (r - 0.5)..=(r + 0.5), 1.0..=0.0);- image[((x as i32 + hw + dx) as usize, (y as i32 + hw + dy) as usize)] =- coverage;+ image.set(((x as i32 + hw + dx) as usize, (y as i32 + hw + dy) as usize), coverage);}}atlas.discs.push(PrerasterizedDisc {@@ -266,7 +265,7 @@ fn resize_to_min_height(image: &mut FontImage, required_height: usize) -> bool {}if image.width() * image.height() > image.pixels.len() {- image.pixels.resize(image.width() * image.height(), 0.0);+ image.pixels.resize(image.width() * image.height(), 0);true} else {falsediff --git a/crates/voice/Cargo.toml b/crates/voice/Cargo.tomlindex 3daaf87..a16e2e9 100644--- a/crates/voice/Cargo.toml+++ b/crates/voice/Cargo.toml@@ -37,6 +37,9 @@ cpal = { version = "=0.18.2", default-features = false }# RustCord: "Voice Isolation" noise suppression (pure-Rust RNNoise port, BSD-3-Clause).# No default features: those build its command-line tool.nnnoiseless = { version = "=0.5.2", default-features = false }+# RustCord: "Echo Cancellation" (WebRTC's AEC3 as a pure-Rust port, BSD-3-Clause); no C+++# or build script.+sonora = "=0.3.0"# Go Live: H.264 decoding of watched streams where Media Foundation is unavailable, and# the encoder fallback when Media Foundation has no hardware H.264 encoder. Built from the# bundled Cisco sources.diff --git a/crates/voice/NOTICE.md b/crates/voice/NOTICE.mdindex 7a305d4..b44a41a 100644--- a/crates/voice/NOTICE.md+++ b/crates/voice/NOTICE.md@@ -39,7 +39,7 @@ Every adapted file keeps an attribution header naming its source.| `src/capture.rs` | `crates/discord-voice/src/capture.rs` | Unchanged apart from the header || `src/timer.rs` | `crates/discord-voice/src/timer.rs` | Unchanged apart from the header || `src/test_mls.rs` | `crates/discord-voice/src/test_mls.rs` | Unchanged apart from the header (test-only) |-| `src/audio.rs` | `crates/discord-voice/src/audio.rs`, `crates/platform/src/audio.rs` | System default devices (followed when they change) or the devices chosen in settings; microphone/speaker volume, RNNoise noise suppression ("Voice Isolation", via nnnoiseless) and a loopback mic test; no echo cancellation or preview; fixed -55 dBFS send gate |+| `src/audio.rs` | `crates/discord-voice/src/audio.rs`, `crates/platform/src/audio.rs` | System default devices (followed when they change) or the devices chosen in settings; microphone/speaker volume, RNNoise noise suppression ("Voice Isolation", via nnnoiseless), echo cancellation fed with what the speaker callback played (`echo.rs`) and a loopback mic test; no preview; fixed -55 dBFS send gate || `src/lib.rs` | Call glue in `apps/desktop/src/voice.rs` (`start_media`, status handling), `screen.rs`, `watch.rs` and `crates/discord-voice/src/lib.rs` | Public API (`VoiceHandle`, `VoiceConfig`, `VoiceEvent`; Go Live: `StreamConfig`, `StreamHandle`, `WatchHandle`, `StreamEvent`, `ScreenSource`, `StreamQuality`, `VideoFrame`, `StreamStats`, `screen_sources`, `screen_thumbnail`); events are serialized so `Disconnected` is always last || `vendor/davey/` | `vendor/davey/` | Serein's patch of davey 0.1.4 (see `vendor/davey/SEREIN-PATCH.md`) || `vendor/hpke-rs/` | `vendor/hpke-rs/` | Serein's security backport of hpke-rs 0.6.1 (see `vendor/hpke-rs/SEREIN-PATCH.md`); CI files dropped |@@ -47,7 +47,7 @@ Every adapted file keeps an attribution header naming its source.RustCord's own, under the crate's MIT OR Apache-2.0 terms: `src/settings.rs` (audiopreferences, device list, mic test), `src/stream_mix.rs` (watched-stream audio in the callmix), `src/stats.rs` (Go Live statistics), `src/health.rs` (call health counters),-`src/agc.rs` (microphone gain), `src/mic.rs` (microphone resampling), `src/ogg_opus.rs`+`src/agc.rs` (microphone gain), `src/echo.rs` (echo cancellation), `src/mic.rs` (microphone resampling), `src/ogg_opus.rs`(soundboard decoding), `src/screen/camera_windows.rs` (camera capture) and`src/screen/cursor_windows.rs` (the pointer in captured frames).@@ -119,6 +119,7 @@ Direct dependencies (versions pinned to Serein's lockfile):| rtrb | 0.4.0 | MIT OR Apache-2.0 || cpal | 0.18.2 | Apache-2.0 || nnnoiseless (RustCord addition: Voice Isolation) | 0.5.2 | BSD-3-Clause (RNNoise: Joe Neeman, Mozilla, Jean-Marc Valin, Xiph.Org Foundation, Mark Borgerding); its FFT crates easyfft, rustfft, realfft, num-complex, transpose, strength_reduce, primal-check, generic_singleton, array-init are MIT OR Apache-2.0 / MIT, anymap3 BlueOak-1.0.0 OR MIT OR Apache-2.0 |+| sonora (RustCord addition: Echo Cancellation) | 0.3.0 | BSD-3-Clause (WebRTC's audio processing ported to Rust: The WebRTC Project Authors, Arun Raghavan and contributors, dignifiedquire; notice in the root `THIRD_PARTY_NOTICES.md`); with its crates sonora-aec3, sonora-agc2, sonora-ns, sonora-common-audio, sonora-fft and sonora-simd 0.3.0 (BSD-3-Clause); its helpers derive_more 2 (MIT), bytemuck 1 (Zlib OR Apache-2.0 OR MIT) and cpufeatures 0.3 (MIT OR Apache-2.0) were already in the graph || windows (Windows only) | 0.61.3 | MIT OR Apache-2.0 || windows-core, windows-future (Windows only) | 0.61.2, 0.2.1 | MIT OR Apache-2.0 || openh264 (Go Live decoding and encoder fallback, as in Serein) | 0.9.8 | BSD-2-Clause (Ralf Biedert); openh264-sys2 0.9.8 compiles Cisco's bundled OpenH264 sources, BSD-2-Clause (Copyright (c) 2013, Cisco Systems); its SIMD helpers wide 1.7.1 and safe_arch 1.2.0 are Zlib OR Apache-2.0 OR MIT; build-time nasm-rs 0.3.2 is MIT OR Apache-2.0 (assembly is used only when `nasm` is installed) |@@ -130,14 +131,15 @@ Direct dependencies (versions pinned to Serein's lockfile):Licenses found in the complete Windows dependency graph: MIT OR Apache-2.0 (most RustCrypto,windows-rs, serde, rand, url crates), MIT (tokio, openmls family, davey, tracing, bytes,mio), Unicode-3.0 (ICU crates used by `url`/`idna`), BSD-3-Clause (curve25519-dalek,-ed25519-dalek, x25519-dalek, subtle, and the bundled libopus C sources), BSD-2-Clause+ed25519-dalek, x25519-dalek, subtle, nnnoiseless, the sonora crates, and the bundled libopus+C sources), BSD-2-Clause(openh264, openh264-sys2 and the bundled OpenH264 C++ sources), Zlib OR Apache-2.0 OR MIT(wide, safe_arch), MPL-2.0(hpke-rs, hpke-rs-crypto, hpke-rs-rust-crypto), ISC (rustls-webpki, untrusted),Apache-2.0 AND ISC (ring), Apache-2.0 (cpal), CDLA-Permissive-2.0 (webpki-roots),Unlicense OR MIT (memchr), BSD-2-Clause OR Apache-2.0 OR MIT (zerocopy).`cargo metadata` lists the exact package set. Binary distributions must carry the-BSD-3-Clause notices of libopus, nnnoiseless (RNNoise, in the root `THIRD_PARTY_NOTICES.md`) and the dalek crates, the BSD-2-Clause notice of OpenH264+BSD-3-Clause notices of libopus, nnnoiseless (RNNoise) and sonora (WebRTC; both in the root `THIRD_PARTY_NOTICES.md`) and the dalek crates, the BSD-2-Clause notice of OpenH264(in the root `THIRD_PARTY_NOTICES.md`), the ISC notices of ring and rustls-webpki, andthe CDLA-Permissive-2.0 notice of webpki-roots. H.264 is patent-encumbered: the OpenH264copyright licence grants no patent rights, and Cisco's royalty coverage applies only todiff --git a/crates/voice/src/audio.rs b/crates/voice/src/audio.rsindex a62c6a0..17956ed 100644--- a/crates/voice/src/audio.rs+++ b/crates/voice/src/audio.rs@@ -5,8 +5,9 @@//// RustCord changes: the system default devices (followed when they change) or the devices// chosen in settings (`settings.rs`), microphone/speaker volume and RNNoise "Voice-// Isolation" from those settings, a loopback mic test, no echo cancellation or preview,-// a fixed energy gate for sending, and automatic gain control (`agc.rs`).+// Isolation" from those settings, echo cancellation fed with what the speakers played+// (`echo.rs`), a loopback mic test, no preview, a fixed energy gate for sending, and+// automatic gain control (`agc.rs`).//! Microphone capture and speaker playback on the chosen or system default devices.//!//! Devices open only once the call is secured. CPAL callbacks use preallocated@@ -339,6 +340,7 @@ fn worker(continue;}streams = Some((revision, value));+ processing.reset_echo();if open_error.take().is_some() {log::info!("voice audio: audio devices recovered");}@@ -399,12 +401,16 @@ fn worker(}if active.input_stream.is_none() && Instant::now() >= next_input_retry {next_input_retry = Instant::now() + Duration::from_secs(2);- active.try_reopen_input(gate, revision);+ if active.try_reopen_input(gate, revision) {+ processing.reset_echo();+ }}if gate.flush.swap(false, Ordering::AcqRel) {active.send_gate = crate::activity::InputGate::default();+ // What played meanwhile goes too, so the echo canceller's two streams stay in step.for _ in 0..QUEUE {let _ = active.input.pop();+ let _ = active.played.pop();}}if active.input_stream.is_none() || (!loopback && !gate.capture()) {@@ -413,6 +419,19 @@ fn worker(CALL_INPUT_LEVEL.store((-100.0f32).to_bits(), Ordering::Relaxed);}}+ // What the speakers played since the last turn, before this turn's microphone frames+ // (the order the devices produced them in): the echo canceller's reference. While+ // the microphone is muted or missing it is dropped, as are its frames, so both+ // streams pick up in step.+ let capturing = active.input_stream.is_some() && gate.capture();+ for _ in 0..QUEUE {+ let Ok(played) = active.played.pop() else {+ break;+ };+ if capturing {+ processing.played(&played);+ }+ }let speaker = crate::settings::output_gain();for _ in 0..QUEUE {let Ok(mut frame) = active.input.pop() else {@@ -482,6 +501,8 @@ struct Streams {output: rtrb::Producer<Frame>,/// Your own microphone for "Listen to Microphone", mixed into the speakers.monitor: rtrb::Producer<Frame>,+ /// What the speakers played, for the echo canceller.+ played: rtrb::Consumer<Frame>,/// Devices actually opened, so a changed system default can be followed.output_id: Option<String>,input_id: Option<String>,@@ -511,7 +532,7 @@ impl Streams {let chosen = output_wanted.as_deref().and_then(|id| chosen_device(&host, id, false));- let ((output_stream, output_write, monitor, output_id), output_wanted) =+ let (speakers, output_wanted) =match chosen.map(|device| build_output(&device, gate, revision)) {Some(Ok(output)) => (output, output_wanted),Some(Err(_)) => (build_output(&default()?, gate, revision)?, None),@@ -534,7 +555,8 @@ impl Streams {{return Err("Call ended before audio devices were ready");}- output_stream+ speakers+ .stream.play().map_err(|_| "Could not start speaker playback")?;Ok(Self {@@ -543,18 +565,20 @@ impl Streams {input_callbacks: gate.input_callbacks.load(Ordering::Acquire),input_activity: Instant::now(),input_stream,- _output_stream: output_stream,+ _output_stream: speakers.stream,input: input_read,- output: output_write,- monitor,- output_id,+ output: speakers.output,+ monitor: speakers.monitor,+ played: speakers.played,+ output_id: speakers.id,input_id,output_wanted,input_wanted,input_error,})}- fn try_reopen_input(&mut self, gate: &Arc<Gate>, revision: u64) {+ /// True once a microphone is open again.+ fn try_reopen_input(&mut self, gate: &Arc<Gate>, revision: u64) -> bool {// Clear the previous failure before callbacks from the replacement can run.gate.input_failed_revision.store(0, Ordering::Release);match open_input_stream(&self.host, &mut self.input_wanted, gate, revision) {@@ -566,6 +590,7 @@ impl Streams {self.input_activity = Instant::now();self.input_error = None;gate.flush.store(true, Ordering::Release);+ true}Err(error) => {if self.input_error != Some(error) {@@ -574,6 +599,7 @@ impl Streams {}gate.input_failed_revision.fetch_max(revision, Ordering::AcqRel);+ false}}}@@ -627,28 +653,33 @@ fn chosen_device_changed(fn default_device_changed(opened: Option<&str>, lookup: impl FnOnce() -> Option<String>) -> bool {opened.is_some_and(|opened| lookup().is_some_and(|current| current != opened))}-/// Build (not start) a speaker stream fed from a fresh ring.+/// A built (not started) speaker stream and the worker's ends of its rings.+struct Speakers {+ stream: cpal::Stream,+ /// The call's mix to play.+ output: rtrb::Producer<Frame>,+ /// "Listen to Microphone": your own voice to play.+ monitor: rtrb::Producer<Frame>,+ /// What was played, for the echo canceller.+ played: rtrb::Consumer<Frame>,+ id: Option<String>,+}+/// Build (not start) a speaker stream fed from fresh rings.fn build_output(output: &cpal::Device,gate: &Arc<Gate>,revision: u64,-) -> Result<- (- cpal::Stream,- rtrb::Producer<Frame>,- rtrb::Producer<Frame>,- Option<String>,- ),- &'static str,-> {+) -> Result<Speakers, &'static str> {let output_id = output.id().ok().map(|id| id.to_string());let output_config = output_config(output)?;let stream_config = output_config.config();let (output_write, output_read) = rtrb::RingBuffer::new(QUEUE);// Three frames: at most 60 ms of your own voice waits to be played.let (monitor_write, monitor_read) = rtrb::RingBuffer::new(3);+ let (played_write, played_read) = rtrb::RingBuffer::new(QUEUE);let mut render = Playback::new(output_config.sample_rate(), output_read);render.monitor = monitor_read;+ render.played = played_write;let output_stream = match output_config.sample_format() {cpal::SampleFormat::F32 => {output_stream::<f32>(output, stream_config, render, gate.clone(), revision)@@ -670,7 +701,13 @@ fn build_output(output_config.sample_rate(),output_config.channels());- Ok((output_stream, output_write, monitor_write, output_id))+ Ok(Speakers {+ stream: output_stream,+ output: output_write,+ monitor: monitor_write,+ played: played_read,+ id: output_id,+ })}/// A device's name for the log.fn label(device: &cpal::Device) -> String {@@ -1003,6 +1040,11 @@ struct Playback {monitor: rtrb::Consumer<Frame>,monitor_frame: Frame,monitor_index: usize,+ /// What was played (at 48 kHz, before the device's rate), handed to the worker's echo+ /// canceller 20 ms at a time.+ played: rtrb::Producer<Frame>,+ played_frame: Frame,+ played_index: usize,previous: f32,next: f32,phase: f64,@@ -1042,10 +1084,14 @@ impl Playback {input,frame: [0.0; 960],index: 960,- // Nothing to listen to until `build_output` connects the microphone's ring.+ // Nothing to listen to, and nobody told what played, until `build_output`+ // connects the worker's rings.monitor: rtrb::RingBuffer::new(1).1,monitor_frame: [0.0; 960],monitor_index: 960,+ played: rtrb::RingBuffer::new(1).0,+ played_frame: [0.0; 960],+ played_index: 0,previous: 0.0,next: 0.0,phase: 1.0,@@ -1067,6 +1113,7 @@ impl Playback {while self.monitor.pop().is_ok() {}self.monitor_frame.fill(0.0);self.monitor_index = 960;+ self.played_index = 0;self.frame.fill(0.0);self.index = 960;self.previous = 0.0;@@ -1119,10 +1166,17 @@ impl Playback {self.monitor_frame = self.monitor.pop().unwrap_or([0.0; 960]);self.monitor_index = 0;}- let value = self.frame[self.index] + self.monitor_frame[self.monitor_index];+ let value = sanitize(self.frame[self.index] + self.monitor_frame[self.monitor_index]);self.index += 1;self.monitor_index += 1;- sanitize(value)+ self.played_frame[self.played_index] = value;+ self.played_index += 1;+ if self.played_index == 960 {+ self.played_index = 0;+ // A full ring (the worker is 320 ms behind) drops the frame.+ let _ = self.played.push(self.played_frame);+ }+ value}fn sample(&mut self) -> f32 {while self.phase >= 1.0 {@@ -1177,6 +1231,33 @@ mod tests {assert!(own.push([0.5; 960]).is_ok(), "deafening drains the listen queue");}+ #[test]+ fn playback_tells_the_echo_canceller_what_it_played() {+ let gate = ready_gate();+ let (mut send, receive) = rtrb::RingBuffer::new(8);+ let (mut own, monitor) = rtrb::RingBuffer::new(3);+ let (played, mut reference) = rtrb::RingBuffer::new(QUEUE);+ // A 44.1 kHz device: the reference stays at 48 kHz, in whole 20 ms frames.+ let mut playback = Playback::new(44_100, receive);+ playback.monitor = monitor;+ playback.played = played;+ send.push([0.25; 960]).unwrap();+ send.push([0.125; 960]).unwrap();+ own.push([0.5; 960]).unwrap();+ let mut rendered = [0.0_f32; 1_000];+ playback.render(&mut rendered, 1, &gate);+ assert_eq!(reference.pop().unwrap(), [0.75; 960], "the call and your own voice");+ assert!(reference.pop().is_err(), "the second frame is not finished yet");+ // Deafening plays nothing, and the unfinished frame is forgotten.+ gate.deafened.store(true, Ordering::Release);+ playback.render(&mut rendered, 1, &gate);+ gate.deafened.store(false, Ordering::Release);+ send.push([0.25; 960]).unwrap();+ send.push([0.25; 960]).unwrap();+ playback.render(&mut rendered, 1, &gate);+ assert_eq!(reference.pop().unwrap(), [0.25; 960]);+ }+#[test]fn rapid_mute_toggles_never_flush_playback_and_end_in_the_latest_state() {let audio = audio_without_devices();diff --git a/crates/voice/src/echo.rs b/crates/voice/src/echo.rsnew file mode 100644index 0000000..c8d1291--- /dev/null+++ b/crates/voice/src/echo.rs@@ -0,0 +1,151 @@+// RustCord addition (not from Serein); MIT OR Apache-2.0 like the rest of the crate.+//! "Echo Cancellation": what the speakers play is taken back out of the microphone, so the+//! others in the call don't hear themselves. This is WebRTC's AEC3, the canceller behind+//! Discord's own setting, through sonora, a pure-Rust port of WebRTC's audio processing.+//!+//! The reference is what the speaker callback actually played (the call, Go Live audio and+//! "Listen to Microphone", after the speaker volume), 20 ms at a time (`audio.rs`). The+//! worker hands over each turn's played frames before that turn's microphone frames, the+//! order the devices produced them in. AEC3 finds the delay between the two streams itself+//! (device buffers, Bluetooth: up to about 450 ms) and follows it when it changes.+//!+//! It works on 10 ms at 48 kHz, split into three bands as WebRTC does on desktop, and adds+//! about 9 ms to the microphone path.+use crate::Frame;+use sonora::config::{EchoCanceller, MaxProcessingRate, Pipeline};+use sonora::{AudioProcessing, Config, StreamConfig};++/// 10 ms at 48 kHz: the canceller's frame.+const HOP: usize = 480;++pub(crate) struct Canceller {+ apm: AudioProcessing,+ /// The 10 ms being processed: sonora reads and writes separate buffers.+ scratch: [f32; HOP],+}+impl Default for Canceller {+ fn default() -> Self {+ let config = Config {+ pipeline: Pipeline {+ // The call's own rate: no resampling inside (32 kHz cost more).+ maximum_internal_processing_rate: MaxProcessingRate::Rate48kHz,+ multi_channel_render: false,+ multi_channel_capture: false,+ ..Pipeline::default()+ },+ // Includes the high-pass filter on the microphone that AEC3 expects.+ echo_canceller: Some(EchoCanceller::default()),+ ..Config::default()+ };+ let mono = StreamConfig::new(48_000, 1);+ Self {+ apm: AudioProcessing::builder()+ .config(config)+ .capture_config(mono)+ .render_config(mono)+ .build(),+ scratch: [0.0; HOP],+ }+ }+}+impl Canceller {+ /// 20 ms the speakers played.+ pub fn played(&mut self, frame: &Frame) {+ for hop in frame.chunks_exact(HOP) {+ // Nothing changes the played audio, so its copy is discarded. (Only an invalid+ // stream format fails, and this one is fixed.)+ let _ = self.apm.process_render_f32(&[hop], &mut [&mut self.scratch]);+ }+ }+ /// 20 ms of microphone, with the echo taken out in place.+ pub fn capture(&mut self, frame: &mut Frame) {+ for hop in frame.chunks_exact_mut(HOP) {+ self.scratch.copy_from_slice(hop);+ let _ = self.apm.process_capture_f32(&[&self.scratch], &mut [hop]);+ }+ }+}++/// A test call: `seconds` of something like speech from the far end (noise through a 500 Hz+/// resonance, in syllable-rate bursts) and its echo `delay_ms` later, through a speaker,+/// room and microphone path with two reflections.+#[cfg(test)]+pub(crate) fn test_call(seconds: usize, delay_ms: usize) -> (Vec<f32>, Vec<f32>) {+ let total = 48_000 * seconds;+ let mut seed = 0x1234_5678_9abc_def1u64;+ let mut noise = || {+ seed ^= seed << 13;+ seed ^= seed >> 7;+ seed ^= seed << 17;+ (seed >> 40) as f32 / (1u64 << 24) as f32 * 2.0 - 1.0+ };+ let (radius, angle) = (0.98f32, 2.0 * std::f32::consts::PI * 500.0 / 48_000.0);+ let (mut y1, mut y2) = (0.0f32, 0.0f32);+ let far: Vec<f32> = (0..total)+ .map(|n| {+ let y = noise() + 2.0 * radius * angle.cos() * y1 - radius * radius * y2;+ (y2, y1) = (y1, y);+ let syllables = 0.5 + 0.5 * (n as f32 * 2.0 * std::f32::consts::PI * 4.0 / 48_000.0).sin();+ y * 0.02 * syllables * syllables+ })+ .collect();+ let delay = 48 * delay_ms;+ let at = |n: usize, back: usize| n.checked_sub(back).map_or(0.0, |i| far[i]);+ let echo = (0..total)+ .map(|n| 0.1 * (at(n, delay) + 0.4 * at(n, delay + 48 * 7) + 0.1 * at(n, delay + 48 * 23)))+ .collect();+ (far, echo)+}++#[cfg(test)]+mod tests {+ use super::*;++ fn frame(samples: &[f32], k: usize) -> Frame {+ samples[k * 960..(k + 1) * 960].try_into().unwrap()+ }+ fn energy_db(samples: &[f32]) -> f64 {+ let energy: f64 = samples.iter().map(|s| f64::from(*s).powi(2)).sum();+ 10.0 * (energy / samples.len() as f64).max(1e-20).log10()+ }++ #[test]+ fn removes_the_echo_and_keeps_your_voice() {+ // Four seconds of the far end talking, then one of you talking alone (a 1 kHz tone).+ let (far, echo) = test_call(5, 80);+ let voice = |n: usize| 0.05 * (2.0 * std::f32::consts::PI * 1_000.0 * n as f32 / 48_000.0).sin();+ let mic: Vec<f32> = (0..far.len()).map(|n| if n < 4 * 48_000 { echo[n] } else { voice(n) }).collect();+ let mut canceller = Canceller::default();+ let mut out = Vec::with_capacity(mic.len());+ for k in 0..far.len() / 960 {+ let played = if k < 200 { frame(&far, k) } else { [0.0; 960] };+ canceller.played(&played);+ let mut heard = frame(&mic, k);+ canceller.capture(&mut heard);+ out.extend_from_slice(&heard);+ }+ let second = 3 * 48_000..4 * 48_000;+ let removed = energy_db(&mic[second.clone()]) - energy_db(&out[second]);+ assert!(removed > 25.0, "the echo is only {removed:.1} dB quieter");+ let alone = 4 * 48_000 + 4_800..5 * 48_000;+ let kept = energy_db(&out[alone.clone()]) - energy_db(&mic[alone]);+ assert!(kept.abs() < 1.0, "your voice changed by {kept:.1} dB");+ }++ #[test]+ fn finds_a_long_echo_delay() {+ // A Bluetooth headset: the echo comes back 300 ms later.+ let (far, echo) = test_call(4, 300);+ let mut canceller = Canceller::default();+ let mut out = Vec::with_capacity(echo.len());+ for k in 0..far.len() / 960 {+ canceller.played(&frame(&far, k));+ let mut heard = frame(&echo, k);+ canceller.capture(&mut heard);+ out.extend_from_slice(&heard);+ }+ let second = 3 * 48_000..4 * 48_000;+ let removed = energy_db(&echo[second.clone()]) - energy_db(&out[second]);+ assert!(removed > 25.0, "the echo is only {removed:.1} dB quieter");+ }+}diff --git a/crates/voice/src/lib.rs b/crates/voice/src/lib.rsindex 436f5ad..9230a8f 100644--- a/crates/voice/src/lib.rs+++ b/crates/voice/src/lib.rs@@ -40,6 +40,7 @@ mod audio;mod ogg_opus;mod capture;mod crypto;+mod echo;mod health;mod jitter;mod mic;diff --git a/crates/voice/src/settings.rs b/crates/voice/src/settings.rsindex d7523c0..aeb1f68 100644--- a/crates/voice/src/settings.rs+++ b/crates/voice/src/settings.rs@@ -1,10 +1,10 @@// RustCord addition (not from Serein); MIT OR Apache-2.0 like the rest of the crate.//! Audio preferences shared by every call (Settings β Voice & Video): which microphone and-//! speakers, their volumes and "Voice Isolation" noise suppression, plus the device list and-//! the settings page's mic test.+//! speakers, their volumes, echo cancellation and "Voice Isolation" noise suppression, plus+//! the device list and the settings page's mic test.//!//! The preferences are process-wide: a running call picks a change up within one audio-//! worker turn (5 ms). Volumes and noise suppression apply to the next 20 ms frame; a new+//! worker turn (5 ms). Volumes and processing apply to the next 20 ms frame; a new//! microphone reopens only the microphone, a new speaker reopens both directions.use crate::Frame;use cpal::traits::{DeviceTrait, HostTrait};@@ -28,6 +28,9 @@ pub struct AudioSettings {/// RNNoise noise suppression on the microphone ("Voice Isolation"); off is "Studio":/// the microphone as it is.pub voice_isolation: bool,+ /// Echo cancellation (WebRTC's AEC3): what the speakers play is taken back out of the+ /// microphone, so the others don't hear themselves.+ pub echo_cancellation: bool,/// Automatic gain control: a quiet microphone raised toward a steady speech level.pub automatic_gain_control: bool,/// Play your own microphone (after processing, before the send gate) on the speakers@@ -45,6 +48,7 @@ impl Default for AudioSettings {input_volume: 1.0,output_volume: 1.0,voice_isolation: false,+ echo_cancellation: false,automatic_gain_control: false,listen_to_mic: false,input_sensitivity_db: f32::from(crate::audio::SEND_THRESHOLD_DB),@@ -61,6 +65,7 @@ static DEVICE_REVISION: AtomicU64 = AtomicU64::new(0);static INPUT_GAIN: AtomicU32 = AtomicU32::new(1.0f32.to_bits());static OUTPUT_GAIN: AtomicU32 = AtomicU32::new(1.0f32.to_bits());static ISOLATION: AtomicBool = AtomicBool::new(false);+static ECHO_CANCELLATION: AtomicBool = AtomicBool::new(false);static GAIN_CONTROL: AtomicBool = AtomicBool::new(false);fn devices() -> std::sync::MutexGuard<'static, (Option<String>, Option<String>)> {@@ -82,6 +87,7 @@ pub fn set_audio_settings(settings: &AudioSettings) {INPUT_GAIN.store(gain(settings.input_volume, 1.0).to_bits(), Ordering::Release);OUTPUT_GAIN.store(gain(settings.output_volume, 2.0).to_bits(), Ordering::Release);ISOLATION.store(settings.voice_isolation, Ordering::Release);+ ECHO_CANCELLATION.store(settings.echo_cancellation, Ordering::Release);GAIN_CONTROL.store(settings.automatic_gain_control, Ordering::Release);LISTEN.store(settings.listen_to_mic, Ordering::Release);let sensitivity = if settings.input_sensitivity_db.is_finite() {@@ -107,6 +113,7 @@ pub fn audio_settings() -> AudioSettings {input_volume: input_gain(),output_volume: output_gain(),voice_isolation: ISOLATION.load(Ordering::Acquire),+ echo_cancellation: ECHO_CANCELLATION.load(Ordering::Acquire),automatic_gain_control: GAIN_CONTROL.load(Ordering::Acquire),listen_to_mic: listen_to_mic(),input_sensitivity_db: f32::from(send_threshold_db()),@@ -185,18 +192,37 @@ pub(crate) fn scale(frame: &mut Frame, gain: f32) {}}-/// Microphone processing before the send gate: automatic gain control, "Voice Isolation"-/// (RNNoise at 48 kHz, two 10 ms hops per 20 ms frame, about 10 ms of added latency) and-/// the microphone volume. The gain control and denoiser only exist while they are on.+/// Microphone processing before the send gate: echo cancellation (`echo.rs`, about 9 ms of+/// added latency), automatic gain control, "Voice Isolation" (RNNoise at 48 kHz, two 10 ms+/// hops per 20 ms frame, about 10 ms of added latency) and the microphone volume. Each stage+/// only exists while it is on.#[derive(Default)]pub(crate) struct Processing {+ echo: Option<Box<crate::echo::Canceller>>,agc: Option<crate::agc::Agc>,denoiser: Option<Box<nnnoiseless::DenoiseState<'static>>>,}impl Processing {+ /// 20 ms the speakers played: the echo canceller's reference (ignored while it is off).+ pub fn played(&mut self, frame: &Frame) {+ if ECHO_CANCELLATION.load(Ordering::Acquire) {+ self.echo.get_or_insert_default().played(frame);+ }+ }+ /// New devices: a new echo path and delay for the canceller to learn from scratch.+ pub fn reset_echo(&mut self) {+ self.echo = None;+ }/// Processes `frame` in place; returns the automatic gain it was raised by (dB), which/// the send gate discounts so the input sensitivity keeps meaning the microphone's level.pub fn apply(&mut self, frame: &mut Frame) -> f32 {+ // First, as in WebRTC: the gain control and denoiser would change the echo path the+ // canceller learns.+ if ECHO_CANCELLATION.load(Ordering::Acquire) {+ self.echo.get_or_insert_default().capture(frame);+ } else {+ self.echo = None;+ }// Before noise suppression, which handles soft speech badly.let raised = if GAIN_CONTROL.load(Ordering::Acquire) {self.agc.get_or_insert_default().apply(frame)@@ -334,12 +360,13 @@ mod tests {input_volume: 3.0,output_volume: f32::NAN,voice_isolation: true,+ echo_cancellation: true,automatic_gain_control: true,listen_to_mic: true,input_sensitivity_db: -200.0,});let now = audio_settings();- assert!(now.listen_to_mic);+ assert!(now.listen_to_mic && now.echo_cancellation);assert_eq!(now.input_sensitivity_db, -80.0);assert_eq!(now.input_device.as_deref(), Some("wasapi:mic"));assert_eq!((now.input_volume, now.output_volume), (1.0, 1.0));@@ -377,6 +404,39 @@ mod tests {INPUT_GAIN.store(1.0f32.to_bits(), Ordering::Release);}+ #[test]+ fn echo_is_cancelled_first_and_freed_when_off() {+ let _serial = SERIAL.lock().unwrap_or_else(std::sync::PoisonError::into_inner);+ let (far, echo) = crate::echo::test_call(3, 60);+ let frame = |samples: &[f32], k: usize| -> Frame { samples[k * 960..(k + 1) * 960].try_into().unwrap() };+ let mut processing = Processing::default();+ // Off: nothing is kept for the speakers' audio, and the echo goes through.+ processing.played(&frame(&far, 0));+ assert!(processing.echo.is_none());+ ECHO_CANCELLATION.store(true, Ordering::Release);+ let (mut heard, mut cleaned) = (0.0f64, 0.0f64);+ for k in 0..far.len() / 960 {+ processing.played(&frame(&far, k));+ let mut mic = frame(&echo, k);+ processing.apply(&mut mic);+ if k >= 100 {+ heard += frame(&echo, k).iter().map(|s| f64::from(*s).powi(2)).sum::<f64>();+ cleaned += mic.iter().map(|s| f64::from(*s).powi(2)).sum::<f64>();+ }+ }+ assert!(10.0 * (heard / cleaned).log10() > 25.0, "the echo should be gone after two seconds");+ // A new device starts the canceller over; turning it off frees it.+ processing.reset_echo();+ assert!(processing.echo.is_none());+ processing.played(&frame(&far, 0));+ assert!(processing.echo.is_some());+ ECHO_CANCELLATION.store(false, Ordering::Release);+ let mut mic = frame(&echo, 0);+ processing.apply(&mut mic);+ assert!(processing.echo.is_none());+ assert_eq!(mic, frame(&echo, 0), "off leaves the microphone as it is");+ }+/// This machine's device list as RustCord sees it:/// `cargo test -p voice --lib -- --ignored --nocapture list_devices`.#[test]@@ -413,4 +473,30 @@ mod tests {ISOLATION.store(false, Ordering::Release);println!("RNNoise: {per_frame:?} per 20 ms frame = {:.2}% of one core", per_frame.as_secs_f64() / 0.02 * 100.0);}++ /// CPU cost of Echo Cancellation (the played audio and the microphone, while the far end+ /// talks): `cargo test -p voice --release -- --ignored --nocapture echo_cancellation_cost`.+ #[test]+ #[ignore]+ fn echo_cancellation_cost() {+ let _serial = SERIAL.lock().unwrap_or_else(std::sync::PoisonError::into_inner);+ ECHO_CANCELLATION.store(true, Ordering::Release);+ let mut processing = Processing::default();+ let (far, echo) = crate::echo::test_call(10, 80);+ let frames: Vec<(Frame, Frame)> = (0..far.len() / 960)+ .map(|k| {+ let range = k * 960..(k + 1) * 960;+ (far[range.clone()].try_into().unwrap(), echo[range].try_into().unwrap())+ })+ .collect();+ let start = std::time::Instant::now();+ for (played, heard) in &frames {+ processing.played(played);+ let mut frame = *heard;+ processing.apply(&mut frame);+ }+ let per_frame = start.elapsed() / frames.len() as u32;+ ECHO_CANCELLATION.store(false, Ordering::Release);+ println!("Echo cancellation: {per_frame:?} per 20 ms frame = {:.2}% of one core", per_frame.as_secs_f64() / 0.02 * 100.0);+ }}