- Fix the search results not expanding
- Fix the spacing around the searchbar
The two UI files are identical except for some labels and IDs and should
be merged
This fixes this errors from clippy:
```
warning: use of `unwrap_or` followed by a call to `new`
--> fractal-matrix-api/src/backend/room.rs:80:30
|
80 | avatar = util::get_room_avatar(&baseu, &tk, &userid, &roomid)
| ______________________________^
81 | | .unwrap_or(String::from(""));
| |_________________________________________________^ help: try this: `util::get_room_avatar(&baseu, &tk, &userid, &roomid).unwrap_or_default()`
|
= note: #[warn(clippy::or_fun_call)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#or_fun_call
```
Related: #370
This fixes this errors from clippy:
```
error: single-character string constant used as pattern
--> fractal-matrix-api/src/backend/media.rs:119:30
|
119 | let name = url.split("/").last().unwrap_or_default();
| ^^^ help: try using a char instead: `'/'`
|
= note: `-D clippy::single-char-pattern` implied by `-D warnings`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#single_char_pattern
```
Related: #370
This fixes some errors from clippy about needless length comparison to 0:
```
error: length comparison to zero
--> fractal-matrix-api/src/util.rs:483:27
|
483 | if array.is_none() || array.unwrap().len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `array.unwrap().is_empty()`
|
= note: `-D clippy::len-zero` implied by `-D warnings`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#len_zero
```
Related: #370
This patch fixes a big bunch of 'unnecessary pass by value' errors from clippy:
```
error: this argument is passed by value, but not consumed in the function body
--> fractal-matrix-api/src/util.rs:340:9
|
340 | tk: String,
| ^^^^^^
|
= note: `-D clippy::needless-pass-by-value` implied by `-D warnings`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#needless_pass_by_value
help: consider changing the type to
|
340 | tk: &str,
| ^^^^
help: change `tk.clone()` to
|
357 | tk.to_string(),
| ^^^^^^^^^^^^^^
```
Related: #370
Fixing clippy error:
```
error: called `map(f)` on an Option value where `f` is a unit closure
--> fractal-matrix-api/src/util.rs:248:17
|
248 | / fread["content"]["event_id"]
249 | | .as_str()
250 | | .map(|ev| r.add_receipt_from_fully_read(userid, ev));
| |________________________________________________________________________^
|
= note: `-D clippy::option-map-unit-fn` implied by `-D warnings`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#option_map_unit_fn
help: try this
|
248 | if let Some(ev) = fread["content"]["event_id"]
249 | .as_str() { r.add_receipt_from_fully_read(userid, ev) }
|
```
Related: #370
Fixing clippy error:
```
error: for loop over `dataevs.as_array()`, which is an `Option`. This is more readably written as an `if let` statement.
--> fractal-matrix-api/src/util.rs:221:19
|
221 | for ev in dataevs.as_array() {
| ^^^^^^^^^^^^^^^^^^
|
= note: #[deny(clippy::for_loop_over_option)] on by default
= help: consider replacing `for ev in dataevs.as_array()` with `if let Some(ev) = dataevs.as_array()`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#for_loop_over_option
```
Related: #370
We were storing the signal_id, but we never disconnect that handler so
it worked the first time and then we were getting all key events and
future widgets creation doesn't work.
This patch disconnect the signal just when the widget gets unmapped, as
we create a new widget when we open the media-viewer again.
Fix#402
Code inside debug_assert! is not called in release mode. In release mode
all the debug_assert! is omitted so the code inside never runs.
https://doc.rust-lang.org/std/macro.debug_assert.html
I've moved all the code inside the debug_assert! call to outside and
assign to a variable so the assert is done in development version but
doesn't affects to the release version at all.
The room order wasn't updated and the room name wasn't bold when you
receive a message without a room selected because if active_room is
None, the `?` operator will return the function and the moveup and
set_bold functions never get called.
Fix#394