Skip to content

v2.0.0-20231105.202213

Pre-release
Pre-release
Compare
Choose a tag to compare
@andregasser andregasser released this 05 Nov 20:27
· 141 commits to master since this release
d53bb48

📢 Overview

This snapshot contains lots of contributions that came in thanks to Hacktoberfest 2023. Many aspects of the library have been fundamentally improved. As a result, it was inevitable to introduce certain incompatible changes to the previous snapshot. You will almost certainly have to adapt and recompile your code. In the "Breaking Changes" section, we do our best to document these changes in the hope that the transition to this snapshot will be as painless as possible for you.

⭐ New Features

🐞 Bug Fixes

📔 Documentation

  • Updated contributing file with project structure by @Yordaniss in #306

🔨 Dependency Upgrades

⚡ Breaking Changes

RxJava, introduced in #288

We now no longer check if a downstream consumer has been disposed when emitting errors. Please check the Error Handling section of our RxJava documentation

Replace Gson with kotlinx.serialization, introduced in #270

Gson has been completely replaced with kotlinx.serialization.

Previously, we defined Gson as an api dependency so that it would be bundled with our library. This is no longer the case. We are also not exposing kotlinx.serialization in the same way.

MastodonClient previously exposed the Gson serializer via getSerializer. This method has been removed without replacement.

Dates returned as PrecisionDateTime which wraps java.time.Instant, introduced in #312

Previously, dates (e.g. created_at, last_status_at, …) were returned as the String we received from the Mastodon API. This is usually a full ISO8601 in UTC but sometimes is just a local date.

We now return PrecisionDateTime which can have different values depending on what we get from the API:

  • PrecisionDateTime.ValidPrecisionDateTime.ExactTime
    • We got an exact string that pinpoints an instant in time up to a second or higher like 2023-10-28T13:37:42Z that can be parsed as an Instant
  • PrecisionDateTime.ValidPrecisionDateTime.StartOfDay
    • We got a string that describes a date without a time like 2023-10-28. We default to the start of the day when parsing an Instant
  • PrecisionDateTime.InvalidPrecisionDateTime.Invalid
    • The string we received is invalid and could not be parsed
  • PrecisionDateTime.InvalidPrecisionDateTime.Unavailable
    • The parameter was unavailable, thus no parsing happened. This is the default value.

We have added helper methods for you to use:

  • PrecisionDateTime#mostPreciseInstantOrNull
  • PrecisionDateTime#mostPreciseOrFallback
  • PrecisionDateTime#isValid

Please check the documentation for further info.

Instance API methods, introduced in #303

The old getInstance pointing to the v1 endpoint of the Instance APIs has been renamed to getInstanceV1.

getInstance now points to the v2 endpoint of the Instance APIs.

As the V1 variant has been deprecated since Mastodon 4.0.0, it is unlikely that you will need the V1 variant anymore and it is due for removal as soon as older Mastodon API versions have been completely deprecated by Mastodon.

Notification methods renaming, introduced in #302

  • getNotifications has been renamed to getAllNotifications
  • clearNotifications has been renamed to dismissAllNotifications

PreviewCard property renaming / removal, introduced in #319

  • methodUrl has been renamed to embedUrl to match the official documentation
  • history has been removed as it is not needed in this context and would always be an empty list

Enum improvements, introduced in #310

  • All enum values are now uppercase to be more closely aligned with Kotlin coding conventions (e.g. Action.Hide is now Action.HIDE)
  • Filter.Context has been renamed to Filter.FilterContext
  • Filter.Action has been renamed to Filter.FilterAction
  • Notification.Type has been renamed to Notification.NotificationType
  • ReportType has been renamed to ReportCategory
  • Filter.context now returns a List<FilterContext> instead of a List<String>
  • Filter.filterAction now returns a FilterAction object instead of a String
  • MastodonList.repliesPolicy now returns a RepliesPolicy object instead of a String
  • MediaAttachment.type now returns a MediaType object instead of a String
  • Notification.type now returns a NotificationType object instead of a String
  • PreviewCard.type now returns a CardType object instead of a String
  • FilterMethods.createFilter(): context parameter type has been changed from List<Filter.Context> to List<Filter.FilterContext>
  • FilterMethods.createFilter(): filterAction parameter type has been changed from Filter.Action to Filter.FilterAction
  • FilterMethods.updateFilter(): context parameter type has been changed from List<Filter.Context> to List<Filter.FilterContext>
  • FilterMethods.updateFilter(): filterAction parameter type has been changed from Filter.Action to Filter.FilterAction
  • NotificationMethods.getAllNotifications(): excludeTypes parameter type has been changed from List<Notification.Type> to List<Notification.NotificationType>
  • ReportMethods.fileReport(): category parameter type has been changed from ReportType to ReportCategory

Addition of preferences API methods, introduced in #284

  • ScheduledStatus.Parameters.visibility now returns an object of type Visibility instead of String
  • Status.visibility now returns an object of type Visibility instead of String
  • StatusMethods.postStatus(): visibility parameter type has been changed from Status.Visibility to Visibility
  • StatusMethods.postPoll(): visibility parameter type has been changed from Status.Visibility to Visibility
  • StatusMethods.scheduleStatus(): visibility parameter type has been changed from Status.Visibility to Visibility
  • StatusMethods.schedulePoll(): visibility parameter type has been changed from Status.Visibility to Visibility
  • StatusMethods.reblogStatus(): visibility parameter type has been changed from Status.Visibility to Visibility

Range class changes, introduced in #268

  • Range has received an additional constructor parameter minId
  • Link has received an additional constructor parameter minId

Additional search parameters, introduced in #267

  • SearchMethods.searchContent got additional paramters for querying: type, following, excludeUnreviewed, accountId, maxId, minId, limit, offset

Various class / method name changes, introduced in 3d475cc

  • RxCustomEmojisMethods has been renamed to RxCustomEmojiMethods
  • RxCustomEmojisMethods.getAllCustomEmoji() has been renamed to RxCustomEmojiMethods.getAllCustomEmojis()
  • CustomEmojisMethods has been renamed to CustomEmojiMethods
  • CustomEmojisMethods.getAllCustomEmoji() has been renamed to CustomEmojiMethods.getAllCustomEmojis()
  • RxDomainBlocksMethods has been renamed to RxDomainBlockMethods
  • DomainBlocksMethods has been renamed to DomainBlockMethods
  • RxFeaturedTagsMethods has been renamed to RxFeaturedTagMethods

❤️ Contributors

Thank you to all the contributors who worked on this release:

Full Changelog: v2.0.0-20230902.213631...v2.0.0-20231105.202213