Skip to content

Commit 372ef99

Browse files
committed
Fixed an issue with subscriptions after re-authenticating
1 parent a4ca9c0 commit 372ef99

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/main/assets/changelog-alpha.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/Alpha 335 (2023-07-02)
2+
Fixed an issue with subscriptions after re-authenticating
3+
14
/Alpha 334 (2023-06-25)
25
Due to Reddit API changes, any active accounts must be logged in again
36

src/main/assets/changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
105/1.21
1+
106/1.21.1
22
Show Reddit user agreement prompt at startup
33
Due to Reddit API changes, any active accounts must be logged in again
44
More specific error message when a subreddit is private
@@ -12,6 +12,7 @@ Fix for MediaMuxer crash
1212
Imgur links on non-standard subdomains are now handled correctly
1313
Detects more bot usernames
1414
Dependency updates
15+
v1.21.1: Fixed an issue with subscriptions after re-authenticating
1516

1617
104/1.20
1718
Renamed "Find Subreddit" to "Find Location"

src/main/java/org/quantumbadger/redreader/account/RedditAccount.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import org.quantumbadger.redreader.common.StringUtils;
2323
import org.quantumbadger.redreader.reddit.api.RedditOAuth;
2424

25+
import java.util.Objects;
26+
2527
public class RedditAccount {
2628

2729
@NonNull public final String username;
@@ -71,8 +73,16 @@ public synchronized void setAccessToken(final RedditOAuth.AccessToken token) {
7173

7274
@Override
7375
public boolean equals(final Object o) {
74-
return o instanceof RedditAccount
75-
&& username.equalsIgnoreCase(((RedditAccount)o).username);
76+
77+
if(!(o instanceof RedditAccount)) {
78+
return false;
79+
}
80+
81+
final RedditAccount other = (RedditAccount)o;
82+
83+
return username.equalsIgnoreCase(other.username)
84+
&& Objects.equals(clientId, other.clientId)
85+
&& Objects.equals(refreshToken, other.refreshToken);
7686
}
7787

7888
@Override

0 commit comments

Comments
 (0)