author | Myhailo Danylenko <isbear@ukrpost.net> |
Thu, 17 Mar 2016 23:17:00 +0200 | |
changeset 151 | 5d90caa7fb2c |
parent 68 | 742878c74b8e |
permissions | -rw-r--r-- |
68 | 1 |
|
2 |
-- USER MOOD (XEP-0107) |
|
3 |
||
4 |
-- library |
|
5 |
||
6 |
local pep = require 'lm.pep' |
|
7 |
||
8 |
-- |
|
9 |
||
10 |
local F = { } |
|
11 |
||
12 |
function F.publish ( conn, success, fail, mood, message ) |
|
13 |
local item = { xmlns = 'http://jabber.org/protocol/mood' } |
|
14 |
if mood then |
|
15 |
item[mood] = { } |
|
16 |
end |
|
17 |
if message then |
|
18 |
item.text = { message } |
|
19 |
end |
|
20 |
pep.publish ( conn, 'http://jabber.org/protocol/mood', { mood = item }, success, fail ) |
|
21 |
end |
|
22 |
||
23 |
return F |
|
24 |
||
25 |
-- vim: se ts=4: -- |