examples/lm/activity.lua
author Myhailo Danylenko <isbear@ukrpost.net>
Tue, 21 Aug 2012 15:47:07 +0300
changeset 131 d1d2754bbdaf
parent 68 742878c74b8e
permissions -rw-r--r--
Update copyright header in cmakelists


-- USER ACTIVITY (XEP-0108)

-- library

local pep    = require 'lm.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: --