Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into appimage
Browse files Browse the repository at this point in the history
  • Loading branch information
Npepperlinux committed Oct 18, 2023
2 parents 9d946b9 + b0011ee commit cbb871a
Show file tree
Hide file tree
Showing 94 changed files with 8,553 additions and 2,565 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ app.*.map.json

# builder
**/node_modules/
**/build/

# Release
/private_keys/
33 changes: 33 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ PODS:
- DKImagePickerController/PhotoGallery
- Flutter
- Flutter (1.0.0)
- flutter_image_compress_common (1.0.0):
- Flutter
- Mantle
- SDWebImage
- SDWebImageWebPCoder
- flutter_secure_storage (6.0.0):
- Flutter
- FMDB (2.7.5):
Expand All @@ -45,6 +50,21 @@ PODS:
- Flutter
- image_gallery_saver (2.0.2):
- Flutter
- libwebp (1.3.2):
- libwebp/demux (= 1.3.2)
- libwebp/mux (= 1.3.2)
- libwebp/sharpyuv (= 1.3.2)
- libwebp/webp (= 1.3.2)
- libwebp/demux (1.3.2):
- libwebp/webp
- libwebp/mux (1.3.2):
- libwebp/demux
- libwebp/sharpyuv (1.3.2)
- libwebp/webp (1.3.2):
- libwebp/sharpyuv
- Mantle (2.2.0):
- Mantle/extobjc (= 2.2.0)
- Mantle/extobjc (2.2.0)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
Expand All @@ -57,6 +77,9 @@ PODS:
- SDWebImage (5.15.8):
- SDWebImage/Core (= 5.15.8)
- SDWebImage/Core (5.15.8)
- SDWebImageWebPCoder (0.11.0):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.15)
- share_plus (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
Expand All @@ -73,6 +96,7 @@ DEPENDENCIES:
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- image_editor_common (from `.symlinks/plugins/image_editor_common/ios`)
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
Expand All @@ -90,7 +114,10 @@ SPEC REPOS:
- DKImagePickerController
- DKPhotoGallery
- FMDB
- libwebp
- Mantle
- SDWebImage
- SDWebImageWebPCoder
- SwiftyGif

EXTERNAL SOURCES:
Expand All @@ -100,6 +127,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/file_picker/ios"
Flutter:
:path: Flutter
flutter_image_compress_common:
:path: ".symlinks/plugins/flutter_image_compress_common/ios"
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
image_editor_common:
Expand Down Expand Up @@ -129,15 +158,19 @@ SPEC CHECKSUMS:
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_editor_common: d6f6644ae4a6de80481e89fe6d0a8c49e30b4b43
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
receive_sharing_intent: c0d87310754e74c0f9542947e7cbdf3a0335a3b1
SDWebImage: cb032eba469c54e0000e78bcb0a13cdde0a52798
SDWebImageWebPCoder: 295a6573c512f54ad2dd58098e64e17dcf008499
share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
Expand Down
1 change: 1 addition & 0 deletions lib/const.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const misskeyIOReactionDelay = 1500;
83 changes: 69 additions & 14 deletions lib/extensions/text_editing_controller_extension.dart
Original file line number Diff line number Diff line change
@@ -1,25 +1,80 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:miria/model/input_completion_type.dart';

extension TextEditingControllerExtension on TextEditingController {
bool get isIncludeBeforeColon {
if (selection.base.offset == -1) return false;
return text.substring(0, selection.base.offset).contains(":");
String? get textBeforeSelection {
final baseOffset = selection.baseOffset;
if (baseOffset < 0) {
return null;
}
return text.substring(0, baseOffset);
}

bool get isEmojiScope {
final position = selection.base.offset;
final startPosition = text.substring(0, position).lastIndexOf(":") + 1;
String? get emojiQuery {
final textBeforeSelection = this.textBeforeSelection;
if (textBeforeSelection == null) {
return null;
}
final lastColonIndex = textBeforeSelection.lastIndexOf(":");
if (lastColonIndex < 0) {
return null;
}
if (RegExp(r':[a-zA-z_0-9]+?:$')
.hasMatch(text.substring(0, startPosition))) {
return true;
.hasMatch(text.substring(0, lastColonIndex + 1))) {
return null;
} else {
return textBeforeSelection.substring(lastColonIndex + 1);
}
}

String? get mfmFnQuery {
final textBeforeSelection = this.textBeforeSelection;
if (textBeforeSelection == null) {
return null;
}
final lastOpenTagIndex = textBeforeSelection.lastIndexOf(r"$[");
if (lastOpenTagIndex < 0) {
return null;
}
final query = textBeforeSelection.substring(lastOpenTagIndex + 2);
if (RegExp(r"^[a-z234]*$").hasMatch(query)) {
return query;
} else {
return null;
}
return false;
}

String get emojiSearchValue {
final position = selection.base.offset;
final startPosition = text.substring(0, position).lastIndexOf(":") + 1;
return text.substring(startPosition, position);
String? get hashtagQuery {
final textBeforeSelection = this.textBeforeSelection;
if (textBeforeSelection == null) {
return null;
}
final lastHashIndex = textBeforeSelection.lastIndexOf("#");
if (lastHashIndex < 0) {
return null;
}
final query = textBeforeSelection.substring(lastHashIndex + 1);
if (query.contains(RegExp(r"""[ \u3000\t.,!?'"#:/[\]【】()「」()<>]"""))) {
return null;
} else {
return query;
}
}

InputCompletionType get inputCompletionType {
final emojiQuery = this.emojiQuery;
if (emojiQuery != null) {
return Emoji(emojiQuery);
}
final mfmFnQuery = this.mfmFnQuery;
if (mfmFnQuery != null) {
return MfmFn(mfmFnQuery);
}
final hashtagQuery = this.hashtagQuery;
if (hashtagQuery != null) {
return Hashtag(hashtagQuery);
}
return Basic();
}

void insert(String insertText, {String? afterText}) {
Expand Down
13 changes: 13 additions & 0 deletions lib/extensions/users_lists_show_response_extension.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'package:misskey_dart/misskey_dart.dart';

extension UsersListsShowResponseExtension on UsersListsShowResponse {
UsersList toUsersList() {
return UsersList(
id: id,
createdAt: createdAt,
name: name,
userIds: userIds,
isPublic: isPublic,
);
}
}
36 changes: 36 additions & 0 deletions lib/model/antenna_settings.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:misskey_dart/misskey_dart.dart';

part 'antenna_settings.freezed.dart';

@freezed
class AntennaSettings with _$AntennaSettings {
const factory AntennaSettings({
@Default("") String name,
@Default(AntennaSource.all) AntennaSource src,
String? userListId,
@Default([]) List<List<String>> keywords,
@Default([]) List<List<String>> excludeKeywords,
@Default([]) List<String> users,
@Default(false) bool caseSensitive,
@Default(false) bool withReplies,
@Default(false) bool withFile,
@Default(false) bool notify,
}) = _AntennaSettings;
const AntennaSettings._();

factory AntennaSettings.fromAntenna(Antenna antenna) {
return AntennaSettings(
name: antenna.name,
src: antenna.src,
userListId: antenna.userListId,
keywords: antenna.keywords,
excludeKeywords: antenna.excludeKeywords,
users: antenna.users,
caseSensitive: antenna.caseSensitive,
withReplies: antenna.withReplies,
withFile: antenna.withFile,
notify: antenna.notify,
);
}
}
Loading

0 comments on commit cbb871a

Please sign in to comment.