• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

開発に使用するリポジトリ


Commit MetaInfo

修订版3b03e11b563bf0decdee7bf110f34c3a9ae4c803 (tree)
时间2013-07-07 03:40:55
作者Kimura Youichi <kim.upsilon@bucy...>
CommiterKimura Youichi

Log Message

Nullable<T> 型を積極的に使うように変更

もぅ post.RetweetedId > 0 とかマヂ無理。リファクタリングしよ…

このコミットによる変更で、これまで値が存在しないことを表すために 0 が使用されて
いたフィールドの型が Nullable<T> に変更されています。
具体的には PostStatus.RetweetedId や PostStatus.InReplyToStatusId などが long 型
から long? (Nullable<long>) 型に変更されました。また、HttpTwitter クラスでは、
Twitter API をコールするメソッドで任意とされているパラメータ (since_id や count
など) の型が Nullable<T> に変更されています。
これによって、例えば post.InReplyToStatusId > 0 のようにしてツイートがリプライで
あるか否かを判定していたコードが、これからは post.InReplyToStatusId != null と
記述するようになります。
派生プロジェクトにおいては、派生版のコードをマージする際に InReplyToStatusId や
RetweetedId などを使用したり HttpTwitter クラスのメソッドを使用したりするコード
が存在しないか確認し、もし存在すればそれらのコードの修正が必要か否か注意深く確認
して下さい。

更改概述

差异

