OSDN Git Service

OpenTween v2.4.2 リリース
[opentween/open-tween.git] / OpenTween / UserInfo.cs
index 8a5777b..f11781d 100644 (file)
 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 // Boston, MA 02110-1301, USA.
 
+#nullable enable
+
 using System;
 using System.Net;
-using OpenTween.Api;
+using OpenTween.Api.DataModel;
 
 namespace OpenTween
 {
@@ -36,7 +38,7 @@ namespace OpenTween
         {
         }
 
-        public UserInfo(TwitterDataModel.User user)
+        public UserInfo(TwitterUser user)
         {
             this.Id = user.Id;
             this.Name = WebUtility.HtmlDecode(user.Name).Trim();
@@ -51,7 +53,7 @@ namespace OpenTween
             {
                 this.ImageUrl = null;
             }
-            this.Url = user.Url;
+            this.Url = user.Url ?? "";
             this.Protect = user.Protected;
             this.FriendsCount = user.FriendsCount;
             this.FollowersCount = user.FollowersCount;
@@ -60,34 +62,32 @@ namespace OpenTween
             this.Verified = user.Verified;
             if (user.Status != null)
             {
-                this.RecentPost = user.Status.Text;
+                this.RecentPost = user.Status.FullText;
                 this.PostCreatedAt = MyCommon.DateTimeParse(user.Status.CreatedAt);
                 this.PostSource = user.Status.Source;
             }
         }
-        public Int64 Id = 0;
+        public long Id = 0;
         public string Name = "";
         public string ScreenName = "";
         public string Location = "";
         public string Description = "";
-        public Uri ImageUrl = null;
+        public Uri? ImageUrl = null;
         public string Url = "";
         public bool Protect = false;
         public int FriendsCount = 0;
         public int FollowersCount = 0;
         public int FavoriteCount = 0;
-        public DateTime CreatedAt = new DateTime();
+        public DateTimeUtc CreatedAt;
         public int StatusesCount = 0;
         public bool Verified = false;
         public string RecentPost = "";
-        public DateTime PostCreatedAt = new DateTime();
+        public DateTimeUtc PostCreatedAt;
         public string PostSource = "";        // html形式 "<a href="http://sourceforge.jp/projects/tween/wiki/FrontPage" rel="nofollow">Tween</a>"
         public bool isFollowing = false;
         public bool isFollowed = false;
 
         public override string ToString()
-        {
-            return this.ScreenName + " / " + this.Name;
-        }
+            => this.ScreenName + " / " + this.Name;
     }
 }