This file contains 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
-- NOTE: requires adding resource-hibernate and resource-resumed events to mod_smacks | |
-- TODO: make it reuse the contents of the user's last presence instead of creating a completely new one | |
local st = require "util.stanza"; | |
local core_post_stanza = prosody.core_post_stanza; | |
local xmlns_psa = "urn:xmpp:psa"; | |
module:hook("resource-hibernate", function(event) |
This file contains 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
// There are cases where we want to go ahead and render a view before | |
// we have data from an API, but we need to know when we're able to | |
// then fetch that data. | |
// | |
// This isn't so much an issue with REST APIs, but this will happen | |
// for any socket.io/WebSocket API where you have to wait for that | |
// connection to be authenticated. | |
// -------------------------------------------------------------------- |
This file contains 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
// In-progress experiments with this idea before making a proper module | |
var State = require('ampersand-state'); | |
module.exports = State.extend({ | |
props: { | |
max: ['number', true, 20], | |
reverse: 'boolean', | |
first: 'any', // string or bool (true means end-of-collection, false means start-of-collection) |
This file contains 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 jid_bare = require "util.jid".bare; | |
local xmlns_push = "urn:xmpp:push:0"; | |
local full_sessions, bare_sessions = full_sessions, bare_sessions; | |
local recipients = {}; | |
local function toggle_push(event) | |
local origin, stanza = event.origin, event.stanza; | |
local user = stanza.attr.to or (origin.username..'@'..origin.host); |
This file contains 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
/*! stanzaio 2014-04-24*/!function(a){if("object"==typeof exports)module.exports=a();else if("function"==typeof define&&define.amd)define(a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.XMPP=a()}}(function(){var a,b,c;return function d(a,b,c){function e(g,h){if(!b[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=b[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,d,a,b,c)}return b[g].exports}for(var f="function"==typeof require&&require,g=0;g<c.length;g++)e(c[g]);return e}({1:[function(a,b,c){"use strict";c.Stream=a("./lib/stanza/stream"),c.BOSH=a("./lib/stanza/bosh"),c.Message=a("./lib/stanza/message"),c.Presence=a("./lib/stanza/presence"),c.Iq=a("./lib/stanza/iq"),c.PubsubEvent=a("./lib/stanza/pubsub").EventItem,c.PubsubItem=a("./lib/stanza/pubsub").Item,c.JID=a("./lib/jid"),c.Client=a( |
This file contains 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
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.XMPP=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | |
"use strict"; | |
exports.Stream = _dereq_('./lib/stanza/stream'); | |
exports.BOSH = _dereq_('./lib/stanza/bosh'); | |
exports.Message = _dereq_('./lib/stanza/message'); | |
exports.Presence = _dereq_('./lib/stanza/presence'); | |
exports.Iq = _dereq_('./lib/stanza/iq'); | |
exports.PubsubEvent = _dereq_(' |
This file contains 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
/*! stanzaio 2014-04-21*/!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.XMPP=e():"undefined"!=typeof global?global.XMPP=e():"undefined"!=typeof self&&(self.XMPP=e())}(function(){var e,n,o;return function f(e,n,o){function d(t,u){if(!n[t]){if(!e[t]){var l="function"==typeof require&&require;if(!u&&l)return l(t,!0);if(i)return i(t,!0);throw new Error("Cannot find module '"+t+"'")}var p=n[t]={exports:{}};e[t][0].call(p.exports,function(n){var o=e[t][1][n];return d(o?o:n)},p,p.exports,f,e,n,o)}return n[t].exports}for(var i="function"==typeof require&&require,t=0;t<o.length;t++)d(o[t]);return d}({1:[function(e,n,o){"use strict";o.Stream=e("./lib/stanza/stream"),o.BOSH=e("./lib/stanza/bosh"),o.Message=e("./lib/stanza/message"),o.Presence=e("./lib/stanza/presence"),o.Iq=e("./lib/stanza/iq"),o.PubsubEvent=e("./lib/stanza/pubsub").EventItem,o.PubsubItem=e("./lib/stanza/pubsub").Item,o.JID=e("./lib/jid"),o.Client=e("./lib/client |
This file has been truncated, but you can view the full file.
This file contains 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
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.XMPP=e():"undefined"!=typeof global?global.XMPP=e():"undefined"!=typeof self&&(self.XMPP=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
"use strict"; | |
exports.Stream = require('./lib/stanza/stream'); | |
exports.BOSH = require('./lib/stanza/bosh'); | |
exports.Message = require('./lib/stanza/message'); | |
exports.Presence = require('./lib/stanza/presence'); | |
exports.Iq = require('./lib/stanza/iq'); | |
exports.PubsubEvent = require('./lib/stanza/ |
This file contains 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
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.XMPP=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | |
"use strict"; | |
exports.Stream = _dereq_('./lib/stanza/stream'); | |
exports.BOSH = _dereq_('./lib/stanza/bosh'); | |
exports.Message = _dereq_('./lib/stanza/message'); | |
exports.Presence = _dereq_('./lib/stanza/presence'); | |
exports.Iq = _dereq_('./lib/stanza/iq'); | |
exports.PubsubEvent = _dereq_(' |
This file contains 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
/*! stanzaio 2014-04-21!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.XMPP=e()}}(function(){var e,f,n;return function o(e,f,n){function d(t,l){if(!f[t]){if(!e[t]){var u="function"==typeof require&&require;if(!l&&u)return u(t,!0);if(i)return i(t,!0);throw new Error("Cannot find module '"+t+"'")}var p=f[t]={exports:{}};e[t][0].call(p.exports,function(f){var n=e[t][1][f];return d(n?n:f)},p,p.exports,o,e,f,n)}return f[t].exports}for(var i="function"==typeof require&&require,t=0;t<n.length;t++)d(n[t]);return d}({1:[function(e,f,n){"use strict";n.Stream=e("./lib/stanza/stream"),n.BOSH=e("./lib/stanza/bosh"),n.Message=e("./lib/stanza/message"),n.Presence=e("./lib/stanza/presence"),n.Iq=e("./lib/stanza/iq"),n.PubsubEvent=e("./lib/stanza/pubsub").EventItem,n.PubsubItem=e("./lib/stanza/pubsub").Item,n.JID=e("./lib/jid"),n.Client=e(". |