examples/lm/attention.lua
changeset 99 ed4676536ed9
parent 68 742878c74b8e
equal deleted inserted replaced
98:59aeae623ac6 99:ed4676536ed9
     7 
     7 
     8 --
     8 --
     9 
     9 
    10 local O = {
    10 local O = {
    11 	handler =
    11 	handler =
    12 		function ( mesg )
    12 		function ( mesg, from )
    13 		end,
    13 		end,
    14 }
    14 }
    15 
    15 
    16 local F = { }
    16 local F = { }
    17 
    17 
    36 	if a and a:attribute ( 'xmlns' ) == 'urn:xmpp:attention:0' then
    36 	if a and a:attribute ( 'xmlns' ) == 'urn:xmpp:attention:0' then
    37 		local body = mess:child ( 'body' )
    37 		local body = mess:child ( 'body' )
    38 		if body then
    38 		if body then
    39 			body = body:value ()
    39 			body = body:value ()
    40 		end
    40 		end
    41 		O.handler ( body )
    41 		O.handler ( body, mess:attribute ( "from" ) )
    42 	end
    42 	end
    43 	return false
    43 	return false
    44 end
    44 end
    45 
    45 
    46 return F
    46 return F