mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-11 15:40:29 -04:00
account management update
This commit is contained in:
parent
01c6490ec4
commit
5e4f47d5a1
42 changed files with 1663 additions and 831 deletions
55
lib/account_manager/models/account_spec.dart
Normal file
55
lib/account_manager/models/account_spec.dart
Normal file
|
@ -0,0 +1,55 @@
|
|||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import '../../proto/proto.dart' as proto;
|
||||
|
||||
/// Profile and Account configurable fields
|
||||
/// Some are publicly visible via the proto.Profile
|
||||
/// Some are privately held as proto.Account configurations
|
||||
class AccountSpec {
|
||||
AccountSpec(
|
||||
{required this.name,
|
||||
required this.pronouns,
|
||||
required this.about,
|
||||
required this.availability,
|
||||
required this.invisible,
|
||||
required this.freeMessage,
|
||||
required this.awayMessage,
|
||||
required this.busyMessage,
|
||||
required this.avatar,
|
||||
required this.autoAway,
|
||||
required this.autoAwayTimeout});
|
||||
|
||||
String get status {
|
||||
late final String status;
|
||||
switch (availability) {
|
||||
case proto.Availability.AVAILABILITY_AWAY:
|
||||
status = awayMessage;
|
||||
break;
|
||||
case proto.Availability.AVAILABILITY_BUSY:
|
||||
status = busyMessage;
|
||||
break;
|
||||
case proto.Availability.AVAILABILITY_FREE:
|
||||
status = freeMessage;
|
||||
break;
|
||||
case proto.Availability.AVAILABILITY_UNSPECIFIED:
|
||||
case proto.Availability.AVAILABILITY_OFFLINE:
|
||||
status = '';
|
||||
break;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
String name;
|
||||
String pronouns;
|
||||
String about;
|
||||
proto.Availability availability;
|
||||
bool invisible;
|
||||
String freeMessage;
|
||||
String awayMessage;
|
||||
String busyMessage;
|
||||
ImageProvider? avatar;
|
||||
bool autoAway;
|
||||
int autoAwayTimeout;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
export 'account_info.dart';
|
||||
export 'account_update_spec.dart';
|
||||
export 'encryption_key_type.dart';
|
||||
export 'local_account/local_account.dart';
|
||||
export 'new_profile_spec.dart';
|
||||
export 'per_account_collection_state/per_account_collection_state.dart';
|
||||
export 'user_login/user_login.dart';
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
class NewProfileSpec {
|
||||
NewProfileSpec({required this.name, required this.pronouns});
|
||||
String name;
|
||||
String pronouns;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue