diff --git a/gomuks b/gomuks index 0e06c7b..9444dd2 160000 --- a/gomuks +++ b/gomuks @@ -1 +1 @@ -Subproject commit 0e06c7b74f96d3e29a8101893ca1921d13a90573 +Subproject commit 9444dd293664c300c6e710bb6cddcd9c6cab365d diff --git a/lib/controllers/client.dart b/lib/controllers/client.dart index af44d2f..b7d1eb4 100644 --- a/lib/controllers/client.dart +++ b/lib/controllers/client.dart @@ -2,7 +2,6 @@ import "dart:ffi"; import "dart:io"; import "dart:isolate"; import "dart:math"; - import "package:fast_immutable_collections/fast_immutable_collections.dart"; import "package:ffi/ffi.dart"; import "package:flutter/foundation.dart"; @@ -262,13 +261,8 @@ class ClientController extends AsyncNotifier { Future paginate(PaginateRequest request) async => .fromJson(await _sendCommand("paginate", request.toJson())); - Future getProfile(String userId) async { - try { - return .fromJson(await _sendCommand("get_profile", {"user_id": userId})); - } catch (_) { - return ProfileResponse(profile: .new(id: userId)); - } - } + Future getProfile(String userId) async => + .fromJson(await _sendCommand("get_profile", {"user_id": userId})); Future reportEvent(ReportRequest request) => _sendCommand("report_event", request.toJson()); diff --git a/lib/models/profile_response.dart b/lib/models/profile_response.dart index fcaaf2e..8984bcf 100644 --- a/lib/models/profile_response.dart +++ b/lib/models/profile_response.dart @@ -9,7 +9,7 @@ part "profile_response.g.dart"; @JsonSerializable() class const ProfileResponse({ @JsonKey(fromJson: Profile.fromJson) required final Profile profile, - final Bio? bio, + required final Bio? bio, }) with _$ProfileResponse { Map toJson() => _$ProfileResponseToJson(this); diff --git a/lib/widgets/url_preview.dart b/lib/widgets/url_preview.dart index 5eda427..37a2733 100644 --- a/lib/widgets/url_preview.dart +++ b/lib/widgets/url_preview.dart @@ -31,15 +31,9 @@ class const UrlPreview(final Uri link, {super.key}) extends ConsumerWidget { Text( preview.title!, style: Theme.of(context).textTheme.titleLarge, - maxLines: 3, - overflow: .ellipsis, ), if (preview.description != null) ...[ - Text( - preview.description!, - maxLines: 20, - overflow: .ellipsis, - ), + Text(preview.description!), SizedBox(height: 4), ], if (preview.imageUrl != null) diff --git a/lib/widgets/user_bottom_sheet.dart b/lib/widgets/user_bottom_sheet.dart index feeb5a1..a725613 100644 --- a/lib/widgets/user_bottom_sheet.dart +++ b/lib/widgets/user_bottom_sheet.dart @@ -200,35 +200,36 @@ final class const UserBottomSheet( ), if (ref.watch( - PowerLevelController.provider( - .membershipAction( - action: .kick, - roomId: roomId!, - targetUser: userId, - ), - ), - )) + PowerLevelController.provider( + .membershipAction( + action: .kick, + roomId: roomId!, + targetUser: userId, + ), + ), + ) && + member.status == .join || + member.status == .invite) Padding( padding: .only(top: 4), child: Row( mainAxisSize: MainAxisSize.max, spacing: 8, children: [ - if (member.status == .join || member.status == .invite) - M3EButton.icon( - onPressed: () => showMembershipDialog(.kick), - shape: .square, - icon: Icon(Icons.sports_martial_arts), - label: Text("Kick"), - decoration: .new( - backgroundColor: WidgetStatePropertyAll( - theme.colorScheme.error, - ), - foregroundColor: WidgetStatePropertyAll( - theme.colorScheme.onError, - ), + M3EButton.icon( + onPressed: () => showMembershipDialog(.kick), + shape: .square, + icon: Icon(Icons.sports_martial_arts), + label: Text("Kick"), + decoration: .new( + backgroundColor: WidgetStatePropertyAll( + theme.colorScheme.error, + ), + foregroundColor: WidgetStatePropertyAll( + theme.colorScheme.onError, ), ), + ), M3EButton.icon( onPressed: () => showMembershipDialog(.ban),