mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04: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
|
static bool
|
||||||
emit_notifications(int fd, const user_notifications_t *notifications)
|
emit_notifications(int fd, const user_notifications_t *notifications)
|
||||||
{
|
{
|
||||||
|
/* Errors first */
|
||||||
tll_foreach(*notifications, it) {
|
tll_foreach(*notifications, it) {
|
||||||
if (!emit_one_notification(fd, &it->item))
|
if (it->item.kind == USER_NOTIFICATION_ERROR) {
|
||||||
return false;
|
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;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue