Browse Source

chore: Upgrade crate dependencies

pipelines/786320
Kévin Commaille 1 year ago
parent
commit
9048261ccd
No known key found for this signature in database
GPG Key ID: C971D9DBC9D678D
  1. 683
      Cargo.lock
  2. 18
      Cargo.toml
  3. 10
      src/components/context_menu_bin.rs
  4. 4
      src/components/crypto/identity_setup_view.rs
  5. 2
      src/components/label_with_widgets.rs
  6. 8
      src/components/power_level_selection/row.rs
  7. 4
      src/session/model/room/aliases.rs
  8. 28
      src/session/model/room/mod.rs
  9. 2
      src/session/model/room/timeline/virtual_item.rs
  10. 4
      src/session/view/content/room_history/message_toolbar/completion/completion_popover.rs
  11. 2
      src/session/view/content/room_history/sender_avatar/mod.rs
  12. 12
      src/utils/location/linux.rs
  13. 18
      src/utils/media/image/mod.rs

683
Cargo.lock generated

File diff suppressed because it is too large Load Diff

18
Cargo.toml

@ -3,7 +3,7 @@ name = "fractal"
version = "9.0.0"
authors = ["Julian Sparber <julian@sparber.net>"]
edition = "2021"
rust-version = "1.80"
rust-version = "1.82"
publish = false
[profile.release]
@ -41,7 +41,7 @@ serde = "1"
serde_json = "1"
strum = { version = "0.26", features = ["derive"] }
tempfile = "3"
thiserror = "1"
thiserror = "2"
tld = "2"
tokio = { version = "1", features = ["rt", "rt-multi-thread", "sync"] }
tokio-stream = { version = "0.1", features = ["sync"] }
@ -65,8 +65,9 @@ shumate = { package = "libshumate", version = "0.6" }
sourceview = { package = "sourceview5", version = "0.9" }
[dependencies.matrix-sdk]
git = "https://github.com/matrix-org/matrix-rust-sdk.git"
rev = "e55a1c7e00d2693d87d798f09852161d5cbf0495"
version = "0.9"
# git = "https://github.com/matrix-org/matrix-rust-sdk.git"
# rev = "866b5fea40bea68be870f3cf02d59401c2d9933f"
features = [
"socks",
"sso-login",
@ -75,11 +76,12 @@ features = [
]
[dependencies.matrix-sdk-ui]
git = "https://github.com/matrix-org/matrix-rust-sdk.git"
rev = "e55a1c7e00d2693d87d798f09852161d5cbf0495"
version = "0.9"
# git = "https://github.com/matrix-org/matrix-rust-sdk.git"
# rev = "866b5fea40bea68be870f3cf02d59401c2d9933f"
[dependencies.ruma]
version = "0.11"
version = "0.12"
# git = "https://github.com/ruma/ruma.git"
# rev = "26165b23fc2ae9928c5497a21db3d31f4b44cc2a"
features = [
@ -97,7 +99,7 @@ features = [
# Linux-only dependencies.
[target.'cfg(target_os = "linux")'.dependencies]
ashpd = { version = "0.9", default-features = false, features = [
ashpd = { version = "0.10", default-features = false, features = [
"pipewire",
"tracing",
"tokio",

10
src/components/context_menu_bin.rs

@ -159,10 +159,7 @@ mod imp {
let obj = self.obj();
if let Some(popover) = prev_popover {
if popover
.parent()
.is_some_and(|w| &w == obj.upcast_ref::<gtk::Widget>())
{
if popover.parent().is_some_and(|w| w == *obj) {
popover.unparent();
}
}
@ -176,10 +173,7 @@ mod imp {
#[weak]
obj,
move |popover| {
if !popover
.parent()
.is_some_and(|w| &w == obj.upcast_ref::<gtk::Widget>())
{
if popover.parent().is_none_or(|w| w != obj) {
obj.imp().popover.disconnect_signals();
}
}

4
src/components/crypto/identity_setup_view.rs

@ -328,11 +328,11 @@ mod imp {
self.verification_page.set_verification(verification);
if has_verification
&& !self
&& self
.navigation
.visible_page()
.and_then(|p| p.tag())
.is_some_and(|t| t == CryptoIdentitySetupPage::Verify.as_ref())
.is_none_or(|t| t != CryptoIdentitySetupPage::Verify.as_ref())
{
self.navigation
.push_by_tag(CryptoIdentitySetupPage::Verify.as_ref());

2
src/components/label_with_widgets.rs

@ -186,7 +186,7 @@ mod imp {
/// Allocate shapes in the Pango layout for the child widgets.
fn allocate_shapes(&self) {
if !self.label.borrow().as_ref().is_some_and(|s| !s.is_empty()) {
if self.label.borrow().as_ref().is_none_or(String::is_empty) {
// No need to compute shapes if the label is empty.
return;
}

8
src/components/power_level_selection/row.rs

@ -166,10 +166,10 @@ mod imp {
/// Update the position of the selected label.
fn update_selected_position(&self) {
if self.use_subtitle.get() {
if !self
if self
.selected_box
.parent()
.is_some_and(|p| p == *self.subtitle_bin)
.is_none_or(|p| p != *self.subtitle_bin)
{
if self.selected_box.parent().is_some() {
self.combo_selection_bin.set_child(None::<&gtk::Widget>);
@ -177,10 +177,10 @@ mod imp {
self.subtitle_bin.set_child(Some(&*self.selected_box));
}
} else if !self
} else if self
.selected_box
.parent()
.is_some_and(|p| p == *self.combo_selection_bin)
.is_none_or(|p| p != *self.combo_selection_bin)
{
if self.selected_box.parent().is_some() {
self.subtitle_bin.set_child(None::<&gtk::Widget>);

4
src/session/model/room/aliases.rs

@ -103,7 +103,7 @@ mod imp {
// Check if aliases were changed in the current list.
for (i, old_alias) in old_aliases.iter().enumerate() {
if !alt_aliases.get(i).is_some_and(|alias| alias == old_alias) {
if alt_aliases.get(i).is_none_or(|alias| alias != old_alias) {
pos = Some(i);
break;
}
@ -245,7 +245,7 @@ impl RoomAliases {
.unwrap_or_default();
// Remove the canonical alias, if it is there.
if !event_content.alias.take().is_some_and(|a| a == *alias) {
if event_content.alias.take().is_none_or(|a| a != *alias) {
// Nothing to do.
return Err(());
}

28
src/session/model/room/mod.rs

@ -540,7 +540,7 @@ mod imp {
self.set_up_typing();
}
RoomState::Left | RoomState::Knocked => {}
RoomState::Left | RoomState::Knocked | RoomState::Banned => {}
RoomState::Invited => {
spawn!(
glib::Priority::DEFAULT_IDLE,
@ -588,7 +588,7 @@ mod imp {
}
}
RoomState::Invited => RoomCategory::Invited,
RoomState::Left | RoomState::Knocked => RoomCategory::Left,
RoomState::Left | RoomState::Knocked | RoomState::Banned => RoomCategory::Left,
};
self.set_category(category);
@ -877,17 +877,21 @@ mod imp {
async fn direct_user_id(&self) -> Option<OwnedUserId> {
let matrix_room = self.matrix_room();
// Check if the room direct and if there only one target.
let direct_targets = matrix_room.direct_targets();
if direct_targets.len() != 1 {
// It was a direct chat with several users.
// Check if the room is direct and if there is only one target.
let mut direct_targets = matrix_room
.direct_targets()
.into_iter()
.filter_map(|id| OwnedUserId::try_from(id).ok());
let Some(direct_target_user_id) = direct_targets.next() else {
// It is not a direct chat.
return None;
}
};
let direct_target_user_id = direct_targets
.into_iter()
.next()
.expect("there is 1 direct target");
if direct_targets.next().is_some() {
// It is a direct chat with several users.
return None;
}
// Check that there are still at most 2 members.
let members_count = matrix_room.active_members_count();
@ -1132,7 +1136,7 @@ mod imp {
/// Update the visibility of the history.
fn update_history_visibility(&self) {
let matrix_room = self.matrix_room();
let visibility = matrix_room.history_visibility().into();
let visibility = matrix_room.history_visibility_or_default().into();
if self.history_visibility.get() == visibility {
return;

2
src/session/model/room/timeline/virtual_item.rs

@ -93,7 +93,7 @@ impl VirtualItem {
/// Create a new `VirtualItem` from a virtual timeline item.
pub fn new(item: &VirtualTimelineItem) -> Self {
match item {
VirtualTimelineItem::DayDivider(ts) => Self::day_divider_with_timestamp(*ts),
VirtualTimelineItem::DateDivider(ts) => Self::day_divider_with_timestamp(*ts),
VirtualTimelineItem::ReadMarker => Self::new_messages(),
}
}

4
src/session/view/content/room_history/message_toolbar/completion/completion_popover.rs

@ -572,9 +572,9 @@ impl CompletionPopover {
/// Show the popover.
fn popup(&self) {
if !self
if self
.selected_row_index()
.is_some_and(|index| index < self.imp().visible_rows_count())
.is_none_or(|index| index >= self.imp().visible_rows_count())
{
self.select_row_at_index(Some(0));
}

2
src/session/view/content/room_history/sender_avatar/mod.rs

@ -403,7 +403,7 @@ mod imp {
#[weak]
obj,
move |popover| {
if !popover.parent().is_some_and(|w| w == obj) {
if popover.parent().is_none_or(|w| w != obj) {
let imp = obj.imp();
imp.popover.disconnect_signals();

12
src/utils/location/linux.rs

@ -1,11 +1,8 @@
//! Linux Location API.
use ashpd::{
desktop::{
location::{Accuracy, Location as PortalLocation, LocationProxy},
Session,
},
WindowIdentifier,
use ashpd::desktop::{
location::{Accuracy, Location as PortalLocation, LocationProxy},
Session,
};
use futures_util::{future, stream, FutureExt, Stream, StreamExt, TryFutureExt};
use geo_uri::GeoUri;
@ -122,14 +119,13 @@ mod imp {
spawn_tokio!(async move {
let (proxy, session) = &*proxy;
let identifier = WindowIdentifier::default();
// We want to be listening for new locations whenever the session is up
// otherwise we might lose the first response and will have to wait for a future
// update by geoclue.
let mut stream = proxy.receive_location_updated().await?;
let (_, first_location) = future::try_join(
proxy.start(session, &identifier).into_future(),
proxy.start(session, None).into_future(),
stream.next().map(|l| l.ok_or(ashpd::Error::NoResponse)),
)
.await?;

18
src/utils/media/image/mod.rs

@ -5,7 +5,7 @@ use std::{error::Error, fmt, str::FromStr, sync::Arc};
use gettextrs::gettext;
use gtk::{gdk, gio, graphene, gsk, prelude::*};
use matrix_sdk::{
attachment::{BaseImageInfo, BaseThumbnailInfo, Thumbnail},
attachment::{BaseImageInfo, Thumbnail},
media::{MediaFormat, MediaRequestParameters, MediaThumbnailSettings},
Client,
};
@ -396,19 +396,16 @@ impl TextureThumbnailer {
let encoder = webp::Encoder::new(&data, webp_layout, dimensions.width, dimensions.height);
let data = encoder.encode(WEBP_DEFAULT_QUALITY).to_vec();
let size = data.len().try_into().ok()?;
let content_type =
mime::Mime::from_str(WEBP_CONTENT_TYPE).expect("content type should be valid");
let thumbnail_info = BaseThumbnailInfo {
width: Some(dimensions.width.into()),
height: Some(dimensions.height.into()),
size: data.len().try_into().ok(),
};
Some(Thumbnail {
data,
content_type,
info: Some(thumbnail_info),
width: dimensions.width.into(),
height: dimensions.height.into(),
size,
})
}
}
@ -523,9 +520,10 @@ impl ImageSource<'_> {
/// accept to create a thumbnail of those.
fn can_be_thumbnailed(&self) -> bool {
!self.source.is_encrypted()
&& !self
&& self
.info
.is_some_and(|i| i.mimetype.is_some_and(|m| m == SVG_CONTENT_TYPE))
.and_then(|i| i.mimetype)
.is_none_or(|m| m != SVG_CONTENT_TYPE)
}
/// The filesize of this source.

Loading…
Cancel
Save