Shoutbox

question - manipulate text on sender side - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: question - manipulate text on sender side (/showthread.php?tid=82811)

question - manipulate text on sender side by Hen on 03-30-2008 at 11:00 AM

Hi,
Is there a way that after the user will send the message, it will appear differently only on his side?
When using 'Messgae.replace' it will change the text as I want, but I want only the sender to see the change, and that the receiver will get the message untouched.
Thanks.


RE: question - manipulate text on sender side by markee on 03-30-2008 at 11:11 AM

Change it in the Received message function rather than the send message.  This function is fired after the message has already been sent to the recipient.  The problem is that the message cannot be any longer than the original message.


RE: question - manipulate text on sender side by Hen on 03-30-2008 at 11:45 AM

Bu then, also the message is changed according to the pre defined parameters also when I receive a message.
I only want to change the sent message, and only on the sender screen...


RE: question - manipulate text on sender side by markee on 03-30-2008 at 12:03 PM

Well then limit the origin from which the message comes from.  It should be your display name.  Try something like this.

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind){
    if(MessageKind === 1 && Origin === Messenger.MyName){
        return Message.replace(/\b([a-z])([a-z]*)([a-z])\b/gi,"$3$2$1");//Switch the first and last letter of each word
    }
}

RE: question - manipulate text on sender side by Hen on 03-30-2008 at 12:12 PM

Great.
Thanks markee!