Skip to content

Commit

Permalink
Merge branch 'main' into sort-system-lang
Browse files Browse the repository at this point in the history
  • Loading branch information
ggurdin committed Dec 13, 2023
2 parents ede7750 + d2e5536 commit 807a01a
Show file tree
Hide file tree
Showing 26 changed files with 749 additions and 255 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- run: echo "$WEB_APP_ENV" > .env
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
Expand All @@ -31,7 +30,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- run: echo "$WEB_APP_ENV" > .env
- uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
Expand All @@ -47,7 +45,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- run: echo "$WEB_APP_ENV" > .env
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
Expand All @@ -62,7 +59,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- run: echo "$WEB_APP_ENV" > .env
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
Expand All @@ -77,7 +73,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- run: echo "$WEB_APP_ENV" > .env
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/main_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ on:
push:
branches:
- main
- pangea-merge

env:
# Setting an environment variable with the value of a configuration variable
WEB_APP_ENV: ${{ vars.WEB_APP_ENV }}

jobs:
deploy_web:
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v2
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- run: echo "$WEB_APP_ENV" > .env
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
Expand All @@ -23,18 +26,20 @@ jobs:
- name: Prepare web
run: ./scripts/prepare-web.sh
- name: Build Release Web
run: flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --release --source-maps --base-href "/client/"
run: ./scripts/build-web.sh
- name: Build Website
run: |
mv build/web public
mv .env public/.env
touch public/.env
echo "$WEB_APP_ENV" >> public/.env
cp public/.env public/assets/.env
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages
# cname: app.staging.pangea.chat.im
# cname: app.staging.pangea.chat

update_sentry:
runs-on: ubuntu-latest
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/old.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Old Release Workflow
on:
push:
branches:
- main
- pangea-merge
- master-unused

concurrency:
group: release_workflow
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ jobs:
- name: Build Release Web
run: flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --release --source-maps
- name: Create archive
run: tar -czf fluffychat-web.tar.gz build/web/
run: tar -czf pangeachat-web.tar.gz build/web/
- name: Upload Web Build
uses: actions/upload-artifact@v2
with:
name: Web Build
path: fluffychat-web.tar.gz
path: pangeachat-web.tar.gz
- name: Upload to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: fluffychat-web.tar.gz
asset_name: fluffychat-web.tar.gz
asset_path: pangeachat-web.tar.gz
asset_name: pangeachat-web.tar.gz
asset_content_type: application/gzip

build_apk:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
.svn/
prime
*.env
!/public/.env

# libolm package
/assets/js/package
Expand Down
19 changes: 17 additions & 2 deletions assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3339,7 +3339,12 @@
"downloadTxtFile": "Download Text File",
"downloadCSVFile": "Download CSV File",
"promotionalSubscriptionDesc": "You currently have a lifetime promotional subscription. Message [email protected] for help changing your subscription.",
"originalSubscriptionPlatform": "Subscription purchased through",
"originalSubscriptionPlatform": "Subscription purchased through {purchasePlatform}",
"@originalSubscriptionPlatform": {
"placeholders": {
"purchasePlatform": {}
}
},
"oneWeekTrial": "One Week Trial",
"creatingSpacePleaseWait": "Creating space. Please wait...",
"downloadXLSXFile": "Download Excel File",
Expand Down Expand Up @@ -3938,5 +3943,15 @@
"groupName": "Group name",
"createGroupAndInviteUsers": "Create a group and invite users",
"groupCanBeFoundViaSearch": "Group can be found via search",
"inNoSpaces": "You are not a member of any classes or exchanges"
"trialExpiration": "Your free trial expires on {expiration}",
"@trialExpiration": {
"placeholders": {
"expiration": {}
}
},
"freeTrialDesc": "New users recieve a one week free trial of Pangea Chat",
"activateTrial": "Activate Trial",
"inNoSpaces": "You are not a member of any classes or exchanges",
"successfullySubscribed": "You have successfully subscribed!",
"clickToManageSubscription": "Click here to manage your subscription."
}
8 changes: 4 additions & 4 deletions config.sample.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"application_name": "FluffyChat",
"application_name": "PangeaChat",
"application_welcome_message": null,
"default_homeserver": "matrix.org",
"web_base_url": "https://fluffychat.im/web",
"privacy_url": "https://fluffychat.im/en/privacy.html",
"default_homeserver": "matrix.pangea.chat",
"web_base_url": "https://web.pangea.chat",
"privacy_url": "https://pangea.chat/privacy",
"render_html": false,
"hide_redacted_events": false,
"hide_unknown_events": false
Expand Down
5 changes: 3 additions & 2 deletions lib/config/app_config.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:ui';

import 'package:matrix/matrix.dart';

import 'package:fluffychat/pangea/config/environment.dart';
// Project imports:
import 'package:matrix/matrix.dart';

