What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Origin to email?

Pages: (2): « First [ 1 ] 2 » Last »
Origin to email?
Author: Message:
Robin4286
Junior Member
**


Posts: 21
Joined: Sep 2006
O.P. Origin to email?
Okay, so in the message recieved event it returns the origin of the message sent. Is there a way to get the email of this origin?
09-16-2006 02:46 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Origin to email?
code:
for(var enumerator = new Enumerator(pChatWnd.Contacts) ; !enumerator.atEnd(); enumerator.moveNext()){
    var Contact = enumerator.item();
    Debug.Trace('Contact.Email :'+Contact.Email);
}

Your going to have to change pChatWnd to whatever the ChatWnd object is called in the function.

This post was edited on 09-16-2006 at 03:42 AM by matty.
09-16-2006 03:41 AM
Profile E-Mail PM Find Quote Report
Robin4286
Junior Member
**


Posts: 21
Joined: Sep 2006
O.P. RE: Origin to email?
Well thats not really accomplishing what I am trying to do. What I want to do is return who sent the email, not who is in the conversation.

Can anyone help with this?
09-16-2006 03:57 AM
Profile E-Mail PM Find Quote Report
cloudhunter
Senior Member
****


Posts: 536
Reputation: 18
37 / – / –
Joined: Dec 2005
RE: Origin to email?
It does exactly what you want. When it receives an origin, it looks for the people in the chat window, and finds out the email address. Saves iterating through all the Contacts.
[Image: cloudy.jpg]
Sig by pirateok/marisaok/marisa ;)
quote:
Originally posted by Moulin Rouge
The greatest thing you'll ever learn, is just to love and be loved in return

6721 days, 21 hours, 32 minutes, 54 seconds ago
09-16-2006 03:59 AM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Origin to email?
quote:
Originally posted by cloudhunter
It does exactly what you want. When it receives an origin, it looks for the people in the chat window, and finds out the email address. Saves iterating through all the Contacts.
which will only work when there is only 1 contact in the chat though, and which you need to explicitly check on or you might end up with the wrong contact.

Also you need to check if the message doesn't come from yourself. eg: if you explicitly use what Matty posted you can end up with the contact's email, while the message was actually being send by you..

------

Robin4286

quote:
Originally posted by Robin4286
Well thats not really accomplishing what I am trying to do. What I want to do is return who sent the email, not who is in the conversation.
it is exactly what you need as you need to know who is in the conversation to check the Origin (the name) against.

So with what Matty showed, you can easly iterate thru all the contacts and getting their name and comparing it to the origin.

If there is only one contact, the iteration will be extremely short (1), if there are more than one contact, the iteration would still be short (compared to checking your whole contactlist)...


So what you need to make this:
- the code from Matty and how to iterate thru the contacts in the chat window (which is exactly what he showed).
- comparing their Name with the Origin parameter
- if a match occurs, get the email from that contact

This post was edited on 09-16-2006 at 04:39 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-16-2006 04:32 AM
Profile PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Origin to email?
quote:
Originally posted by Matty
code:
for(var enumerator = new Enumerator(pChatWnd.Contacts) ; !enumerator.atEnd(); enumerator.moveNext()){
    var Contact = enumerator.item();
    Debug.Trace('Contact.Email :'+Contact.Email);
}

Your going to have to change pChatWnd to whatever the ChatWnd object is called in the function.
Wouldn't the following code be better?
code:
for(var enumerator = new Enumerator(pChatWnd.Contacts) ; !enumerator.atEnd(); enumerator.moveNext()){
    var Cont = enumerator.item();
    if (Cont.Name === Origin){
    var Contact = Cont;
    }
}
Debug.Trace('The email of "+Origin+" is "+Contact.Email)//and you can use Contact throughout the rest of the function too

This post was edited on 09-16-2006 at 07:29 AM by markee.
[Image: markee.png]
09-16-2006 07:27 AM
Profile PM Find Quote Report
Robin4286
Junior Member
**


Posts: 21
Joined: Sep 2006
O.P. RE: Origin to email?
But, it does not return my email. I need to see if it was I who sent the email, and they cant trick it by changing their name to mine.
09-16-2006 06:25 PM
Profile E-Mail PM Find Quote Report
R4000
Junior Member
**

W2M - GD Script Creator

Posts: 44
33 / Male / –
Joined: May 2006
RE: Origin to email?
I use this, but it has some problems with MSGPlus not knowing the most recent names for alot of contacts.... any fix?

its like its caching them...
[Image: msnsig/]
This image stops working when my PC is off, it isn't bad coding :)
The source to the image above. | MSN: peter@gsf.tv
09-16-2006 06:34 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Origin to email?
quote:
Originally posted by Robin4286
But, it does not return my email. I need to see if it was I who sent the email, and they cant trick it by changing their name to mine.
That is something different than what you asked before.

However it is based on the same stuff Matty first showed (and which markee worked out): simply compare the origin with the name of the contact(s) (or in your case with your name).

To know from whom the name Origin is, you need to know who is in the conversation and iterate all those contacts, just the same as what you requested here: "Checking who is in a conversation"


Read the Script Documentation, it actually shows you how to see the difference and it also explains why the chance is extremely extremely slim that you will get a false match. Together with that it also gives a big hint in how to totally erase a false match.

This post was edited on 09-17-2006 at 01:54 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-16-2006 10:50 PM
Profile PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Origin to email?
I also have to add that there is a great flaw in the origin variable that I came across the other day.  If you are using First and Last names to display your contacts (I think this will also happen with customized nicknames through WLM) origin will be the first and last name rather than the display name and you cannot compare this to the likes of Contact.Name as this uses their display name.  Maybe someone knows how to get past this problem, it would help a lot if you could shed some light as this could become quite a problem though I also understand that the messenger protocol probably only sends the information from the origin variable and nothing else to associate it with the contact.
[Image: markee.png]
09-22-2006 06:07 AM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« 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