Skip to content

Instantly share code, notes, and snippets.

@legastero
legastero / jingle_actions.md
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.

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
legastero / prosody_presence_broadcast.diff
Last active June 26, 2019 20:35
Experiment enabling presence broadcast controls in MUC
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
legastero / ColorGenerator.ts
Created September 7, 2018 21:43
Color Generator
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 (https://keybase.io/lancestout) on keybase.
  • I have a public key ASACuCJ8GpOfHaWaKM5TlSTqBNn2rpkdI5t3u1G9vheRUgo

To claim this, I am signing this object:

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
legastero / SECURITY.md
Last active November 19, 2015 19:03
NSP SECURITY.md

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
legastero / component.js
Last active August 29, 2015 14:24
Using jxt-xmpp with node-xmpp-component
'use strict';
var JXT = require('jxt').createRegistry();
var XMPPComponent = require('node-xmpp-component');
JXT.use(require('jxt-xmpp-types'));
JXT.use(require('jxt-xmpp'));
var Message = JXT.getMessage('component');
@legastero
legastero / index.js
Last active August 29, 2015 14:13
requirebin sketch
require('drag-drop-webkit-mobile');
var XMPP = require('stanza.io');
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>';