diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 2d1614306b..65ced8e53c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -6,7 +6,7 @@ on:
name: Build
env:
- FLUTTER_VERSION: 3.16.5
+ FLUTTER_VERSION: 3.22.2
XCODE_VERSION: ^15.0.1
jobs:
@@ -19,7 +19,7 @@ jobs:
- os: android
runner: ubuntu-latest
- os: ios
- runner: macos-13
+ runner: macos-latest
fail-fast: false
steps:
- name: Checkout repository
@@ -49,7 +49,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: "temurin" # See 'Supported distributions' for available options
- java-version: "11"
+ java-version: "17"
- name: Select Xcode version
if: matrix.os == 'ios'
diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml
index 752a9acc41..a05f24d3f1 100644
--- a/.github/workflows/gh-pages.yaml
+++ b/.github/workflows/gh-pages.yaml
@@ -2,7 +2,7 @@ on:
pull_request:
env:
- FLUTTER_VERSION: 3.16.5
+ FLUTTER_VERSION: 3.22.2
LIBOLM_VERSION: 3.2.16
name: Deploying on GitHub Pages
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 87059d1728..1a47ab02d1 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -4,7 +4,7 @@ on:
- "v*.*.*"
env:
- FLUTTER_VERSION: 3.16.5
+ FLUTTER_VERSION: 3.22.2
XCODE_VERSION: ^15.0.1
name: Release
@@ -21,7 +21,7 @@ jobs:
- os: android
runner: ubuntu-latest
- os: ios
- runner: macos-13
+ runner: macos-latest
fail-fast: false
steps:
@@ -52,7 +52,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: "temurin" # See 'Supported distributions' for available options
- java-version: "11"
+ java-version: "17"
- name: Select Xcode version
if: matrix.os == 'ios'
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index a830f2f320..69d251ff18 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -4,7 +4,7 @@ on:
name: Tests
env:
- FLUTTER_VERSION: 3.16.5
+ FLUTTER_VERSION: 3.22.2
jobs:
code_analyze:
diff --git a/.gitignore b/.gitignore
index ffacbe6231..b21c33414b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,7 +11,10 @@
.history
.svn/
prime
+
+#generated file
*.g.dart
+**/*.mocks.dart
# libolm package
/assets/js/package
@@ -61,5 +64,4 @@ ios/Podfile.lock
/linux/out
/macos/out
.vs
-olm
-test/interceptor/*.mocks.dart
+olm
\ No newline at end of file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bf37f9041d..2dcffc6a5a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,5 @@
variables:
- FLUTTER_VERSION: 3.16.5
+ FLUTTER_VERSION: 3.22.2
image:
name: cirrusci/flutter:${FLUTTER_VERSION}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 105086f2c2..19c3dc5b17 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,47 @@
-## [2.5.3+2330] - 2024-05-03
+## [2.5.9+2330] - 2024-06-18
+
+### Fixed
+- #1615 Not auto jump to lastest message when user send an attachment in case user seeing older message
+- members list always have to reload
+- #1793 Recent contacts aren't recent
+- #1356 Rework account picker
+- #1635 Irrelevant search results
+- #1698 Group details is small in width
+- #1855 hot-fix: fix the error l10n not found after build runner build
+- #1841 Can't close invitation dialog in Chat
+- #1787 Improve when leave group chat
+- #1812 Remove X from the search bar when it's empty
+- #1644 “Tap to allow access to your Gallery” button is not in center of its container
+- #1602 When typing and shift + ctrl to get a line break, the internal mouse cursor disappears
+- #1825 When adding members to a group chat, search results aren't displayed correctly
+- #1791 Improve display contacts on multiple homeserver
+- #1869 Can not open keyboard when tap on the textfield in IOS
+- #1806 Images are displayed weirdly if they didn't yet load
+- #1587 Can't open chat in chat list when click on notification
+- #1777 Changing greeting message: include tag in greeting message
+
+### Added
+- #1645 Missing counting selected image at send icon
+- Update store metadata
+- update of README.md
+- #979 Improve tom bootstrap dialog
+- #1836 Move the Shared media part to the Profile part
+
+## [2.5.8+2330] - 2024-05-25
+- #1781 Upgrade to Flutter SDK 3.22.0
+
+## [2.5.5+2330] - 2024-05-25
+
+### Fixed
+- #1526 cannot unmute more than 2 chats
+- #1785 Improve logout for multiple accounts
+
+### Added
+- #1722 Recents contacts for contact/search/create group chat screen
+- #1735 Search external contact in search screen
+- #1780 add parameter `app=chat` when connect with TWP platform
+
+## [2.5.3+2330] - 2024-05-19
### Fixed
- #1650: Memory leak problems: Web and Mobile app
diff --git a/Dockerfile b/Dockerfile
index a3478cb6a0..8843fe8c2f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,11 @@
# Specify versions
-ARG FLUTTER_VERSION=3.16.5
-ARG OLM_VERSION=3.2.15
+ARG FLUTTER_VERSION=3.22.2
+ARG OLM_VERSION=3.2.16
+ARG NIX_VERSION=2.22.1
# Building libolm
# libolm only has amd64
-FROM --platform=linux/amd64 nixos/nix AS olm-builder
+FROM --platform=linux/amd64 nixos/nix:${NIX_VERSION} AS olm-builder
ARG OLM_VERSION
RUN nix build -v --extra-experimental-features flakes --extra-experimental-features nix-command gitlab:matrix-org/olm/${OLM_VERSION}?host=gitlab.matrix.org\#javascript
@@ -15,7 +16,6 @@ WORKDIR /app
RUN DEBIAN_FRONTEND=noninteractive apt update && \
apt install -y openssh-client && \
rm -rf assets/js/* && \
- mkdir ~/.ssh && \
ssh-keyscan github.com >> ~/.ssh/known_hosts
COPY --from=olm-builder /result/javascript assets/js/package
RUN --mount=type=ssh,required=true ./scripts/build-web.sh
diff --git a/README.md b/README.md
index e6c0949941..083454110c 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Twake
+# Twake Chat Client
[![Contributors](https://img.shields.io/github/contributors/linagora/twake-on-matrix?label=Contributors
)](
https://github.com/linagora/twake-on-matrix/graphs/contributors
@@ -12,14 +12,21 @@
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 3207d8a0df..f58fd15636 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -32,6 +32,7 @@
+
`surfaceContainerHighest`, `MaterialStateProperty` => `WidgetStateProperty`, `MaterialState` => `WidgetState`, use `super.key` for shorter form (new lint rule)
+- Migration from `RawKeyEvent` to `KeyEvent`. [Read more](https://docs.flutter.dev/release/breaking-changes/key-event-migration#deprecated-apis-that-have-an-equivalent) (in conclusion, add ignore_deprecated, because that when i test it again, the up/down not work)
+- Upgrade flutter_local_notification from `requestPermission` => `requestNotificationsPermission` [Changelog](https://pub.dev/packages/flutter_local_notifications/changelog#16001), [Readmore](https://developer.android.com/develop/ui/views/notifications/notification-permission?hl=vi)
+- Upgrade `url_laucher`, change from `Uri` to `WebUri`, remove `ChromeSafariBrowserSettings` in web
+- Upgrade `the index.html` file in web folder
+- Upgrade other packages in pubspec.yaml to resolve conflicts
\ No newline at end of file
diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index a6b826db27..5e31d3d342 100644
--- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -1,6 +1,6 @@
fallbackValue,
(success) => success is T ? success : fallbackValue,
);
+
+ T? getFailureOrNull({T? fallbackValue}) => fold(
+ (failure) => failure is T ? failure : fallbackValue,
+ (success) => fallbackValue,
+ );
}
diff --git a/lib/config/app_config.dart b/lib/config/app_config.dart
index a991e38881..09f84c35b5 100644
--- a/lib/config/app_config.dart
+++ b/lib/config/app_config.dart
@@ -40,8 +40,14 @@ abstract class AppConfig {
///`HOME_SERVER`: Homeserver, sample is `https://example.com`
static String homeserver = sampleValue;
+ static String appParameter = 'chat';
+
static String? platform;
+ static String _appPolicy = 'https://twake.app/policy';
+
+ static String appTermsOfUse = 'https://twake.app/terms';
+
static double toolbarHeight(BuildContext context) =>
responsive.isMobile(context) ? 48 : 56;
static const Color chatColor = primaryColor;
@@ -52,9 +58,8 @@ abstract class AppConfig {
static const Color primaryColor = Color.fromARGB(255, 135, 103, 172);
static const Color primaryColorLight = Color(0xFFCCBDEA);
static const Color secondaryColor = Color(0xFF41a2bc);
- static String _privacyUrl = 'https://twake.app/en/privacy/';
- static String get privacyUrl => _privacyUrl;
+ static String get privacyUrl => _appPolicy;
static const String enablePushTutorial =
'https://gitlab.com/famedly/fluffychat/-/wikis/Push-Notifications-without-Google-Services';
static const String encryptionTutorial =
@@ -208,7 +213,7 @@ abstract class AppConfig {
_webBaseUrl = json['privacy_url'];
}
if (json['web_base_url'] is String) {
- _privacyUrl = json['web_base_url'];
+ _appPolicy = json['web_base_url'];
}
if (json['render_html'] is bool) {
renderHtml = json['render_html'];
diff --git a/lib/config/first_column_inner_routes.dart b/lib/config/first_column_inner_routes.dart
index 7da75e08b8..faaca731da 100644
--- a/lib/config/first_column_inner_routes.dart
+++ b/lib/config/first_column_inner_routes.dart
@@ -2,7 +2,7 @@ import 'package:fluffychat/pages/new_group/new_group.dart';
import 'package:fluffychat/pages/new_group/new_group_chat_info.dart';
import 'package:fluffychat/pages/new_private_chat/new_private_chat.dart';
import 'package:fluffychat/pages/search/search.dart';
-import 'package:fluffychat/presentation/model/presentation_contact.dart';
+import 'package:fluffychat/presentation/model/contact/presentation_contact.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:flutter/cupertino.dart';
diff --git a/lib/config/go_routes/go_router.dart b/lib/config/go_routes/go_router.dart
index d585d5dd32..808467d4c1 100644
--- a/lib/config/go_routes/go_router.dart
+++ b/lib/config/go_routes/go_router.dart
@@ -22,7 +22,7 @@ import 'package:fluffychat/pages/story/story_page.dart';
import 'package:fluffychat/pages/twake_welcome/twake_welcome.dart';
import 'package:fluffychat/presentation/model/chat/chat_router_input_argument.dart';
import 'package:fluffychat/presentation/model/forward/forward_argument.dart';
-import 'package:fluffychat/presentation/model/presentation_contact.dart';
+import 'package:fluffychat/presentation/model/contact/presentation_contact.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/utils/responsive/responsive_utils.dart';
import 'package:fluffychat/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body.dart';
@@ -375,7 +375,11 @@ abstract class AppRoutes {
redirect: loggedOutRedirect,
pageBuilder: (context, state) => defaultPageBuilder(
context,
- const HomeserverPicker(),
+ TwakeWelcome(
+ arg: state.extra is TwakeWelcomeArg?
+ ? state.extra as TwakeWelcomeArg?
+ : null,
+ ),
),
routes: [
GoRoute(
@@ -386,21 +390,12 @@ abstract class AppRoutes {
),
redirect: loggedOutRedirect,
),
- GoRoute(
- path: 'twakeWelcome',
- pageBuilder: (context, state) => defaultPageBuilder(
- context,
- const TwakeWelcome(),
- ),
- redirect: loggedInRedirect,
- ),
GoRoute(
path: 'homeserverpicker',
pageBuilder: (context, state) => defaultPageBuilder(
context,
const HomeserverPicker(),
),
- redirect: loggedInRedirect,
),
],
),
diff --git a/lib/config/themes.dart b/lib/config/themes.dart
index 4f9cec6b6d..d474774b73 100644
--- a/lib/config/themes.dart
+++ b/lib/config/themes.dart
@@ -199,9 +199,13 @@ abstract class TwakeThemes {
onSecondaryContainer: brightness == Brightness.light
? LinagoraSysColors.material().onSecondaryContainer
: LinagoraSysColors.material().onSecondaryContainerDark,
+ // TODO: remove when the color scheme is updated
+ // ignore: deprecated_member_use
background: brightness == Brightness.light
? LinagoraSysColors.material().background
: LinagoraSysColors.material().backgroundDark,
+ // TODO: remove when the color scheme is updated
+ // ignore: deprecated_member_use
onBackground: brightness == Brightness.light
? LinagoraSysColors.material().onBackground
: LinagoraSysColors.material().onBackgroundDark,
@@ -226,7 +230,7 @@ abstract class TwakeThemes {
surfaceTint: brightness == Brightness.light
? LinagoraSysColors.material().surfaceTint
: LinagoraSysColors.material().surfaceTintDark,
- surfaceVariant: brightness == Brightness.light
+ surfaceContainerHighest: brightness == Brightness.light
? LinagoraSysColors.material().surfaceVariant
: LinagoraSysColors.material().surfaceVariantDark,
onSurfaceVariant: brightness == Brightness.light
@@ -252,8 +256,8 @@ abstract class TwakeThemes {
),
iconButtonTheme: IconButtonThemeData(
style: ButtonStyle(
- iconSize: MaterialStateProperty.all(iconSize),
- iconColor: MaterialStateProperty.all(
+ iconSize: WidgetStateProperty.all(iconSize),
+ iconColor: WidgetStateProperty.all(
brightness == Brightness.light
? LinagoraSysColors.material().onSurface
: LinagoraSysColors.material().onSurfaceDark,
@@ -268,9 +272,9 @@ abstract class TwakeThemes {
),
switchTheme: SwitchThemeData(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
- overlayColor: MaterialStateProperty.resolveWith(
- (Set states) {
- if (states.contains(MaterialState.selected)) {
+ overlayColor: WidgetStateProperty.resolveWith(
+ (Set states) {
+ if (states.contains(WidgetState.selected)) {
return brightness == Brightness.light
? LinagoraSysColors.material().primary
: LinagoraSysColors.material().primaryDark;
@@ -281,9 +285,9 @@ abstract class TwakeThemes {
}
},
),
- thumbColor: MaterialStateProperty.resolveWith(
- (Set states) {
- if (states.contains(MaterialState.selected)) {
+ thumbColor: WidgetStateProperty.resolveWith(
+ (Set states) {
+ if (states.contains(WidgetState.selected)) {
return brightness == Brightness.light
? LinagoraSysColors.material().onPrimary
: LinagoraSysColors.material().onPrimaryDark;
@@ -294,9 +298,9 @@ abstract class TwakeThemes {
}
},
),
- trackColor: MaterialStateProperty.resolveWith(
- (Set states) {
- if (states.contains(MaterialState.selected)) {
+ trackColor: WidgetStateProperty.resolveWith(
+ (Set states) {
+ if (states.contains(WidgetState.selected)) {
return brightness == Brightness.light
? LinagoraSysColors.material().primary
: LinagoraSysColors.material().primaryDark;
diff --git a/lib/data/datasource/tom_configurations_datasource.dart b/lib/data/datasource/tom_configurations_datasource.dart
index a39ae18400..6cfac3820c 100644
--- a/lib/data/datasource/tom_configurations_datasource.dart
+++ b/lib/data/datasource/tom_configurations_datasource.dart
@@ -7,4 +7,6 @@ abstract class ToMConfigurationsDatasource {
String userId,
ToMConfigurations toMConfigurations,
);
+
+ Future deleteTomConfigurations(String userId);
}
diff --git a/lib/data/datasource_impl/tom_configurations_datasource_impl.dart b/lib/data/datasource_impl/tom_configurations_datasource_impl.dart
index b6914654ed..2a51dc247a 100644
--- a/lib/data/datasource_impl/tom_configurations_datasource_impl.dart
+++ b/lib/data/datasource_impl/tom_configurations_datasource_impl.dart
@@ -46,4 +46,10 @@ class HiveToMConfigurationDatasource implements ToMConfigurationsDatasource {
.toJson(),
);
}
+
+ @override
+ Future deleteTomConfigurations(String userId) {
+ final hiveCollectionToMDatabase = getIt.get();
+ return hiveCollectionToMDatabase.tomConfigurationsBox.delete(userId);
+ }
}
diff --git a/lib/data/network/exception/dio_duplicate_download_exception.dart b/lib/data/network/exception/dio_duplicate_download_exception.dart
index b9ad49d8d2..c2a8ee41fc 100644
--- a/lib/data/network/exception/dio_duplicate_download_exception.dart
+++ b/lib/data/network/exception/dio_duplicate_download_exception.dart
@@ -2,10 +2,9 @@ import 'package:dio/dio.dart';
import 'package:equatable/equatable.dart';
class DioDuplicateDownloadException extends DioException with EquatableMixin {
- DioDuplicateDownloadException({required RequestOptions requestOptions})
+ DioDuplicateDownloadException({required super.requestOptions})
: super(
message: 'Download already in progress',
- requestOptions: requestOptions,
type: DioExceptionType.unknown,
);
diff --git a/lib/data/network/extensions/file_info_extension.dart b/lib/data/network/extensions/file_info_extension.dart
index 7ba5ae3005..fa1ffa2a30 100644
--- a/lib/data/network/extensions/file_info_extension.dart
+++ b/lib/data/network/extensions/file_info_extension.dart
@@ -1,13 +1,10 @@
-import 'package:flutter/foundation.dart';
+import 'package:fluffychat/utils/mime_type_uitls.dart';
import 'package:matrix/matrix.dart';
-import 'package:mime/mime.dart';
extension FileInfoExtension on FileInfo {
String get fileExtension => fileName.split('.').last;
- String get mimeType =>
- lookupMimeType(kIsWeb ? fileName : filePath) ??
- 'application/octet-stream';
+ String get mimeType => MimeTypeUitls.instance.getTwakeMimeType(filePath);
Map get metadata => ({
'mimetype': mimeType,
diff --git a/lib/data/repository/contact/tom_contact_repository_impl.dart b/lib/data/repository/contact/tom_contact_repository_impl.dart
index 0abbb32e13..ef0a03b30d 100644
--- a/lib/data/repository/contact/tom_contact_repository_impl.dart
+++ b/lib/data/repository/contact/tom_contact_repository_impl.dart
@@ -11,18 +11,16 @@ class TomContactRepositoryImpl implements ContactRepository {
TomContactRepositoryImpl();
@override
- Stream> fetchContacts({
+ Future> fetchContacts({
required ContactQuery query,
int? limit,
int? offset,
- }) async* {
- final response = await datasource.fetchContacts(
+ }) async {
+ return datasource.fetchContacts(
query: query,
limit: limit,
offset: offset,
);
-
- yield response;
}
@override
diff --git a/lib/data/repository/tom_configurations_repository_impl.dart b/lib/data/repository/tom_configurations_repository_impl.dart
index 4a8bcdc115..9ddecd06f0 100644
--- a/lib/data/repository/tom_configurations_repository_impl.dart
+++ b/lib/data/repository/tom_configurations_repository_impl.dart
@@ -22,4 +22,9 @@ class ToMConfigurationsRepositoryImpl implements ToMConfigurationsRepository {
toMConfigurations,
);
}
+
+ @override
+ Future deleteTomConfigurations(String userId) {
+ return tomConfigurationsDatasource.deleteTomConfigurations(userId);
+ }
}
diff --git a/lib/domain/app_state/contact/get_contacts_state.dart b/lib/domain/app_state/contact/get_contacts_state.dart
index 59b2811991..66976f4645 100644
--- a/lib/domain/app_state/contact/get_contacts_state.dart
+++ b/lib/domain/app_state/contact/get_contacts_state.dart
@@ -28,6 +28,13 @@ class GetContactsSuccess extends Success {
List