Mercurial > prosody-modules
comparison mod_carbons/mod_carbons.lua @ 1795:91c01ef82807
mod_carbons: Get full_ and bare_sessions from the prosody global [luacheck]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 27 Aug 2015 12:17:12 +0200 |
parents | eefe4b69b5f6 |
children | db8b256f51ff |
comparison
equal
deleted
inserted
replaced
1794:eefe4b69b5f6 | 1795:91c01ef82807 |
---|---|
7 local jid_bare = require "util.jid".bare; | 7 local jid_bare = require "util.jid".bare; |
8 local xmlns_carbons = "urn:xmpp:carbons:2"; | 8 local xmlns_carbons = "urn:xmpp:carbons:2"; |
9 local xmlns_carbons_old = "urn:xmpp:carbons:1"; | 9 local xmlns_carbons_old = "urn:xmpp:carbons:1"; |
10 local xmlns_carbons_really_old = "urn:xmpp:carbons:0"; | 10 local xmlns_carbons_really_old = "urn:xmpp:carbons:0"; |
11 local xmlns_forward = "urn:xmpp:forward:0"; | 11 local xmlns_forward = "urn:xmpp:forward:0"; |
12 local full_sessions, bare_sessions = full_sessions, bare_sessions; | 12 local full_sessions, bare_sessions = prosody.full_sessions, prosody.bare_sessions; |
13 | 13 |
14 local function toggle_carbons(event) | 14 local function toggle_carbons(event) |
15 local origin, stanza = event.origin, event.stanza; | 15 local origin, stanza = event.origin, event.stanza; |
16 local state = stanza.tags[1].attr.mode or stanza.tags[1].name; | 16 local state = stanza.tags[1].attr.mode or stanza.tags[1].name; |
17 module:log("debug", "%s %sd carbons", origin.full_jid, state); | 17 module:log("debug", "%s %sd carbons", origin.full_jid, state); |