Scripting Bugs... - 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: WLM Plus! Bug Reports (/forumdisplay.php?fid=7)
+----- Thread: Scripting Bugs... (/showthread.php?tid=69481)
Scripting Bugs... by NanaFreak on 12-14-2006 at 03:34 AM
markee and i were scripting Message Customizer! Live and when markee put stuff onto my computer that work perfect on his it would work on mine. we eventually found what the error was. it is:
code: Messenger.MyContacts.GetContact("EMIAL@yahoo.com").Name
and the debugger comes up with:
code: Error: Object required.
Line: LINE. Code: -2146827864.
i was just wondering if you would be able to look into this for me. we think it was plus! having troubles trying to make the contact object and this is the first time this has happened to us so we weren't entirely sure. has anyone else had this trouble?
thanks NanaFreak
RE: Scripting Bugs... by Felu on 12-14-2006 at 10:20 AM
Verified. Its only with all yahoo network contacts.
RE: Scripting Bugs... by Patchou on 12-14-2006 at 10:36 PM
Thank you for reporting, that will be fixed in the next version. Meanwhile, to make it work, just prefix the email with "yahoo:" so that "contact@yahoo.com" becomes "yahoo:contact@yahoo.com" and it will work (it will also continue to work in future versions).
RE: Scripting Bugs... by markee on 12-15-2006 at 03:59 AM
Thanks Patchou! Though I must tell you that I had to adjust what you said a little to get it to work. instead of prefixing the email address with "yahoo:" it needed to be "Yahoo:", its a shame that one capitalization makes such a difference. Thanks though, I hope this detail helps other people out too .
RE: Scripting Bugs... by Felu on 12-15-2006 at 11:03 AM
Just saw (!M) with yahoo contacts becomes yahoo:contact@yahoo.com . And i like the idea that both yahoo:contact@yahoo.com and contact@yahoo.com will work. It is easy to identify Yahoo network contacts. But (!M) should only return contact@yahoo.com .
RE: Scripting Bugs... by CookieRevised on 12-15-2006 at 02:36 PM
So, wait...
if a Yahoo contact triggers an event (eg: contactsignin), or when you get the email from the Contact object, the email will always be prefixed with "Yahoo:" ?
If so, it would mean that many scripts need to be updated and maybe will even break...
PS: I can't test this since I don't have any yahoo contacts, hence my question here.
RE: Scripting Bugs... by Felu on 12-15-2006 at 02:51 PM
quote: Originally posted by CookieRevised
if a Yahoo contact triggers an event (eg: contactsignin), or when you get the email from the Contact object, the email will always be prefixed with "Yahoo:" ?
Tested. They are prefixed with a yahoo: and not Yahoo: . And Messenger.CreateChat("contact@yahoo.com"); does not work(not the right contact, though same email) but Messenger.CreateChat("yahoo:contact@yahoo.com"); does.
RE: Scripting Bugs... by CookieRevised on 12-15-2006 at 05:18 PM
So we have two contacts with same email but different networks (as this is possible according to the plus! scripting docs):
What will happen when you do createchat() or getcontact() with just the email in that case? Open a chat and get the contact from the MSN network?
And since both emails exist, we also can't check for the .Network, because, what contact is meant with getcontact("e@mail.com")? Or, to put it in another way, to get the correct network for the contact, we _need_ to prefix the email with "yahoo". But then again, since we prefix it with yahoo, we already know it is a yahoo contact...
And let's say we have a bunch of email addresses (given by the user or whatever), and we want to know which emails are in our list and what the network is for them.
To get _all_ contact objects from those emails we actually need to call getcontact() twice for each email (once with and once without the prefix)? Because:
1) for a yahoo email, and no same msn email exist, calling getcontact("e@mail.com") will not return null, so we have a contact object to get the network
2) for a yahoo email, and same msn email exists, calling getcontact("e@mail.com") will also not return null, but it will return the wrong contact....
So we _need_ to call getcontact() twice, with and without the prefix....
-----
Another question: How is it actually possible to have 2 of the same emails in Messenger.MyContacts but each with a different network? Does that mean when one signs in with his account in Messenger, he can also sign in with that same email address in yahoo messenger?
-----
And thus since Contact.Email will always give only the email without the possible prefix, every script which uses for example if (Contact.Email !== Messenger.MyEmail) to make sure something isn't done with our own account (and that is used a lot in many scripts!), is no good and will fail since there is a possebility that someone made a yahoo account with that email...
Aka Messenger.MyEmail isn't always our own email address, but might be the email of someone else too!
So, the only correct way to check if a contact object _is_ our own is something like:
if (Contact.Email === Messenger.MyEmail && Contact.Network === 1) { // Contact = us }
?
....
major confussions here
PS: though any help is majorly appriciated, those who want to try and answer these questions or clarify and explain something, make absolutely sure you 100% know what you're talking about and that it is 100% correct what you're saying as it is already confussing enough as it is
RE: Scripting Bugs... by Menthix on 12-15-2006 at 05:26 PM
quote: Originally posted by CookieRevised
Does that mean when one signs in with his account in Messenger, he can also sign in with that same email address in yahoo messenger?
No, but you can signin with your Yahoo address in YIM and use the Yahoo address with a .Net Passport so you can signin to WLM with the same address at the same time. And I believe its possible to have a address added for both of those networks on your contact list.
RE: Scripting Bugs... by Patchou on 12-15-2006 at 06:10 PM
(!M) fixed for yahoo contacts.
I'll add some information about the "yahoo:" prefix in the documentation. Remember that it is pretty rare to have two contacts with the same email but on two networks, however, I agree this may happen and Messenger Plus! Live was designed to work properly in such cases.
For scripts, the problem shouldn't be that big... if you have the email of a contact, you got it from somewhere and this somewhere will generally be a Contact object that has the Network property. By default, if no "yahoo:" prefix is added, GetContact() will search first for MSN contacts, then for Yahoo ones. I will fix OpenChat() the same way.
RE: Scripting Bugs... by CookieRevised on 12-15-2006 at 06:17 PM
Ah, thanks.....
but quote: Originally posted by Patchou
For scripts, the problem shouldn't be that big... if you have the email of a contact, you got it from somewhere and this somewhere will generally be a Contact object that has the Network property.
Yes, but the problem in many (if not all?) scripts dealing with emails is that quite often the email is stored somewhere in a variable or used as id and by the time it is checked upon again, the object is already long gone.
Aka: I haven't seen a single script (yet) which also stores the network together with the email...
PS: additional question which I can't check upon: can you send files from MSNMSGR to YIM?
RE: Scripting Bugs... by Patchou on 12-15-2006 at 06:23 PM
no idea about sending files, never tried... I'd guess so?
As for storing the network, that's true and that's also why I just fixed the two functions above to automatically take care of it whenever possible. I'll update the doc to specify that in case of doubt, Network should be checked and "yahoo:" should be added in front of the email for future reference, if you want to be 100% absolutely sure you always refer to the proper contact.
RE: Scripting Bugs... by CookieRevised on 12-15-2006 at 09:57 PM
quote: Originally posted by Patchou
no idea about sending files, never tried... I'd guess so?
just tested it, apparently not... neither vice versa...
quote: Originally posted by Patchou
As for storing the network, that's true and that's also why I just fixed the two functions above to automatically take care of it whenever possible. I'll update the doc to specify that in case of doubt, Network should be checked and "yahoo:" should be added in front of the email for future reference, if you want to be 100% absolutely sure you always refer to the proper contact.
Though this will 'break' stuff in a similar fashion actually...
eg: I have a function which does something to contacts, I get the email from an event so it will always be prefixed or not, according to the network.
But when I use GetContact(sEmail) with this correctly formatted email (not prefixed for msn network), it might return a yahoo contact nevertheless...
This means that all scripts using something like this are again buggy... (which can be fixed of course, but nevertheless something for script developpers to watch out for...)
RE: Scripting Bugs... by Patchou on 12-16-2006 at 12:35 AM
well no... as I said, no prefix = msn by default so using GetContact() by using a "yahoo:" prefix for Yahoo contacts or nothing for msn contacts will always work as intended.
RE: Scripting Bugs... by ahmetgns on 10-29-2008 at 11:20 PM
Bump!
The Plus! commands which can be used with contact parameters like /block <contact's email> cannot be used for Yahoo! contacts unless you prefix the email with yahoo: . I know if there are two contacts from different networks then Plus! cannot know which one user is refering to. So it must display the "Choose a contact" window to let the user to choose one, otherwise it must do the action with the unique contact with that email address without asking anything.
Also in contact lists of Messenger Plus! windows like Contact List Clean-Up or Contacts on Desktop, when you sort the list by e-mail addresses, the Yahoo! contacts appears in between Z & W which led me to think Plus! cannot handle Yahoo! contacts at first when I was looking for one Yahoo! contact with address starting with "A".
|