# HG changeset patch # User Matthew Wild # Date 1371331608 -3600 # Node ID 6685ebe6f8cf4cb4f1015544b7e1b56e0d04ecf4 # Parent 6c555e7dc942faa82939123e2d07b10e8f629883 mod_statistics: top: Make sessions temporarily bold when they are updated diff -r 6c555e7dc942 -r 6685ebe6f8cf mod_statistics/top.lua --- a/mod_statistics/top.lua Sat Jun 15 22:11:30 2013 +0100 +++ b/mod_statistics/top.lua Sat Jun 15 22:26:48 2013 +0100 @@ -137,7 +137,14 @@ end table.insert(row, v); end + if session.updated then + self.listwin:attron(curses.A_BOLD); + end self.listwin:mvaddstr(index, 0, " "..table.concat(row)); + if session.updated then + session.updated = false; + self.listwin:attroff(curses.A_BOLD); + end end else -- FIXME: How to clear a line? It's 5am and I don't feel like reading docs. @@ -162,6 +169,7 @@ stats.total_stanzas_in = stats.message_in + stats.presence_in + stats.iq_in; stats.total_stanzas_out = stats.message_out + stats.presence_out + stats.iq_out; stats.last_update = time(); + stats.updated = true; end function new(base)