Merge branch 'main' of gitlab.com:famedly/fluffychat into main
This commit is contained in:
commit
46e71d6f01
35 changed files with 224 additions and 99 deletions
|
|
@ -28,16 +28,16 @@ class InvitationSelectionController extends State<InvitationSelection> {
|
|||
Timer coolDown;
|
||||
|
||||
Future<List<User>> getContacts(BuildContext context) async {
|
||||
var client = Matrix.of(context).client;
|
||||
final client = Matrix.of(context).client;
|
||||
final room = client.getRoomById(widget.roomId);
|
||||
var participants = await room.requestParticipants();
|
||||
final participants = await room.requestParticipants();
|
||||
participants.removeWhere(
|
||||
(u) => ![Membership.join, Membership.invite].contains(u.membership),
|
||||
);
|
||||
var contacts = <User>[];
|
||||
var userMap = <String, bool>{};
|
||||
final contacts = <User>[];
|
||||
final userMap = <String, bool>{};
|
||||
for (var i = 0; i < client.rooms.length; i++) {
|
||||
var roomUsers = client.rooms[i].getParticipants();
|
||||
final roomUsers = client.rooms[i].getParticipants();
|
||||
|
||||
for (var j = 0; j < roomUsers.length; j++) {
|
||||
if (userMap[roomUsers[j].id] != true &&
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class SignUpController extends State<SignUp> {
|
|||
MatrixFile avatar;
|
||||
|
||||
void setAvatarAction() async {
|
||||
var file =
|
||||
final file =
|
||||
await FilePickerCross.importFromStorage(type: FileTypeCross.image);
|
||||
if (file != null) {
|
||||
setState(
|
||||
|
|
@ -35,7 +35,7 @@ class SignUpController extends State<SignUp> {
|
|||
void resetAvatarAction() => setState(() => avatar = null);
|
||||
|
||||
void signUpAction([_]) async {
|
||||
var matrix = Matrix.of(context);
|
||||
final matrix = Matrix.of(context);
|
||||
if (usernameController.text.isEmpty) {
|
||||
setState(() => usernameError = L10n.of(context).pleaseChooseAUsername);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class SignUpPasswordController extends State<SignUpPassword> {
|
|||
void toggleShowPassword() => setState(() => showPassword = !showPassword);
|
||||
|
||||
void signUpAction({AuthenticationData auth}) async {
|
||||
var matrix = Matrix.of(context);
|
||||
final matrix = Matrix.of(context);
|
||||
if (passwordController.text.isEmpty) {
|
||||
setState(() => passwordError = L10n.of(context).pleaseEnterYourPassword);
|
||||
} else {
|
||||
|
|
@ -42,7 +42,7 @@ class SignUpPasswordController extends State<SignUpPassword> {
|
|||
|
||||
try {
|
||||
setState(() => loading = true);
|
||||
var waitForLogin = matrix.client.onLoginStateChanged.stream.first;
|
||||
final waitForLogin = matrix.client.onLoginStateChanged.stream.first;
|
||||
await matrix.client.register(
|
||||
username: widget.username,
|
||||
password: passwordController.text,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue