public async Task PushStartButton(CancellationToken cancellationToken) { var mastodonAccounts = (await _mastodonAccountRepository.GetAllMastodonAccounts(cancellationToken)).ToArray(); var misskeyAccounts = (await _misskeyAccountRepository.GetAllMisskeyAccounts(cancellationToken)).ToArray(); if (mastodonAccounts.Length is 0 && misskeyAccounts.Length is 0) { _startRegisteringAccount.StartRegisteringAccount(); }
public async Task <IEnumerable <AccountData> > GetAllAccounts(CancellationToken cancellationToken) { var mastodonData = await _mastodonAccountRepository.GetAllMastodonAccounts(cancellationToken); var misskeyData = await _misskeyAccountRepository.GetAllMisskeyAccounts(cancellationToken); return(mastodonData.Select(d => new AccountData(d.AccountIdentifier.Value, d.Username.Value, d.Instance.Value, d.IconUrl.IconUrl, d.IsReadingPostsFromThisAccount.Value, "Mastodon")) .Concat(misskeyData.Select(d => new AccountData(d.AccountIdentifier.Value, d.Username.Value, d.Instance.Value, d.IconUrl.IconUrl, d.IsReadingPostsFromThisAccount.Value, "Misskey"))) .ToList()); }