examples/transports.lua
changeset 9 c2517f8bf647
parent 8 fc9060b9b7cc
child 32 524fde5be49a
--- a/examples/transports.lua	Wed Feb 25 22:58:34 2009 +0200
+++ b/examples/transports.lua	Thu Feb 26 01:05:02 2009 +0200
@@ -1,5 +1,6 @@
 -- TRANSPORTED BUDDIES AVAILABILITY INDICATION
 
+-- XXX: to option?
 transport_jids = { 'icq.jabber.kiev.ua', 'mrim.unixzone.org.ua' }
 
 hooks_d['hook-status-change'].transports =
@@ -30,4 +31,15 @@
 		end
 	end
 
+hooks_d['hook-post-connect'].transports = hooks_d['hook-start'].transports
+
+hooks_d['hook-pre-disconnect'].transports =
+	function ( args )
+		for k, jid in pairs ( transport_jids ) do
+			-- when disconnected, all buddies are inaccessible, so, make them the same
+			main.run ( ("color roster * *@%s white"):format ( jid ) )
+			main.run ( ("color roster dn_? *@%s brightblack"):format ( jid ) )
+		end
+	end
+
 -- vim: se ts=4: --