Comparison

plugins/mod_carbons.lua @ 6843:161cccfdf015

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Tue, 22 Sep 2015 01:31:52 +0200
parent 6841:be87ab2d611c
child 7670:2be85cb3bc66
comparison
equal deleted inserted replaced
6839:298182fd2387 6843:161cccfdf015
12 local function toggle_carbons(event) 12 local function toggle_carbons(event)
13 local origin, stanza = event.origin, event.stanza; 13 local origin, stanza = event.origin, event.stanza;
14 local state = stanza.tags[1].name; 14 local state = stanza.tags[1].name;
15 module:log("debug", "%s %sd carbons", origin.full_jid, state); 15 module:log("debug", "%s %sd carbons", origin.full_jid, state);
16 origin.want_carbons = state == "enable" and stanza.tags[1].attr.xmlns; 16 origin.want_carbons = state == "enable" and stanza.tags[1].attr.xmlns;
17 return origin.send(st.reply(stanza)); 17 origin.send(st.reply(stanza));
18 return true;
18 end 19 end
19 module:hook("iq-set/self/"..xmlns_carbons..":disable", toggle_carbons); 20 module:hook("iq-set/self/"..xmlns_carbons..":disable", toggle_carbons);
20 module:hook("iq-set/self/"..xmlns_carbons..":enable", toggle_carbons); 21 module:hook("iq-set/self/"..xmlns_carbons..":enable", toggle_carbons);
21 22
22 local function message_handler(event, c2s) 23 local function message_handler(event, c2s)