Origin and Messenger.MyName... - 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: Origin and Messenger.MyName... (/showthread.php?tid=97041) Origin and Messenger.MyName... by whiz on 03-12-2011 at 01:39 PM
I'm having an issue where I'm trying to see if a message sent to a conversation was sent by the current user, or the other contact. jscript code:Although this wouldn't work if the other user had the same name, it was enough for what I was doing. The problem now is: on Messenger 2011, the current user's name when sending a message (Origin) doesn't always match the name property (Messenger.MyName) if that has been changed by another script. Although editing Messenger.MyName throws an error, it still actually changes, causing the comparison to return false (Origin holds the name set on the Windows Live profile, whereas Messenger.MyName stores the new nickname). Any suggestions, or a better method of checking who sent the message? RE: Origin and Messenger.MyName... by Mnjul on 03-12-2011 at 02:11 PM
http://mpscripts.net/docs/ref-msgevents-chatwndreceivemessage.php RE: Origin and Messenger.MyName... by matty on 03-12-2011 at 08:36 PM
Would look something like this: js code: RE: Origin and Messenger.MyName... by foaly on 03-12-2011 at 08:47 PM
quote: Shouldn't you return sMessage anyway? Now you only do it when you sent the message yourself.... RE: Origin and Messenger.MyName... by Matti on 03-12-2011 at 11:08 PM
quote:According to CookieRevised's reply to Gettin data from "/" commands, both are just fine. Returning void, zero or the original message all produce the same result. It just depends what the developer prefers to use. A small note: matty's code implies that you don't do anything else in OnEvent_ChatWndDestroyed. If you need to add code in that event that shouldn't be ran when a message is received, simply replace the call to the destroyed event with the line in the body of that event. RE: Origin and Messenger.MyName... by matty on 03-13-2011 at 12:35 AM
quote:Only reason for that is I wanted to exit the function. If you aren't changing the message you don't need to return anything. But since I wanted to exit the function I returned the message. Note if I used an ELSE clause then I wouldn't need to return the message at all. |