author | Myhailo Danylenko <isbear@ukrpost.net> |
Fri, 27 Mar 2009 12:06:19 +0200 | |
changeset 66 | 542f61e113cb |
parent 59 | 4660c4f10ef1 |
child 68 | 742878c74b8e |
permissions | -rw-r--r-- |
59 | 1 |
|
2 |
-- USER MOOD (XEP-0107) |
|
3 |
||
4 |
-- library |
|
5 |
||
66 | 6 |
local pep = require 'pep' |
7 |
||
8 |
-- |
|
59 | 9 |
|
66 | 10 |
local F = { } |
59 | 11 |
|
66 | 12 |
function F.publish ( conn, success, fail, mood, message ) |
59 | 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 |
||
66 | 23 |
return F |
59 | 24 |
|
25 |
-- vim: se ts=4: -- |