Esempio n. 1
0
        public User(Mastonet.Entities.Account cUser)
        {
            CreateAt        = cUser.CreatedAt;
            Description     = ContentRegex.Replace(LinkRegex.Replace(cUser.Note.Replace("<br>", "\n"), x => " " + x.Groups[1].Value + " "), "").Trim();
            Entities        = new UserEntities();
            FavouritesCount = 0;
            FollowersCount  = cUser.FollowersCount;
            FriendsCount    = cUser.FollowingCount;
            Id = cUser.Id;
            IsFollowRequestSent = false;
            IsMuting            = false;
            IsProtected         = cUser.Locked;
            IsVerified          = false;
            Language            = "en";
            ListedCount         = 0;
            Location            = "";
            var name = string.IsNullOrWhiteSpace(cUser.DisplayName) ? cUser.UserName : cUser.DisplayName;

            name = EmojiPatterns.LightValidEmoji.Replace(name,
                                                         x => EmojiPatterns.EmojiDictionary.TryGetValue(x.Groups[2].Value, out string val) ? val : x.Value);
            Name = name;
            ProfileBackgroundColor    = "C0DEED";
            ProfileBackgroundImageUrl = "http://localhost/";
            ProfileBannerUrl          = cUser.HeaderUrl.StartsWith("http") ? cUser.HeaderUrl : "http://localhost/";
            ProfileImageUrl           = cUser.AvatarUrl.StartsWith("http") ? cUser.AvatarUrl : "http://localhost/";
            ScreenName    = cUser.AccountName;
            StatusesCount = cUser.StatusesCount;
            TimeZone      = null;
            Url           = cUser.ProfileUrl;
        }
Esempio n. 2
0
 public User(CoreTweet.User cUser)
 {
     CreateAt        = cUser.CreatedAt.DateTime;
     Description     = cUser.Description;
     Entities        = new UserEntities(cUser.Entities);
     FavouritesCount = cUser.FavouritesCount;
     FollowersCount  = cUser.FollowersCount;
     FriendsCount    = cUser.FriendsCount;
     Id = cUser.Id ?? 0;
     IsFollowRequestSent = cUser.IsFollowRequestSent ?? false;
     IsMuting            = cUser.IsMuting ?? false;
     IsProtected         = cUser.IsProtected;
     IsVerified          = cUser.IsVerified;
     Language            = cUser.Language;
     ListedCount         = cUser.ListedCount ?? 0;
     Location            = cUser.Location;
     Name = cUser.Name;
     ProfileBackgroundColor    = cUser.ProfileBackgroundColor;
     ProfileBackgroundImageUrl = cUser.ProfileBackgroundImageUrl;
     ProfileBannerUrl          = cUser.ProfileBannerUrl;
     ProfileImageUrl           = cUser.ProfileImageUrl;
     ScreenName    = cUser.ScreenName;
     StatusesCount = cUser.StatusesCount;
     TimeZone      = cUser.TimeZone;
     Url           = cUser.Url;
 }