OSDN Git Service

C# 8.0 のnull許容参照型を有効化
[opentween/open-tween.git] / OpenTween / UserInfo.cs
index a026174..f11781d 100644 (file)
@@ -24,6 +24,8 @@
 // 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.DataModel;
@@ -51,26 +53,26 @@ 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;
-            this.CreatedAt = new DateTimeUtc(MyCommon.DateTimeParse(user.CreatedAt).ToUniversalTime());
+            this.CreatedAt = MyCommon.DateTimeParse(user.CreatedAt);
             this.StatusesCount = user.StatusesCount;
             this.Verified = user.Verified;
             if (user.Status != null)
             {
                 this.RecentPost = user.Status.FullText;
-                this.PostCreatedAt = new DateTimeUtc(MyCommon.DateTimeParse(user.Status.CreatedAt).ToUniversalTime());
+                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;
@@ -86,8 +88,6 @@ namespace OpenTween
         public bool isFollowed = false;
 
         public override string ToString()
-        {
-            return this.ScreenName + " / " + this.Name;
-        }
+            => this.ScreenName + " / " + this.Name;
     }
 }