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.
Normally, I'd use something like this:
jscript code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind)
{
if (Origin === Messenger.MyName)
{
// current user sent it
}
else
{
// other contact sent it
}
}
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?