Compare commits

..

No commits in common. "master" and "v0.9.0" have entirely different histories.

20 changed files with 175 additions and 402 deletions

View file

@ -16,7 +16,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: os:
- ubuntu-22.04 - ubuntu-latest
- windows-latest - windows-latest
- macos-latest - macos-latest
- macos-13 - macos-13
@ -59,11 +59,11 @@ jobs:
- name: Zip artifacts - name: Zip artifacts
run: | run: |
chmod +x cove-ubuntu-22.04/cove chmod +x cove-ubuntu-latest/cove
chmod +x cove-windows-latest/cove.exe chmod +x cove-windows-latest/cove.exe
chmod +x cove-macos-latest/cove chmod +x cove-macos-latest/cove
chmod +x cove-macos-13/cove chmod +x cove-macos-13/cove
zip -jr "cove-$(cat cove-ubuntu-22.04/host).zip" cove-ubuntu-22.04/cove zip -jr "cove-$(cat cove-ubuntu-latest/host).zip" cove-ubuntu-latest/cove
zip -jr "cove-$(cat cove-windows-latest/host).zip" cove-windows-latest/cove.exe zip -jr "cove-$(cat cove-windows-latest/host).zip" cove-windows-latest/cove.exe
zip -jr "cove-$(cat cove-macos-latest/host).zip" cove-macos-latest/cove zip -jr "cove-$(cat cove-macos-latest/host).zip" cove-macos-latest/cove
zip -jr "cove-$(cat cove-macos-13/host).zip" cove-macos-13/cove zip -jr "cove-$(cat cove-macos-13/host).zip" cove-macos-13/cove

View file

@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
Procedure when bumping the version number: Procedure when bumping the version number:
1. Update dependencies in a separate commit 1. Update dependencies and flake in a separate commit
2. Set version number in `Cargo.toml` 2. Set version number in `Cargo.toml`
3. Add new section in this changelog 3. Add new section in this changelog
4. Run `cargo run help-config > CONFIG.md` 4. Run `cargo run help-config > CONFIG.md`
@ -15,33 +15,6 @@ Procedure when bumping the version number:
## Unreleased ## Unreleased
### Changed
- Display emoji user id hashes in the nick list
- Compile linux binary with older glibc version
## v0.9.3 - 2025-05-31
### Added
- Key bindings for emoji-based user id hashing
### Fixed
- `keys.rooms.action.connect_autojoin` connecting to non-autojoin rooms
## v0.9.2 - 2025-03-14
### Added
- `bell_on_mention` config option
## v0.9.1 - 2025-03-01
### Fixed
- Rendering glitches with unicode-based width estimation
## v0.9.0 - 2025-02-23 ## v0.9.0 - 2025-02-23
### Added ### Added

View file

@ -53,14 +53,6 @@ Available modifiers:
## Available options ## Available options
### `bell_on_mention`
**Required:** yes
**Type:** boolean
**Default:** `false`
Ring the bell (character 0x07) when you are mentioned in a room.
### `data_dir` ### `data_dir`
**Required:** no **Required:** no
@ -537,14 +529,6 @@ Reply to message, inline if possible.
Reply opposite to normal reply. Reply opposite to normal reply.
### `keys.tree.action.toggle_nick_emoji`
**Required:** yes
**Type:** key binding
**Default:** `"e"`
Toggle agent id based nick emoji.
### `keys.tree.action.toggle_seen` ### `keys.tree.action.toggle_seen`
**Required:** yes **Required:** yes

264
Cargo.lock generated
View file

