68
|
1 |
|
|
2 |
-- USER ACTIVITY (XEP-0108) |
|
3 |
|
|
4 |
-- library |
|
5 |
|
|
6 |
local pep = require 'lm.pep' |
|
7 |
|
|
8 |
-- public |
|
9 |
|
|
10 |
local F = { } |
|
11 |
|
|
12 |
function F.publish ( conn, success, fail, general, specific, message ) |
|
13 |
local item = { xmlns = 'http://jabber.org/protocol/activity' } |
|
14 |
if general then |
|
15 |
item[general] = { } |
|
16 |
if specific then |
|
17 |
item[general][specific] = { } |
|
18 |
end |
|
19 |
end |
|
20 |
if message then |
|
21 |
item.text = { message } |
|
22 |
end |
|
23 |
pep.publish ( conn, 'http://jabber.org/protocol/activity', { activity = item }, success, fail ) |
|
24 |
end |
|
25 |
|
|
26 |
return F |
|
27 |
|
|
28 |
-- vim: se ts=4: -- |