abstract class AppConfig {
// #Pangea
Expand Down Expand Up @@ -121,6 +121,7 @@ abstract class AppConfig {
"https://buy.stripe.com/test_bIY6ssd8z5Uz8ec8ww";
static String iosPromoCode =
"https://apps.apple.com/redeem?ctx=offercodes&id=1445118630&code=";
static String trialSubscriptionId = "pangea_new_user_trial";
// Pangea#

static void loadFromJson(Map<String, dynamic> json) {
Expand Down
18 changes: 9 additions & 9 deletions lib/pages/chat_details/chat_details_view.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import 'package:flutter/material.dart';

import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:go_router/go_router.dart';
import 'package:matrix/matrix.dart';

import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pages/chat_details/chat_details.dart';
import 'package:fluffychat/pages/chat_details/participant_list_item.dart';
Expand All @@ -26,6 +19,11 @@ import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/chat_settings_popup_menu.dart';
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
import 'package:fluffychat/widgets/matrix.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:go_router/go_router.dart';
import 'package:matrix/matrix.dart';

class ChatDetailsView extends StatelessWidget {
final ChatDetailsController controller;
Expand Down Expand Up @@ -546,8 +544,10 @@ class ChatDetailsView extends StatelessWidget {
backgroundColor:
Theme.of(context).scaffoldBackgroundColor,
foregroundColor: iconColor,
child: const Icon(
Icons.lock_outlined,
child: Icon(
room.locked
? Icons.lock_outlined
: Icons.no_encryption_outlined,
),
),
value: room.locked,
Expand Down
38 changes: 24 additions & 14 deletions lib/pages/chat_list/chat_list.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
import 'dart:async';
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:collection/collection.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:go_router/go_router.dart';
import 'package:matrix/matrix.dart';
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
import 'package:uni_links/uni_links.dart';

// Project imports:
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pages/chat_list/chat_list_view.dart';
Expand All @@ -24,20 +14,30 @@ import 'package:fluffychat/pangea/utils/add_to_space.dart';
import 'package:fluffychat/pangea/utils/chat_list_handle_space_tap.dart';
import 'package:fluffychat/pangea/utils/error_handler.dart';
import 'package:fluffychat/pangea/utils/firebase_analytics.dart';
import 'package:fluffychat/pangea/widgets/subscription/subscription_snackbar.dart';
import 'package:fluffychat/utils/localized_exception_extension.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/client_stories_extension.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/utils/tor_stub.dart'
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:go_router/go_router.dart';
import 'package:matrix/matrix.dart';
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
import 'package:uni_links/uni_links.dart';

import '../../../utils/account_bundles.dart';
import '../../utils/matrix_sdk_extensions/matrix_file_extension.dart';
import '../../utils/url_launcher.dart';
import '../../utils/voip/callkeep_manager.dart';
import '../../widgets/fluffy_chat_app.dart';
import '../../widgets/matrix.dart';

import 'package:fluffychat/utils/tor_stub.dart'
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';

enum SelectMode {
normal,
share,
Expand Down Expand Up @@ -445,6 +445,7 @@ class ChatListController extends State<ChatList>
//#Pangea
StreamSubscription? classStream;
StreamSubscription? _invitedSpaceSubscription;
StreamSubscription? _subscriptionStatusStream;
//Pangea#

@override
Expand Down Expand Up @@ -502,6 +503,14 @@ class ChatListController extends State<ChatList>
}
}
});

_subscriptionStatusStream = pangeaController
.subscriptionController.subscriptionStream.stream
.listen((event) {
if (mounted) {
showSubscribedSnackbar(context);
}
});
//Pangea#

super.initState();
Expand All @@ -515,6 +524,7 @@ class ChatListController extends State<ChatList>
//#Pangea
classStream?.cancel();
_invitedSpaceSubscription?.cancel();
_subscriptionStatusStream?.cancel();
//Pangea#
scrollController.removeListener(_onScroll);
super.dispose();
Expand Down
30 changes: 26 additions & 4 deletions lib/pages/login/login_view.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Flutter imports:

import 'package:fluffychat/pangea/utils/password_forgotten.dart';
import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
import 'package:flutter/material.dart';

import 'package:flutter_gen/gen_l10n/l10n.dart';

import 'package:fluffychat/pangea/utils/password_forgotten.dart';
import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
import 'login.dart';

class LoginView extends StatelessWidget {
Expand All @@ -20,7 +19,30 @@ class LoginView extends StatelessWidget {
// enforceMobileMode: Matrix.of(context).client.isLogged(),
// Pangea#
appBar: AppBar(
leading: controller.loading ? null : const BackButton(),
// #Pangea
// leading: controller.loading ? null : const BackButton(),
leading: controller.loading
? null
: Padding(
padding: const EdgeInsets.only(left: 10),
child: ElevatedButton(
onPressed: () => Navigator.of(context).pop(),
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
backgroundColor: MaterialStateProperty.all<Color>(
Theme.of(context)
.colorScheme
.background
.withOpacity(0.75),
),
shape: MaterialStateProperty.all<OutlinedBorder>(
const CircleBorder(),
),
),
child: const Icon(Icons.arrow_back),
),
),
// Pangea#
automaticallyImplyLeading: !controller.loading,
centerTitle: true,
// #Pangea
Expand Down
4 changes: 4 additions & 0 deletions lib/pangea/constants/local.key.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ class PLocalKey {
static const String classes = 'classes';

static const String cachedClassCodeToJoin = "cachedclasscodetojoin";
static const String beganWebPayment = "beganWebPayment";

// making this a random string so that it's harder to guess
static const String activatedTrialKey = '7C4EuKIsph';
}
Loading

0 comments on commit 807a01a

Please sign in to comment.