irc embed fix
This commit is contained in:
parent
98b71ac466
commit
1369446721
31
client.js
31
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<a.length; i += limit){
|
||||
|
||||
irc_client.send("RELAYMSG", "#deekchat", user.name + "/Dek", a.slice(i, i + limit));
|
||||
irc_client.send("RELAYMSG", "#deekchat", irc_username + "/Dek", a.slice(i, i + limit));
|
||||
}
|
||||
});
|
||||
|
||||
for(var i=0; i<msg.files.length; i++){
|
||||
|
||||
irc_client.send("RELAYMSG", "#deekchat", user.name + "/Dek", msg.files[i]);
|
||||
irc_client.send("RELAYMSG", "#deekchat", irc_username + "/Dek", msg.files[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue