examples/activity.lua
author Myhailo Danylenko <isbear@ukrpost.net>
Sat, 28 Mar 2009 19:43:12 +0200
changeset 67 d33ca5572e91
parent 66 542f61e113cb
child 68 742878c74b8e
permissions -rw-r--r--
Fully object forms interface (untested)


-- USER ACTIVITY (XEP-0108)

-- library

local pep    = require 'pep'

-- public

local F = { }

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

return F

-- vim: se ts=4: --