summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Burgess <pete.burgess@isode.com>2018-03-26 11:17:24 (GMT)
committerPeter Burgess <pete.burgess@isode.com>2018-03-27 12:58:17 (GMT)
commit860ef54501e8c32d91160f798c8f9ecf811f2501 (patch)
tree60e3621f634b10a64fcf5cb1c5da8279c08e78a3 /Sluift/Examples
parent92bba873587e0cfaf53aff6749d4537b13e275e8 (diff)
downloadswift-860ef54501e8c32d91160f798c8f9ecf811f2501.zip
swift-860ef54501e8c32d91160f798c8f9ecf811f2501.tar.bz2
Add new ReferencePayload element class, parser and serializer
Added a new element object ReferencePayload, and created the parser and serializer to handle this element. Currently no functionality to send references directly in swift, nor to render their contents. Test-Information: Unit tests written and passed for serializer and parser, testing various types of valid and invalid references, and testing references with embedded payloads. Change-Id: I81fd5d9e020fac1729640f297705806af97f6388
Diffstat (limited to 'Sluift/Examples')
-rw-r--r--Sluift/Examples/SendReference.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/Sluift/Examples/SendReference.lua b/Sluift/Examples/SendReference.lua
index b705172..2e60182 100644
--- a/Sluift/Examples/SendReference.lua
+++ b/Sluift/Examples/SendReference.lua
@@ -37,7 +37,7 @@ function get_password(prompt)
if stty_ret then
io.write("\027[m")
else
- os.execute("stty sane")
+ os.execute("stty echo")
end
io.write("\n");
if ok then
@@ -55,6 +55,7 @@ datauri = #arg > 2 and arg[3] or DEFAULT_URI
sluift.debug = 1
sluift.with(sluift.new_client(jid, password), function()
+ options = { host=os.getenv("XMPP_HOST"), port=os.getenv("XMPP_PORT") }
connect(options)
reference = {
['_type'] = 'dom',
@@ -63,6 +64,9 @@ sluift.with(sluift.new_client(jid, password), function()
['attributes'] = {
{ ['name'] = 'type', ['value'] = 'data' },
{ ['name'] = 'uri', ['value'] = datauri },
+ { ['name'] = 'mimeType', ['value'] = arg[4] },
+ { ['name'] = 'begin', ['value'] = arg[5] },
+ { ['name'] = 'end', ['value'] = arg[6] }
},
}
send_message{to=tojid, body="Check out this data!", payloads={reference}}