refactor: remove video channel type, fix invisible CreateChannel inputs
Voice channels already support video/screen share, so the separate video type was redundant. Adds migration to convert existing video channels. Also adds border-border-soft to CreateChannel input fields for visibility.
This commit is contained in:
@@ -213,6 +213,9 @@ export function runMigrations(db: Database.Database): void {
|
||||
// ─── Lowercase all existing usernames ────────────────────────────────────────
|
||||
migrateLowercaseUsernames(db);
|
||||
|
||||
// ─── Convert video channels to voice (video type removed) ─────────────────
|
||||
migrateVideoChannels(db);
|
||||
|
||||
console.log('Migrations complete.');
|
||||
}
|
||||
|
||||
@@ -583,6 +586,14 @@ function migrateLowercaseUsernames(db: Database.Database): void {
|
||||
}
|
||||
}
|
||||
|
||||
/** Convert any existing video channels to voice (video type removed — voice channels have full video capability) */
|
||||
function migrateVideoChannels(db: Database.Database): void {
|
||||
const result = db.prepare("UPDATE channels SET type = 'voice' WHERE type = 'video'").run();
|
||||
if (result.changes > 0) {
|
||||
console.log(`Migrating: Converted ${result.changes} video channel(s) to voice`);
|
||||
}
|
||||
}
|
||||
|
||||
function migrateReplicatedUsernames(db: Database.Database): void {
|
||||
const rows = db.prepare(
|
||||
"SELECT id, username, home_instance FROM users WHERE home_instance IS NOT NULL AND username NOT LIKE '%@%'"
|
||||
|
||||
Reference in New Issue
Block a user