AGPL-3.0-only, a source link in the app, and everything on dev since #5 #6

Merged
bvandeusen merged 214 commits from dev into main 2026-10-21 21:40:00 -04:00
Showing only changes of commit dc9cf85cdc - Show all commits
+9 -11
View File
@@ -1069,7 +1069,7 @@ pub fn rename_label(conn: &Connection, id: &str, name: &str) -> rusqlite::Result
) )
.optional()?; .optional()?;
if let Some((other_id, other_created)) = clash { let renamed = if let Some((other_id, other_created)) = clash {
let mine_created: String = let mine_created: String =
conn.query_row("SELECT created_at FROM labels WHERE id = ?1", [id], |r| { conn.query_row("SELECT created_at FROM labels WHERE id = ?1", [id], |r| {
r.get(0) r.get(0)
@@ -1085,20 +1085,18 @@ pub fn rename_label(conn: &Connection, id: &str, name: &str) -> rusqlite::Result
// knows to mark every affected NOTE dirty before the delete cascades the // knows to mark every affected NOTE dirty before the delete cascades the
// membership rows away, which is what makes the merge reach the server. // membership rows away, which is what makes the merge reach the server.
merge_labels(conn, &doomed, &survivor)?; merge_labels(conn, &doomed, &survivor)?;
// The survivor may still carry the old spelling — it is the one that keeps survivor
// existing, so it is the one that has to end up named what was asked for. } else {
conn.execute( id.to_string()
"UPDATE labels SET name = ?1, updated_at = ?2, dirty = 1 WHERE id = ?3", };
params![name, now(), survivor],
)?;
return load_label(conn, &survivor);
}
// A merge's survivor may still carry the old spelling — it is the one that keeps
// existing, so it is the one that has to end up named what was asked for.
conn.execute( conn.execute(
"UPDATE labels SET name = ?1, updated_at = ?2, dirty = 1 WHERE id = ?3", "UPDATE labels SET name = ?1, updated_at = ?2, dirty = 1 WHERE id = ?3",
params![name, now(), id], params![name, now(), renamed],
)?; )?;
load_label(conn, id) load_label(conn, &renamed)
} }
pub fn set_label_color(conn: &Connection, id: &str, color: &str) -> rusqlite::Result<Label> { pub fn set_label_color(conn: &Connection, id: &str, color: &str) -> rusqlite::Result<Label> {