examples/lm/mood.lua
author Myhailo Danylenko <isbear@ukrpost.net>
Tue, 31 Mar 2009 18:35:34 +0300
changeset 68 742878c74b8e
permissions -rw-r--r--
Lm separation, privacy * Library parts moved to lm.* * mc_* renamed to plain names * Privacy lists suppart (not tested)


-- USER MOOD (XEP-0107)

-- library

local pep = require 'lm.pep'

--

local F = { }

function F.publish ( conn, success, fail, mood, message )
	local item = { xmlns = 'http://jabber.org/protocol/mood' }
	if mood then
		item[mood] = { }
	end
	if message then
		item.text = { message }
	end
	pep.publish ( conn, 'http://jabber.org/protocol/mood', { mood = item }, success, fail )
end

return F

-- vim: se ts=4: --