mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-23 12:39:29 +01:00
refactor: Remove deprecated jitsi call generator
This commit is contained in:
parent
ff89fcfc84
commit
e023d52bef
@ -21,7 +21,6 @@ FluffyChat is an open source, nonprofit and cute matrix messenger app. The app i
|
|||||||
- Custom themes
|
- Custom themes
|
||||||
- Hides complexity of Matrix IDs behind simple QR codes
|
- Hides complexity of Matrix IDs behind simple QR codes
|
||||||
- Custom emotes and stickers
|
- Custom emotes and stickers
|
||||||
- Video calls via sharing links to Jitsi
|
|
||||||
- Spaces
|
- Spaces
|
||||||
- Compatible with Element, Nheko, NeoChat and all other Matrix apps
|
- Compatible with Element, Nheko, NeoChat and all other Matrix apps
|
||||||
- End to end encryption
|
- End to end encryption
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"application_name": "FluffyChat",
|
"application_name": "FluffyChat",
|
||||||
"application_welcome_message": null,
|
"application_welcome_message": null,
|
||||||
"default_homeserver": "matrix.org",
|
"default_homeserver": "matrix.org",
|
||||||
"jitsi_instance": "https://meet.jit.si/",
|
|
||||||
"web_base_url": "https://fluffychat.im/web",
|
"web_base_url": "https://fluffychat.im/web",
|
||||||
"privacy_url": "https://fluffychat.im/en/privacy.html",
|
"privacy_url": "https://fluffychat.im/en/privacy.html",
|
||||||
"render_html": false,
|
"render_html": false,
|
||||||
|
@ -9,7 +9,6 @@ abstract class AppConfig {
|
|||||||
static String? get applicationWelcomeMessage => _applicationWelcomeMessage;
|
static String? get applicationWelcomeMessage => _applicationWelcomeMessage;
|
||||||
static String _defaultHomeserver = 'matrix.org';
|
static String _defaultHomeserver = 'matrix.org';
|
||||||
static String get defaultHomeserver => _defaultHomeserver;
|
static String get defaultHomeserver => _defaultHomeserver;
|
||||||
static String jitsiInstance = 'https://meet.jit.si/';
|
|
||||||
static double bubbleSizeFactor = 1;
|
static double bubbleSizeFactor = 1;
|
||||||
static double fontSizeFactor = 1;
|
static double fontSizeFactor = 1;
|
||||||
static Color chatColor = primaryColor;
|
static Color chatColor = primaryColor;
|
||||||
@ -77,9 +76,6 @@ abstract class AppConfig {
|
|||||||
if (json['default_homeserver'] is String) {
|
if (json['default_homeserver'] is String) {
|
||||||
_defaultHomeserver = json['default_homeserver'];
|
_defaultHomeserver = json['default_homeserver'];
|
||||||
}
|
}
|
||||||
if (json['jitsi_instance'] is String) {
|
|
||||||
jitsiInstance = json['jitsi_instance'];
|
|
||||||
}
|
|
||||||
if (json['privacy_url'] is String) {
|
if (json['privacy_url'] is String) {
|
||||||
_webBaseUrl = json['privacy_url'];
|
_webBaseUrl = json['privacy_url'];
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
abstract class SettingKeys {
|
abstract class SettingKeys {
|
||||||
static const String jitsiInstance = 'chat.fluffy.jitsi_instance';
|
|
||||||
static const String wallpaper = 'chat.fluffy.wallpaper';
|
static const String wallpaper = 'chat.fluffy.wallpaper';
|
||||||
static const String renderHtml = 'chat.fluffy.renderHtml';
|
static const String renderHtml = 'chat.fluffy.renderHtml';
|
||||||
static const String hideRedactedEvents = 'chat.fluffy.hideRedactedEvents';
|
static const String hideRedactedEvents = 'chat.fluffy.hideRedactedEvents';
|
||||||
|
@ -16,10 +16,8 @@ import 'package:image_picker/image_picker.dart';
|
|||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:record/record.dart';
|
import 'package:record/record.dart';
|
||||||
import 'package:scroll_to_index/scroll_to_index.dart';
|
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
|
||||||
import 'package:vrouter/vrouter.dart';
|
import 'package:vrouter/vrouter.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
|
||||||
import 'package:fluffychat/pages/chat/chat_view.dart';
|
import 'package:fluffychat/pages/chat/chat_view.dart';
|
||||||
import 'package:fluffychat/pages/chat/cupertino_widgets_bottom_sheet.dart';
|
import 'package:fluffychat/pages/chat/cupertino_widgets_bottom_sheet.dart';
|
||||||
import 'package:fluffychat/pages/chat/event_info_dialog.dart';
|
import 'package:fluffychat/pages/chat/event_info_dialog.dart';
|
||||||
@ -128,20 +126,6 @@ class ChatController extends State<Chat> {
|
|||||||
|
|
||||||
EmojiPickerType emojiPickerType = EmojiPickerType.keyboard;
|
EmojiPickerType emojiPickerType = EmojiPickerType.keyboard;
|
||||||
|
|
||||||
void startCallAction() async {
|
|
||||||
final url =
|
|
||||||
'${AppConfig.jitsiInstance}${Uri.encodeComponent(Matrix.of(context).client.generateUniqueTransactionId())}';
|
|
||||||
|
|
||||||
final success = await showFutureLoadingDialog(
|
|
||||||
context: context,
|
|
||||||
future: () => room!.sendEvent({
|
|
||||||
'msgtype': Matrix.callNamespace,
|
|
||||||
'body': url,
|
|
||||||
}));
|
|
||||||
if (success.error != null) return;
|
|
||||||
await launch(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
void requestHistory() async {
|
void requestHistory() async {
|
||||||
if (canLoadMore) {
|
if (canLoadMore) {
|
||||||
try {
|
try {
|
||||||
@ -878,9 +862,6 @@ class ChatController extends State<Chat> {
|
|||||||
if (choice == 'location') {
|
if (choice == 'location') {
|
||||||
sendLocationAction();
|
sendLocationAction();
|
||||||
}
|
}
|
||||||
if (choice == 'videocall') {
|
|
||||||
startCallAction();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unpinEvent(String eventId) async {
|
unpinEvent(String eventId) async {
|
||||||
|
@ -84,18 +84,6 @@ class ChatInputRow extends StatelessWidget {
|
|||||||
onSelected: controller.onAddPopupMenuButtonSelected,
|
onSelected: controller.onAddPopupMenuButtonSelected,
|
||||||
itemBuilder: (BuildContext context) =>
|
itemBuilder: (BuildContext context) =>
|
||||||
<PopupMenuEntry<String>>[
|
<PopupMenuEntry<String>>[
|
||||||
PopupMenuItem<String>(
|
|
||||||
value: 'videocall',
|
|
||||||
child: ListTile(
|
|
||||||
leading: const CircleAvatar(
|
|
||||||
backgroundColor: Colors.blueGrey,
|
|
||||||
foregroundColor: Colors.white,
|
|
||||||
child: Icon(Icons.video_call_outlined),
|
|
||||||
),
|
|
||||||
title: Text(L10n.of(context)!.videoCall),
|
|
||||||
contentPadding: const EdgeInsets.all(0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
value: 'file',
|
value: 'file',
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
|
@ -4,7 +4,6 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:matrix_link_text/link_text.dart';
|
import 'package:matrix_link_text/link_text.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
|
||||||
|
|
||||||
import 'package:fluffychat/pages/chat/events/video_player.dart';
|
import 'package:fluffychat/pages/chat/events/video_player.dart';
|
||||||
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/matrix_locals.dart';
|
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/matrix_locals.dart';
|
||||||
@ -172,14 +171,6 @@ class MessageContent extends StatelessWidget {
|
|||||||
case MessageTypes.None:
|
case MessageTypes.None:
|
||||||
textmessage:
|
textmessage:
|
||||||
default:
|
default:
|
||||||
if (event.content['msgtype'] == Matrix.callNamespace) {
|
|
||||||
return _ButtonContent(
|
|
||||||
onPressed: () => launch(event.body),
|
|
||||||
icon: const Icon(Icons.phone_outlined, color: Colors.green),
|
|
||||||
label: L10n.of(context)!.videoCall,
|
|
||||||
textColor: buttonTextColor,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (event.redacted) {
|
if (event.redacted) {
|
||||||
return _ButtonContent(
|
return _ButtonContent(
|
||||||
label: L10n.of(context)!
|
label: L10n.of(context)!
|
||||||
|
@ -11,7 +11,6 @@ import 'package:universal_html/html.dart' as html;
|
|||||||
import 'package:vrouter/vrouter.dart';
|
import 'package:vrouter/vrouter.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/config/setting_keys.dart';
|
|
||||||
import 'package:fluffychat/pages/homeserver_picker/homeserver_picker_view.dart';
|
import 'package:fluffychat/pages/homeserver_picker/homeserver_picker_view.dart';
|
||||||
import 'package:fluffychat/utils/famedlysdk_store.dart';
|
import 'package:fluffychat/utils/famedlysdk_store.dart';
|
||||||
import 'package:fluffychat/utils/platform_infos.dart';
|
import 'package:fluffychat/utils/platform_infos.dart';
|
||||||
@ -98,22 +97,7 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final summary =
|
await Matrix.of(context).getLoginClient().checkHomeserver(homeserver);
|
||||||
await Matrix.of(context).getLoginClient().checkHomeserver(homeserver);
|
|
||||||
|
|
||||||
var jitsi = summary.discoveryInformation?.additionalProperties
|
|
||||||
.tryGet<Map<String, dynamic>>('im.vector.riot.jitsi')
|
|
||||||
?.tryGet<String>('preferredDomain');
|
|
||||||
if (jitsi != null) {
|
|
||||||
if (!jitsi.endsWith('/')) {
|
|
||||||
jitsi += '/';
|
|
||||||
}
|
|
||||||
Logs().v('Found custom jitsi instance $jitsi');
|
|
||||||
await Matrix.of(context)
|
|
||||||
.store
|
|
||||||
.setItem(SettingKeys.jitsiInstance, jitsi);
|
|
||||||
AppConfig.jitsiInstance = jitsi;
|
|
||||||
}
|
|
||||||
|
|
||||||
_rawLoginTypes = await Matrix.of(context).getLoginClient().request(
|
_rawLoginTypes = await Matrix.of(context).getLoginClient().request(
|
||||||
RequestType.GET,
|
RequestType.GET,
|
||||||
|
@ -9,8 +9,6 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
|||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
import 'package:fluffychat/widgets/matrix.dart';
|
||||||
import '../../config/app_config.dart';
|
|
||||||
import '../../config/setting_keys.dart';
|
|
||||||
import '../../utils/platform_infos.dart';
|
import '../../utils/platform_infos.dart';
|
||||||
import 'login_view.dart';
|
import 'login_view.dart';
|
||||||
|
|
||||||
@ -141,19 +139,6 @@ class LoginController extends State<Login> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var jitsi = wellKnownInformation?.additionalProperties
|
|
||||||
.tryGet<Map<String, dynamic>>('im.vector.riot.jitsi')
|
|
||||||
?.tryGet<String>('preferredDomain');
|
|
||||||
if (jitsi != null) {
|
|
||||||
if (!jitsi.endsWith('/')) {
|
|
||||||
jitsi += '/';
|
|
||||||
}
|
|
||||||
Logs().v('Found custom jitsi instance $jitsi');
|
|
||||||
await Matrix.of(context)
|
|
||||||
.store
|
|
||||||
.setItem(SettingKeys.jitsiInstance, jitsi);
|
|
||||||
AppConfig.jitsiInstance = jitsi;
|
|
||||||
}
|
|
||||||
setState(() => usernameError = null);
|
setState(() => usernameError = null);
|
||||||
} else {
|
} else {
|
||||||
setState(() =>
|
setState(() =>
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
||||||
|
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
|
||||||
import 'package:fluffychat/config/setting_keys.dart';
|
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
|
||||||
import 'settings_chat_view.dart';
|
import 'settings_chat_view.dart';
|
||||||
|
|
||||||
class SettingsChat extends StatefulWidget {
|
class SettingsChat extends StatefulWidget {
|
||||||
@ -16,31 +10,6 @@ class SettingsChat extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SettingsChatController extends State<SettingsChat> {
|
class SettingsChatController extends State<SettingsChat> {
|
||||||
void setJitsiInstanceAction() async {
|
|
||||||
const prefix = 'https://';
|
|
||||||
final input = await showTextInputDialog(
|
|
||||||
useRootNavigator: false,
|
|
||||||
context: context,
|
|
||||||
title: L10n.of(context)!.editJitsiInstance,
|
|
||||||
okLabel: L10n.of(context)!.ok,
|
|
||||||
cancelLabel: L10n.of(context)!.cancel,
|
|
||||||
textFields: [
|
|
||||||
DialogTextField(
|
|
||||||
initialText: AppConfig.jitsiInstance.replaceFirst(prefix, ''),
|
|
||||||
prefixText: prefix,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
if (input == null) return;
|
|
||||||
var jitsi = prefix + input.single;
|
|
||||||
if (!jitsi.endsWith('/')) {
|
|
||||||
jitsi += '/';
|
|
||||||
}
|
|
||||||
final matrix = Matrix.of(context);
|
|
||||||
await matrix.store.setItem(SettingKeys.jitsiInstance, jitsi);
|
|
||||||
AppConfig.jitsiInstance = jitsi;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => SettingsChatView(this);
|
Widget build(BuildContext context) => SettingsChatView(this);
|
||||||
}
|
}
|
||||||
|
@ -64,15 +64,6 @@ class SettingsChatView extends StatelessWidget {
|
|||||||
child: Icon(Icons.insert_emoticon_outlined),
|
child: Icon(Icons.insert_emoticon_outlined),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListTile(
|
|
||||||
trailing: const Padding(
|
|
||||||
padding: EdgeInsets.all(16.0),
|
|
||||||
child: Icon(Icons.phone_outlined),
|
|
||||||
),
|
|
||||||
title: Text(L10n.of(context)!.editJitsiInstance),
|
|
||||||
subtitle: Text(AppConfig.jitsiInstance),
|
|
||||||
onTap: controller.setJitsiInstanceAction,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -37,8 +37,6 @@ import 'local_notifications_extension.dart';
|
|||||||
// import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
// import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
|
|
||||||
class Matrix extends StatefulWidget {
|
class Matrix extends StatefulWidget {
|
||||||
static const String callNamespace = 'chat.fluffy.jitsi_call';
|
|
||||||
|
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
|
|
||||||
final GlobalKey<VRouterState>? router;
|
final GlobalKey<VRouterState>? router;
|
||||||
@ -203,7 +201,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
|
|
||||||
final onRoomKeyRequestSub = <String, StreamSubscription>{};
|
final onRoomKeyRequestSub = <String, StreamSubscription>{};
|
||||||
final onKeyVerificationRequestSub = <String, StreamSubscription>{};
|
final onKeyVerificationRequestSub = <String, StreamSubscription>{};
|
||||||
final onJitsiCallSub = <String, StreamSubscription>{};
|
|
||||||
final onNotification = <String, StreamSubscription>{};
|
final onNotification = <String, StreamSubscription>{};
|
||||||
final onLoginStateChanged = <String, StreamSubscription<LoginState>>{};
|
final onLoginStateChanged = <String, StreamSubscription<LoginState>>{};
|
||||||
final onUiaRequest = <String, StreamSubscription<UiaRequest>>{};
|
final onUiaRequest = <String, StreamSubscription<UiaRequest>>{};
|
||||||
@ -436,8 +433,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initSettings() {
|
void initSettings() {
|
||||||
store.getItem(SettingKeys.jitsiInstance).then((final instance) =>
|
|
||||||
AppConfig.jitsiInstance = instance ?? AppConfig.jitsiInstance);
|
|
||||||
store.getItem(SettingKeys.wallpaper).then((final path) async {
|
store.getItem(SettingKeys.wallpaper).then((final path) async {
|
||||||
if (path == null) return;
|
if (path == null) return;
|
||||||
final file = File(path);
|
final file = File(path);
|
||||||
|
@ -9,9 +9,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
|||||||
url_launcher_windows
|
url_launcher_windows
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
|
||||||
)
|
|
||||||
|
|
||||||
set(PLUGIN_BUNDLED_LIBRARIES)
|
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||||
|
|
||||||
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||||
@ -20,8 +17,3 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
|||||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||||
endforeach(plugin)
|
endforeach(plugin)
|
||||||
|
|
||||||
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
|
||||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
|
|
||||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
|
||||||
endforeach(ffi_plugin)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user