Closed Bug 368233 Opened 18 years ago Closed 18 years ago

The Account Wizard should support generic attributes from ISP RDF Files

Categories

(Thunderbird :: Account Manager, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird2.0

People

(Reporter: mscott, Assigned: mscott)

References

Details

(Keywords: fixed1.8.1.2)

Attachments

(1 file, 1 obsolete file)

Bug #368074 would allow ISPs to install anti-spam .sfd files along with their account configuration rdf files. As part of that bug, we want to let ISPs associate a spam server filter file with the account being created using the RDF file. The spam settings use generic attributes on nsIMsgIncomingServer. It would be useful if you could list attributes in an ISP RDF file for objects like the incoming server and the identity, and then if we are unable to assign the attribute into the actual server/identity object, we should fall back and try to set it as a generic attribute on the object instead.
Flags: blocking-thunderbird2+
Blocks: 368074
Status: NEW → ASSIGNED
Attached patch first cut at a patch (obsolete) — Splinter Review
Neil, what do you think of this approach for allowing generic incoming server and identity attributes to be set from ISP files.
Attachment #252835 - Flags: superreview?(neil)
Comment on attachment 252835 [details] [diff] [review] first cut at a patch >+ dest.setCharAttribute(attribute, src[attribute]); Since JS uses Unicode shouldn't this use setUnicharAttribute? >+ // is there a way to detect if a setter for the attribute exists on dest >+ // without relying on an exception? if (dest.__lookupSetter__("attribute")) (Unfortunately I think Components.lookupMethod only works on getters.) >+ // if we are unable to set the attribute directly, consider falling back to >+ // using the generic attribute setters >+ setGeneric = useGenericFallback; > } >+ >+ // if we were unable to set the attribute, fall back to using a generic attribute setter >+ if (setGeneric) >+ setGenericAttribute(dest, src, attribute); Instead of var setGeneric = false; try { ... } catch (e) { setGeneric = useGenericFallback; } if (setGeneric) ... you might as well write try { ... } catch (e) { if (setGeneric) ... }
Attachment #252835 - Flags: superreview?(neil) → superreview+
Thanks for the tip on using __lookupSetter__ Neil. That's what I was looking for.
Attachment #252835 - Attachment is obsolete: true
Attachment #252952 - Flags: superreview+
Attachment #252952 - Flags: approval-thunderbird2+
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1.2
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird2.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: