Skip to content

Commit

Permalink
Lemmy 0.18.0 changes (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
fishcharlie authored Jul 3, 2023
1 parent 345cab8 commit 71ac628
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import Foundation

public enum ListingType: String, Codable, CustomStringConvertible, CaseIterable {
case all = "All"
case community = "Community"
case local = "Local"
case subscribed = "Subscribed"
case community = "Community"

public var description: String {
return rawValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
public enum RegistrationMode: String, Codable, CustomStringConvertible, CaseIterable {
case closed
case open
case requireApplication = "requireapplication"
case requireApplication = "RequireApplication"

public var description: String {
return rawValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ public struct GetCommunityResponse: APIResponse {
public let default_post_language: Int?
public let discussion_languages: [Int]
public let moderators: [CommunityModeratorView]
public let online: Int
public let online: Int?
public let site: Site?

public init(
community_view: CommunityView,
default_post_language: Int? = nil,
discussion_languages: [Int],
moderators: [CommunityModeratorView],
online: Int,
online: Int? = nil,
site: Site? = nil
) {
self.community_view = community_view
Expand Down
4 changes: 2 additions & 2 deletions Sources/Lemmy-Swift-Client/Lemmy API/Requests/GetSite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public struct GetSiteResponse: APIResponse {
public let discussion_languages: [Int]
public let federated_instances: FederatedInstances?
public let my_user: MyUserInfo?
public let online: Int
public let online: Int?
public let site_view: SiteView
public let taglines: [Tagline]?
public let version: String
Expand All @@ -30,7 +30,7 @@ public struct GetSiteResponse: APIResponse {
discussion_languages: [Int],
federated_instances: FederatedInstances? = nil,
my_user: MyUserInfo? = nil,
online: Int,
online: Int? = nil,
site_view: SiteView,
taglines: [Tagline]? = nil,
version: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public struct CommunityAggregates: Codable {
public let users_active_half_year: Int
public let users_active_month: Int
public let users_active_week: Int
public let published: String
public let hot_rank: Int

public init(
comments: Int,
Expand All @@ -20,7 +22,9 @@ public struct CommunityAggregates: Codable {
users_active_day: Int,
users_active_half_year: Int,
users_active_month: Int,
users_active_week: Int
users_active_week: Int,
published: String,
hot_rank: Int
) {
self.comments = comments
self.community_id = community_id
Expand All @@ -31,5 +35,7 @@ public struct CommunityAggregates: Codable {
self.users_active_half_year = users_active_half_year
self.users_active_month = users_active_month
self.users_active_week = users_active_week
self.published = published
self.hot_rank = hot_rank
}
}
4 changes: 2 additions & 2 deletions Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalSite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public struct LocalSite: Codable {
public let default_theme: String
public let enable_downvotes: Bool
public let enable_nsfw: Bool
public let federation_debug: Bool
public let federation_debug: Bool?
public let federation_enabled: Bool
public let federation_worker_count: Int
public let hide_modlog_mod_names: Bool
Expand All @@ -38,7 +38,7 @@ public struct LocalSite: Codable {
default_theme: String,
enable_downvotes: Bool,
enable_nsfw: Bool,
federation_debug: Bool,
federation_debug: Bool? = nil,
federation_enabled: Bool,
federation_worker_count: Int,
hide_modlog_mod_names: Bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public struct PostAggregates: Codable {
public let post_id: Int
public let score: Int
public let upvotes: Int
public let hot_rank: Int
public let hot_rank_active: Int

public init(
comments: Int,
Expand All @@ -23,7 +25,9 @@ public struct PostAggregates: Codable {
newest_comment_time_necro: String,
post_id: Int,
score: Int,
upvotes: Int
upvotes: Int,
hot_rank: Int,
hot_rank_active: Int
) {
self.comments = comments
self.downvotes = downvotes
Expand All @@ -35,5 +39,7 @@ public struct PostAggregates: Codable {
self.post_id = post_id
self.score = score
self.upvotes = upvotes
self.hot_rank = hot_rank
self.hot_rank_active = hot_rank_active
}
}

0 comments on commit 71ac628

Please sign in to comment.