diff --git a/client.js b/client.js index 1873a1a..0554436 100644 --- a/client.js +++ b/client.js @@ -586,6 +586,23 @@ function init_irc(){ case "#deekchat": send(1, "<" + from + "> " + message); + + deek.emit( + "message", + { + text: message, + id: -1, + files: [], + mentions: [], + replies: [], + channel: 1 + }, + { + name: from, + id: -1, + picture: null + } + ); break; } }); @@ -597,7 +614,7 @@ function init_irc(){ irc_logged_in = false; irc_debounce = false; - irc_client.disconnect(); + //irc_client.disconnect(); setTimeout(function(){ @@ -704,22 +721,24 @@ deek.on("message", async function(msg, user){ if( irc_bridge_enabled && irc_logged_in && - msg.channel === 1 + msg.channel === 1 && + msg.id !== -1 ){ + var irc_username = user.name.replace(/[^A-Za-z0-9-_]/g, "-"); + var limit = 412 - ("RELAYMSG #deekchat " + irc_username + "/Dek").length; + msg.text.split("\n").forEach(function(a){ - var limit = 412 - ("RELAYMSG #deekchat " + user.name + "/Dek").length; - for(var i=0; i