Software /
code /
verse
Comparison
plugins/jingle_ibb.lua @ 255:be126fe7c4e7
Merge with MattJ & mva
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 03 Dec 2011 19:46:47 +0100 |
parent | 250:a5ac643a7fd6 |
child | 284:c78d1780f1d2 |
comparison
equal
deleted
inserted
replaced
254:616cc6a5fd30 | 255:be126fe7c4e7 |
---|---|
1 local verse = require "verse"; | |
2 local base64 = require "util.encodings".base64; | |
3 local uuid_generate = require "util.uuid".generate; | |
4 | |
1 local xmlns_jingle_ibb = "urn:xmpp:jingle:transports:ibb:1"; | 5 local xmlns_jingle_ibb = "urn:xmpp:jingle:transports:ibb:1"; |
2 local xmlns_ibb = "http://jabber.org/protocol/ibb"; | 6 local xmlns_ibb = "http://jabber.org/protocol/ibb"; |
3 local base64 = require "util.encodings".base64; | |
4 assert(base64.encode("This is a test.") == "VGhpcyBpcyBhIHRlc3Qu", "Base64 encoding failed"); | 7 assert(base64.encode("This is a test.") == "VGhpcyBpcyBhIHRlc3Qu", "Base64 encoding failed"); |
5 assert(base64.decode("VGhpcyBpcyBhIHRlc3Qu") == "This is a test.", "Base64 decoding failed"); | 8 assert(base64.decode("VGhpcyBpcyBhIHRlc3Qu") == "This is a test.", "Base64 decoding failed"); |
6 local t_concat = table.concat | 9 local t_concat = table.concat |
7 local uuid_generate = require "util.uuid".generate; | |
8 | 10 |
9 local ibb_conn = {}; | 11 local ibb_conn = {}; |
10 local ibb_conn_mt = { __index = ibb_conn }; | 12 local ibb_conn_mt = { __index = ibb_conn }; |
11 | 13 |
12 function new_ibb(stream) | 14 function new_ibb(stream) |