chore: comment cleanup pass ahead of open-sourcing
Removes leftover debug scaffolding (stray Console.WriteLine/NSLog traces, dead nick_buf_ptr, a no-op --print-config flag now implemented for real), fixes stale/misleading comments (channel passwords are no longer a "future M5+" feature, a wrong cross-reference, a stale TlsContext::close() mention, an incomplete BanRecord::subject_type doc, and a smoke test pointing at a build/m1-dev preset that no longer exists), strips internal M1-M5 milestone jargon from comments now that the roadmap is done, trims comments that just restated the following line, and consolidates a few "why" explanations that were duplicated 2-3 times in the same file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -185,9 +185,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
|
||||
required init?(coder: NSCoder) { fatalError() }
|
||||
|
||||
deinit {
|
||||
NSLog("[VoiceCatMac] MainWindowController deinit — client and event handlers are gone")
|
||||
}
|
||||
deinit {}
|
||||
|
||||
// MARK: - UI construction
|
||||
|
||||
@@ -455,10 +453,6 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
}
|
||||
ownPermissions = client.getPermissions()
|
||||
|
||||
NSLog("[VoiceCatMac] bootstrap: channels=%d users=%d perms{admin=%d kick=%d} currentChannelId=%u",
|
||||
channels.count, allUsers.count,
|
||||
ownPermissions.isAdmin, ownPermissions.canKick, currentChannelId)
|
||||
|
||||
// Apply initial output volume (default 80% — matches Windows client)
|
||||
client.setOutputVolume(0.8)
|
||||
|
||||
@@ -477,9 +471,6 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
// MARK: - Event handling
|
||||
|
||||
private func handleEvent(_ event: VoiceCatEvent) {
|
||||
NSLog("[VoiceCatMac] event type=%d result=%d userId=%u channelId=%u streamId=%u text=%@",
|
||||
event.type.rawValue, event.result.rawValue, event.userId, event.channelId,
|
||||
event.streamId, event.text ?? "(nil)")
|
||||
switch event.type {
|
||||
case .channelList:
|
||||
channels = client.listChannels()
|
||||
@@ -1067,7 +1058,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
composeField.stringValue = ""
|
||||
}
|
||||
|
||||
// MARK: - M5: Moderation helpers
|
||||
// MARK: - Moderation helpers
|
||||
|
||||
private func moveUser(_ user: User) {
|
||||
let sheet = MoveUserSheet(channels: channels, currentChannelId: user.channelId)
|
||||
@@ -1241,7 +1232,6 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
presentSheet(sheet)
|
||||
}
|
||||
|
||||
/// Open a PM window from the user context menu.
|
||||
private func openPmWindow(_ user: User) {
|
||||
getOrOpenPmWindow(user.id)
|
||||
}
|
||||
@@ -1288,17 +1278,13 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
func windowWillClose(_ notification: Notification) {
|
||||
if let mon = pttMonitor { NSEvent.removeMonitor(mon) }
|
||||
NotificationCenter.default.removeObserver(self)
|
||||
// Close all PM windows
|
||||
for (_, pmWin) in pmWindows { pmWin.close() }
|
||||
pmWindows.removeAll()
|
||||
// Close settings window
|
||||
settingsWindowController?.close()
|
||||
settingsWindowController = nil
|
||||
// Remove app menus we added
|
||||
if let item = voiceMenuItem { NSApp.mainMenu?.removeItem(item) }
|
||||
if let item = messagesMenuItem { NSApp.mainMenu?.removeItem(item) }
|
||||
if let item = adminMenuItem { NSApp.mainMenu?.removeItem(item) }
|
||||
// Remove Settings menu item + separator from app menu
|
||||
if let appMenu = NSApp.mainMenu?.item(at: 0)?.submenu {
|
||||
if let item = settingsMenuItem { appMenu.removeItem(item) }
|
||||
// Remove the separator we inserted before Quit
|
||||
|
||||
Reference in New Issue
Block a user