From 3cd4a08ffb4bcba0cfbb8a29574ff40d134dc186 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 6 Jun 2008 17:55:27 +0000 Subject: Make server exit when last session dies. Also fix window check for status activity redraw. --- session.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'session.c') diff --git a/session.c b/session.c index c2680492..8ab0c819 100644 --- a/session.c +++ b/session.c @@ -1,4 +1,4 @@ -/* $Id: session.c,v 1.35 2008-06-06 17:20:29 nicm Exp $ */ +/* $Id: session.c,v 1.36 2008-06-06 17:55:27 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -55,7 +55,8 @@ session_alert_add(struct session *s, struct window *w, int type) if (wl == s->curw) continue; - if (wl->window == w && !session_alert_has(s, wl, type)) { + if (wl->window == w && + !session_alert_has(s, wl, type)) { sa = xmalloc(sizeof *sa); sa->wl = wl; sa->type = type; @@ -77,6 +78,19 @@ session_alert_has(struct session *s, struct winlink *wl, int type) return (0); } +int +session_alert_has_window(struct session *s, struct window *w, int type) +{ + struct session_alert *sa; + + TAILQ_FOREACH(sa, &s->alerts, entry) { + if (sa->wl->window == w && sa->type == type) + return (1); + } + + return (0); +} + /* Find session by name. */ struct session * session_find(const char *name) -- cgit