Breaking changes
All versions after v1.0.0 will try to minimize breaking changes until the next major release (v2.0.0). However, there are some cases in which breaking changes are required between minor versions.
RedditClient.subreddits()
returns a SubredditReference instead of a DefaultPaginator (#211)- The upper bound of RedditIterable (and therefore Paginator) has been changed from Any (Object in Java) to UniquelyIdentifiable (#249)
Submission.getThumbnail()
is now nullable (#241)
Improvements
- Streams are here! (#206, #249) A stream continuously polls the first page of some paginated data (e.g. the inbox, new comments, etc.) and emits new values when they are encountered. Here's a practical example:
for (c in redditClient.subreddit("RocketLeague").comments().build().stream()) {
// Do something with the newly-created comment
}
- Added
RedditClient.searchSubreddits()
(#212) - Added
RedditClient.searchSubredditsByName()
(#244) - All models are now Serializable
- Added
SubredditSort.BEST
(see here) - Added
SubredditReference.patchFlairList()
(767ff28
) - Added
SubmissionReference.flagAsSpoiler
andSubmissionReference.stickPost
(#235, thanks to @canaangifford!) - OAuth2 web apps are now supported (#213)
- Better support for serializing Listings (#234)
- Better support for querying suspended/non-existent accounts (#252)
Bug fixes
- Fixed a bug that caused AccountHelper to use the wrong credentials when calling
switchToUserless()
(#210) - Encountering a user profile while browsing subreddits no longer throws an exception (#216)
- Tabs, newlines, and similar characters are now properly sent (#220)
- Fixed a NPE when deserializing posts with embedded media (#227)
- Fixed
StatefulAuthHelper.onUserChallenge
sometimes throwing a NPE (#231) - Fixed a rare JsonDataException where an int was too small to store the embedded media's cache age (#236)
Subreddit.getNsfw()
no longer always returns null (#239)- Better handling of embedded media (#247, #248, thanks to @andsala!)
Comment.getAuthorFlairText()
now works properly (#250)
Deprecations
UserReference.about()
is deprecated in favor ofUserReference.query()
for better handling of suspended/non-existent accounts
Before:
Account account;
try {
account = reddit.user("some username").about();
} catch (NullPointerException e) {
// suspended site-wide
} catch (ApiException e) {
// probably doesn't exist
}
After:
AccountQuery query = reddit.user("some username").query();
switch (query.getStatus()) {
case EXISTS:
Account account = query.getAccount();
// do something
case NON_EXISTENT:
// do something
case SUSPENDED:
// do something
}
Dependencies
Dependency | Before | After |
---|---|---|
Kotlin | 1.2.10 | 1.2.41 |
OkHttp | 3.9.1 | 3.10.0 |
Moshi | 1.5.0 | 1.6.0 |
AutoValue | 1.5.3 | 1.5.4 |