--- a/OpenTween.Tests/MyCommonTest.cs
+++ b/OpenTween.Tests/MyCommonTest.cs
@@ -188,7 +188,7 @@ namespace OpenTween
188188 public static object[] GetStatusUrlTest1_TestCase =
189189 {
190190 new object[] {
191- new PostClass { StatusId = 249493863826350080L, ScreenName = "Favstar_LM", RetweetedId = 0L, RetweetedBy = null },
191+ new PostClass { StatusId = 249493863826350080L, ScreenName = "Favstar_LM", RetweetedId = null, RetweetedBy = null },
192192 "https://twitter.com/Favstar_LM/status/249493863826350080",
193193 },
194194 new object[] {
--- a/OpenTween.Tests/PostClassTest.cs
+++ b/OpenTween.Tests/PostClassTest.cs
@@ -49,7 +49,7 @@ namespace OpenTween
4949 bool IsOwl = false,
5050 bool IsMark = false,
5151 string InReplyToUser = null,
52- long InReplyToStatusId = 0L,
52+ long? InReplyToStatusId = null,
5353 string Source = null,
5454 string SourceHtml = null,
5555 List<string> ReplyToList = null,
@@ -58,7 +58,7 @@ namespace OpenTween
5858 long userId = 0L,
5959 bool FilterHit = false,
6060 string RetweetedBy = null,
61- long RetweetedId = 0L,
61+ long? RetweetedId = null,
6262 StatusGeo Geo = null) :
6363 base(Nickname, textFromApi, text, ImageUrl, screenName, createdAt, statusId, IsFav, IsRead,
6464 IsReply, IsExcludeReply, IsProtect, IsOwl, IsMark, InReplyToUser, InReplyToStatusId, Source,
@@ -124,8 +124,8 @@ namespace OpenTween
124124 post.IsFav = isFav;
125125 Assert.That(post.IsFav, Is.EqualTo(isFav));
126126
127- if (post.RetweetedId != 0)
128- Assert.That(PostClassTest.TestCases[post.RetweetedId].IsFav, Is.EqualTo(isFav));
127+ if (post.RetweetedId != null)
128+ Assert.That(PostClassTest.TestCases[post.RetweetedId.Value].IsFav, Is.EqualTo(isFav));
129129 }
130130
131131 [Test, Combinatorial]
@@ -144,7 +144,7 @@ namespace OpenTween
144144 post.IsMark = mark;
145145 if (mark) except |= 0x02;
146146
147- post.InReplyToStatusId = reply ? 100L : 0L;
147+ post.InReplyToStatusId = reply ? (long?)100L : null;
148148 if (reply) except |= 0x04;
149149
150150 post.PostGeo = geo ? new PostClass.StatusGeo { Lat = -47.15, Lng = -126.716667 } : new PostClass.StatusGeo();
@@ -169,9 +169,9 @@ namespace OpenTween
169169
170170 post.IsDeleted = true;
171171
172- Assert.That(post.InReplyToStatusId, Is.EqualTo(0L));
172+ Assert.That(post.InReplyToStatusId, Is.Null);
173173 Assert.That(post.InReplyToUser, Is.EqualTo(""));
174- Assert.That(post.InReplyToUserId, Is.EqualTo(0L));
174+ Assert.That(post.InReplyToUserId, Is.Null);
175175 Assert.That(post.IsReply, Is.False);
176176 Assert.That(post.ReplyToList, Is.Empty);
177177 Assert.That(post.StateIndex, Is.EqualTo(-1));
--- a/OpenTween.Tests/TwitterTest.cs
+++ b/OpenTween.Tests/TwitterTest.cs
@@ -69,7 +69,7 @@ namespace OpenTween
6969 {
7070 var posts = new Dictionary<long, PostClass>
7171 {
72- {950L, new PostClass { StatusId = 950L, InReplyToStatusId = 0L }}, // このツイートが末端
72+ {950L, new PostClass { StatusId = 950L, InReplyToStatusId = null }}, // このツイートが末端
7373 {987L, new PostClass { StatusId = 987L, InReplyToStatusId = 950L }},
7474 {999L, new PostClass { StatusId = 999L, InReplyToStatusId = 987L }},
7575 {1000L, new PostClass { StatusId = 1000L, InReplyToStatusId = 999L }},
--- a/OpenTween/AppendSettingDialog.cs
+++ b/OpenTween/AppendSettingDialog.cs
@@ -60,7 +60,7 @@ namespace OpenTween
6060 public int MapThumbnailZoom;
6161 public bool IsListStatusesIncludeRts;
6262 public List<UserAccount> UserAccounts;
63- private long InitialUserId;
63+ private long? InitialUserId;
6464 public bool TabMouseLock;
6565 public bool IsRemoveSameEvent;
6666 public bool IsNotifyUseGrowl;
@@ -520,7 +520,7 @@ namespace OpenTween
520520 }
521521 //アクティブユーザーを起動時のアカウントに戻す(起動時アカウントなければ何もしない)
522522 bool userSet = false;
523- if (this.InitialUserId > 0)
523+ if (this.InitialUserId != null)
524524 {
525525 foreach (UserAccount u in this.UserAccounts)
526526 {
--- a/OpenTween/Connection/HttpTwitter.cs
+++ b/OpenTween/Connection/HttpTwitter.cs
@@ -191,11 +191,11 @@ namespace OpenTween
191191 }
192192 }
193193
194- public HttpStatusCode UpdateStatus(string status, long replyToId, ref string content)
194+ public HttpStatusCode UpdateStatus(string status, long? replyToId, ref string content)
195195 {
196196 Dictionary<string, string> param = new Dictionary<string, string>();
197197 param.Add("status", status);
198- if (replyToId > 0) param.Add("in_reply_to_status_id", replyToId.ToString());
198+ if (replyToId != null) param.Add("in_reply_to_status_id", replyToId.ToString());
199199 param.Add("include_entities", "true");
200200 //if (AppendSettingDialog.Instance.ShortenTco && AppendSettingDialog.Instance.UrlConvertAuto) param.Add("wrap_links", "true")
201201
@@ -207,12 +207,12 @@ namespace OpenTween
207207 null);
208208 }
209209
210- public HttpStatusCode UpdateStatusWithMedia(string status, long replyToId, FileInfo mediaFile, ref string content)
210+ public HttpStatusCode UpdateStatusWithMedia(string status, long? replyToId, FileInfo mediaFile, ref string content)
211211 {
212212 //画像投稿用エンドポイント
213213 Dictionary<string, string> param = new Dictionary<string, string>();
214214 param.Add("status", status);
215- if (replyToId > 0) param.Add("in_reply_to_status_id", replyToId.ToString());
215+ if (replyToId != null) param.Add("in_reply_to_status_id", replyToId.ToString());
216216 param.Add("include_entities", "true");
217217 //if (AppendSettingDialog.Instance.ShortenTco && AppendSettingDialog.Instance.UrlConvertAuto) param.Add("wrap_links", "true")
218218
@@ -416,14 +416,14 @@ namespace OpenTween
416416 null);
417417 }
418418
419- public HttpStatusCode HomeTimeline(int count, long max_id, long since_id, ref string content)
419+ public HttpStatusCode HomeTimeline(int? count, long? max_id, long? since_id, ref string content)
420420 {
421421 Dictionary<string, string> param = new Dictionary<string, string>();
422- if (count > 0)
422+ if (count != null)
423423 param.Add("count", count.ToString());
424- if (max_id > 0)
424+ if (max_id != null)
425425 param.Add("max_id", max_id.ToString());
426- if (since_id > 0)
426+ if (since_id != null)
427427 param.Add("since_id", since_id.ToString());
428428
429429 param.Add("include_entities", "true");
@@ -436,22 +436,22 @@ namespace OpenTween
436436 HttpTwitter.API11Enabled ? CreateApi11Calllback("/statuses/home_timeline") : GetApiCallback);
437437 }
438438
439- public HttpStatusCode UserTimeline(long user_id, string screen_name, int count, long max_id, long since_id, ref string content)
439+ public HttpStatusCode UserTimeline(long? user_id, string screen_name, int? count, long? max_id, long? since_id, ref string content)
440440 {
441441 Dictionary<string, string> param = new Dictionary<string, string>();
442442
443- if ((user_id == 0 && string.IsNullOrEmpty(screen_name)) ||
444- (user_id != 0 && !string.IsNullOrEmpty(screen_name))) return HttpStatusCode.BadRequest;
443+ if ((user_id == null && string.IsNullOrEmpty(screen_name)) ||
444+ (user_id != null && !string.IsNullOrEmpty(screen_name))) return HttpStatusCode.BadRequest;
445445
446- if (user_id > 0)
446+ if (user_id != null)
447447 param.Add("user_id", user_id.ToString());
448448 if (!string.IsNullOrEmpty(screen_name))
449449 param.Add("screen_name", screen_name);
450- if (count > 0)
450+ if (count != null)
451451 param.Add("count", count.ToString());
452- if (max_id > 0)
452+ if (max_id != null)
453453 param.Add("max_id", max_id.ToString());
454- if (since_id > 0)
454+ if (since_id != null)
455455 param.Add("since_id", since_id.ToString());
456456
457457 param.Add("include_rts", "true");
@@ -465,14 +465,14 @@ namespace OpenTween
465465 HttpTwitter.API11Enabled ? CreateApi11Calllback("/statuses/user_timeline") : GetApiCallback);
466466 }
467467
468- public HttpStatusCode PublicTimeline(int count, long max_id, long since_id, ref string content)
468+ public HttpStatusCode PublicTimeline(int? count, long? max_id, long? since_id, ref string content)
469469 {
470470 Dictionary<string, string> param = new Dictionary<string, string>();
471- if (count > 0)
471+ if (count != null)
472472 param.Add("count", count.ToString());
473- if (max_id > 0)
473+ if (max_id != null)
474474 param.Add("max_id", max_id.ToString());
475- if (since_id > 0)
475+ if (since_id != null)
476476 param.Add("since_id", since_id.ToString());
477477
478478 param.Add("include_entities", "true");
@@ -487,14 +487,14 @@ namespace OpenTween
487487 GetApiCallback);
488488 }
489489
490- public HttpStatusCode Mentions(int count, long max_id, long since_id, ref string content)
490+ public HttpStatusCode Mentions(int? count, long? max_id, long? since_id, ref string content)
491491 {
492492 Dictionary<string, string> param = new Dictionary<string, string>();
493- if (count > 0)
493+ if (count != null)
494494 param.Add("count", count.ToString());
495- if (max_id > 0)
495+ if (max_id != null)
496496 param.Add("max_id", max_id.ToString());
497- if (since_id > 0)
497+ if (since_id != null)
498498 param.Add("since_id", since_id.ToString());
499499
500500 param.Add("include_entities", "true");
@@ -507,14 +507,14 @@ namespace OpenTween
507507 HttpTwitter.API11Enabled ? CreateApi11Calllback("/statuses/mentions_timeline") : GetApiCallback);
508508 }
509509
510- public HttpStatusCode DirectMessages(int count, long max_id, long since_id, ref string content)
510+ public HttpStatusCode DirectMessages(int? count, long? max_id, long? since_id, ref string content)
511511 {
512512 Dictionary<string, string> param = new Dictionary<string, string>();
513- if (count > 0)
513+ if (count != null)
514514 param.Add("count", count.ToString());
515- if (max_id > 0)
515+ if (max_id != null)
516516 param.Add("max_id", max_id.ToString());
517- if (since_id > 0)
517+ if (since_id != null)
518518 param.Add("since_id", since_id.ToString());
519519 param.Add("include_entities", "true");
520520
@@ -526,14 +526,14 @@ namespace OpenTween
526526 HttpTwitter.API11Enabled ? CreateApi11Calllback("/direct_messages") : GetApiCallback);
527527 }
528528
529- public HttpStatusCode DirectMessagesSent(int count, long max_id, long since_id, ref string content)
529+ public HttpStatusCode DirectMessagesSent(int? count, long? max_id, long? since_id, ref string content)
530530 {
531531 Dictionary<string, string> param = new Dictionary<string, string>();
532- if (count > 0)
532+ if (count != null)
533533 param.Add("count", count.ToString());
534- if (max_id > 0)
534+ if (max_id != null)
535535 param.Add("max_id", max_id.ToString());
536- if (since_id > 0)
536+ if (since_id != null)
537537 param.Add("since_id", since_id.ToString());
538538 param.Add("include_entities", "true");
539539
@@ -545,12 +545,12 @@ namespace OpenTween
545545 HttpTwitter.API11Enabled ? CreateApi11Calllback("/direct_messages/sent") : GetApiCallback);
546546 }
547547
548- public HttpStatusCode Favorites(int count, int page, ref string content)
548+ public HttpStatusCode Favorites(int? count, int? page, ref string content)
549549 {
550550 Dictionary<string, string> param = new Dictionary<string, string>();
551- if (count != 20) param.Add("count", count.ToString());
551+ if (count != null) param.Add("count", count.ToString());
552552
553- if (page > 0)
553+ if (page != null)
554554 {
555555 param.Add("page", page.ToString());
556556 }
@@ -587,16 +587,16 @@ namespace OpenTween
587587 MyCommon.GetAssemblyName());
588588 }
589589
590- public HttpStatusCode PhoenixSearch(string words, string lang, int rpp, int page, long sinceId, ref string content)
590+ public HttpStatusCode PhoenixSearch(string words, string lang, int? rpp, int? page, long? sinceId, ref string content)
591591 {
592592 Dictionary<string, string> param = new Dictionary<string, string>();
593593 if (!string.IsNullOrEmpty(words)) param.Add("q", words);
594594 param.Add("include_entities", "1");
595595 param.Add("contributor_details", "true");
596596 if (!string.IsNullOrEmpty(lang)) param.Add("lang", lang);
597- if (rpp > 0) param.Add("rpp", rpp.ToString());
598- if (page > 0) param.Add("page", page.ToString());
599- if (sinceId > 0) param.Add("since_id", sinceId.ToString());
597+ if (rpp != null) param.Add("rpp", rpp.ToString());
598+ if (page != null) param.Add("page", page.ToString());
599+ if (sinceId != null) param.Add("since_id", sinceId.ToString());
600600
601601 if (param.Count == 0) return HttpStatusCode.BadRequest;
602602
@@ -608,14 +608,14 @@ namespace OpenTween
608608 MyCommon.GetAssemblyName());
609609 }
610610
611- public HttpStatusCode Search(string words, string lang, int count, long maxId, long sinceId, ref string content)
611+ public HttpStatusCode Search(string words, string lang, int? count, long? maxId, long? sinceId, ref string content)
612612 {
613613 Dictionary<string, string> param = new Dictionary<string, string>();
614614 if (!string.IsNullOrEmpty(words)) param.Add("q", words);
615615 if (!string.IsNullOrEmpty(lang)) param.Add("lang", lang);
616- if (count > 0) param.Add(HttpTwitter.API11Enabled ? "count" : "rpp", count.ToString());
617- if (maxId > 0) param.Add("max_id", maxId.ToString());
618- if (sinceId > 0) param.Add("since_id", sinceId.ToString());
616+ if (count != null) param.Add(HttpTwitter.API11Enabled ? "count" : "rpp", count.ToString());
617+ if (maxId != null) param.Add("max_id", maxId.ToString());
618+ if (sinceId != null) param.Add("since_id", sinceId.ToString());
619619
620620 if (param.Count == 0) return HttpStatusCode.BadRequest;
621621
@@ -743,18 +743,18 @@ namespace OpenTween
743743 HttpTwitter.API11Enabled ? CreateApi11Calllback("/lists/subscriptions") : GetApiCallback);
744744 }
745745
746- public HttpStatusCode GetListsStatuses(long userId, long list_id, int per_page, long max_id, long since_id, Boolean isRTinclude, ref string content)
746+ public HttpStatusCode GetListsStatuses(long userId, long list_id, int? per_page, long? max_id, long? since_id, Boolean isRTinclude, ref string content)
747747 {
748748 //認証なくても取得できるが、protectedユーザー分が抜ける
749749 Dictionary<string, string> param = new Dictionary<string, string>();
750750 param.Add("user_id", userId.ToString());
751751 param.Add("list_id", list_id.ToString());
752752 param.Add("include_rts", isRTinclude ? "true" : "false");
753- if (per_page > 0)
753+ if (per_page != null)
754754 param.Add(HttpTwitter.API11Enabled ? "count" : "per_page", per_page.ToString());
755- if (max_id > 0)
755+ if (max_id != null)
756756 param.Add("max_id", max_id.ToString());
757- if (since_id > 0)
757+ if (since_id != null)
758758 param.Add("since_id", since_id.ToString());
759759 param.Add("include_entities", "true");
760760
@@ -888,12 +888,12 @@ namespace OpenTween
888888 }
889889 #endregion
890890
891- public HttpStatusCode Statusid_retweeted_by_ids(long statusid, int count, int page, ref string content)
891+ public HttpStatusCode Statusid_retweeted_by_ids(long statusid, int? count, int? page, ref string content)
892892 {
893893 Dictionary<string, string> param = new Dictionary<string, string>();
894- if (count > 0)
894+ if (count != null)
895895 param.Add("count", count.ToString());
896- if (page > 0)
896+ if (page != null)
897897 param.Add("page", page.ToString());
898898
899899 if (HttpTwitter.API11Enabled)
--- a/OpenTween/Connection/IMultimediaShareService.cs
+++ b/OpenTween/Connection/IMultimediaShareService.cs
@@ -26,7 +26,7 @@ namespace OpenTween
2626 {
2727 string Upload(ref string filePath,
2828 ref string message,
29- long reply_to);
29+ long? reply_to);
3030 bool CheckValidExtension(string ext) ;
3131 string GetFileOpenDialogFilter();
3232 MyCommon.UploadFileType GetFileType(string ext);
--- a/OpenTween/Connection/TwipplePhoto.cs
+++ b/OpenTween/Connection/TwipplePhoto.cs
@@ -63,7 +63,7 @@ namespace OpenTween.Connection
6363
6464 #region Upload Methods
6565
66- public string Upload(ref string filePath, ref string message, long reply_to)
66+ public string Upload(ref string filePath, ref string message, long? reply_to)
6767 {
6868 if (!File.Exists(filePath))
6969 return "Err:File isn't exists.";
--- a/OpenTween/Connection/TwitPic.cs
+++ b/OpenTween/Connection/TwitPic.cs
@@ -51,7 +51,7 @@ namespace OpenTween
5151
5252 private Twitter tw;
5353
54- public string Upload( ref string filePath, ref string message, long reply_to )
54+ public string Upload( ref string filePath, ref string message, long? reply_to )
5555 {
5656 if ( string.IsNullOrEmpty( filePath ) )
5757 return "Err:File isn't specified.";
--- a/OpenTween/Connection/TwitterPhoto.cs
+++ b/OpenTween/Connection/TwitterPhoto.cs
@@ -103,7 +103,7 @@ namespace OpenTween
103103 return type.Equals( UploadFileType.Picture );
104104 }
105105
106- public string Upload( ref string filePath, ref string message, long reply_to )
106+ public string Upload( ref string filePath, ref string message, long? reply_to )
107107 {
108108 if ( string.IsNullOrEmpty( filePath ) )
109109 return "Err:File isn't specified.";
--- a/OpenTween/Connection/imgly.cs
+++ b/OpenTween/Connection/imgly.cs
@@ -48,7 +48,7 @@ namespace OpenTween
4848
4949 private Twitter tw;
5050
51- public string Upload( ref string filePath, ref string message, long reply_to )
51+ public string Upload( ref string filePath, ref string message, long? reply_to )
5252 {
5353 if ( string.IsNullOrEmpty( filePath ) )
5454 return "Err:File isn't specified.";
--- a/OpenTween/Connection/yfrog.cs
+++ b/OpenTween/Connection/yfrog.cs
@@ -48,7 +48,7 @@ namespace OpenTween
4848
4949 private Twitter tw;
5050
51- public string Upload( ref string filePath, ref string message, long reply_to )
51+ public string Upload( ref string filePath, ref string message, long? reply_to )
5252 {
5353 if ( string.IsNullOrEmpty( filePath ) )
5454 return "Err:File isn't exists.";
--- a/OpenTween/DataModel.cs
+++ b/OpenTween/DataModel.cs
@@ -134,12 +134,12 @@ namespace OpenTween
134134 [DataMember(Name = "profile_background_image_url_https")] public string ProfileBackgroundImageUrlHttps;
135135 [DataMember(Name = "screen_name")] public string ScreenName;
136136 [DataMember(Name = "name")] public string Name;
137- [DataMember(Name = "following")] public string Following;
137+ [DataMember(Name = "following")] public bool? Following;
138138 [DataMember(Name = "profile_link_color")] public string ProfileLinkColor;
139139 [DataMember(Name = "id")] public Int64 Id;
140140 [DataMember(Name = "listed_count")] public int ListedCount;
141141 [DataMember(Name = "profile_background_tile")] public bool ProfileBackgroundTile;
142- [DataMember(Name = "utc_offset")] public string UtcOffset;
142+ [DataMember(Name = "utc_offset")] public int? UtcOffset;
143143 [DataMember(Name = "place", IsRequired = false)] public Place Place;
144144 [DataMember(Name = "status", IsRequired = false)] public Status Status;
145145 }
@@ -191,18 +191,18 @@ namespace OpenTween
191191 {
192192 [DataMember(Name = "coordinates", IsRequired = false)] public Coordinates Coordinates;
193193 [DataMember(Name = "geo", IsRequired = false)] public Geo Geo;
194- [DataMember(Name = "in_reply_to_user_id")] public string InReplyToUserId;
194+ [DataMember(Name = "in_reply_to_user_id")] public long? InReplyToUserId;
195195 [DataMember(Name = "source")] public string Source;
196196 [DataMember(Name = "user")] public User User;
197197 [DataMember(Name = "in_reply_to_screen_name")] public string InReplyToScreenName;
198198 [DataMember(Name = "created_at")] public string CreatedAt;
199199 [DataMember(Name = "contributors")] public int[] Contributors;
200200 [DataMember(Name = "favorited")] public bool Favorited;
201- [DataMember(Name = "truncated")] public string Truncated;
201+ [DataMember(Name = "truncated")] public bool? Truncated;
202202 [DataMember(Name = "id")] public Int64 Id;
203203 [DataMember(Name = "annotations", IsRequired = false)] public Annotations Annotations;
204204 [DataMember(Name = "place", IsRequired = false)] public Place Place;
205- [DataMember(Name = "in_reply_to_status_id")] public string InReplyToStatusId;
205+ [DataMember(Name = "in_reply_to_status_id")] public long? InReplyToStatusId;
206206 [DataMember(Name = "text")] public string Text;
207207 [DataMember(Name = "entities", IsRequired = false)] public Entities Entities;
208208 }
@@ -213,13 +213,13 @@ namespace OpenTween
213213 [DataMember(Name = "in_reply_to_status_id_str")] public string InReplyToStatusIdStr;
214214 [DataMember(Name = "contributors", IsRequired = false)] public int[] Contributors;
215215 [DataMember(Name = "in_reply_to_screen_name")] public string InReplyToScreenName;
216- [DataMember(Name = "in_reply_to_status_id")] public string InReplyToStatusId;
216+ [DataMember(Name = "in_reply_to_status_id")] public long? InReplyToStatusId;
217217 [DataMember(Name = "in_reply_to_user_id_str")] public string InReplyToUserIdStr;
218- [DataMember(Name = "retweet_count")] public string RetweetCount;
218+ [DataMember(Name = "retweet_count")] public int RetweetCount;
219219 [DataMember(Name = "created_at")] public string CreatedAt;
220220 [DataMember(Name = "geo", IsRequired = false)] public Geo Geo;
221221 [DataMember(Name = "retweeted")] public bool Retweeted;
222- [DataMember(Name = "in_reply_to_user_id")] public string InReplyToUserId;
222+ [DataMember(Name = "in_reply_to_user_id")] public long? InReplyToUserId;
223223 [DataMember(Name = "source")] public string Source;
224224 [DataMember(Name = "id_str")] public string IdStr;
225225 [DataMember(Name = "coordinates", IsRequired = false)] public Coordinates Coordinates;
--- a/OpenTween/MyCommon.cs
+++ b/OpenTween/MyCommon.cs
@@ -901,10 +901,10 @@ namespace OpenTween
901901
902902 public static string GetStatusUrl(PostClass post)
903903 {
904- if (post.RetweetedId == 0)
904+ if (post.RetweetedId == null)
905905 return GetStatusUrl(post.ScreenName, post.StatusId);
906906 else
907- return GetStatusUrl(post.ScreenName, post.RetweetedId);
907+ return GetStatusUrl(post.ScreenName, post.RetweetedId.Value);
908908 }
909909
910910 public static string GetStatusUrl(string screenName, long statusId)
--- a/OpenTween/StatusDictionary.cs
+++ b/OpenTween/StatusDictionary.cs
@@ -70,7 +70,7 @@ namespace OpenTween
7070 public bool IsOwl { get; set; }
7171 private bool _IsMark;
7272 public string InReplyToUser { get; set; }
73- private long _InReplyToStatusId;
73+ private long? _InReplyToStatusId;
7474 public string Source { get; set; }
7575 public string SourceHtml { get; set; }
7676 public List<string> ReplyToList { get; set; }
@@ -79,12 +79,12 @@ namespace OpenTween
7979 public long UserId { get; set; }
8080 public bool FilterHit { get; set; }
8181 public string RetweetedBy { get; set; }
82- public long RetweetedId { get; set; }
82+ public long? RetweetedId { get; set; }
8383 private bool _IsDeleted = false;
8484 private StatusGeo _postGeo = new StatusGeo();
8585 public int RetweetedCount { get; set; }
86- public long RetweetedByUserId { get; set; }
87- public long InReplyToUserId { get; set; }
86+ public long? RetweetedByUserId { get; set; }
87+ public long? InReplyToUserId { get; set; }
8888 public Dictionary<string, string> Media { get; set; }
8989
9090 public string RelTabName { get; set; }
@@ -117,7 +117,7 @@ namespace OpenTween
117117 bool IsOwl,
118118 bool IsMark,
119119 string InReplyToUser,
120- long InReplyToStatusId,
120+ long? InReplyToStatusId,
121121 string Source,
122122 string SourceHtml,
123123 List<string> ReplyToList,
@@ -126,7 +126,7 @@ namespace OpenTween
126126 long userId,
127127 bool FilterHit,
128128 string RetweetedBy,
129- long RetweetedId,
129+ long? RetweetedId,
130130 StatusGeo Geo)
131131 : this()
132132 {
@@ -178,9 +178,9 @@ namespace OpenTween
178178 {
179179 get
180180 {
181- if (this.RetweetedId > 0 && this.GetRetweetSource(this.RetweetedId) != null)
181+ if (this.RetweetedId != null && this.GetRetweetSource(this.RetweetedId.Value) != null)
182182 {
183- return this.GetRetweetSource(this.RetweetedId).IsFav;
183+ return this.GetRetweetSource(this.RetweetedId.Value).IsFav;
184184 }
185185 else
186186 {
@@ -190,9 +190,9 @@ namespace OpenTween
190190 set
191191 {
192192 _IsFav = value;
193- if (this.RetweetedId > 0 && this.GetRetweetSource(this.RetweetedId) != null)
193+ if (this.RetweetedId != null && this.GetRetweetSource(this.RetweetedId.Value) != null)
194194 {
195- this.GetRetweetSource(this.RetweetedId).IsFav = value;
195+ this.GetRetweetSource(this.RetweetedId.Value).IsFav = value;
196196 }
197197 }
198198 }
@@ -235,7 +235,7 @@ namespace OpenTween
235235 _IsMark = value;
236236 }
237237 }
238- public long InReplyToStatusId
238+ public long? InReplyToStatusId
239239 {
240240 get
241241 {
@@ -243,7 +243,7 @@ namespace OpenTween
243243 }
244244 set
245245 {
246- if (value > 0)
246+ if (value != null)
247247 {
248248 _states = _states | States.Reply;
249249 }
@@ -265,9 +265,9 @@ namespace OpenTween
265265 {
266266 if (value)
267267 {
268- this.InReplyToStatusId = 0;
268+ this.InReplyToStatusId = null;
269269 this.InReplyToUser = "";
270- this.InReplyToUserId = 0;
270+ this.InReplyToUserId = null;
271271 this.IsReply = false;
272272 this.ReplyToList = new List<string>();
273273 this._states = States.None;
@@ -652,7 +652,7 @@ namespace OpenTween
652652 tab.Remove(Id);
653653 }
654654 //FavタブからRetweet発言を削除する場合は、他の同一参照Retweetも削除
655- if (tType == MyCommon.TabUsageType.Favorites && post.RetweetedId > 0)
655+ if (tType == MyCommon.TabUsageType.Favorites && post.RetweetedId != null)
656656 {
657657 for (int i = 0; i < tab.AllCount; i++)
658658 {
@@ -665,7 +665,7 @@ namespace OpenTween
665665 {
666666 break;
667667 }
668- if (rPost.RetweetedId > 0 && rPost.RetweetedId == post.RetweetedId)
668+ if (rPost.RetweetedId != null && rPost.RetweetedId == post.RetweetedId)
669669 {
670670 if (tab.UnreadManage && !rPost.IsRead) //未読管理
671671 {
@@ -1198,7 +1198,7 @@ namespace OpenTween
11981198 {
11991199 if (Item.IsFav)
12001200 {
1201- if (Item.RetweetedId == 0)
1201+ if (Item.RetweetedId == null)
12021202 {
12031203 _statuses[Item.StatusId].IsFav = true;
12041204 }
@@ -1214,16 +1214,17 @@ namespace OpenTween
12141214 }
12151215 else
12161216 {
1217- if (Item.IsFav && Item.RetweetedId > 0) Item.IsFav = false;
1217+ if (Item.IsFav && Item.RetweetedId != null) Item.IsFav = false;
12181218 //既に持っている公式RTは捨てる
12191219 if (AppendSettingDialog.Instance.HideDuplicatedRetweets &&
12201220 !Item.IsMe &&
1221- this._retweets.ContainsKey(Item.RetweetedId) &&
1222- this._retweets[Item.RetweetedId].RetweetedCount > 0) return;
1221+ Item.RetweetedId != null &&
1222+ this._retweets.ContainsKey(Item.RetweetedId.Value) &&
1223+ this._retweets[Item.RetweetedId.Value].RetweetedCount > 0) return;
12231224 if (BlockIds.Contains(Item.UserId)) return;
12241225 _statuses.Add(Item.StatusId, Item);
12251226 }
1226- if (Item.RetweetedId > 0)
1227+ if (Item.RetweetedId != null)
12271228 {
12281229 this.AddRetweet(Item);
12291230 }
@@ -1264,19 +1265,21 @@ namespace OpenTween
12641265
12651266 private void AddRetweet(PostClass item)
12661267 {
1268+ var retweetedId = item.RetweetedId.Value;
1269+
12671270 //true:追加、False:保持済み
1268- if (_retweets.ContainsKey(item.RetweetedId))
1271+ if (_retweets.ContainsKey(retweetedId))
12691272 {
1270- _retweets[item.RetweetedId].RetweetedCount++;
1271- if (_retweets[item.RetweetedId].RetweetedCount > 10)
1273+ _retweets[retweetedId].RetweetedCount++;
1274+ if (_retweets[retweetedId].RetweetedCount > 10)
12721275 {
1273- _retweets[item.RetweetedId].RetweetedCount = 0;
1276+ _retweets[retweetedId].RetweetedCount = 0;
12741277 }
12751278 return;
12761279 }
12771280
12781281 _retweets.Add(
1279- item.RetweetedId,
1282+ item.RetweetedId.Value,
12801283 new PostClass(
12811284 item.Nickname,
12821285 item.TextFromApi,
@@ -1284,7 +1287,7 @@ namespace OpenTween
12841287 item.ImageUrl,
12851288 item.ScreenName,
12861289 item.CreatedAt,
1287- item.RetweetedId,
1290+ item.RetweetedId.Value,
12881291 item.IsFav,
12891292 item.IsRead,
12901293 item.IsReply,
@@ -1302,11 +1305,11 @@ namespace OpenTween
13021305 item.UserId,
13031306 item.FilterHit,
13041307 "",
1305- 0,
1308+ null,
13061309 item.PostGeo
13071310 )
13081311 );
1309- _retweets[item.RetweetedId].RetweetedCount++;
1312+ _retweets[retweetedId].RetweetedCount++;
13101313 }
13111314
13121315 public void SetReadAllTab(bool Read, string TabName, int Index)
@@ -3198,7 +3201,7 @@ namespace OpenTween
31983201 }
31993202 if (_isRt)
32003203 {
3201- if (post.RetweetedId == 0) bHit = false;
3204+ if (post.RetweetedId == null) bHit = false;
32023205 }
32033206 if (!string.IsNullOrEmpty(_source))
32043207 {
@@ -3325,7 +3328,7 @@ namespace OpenTween
33253328 }
33263329 if (_isExRt)
33273330 {
3328- if (post.RetweetedId > 0) exFlag = true;
3331+ if (post.RetweetedId != null) exFlag = true;
33293332 }
33303333 if (!string.IsNullOrEmpty(_exSource))
33313334 {
--- a/OpenTween/Tween.cs
+++ b/OpenTween/Tween.cs
@@ -153,7 +153,7 @@ namespace OpenTween
153153 private int _hisIdx; //発言履歴カレントインデックス
154154
155155 //発言投稿時のAPI引数(発言編集時に設定。手書きreplyでは設定されない)
156- private long _reply_to_id; // リプライ先のステータスID 0の場合はリプライではない 注:複数あてのものはリプライではない
156+ private long? _reply_to_id; // リプライ先のステータスID 0の場合はリプライではない 注:複数あてのものはリプライではない
157157 private string _reply_to_name; // リプライ先ステータスの書き込み者の名前
158158
159159 //時速表示用
@@ -291,14 +291,14 @@ namespace OpenTween
291291 private class PostingStatus
292292 {
293293 public string status = "";
294- public long inReplyToId = 0;
295- public string inReplyToName = "";
294+ public long? inReplyToId = null;
295+ public string inReplyToName = null;
296296 public string imageService = ""; //画像投稿サービス名
297297 public string imagePath = "";
298298 public PostingStatus()
299299 {
300300 }
301- public PostingStatus(string status, long replyToId, string replyToName)
301+ public PostingStatus(string status, long? replyToId, string replyToName)
302302 {
303303 this.status = status;
304304 this.inReplyToId = replyToId;
@@ -588,8 +588,8 @@ namespace OpenTween
588588
589589 _history.Add(new PostingStatus());
590590 _hisIdx = 0;
591- _reply_to_id = 0;
592- _reply_to_name = "";
591+ _reply_to_id = null;
592+ _reply_to_name = null;
593593
594594 //<<<<<<<<<設定関連>>>>>>>>>
595595 //設定コンバージョン
@@ -2017,7 +2017,7 @@ namespace OpenTween
20172017 Color cl;
20182018 if (Post.IsFav)
20192019 cl = _clFav;
2020- else if (Post.RetweetedId > 0)
2020+ else if (Post.RetweetedId != null)
20212021 cl = _clRetweet;
20222022 else if (Post.IsOwl && (Post.IsDm || SettingDialog.OneWayLove))
20232023 cl = _clOWL;
@@ -2244,7 +2244,7 @@ namespace OpenTween
22442244 //ハッシュタグ
22452245 if (HashMgr.IsNotAddToAtReply)
22462246 {
2247- if (!string.IsNullOrEmpty(HashMgr.UseHash) && _reply_to_id == 0 && string.IsNullOrEmpty(_reply_to_name))
2247+ if (!string.IsNullOrEmpty(HashMgr.UseHash) && _reply_to_id == null && string.IsNullOrEmpty(_reply_to_name))
22482248 {
22492249 if (HashMgr.IsHead)
22502250 header = HashMgr.UseHash + " ";
@@ -2363,8 +2363,8 @@ namespace OpenTween
23632363 OpenUriAsync(tmp);
23642364 }
23652365
2366- _reply_to_id = 0;
2367- _reply_to_name = "";
2366+ _reply_to_id = null;
2367+ _reply_to_name = null;
23682368 StatusText.Text = "";
23692369 _history.Add(new PostingStatus());
23702370 _hisIdx = _history.Count - 1;
@@ -2496,10 +2496,10 @@ namespace OpenTween
24962496 bw.ReportProgress(50, MakeStatusMessage(args, false));
24972497 if (!post.IsFav)
24982498 {
2499- if (post.RetweetedId == 0)
2499+ if (post.RetweetedId == null)
25002500 ret = tw.PostFavAdd(post.StatusId);
25012501 else
2502- ret = tw.PostFavAdd(post.RetweetedId);
2502+ ret = tw.PostFavAdd(post.RetweetedId.Value);
25032503
25042504 if (ret.Length == 0)
25052505 {
@@ -2549,10 +2549,10 @@ namespace OpenTween
25492549 bw.ReportProgress(50, MakeStatusMessage(args, false));
25502550 if (post.IsFav)
25512551 {
2552- if (post.RetweetedId == 0)
2552+ if (post.RetweetedId == null)
25532553 ret = tw.PostFavRemove(post.StatusId);
25542554 else
2555- ret = tw.PostFavRemove(post.RetweetedId);
2555+ ret = tw.PostFavRemove(post.RetweetedId.Value);
25562556
25572557 if (ret.Length == 0)
25582558 {
@@ -3614,7 +3614,7 @@ namespace OpenTween
36143614 //}
36153615 if (_statuses.Tabs[ListTab.SelectedTab.Text].TabType == MyCommon.TabUsageType.PublicSearch
36163616 || !this.ExistCurrentPost
3617- || !(_curPost.InReplyToStatusId > 0))
3617+ || _curPost.InReplyToStatusId == null)
36183618 {
36193619 RepliedStatusOpenMenuItem.Enabled = false;
36203620 }
@@ -5035,8 +5035,8 @@ namespace OpenTween
50355035 }
50365036 if (string.IsNullOrEmpty(StatusText.Text))
50375037 {
5038- _reply_to_id = 0;
5039- _reply_to_name = "";
5038+ _reply_to_id = null;
5039+ _reply_to_name = null;
50405040 }
50415041 }
50425042
@@ -5238,10 +5238,10 @@ namespace OpenTween
52385238 //if (Post.IsDeleted) mk.Append("×");
52395239 //if (Post.IsMark) mk.Append("♪");
52405240 //if (Post.IsProtect) mk.Append("Ю");
5241- //if (Post.InReplyToStatusId > 0) mk.Append("⇒");
5241+ //if (Post.InReplyToStatusId != null) mk.Append("⇒");
52425242 if (Post.FavoritedCount > 0) mk.Append("+" + Post.FavoritedCount.ToString());
52435243 ImageListViewItem itm;
5244- if (Post.RetweetedId == 0)
5244+ if (Post.RetweetedId == null)
52455245 {
52465246 string[] sitem= {"",
52475247 Post.Nickname,
@@ -6221,7 +6221,7 @@ namespace OpenTween
62216221 NameLabel.ForeColor = System.Drawing.SystemColors.ControlText;
62226222 DateTimeLabel.Text = _curPost.CreatedAt.ToString();
62236223 if (_curPost.IsOwl && (SettingDialog.OneWayLove || _statuses.Tabs[_curTab.Text].TabType == MyCommon.TabUsageType.DirectMessage)) NameLabel.ForeColor = _clOWL;
6224- if (_curPost.RetweetedId > 0) NameLabel.ForeColor = _clRetweet;
6224+ if (_curPost.RetweetedId != null) NameLabel.ForeColor = _clRetweet;
62256225 if (_curPost.IsFav) NameLabel.ForeColor = _clFav;
62266226
62276227 if (DumpPostClassToolStripMenuItem.Checked)
@@ -7054,7 +7054,7 @@ namespace OpenTween
70547054 if (post.IsDeleted) continue;
70557055 if (!isDm)
70567056 {
7057- if (post.RetweetedId > 0)
7057+ if (post.RetweetedId != null)
70587058 sb.AppendFormat("{0}:{1} [http://twitter.com/{0}/status/{2}]{3}", post.ScreenName, post.TextSingleLine, post.RetweetedId, Environment.NewLine);
70597059 else
70607060 sb.AppendFormat("{0}:{1} [http://twitter.com/{0}/status/{2}]{3}", post.ScreenName, post.TextSingleLine, post.StatusId, Environment.NewLine);
@@ -7240,7 +7240,7 @@ namespace OpenTween
72407240 }
72417241
72427242 string name = "";
7243- if (_curPost.RetweetedId == 0)
7243+ if (_curPost.RetweetedId == null)
72447244 {
72457245 name = _curPost.ScreenName;
72467246 }
@@ -7250,7 +7250,7 @@ namespace OpenTween
72507250 }
72517251 for (int idx = fIdx; idx != toIdx; idx += stp)
72527252 {
7253- if (_statuses[_curTab.Text, idx].RetweetedId == 0)
7253+ if (_statuses[_curTab.Text, idx].RetweetedId == null)
72547254 {
72557255 if (_statuses[_curTab.Text, idx].ScreenName == name)
72567256 {
@@ -7425,7 +7425,7 @@ namespace OpenTween
74257425
74267426 TabClass curTabClass = _statuses.Tabs[_curTab.Text];
74277427
7428- if (curTabClass.TabType == MyCommon.TabUsageType.PublicSearch && _curPost.InReplyToStatusId == 0 && _curPost.TextFromApi.Contains("@"))
7428+ if (curTabClass.TabType == MyCommon.TabUsageType.PublicSearch && _curPost.InReplyToStatusId == null && _curPost.TextFromApi.Contains("@"))
74297429 {
74307430 PostClass post = null;
74317431 string r = tw.GetStatusApi(false, _curPost.StatusId, ref post);
@@ -7443,17 +7443,17 @@ namespace OpenTween
74437443 }
74447444 }
74457445
7446- if (!(this.ExistCurrentPost && _curPost.InReplyToUser != null && _curPost.InReplyToStatusId > 0)) return;
7446+ if (!(this.ExistCurrentPost && _curPost.InReplyToUser != null && _curPost.InReplyToStatusId != null)) return;
74477447
74487448 if (replyChains == null || (replyChains.Count > 0 && replyChains.Peek().InReplyToId != _curPost.StatusId))
74497449 {
74507450 replyChains = new Stack<ReplyChain>();
74517451 }
7452- replyChains.Push(new ReplyChain(_curPost.StatusId, _curPost.InReplyToStatusId, _curTab));
7452+ replyChains.Push(new ReplyChain(_curPost.StatusId, _curPost.InReplyToStatusId.Value, _curTab));
74537453
74547454 int inReplyToIndex;
74557455 string inReplyToTabName;
7456- long inReplyToId = _curPost.InReplyToStatusId;
7456+ long inReplyToId = _curPost.InReplyToStatusId.Value;
74577457 string inReplyToUser = _curPost.InReplyToUser;
74587458 Dictionary<long, PostClass> curTabPosts;
74597459
@@ -7479,7 +7479,7 @@ namespace OpenTween
74797479 catch (InvalidOperationException)
74807480 {
74817481 PostClass post = null;
7482- string r = tw.GetStatusApi(false, _curPost.InReplyToStatusId, ref post);
7482+ string r = tw.GetStatusApi(false, _curPost.InReplyToStatusId.Value, ref post);
74837483 if (string.IsNullOrEmpty(r) && post != null)
74847484 {
74857485 post.IsRead = true;
@@ -7528,7 +7528,7 @@ namespace OpenTween
75287528
75297529 if (parallel)
75307530 {
7531- if (_curPost.InReplyToStatusId != 0)
7531+ if (_curPost.InReplyToStatusId != null)
75327532 {
75337533 var posts = from t in _statuses.Tabs
75347534 from p in t.Value.IsInnerStorageTabType ? t.Value.Posts : _statuses.Posts
@@ -8252,8 +8252,8 @@ namespace OpenTween
82528252 StatusText.Text = "D " + _curPost.ScreenName + " " + StatusText.Text;
82538253 StatusText.SelectionStart = StatusText.Text.Length;
82548254 StatusText.Focus();
8255- _reply_to_id = 0;
8256- _reply_to_name = "";
8255+ _reply_to_id = null;
8256+ _reply_to_name = null;
82578257 return;
82588258 }
82598259 if (string.IsNullOrEmpty(StatusText.Text))
@@ -8262,9 +8262,9 @@ namespace OpenTween
82628262
82638263 // ステータステキストが入力されていない場合先頭に@ユーザー名を追加する
82648264 StatusText.Text = "@" + _curPost.ScreenName + " ";
8265- if (_curPost.RetweetedId > 0)
8265+ if (_curPost.RetweetedId != null)
82668266 {
8267- _reply_to_id = _curPost.RetweetedId;
8267+ _reply_to_id = _curPost.RetweetedId.Value;
82688268 }
82698269 else
82708270 {
@@ -8281,12 +8281,12 @@ namespace OpenTween
82818281 //1件選んでEnter or DoubleClick
82828282 if (StatusText.Text.Contains("@" + _curPost.ScreenName + " "))
82838283 {
8284- if (_reply_to_id > 0 && _reply_to_name == _curPost.ScreenName)
8284+ if (_reply_to_id != null && _reply_to_name == _curPost.ScreenName)
82858285 {
82868286 //返信先書き換え
8287- if (_curPost.RetweetedId > 0)
8287+ if (_curPost.RetweetedId != null)
82888288 {
8289- _reply_to_id = _curPost.RetweetedId;
8289+ _reply_to_id = _curPost.RetweetedId.Value;
82908290 }
82918291 else
82928292 {
@@ -8303,16 +8303,16 @@ namespace OpenTween
83038303 {
83048304 // 複数リプライ
83058305 StatusText.Text = StatusText.Text.Insert(2, "@" + _curPost.ScreenName + " ");
8306- _reply_to_id = 0;
8307- _reply_to_name = "";
8306+ _reply_to_id = null;
8307+ _reply_to_name = null;
83088308 }
83098309 else
83108310 {
83118311 // 単独リプライ
83128312 StatusText.Text = "@" + _curPost.ScreenName + " " + StatusText.Text;
8313- if (_curPost.RetweetedId > 0)
8313+ if (_curPost.RetweetedId != null)
83148314 {
8315- _reply_to_id = _curPost.RetweetedId;
8315+ _reply_to_id = _curPost.RetweetedId.Value;
83168316 }
83178317 else
83188318 {
@@ -8327,8 +8327,8 @@ namespace OpenTween
83278327 // 複数リプライ
83288328 StatusText.Text = ". @" + _curPost.ScreenName + " " + StatusText.Text;
83298329 //StatusText.Text = "@" + _curPost.ScreenName + " " + StatusText.Text;
8330- _reply_to_id = 0;
8331- _reply_to_name = "";
8330+ _reply_to_id = null;
8331+ _reply_to_name = null;
83328332 }
83338333 }
83348334 else
@@ -8380,8 +8380,8 @@ namespace OpenTween
83808380 if (!sTxt.StartsWith(". "))
83818381 {
83828382 sTxt = ". " + sTxt;
8383- _reply_to_id = 0;
8384- _reply_to_name = "";
8383+ _reply_to_id = null;
8384+ _reply_to_name = null;
83858385 }
83868386 for (int cnt = 0; cnt < _curList.SelectedIndices.Count; cnt++)
83878387 {
@@ -8432,8 +8432,8 @@ namespace OpenTween
84328432 {
84338433 StatusText.Text = ". " + StatusText.Text;
84348434 sidx += 2;
8435- _reply_to_id = 0;
8436- _reply_to_name = "";
8435+ _reply_to_id = null;
8436+ _reply_to_name = null;
84378437 }
84388438 if (sidx > 0)
84398439 {
@@ -8497,9 +8497,9 @@ namespace OpenTween
84978497 StatusText.Text = ids;
84988498 StatusText.SelectionStart = ids.Length;
84998499 StatusText.Focus();
8500- if (post.RetweetedId > 0)
8500+ if (post.RetweetedId != null)
85018501 {
8502- _reply_to_id = post.RetweetedId;
8502+ _reply_to_id = post.RetweetedId.Value;
85038503 }
85048504 else
85058505 {
@@ -8904,7 +8904,7 @@ namespace OpenTween
89048904 if (!SelectTab(out tabName)) return;
89058905
89068906 fltDialog.SetCurrent(tabName);
8907- if (_statuses[_curTab.Text, idx].RetweetedId == 0)
8907+ if (_statuses[_curTab.Text, idx].RetweetedId == null)
89088908 {
89098909 fltDialog.AddNewFilter(_statuses[_curTab.Text, idx].ScreenName, _statuses[_curTab.Text, idx].TextFromApi);
89108910 }
@@ -9062,7 +9062,7 @@ namespace OpenTween
90629062 {
90639063 FiltersClass fc = new FiltersClass();
90649064 ids.Add(post.ScreenName);
9065- if (post.RetweetedId == 0)
9065+ if (post.RetweetedId == null)
90669066 {
90679067 fc.NameFilter = post.ScreenName;
90689068 }
@@ -9597,12 +9597,12 @@ namespace OpenTween
95979597 }
95989598
95999599 // リプライ先ステータスIDの指定がない場合は指定しない
9600- if (_reply_to_id == 0) return;
9600+ if (_reply_to_id == null) return;
96019601
96029602 // リプライ先ユーザー名がない場合も指定しない
96039603 if (string.IsNullOrEmpty(_reply_to_name))
96049604 {
9605- _reply_to_id = 0;
9605+ _reply_to_id = null;
96069606 return;
96079607 }
96089608
@@ -9627,8 +9627,8 @@ namespace OpenTween
96279627 }
96289628 }
96299629
9630- _reply_to_id = 0;
9631- _reply_to_name = "";
9630+ _reply_to_id = null;
9631+ _reply_to_name = null;
96329632
96339633 }
96349634
@@ -9711,28 +9711,28 @@ namespace OpenTween
97119711
97129712 private void doRepliedStatusOpen()
97139713 {
9714- if (this.ExistCurrentPost && _curPost.InReplyToUser != null && _curPost.InReplyToStatusId > 0)
9714+ if (this.ExistCurrentPost && _curPost.InReplyToUser != null && _curPost.InReplyToStatusId != null)
97159715 {
97169716 if (MyCommon.IsKeyDown(Keys.Shift))
97179717 {
9718- OpenUriAsync(MyCommon.GetStatusUrl(_curPost.InReplyToUser, _curPost.InReplyToStatusId));
9718+ OpenUriAsync(MyCommon.GetStatusUrl(_curPost.InReplyToUser, _curPost.InReplyToStatusId.Value));
97199719 return;
97209720 }
9721- if (_statuses.ContainsKey(_curPost.InReplyToStatusId))
9721+ if (_statuses.ContainsKey(_curPost.InReplyToStatusId.Value))
97229722 {
9723- PostClass repPost = _statuses[_curPost.InReplyToStatusId];
9723+ PostClass repPost = _statuses[_curPost.InReplyToStatusId.Value];
97249724 MessageBox.Show(repPost.ScreenName + " / " + repPost.Nickname + " (" + repPost.CreatedAt.ToString() + ")" + Environment.NewLine + repPost.TextFromApi);
97259725 }
97269726 else
97279727 {
97289728 foreach (TabClass tb in _statuses.GetTabsByType(MyCommon.TabUsageType.Lists | MyCommon.TabUsageType.PublicSearch))
97299729 {
9730- if (tb == null || !tb.Contains(_curPost.InReplyToStatusId)) break;
9731- PostClass repPost = _statuses[_curPost.InReplyToStatusId];
9730+ if (tb == null || !tb.Contains(_curPost.InReplyToStatusId.Value)) break;
9731+ PostClass repPost = _statuses[_curPost.InReplyToStatusId.Value];
97329732 MessageBox.Show(repPost.ScreenName + " / " + repPost.Nickname + " (" + repPost.CreatedAt.ToString() + ")" + Environment.NewLine + repPost.TextFromApi);
97339733 return;
97349734 }
9735- OpenUriAsync(MyCommon.GetStatusUrl(_curPost.InReplyToUser, _curPost.InReplyToStatusId));
9735+ OpenUriAsync(MyCommon.GetStatusUrl(_curPost.InReplyToUser, _curPost.InReplyToStatusId.Value));
97369736 }
97379737 }
97389738 }
@@ -10999,8 +10999,8 @@ namespace OpenTween
1099910999 else
1100011000 status = Regex.Replace(status, @"(\r\n|\n|\r)?<br>", " ", RegexOptions.IgnoreCase | RegexOptions.Multiline);
1100111001
11002- _reply_to_id = 0;
11003- _reply_to_name = "";
11002+ _reply_to_id = null;
11003+ _reply_to_name = null;
1100411004 status = status.Replace("&nbsp;", " ");
1100511005
1100611006 return status;
@@ -11492,13 +11492,13 @@ namespace OpenTween
1149211492 rtdata = CreateRetweetUnofficial(rtdata);
1149311493
1149411494 StatusText.Text = " QT @" + _curPost.ScreenName + ": " + WebUtility.HtmlDecode(rtdata);
11495- if (_curPost.RetweetedId == 0)
11495+ if (_curPost.RetweetedId == null)
1149611496 {
1149711497 _reply_to_id = _curPost.StatusId;
1149811498 }
1149911499 else
1150011500 {
11501- _reply_to_id = _curPost.RetweetedId;
11501+ _reply_to_id = _curPost.RetweetedId.Value;
1150211502 }
1150311503 _reply_to_name = _curPost.ScreenName;
1150411504
@@ -11612,7 +11612,7 @@ namespace OpenTween
1161211612 if (_curList.SelectedIndices.Count > 0)
1161311613 {
1161411614 PostClass post = GetCurTabPost(_curList.SelectedIndices[0]);
11615- if (post.RetweetedId > 0)
11615+ if (post.RetweetedId != null)
1161611616 {
1161711617 OpenUriAsync("http://twitter.com/" + GetCurTabPost(_curList.SelectedIndices[0]).RetweetedBy);
1161811618 }
@@ -11924,7 +11924,7 @@ namespace OpenTween
1192411924 }
1192511925 if (_statuses.Tabs[ListTab.SelectedTab.Text].TabType == MyCommon.TabUsageType.PublicSearch
1192611926 || !this.ExistCurrentPost
11927- || !(_curPost.InReplyToStatusId > 0))
11927+ || _curPost.InReplyToStatusId == null)
1192811928 {
1192911929 OpenRepSourceOpMenuItem.Enabled = false;
1193011930 }
@@ -12181,9 +12181,9 @@ namespace OpenTween
1218112181 int counter = 0;
1218212182
1218312183 long statusid;
12184- if (_curPost.RetweetedId > 0)
12184+ if (_curPost.RetweetedId != null)
1218512185 {
12186- statusid = _curPost.RetweetedId;
12186+ statusid = _curPost.RetweetedId.Value;
1218712187 }
1218812188 else
1218912189 {
@@ -13184,7 +13184,7 @@ namespace OpenTween
1318413184 {
1318513185 string xUrl = SettingDialog.UserAppointUrl;
1318613186 xUrl = xUrl.Replace("{ID}", _curPost.ScreenName);
13187- if (_curPost.RetweetedId != 0)
13187+ if (_curPost.RetweetedId != null)
1318813188 {
1318913189 xUrl = xUrl.Replace("{STATUS}", _curPost.RetweetedId.ToString());
1319013190 }
--- a/OpenTween/Twitter.cs
+++ b/OpenTween/Twitter.cs
@@ -554,7 +554,7 @@ namespace OpenTween
554554 return false;
555555 }
556556
557- public string PostStatus(string postStr, long reply_to)
557+ public string PostStatus(string postStr, long? reply_to)
558558 {
559559
560560 if (MyCommon._endingFlag) return "";
@@ -663,7 +663,7 @@ namespace OpenTween
663663 }
664664 }
665665
666- public string PostStatusWithMedia(string postStr, long reply_to, FileInfo mediaFile)
666+ public string PostStatusWithMedia(string postStr, long? reply_to, FileInfo mediaFile)
667667 {
668668 if (MyCommon._endingFlag) return "";
669669
@@ -916,9 +916,9 @@ namespace OpenTween
916916 {
917917 return "Err:Target isn't found.";
918918 }
919- if (TabInformations.GetInstance()[id].RetweetedId > 0)
919+ if (TabInformations.GetInstance()[id].RetweetedId != null)
920920 {
921- target = TabInformations.GetInstance()[id].RetweetedId; //再RTの場合は元発言をRT
921+ target = TabInformations.GetInstance()[id].RetweetedId.Value; //再RTの場合は元発言をRT
922922 }
923923
924924 HttpStatusCode res = HttpStatusCode.BadRequest;
@@ -971,7 +971,7 @@ namespace OpenTween
971971 if (TabInformations.GetInstance().ContainsKey(post.StatusId)) return "";
972972 }
973973 //Retweet判定
974- if (post.RetweetedId == 0) return "Invalid Json!";
974+ if (post.RetweetedId == null) return "Invalid Json!";
975975 //ユーザー情報
976976 post.IsMe = true;
977977
@@ -1380,9 +1380,7 @@ namespace OpenTween
13801380 MyCommon.TraceOut(ex, MethodBase.GetCurrentMethod().Name + " " + content);
13811381 return "Invalid Json!";
13821382 }
1383- int tmp;
1384- if (int.TryParse(status.RetweetCount, out tmp))
1385- retweeted_count = tmp;
1383+ retweeted_count = status.RetweetCount;
13861384 return "";
13871385 }
13881386
@@ -1898,22 +1896,22 @@ namespace OpenTween
18981896 {
18991897 if (more)
19001898 {
1901- res = twCon.HomeTimeline(count, this.minHomeTimeline, 0, ref content);
1899+ res = twCon.HomeTimeline(count, this.minHomeTimeline, null, ref content);
19021900 }
19031901 else
19041902 {
1905- res = twCon.HomeTimeline(count, 0, 0, ref content);
1903+ res = twCon.HomeTimeline(count, null, null, ref content);
19061904 }
19071905 }
19081906 else
19091907 {
19101908 if (more)
19111909 {
1912- res = twCon.Mentions(count, this.minMentions, 0, ref content);
1910+ res = twCon.Mentions(count, this.minMentions, null, ref content);
19131911 }
19141912 else
19151913 {
1916- res = twCon.Mentions(count, 0, 0, ref content);
1914+ res = twCon.Mentions(count, null, null, ref content);
19171915 }
19181916 }
19191917 }
@@ -1966,17 +1964,17 @@ namespace OpenTween
19661964 var target = tab.User;
19671965 if (string.IsNullOrEmpty(target)) return "";
19681966 userName = target;
1969- res = twCon.UserTimeline(0, target, count, 0, 0, ref content);
1967+ res = twCon.UserTimeline(null, target, count, null, null, ref content);
19701968 }
19711969 else
19721970 {
19731971 if (more)
19741972 {
1975- res = twCon.UserTimeline(0, userName, count, tab.OldestId, 0, ref content);
1973+ res = twCon.UserTimeline(null, userName, count, tab.OldestId, null, ref content);
19761974 }
19771975 else
19781976 {
1979- res = twCon.UserTimeline(0, userName, count, 0, 0, ref content);
1977+ res = twCon.UserTimeline(null, userName, count, null, null, ref content);
19801978 }
19811979 }
19821980 }
@@ -2126,17 +2124,13 @@ namespace OpenTween
21262124 //Source取得(htmlの場合は、中身を取り出し)
21272125 post.Source = retweeted.Source;
21282126 //Reply先
2129- long inReplyToStatusId;
2130- long.TryParse(retweeted.InReplyToStatusId, out inReplyToStatusId);
2131- post.InReplyToStatusId = inReplyToStatusId;
2127+ post.InReplyToStatusId = retweeted.InReplyToStatusId;
21322128 post.InReplyToUser = retweeted.InReplyToScreenName;
2133- long inReplyToUserId;
2134- long.TryParse(status.InReplyToUserId, out inReplyToUserId);
2135- post.InReplyToUserId = inReplyToUserId;
2129+ post.InReplyToUserId = status.InReplyToUserId;
21362130
21372131 //幻覚fav対策
21382132 var tc = TabInformations.GetInstance().GetTabByType(MyCommon.TabUsageType.Favorites);
2139- post.IsFav = tc.Contains(post.RetweetedId);
2133+ post.IsFav = tc.Contains(retweeted.Id);
21402134
21412135 if (retweeted.Geo != null) post.PostGeo = new PostClass.StatusGeo {Lat = retweeted.Geo.Coordinates[0], Lng = retweeted.Geo.Coordinates[1]};
21422136
@@ -2164,13 +2158,9 @@ namespace OpenTween
21642158 entities = status.Entities;
21652159 //Source取得(htmlの場合は、中身を取り出し)
21662160 post.Source = status.Source;
2167- long inReplyToStatusId;
2168- long.TryParse(status.InReplyToStatusId, out inReplyToStatusId);
2169- post.InReplyToStatusId = inReplyToStatusId;
2161+ post.InReplyToStatusId = status.InReplyToStatusId;
21702162 post.InReplyToUser = status.InReplyToScreenName;
2171- long inReplyToUserId;
2172- long.TryParse(status.InReplyToUserId, out inReplyToUserId);
2173- post.InReplyToUserId = inReplyToUserId;
2163+ post.InReplyToUserId = status.InReplyToUserId;
21742164
21752165 if (status.Geo != null) post.PostGeo = new PostClass.StatusGeo {Lat = status.Geo.Coordinates[0], Lng = status.Geo.Coordinates[1]};
21762166
@@ -2256,7 +2246,7 @@ namespace OpenTween
22562246 }
22572247
22582248 //RT禁止ユーザーによるもの
2259- if (post.RetweetedId > 0 && this.noRTId.Contains(post.RetweetedByUserId)) continue;
2249+ if (post.RetweetedByUserId != null && this.noRTId.Contains(post.RetweetedByUserId.Value)) continue;
22602250
22612251 post.IsRead = read;
22622252 if (post.IsMe && !read && _readOwnPost) post.IsRead = true;
@@ -2385,7 +2375,7 @@ namespace OpenTween
23852375 post.Source = WebUtility.HtmlDecode(status.Source);
23862376 post.InReplyToStatusId = status.InReplyToStatusId;
23872377 post.InReplyToUser = status.ToUser;
2388- post.InReplyToUserId = !status.ToUserId.HasValue ? 0 : (long)status.ToUserId;
2378+ post.InReplyToUserId = status.ToUserId;
23892379
23902380 if (status.Geo != null) post.PostGeo = new PostClass.StatusGeo { Lat = status.Geo.Coordinates[0], Lng = status.Geo.Coordinates[1] };
23912381
@@ -2508,11 +2498,11 @@ namespace OpenTween
25082498 {
25092499 if (more)
25102500 {
2511- res = twCon.GetListsStatuses(tab.ListInfo.UserId, tab.ListInfo.Id, count, tab.OldestId, 0, AppendSettingDialog.Instance.IsListStatusesIncludeRts, ref content);
2501+ res = twCon.GetListsStatuses(tab.ListInfo.UserId, tab.ListInfo.Id, count, tab.OldestId, null, AppendSettingDialog.Instance.IsListStatusesIncludeRts, ref content);
25122502 }
25132503 else
25142504 {
2515- res = twCon.GetListsStatuses(tab.ListInfo.UserId, tab.ListInfo.Id, count, 0, 0, AppendSettingDialog.Instance.IsListStatusesIncludeRts, ref content);
2505+ res = twCon.GetListsStatuses(tab.ListInfo.UserId, tab.ListInfo.Id, count, null, null, AppendSettingDialog.Instance.IsListStatusesIncludeRts, ref content);
25162506 }
25172507 }
25182508 catch(Exception ex)
@@ -2546,11 +2536,11 @@ namespace OpenTween
25462536 throw new ArgumentException("startStatusId (" + startStatusId + ") が posts の中から見つかりませんでした。");
25472537
25482538 var nextPost = posts[startStatusId];
2549- while (nextPost.InReplyToStatusId != 0)
2539+ while (nextPost.InReplyToStatusId != null)
25502540 {
2551- if (!posts.ContainsKey(nextPost.InReplyToStatusId))
2541+ if (!posts.ContainsKey(nextPost.InReplyToStatusId.Value))
25522542 break;
2553- nextPost = posts[nextPost.InReplyToStatusId];
2543+ nextPost = posts[nextPost.InReplyToStatusId.Value];
25542544 }
25552545
25562546 return nextPost;
@@ -2560,11 +2550,11 @@ namespace OpenTween
25602550 {
25612551 var rslt = "";
25622552 var relPosts = new Dictionary<Int64, PostClass>();
2563- if (tab.RelationTargetPost.TextFromApi.Contains("@") && tab.RelationTargetPost.InReplyToStatusId == 0)
2553+ if (tab.RelationTargetPost.TextFromApi.Contains("@") && tab.RelationTargetPost.InReplyToStatusId == null)
25642554 {
25652555 //検索結果対応
25662556 var p = TabInformations.GetInstance()[tab.RelationTargetPost.StatusId];
2567- if (p != null && p.InReplyToStatusId > 0)
2557+ if (p != null && p.InReplyToStatusId != null)
25682558 {
25692559 tab.RelationTargetPost = p;
25702560 }
@@ -2590,15 +2580,15 @@ namespace OpenTween
25902580 rslt = this.GetRelatedResultsApi(nextPost, relPosts);
25912581 if (!string.IsNullOrEmpty(rslt)) break;
25922582 nextPost = FindTopOfReplyChain(relPosts, nextPost.StatusId);
2593- } while (nextPost.InReplyToStatusId != 0 && loopCount++ <= 5);
2583+ } while (nextPost.InReplyToStatusId != null && loopCount++ <= 5);
25942584 }
25952585
25962586 // 二周目: in_reply_to_status_id を使用してリプライチェインを辿る
25972587 nextPost = FindTopOfReplyChain(relPosts, tab.RelationTargetPost.StatusId);
25982588 loopCount = 1;
2599- while (nextPost.InReplyToStatusId != 0 && loopCount++ <= 20)
2589+ while (nextPost.InReplyToStatusId != null && loopCount++ <= 20)
26002590 {
2601- var inReplyToId = nextPost.InReplyToStatusId;
2591+ var inReplyToId = nextPost.InReplyToStatusId.Value;
26022592
26032593 var inReplyToPost = TabInformations.GetInstance()[inReplyToId];
26042594 if (inReplyToPost != null)
@@ -2673,9 +2663,9 @@ namespace OpenTween
26732663 var content = "";
26742664 try
26752665 {
2676- if (post.RetweetedId > 0)
2666+ if (post.RetweetedId != null)
26772667 {
2678- res = twCon.GetRelatedResults(post.RetweetedId, ref content);
2668+ res = twCon.GetRelatedResults(post.RetweetedId.Value, ref content);
26792669 }
26802670 else
26812671 {
@@ -2739,8 +2729,8 @@ namespace OpenTween
27392729
27402730 HttpStatusCode res;
27412731 var content = "";
2742- var maxId = 0L;
2743- var sinceId = 0L;
2732+ long? maxId = null;
2733+ long? sinceId = null;
27442734 var count = 100;
27452735 if (AppendSettingDialog.Instance.UseAdditionalCount &&
27462736 AppendSettingDialog.Instance.SearchCountApi != 0)
@@ -2799,8 +2789,8 @@ namespace OpenTween
27992789
28002790 HttpStatusCode res;
28012791 var content = "";
2802- var page = 0;
2803- var sinceId = 0L;
2792+ int? page = null;
2793+ long? sinceId = null;
28042794 var count = 100;
28052795 var querystr = "";
28062796 if (AppendSettingDialog.Instance.UseAdditionalCount &&
@@ -3006,22 +2996,22 @@ namespace OpenTween
30062996 {
30072997 if (more)
30082998 {
3009- res = twCon.DirectMessages(20, minDirectmessage, 0, ref content);
2999+ res = twCon.DirectMessages(20, minDirectmessage, null, ref content);
30103000 }
30113001 else
30123002 {
3013- res = twCon.DirectMessages(20, 0, 0, ref content);
3003+ res = twCon.DirectMessages(20, null, null, ref content);
30143004 }
30153005 }
30163006 else
30173007 {
30183008 if (more)
30193009 {
3020- res = twCon.DirectMessagesSent(20, minDirectmessageSent, 0, ref content);
3010+ res = twCon.DirectMessagesSent(20, minDirectmessageSent, null, ref content);
30213011 }
30223012 else
30233013 {
3024- res = twCon.DirectMessagesSent(20, 0, 0, ref content);
3014+ res = twCon.DirectMessagesSent(20, null, null, ref content);
30253015 }
30263016 }
30273017 }
@@ -3143,13 +3133,9 @@ namespace OpenTween
31433133 //Source取得(htmlの場合は、中身を取り出し)
31443134 post.Source = retweeted.Source;
31453135 //Reply先
3146- long inReplyToStatusId;
3147- long.TryParse(retweeted.InReplyToStatusId, out inReplyToStatusId);
3148- post.InReplyToStatusId = inReplyToStatusId;
3136+ post.InReplyToStatusId = retweeted.InReplyToStatusId;
31493137 post.InReplyToUser = retweeted.InReplyToScreenName;
3150- long inReplyToUserId;
3151- long.TryParse(retweeted.InReplyToUserId, out inReplyToUserId);
3152- post.InReplyToUserId = inReplyToUserId;
3138+ post.InReplyToUserId = retweeted.InReplyToUserId;
31533139 post.IsFav = true;
31543140
31553141 //以下、ユーザー情報
@@ -3173,13 +3159,9 @@ namespace OpenTween
31733159 entities = status.Entities;
31743160 //Source取得(htmlの場合は、中身を取り出し)
31753161 post.Source = status.Source;
3176- long inReplyToStatusId;
3177- long.TryParse(status.InReplyToStatusId, out inReplyToStatusId);
3178- post.InReplyToStatusId = inReplyToStatusId;
3162+ post.InReplyToStatusId = status.InReplyToStatusId;
31793163 post.InReplyToUser = status.InReplyToScreenName;
3180- long inReplyToUserId;
3181- long.TryParse(status.InReplyToUserId, out inReplyToUserId);
3182- post.InReplyToUserId = inReplyToUserId;
3164+ post.InReplyToUserId = status.InReplyToUserId;
31833165
31843166 post.IsFav = true;
31853167