mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
slave: user-notifications: emit errors first, then warnings and last deprecations
This commit is contained in:
parent
9b0376efc3
commit
b661513245
1 changed files with 21 additions and 2 deletions
23
slave.c
23
slave.c
|
|
@ -102,9 +102,28 @@ emit_one_notification(int fd, const struct user_notification *notif)
|
|||
static bool
|
||||
emit_notifications(int fd, const user_notifications_t *notifications)
|
||||
{
|
||||
/* Errors first */
|
||||
tll_foreach(*notifications, it) {
|
||||
if (!emit_one_notification(fd, &it->item))
|
||||
return false;
|
||||
if (it->item.kind == USER_NOTIFICATION_ERROR) {
|
||||
if (!emit_one_notification(fd, &it->item))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Then warnings */
|
||||
tll_foreach(*notifications, it) {
|
||||
if (it->item.kind == USER_NOTIFICATION_WARNING) {
|
||||
if (!emit_one_notification(fd, &it->item))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally deprecation messages */
|
||||
tll_foreach(*notifications, it) {
|
||||
if (it->item.kind == USER_NOTIFICATION_DEPRECATED) {
|
||||
if (!emit_one_notification(fd, &it->item))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue