Skip to content
This repository was archived by the owner on Nov 19, 2026. It is now read-only.

Commit 6ffdfcb

Browse files
committed
feat: 0.4.0, full feature parity
1 parent b0e193a commit 6ffdfcb

34 files changed

Lines changed: 2778 additions & 132 deletions

‎DevNull.AppStore.entitlements‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<true/>
1313
<key>com.apple.security.device.audio-input</key>
1414
<true/>
15+
<key>com.apple.security.device.camera</key>
16+
<true/>
1517
<key>com.apple.security.files.user-selected.read-write</key>
1618
<true/>
1719
</dict>

‎DevNull.entitlements‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
<dict>
55
<key>com.apple.security.device.audio-input</key>
66
<true/>
7+
<key>com.apple.security.device.camera</key>
8+
<true/>
79
</dict>
810
</plist>

‎Info.plist‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundlePackageType</key>
2222
<string>APPL</string>
2323
<key>CFBundleShortVersionString</key>
24-
<string>0.3.2</string>
24+
<string>0.4.0</string>
2525
<key>CFBundleURLTypes</key>
2626
<array>
2727
<dict>
@@ -41,10 +41,12 @@
4141
<string>public.app-category.social-networking</string>
4242
<key>LSMinimumSystemVersion</key>
4343
<string>14.0</string>
44+
<key>NSCameraUsageDescription</key>
45+
<string>/dev/null uses your camera only while you turn it on in a call.</string>
4446
<key>NSHighResolutionCapable</key>
4547
<true/>
4648
<key>NSMicrophoneUsageDescription</key>
47-
<string>/dev/null uses your microphone only while you record a voice note.</string>
49+
<string>/dev/null uses your microphone only while you record a voice note or are on a call.</string>
4850
<key>NSPrincipalClass</key>
4951
<string>NSApplication</string>
5052
<key>NSSupportsAutomaticTermination</key>