@ -90,15 +90,15 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.97" version = "1.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4"
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.87" version = "0.1.86"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -113,25 +113,27 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]] [[package]]
name = "aws-lc-rs" name = "aws-lc-rs"
version = "1.12.6" version = "1.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dabb68eb3a7aa08b46fddfd59a3d55c978243557a90ab804769f7e20e67d2b01" checksum = "4cd755adf9707cf671e31d944a189be3deaaeee11c8bc1d669bb8022ac90fbd0"
dependencies = [ dependencies = [
"aws-lc-sys", "aws-lc-sys",
"paste",
"zeroize", "zeroize",
] ]
[[package]] [[package]]
name = "aws-lc-sys" name = "aws-lc-sys"
version = "0.27.0" version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bbe221bbf523b625a4dd8585c7f38166e31167ec2ca98051dbcb4c3b6e825d2" checksum = "0f9dd2e03ee80ca2822dd6ea431163d2ef259f2066a4d6ccaca6d9dcb386aa43"
dependencies = [ dependencies = [
"bindgen", "bindgen",
"cc", "cc",
"cmake", "cmake",
"dunce", "dunce",
"fs_extra", "fs_extra",
"paste",
] ]
[[package]] [[package]]
@ -174,9 +176,9 @@ dependencies = [
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "2.9.0" version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36"
[[package]] [[package]]
name = "block-buffer" name = "block-buffer"
@ -188,10 +190,16 @@ dependencies = [
] ]
[[package]] [[package]]
name = "bytes" name = "byteorder"
version = "1.10.1" version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "bytes"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9"
[[package]] [[package]]
name = "caseless" name = "caseless"
@ -204,9 +212,9 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.2.16" version = "1.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9"
dependencies = [ dependencies = [
"jobserver", "jobserver",
"libc", "libc",
@ -241,9 +249,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.32" version = "4.5.30"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -251,9 +259,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.32" version = "4.5.30"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -263,9 +271,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "4.5.32" version = "4.5.28"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",
@ -322,7 +330,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]] [[package]]
name = "cove" name = "cove"
version = "0.9.3" version = "0.9.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -350,7 +358,7 @@ dependencies = [
[[package]] [[package]]
name = "cove-config" name = "cove-config"
version = "0.9.3" version = "0.9.0"
dependencies = [ dependencies = [
"cove-input", "cove-input",
"cove-macro", "cove-macro",
@ -361,7 +369,7 @@ dependencies = [
[[package]] [[package]]
name = "cove-input" name = "cove-input"
version = "0.9.3" version = "0.9.0"
dependencies = [ dependencies = [
"cove-macro", "cove-macro",
"crossterm", "crossterm",
@ -375,7 +383,7 @@ dependencies = [
[[package]] [[package]]
name = "cove-macro" name = "cove-macro"
version = "0.9.3" version = "0.9.0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -401,7 +409,7 @@ dependencies = [
"crossterm_winapi", "crossterm_winapi",
"mio", "mio",
"parking_lot", "parking_lot",
"rustix 0.38.44", "rustix",
"signal-hook", "signal-hook",
"signal-hook-mio", "signal-hook-mio",
"winapi", "winapi",
@ -490,9 +498,9 @@ dependencies = [
[[package]] [[package]]
name = "either" name = "either"
version = "1.15.0" version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]] [[package]]
name = "equivalent" name = "equivalent"
@ -678,9 +686,9 @@ dependencies = [
[[package]] [[package]]
name = "http" name = "http"
version = "1.3.1" version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea"
dependencies = [ dependencies = [
"bytes", "bytes",
"fnv", "fnv",
@ -689,15 +697,15 @@ dependencies = [
[[package]] [[package]]
name = "httparse" name = "httparse"
version = "1.10.1" version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a"
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "2.8.0" version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652"
dependencies = [ dependencies = [
"equivalent", "equivalent",
"hashbrown 0.15.2", "hashbrown 0.15.2",
@ -739,17 +747,16 @@ dependencies = [
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "1.0.15" version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
[[package]] [[package]]
name = "jiff" name = "jiff"
version = "0.2.4" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d699bc6dfc879fb1bf9bdff0d4c56f0884fc6f0d0eb0fba397a6d00cd9a6b85e" checksum = "3590fea8e9e22d449600c9bbd481a8163bef223e4ff938e5f55899f8cf1adb93"
dependencies = [ dependencies = [
"jiff-static",
"jiff-tzdb-platform", "jiff-tzdb-platform",
"log", "log",
"portable-atomic", "portable-atomic",
@ -758,22 +765,11 @@ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
[[package]]
name = "jiff-static"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d16e75759ee0aa64c57a56acbf43916987b20c77373cb7e808979e02b93c9f9"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "jiff-tzdb" name = "jiff-tzdb"
version = "0.1.3" version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "962e1dfe9b2d75a84536cf5bf5eaaa4319aa7906c7160134a22883ac316d5f31" checksum = "cf2cec2f5d266af45a071ece48b1fb89f3b00b2421ac3a5fe10285a6caaa60d3"
[[package]] [[package]]
name = "jiff-tzdb-platform" name = "jiff-tzdb-platform"
@ -807,9 +803,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.171" version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]] [[package]]
name = "libloading" name = "libloading"
@ -857,12 +853,6 @@ version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
[[package]]
name = "linux-raw-sys"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413"
[[package]] [[package]]
name = "lock_api" name = "lock_api"
version = "0.4.12" version = "0.4.12"
@ -893,9 +883,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.8.5" version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b"
dependencies = [ dependencies = [
"adler2", "adler2",
] ]
@ -948,9 +938,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.21.1" version = "1.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
[[package]] [[package]]
name = "open" name = "open"
@ -1007,6 +997,12 @@ dependencies = [
"windows-targets", "windows-targets",
] ]
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]] [[package]]
name = "pathdiff" name = "pathdiff"
version = "0.2.3" version = "0.2.3"
@ -1027,15 +1023,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.32" version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
[[package]] [[package]]
name = "portable-atomic" name = "portable-atomic"
version = "1.11.0" version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
[[package]] [[package]]
name = "portable-atomic-util" name = "portable-atomic-util"
@ -1054,18 +1050,18 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]] [[package]]
name = "ppv-lite86" name = "ppv-lite86"
version = "0.2.21" version = "0.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
dependencies = [ dependencies = [
"zerocopy 0.8.23", "zerocopy 0.7.35",
] ]
[[package]] [[package]]
name = "prettyplease" name = "prettyplease"
version = "0.2.31" version = "0.2.29"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"syn", "syn",
@ -1073,18 +1069,18 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.94" version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.40" version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
@ -1097,7 +1093,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
dependencies = [ dependencies = [
"rand_chacha", "rand_chacha",
"rand_core", "rand_core",
"zerocopy 0.8.23", "zerocopy 0.8.20",
] ]
[[package]] [[package]]
@ -1112,18 +1108,19 @@ dependencies = [
[[package]] [[package]]
name = "rand_core" name = "rand_core"
version = "0.9.3" version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" checksum = "a88e0da7a2c97baa202165137c158d0a2e824ac465d13d81046727b34cb247d3"
dependencies = [ dependencies = [
"getrandom 0.3.1", "getrandom 0.3.1",
"zerocopy 0.8.20",
] ]
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.5.10" version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834"
dependencies = [ dependencies = [
"bitflags", "bitflags",
] ]
@ -1170,9 +1167,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]] [[package]]
name = "ring" name = "ring"
version = "0.17.14" version = "0.17.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24"
dependencies = [ dependencies = [
"cc", "cc",
"cfg-if", "cfg-if",
@ -1218,20 +1215,7 @@ dependencies = [
"bitflags", "bitflags",
"errno", "errno",
"libc", "libc",
"linux-raw-sys 0.4.15", "linux-raw-sys",
"windows-sys 0.59.0",
]
[[package]]
name = "rustix"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825"
dependencies = [
"bitflags",
"errno",
"libc",
"linux-raw-sys 0.9.3",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@ -1282,9 +1266,9 @@ dependencies = [
[[package]] [[package]]
name = "ryu" name = "ryu"
version = "1.0.20" version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd"
[[package]] [[package]]
name = "schannel" name = "schannel"
@ -1326,9 +1310,9 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.219" version = "1.0.218"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
@ -1345,9 +1329,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.219" version = "1.0.218"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1366,9 +1350,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.140" version = "1.0.139"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6"
dependencies = [ dependencies = [
"itoa", "itoa",
"memchr", "memchr",
@ -1471,9 +1455,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.100" version = "2.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1482,31 +1466,32 @@ dependencies = [
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.19.0" version = "3.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230"
dependencies = [ dependencies = [
"cfg-if",
"fastrand", "fastrand",
"getrandom 0.3.1", "getrandom 0.3.1",
"once_cell", "once_cell",
"rustix 1.0.2", "rustix",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "2.0.12" version = "2.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "2.0.12" version = "2.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1515,9 +1500,9 @@ dependencies = [
[[package]] [[package]]
name = "time" name = "time"
version = "0.3.39" version = "0.3.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21"
dependencies = [ dependencies = [
"deranged", "deranged",
"itoa", "itoa",
@ -1530,15 +1515,15 @@ dependencies = [
[[package]] [[package]]
name = "time-core" name = "time-core"
version = "0.1.3" version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]] [[package]]
name = "time-macros" name = "time-macros"
version = "0.2.20" version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de"
dependencies = [ dependencies = [
"num-conv", "num-conv",
"time-core", "time-core",
@ -1546,9 +1531,9 @@ dependencies = [
[[package]] [[package]]
name = "tinyvec" name = "tinyvec"
version = "1.9.0" version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8"
dependencies = [ dependencies = [
"tinyvec_macros", "tinyvec_macros",
] ]
@ -1561,9 +1546,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.44.1" version = "1.43.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
@ -1590,9 +1575,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-rustls" name = "tokio-rustls"
version = "0.26.2" version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37"
dependencies = [ dependencies = [
"rustls", "rustls",
"tokio", "tokio",
@ -1661,8 +1646,8 @@ dependencies = [
[[package]] [[package]]
name = "toss" name = "toss"
version = "0.3.4" version = "0.3.2"
source = "git+https://github.com/Garmelon/toss.git?tag=v0.3.4#57aa8c59308f6f0aa82bde415a42b56c3d6f7c4d" source = "git+https://github.com/Garmelon/toss.git?tag=v0.3.2#d28ce90ec7590778e6035a7b00b1d85064f03dbf"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"crossterm", "crossterm",
@ -1698,9 +1683,9 @@ checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.18" version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe"
[[package]] [[package]]
name = "unicode-linebreak" name = "unicode-linebreak"
@ -1792,7 +1777,7 @@ dependencies = [
"either", "either",
"home", "home",
"once_cell", "once_cell",
"rustix 0.38.44", "rustix",
] ]
[[package]] [[package]]
@ -1901,9 +1886,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.7.4" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@ -1923,16 +1908,17 @@ version = "0.7.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
dependencies = [ dependencies = [
"byteorder",
"zerocopy-derive 0.7.35", "zerocopy-derive 0.7.35",
] ]
[[package]] [[package]]
name = "zerocopy" name = "zerocopy"
version = "0.8.23" version = "0.8.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" checksum = "dde3bb8c68a8f3f1ed4ac9221aad6b10cece3e60a8e2ea54a6a2dec806d0084c"
dependencies = [ dependencies = [
"zerocopy-derive 0.8.23", "zerocopy-derive 0.8.20",
] ]
[[package]] [[package]]
@ -1948,9 +1934,9 @@ dependencies = [
[[package]] [[package]]
name = "zerocopy-derive" name = "zerocopy-derive"
version = "0.8.23" version = "0.8.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" checksum = "eea57037071898bf96a6da35fd626f4f27e9cee3ead2a6c703cf09d472b2e700"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

View file

@ -3,32 +3,32 @@ resolver = "3"
members = ["cove", "cove-*"] members = ["cove", "cove-*"]
[workspace.package] [workspace.package]
version = "0.9.3" version = "0.9.0"
edition = "2024" edition = "2024"
[workspace.dependencies] [workspace.dependencies]
anyhow = "1.0.97" anyhow = "1.0.96"
async-trait = "0.1.87" async-trait = "0.1.86"
clap = { version = "4.5.32", features = ["derive", "deprecated"] } clap = { version = "4.5.30", features = ["derive", "deprecated"] }
cookie = "0.18.1" cookie = "0.18.1"
crossterm = "0.28.1" crossterm = "0.28.1"
directories = "6.0.0" directories = "6.0.0"
edit = "0.1.5" edit = "0.1.5"
jiff = "0.2.4" jiff = "0.2.1"
linkify = "0.10.0" linkify = "0.10.0"
log = { version = "0.4.26", features = ["std"] } log = { version = "0.4.26", features = ["std"] }
open = "5.3.2" open = "5.3.2"
parking_lot = "0.12.3" parking_lot = "0.12.3"
proc-macro2 = "1.0.94" proc-macro2 = "1.0.93"
quote = "1.0.40" quote = "1.0.38"
rusqlite = { version = "0.31.0", features = ["bundled", "time"] } rusqlite = { version = "0.31.0", features = ["bundled", "time"] }
rustls = "0.23.23" rustls = "0.23.23"
serde = { version = "1.0.219", features = ["derive"] } serde = { version = "1.0.218", features = ["derive"] }
serde_either = "0.2.1" serde_either = "0.2.1"
serde_json = "1.0.140" serde_json = "1.0.139"
syn = "2.0.100" syn = "2.0.98"
thiserror = "2.0.12" thiserror = "2.0.11"
tokio = { version = "1.44.1", features = ["full"] } tokio = { version = "1.43.0", features = ["full"] }
toml = "0.8.20" toml = "0.8.20"
unicode-width = "0.2.0" unicode-width = "0.2.0"
@ -39,7 +39,7 @@ features = ["bot"]
[workspace.dependencies.toss] [workspace.dependencies.toss]
git = "https://github.com/Garmelon/toss.git" git = "https://github.com/Garmelon/toss.git"
tag = "v0.3.4" tag = "v0.3.2"
[workspace.dependencies.vault] [workspace.dependencies.vault]
git = "https://github.com/Garmelon/vault.git" git = "https://github.com/Garmelon/vault.git"

View file

@ -104,7 +104,6 @@ default_bindings! {
pub fn mark_older_seen => ["ctrl+s"]; pub fn mark_older_seen => ["ctrl+s"];
pub fn info => ["i"]; pub fn info => ["i"];
pub fn links => ["I"]; pub fn links => ["I"];
pub fn toggle_nick_emoji => ["e"];
pub fn increase_caesar => ["c"]; pub fn increase_caesar => ["c"];
pub fn decrease_caesar => ["C"]; pub fn decrease_caesar => ["C"];
} }
@ -357,9 +356,6 @@ pub struct TreeAction {
/// List links found in message. /// List links found in message.
#[serde(default = "default::tree_action::links")] #[serde(default = "default::tree_action::links")]
pub links: KeyBinding, pub links: KeyBinding,
/// Toggle agent id based nick emoji.
#[serde(default = "default::tree_action::toggle_nick_emoji")]
pub toggle_nick_emoji: KeyBinding,
/// Increase caesar cipher rotation. /// Increase caesar cipher rotation.
#[serde(default = "default::tree_action::increase_caesar")] #[serde(default = "default::tree_action::increase_caesar")]
pub increase_caesar: KeyBinding, pub increase_caesar: KeyBinding,

View file

@ -100,10 +100,6 @@ pub struct Config {
#[serde(default)] #[serde(default)]
pub rooms_sort_order: RoomsSortOrder, pub rooms_sort_order: RoomsSortOrder,
/// Ring the bell (character 0x07) when you are mentioned in a room.
#[serde(default)]
pub bell_on_mention: bool,
/// Time zone that chat timestamps should be displayed in. /// Time zone that chat timestamps should be displayed in.
/// ///
/// This option can either be the string `"localtime"`, a [POSIX TZ string], /// This option can either be the string `"localtime"`, a [POSIX TZ string],

View file

@ -1,18 +1,15 @@
use crossterm::style::Stylize; use crossterm::style::Stylize;
use euphoxide::api::{MessageId, Snowflake, Time, UserId}; use euphoxide::api::{MessageId, Snowflake, Time};
use jiff::Timestamp; use jiff::Timestamp;
use toss::{Style, Styled}; use toss::{Style, Styled};
use crate::{store::Msg, ui::ChatMsg}; use crate::{store::Msg, ui::ChatMsg};
use super::util;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct SmallMessage { pub struct SmallMessage {
pub id: MessageId, pub id: MessageId,
pub parent: Option<MessageId>, pub parent: Option<MessageId>,
pub time: Time, pub time: Time,
pub user_id: UserId,
pub nick: String, pub nick: String,
pub content: String, pub content: String,
pub seen: bool, pub seen: bool,
@ -73,10 +70,6 @@ impl Msg for SmallMessage {
fn last_possible_id() -> Self::Id { fn last_possible_id() -> Self::Id {
MessageId(Snowflake::MAX) MessageId(Snowflake::MAX)
} }
fn nick_emoji(&self) -> Option<String> {
Some(util::user_id_emoji(&self.user_id))
}
} }
impl ChatMsg for SmallMessage { impl ChatMsg for SmallMessage {

View file

@ -1,28 +1,11 @@
use std::{ use std::sync::LazyLock;
collections::HashSet,
hash::{DefaultHasher, Hash, Hasher},
sync::LazyLock,
};
use crossterm::style::{Color, Stylize}; use crossterm::style::{Color, Stylize};
use euphoxide::{Emoji, api::UserId}; use euphoxide::Emoji;
use toss::{Style, Styled}; use toss::{Style, Styled};
pub static EMOJI: LazyLock<Emoji> = LazyLock::new(Emoji::load); pub static EMOJI: LazyLock<Emoji> = LazyLock::new(Emoji::load);
pub static EMOJI_LIST: LazyLock<Vec<String>> = LazyLock::new(|| {
let mut list = EMOJI
.0
.values()
.flatten()
.cloned()
.collect::<HashSet<_>>()
.into_iter()
.collect::<Vec<_>>();
list.sort_unstable();
list
});
/// Convert HSL to RGB following [this approach from wikipedia][1]. /// Convert HSL to RGB following [this approach from wikipedia][1].
/// ///
/// `h` must be in the range `[0, 360]`, `s` and `l` in the range `[0, 1]`. /// `h` must be in the range `[0, 360]`, `s` and `l` in the range `[0, 1]`.
@ -86,11 +69,3 @@ pub fn style_mention_exact(mention: &str, base: Style) -> Styled {
.expect("mention must start with @"); .expect("mention must start with @");
Styled::new(mention, nick_style(nick, base)) Styled::new(mention, nick_style(nick, base))
} }
pub fn user_id_emoji(user_id: &UserId) -> String {
let mut hasher = DefaultHasher::new();
user_id.0.hash(&mut hasher);
let hash = hasher.finish();
let emoji = &EMOJI_LIST[hash as usize % EMOJI_LIST.len()];
emoji.clone()
}

View file

@ -8,10 +8,6 @@ pub trait Msg {
fn parent(&self) -> Option<Self::Id>; fn parent(&self) -> Option<Self::Id>;
fn seen(&self) -> bool; fn seen(&self) -> bool;
fn nick_emoji(&self) -> Option<String> {
None
}
fn last_possible_id() -> Self::Id; fn last_possible_id() -> Self::Id;
} }

View file

@ -50,7 +50,6 @@ impl From<Infallible> for UiError {
} }
} }
#[expect(clippy::large_enum_variant)]
pub enum UiEvent { pub enum UiEvent {
GraphemeWidthsChanged, GraphemeWidthsChanged,
LogChanged, LogChanged,

View file

@ -37,7 +37,6 @@ pub struct ChatState<M: Msg, S: MsgStore<M>> {
cursor: Cursor<M::Id>, cursor: Cursor<M::Id>,
editor: EditorState, editor: EditorState,
nick_emoji: bool,
caesar: i8, caesar: i8,
mode: Mode, mode: Mode,
@ -49,7 +48,6 @@ impl<M: Msg, S: MsgStore<M> + Clone> ChatState<M, S> {
Self { Self {
cursor: Cursor::Bottom, cursor: Cursor::Bottom,
editor: EditorState::new(), editor: EditorState::new(),
nick_emoji: false,
caesar: 0, caesar: 0,
mode: Mode::Tree, mode: Mode::Tree,
@ -58,10 +56,6 @@ impl<M: Msg, S: MsgStore<M> + Clone> ChatState<M, S> {
store, store,
} }
} }
pub fn nick_emoji(&self) -> bool {
self.nick_emoji
}
} }
impl<M: Msg, S: MsgStore<M>> ChatState<M, S> { impl<M: Msg, S: MsgStore<M>> ChatState<M, S> {
@ -85,7 +79,6 @@ impl<M: Msg, S: MsgStore<M>> ChatState<M, S> {
&mut self.editor, &mut self.editor,
nick, nick,
focused, focused,
self.nick_emoji,
self.caesar, self.caesar,
) )
.boxed_async(), .boxed_async(),
@ -124,11 +117,6 @@ impl<M: Msg, S: MsgStore<M>> ChatState<M, S> {
Reaction::Composed { parent, content } Reaction::Composed { parent, content }
} }
Reaction::NotHandled if event.matches(&keys.tree.action.toggle_nick_emoji) => {
self.nick_emoji = !self.nick_emoji;
Reaction::Handled
}
Reaction::NotHandled if event.matches(&keys.tree.action.increase_caesar) => { Reaction::NotHandled if event.matches(&keys.tree.action.increase_caesar) => {
self.caesar = (self.caesar + 1).rem_euclid(26); self.caesar = (self.caesar + 1).rem_euclid(26);
Reaction::Handled Reaction::Handled

View file

@ -389,7 +389,6 @@ impl<M: Msg, S: MsgStore<M>> TreeViewState<M, S> {
editor: &'a mut EditorState, editor: &'a mut EditorState,
nick: String, nick: String,
focused: bool, focused: bool,
nick_emoji: bool,
caesar: i8, caesar: i8,
) -> TreeView<'a, M, S> { ) -> TreeView<'a, M, S> {
TreeView { TreeView {
@ -398,7 +397,6 @@ impl<M: Msg, S: MsgStore<M>> TreeViewState<M, S> {
editor, editor,
nick, nick,
focused, focused,
nick_emoji,
caesar, caesar,
} }
} }
@ -412,8 +410,6 @@ pub struct TreeView<'a, M: Msg, S: MsgStore<M>> {
nick: String, nick: String,
focused: bool, focused: bool,
nick_emoji: bool,
caesar: i8, caesar: i8,
} }
@ -442,7 +438,6 @@ where
size, size,
nick: self.nick.clone(), nick: self.nick.clone(),
focused: self.focused, focused: self.focused,
nick_emoji: self.nick_emoji,
caesar: self.caesar, caesar: self.caesar,
last_cursor: self.state.last_cursor.clone(), last_cursor: self.state.last_cursor.clone(),
last_cursor_top: self.state.last_cursor_top, last_cursor_top: self.state.last_cursor_top,

View file

@ -80,7 +80,6 @@ pub struct TreeContext<Id> {
pub size: Size, pub size: Size,
pub nick: String, pub nick: String,
pub focused: bool, pub focused: bool,
pub nick_emoji: bool,
pub caesar: i8, pub caesar: i8,
pub last_cursor: Cursor<Id>, pub last_cursor: Cursor<Id>,
pub last_cursor_top: i32, pub last_cursor_top: i32,
@ -208,7 +207,6 @@ where
self.tz.clone(), self.tz.clone(),
indent, indent,
msg, msg,
self.context.nick_emoji,
self.context.caesar, self.context.caesar,
folded_info, folded_info,
); );

View file

@ -22,7 +22,6 @@ where
size: self.last_size, size: self.last_size,
nick: self.last_nick.clone(), nick: self.last_nick.clone(),
focused: true, focused: true,
nick_emoji: false,
caesar: 0, caesar: 0,
last_cursor: self.last_cursor.clone(), last_cursor: self.last_cursor.clone(),
last_cursor_top: self.last_cursor_top, last_cursor_top: self.last_cursor_top,

View file

@ -59,17 +59,10 @@ pub fn msg<M: Msg + ChatMsg>(
tz: TimeZone, tz: TimeZone,
indent: usize, indent: usize,
msg: &M, msg: &M,
nick_emoji: bool,
caesar: i8, caesar: i8,
folded_info: Option<usize>, folded_info: Option<usize>,
) -> Boxed<'static, Infallible> { ) -> Boxed<'static, Infallible> {
let (mut nick, mut content) = msg.styled(); let (nick, mut content) = msg.styled();
if nick_emoji {
if let Some(emoji) = msg.nick_emoji() {
nick = nick.then_plain("(").then_plain(emoji).then_plain(")");
}
}
if caesar != 0 { if caesar != 0 {
// Apply caesar in inverse because we're decoding // Apply caesar in inverse because we're decoding

View file

@ -22,10 +22,9 @@ pub fn widget<'a>(
list: &'a mut ListState<SessionId>, list: &'a mut ListState<SessionId>,
joined: &Joined, joined: &Joined,
focused: bool, focused: bool,
nick_emoji: bool,
) -> impl Widget<UiError> + use<'a> { ) -> impl Widget<UiError> + use<'a> {
let mut list_builder = ListBuilder::new(); let mut list_builder = ListBuilder::new();
render_rows(&mut list_builder, joined, focused, nick_emoji); render_rows(&mut list_builder, joined, focused);
list_builder.build(list) list_builder.build(list)
} }
@ -71,7 +70,6 @@ fn render_rows(
list_builder: &mut ListBuilder<'_, SessionId, Background<Text>>, list_builder: &mut ListBuilder<'_, SessionId, Background<Text>>,
joined: &Joined, joined: &Joined,
focused: bool, focused: bool,
nick_emoji: bool,
) { ) {
let mut people = vec![]; let mut people = vec![];
let mut bots = vec![]; let mut bots = vec![];
@ -97,38 +95,10 @@ fn render_rows(
lurkers.sort_unstable(); lurkers.sort_unstable();
nurkers.sort_unstable(); nurkers.sort_unstable();
render_section( render_section(list_builder, "People", &people, &joined.session, focused);
list_builder, render_section(list_builder, "Bots", &bots, &joined.session, focused);
"People", render_section(list_builder, "Lurkers", &lurkers, &joined.session, focused);
&people, render_section(list_builder, "Nurkers", &nurkers, &joined.session, focused);
&joined.session,
focused,
nick_emoji,
);
render_section(
list_builder,
"Bots",
&bots,
&joined.session,
focused,
nick_emoji,
);
render_section(
list_builder,
"Lurkers",
&lurkers,
&joined.session,
focused,
nick_emoji,
);
render_section(
list_builder,
"Nurkers",
&nurkers,
&joined.session,
focused,
nick_emoji,
);
} }
fn render_section( fn render_section(
@ -137,7 +107,6 @@ fn render_section(
sessions: &[HalfSession], sessions: &[HalfSession],
own_session: &SessionView, own_session: &SessionView,
focused: bool, focused: bool,
nick_emoji: bool,
) { ) {
if sessions.is_empty() { if sessions.is_empty() {
return; return;
@ -155,7 +124,7 @@ fn render_section(
list_builder.add_unsel(Text::new(row).background()); list_builder.add_unsel(Text::new(row).background());
for session in sessions { for session in sessions {
render_row(list_builder, session, own_session, focused, nick_emoji); render_row(list_builder, session, own_session, focused);
} }
} }
@ -164,7 +133,6 @@ fn render_row(
session: &HalfSession, session: &HalfSession,
own_session: &SessionView, own_session: &SessionView,
focused: bool, focused: bool,
nick_emoji: bool,
) { ) {
let (name, style, style_inv, perms_style_inv) = if session.name.is_empty() { let (name, style, style_inv, perms_style_inv) = if session.name.is_empty() {
let name = "lurk".to_string(); let name = "lurk".to_string();
@ -198,24 +166,16 @@ fn render_row(
" " " "
}; };
let emoji = if nick_emoji {
format!(" ({})", euph::user_id_emoji(&session.id))
} else {
"".to_string()
};
list_builder.add_sel(session.session_id.clone(), move |selected| { list_builder.add_sel(session.session_id.clone(), move |selected| {
if focused && selected { if focused && selected {
let text = Styled::new_plain(owner) let text = Styled::new_plain(owner)
.then(name, style_inv) .then(name, style_inv)
.then(perms, perms_style_inv) .then(perms, perms_style_inv);
.then(emoji, perms_style_inv);
Text::new(text).background().with_style(style_inv) Text::new(text).background().with_style(style_inv)
} else { } else {
let text = Styled::new_plain(owner) let text = Styled::new_plain(owner)
.then(&name, style) .then(&name, style)
.then_plain(perms) .then_plain(perms);
.then_plain(emoji);
Text::new(text).background() Text::new(text).background()
} }
}); });

View file

@ -4,8 +4,8 @@ use cove_config::{Config, Keys};
use cove_input::InputEvent; use cove_input::InputEvent;
use crossterm::style::Stylize; use crossterm::style::Stylize;
use euphoxide::{ use euphoxide::{
api::{Data, Message, MessageId, PacketType, SessionId, packet::ParsedPacket}, api::{Data, Message, MessageId, PacketType, SessionId},
bot::instance::{ConnSnapshot, Event, ServerConfig}, bot::instance::{Event, ServerConfig},
conn::{self, Joined, Joining, SessionInfo}, conn::{self, Joined, Joining, SessionInfo},
}; };
use jiff::tz::TimeZone; use jiff::tz::TimeZone;
@ -19,7 +19,7 @@ use toss::{
}; };
use crate::{ use crate::{
euph::{self, SpanType}, euph,
macros::logging_unwrap, macros::logging_unwrap,
ui::{ ui::{
UiError, UiEvent, UiError, UiEvent,
@ -73,8 +73,6 @@ pub struct EuphRoom {
last_msg_sent: Option<oneshot::Receiver<MessageId>>, last_msg_sent: Option<oneshot::Receiver<MessageId>>,
nick_list: ListState<SessionId>, nick_list: ListState<SessionId>,
mentioned: bool,
} }
impl EuphRoom { impl EuphRoom {
@ -98,7 +96,6 @@ impl EuphRoom {
chat: ChatState::new(vault, tz), chat: ChatState::new(vault, tz),
last_msg_sent: None, last_msg_sent: None,
nick_list: ListState::new(), nick_list: ListState::new(),
mentioned: false,
} }
} }
@ -121,7 +118,7 @@ impl EuphRoom {
.server_config .server_config
.clone() .clone()
.room(self.vault().room().name.clone()) .room(self.vault().room().name.clone())
.name(format!("{room:?}-{next_instance_id}")) .name(format!("{room:?}-{}", next_instance_id))
.human(true) .human(true)
.username(self.room_config.username.clone()) .username(self.room_config.username.clone())
.force_username(self.room_config.force_username) .force_username(self.room_config.force_username)
@ -167,12 +164,6 @@ impl EuphRoom {
} }
} }
pub fn retrieve_mentioned(&mut self) -> bool {
let mentioned = self.mentioned;
self.mentioned = false;
mentioned
}
pub async fn unseen_msgs_count(&self) -> usize { pub async fn unseen_msgs_count(&self) -> usize {
logging_unwrap!(self.vault().unseen_msgs_count().await) logging_unwrap!(self.vault().unseen_msgs_count().await)
} }
@ -291,16 +282,11 @@ impl EuphRoom {
joined: &Joined, joined: &Joined,
focus: Focus, focus: Focus,
) -> BoxedAsync<'a, UiError> { ) -> BoxedAsync<'a, UiError> {
let nick_list_widget = nick_list::widget( let nick_list_widget = nick_list::widget(nick_list, joined, focus == Focus::NickList)
nick_list, .padding()
joined, .with_right(1)
focus == Focus::NickList, .border()
chat.nick_emoji(), .desync();
)
.padding()
.with_right(1)
.border()
.desync();
let chat_widget = chat.widget(joined.session.name.clone(), focus == Focus::Chat); let chat_widget = chat.widget(joined.session.name.clone(), focus == Focus::Chat);
@ -571,35 +557,6 @@ impl EuphRoom {
return false; return false;
} }
if let Event::Packet(
_,
ParsedPacket {
content: Ok(Data::SendEvent(send)),
..
},
ConnSnapshot {
state: conn::State::Joined(joined),
..
},
) = &event
{
let normalized_name = euphoxide::nick::normalize(&joined.session.name);
let content = &*send.0.content;
for (rtype, rspan) in euph::find_spans(content) {
if rtype != SpanType::Mention {
continue;
}
let Some(mention) = content[rspan].strip_prefix('@') else {
continue;
};
let normalized_mention = euphoxide::nick::normalize(mention);
if normalized_name == normalized_mention {
self.mentioned = true;
break;
}
}
}
// We handle the packet internally first because the room event handling // We handle the packet internally first because the room event handling
// will consume it while we only need a reference. // will consume it while we only need a reference.
let handled = if let Event::Packet(_, packet, _) = &event { let handled = if let Event::Packet(_, packet, _) = &event {

View file

@ -17,7 +17,7 @@ use jiff::tz::TimeZone;
use tokio::sync::mpsc; use tokio::sync::mpsc;
use toss::{ use toss::{
Style, Styled, Widget, WidgetExt, Style, Styled, Widget, WidgetExt,
widgets::{BellState, BoxedAsync, Empty, Join2, Text}, widgets::{BoxedAsync, Empty, Join2, Text},
}; };
use crate::{ use crate::{
@ -95,7 +95,6 @@ pub struct Rooms {
list: ListState<RoomIdentifier>, list: ListState<RoomIdentifier>,
order: Order, order: Order,
bell: BellState,
euph_servers: HashMap<String, EuphServer>, euph_servers: HashMap<String, EuphServer>,
euph_rooms: HashMap<RoomIdentifier, EuphRoom>, euph_rooms: HashMap<RoomIdentifier, EuphRoom>,
@ -116,7 +115,6 @@ impl Rooms {
state: State::ShowList, state: State::ShowList,
list: ListState::new(), list: ListState::new(),
order: Order::from_rooms_sort_order(config.rooms_sort_order), order: Order::from_rooms_sort_order(config.rooms_sort_order),
bell: BellState::new(),
euph_servers: HashMap::new(), euph_servers: HashMap::new(),
euph_rooms: HashMap::new(), euph_rooms: HashMap::new(),
}; };
@ -246,9 +244,7 @@ impl Rooms {
.retain(|n, r| !r.stopped() || rooms_set.contains(n)); .retain(|n, r| !r.stopped() || rooms_set.contains(n));
for room in rooms_set { for room in rooms_set {
let room = self.get_or_insert_room(room).await; self.get_or_insert_room(room).await.retain();
room.retain();
self.bell.ring |= room.retrieve_mentioned();
} }
} }
@ -258,7 +254,7 @@ impl Rooms {
_ => self.stabilize_rooms().await, _ => self.stabilize_rooms().await,
} }
let widget = match &mut self.state { match &mut self.state {
State::ShowList => Self::rooms_widget( State::ShowList => Self::rooms_widget(
&self.vault, &self.vault,
self.config, self.config,
@ -301,12 +297,6 @@ impl Rooms {
.below(delete.widget()) .below(delete.widget())
.desync() .desync()
.boxed_async(), .boxed_async(),
};
if self.config.bell_on_mention {
widget.above(self.bell.widget().desync()).boxed_async()
} else {
widget
} }
} }
@ -536,10 +526,7 @@ impl Rooms {
} }
if event.matches(&keys.rooms.action.connect_autojoin) { if event.matches(&keys.rooms.action.connect_autojoin) {
for (domain, server) in &self.config.euph.servers { for (domain, server) in &self.config.euph.servers {
for (name, room) in &server.rooms { for name in server.rooms.keys() {
if !room.autojoin {
continue;
}
let id = RoomIdentifier::new(domain.clone(), name.clone()); let id = RoomIdentifier::new(domain.clone(), name.clone());
self.connect_to_room(id).await; self.connect_to_room(id).await;
} }

View file

@ -611,7 +611,7 @@ impl Action for GetMsg {
let msg = conn let msg = conn
.query_row( .query_row(
" "
SELECT id, parent, time, user_id, name, content, seen SELECT id, parent, time, name, content, seen
FROM euph_msgs FROM euph_msgs
WHERE domain = ? WHERE domain = ?
AND room = ? AND room = ?
@ -623,10 +623,9 @@ impl Action for GetMsg {
id: MessageId(row.get::<_, WSnowflake>(0)?.0), id: MessageId(row.get::<_, WSnowflake>(0)?.0),
parent: row.get::<_, Option<WSnowflake>>(1)?.map(|s| MessageId(s.0)), parent: row.get::<_, Option<WSnowflake>>(1)?.map(|s| MessageId(s.0)),
time: row.get::<_, WTime>(2)?.0, time: row.get::<_, WTime>(2)?.0,
user_id: UserId(row.get(3)?), nick: row.get(3)?,
nick: row.get(4)?, content: row.get(4)?,
content: row.get(5)?, seen: row.get(5)?,
seen: row.get(6)?,
}) })
}, },
) )
@ -704,7 +703,7 @@ impl Action for GetTree {
AND tree.room = euph_msgs.room AND tree.room = euph_msgs.room
AND tree.id = euph_msgs.parent AND tree.id = euph_msgs.parent
) )
SELECT id, parent, time, user_id, name, content, seen SELECT id, parent, time, name, content, seen
FROM euph_msgs FROM euph_msgs
JOIN tree USING (domain, room, id) JOIN tree USING (domain, room, id)
ORDER BY id ASC ORDER BY id ASC
@ -717,10 +716,9 @@ impl Action for GetTree {
id: MessageId(row.get::<_, WSnowflake>(0)?.0), id: MessageId(row.get::<_, WSnowflake>(0)?.0),
parent: row.get::<_, Option<WSnowflake>>(1)?.map(|s| MessageId(s.0)), parent: row.get::<_, Option<WSnowflake>>(1)?.map(|s| MessageId(s.0)),
time: row.get::<_, WTime>(2)?.0, time: row.get::<_, WTime>(2)?.0,
user_id: UserId(row.get(3)?), nick: row.get(3)?,
nick: row.get(4)?, content: row.get(4)?,
content: row.get(5)?, seen: row.get(5)?,
seen: row.get(6)?,
}) })
}, },
)? )?