changeset 1083:6685ebe6f8cf

mod_statistics: top: Make sessions temporarily bold when they are updated
author Matthew Wild <mwild1@gmail.com>
date Sat, 15 Jun 2013 22:26:48 +0100
parents 6c555e7dc942
children 9612cea92503
files mod_statistics/top.lua
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)