examples/transports.lua
changeset 9 c2517f8bf647
parent 8 fc9060b9b7cc
child 32 524fde5be49a
equal deleted inserted replaced
8:fc9060b9b7cc 9:c2517f8bf647
     1 -- TRANSPORTED BUDDIES AVAILABILITY INDICATION
     1 -- TRANSPORTED BUDDIES AVAILABILITY INDICATION
     2 
     2 
       
     3 -- XXX: to option?
     3 transport_jids = { 'icq.jabber.kiev.ua', 'mrim.unixzone.org.ua' }
     4 transport_jids = { 'icq.jabber.kiev.ua', 'mrim.unixzone.org.ua' }
     4 
     5 
     5 hooks_d['hook-status-change'].transports =
     6 hooks_d['hook-status-change'].transports =
     6 	function ( args )
     7 	function ( args )
     7 		for k, jid in pairs ( transport_jids ) do
     8 		for k, jid in pairs ( transport_jids ) do
    28 				main.run ( ("color roster dn_? *@%s brightblack"):format ( jid ) )
    29 				main.run ( ("color roster dn_? *@%s brightblack"):format ( jid ) )
    29 			end
    30 			end
    30 		end
    31 		end
    31 	end
    32 	end
    32 
    33 
       
    34 hooks_d['hook-post-connect'].transports = hooks_d['hook-start'].transports
       
    35 
       
    36 hooks_d['hook-pre-disconnect'].transports =
       
    37 	function ( args )
       
    38 		for k, jid in pairs ( transport_jids ) do
       
    39 			-- when disconnected, all buddies are inaccessible, so, make them the same
       
    40 			main.run ( ("color roster * *@%s white"):format ( jid ) )
       
    41 			main.run ( ("color roster dn_? *@%s brightblack"):format ( jid ) )
       
    42 		end
       
    43 	end
       
    44 
    33 -- vim: se ts=4: --
    45 -- vim: se ts=4: --