Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API to get, follow and unfollow tags #150

Merged
merged 2 commits into from
Apr 22, 2023
Merged

Conversation

Tunous
Copy link
Contributor

@Tunous Tunous commented Apr 21, 2023

No description provided.

Copy link
Contributor

@davidgarywood davidgarywood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant 🙏

/// - Parameter id: Name of the tag.
@discardableResult
func followTag(_ id: String) async throws -> Tag {
let req = HTTPRequestBuilder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is supported only by Mastodon and Friendica, we need a guard for the flavour.

@discardableResult
func unfollowTag(_ id: String) async throws -> Tag {
let req = HTTPRequestBuilder {
$0.url = getURL(["api", "v1", "tags", id, "unfollow"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, only masto and Friendica

@kkostov
Copy link
Contributor

kkostov commented Apr 22, 2023

@Tunous Looks great! If you could you add a guard for the flavour of the follow/unfollow methods then it will be ready to merge 🚀.

Thanks a lot! 🙌

@Tunous
Copy link
Contributor Author

Tunous commented Apr 22, 2023

@kkostov Good find. This also gives me an idea that I should hide that function from the app UI. I added a property to tell if the feature is supported to be able to do that.

Copy link
Contributor

@kkostov kkostov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tunous Nice! I like the availability flag a lot! (@davidgarywood)

@kkostov kkostov merged commit 57440d8 into TootSDK:main Apr 22, 2023
@Tunous Tunous deleted the feat/tags branch April 22, 2023 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants