examples/mcabberrc.lua
changeset 10 73f4c12b6ffb
parent 9 c2517f8bf647
child 12 a52d61f57e0d
equal deleted inserted replaced
9:c2517f8bf647 10:73f4c12b6ffb
   110 
   110 
   111 	if tbls == "" then
   111 	if tbls == "" then
   112 		return string.format ( "{%s }", jk:sub ( 1, -2 ) )
   112 		return string.format ( "{%s }", jk:sub ( 1, -2 ) )
   113 	else
   113 	else
   114 		return string.format ( "{%s\n%s%s}", jk, tbls, prefix )
   114 		return string.format ( "{%s\n%s%s}", jk, tbls, prefix )
   115 	end
       
   116 end
       
   117 
       
   118 -- XXX to C?
       
   119 function full_current_jid ()
       
   120 	local jid = main.current_buddy ()
       
   121 	if jid then
       
   122 		local info = main.buddy_info ( jid )
       
   123 		local prio, resource = 0
       
   124 		for res, par in pairs ( info.resources ) do
       
   125 			if prio <= par.priority then
       
   126 				resource = res
       
   127 				prio = par.priority
       
   128 			end
       
   129 		end
       
   130 		if resource then
       
   131 			return jid .. '/' .. resource
       
   132 		else
       
   133 			return jid
       
   134 		end
       
   135 	else
       
   136 		return nil
       
   137 	end
   115 	end
   138 end
   116 end
   139 
   117 
   140 function online ( jid )
   118 function online ( jid )
   141 	local info = main.buddy_info ( jid )
   119 	local info = main.buddy_info ( jid )