Add h keybinding to toggle hold/release via postsuper -h/-H

Preserves the ! suffix from postqueue -p output to track hold status
in QueueEntry, and optimistically toggles it in the UI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-03-29 20:00:51 +07:00
commit 3916c49a0c
4 changed files with 34 additions and 3 deletions

View file

@ -11,6 +11,7 @@ import (
type QueueEntry struct {
ID string
OnHold bool
Size int
Date time.Time
Sender string
@ -114,9 +115,10 @@ func parseQueueLine(line string) *QueueEntry {
return nil
}
id := fields[0]
raw := fields[0]
onHold := strings.HasSuffix(raw, "!")
// Strip trailing status character (* or !)
id = strings.TrimRight(id, "*!")
id := strings.TrimRight(raw, "*!")
var size int
fmt.Sscanf(fields[1], "%d", &size)
@ -137,6 +139,7 @@ func parseQueueLine(line string) *QueueEntry {
return &QueueEntry{
ID: id,
OnHold: onHold,
Size: size,
Date: t,
Sender: sender,