Skip to content

Commit 71ac628

Browse files
authored
Lemmy 0.18.0 changes (#32)
1 parent 345cab8 commit 71ac628

File tree

7 files changed

+22
-10
lines changed

7 files changed

+22
-10
lines changed

Sources/Lemmy-Swift-Client/Lemmy API/Enums/ListingType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import Foundation
22

33
public enum ListingType: String, Codable, CustomStringConvertible, CaseIterable {
44
case all = "All"
5-
case community = "Community"
65
case local = "Local"
76
case subscribed = "Subscribed"
7+
case community = "Community"
88

99
public var description: String {
1010
return rawValue

Sources/Lemmy-Swift-Client/Lemmy API/Enums/RegistrationMode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33
public enum RegistrationMode: String, Codable, CustomStringConvertible, CaseIterable {
44
case closed
55
case open
6-
case requireApplication = "requireapplication"
6+
case requireApplication = "RequireApplication"
77

88
public var description: String {
99
return rawValue

Sources/Lemmy-Swift-Client/Lemmy API/Requests/GetCommunity.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ public struct GetCommunityResponse: APIResponse {
2222
public let default_post_language: Int?
2323
public let discussion_languages: [Int]
2424
public let moderators: [CommunityModeratorView]
25-
public let online: Int
25+
public let online: Int?
2626
public let site: Site?
2727

2828
public init(
2929
community_view: CommunityView,
3030
default_post_language: Int? = nil,
3131
discussion_languages: [Int],
3232
moderators: [CommunityModeratorView],
33-
online: Int,
33+
online: Int? = nil,
3434
site: Site? = nil
3535
) {
3636
self.community_view = community_view

Sources/Lemmy-Swift-Client/Lemmy API/Requests/GetSite.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public struct GetSiteResponse: APIResponse {
1919
public let discussion_languages: [Int]
2020
public let federated_instances: FederatedInstances?
2121
public let my_user: MyUserInfo?
22-
public let online: Int
22+
public let online: Int?
2323
public let site_view: SiteView
2424
public let taglines: [Tagline]?
2525
public let version: String
@@ -30,7 +30,7 @@ public struct GetSiteResponse: APIResponse {
3030
discussion_languages: [Int],
3131
federated_instances: FederatedInstances? = nil,
3232
my_user: MyUserInfo? = nil,
33-
online: Int,
33+
online: Int? = nil,
3434
site_view: SiteView,
3535
taglines: [Tagline]? = nil,
3636
version: String

Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityAggregates.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public struct CommunityAggregates: Codable {
1010
public let users_active_half_year: Int
1111
public let users_active_month: Int
1212
public let users_active_week: Int
13+
public let published: String
14+
public let hot_rank: Int
1315

1416
public init(
1517
comments: Int,
@@ -20,7 +22,9 @@ public struct CommunityAggregates: Codable {
2022
users_active_day: Int,
2123
users_active_half_year: Int,
2224
users_active_month: Int,
23-
users_active_week: Int
25+
users_active_week: Int,
26+
published: String,
27+
hot_rank: Int
2428
) {
2529
self.comments = comments
2630
self.community_id = community_id
@@ -31,5 +35,7 @@ public struct CommunityAggregates: Codable {
3135
self.users_active_half_year = users_active_half_year
3236
self.users_active_month = users_active_month
3337
self.users_active_week = users_active_week
38+
self.published = published
39+
self.hot_rank = hot_rank
3440
}
3541
}

Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalSite.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public struct LocalSite: Codable {
1111
public let default_theme: String
1212
public let enable_downvotes: Bool
1313
public let enable_nsfw: Bool
14-
public let federation_debug: Bool
14+
public let federation_debug: Bool?
1515
public let federation_enabled: Bool
1616
public let federation_worker_count: Int
1717
public let hide_modlog_mod_names: Bool
@@ -38,7 +38,7 @@ public struct LocalSite: Codable {
3838
default_theme: String,
3939
enable_downvotes: Bool,
4040
enable_nsfw: Bool,
41-
federation_debug: Bool,
41+
federation_debug: Bool? = nil,
4242
federation_enabled: Bool,
4343
federation_worker_count: Int,
4444
hide_modlog_mod_names: Bool,

Sources/Lemmy-Swift-Client/Lemmy API/Structs/PostAggregates.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public struct PostAggregates: Codable {
1212
public let post_id: Int
1313
public let score: Int
1414
public let upvotes: Int
15+
public let hot_rank: Int
16+
public let hot_rank_active: Int
1517

1618
public init(
1719
comments: Int,
@@ -23,7 +25,9 @@ public struct PostAggregates: Codable {
2325
newest_comment_time_necro: String,
2426
post_id: Int,
2527
score: Int,
26-
upvotes: Int
28+
upvotes: Int,
29+
hot_rank: Int,
30+
hot_rank_active: Int
2731
) {
2832
self.comments = comments
2933
self.downvotes = downvotes
@@ -35,5 +39,7 @@ public struct PostAggregates: Codable {
3539
self.post_id = post_id
3640
self.score = score
3741
self.upvotes = upvotes
42+
self.hot_rank = hot_rank
43+
self.hot_rank_active = hot_rank_active
3844
}
3945
}

0 commit comments

Comments
 (0)