• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

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

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


Commit MetaInfo

Révision55cac00071ecc30dc502e1a2f1c4642b2b10c8bc (tree)
l'heure2014-11-23 11:21:55
AuteurKimura Youichi <kim.upsilon@bucy...>
CommiterKimura Youichi

Message de Log

ミュート機能がRecentタブで正しく動作していなかった不具合を修正

Change Summary

Modification

--- a/OpenTween.Tests/TabInformationTest.cs
+++ b/OpenTween.Tests/TabInformationTest.cs
@@ -78,5 +78,89 @@ namespace OpenTween
7878 var baseTabName = "NewTab";
7979 Assert.Throws<TabException>(() => this.tabinfo.MakeTabName(baseTabName, 5));
8080 }
81+
82+ [Fact]
83+ public void IsMuted_Test()
84+ {
85+ this.tabinfo.MuteUserIds = new List<long> { 12345L };
86+
87+ var post = new PostClass
88+ {
89+ UserId = 12345L,
90+ Text = "hogehoge",
91+ };
92+ Assert.True(this.tabinfo.IsMuted(post));
93+ }
94+
95+ [Fact]
96+ public void IsMuted_NotMutingTest()
97+ {
98+ this.tabinfo.MuteUserIds = new List<long> { 12345L };
99+
100+ var post = new PostClass
101+ {
102+ UserId = 11111L,
103+ Text = "hogehoge",
104+ };
105+ Assert.False(this.tabinfo.IsMuted(post));
106+ }
107+
108+ [Fact]
109+ public void IsMuted_RetweetTest()
110+ {
111+ this.tabinfo.MuteUserIds = new List<long> { 12345L };
112+
113+ var post = new PostClass
114+ {
115+ UserId = 11111L,
116+ RetweetedByUserId = 12345L,
117+ Text = "hogehoge",
118+ };
119+ Assert.True(this.tabinfo.IsMuted(post));
120+ }
121+
122+ [Fact]
123+ public void IsMuted_RetweetNotMutingTest()
124+ {
125+ this.tabinfo.MuteUserIds = new List<long> { 12345L };
126+
127+ var post = new PostClass
128+ {
129+ UserId = 11111L,
130+ RetweetedByUserId = 22222L,
131+ Text = "hogehoge",
132+ };
133+ Assert.False(this.tabinfo.IsMuted(post));
134+ }
135+
136+ [Fact]
137+ public void IsMuted_ReplyTest()
138+ {
139+ this.tabinfo.MuteUserIds = new List<long> { 12345L };
140+
141+ // ミュート対象のユーザーであってもリプライの場合は対象外とする
142+ var post = new PostClass
143+ {
144+ UserId = 12345L,
145+ Text = "@foo hogehoge",
146+ IsReply = true,
147+ };
148+ Assert.False(this.tabinfo.IsMuted(post));
149+ }
150+
151+ [Fact]
152+ public void IsMuted_NotInHomeTimelineTest()
153+ {
154+ this.tabinfo.MuteUserIds = new List<long> { 12345L };
155+
156+ // Recent以外のタブ(検索など)の場合は対象外とする
157+ var post = new PostClass
158+ {
159+ UserId = 12345L,
160+ Text = "hogehoge",
161+ RelTabName = "Search",
162+ };
163+ Assert.False(this.tabinfo.IsMuted(post));
164+ }
81165 }
82166 }
--- a/OpenTween/Resources/ChangeLog.txt
+++ b/OpenTween/Resources/ChangeLog.txt
@@ -19,6 +19,7 @@
1919 * FIX: 「選択文字列で検索」-「Google」で、一部の記号を含む検索文字列が途切れる不具合を修正
2020 * FIX: 数万件のツイートを表示している状態でのCtrl+Aによる全選択が極端に遅くなる問題を修正
2121 * FIX: UserStreamsから時々不正なJSONが送られてくる問題への対処
22+ * FIX: ミュート機能がRecentタブで正しく動作していなかった不具合を修正
2223
2324 ==== Ver 1.2.3(2014/09/03)
2425 * NEW: UserSteams の (un)mute イベント追加に対応
--- a/OpenTween/StatusDictionary.cs
+++ b/OpenTween/StatusDictionary.cs
@@ -1230,11 +1230,11 @@ namespace OpenTween
12301230 }
12311231 }
12321232
1233- private bool IsMuted(PostClass post)
1233+ public bool IsMuted(PostClass post)
12341234 {
12351235 // Recent以外のツイートと、リプライはミュート対象外
12361236 // 参照: https://support.twitter.com/articles/20171399-muting-users-on-twitter
1237- if (string.IsNullOrEmpty(post.RelTabName) || post.IsReply)
1237+ if (!string.IsNullOrEmpty(post.RelTabName) || post.IsReply)
12381238 return false;
12391239
12401240 if (this.MuteUserIds.Contains(post.UserId))