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:
Deco
Full Member
***


Posts: 188
Reputation: 4
42 / Male / Flag
Joined: Aug 2006
RE: Origin to email?
Here's my two cents:

First off you need to compare the origin so that you don't get your own email since whenever you send a message you get a "message received" event with yourself as origin.

Secondly the code comparing Contact.name will only work if you don't have Nickname for that person. Since Contact.Name is what they use as name and Origin might be what you use as their nickname.

Thirdly this instead of getting the contacts from the chatwindow, gets the contacts from your contact list. Might be a little longer but it'll work when  you have more than one person in the chat window.

function GetContactEmail(Name) {
var Result = "";
var Contacts = Messenger.MyContacts;
    var e = new Enumerator(Contacts);
    for (;!e.atEnd();e.moveNext()) {
        var Contact = e.item();
        if(Contact.Name == Name) {
        Result = Contact.Email;
                }
    }
    return Result;
}

Just an idea :)

Have fun!
09-22-2006 09:59 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: Origin to email?
quote:
Originally posted by Deco
Thirdly this instead of getting the contacts from the chatwindow, gets the contacts from your contact list. Might be a little longer but it'll work when  you have more than one person in the chat window.

function GetContactEmail(Name) {
var Result = "";
var Contacts = Messenger.MyContacts;
    var e = new Enumerator(Contacts);
    for (;!e.atEnd();e.moveNext()) {
        var Contact = e.item();
        if(Contact.Name == Name) {
        Result = Contact.Email;
                }
    }
    return Result;
}
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)

This post was edited on 09-22-2006 at 10:56 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-22-2006 10:54 PM
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