What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » HELP - Email from OnEvent_ChatWndReceiveMessage!

HELP - Email from OnEvent_ChatWndReceiveMessage!
Author: Message:
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. Huh?  HELP - Email from OnEvent_ChatWndReceiveMessage!
js code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind)
The "Origin" variable outputs the contact's name.  Is it possible to get their email address instead?

This post was edited on 05-14-2009 at 07:17 PM by whiz.
05-14-2009 07:16 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: HELP - Email from OnEvent_ChatWndReceiveMessage!
Indirectly, yes it is:

JScript code:
function OnEvent_ChatWndReceiveMessage(obj,orig,msg,k) {
    var Emails = new Array();
    for(var e = new Enumerator(obj.Contacts; !e.atEnd(); e.moveNext()) {
        Emails.push(e.item().Email);
    }
}

The Emails array contains all email addresses. I suppose you know how to use 'em from now on?

This post was edited on 05-14-2009 at 07:45 PM by SmokingCookie.
05-14-2009 07:44 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: HELP - Email from OnEvent_ChatWndReceiveMessage!
So, that will get the email address from the contact window, yes?
05-14-2009 07:56 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: HELP - Email from OnEvent_ChatWndReceiveMessage!
The code that was posted will get ALL users emails that are participating in the conversation (aside from your own).

There is no real reliable way of doing this especially if it is a multi contact chat.

Also note that ChatWndReceiveMessage will fire when you send a message as well. This event is fired when some text is added to the History of the chat.

This post was edited on 05-14-2009 at 08:05 PM by matty.
05-14-2009 08:03 PM
Profile E-Mail PM Find Quote Report
Jesus
Scripting Contest Winner
****

Avatar
Koffie, my cat ;)

Posts: 623
Reputation: 15
38 / Male / Flag
Joined: Jul 2005
RE: HELP - Email from OnEvent_ChatWndReceiveMessage!
It will get the email addresses from ALL contacts in the chatwnd.
You can compare it to the Origin variable of the OnEvent_ChatWndReceiveMessage function, but if for example two contacts have the same name then you could get the wrong contact.

In short, it will work, but it's not fool proof.
Man is least himself when he is in his own person. Give him a mask and he will tell you the truth. (Oscar Wilde)
05-14-2009 08:04 PM
Profile PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
RE: HELP - Email from OnEvent_ChatWndReceiveMessage!
JScript code:
function OnEvent_ChatWndReceiveMessage(obj,orig,msg,k) {
    var Emails = new Array();
    var OriginEmail = "";
    for(var e = new Enumerator(obj.Contacts); !e.atEnd(); e.moveNext()) {
        Emails.push(e.item().Email);
        if(e.item().Name == orig)OriginEmail = e.item().Email;
    }
}

i guess that will work :P

note: it won't work with contacts that have the same name

edit: if you want to limit it to only a one-on-one conversation, just check if obj.Contacts.count == 1

This post was edited on 05-14-2009 at 08:09 PM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
05-14-2009 08:06 PM
Profile PM Web Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: HELP - Email from OnEvent_ChatWndReceiveMessage!
Ok, thanks all!  :)
05-14-2009 08:10 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On