On 26 jun 2011, at 21:23, comm...@adium.im wrote:

> details:      http://hg.adium.im/adium-1.4/rev/89e0195da5b0
> revision:     3555:89e0195da5b0
> branch:               (none)
> author:               Evan Schoenberg
> date:         Sun Jun 26 14:22:43 2011 -0500
> 
> If the auth window closes, let the facebook account know that auth failed. 
> Also, provide a bit more information when migrating accounts: 'The new 
> version of Adium has a much more reliable Facebook Chat service. Log in to 
> use your Facebook account with Adium.'
> (transplanted from ac7aa9e12a561b4c7c4b0f841500e732b8c85e78)
> 
> diffs (224 lines):
> [...]
> @@ -91,6 +103,15 @@
>               if ([frame.dataSource.request.URL.host 
> isEqual:@"www.facebook.com"] && [frame.dataSource.request.URL.path 
> isEqual:@"/login.php"]) {
>                       //Set email and password
>                       DOMDocument *domDoc = [frame DOMDocument];
> +            
> +            if (self.isMigrating) {
> +                NSString *text = domDoc.body.innerHTML;
> +                text = [text stringByReplacingOccurrencesOfString:@"Log in 
> to use your Facebook account"
> +                                                       withString:@"The new 
> version of Adium has a much more reliable Facebook Chat service. Log in to 
> use your Facebook account"];
> +                domDoc.body.innerHTML = text;
> +            }
> +
> +            
>                       [[domDoc getElementById:@"email"] 
> setValue:self.autoFillUsername];
>                       [[domDoc getElementById:@"pass"] 
> setValue:self.autoFillPassword];
> [...]


While I understand why this was added, this is going to be quite hard to 
localize correctly. Simply wrapping the second string in AILocalizedString is 
not enough, it appears Facebook is automatically sending a localized window 
(probably using whatever is send in "Accept-Language:"), though I'm not sure we 
can assume it always returns the same language as the user is using. (maybe 
some cookies he has tell Facebook to use a different language?). Besides, it 
would require each localizer to copy that string exactly from the login window.

Is there no more reliable DOM-modifying way to do this?

To be honest, I think it's unnecessary: if we make a good blog post about it, 
make it very clear in the release notes, (hell, maybe even put the Facebook 
logo in the Sparkle changelog if we can do that) then I don't think many users 
are going to be confused about it.

It also feels a bit wrong to me to tell the user they're using this "secure 
login" and modifying it behind the scenes, but that might just be me...


Thijs

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to