‎Sources/DevNull/API/Models.swift‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ struct User: Codable, Hashable, Identifiable {
3535
let lane: Lane?
3636
let isFollowed: Bool?
3737
let followsYou: Bool?
38+
/// The stream they're on until it runs out, so a list can mark who is live without asking for each profile.
39+
var live: LiveStream? = nil
3840

3941
var displayName: String {
4042
guard let name, !name.trimmingCharacters(in: .whitespaces).isEmpty else {
@@ -54,6 +56,17 @@ struct User: Codable, Hashable, Identifiable {
5456
}
5557
}
5658

59+
/// A YouTube or Twitch stream someone said they're live on, until `endsAt`.
60+
struct LiveStream: Codable, Hashable {
61+
let platform: String
62+
let url: String
63+
let thumbnailUrl: String?
64+
let endsAt: Date
65+
66+
var isOn: Bool { endsAt > .now }
67+
var platformName: String { platform == "twitch" ? "Twitch" : "YouTube" }
68+
}
69+
5770
struct RemotesSettings: Codable, Hashable {
5871
let from: String
5972
let pullReceipts: Bool
@@ -84,9 +97,10 @@ struct CurrentUser: Codable, Hashable {
8497
var preferredLane: Lane? = nil
8598
var automaticLane: Int? = nil
8699
var githubSyncedAt: Date? = nil
100+
var live: LiveStream? = nil
87101

88102
var asUser: User {
89-
User(id: id, handle: handle, name: name, avatarUrl: avatarUrl, bio: bio, htmlUrl: htmlUrl, lane: lane, isFollowed: nil, followsYou: nil)
103+
User(id: id, handle: handle, name: name, avatarUrl: avatarUrl, bio: bio, htmlUrl: htmlUrl, lane: lane, isFollowed: nil, followsYou: nil, live: live)
90104
}
91105
}
92106

@@ -160,12 +174,16 @@ struct BodySegment: Codable, Hashable {
160174
let code: String?
161175
let language: String?
162176
let html: String?
177+
/// The name a code block was given after its language, as in ```php title="app.php".
178+
var filename: String? = nil
163179
}
164180

165181
struct Mention: Codable, Hashable {
166182
let handle: String
167183
let offset: Int
168184
let length: Int
185+
/// "user" or "organization".
186+
var kind: String? = nil
169187
}
170188

171189
struct ReplyGhost: Codable, Hashable {

‎Sources/DevNull/API/WorkspaceModels.swift‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ struct Commit: Codable, Hashable, Identifiable {
105105

106106
/// The web's address of the commit, for Copy Link and Open on the Web.
107107
var webURL: URL {
108-
htmlUrl.flatMap(URL.init(string:)) ?? APIClient.baseURL.appending(path: "@\(author?.handle ?? "")/\(id)")
108+
htmlUrl.flatMap(URL.init(string:)) ?? APIClient.baseURL.appending(path: "@\(author?.handle ?? "")/commits/\(id)")
109109
}
110110

111111
/// The people who replied last, newest first, at most three, for the action row.
@@ -147,6 +147,8 @@ struct LogPage: Decodable {
147147
struct CommitPage: Decodable {
148148
let data: Commit
149149
let ancestors: [Commit]?
150+
/// Who a reply can go to besides the author: the people the commit's thread already addresses.
151+
var replyParticipants: [User]? = nil
150152
}
151153

152154
struct Translation: Codable, Hashable {
@@ -214,9 +216,11 @@ struct Profile: Decodable {
214216
let streaks: Streaks?
215217
let achievements: Achievements?
216218
var pinnedCommit: Commit?
219+
/// The handles the bio mentions that are on /dev/null, lowercased, so the rest link to GitHub.
220+
let bioProfiles: [String: String]?
217221

218222
private enum CodingKeys: String, CodingKey {
219-
case data, isFollowing, followsYou, isMuting, activity, streaks, achievements, pinnedCommit
223+
case data, isFollowing, followsYou, isMuting, activity, streaks, achievements, pinnedCommit, bioProfiles
220224
}
221225

222226
init(from decoder: Decoder) throws {
@@ -230,10 +234,12 @@ struct Profile: Decodable {
230234
streaks = try container.decodeIfPresent(Streaks.self, forKey: .streaks)
231235
achievements = try container.decodeIfPresent(Achievements.self, forKey: .achievements)
232236
pinnedCommit = try container.decodeIfPresent(Commit.self, forKey: .pinnedCommit)
237+
bioProfiles = try? container.decodeIfPresent([String: String].self, forKey: .bioProfiles)
233238
}
234239
}
235240

236-
/// A GitHub organization at an "@handle" no user has, mirrored from GitHub, as its page on the web shows it.
241+
/// A GitHub organization at an "@handle" no user has, mirrored from GitHub, as its page on the web shows it. Its page
242+
/// also says who follows it, its admins and the color they chose; a list says whether the user follows each one.
237243
struct Organization: Decodable, Hashable, Identifiable {
238244
let handle: String
239245
let name: String
@@ -243,11 +249,23 @@ struct Organization: Decodable, Hashable, Identifiable {
243249
let website: String?
244250
let githubUrl: String
245251
let htmlUrl: String
252+
var isFollowed: Bool? = nil
253+
var followersCount: Int? = nil
254+
var lane: Lane? = nil
255+
var admins: [User]? = nil
246256

247257
var id: String { handle }
248258
var avatarURL: URL? { avatarUrl.flatMap(URL.init(string:)) }
249259
}
250260

261+
/// GET organizations/{handle}: the page, with what only a signed request gets beside it.
262+
struct OrganizationPage: Decodable {
263+
var data: Organization
264+
var isFollowing: Bool? = nil
265+
var canClaim: Bool? = nil
266+
var settingsUrl: String? = nil
267+
}
268+
251269
// MARK: - Notifications
252270

253271
enum NotificationKind: String, Codable, Hashable {
@@ -259,6 +277,7 @@ enum NotificationKind: String, Codable, Hashable {
259277
case quoted
260278
case starred
261279
case leveledUp = "leveled_up"
280+
case firstCommit = "first_commit"
262281
case unknown
263282

264283
init(from decoder: Decoder) throws {
@@ -272,6 +291,7 @@ enum NotificationKind: String, Codable, Hashable {
272291
case .quoted: "arrow.2.squarepath"
273292
case .starred: "star"
274293
case .mentioned: "at"
294+
case .firstCommit: "arrow.triangle.branch"
275295
case .approved: "checkmark"
276296
case .rejected: "xmark"
277297
case .leveledUp, .unknown: "chevron.up.2"

0 commit comments

Comments
 (0)