examples/lm/mood.lua
author Myhailo Danylenko <isbear@ukrpost.net>
Sun, 05 Aug 2012 20:10:32 +0300
changeset 123 6b753fbacd4c
parent 68 742878c74b8e
permissions -rw-r--r--
Do not use g_slist_free_full (for now)


-- 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: --