We were ignoring channel send errors and it could be interesting to have
a log about this not sent messages.
This patch adds a new trait to extend the Result<(), SendError<T>> type
and provide a new method called expect_log, that doesn't panic on error
but logs the message in that case.
To avoid crashes when the channel is closed and we try to send something
we should manage the response of `send` instead of calling directly to
`unwrap`.
Recent versions of rust report this warning when building:
warning: `...` range patterns are deprecated
--> fractal-gtk/src/widgets/members_list.rs:169:14
|
169 | 1...49 => (i18n("Privileged"), "badge-grey"),
| ^^^ help: use `..=` for an inclusive range
Fix the warning by just searching and replacing the deprecated code.
Signed-off-by: Alistair Francis <alistair@alistair23.me>
When a user doesn't have permission to send a message to the room let's
block out the text box.
Signed-off-by: Alistair Francis <alistair@alistair23.me>
Disable the ability to write text in rooms where the user doesn't have
write permission.
This fixes: https://gitlab.gnome.org/GNOME/fractal/issues/500
Signed-off-by: Alistair Francis <alistair@alistair23.me>
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>
Currently when opening the room directory and scrolling down, the
already existing rooms will get appended to the list as well as the
new ones causing duplicates.
Only appending new rooms fixes this issue.
A function in directory.rs is currently called set_directory_rooms, but
it's used in a way so that it appends rooms to the directory list.
Renaming the function to append_directory_rooms will clarify what it's
actually doing.
Currently the autocompletion-popover has a margin-left in its stylesheet
which does look misplaced if the window has a small width.
To fix this remove the left margin of the autocompletion-popover once the
transition between the 'narrow' and 'non-narrow' mode happens.
Fixes https://gitlab.gnome.org/GNOME/fractal/issues/516
The quit method of AppOp was called twice because it was called on the
window delete event closure and also in the app shutdown. This patch
removes the call in the window delete event so we only left one call.
Fix https://gitlab.gnome.org/GNOME/fractal/issues/506
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.
Previously we did not enable syntax highlighting if the user
already had markdown enabled during startup. This commit
ensures that we enable it.
Closes https://gitlab.gnome.org/GNOME/fractal/issues/302
We only get the list of direct rooms in the initial sync so that list is
not up to date. This patch reloads the direct rooms hashmap before
trying to update to avoid remove existing direct chat rooms.
Fix https://gitlab.gnome.org/GNOME/fractal/issues/203
GTK 3.24.7 has fixed the gtk_window_present() not working in Wayland
issue described here: https://gitlab.gnome.org/GNOME/gtk/issues/624.
Since this has been fixed update our minimum GTK version and use the
present() function.
Signed-off-by: Alistair Francis <alistair@alistair23.me>