diff --git a/bin/matrixoidc.dart b/bin/matrixoidc.dart index b707c52..38b0465 100644 --- a/bin/matrixoidc.dart +++ b/bin/matrixoidc.dart @@ -11,7 +11,7 @@ void main(List argsRaw) async { final parser = ConfigParser() ..addOption("socket", abbr: "s", mandatory: true) ..addOption("homeserver", abbr: "h", mandatory: true) - ..addOption("foundUri", abbr: "f", mandatory: true) + ..addOption("successUri", abbr: "s", mandatory: true) ..addOption("name", abbr: "n", mandatory: true) ..addOption("adminRoom", abbr: "a", mandatory: true) ..addOption("botPasswordFile", abbr: "b", mandatory: true) diff --git a/lib/helpers/api_helper.dart b/lib/helpers/api_helper.dart index df80f26..5e9c42a 100644 --- a/lib/helpers/api_helper.dart +++ b/lib/helpers/api_helper.dart @@ -59,7 +59,7 @@ class ApiHelper { ); } - return Response.found(settings.foundUri); + return Response.found(settings.successUri); } static final provider = Provider(ApiHelper.new); diff --git a/lib/models/settings.dart b/lib/models/settings.dart index 1babcc7..481a410 100644 --- a/lib/models/settings.dart +++ b/lib/models/settings.dart @@ -8,7 +8,7 @@ abstract class Settings with _$Settings { const factory Settings({ required String socket, required Uri homeserver, - required Uri foundUri, + required Uri successUri, required String name, required String adminRoom, required String botPasswordFile, diff --git a/lib/models/settings.freezed.dart b/lib/models/settings.freezed.dart index cb1018f..d4d4767 100644 --- a/lib/models/settings.freezed.dart +++ b/lib/models/settings.freezed.dart @@ -16,7 +16,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$Settings { - String get socket; Uri get homeserver; Uri get foundUri; String get name; String get adminRoom; String get botPasswordFile; String get smtpPasswordFile; String? get inviteTo; + String get socket; Uri get homeserver; Uri get successUri; String get name; String get adminRoom; String get botPasswordFile; String get smtpPasswordFile; String? get inviteTo; /// Create a copy of Settings /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -29,16 +29,16 @@ $SettingsCopyWith get copyWith => _$SettingsCopyWithImpl(thi @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is Settings&&(identical(other.socket, socket) || other.socket == socket)&&(identical(other.homeserver, homeserver) || other.homeserver == homeserver)&&(identical(other.foundUri, foundUri) || other.foundUri == foundUri)&&(identical(other.name, name) || other.name == name)&&(identical(other.adminRoom, adminRoom) || other.adminRoom == adminRoom)&&(identical(other.botPasswordFile, botPasswordFile) || other.botPasswordFile == botPasswordFile)&&(identical(other.smtpPasswordFile, smtpPasswordFile) || other.smtpPasswordFile == smtpPasswordFile)&&(identical(other.inviteTo, inviteTo) || other.inviteTo == inviteTo)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is Settings&&(identical(other.socket, socket) || other.socket == socket)&&(identical(other.homeserver, homeserver) || other.homeserver == homeserver)&&(identical(other.successUri, successUri) || other.successUri == successUri)&&(identical(other.name, name) || other.name == name)&&(identical(other.adminRoom, adminRoom) || other.adminRoom == adminRoom)&&(identical(other.botPasswordFile, botPasswordFile) || other.botPasswordFile == botPasswordFile)&&(identical(other.smtpPasswordFile, smtpPasswordFile) || other.smtpPasswordFile == smtpPasswordFile)&&(identical(other.inviteTo, inviteTo) || other.inviteTo == inviteTo)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,socket,homeserver,foundUri,name,adminRoom,botPasswordFile,smtpPasswordFile,inviteTo); +int get hashCode => Object.hash(runtimeType,socket,homeserver,successUri,name,adminRoom,botPasswordFile,smtpPasswordFile,inviteTo); @override String toString() { - return 'Settings(socket: $socket, homeserver: $homeserver, foundUri: $foundUri, name: $name, adminRoom: $adminRoom, botPasswordFile: $botPasswordFile, smtpPasswordFile: $smtpPasswordFile, inviteTo: $inviteTo)'; + return 'Settings(socket: $socket, homeserver: $homeserver, successUri: $successUri, name: $name, adminRoom: $adminRoom, botPasswordFile: $botPasswordFile, smtpPasswordFile: $smtpPasswordFile, inviteTo: $inviteTo)'; } @@ -49,7 +49,7 @@ abstract mixin class $SettingsCopyWith<$Res> { factory $SettingsCopyWith(Settings value, $Res Function(Settings) _then) = _$SettingsCopyWithImpl; @useResult $Res call({ - String socket, Uri homeserver, Uri foundUri, String name, String adminRoom, String botPasswordFile, String smtpPasswordFile, String? inviteTo + String socket, Uri homeserver, Uri successUri, String name, String adminRoom, String botPasswordFile, String smtpPasswordFile, String? inviteTo }); @@ -66,11 +66,11 @@ class _$SettingsCopyWithImpl<$Res> /// Create a copy of Settings /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? socket = null,Object? homeserver = null,Object? foundUri = null,Object? name = null,Object? adminRoom = null,Object? botPasswordFile = null,Object? smtpPasswordFile = null,Object? inviteTo = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? socket = null,Object? homeserver = null,Object? successUri = null,Object? name = null,Object? adminRoom = null,Object? botPasswordFile = null,Object? smtpPasswordFile = null,Object? inviteTo = freezed,}) { return _then(_self.copyWith( socket: null == socket ? _self.socket : socket // ignore: cast_nullable_to_non_nullable as String,homeserver: null == homeserver ? _self.homeserver : homeserver // ignore: cast_nullable_to_non_nullable -as Uri,foundUri: null == foundUri ? _self.foundUri : foundUri // ignore: cast_nullable_to_non_nullable +as Uri,successUri: null == successUri ? _self.successUri : successUri // ignore: cast_nullable_to_non_nullable as Uri,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,adminRoom: null == adminRoom ? _self.adminRoom : adminRoom // ignore: cast_nullable_to_non_nullable as String,botPasswordFile: null == botPasswordFile ? _self.botPasswordFile : botPasswordFile // ignore: cast_nullable_to_non_nullable @@ -87,12 +87,12 @@ as String?, @JsonSerializable() class _Settings implements Settings { - const _Settings({required this.socket, required this.homeserver, required this.foundUri, required this.name, required this.adminRoom, required this.botPasswordFile, required this.smtpPasswordFile, required this.inviteTo}); + const _Settings({required this.socket, required this.homeserver, required this.successUri, required this.name, required this.adminRoom, required this.botPasswordFile, required this.smtpPasswordFile, required this.inviteTo}); factory _Settings.fromJson(Map json) => _$SettingsFromJson(json); @override final String socket; @override final Uri homeserver; -@override final Uri foundUri; +@override final Uri successUri; @override final String name; @override final String adminRoom; @override final String botPasswordFile; @@ -112,16 +112,16 @@ Map toJson() { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _Settings&&(identical(other.socket, socket) || other.socket == socket)&&(identical(other.homeserver, homeserver) || other.homeserver == homeserver)&&(identical(other.foundUri, foundUri) || other.foundUri == foundUri)&&(identical(other.name, name) || other.name == name)&&(identical(other.adminRoom, adminRoom) || other.adminRoom == adminRoom)&&(identical(other.botPasswordFile, botPasswordFile) || other.botPasswordFile == botPasswordFile)&&(identical(other.smtpPasswordFile, smtpPasswordFile) || other.smtpPasswordFile == smtpPasswordFile)&&(identical(other.inviteTo, inviteTo) || other.inviteTo == inviteTo)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Settings&&(identical(other.socket, socket) || other.socket == socket)&&(identical(other.homeserver, homeserver) || other.homeserver == homeserver)&&(identical(other.successUri, successUri) || other.successUri == successUri)&&(identical(other.name, name) || other.name == name)&&(identical(other.adminRoom, adminRoom) || other.adminRoom == adminRoom)&&(identical(other.botPasswordFile, botPasswordFile) || other.botPasswordFile == botPasswordFile)&&(identical(other.smtpPasswordFile, smtpPasswordFile) || other.smtpPasswordFile == smtpPasswordFile)&&(identical(other.inviteTo, inviteTo) || other.inviteTo == inviteTo)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,socket,homeserver,foundUri,name,adminRoom,botPasswordFile,smtpPasswordFile,inviteTo); +int get hashCode => Object.hash(runtimeType,socket,homeserver,successUri,name,adminRoom,botPasswordFile,smtpPasswordFile,inviteTo); @override String toString() { - return 'Settings(socket: $socket, homeserver: $homeserver, foundUri: $foundUri, name: $name, adminRoom: $adminRoom, botPasswordFile: $botPasswordFile, smtpPasswordFile: $smtpPasswordFile, inviteTo: $inviteTo)'; + return 'Settings(socket: $socket, homeserver: $homeserver, successUri: $successUri, name: $name, adminRoom: $adminRoom, botPasswordFile: $botPasswordFile, smtpPasswordFile: $smtpPasswordFile, inviteTo: $inviteTo)'; } @@ -132,7 +132,7 @@ abstract mixin class _$SettingsCopyWith<$Res> implements $SettingsCopyWith<$Res> factory _$SettingsCopyWith(_Settings value, $Res Function(_Settings) _then) = __$SettingsCopyWithImpl; @override @useResult $Res call({ - String socket, Uri homeserver, Uri foundUri, String name, String adminRoom, String botPasswordFile, String smtpPasswordFile, String? inviteTo + String socket, Uri homeserver, Uri successUri, String name, String adminRoom, String botPasswordFile, String smtpPasswordFile, String? inviteTo }); @@ -149,11 +149,11 @@ class __$SettingsCopyWithImpl<$Res> /// Create a copy of Settings /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? socket = null,Object? homeserver = null,Object? foundUri = null,Object? name = null,Object? adminRoom = null,Object? botPasswordFile = null,Object? smtpPasswordFile = null,Object? inviteTo = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? socket = null,Object? homeserver = null,Object? successUri = null,Object? name = null,Object? adminRoom = null,Object? botPasswordFile = null,Object? smtpPasswordFile = null,Object? inviteTo = freezed,}) { return _then(_Settings( socket: null == socket ? _self.socket : socket // ignore: cast_nullable_to_non_nullable as String,homeserver: null == homeserver ? _self.homeserver : homeserver // ignore: cast_nullable_to_non_nullable -as Uri,foundUri: null == foundUri ? _self.foundUri : foundUri // ignore: cast_nullable_to_non_nullable +as Uri,successUri: null == successUri ? _self.successUri : successUri // ignore: cast_nullable_to_non_nullable as Uri,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,adminRoom: null == adminRoom ? _self.adminRoom : adminRoom // ignore: cast_nullable_to_non_nullable as String,botPasswordFile: null == botPasswordFile ? _self.botPasswordFile : botPasswordFile // ignore: cast_nullable_to_non_nullable diff --git a/lib/models/settings.g.dart b/lib/models/settings.g.dart index 31bffe3..60f17b5 100644 --- a/lib/models/settings.g.dart +++ b/lib/models/settings.g.dart @@ -9,7 +9,7 @@ part of 'settings.dart'; _Settings _$SettingsFromJson(Map json) => _Settings( socket: json['socket'] as String, homeserver: Uri.parse(json['homeserver'] as String), - foundUri: Uri.parse(json['foundUri'] as String), + successUri: Uri.parse(json['successUri'] as String), name: json['name'] as String, adminRoom: json['adminRoom'] as String, botPasswordFile: json['botPasswordFile'] as String, @@ -20,7 +20,7 @@ _Settings _$SettingsFromJson(Map json) => _Settings( Map _$SettingsToJson(_Settings instance) => { 'socket': instance.socket, 'homeserver': instance.homeserver.toString(), - 'foundUri': instance.foundUri.toString(), + 'successUri': instance.successUri.toString(), 'name': instance.name, 'adminRoom': instance.adminRoom, 'botPasswordFile': instance.botPasswordFile,