Skip to content

Instantly share code, notes, and snippets.

legastero /
Last active January 8, 2020 21:22
Thoughts and Clarifications on Jingle Actions

Thoughts and Clarifications on Jingle Actions

Given feedback and implementation experience, here are some thoughts filling in parts of the Jingle state machine related to when and how certain actions can be performed. These things are implied by the XEP once various rules are applied, but they aren't explicitly stated.

I've previously written down some other things not stated in the XEP

session-* actions are two-for-one deals

The XEP does call out that session-accept implicitly also acts as a content-accept. However, that principle also applies to session-initiate and session-terminate, even though the XEP does not make note of it.

View udt.diff
diff --git a/src/Namespaces.ts b/src/Namespaces.ts
index fd2e0ca..127b285 100644
--- a/src/Namespaces.ts
+++ b/src/Namespaces.ts
@@ -373,6 +373,9 @@ export const NS_OMEMO_AXOLOTL = 'eu.siacs.conversations.axolotl';
export const NS_OMEMO_AXOLOTL_DEVICELIST = 'eu.siacs.conversations.axolotl.devicelist';
export const NS_OMEMO_AXOLOTL_BUNDLES = 'eu.siacs.conversations.axolotl.bundles';
+// XEP-????
+export const NS_UDT_0 = 'urn:xmpp:udt:0';
legastero / prosody_presence_broadcast.diff
Last active June 26, 2019 20:35
Experiment enabling presence broadcast controls in MUC
View prosody_presence_broadcast.diff
diff -r 5c9341a1b36f plugins/muc/mod_muc.lua
--- a/plugins/muc/mod_muc.lua Thu Jun 20 22:25:46 2019 +0200
+++ b/plugins/muc/mod_muc.lua Wed Jun 26 13:34:55 2019 -0700
@@ -86,6 +86,12 @@
room_mt.get_registered_jid = register.get_registered_jid;
room_mt.handle_register_iq = register.handle_register_iq;
+local presence_broadcast = module:require "muc/presence_broadcast";
+room_mt.get_presence_broadcast = presence_broadcast.get;
+room_mt.set_presence_broadcast = presence_broadcast.set;
legastero / ColorGenerator.ts
Created September 7, 2018 21:43
Color Generator
View ColorGenerator.ts
import { createHash } from 'iana-hashes';
export type ColorBlindMode = 'red-green' | 'blue';
export interface CbCr {
cb: number;
cr: number;

Keybase proof

I hereby claim:

  • I am legastero on github.
  • I am lancestout ( on keybase.
  • I have a public key ASACuCJ8GpOfHaWaKM5TlSTqBNn2rpkdI5t3u1G9vheRUgo

To claim this, I am signing this object:

View voice.diff
diff -r 62d533535334 plugins/muc/moderated.lib.lua
--- a/plugins/muc/moderated.lib.lua Thu Mar 24 13:57:58 2016 +0100
+++ b/plugins/muc/moderated.lib.lua Mon Mar 28 10:53:44 2016 -0700
@@ -7,6 +7,10 @@
-- COPYING file in the source package for more information.
+local st = require "util.stanza";
+local dataform = require "util.dataforms";

See a working demo of Jingle session management

I'm working on updates to XEP-0166 to add implementation guidance, but I'm going to share the CliffsNotes version here in the meantime since people are looking at creating new implementations.

I have worked on multiple Jingle implementations (and multiple iterations of each) for five years now, on various platforms and languages (Python, Lua, JavaScript, Swift). However, it has only been this past year that I've "achieved enlightenment" and finally understood what the processing model

legastero /
Last active November 19, 2015 19:03

Reporting Security Vulnerabilities

This package is using the Node Security Project (NSP) to facilitate responsible disclosure of potential security issues and subsequent security patches and advisories.

If you have discovered a potential security issue, please send the relevant information (such as references, commits, or code examples that would be useful in reproducing the issue) to the Node Security Project by either:

legastero / component.js
Last active August 29, 2015 14:24
Using jxt-xmpp with node-xmpp-component
View component.js
'use strict';
var JXT = require('jxt').createRegistry();
var XMPPComponent = require('node-xmpp-component');
var Message = JXT.getMessage('component');
legastero / index.js
Last active August 29, 2015 14:13
requirebin sketch
View index.js
var XMPP = require('');
var dragDrop = require('drag-drop');
var mucRoom = window.prompt('Enter name for filedrop session:');
document.querySelector('body').innerHTML = '<div id="logs" style="height:100%;overflow:scroll"></div>';
document.querySelector('#logs').innerHTML = '<div id="droparea" style="color:green; font-weight:bold">Drop a file on this part of the page</div><div>Filedrop session: '+mucRoom+'</div><div style="color:red">BE CAREFUL WHAT YOU SHARE</div>';