It seems that Synapse sometimes sends junk data in fields where a URL
is expected. Since there are plans to use the ruma libraries and they
don't use Url intentionally, doing this fixes#642 and adapts the code
for the future inclusion of ruma.
There is a big match block in `fn dispatch_error` to handle all error
cases, which are modeled with a big enum with many variants. Since there
is an error case for each request, this can be changed to isolated data
structures that implement a common trait. Done this way, extending and
modifying existing error cases becomes easier. Moreover, there is no
need to check among so many variants and then run the proper piece of
code; traits pass a pointer directly to the function.
You are using an explicit closure for copying elements
You are using an explicit closure for cloning elements
you don't need to add `&` to both the expression and the patterns
you don't need to add `&` to all patterns
use of a blacklisted/placeholder name `bar`/`foo`
manual implementation of an assign operation
`ref` directly on a function argument is ignored. Consider using a reference type instead.
called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
single-character string constant used as pattern
this creates an owned instance just for comparison ("image/gif".to_string())
Matching on `Some` with `ok()` is redundant
useless use of `format!`
redundant closure found ( map(|foo| String::from(foo)) )
long literal lacking separators (1_000_000_000)
Imports are only necessary if a specific symbol gets imported. Importing a crate without symbols
is redundant as you have to use the crate name also in the first usage.
Before, Fractal would always wait for 10 seconds when the sync request
failed. With this commit, the time Fractal waits before the next request
increases exponentially, if the error is a 429 (Too Many Requests) error.
Before, the gtk main thread sometimes froze when sending an audio or video
attachment. That was due to trying to get the duration of the audio/video
using gstreamer_editing_services. Now, using gstreamer_pbutils,
that doesn't happen anymore.
Furthermore, when creating an audio player in the room history, the
duration of the audio was displayed as 00:00 until play was hit. Now,
the duration of the audio gets displayed correctly from the moment of the
creation of the player on.
Before, when a user attached a video, the attachment was handled as
a file. With this commit, it gets handled as a video. As a consequence,
it's played in the room history and added to the media viewer.
The current power_levels variable really only describes the admins
(hence the call to get_admins()) so let's rename it to be more accurate.
Signed-off-by: Alistair Francis <alistair@alistair23.me>
The latest version of the libhandy bindings requires an
update to the latest version of the gtk-rs bindings. This
update comes with a few changes, including the removal of the
`Into<Option<T>` pattern in favor of explicitly using `Some(T)` for options.