comparison mod_pubsub_mqtt/mod_pubsub_mqtt.lua @ 1243:c2bf6b2102aa

mod_pubsub_mqtt: Change namespace of 'data' element to make it generic
author Matthew Wild <mwild1@gmail.com>
date Mon, 02 Dec 2013 03:08:17 +0000
parents e0d97eb52ab8
children e76f7b6be20e
comparison
equal deleted inserted replaced
1242:4d1226220e58 1243:c2bf6b2102aa
39 module:log("warn", "Unable to locate host/node: %s", packet.topic); 39 module:log("warn", "Unable to locate host/node: %s", packet.topic);
40 return; 40 return;
41 end 41 end
42 local id = "mqtt"; 42 local id = "mqtt";
43 local ok, err = pubsub:publish(node, true, id, 43 local ok, err = pubsub:publish(node, true, id,
44 st.stanza("data", { xmlns = "https://prosody.im/protocol/mqtt" }) 44 st.stanza("data", { xmlns = "https://prosody.im/protocol/data" })
45 :text(packet.data) 45 :text(packet.data)
46 ); 46 );
47 if not ok then 47 if not ok then
48 module:log("warn", "Error publishing MQTT data: %s", tostring(err)); 48 module:log("warn", "Error publishing MQTT data: %s", tostring(err));
49 end 49 end