O.P. Nickname highlight
Hello community,
those users who use irc may already know it. once your nickname is mentioned in a channel a small box appears in the lower right corner of your desktop and you get informed about this (e.g. Nickname 'Johnny' was mentioned in #irc).
is there a similar function to this for msgplus?
it would be useful e.g. in a mass conversation.
a normal msgplus message (MsgPlus.DisplayToastContact("Information","Your nickname has been mentioned by User")) should appear.
im also a scripter, but not experienced in msgplus scripting.
so it would be nice if you could help me. its okay.. i figured it out myself:
--
var highwords = new Array ("johnny", "jay");
function OnEvent_Initialize(MessengerStart)
{
}
function OnEvent_Uninitialize(MessengerExit)
{
}
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind)
{
var e = new Enumerator(ChatWnd.Contacts);
var contact = e.item();
checkAndDisplay (Message, contact.Name);
}
function checkAndDisplay (Message, my)
{
for (i in highwords) {
if (Message.toLowerCase().search(highwords[i]) != -1) {
MsgPlus.DisplayToastContact("Nick Highlighter", "[c=#3682B4]Highlight[/c]", "'"+ucfirst(highwords[i])+"' has been mentioned by: " + my, null, "locateDetectedAddress");
}
}
}
function ucfirst(str) {
return str.substr(0,1).toUpperCase() + str.substr(1,str.length);
}
|