Origin to email? - 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 to email? (/showthread.php?tid=66302) Origin to email? by Robin4286 on 09-16-2006 at 02:46 AM 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? RE: Origin to email? by matty on 09-16-2006 at 03:41 AM
code: Your going to have to change pChatWnd to whatever the ChatWnd object is called in the function. RE: Origin to email? by Robin4286 on 09-16-2006 at 03:57 AM
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. RE: Origin to email? by cloudhunter on 09-16-2006 at 03:59 AM 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. RE: Origin to email? by CookieRevised on 09-16-2006 at 04:32 AM
quote: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: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 RE: Origin to email? by markee on 09-16-2006 at 07:27 AM
quote:Wouldn't the following code be better? code: RE: Origin to email? by Robin4286 on 09-16-2006 at 06:25 PM 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. RE: Origin to email? by R4000 on 09-16-2006 at 06:34 PM
I use this, but it has some problems with MSGPlus not knowing the most recent names for alot of contacts.... any fix? RE: Origin to email? by CookieRevised on 09-16-2006 at 10:50 PM
quote: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. RE: Origin to email? by markee on 09-22-2006 at 06:07 AM 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. RE: Origin to email? by Deco on 09-22-2006 at 09:59 PM
Here's my two cents: RE: RE: Origin to email? by CookieRevised on 09-22-2006 at 10:54 PM
quote:When you have more than one person in the chat window, simply use ChatWnd.Contacts. In fact you must use it anyways anyhow and you must check for all (even if it is only 1) contacts like that. Using the contactlist window contacts will: a) make this unneeded longer b) make the (though very remote) chance of getting a false positive much higher. Since two people can have the same name. The chance that two people have the same name is much larger in a larger list. c) will fail if a contact is in the chat window which is not in your contact list (which is quite possible in multiple contact chats) |