Пример #1
0
 public Shell(MastodonClient don, Account myself, Logger logger)
 {
     Core        = new Server(this);
     Mastodon    = don;
     Myself      = new DonUser(myself);
     this.logger = logger;
     SubscribeStreams();
 }
Пример #2
0
 public DonPost(Status toot, Shell shell)
 {
     Native      = toot;
     Id          = toot.Id.ToString();
     User        = new DonUser(toot.Account);
     Text        = Regex.Replace(toot.Content, @"<("".*?""|'.*?'|[^'""])*?>", "");
     IsReply     = toot.InReplyToId != default;
     Reply       = IsReply ? shell.GetPostAsync(toot.InReplyToId.ToString()).Result : default;
     RepostCount = toot.ReblogsCount;
     Visiblity   =
         toot.Visibility == VisibilityType.Public ? V.Public    :
         toot.Visibility == VisibilityType.Unlisted ? V.Limited :
         toot.Visibility == VisibilityType.Private ? V.Private  :
         toot.Visibility == VisibilityType.Direct ? V.Direct    : V.Default;
     NativeVisiblity = toot.Visibility?.ToString().ToLowerInvariant();
     Via             = toot.Application?.Name;
     Poll            = default;
     Attachments     = toot.MediaAttachments?.Select(m => new DonAttachment(m) as IAttachment).ToList();
 }