feat(dvk): delete a message — recording and label together
A deleted message is a free slot, per its operator; keeping the label made it look half-deleted.
This commit is contained in:
@@ -10300,6 +10300,22 @@ func (a *App) GetDVKMessages() []DVKMessage {
|
||||
return out
|
||||
}
|
||||
|
||||
// DVKDelete removes a slot's recording AND its label — a deleted message is a
|
||||
// free slot, per its operator.
|
||||
func (a *App) DVKDelete(slot int) error {
|
||||
if slot < 1 || slot > dvkSlots {
|
||||
return fmt.Errorf("bad slot")
|
||||
}
|
||||
if err := os.Remove(a.dvkPath(slot)); err != nil && !os.IsNotExist(err) {
|
||||
return fmt.Errorf("delete message %d: %w", slot, err)
|
||||
}
|
||||
if a.settings != nil {
|
||||
_ = a.settings.Set(a.ctx, dvkLabelKey(slot), "")
|
||||
}
|
||||
applog.Printf("dvk: message F%d deleted (label cleared)", slot)
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetDVKLabel renames a voice-keyer slot.
|
||||
func (a *App) SetDVKLabel(slot int, label string) error {
|
||||
if a.settings == nil {
|
||||
|
||||
Reference in New Issue
Block a user