Removing MQTT message inbound.

This commit is contained in:
Stephen Vanderwarker 2022-05-26 19:06:33 -04:00
parent 4045b29b72
commit b2444eb609
Signed by: stephen
GPG Key ID: EF429EF847868C14

View File

@ -114,25 +114,15 @@ try {
// setup friends list // setup friends list
const friends = Object.keys(config.friends); const friends = Object.keys(config.friends);
client.subscribe('phones/pixel2/media', function (err) {
if (!err) {
debug();
}
})
client.on('message', function (topic, payload) {
var nowPlaying = payload.toString()
console.log(nowPlaying)
xmpp.send(user_jid, nowPlaying)
})
xmpp.on('online', function (data, to) { xmpp.on('online', function (data, to) {
// once we're online, we'll send a message alerting xmpp admins // once we're online, we'll send a message alerting xmpp admins
console.log('Connected with JID: ' + bot_jid); console.log('Connected with JID: ' + bot_jid);
xmpp.send(user_jid, "[ONLINE]", false); //xmpp.send(user_jid, "[ONLINE]", false);
// send mqtt online message // send mqtt online message
client.publish(mqtt_topic, mqtt_message); client.publish(mqtt_topic, mqtt_message);
// toot online message // toot online message
if (mastodon_toots_enabled === "1"){ if (mastodon_enabled === "1"){
M.post('statuses', { M.post('statuses', {
status: `${mastodon_toot}` status: `${mastodon_toot}`
}); });