This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph foo { | |
rankdir=LR; | |
node [ shape = point ]; | |
ENTRY; | |
en_98; | |
eof_1; | |
eof_2; | |
eof_3; | |
eof_4; | |
eof_5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
%%{ | |
machine foo; | |
alphtype unsigned char; | |
action char { printf("> %c\n", *p); } Char = any* @char; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local host = hosts[module.host]; | |
module:hook("presence/full", function(event) | |
local origin, stanza = event.origin, event.stanza; | |
local node, host, resource = jid_split(stanza.attr.to); | |
if not node then return; end -- not to a room | |
local room = host.muc[node.."@"..host]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local bookmark = { | |
jid = "[email protected]"; | |
name = "Jabber Support Room"; | |
}; | |
local datamanager = require "util.datamanager"; | |
local st = require "util.stanza"; | |
module:hook("user-registered", function(event) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- expects XML file as first argument | |
-- call in a loop over all files | |
-- e.g., on windows I can do: for %x in (xml\*.xml) do @ j2offline.lua %x | |
-- prosody stuff needs to be on LUA_PATH and LUA_CPATH, or add it here: | |
package.path = "../?.lua;"..package.path; | |
package.cpath = "../?.dll;../?.so;"..package.cpath; | |
prosody = { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/util/sasl_cyrus.lua b/util/sasl_cyrus.lua | |
--- a/util/sasl_cyrus.lua | |
+++ b/util/sasl_cyrus.lua | |
@@ -97,6 +97,9 @@ | |
local data; | |
if self.mechanism then | |
+ if self.mechanism == "PLAIN" then | |
+ message = (message or ""):match("(%z.*)"); | |
+ end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/util/sasl_cyrus.lua b/util/sasl_cyrus.lua | |
--- a/util/sasl_cyrus.lua | |
+++ b/util/sasl_cyrus.lua | |
@@ -97,6 +97,9 @@ | |
local data; | |
if self.mechanism then | |
+ if self.mechanism == "PLAIN" then | |
+ message = (message or ""):match("(%z.*)"); | |
+ end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local st, uuid = require "util.stanza", require "util.uuid"; | |
local xmlns_cmd = "http://jabber.org/protocol/commands"; | |
local states = {} | |
local _M = {}; | |
function _cmdtag(desc, status, sessionid, action) | |
local cmd = st.stanza("command", { xmlns = xmlns_cmd, node = desc.node, status = status }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== Pseudo-code for a new caps hash algorithm == | |
- Not susceptible to trivial preimage attacks | |
- No escaping required | |
- Can be implemented efficiently | |
- Pseudo-code uses functional primitives, but easily translatable to non-functional languages (like C) | |
- No undefined edge cases, everything fully specified, including when attributes/elements are missing or duplicated | |
- 'ver' based on JSON-isque delimiters, using null byte '\0' as escape | |
- Possibly controversial aspects: | |
- Concious decision to not fail on missing required elements/attributes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local st = require "util.stanza"; | |
local lxp = require "lxp"; | |
-- XML parser | |
local parse_xml = (function() | |
local ns_prefixes = { | |
["http://www.w3.org/XML/1998/namespace"] = "xml"; | |
}; | |
local ns_separator = "\1"; |