public MastodonNotification(int id, string type, MastodonAccount account, MastodonStatus status) : base(id) { if (account != null) { this._accounts.Add(account); } if (status != null) { this.Status = status; } switch (type) { case "mention": this.Type = NotificationType.Mention; break; case "reblog": this.Type = NotificationType.Boost; break; case "favourite": this.Type = NotificationType.Favorite; break; case "follow": this.Type = NotificationType.Follow; break; default: this.Type = NotificationType.Unknown; break; } }
private async void OnAddAccountClickAsync(object sender, RoutedEventArgs e) { var progdiag = await this.ShowProgressAsync("認証中", "認証処理をしています。しばらくお待ちください。"); try { var tokens = await authClient.ConnectWithCode(PinCodeTextBox.Text); await Task.Run(() => { var client = new MastodonClient(registeredApp, tokens); var container = new MastodonAccount(client); Core.ConfigStore.StaticConfig.accountList.Add(container); }); await progdiag.CloseAsync(); this.Close(); } catch (Exception ex) { await this.ShowMessageAsync("エラー", $"何らかのエラーで認証を開始することが出来ませんでした。\n\n{ex}"); await progdiag.CloseAsync(); } }
public override DataTemplate SelectTemplate(object item, DependencyObject container) { return(item switch { TwitterAccount _ => this.GetTemplate("AccountTemplate.Twitter"), MastodonAccount _ => this.GetTemplate("AccountTemplate.Mastodon"), _ => base.SelectTemplate(item, container), });
internal MastodonStatus(int id, MastodonAccount account, string content, bool reblogged, bool favorited, MastodonStatus reblog, int?replyToId, int?replyToAccountId, IEnumerable <MastodonAttachment> mediaAttachments, IEnumerable <MastodonTag> tags, DateTime createdAt) : this(id, account) { if (reblog != null) { this.BoostedId = reblog.Id; this.IsBoost = true; } this.Content = content; this.IsFavorited = favorited; this.IsBoosted = reblogged; this.Boost = reblog; this.Account = account; this.IsReply = replyToAccountId != null || replyToId != null; this.ReplyToId = replyToId ?? 0; this.ReplyToAccountId = replyToAccountId ?? 0; this.MediaAttachments = mediaAttachments; this.Tags = tags; this.CreatedAt = createdAt; }
internal MastodonStatus(int id, MastodonAccount account) : base(id) { this.Account = account; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="account">アカウント情報</param> public MastodonStatusAccessor(MastodonAccount account) { this._account = account; }
public MastodonValidator(MastodonAccount account) { this._account = account; }
public MastodonTimeline(MastodonAccount account) : base(account) { this._account = account; this._userId = account.Info.Id; }
public async Task SaveMastodonAccount(MastodonAccount accountData, CancellationToken cancellationToken) { await _storage.SaveMastodonAccountData(new MastodonAccountData(accountData.Username.Value, accountData.Instance.Value, accountData.DisplayName.Value, accountData.AccessToken.Token, accountData.IconUrl.IconUrl, accountData.IsReadingPostsFromThisAccount.Value), cancellationToken); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="account">アカウント情報</param> public MastodonMediaAccessor(MastodonAccount account) { this._account = account; }
public MastodonApiGateway(MastodonAccount account) { this._account = account; this._api = account.Api; }