Mark the lead's messages and answers as the lead's, not the human's

This commit is contained in:
Ian Gulliver
2026-10-20 12:20:51 -07:00
parent 181482e5d0
commit 0f33ad4524
14 changed files with 93 additions and 23 deletions
+5 -4
View File
@@ -92,18 +92,19 @@ func decisionLine(item api.InboxItem, r api.InboxResponse) string {
if r.Text != nil {
text = strings.TrimSpace(*r.Text)
}
who := actorName(r.User)
switch r.Type {
case api.Option:
line := fmt.Sprintf("%s chose: %s\n", r.User, strings.Join(*r.Options, "; "))
line := fmt.Sprintf("%s chose: %s\n", who, strings.Join(*r.Options, "; "))
if item.Payload["multiple"] == true {
line = fmt.Sprintf("%s checked: %s\n", r.User, strings.Join(*r.Options, "; "))
line = fmt.Sprintf("%s checked: %s\n", who, strings.Join(*r.Options, "; "))
}
if text != "" {
line += fmt.Sprintf("%s added: %s\n", r.User, text)
line += fmt.Sprintf("%s added: %s\n", who, text)
}
return line
case api.Other:
return fmt.Sprintf("%s answered: %s\n", r.User, text)
return fmt.Sprintf("%s answered: %s\n", who, text)
}
return ""
}