Skip to content

Commit

Permalink
Merge branch 'develop' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
4ster1sk committed Dec 22, 2024
2 parents 0a705c0 + b01c83c commit cad5801
Show file tree
Hide file tree
Showing 51 changed files with 814 additions and 220 deletions.
4 changes: 2 additions & 2 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"flutter": "3.24.3"
}
"flutter": "3.24.5"
}
4 changes: 0 additions & 4 deletions .github/workflows/windows_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ jobs:
- name: Delete unnecessary DLL
run: |
rm build\windows\x64\runner\Release\api-ms-*.dll
rm build\windows\x64\runner\Release\concrt140.dll
rm build\windows\x64\runner\Release\msvcp*.dll
rm build\windows\x64\runner\Release\ucrtbas*.dll
rm build\windows\x64\runner\Release\vc*.dll
- name: Get translation files for Inno Setup
run: |
Expand Down
5 changes: 3 additions & 2 deletions README-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ MiriaはiOS, Android向けMisskeyクライアントです。Windowsでも動作
- [Play Store](https://play.google.com/store/apps/details?id=info.shiosyakeyakini.miria)
- [App Store](https://apps.apple.com/jp/app/miria/id6449201469)
- 最新版をGitHubからインストール
- [GitHub最新版のリリース(Windows版もあります)](https://github.com/shiosyakeyakini-info/miria/releases/latest)
- [GitHub最新版のリリース(Windows版とSnapパッケージもあります)](https://github.com/shiosyakeyakini-info/miria/releases/latest)
- [Obtainium(APKマネージャー)](https://apps.obtainium.imranr.dev/redirect?r=obtainium://app/%7B%22id%22%3A%22info.shiosyakeyakini.miria%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2Fshiosyakeyakini-info%2Fmiria%22%2C%22author%22%3A%22shiosyakeyakini-info%22%2C%22name%22%3A%22miria%22%2C%22additionalSettings%22%3A%22%7B%5C%22includePrereleases%5C%22%3Atrue%2C%5C%22fallbackToOlderReleases%5C%22%3Atrue%2C%5C%22verifyLatestTag%5C%22%3Afalse%2C%5C%22dontSortReleasesList%5C%22%3Afalse%2C%5C%22releaseTitleAsVersion%5C%22%3Afalse%2C%5C%22trackOnly%5C%22%3Afalse%2C%5C%22versionDetection%5C%22%3Atrue%7D%22%2C%22overrideSource%22%3Anull%7D)
- 最新版をTestFlightからインストール
- [TestFlight](https://testflight.apple.com/join/X6Q7pE98)

Expand All @@ -37,7 +38,7 @@ MiriaはiOS, Android向けMisskeyクライアントです。Windowsでも動作
- ただし、一部の機能を独自に取り込んだり、特定のサーバー向けの実装を行っている場合があります。
- MiriaはMisskey v13以上とそれらのフォークされたサーバーでのみ動作します。
- [Sharkey](https://joinsharkey.org/)[CherryPick](https://github.com/kokonect-link/cherrypick)[もこきー](https://mkkey.net/)では動作するかもしれませんが、テストは行われていません。
- [Firefish](https://joinfirefish.org/ja/)[Catodon](https://catodon.social/)およびMastodonへは今後もサポートする予定はありません。
- [Iceshrimp](https://iceshrimp.dev/)[Catodon](https://catodon.social/)およびMastodonへは今後もサポートする予定はありません。
- MiriaはAiScript関連の機能(プラグイン、Play)は実装されていません。難しすぎるためです。
- Miriaはブラウザの機能に依存していません。
- MFMの見た目がブラウザと異なる場合があります。
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ Miria is Misskey Client App for iOS, Android and many targets which made by Flut

## Install

- [Play Store](https://play.google.com/store/apps/details?id=info.shiosyakeyakini.miria)
- [App Store](https://apps.apple.com/jp/app/miria/id6449201469)
- [Download latest release from GitHub(Include Windows Version)](https://github.com/shiosyakeyakini-info/miria/releases/latest)
- [Play Store](https://play.google.com/store/apps/details?id=info.shiosyakeyakini.miria)
- [TestFlight](https://testflight.apple.com/join/X6Q7pE98)
- [Obtainium](https://apps.obtainium.imranr.dev/redirect?r=obtainium://app/%7B%22id%22%3A%22info.shiosyakeyakini.miria%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2Fshiosyakeyakini-info%2Fmiria%22%2C%22author%22%3A%22shiosyakeyakini-info%22%2C%22name%22%3A%22miria%22%2C%22additionalSettings%22%3A%22%7B%5C%22includePrereleases%5C%22%3Atrue%2C%5C%22fallbackToOlderReleases%5C%22%3Atrue%2C%5C%22verifyLatestTag%5C%22%3Afalse%2C%5C%22dontSortReleasesList%5C%22%3Afalse%2C%5C%22releaseTitleAsVersion%5C%22%3Afalse%2C%5C%22trackOnly%5C%22%3Afalse%2C%5C%22versionDetection%5C%22%3Atrue%7D%22%2C%22overrideSource%22%3Anull%7D)
- [Download latest release from GitHub(Include Windows Version & Snap packages)](https://github.com/shiosyakeyakini-info/miria/releases/latest)

I'm planning to deploy from F-Droid.

Expand All @@ -33,12 +34,12 @@ I'm planning to deploy from F-Droid.

- Miria does not support forked server's unique features.
- Miria supports only over Misskey v13 and forked servers.
- [Sharkey](https://joinsharkey.org/), [CherryPick](https://github.com/kokonect-link/cherrypick) and [mkkey.net](https://mkkey.net/) may be available but did not test.
- [Firefish](https://joinfirefish.org/ja/), [Catodon](https://catodon.social/), Mastodon will not support in the future too.
- Available in [Sharkey](https://joinsharkey.org/), [CherryPick](https://github.com/kokonect-link/cherrypick) and [mkkey.net](https://mkkey.net/), but not tested.
- [Iceshrimp](https://iceshrimp.dev/), [Catodon](https://catodon.social/), Mastodon will not be supported in the future.
- Miria does not support AiScript related features. (Plugin, Play)
- Miria does not depend browser features. ¥
- Miria does not depend on browser features.
- There are cases in which Miria's MFM appearance is different from browsers.
- Custom CSS didn't support.
- Custom CSS not supported.

## Contribute

Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,6 @@ SPEC CHECKSUMS:
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4

PODFILE CHECKSUM: 9a5aff7d2a4fe2dcc914618b99f9ff063b14915b
PODFILE CHECKSUM: fc9f5883117ffc5dbdfedd53e44b13710e7871f2

COCOAPODS: 1.14.3
14 changes: 8 additions & 6 deletions lib/l10n/app_ja-oj.arb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"noneAction": "なにもいたしませんわ",
"pleaseInput": "お入れなさって",
"pleaseSelect": "お選びになさって",
"clipDescription": "説明(なくてもよろしくてよ)",

"serverRules": "サーバーの定め",
"antennaSourceUserHintText": "ユーザーネームを改行で区切って指定いたしますわ",
Expand All @@ -22,9 +21,6 @@
"confirmDeletingAntenna": "アンテナを削除いたしますこと?",
"channelJoinningCounts": "{usersCount}人が参加なされてますわ",

"willFavorite": "お気に入りに入れますわ",
"willFollow": "フォローいたしますわ",

"confirmDeleteClip": "クリップを削除いたしますこと?",
"clipDescription": "説明(省略されてもよろしくてよ)",
"alreadyAddedClip": "こちらのノートすでにクリップに追加されていますわ",
Expand Down Expand Up @@ -58,6 +54,8 @@
"openAsOtherAccount": "開くアカウントを選びなさって",
"pickColor": "色を選びなさって",
"decideColor": "これにいたしますわ",
"replyNotePlaceholder": "何と送りますの?",
"defaultNotePlaceholder": "ごきげんよう",

"followedNotification": "{userName}からフォローされましてよ",
"followRequestAcceptedNotification": "{userName}がフォローしてもよくってよとお聞きいたしましたわ",
Expand Down Expand Up @@ -106,10 +104,14 @@
"cannotMentionToRemoteInLocalOnlyNote": "連合切られているのに他のサーバーの人がメンションに含まれているようですわ",
"cannotPublicReplyToPrivateNote": "リプライが{visibility}のようでして……パブリックにはできませんこと",

"unsupportedFile": "対応してないファイルのようですわ",
"failedFileSave": "ファイルの保存に失敗したようですわね…"
"memoDescription": "メモしたいことをお書きくださいまし",
"confirmCreateBlock": "ブロックなさりますの?",

"unsupportedFile": "対応してないファイルのようですわ",
"unsupportedFileWithFilename": "{filename}は対応してないファイルのようですわ",
"failedFileSave": "ファイルの保存に失敗したようですわね…",

"nothingHere": "ここには何もありませんわ"



Expand Down
9 changes: 8 additions & 1 deletion lib/l10n/app_ja.arb
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@
"updatedAtDescendingOrder": "更新された順",

"unsupportedFile": "対応してないファイルやわ",
"unsupportedFileWithFilename": "{filename}は対応してないファイルやわ",
"failedFileSave": "ファイルの保存に失敗したみたいや",

"misskeyGames": "Misskey Games",
Expand All @@ -1005,6 +1006,12 @@
}
}
},
"nonInvitedReversi": "招待はされとらへんみたいや"
"nonInvitedReversi": "招待はされとらへんみたいや",

"remoteServerWithoutLogin": "相手先のサーバー(ログインなし)",
"nothingHere": "なんもないで",

"deckMode": "デッキモード",
"enableDeckMode": "デッキモードにする"

}
4 changes: 3 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Miria extends HookConsumerWidget with WidgetsBindingObserver {
}

Future<void> _initWindow(WidgetRef ref) async {
if (!isDesktop) return;
await windowManager.setPreventClose(true);
final config = ref.read(desktopSettingsRepositoryProvider).settings;

Expand Down Expand Up @@ -187,7 +188,8 @@ class MiriaWindowListener with WindowListener {
} catch (e) {
if (kDebugMode) print(e);
} finally {
await windowManager.destroy();
await windowManager.setPreventClose(false);
await windowManager.close();
}
}
}
2 changes: 1 addition & 1 deletion lib/repository/general_settings_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class GeneralSettingsRepository extends ChangeNotifier {

Future<void> update(GeneralSettings settings) async {
_settings = settings;
notifyListeners();
final prefs = await SharedPreferences.getInstance();
await prefs.setString("general_settings", jsonEncode(settings.toJson()));
notifyListeners();
}
}
6 changes: 4 additions & 2 deletions lib/repository/import_export_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ class ImportExportRepository extends ChangeNotifier {
await SimpleMessageDialog.show(context, S.of(context).importCompleted);

if (!context.mounted) return;
context.router.removeWhere((route) => true);
await context.router.push(const SplashRoute());
await context.router.pushAndPopUntil(
const SplashRoute(),
predicate: (_) => false,
);
}

Future<void> export(BuildContext context, Account account) async {
Expand Down
5 changes: 3 additions & 2 deletions lib/router/app_router.gr.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 100 additions & 16 deletions lib/state_notifier/note_create_page/note_create_state_notifier.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import "dart:io";
import "dart:typed_data";

import "package:dio/dio.dart";
import "package:file/file.dart";
import "package:file_picker/file_picker.dart";
import "package:flutter/material.dart";
import "package:flutter_gen/gen_l10n/app_localizations.dart";
import "package:flutter_image_compress/flutter_image_compress.dart";
import "package:freezed_annotation/freezed_annotation.dart";
import "package:image/image.dart";
import "package:mfm_parser/mfm_parser.dart";
import "package:mime/mime.dart";
import "package:miria/extensions/note_visibility_extension.dart";
import "package:miria/log.dart";
import "package:miria/model/image_file.dart";
Expand Down Expand Up @@ -155,25 +159,32 @@ class NoteCreateNotifier extends _$NoteCreateNotifier {
}
if (initialMediaFiles != null && initialMediaFiles.isNotEmpty) {
resultState = resultState.copyWith(
files: await Future.wait(
files: (await Future.wait(
initialMediaFiles.map((media) async {
final file = _fileSystem.file(media);
final contents = await file.readAsBytes();
final fileName = file.basename;
final extension = fileName.split(".").last.toLowerCase();
if (["jpg", "png", "gif", "webp"].contains(extension)) {
return ImageFile(
data: contents,
fileName: fileName,
);
if (["jpg", "jpeg", "png", "gif", "webp", "heic", "tif", "tiff"]
.contains(extension)) {
final d = await loadImage(file);
if (d.data.isEmpty) {
await _dialogNotifier.showSimpleDialog(
message: (context) =>
S.of(context).unsupportedFileWithFilename(fileName),
);
return null;
}
return d;
} else {
return UnknownFile(
data: contents,
data: await file.readAsBytes(),
fileName: fileName,
);
}
}),
),
))
.nonNulls
.toList(),
);
}

Expand Down Expand Up @@ -592,8 +603,8 @@ class NoteCreateNotifier extends _$NoteCreateNotifier {
final result = await FilePicker.platform.pickFiles(
type: FileType.image,
allowMultiple: true,
allowCompression: false,
compressionQuality: 0,
allowCompression: Platform.isIOS, // v8.1.3ではiOS以外でこの値を使用していない
compressionQuality: 0, // Androidでは0にすることで圧縮パススルー
);
if (result == null || result.files.isEmpty) return;

Expand All @@ -606,14 +617,87 @@ class NoteCreateNotifier extends _$NoteCreateNotifier {
}).nonNulls;
final files = await Future.wait(
fsFiles.map(
(file) async => ImageFile(
data: await file.readAsBytes(),
fileName: file.basename,
),
(file) async {
final d = await loadImage(file);
if (d.data.isEmpty) {
await _dialogNotifier.showSimpleDialog(
message: (context) =>
S.of(context).unsupportedFileWithFilename(file.basename),
);
return null;
}
return d;
},
),
);

state = state.copyWith(files: [...state.files, ...files]);
state = state.copyWith(
files: [
...state.files,
...files.nonNulls,
],
);
}
}

Future<ImageFile> loadImage(File file) async {
try {
final imageBytes = await file.readAsBytes();
final mime = lookupMimeType(file.path, headerBytes: imageBytes);
var basename = file.basename;

switch (mime) {
case "image/jpeg":
if (!RegExp(r"\.jpe?g$", caseSensitive: false).hasMatch(basename)) {
basename = "$basename.jpg";
}

final origExif = decodeJpgExif(imageBytes);
if (origExif == null || origExif.isEmpty) {
return ImageFile(fileName: basename, data: imageBytes);
}

final exif = ExifData();
exif.imageIfd.orientation = (origExif.imageIfd.hasOrientation)
? origExif.imageIfd.orientation
: 1;

return ImageFile(
fileName: basename,
data: injectJpgExif(imageBytes, exif) ?? Uint8List(0),
);

case "image/heic":
return ImageFile(
fileName: "$basename.jpg",
data: await FlutterImageCompress.compressWithList(
imageBytes,
quality: 95,
format: CompressFormat.jpeg,
keepExif: false,
),
);

case "image/tiff":
final tiff = decodeTiff(imageBytes);
if (tiff == null) {
throw const FormatException("Decoded TIFF image is null");
}

final exif = ExifData();
if (tiff.exif.imageIfd.hasOrientation) {
exif.imageIfd.orientation = tiff.exif.imageIfd.orientation;
}
tiff.exif = exif;

return ImageFile(
fileName: "$basename.jpg", data: encodeJpg(tiff, quality: 95));

default:
return ImageFile(fileName: basename, data: imageBytes);
}
} catch (e) {
return ImageFile(fileName: file.basename, data: Uint8List(0));
}
}

Expand Down
9 changes: 6 additions & 3 deletions lib/view/antenna_page/antenna_settings_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,12 @@ class AntennaSettingsForm extends HookConsumerWidget {
final settings = ref.watch(_antennaSettingsNotifierProvider);
final list = ref.watch(_usersListListProvider);
final controller = useTextEditingController();
ref.listen(
_initialSettingsProvider.select((settings) => settings.users.join("\n")),
(_, next) => controller.text = next,
useEffect(
() {
controller.text = settings.users.join("\n");
return null;
},
const [],
);

return Form(
Expand Down
Loading

0 comments on commit cad5801

Please sign in to comment.