Support #697

Replace URLS or Text to Custom Message

Added by Suman Armaan almost 2 years ago. Updated almost 2 years ago.

Status:NewStart date:10/31/2015
Priority:UrgentDue date:
Assignee:Valentin Manthei% Done:

0%

Category:-
Target version:-

Description

Hello,
I explored BugTracker of lightIRC and found a code for disabling links in chat. The code is present in config.js as:-

/ This method gets called if you use the parameter loopServerCommands /
function onServerCommand(command) {
if(command.indexOf("PRIVMSG") > -1) {
var tokens = command.split(" ");
if(tokens.length > 2) {
var message = tokens3;
message = message.replace("www", "w*w");
message = message.replace("http", "ht*p");
command = tokens.slice(0, 3).join(" ")+" "+message;
}
}
return command;
}

But, I am confused on how to replace the words like www/http:// or http://www. or .com etc. to custom text by me. I am not sure, how to do this.
The scene: User sends the message like: Hey! Join www.example.com!!! / http://www.example.com/et.html!!! etc. but the message changes to "Do not send such text" etc.
I hope you have get me.

History

#1 Updated by Valentin Manthei almost 2 years ago

Is it still up to date?

Also available in: Atom PDF