OSDN Git Service

deprecated な Geo の代わりに Coordinates を使う
authorspx <spx268@gmail.com>
Wed, 19 Jun 2013 19:51:53 +0000 (04:51 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Wed, 4 Dec 2013 10:53:03 +0000 (19:53 +0900)
OpenTween/DataModel.cs
OpenTween/Twitter.cs

index b252667..d5372e9 100644 (file)
@@ -149,7 +149,7 @@ namespace OpenTween
         public class Coordinates
         {
             [DataMember(Name = "type", IsRequired = false)] public string Type;
-            [DataMember(Name = "coordinates", IsRequired = false)] public double[] coordinates = new double[3];
+            [DataMember(Name = "coordinates", IsRequired = false)] public double[] coordinates = new double[2];
         }
 
         [DataContract]
@@ -191,7 +191,7 @@ namespace OpenTween
         public class RetweetedStatus
         {
             [DataMember(Name = "coordinates", IsRequired = false)] public Coordinates Coordinates;
-            [DataMember(Name = "geo", IsRequired = false)] public Geo Geo;
+            //[DataMember(Name = "geo", IsRequired = false)] public Geo Geo;
             [DataMember(Name = "in_reply_to_user_id")] public long? InReplyToUserId;
             [DataMember(Name = "source")] public string Source;
             [DataMember(Name = "user")] public User User;
@@ -218,7 +218,7 @@ namespace OpenTween
             [DataMember(Name = "in_reply_to_user_id_str")] public string InReplyToUserIdStr;
             [DataMember(Name = "retweet_count")] public int RetweetCount;
             [DataMember(Name = "created_at")] public string CreatedAt;
-            [DataMember(Name = "geo", IsRequired = false)] public Geo Geo;
+            //[DataMember(Name = "geo", IsRequired = false)] public Geo Geo;
             [DataMember(Name = "retweeted")] public bool Retweeted;
             [DataMember(Name = "in_reply_to_user_id")] public long? InReplyToUserId;
             [DataMember(Name = "source")] public string Source;
index 14ce6cd..c4cb1b8 100644 (file)
@@ -1604,7 +1604,7 @@ namespace OpenTween
                 var tc = TabInformations.GetInstance().GetTabByType(MyCommon.TabUsageType.Favorites);
                 post.IsFav = tc.Contains(retweeted.Id);
 
-                if (retweeted.Geo != null) post.PostGeo = new PostClass.StatusGeo {Lat = retweeted.Geo.Coordinates[0], Lng = retweeted.Geo.Coordinates[1]};
+                if (retweeted.Coordinates != null) post.PostGeo = new PostClass.StatusGeo { Lng = retweeted.Coordinates.coordinates[0], Lat = retweeted.Coordinates.coordinates[1] };
 
                 //以下、ユーザー情報
                 var user = retweeted.User;
@@ -1634,7 +1634,7 @@ namespace OpenTween
                 post.InReplyToUser = status.InReplyToScreenName;
                 post.InReplyToUserId = status.InReplyToUserId;
 
-                if (status.Geo != null) post.PostGeo = new PostClass.StatusGeo {Lat = status.Geo.Coordinates[0], Lng = status.Geo.Coordinates[1]};
+                if (status.Coordinates != null) post.PostGeo = new PostClass.StatusGeo { Lng = status.Coordinates.coordinates[0], Lat = status.Coordinates.coordinates[1] };
 
                 //以下、ユーザー情報
                 var user = status.User;