Opened 2 years ago

Closed 2 years ago

#1487143 closed Feature Patches (fixed)

Name building in addcontact.inc

Reported by: andudi Owned by:
Priority: 5 Milestone: 0.6-beta
Component: Addressbook Version: 0.4.2
Severity: minor Keywords:
Cc:

Description (last modified by till)

Parsing the Email address for a sensefull "name" field is now too simple, thus this small patch improves to parse the following formats as supposed:

  • Firstname Surname <email@bla>
  • Surname, Firstname <email@bla>
  • Surname <email@bla>
  • <Firstname[.-_]Surname@email.bla>
  • <Surname@email.bla>

maybe other formats could be sensefull as well...
Andreas

Attachments (1)

addcontact.inc.patch (1.3 KB) - added by andudi 2 years ago.
Patch

Download all attachments as: .zip

Change History (10)

Changed 2 years ago by andudi

Patch

comment:1 Changed 2 years ago by alec

  • Resolution set to wontfix
  • Status changed from new to closed

I don't like it. Guessing the order of names is just wrong. Maybe it could be improved but not this way.

comment:2 Changed 2 years ago by thomasb

  • Milestone changed from 0.5-stable to 0.6-beta
  • Resolution wontfix deleted
  • Severity changed from normal to minor
  • Status changed from closed to reopened

Should be reviewed with the address book improvements planned for 0.6. There was another discussion about different naming schemes. Maybe worth a config option...

comment:3 follow-up: Changed 2 years ago by till

Sort of related -- do you guys think we could spread out the configuration files with 0.6? There are so many configuration options in main now that it's getting a little messy.

It would also designate a clean cut. ;-)

comment:4 Changed 2 years ago by till

  • Description modified (diff)

Update description.

comment:5 in reply to: ↑ 3 Changed 2 years ago by thomasb

Replying to till:

Sort of related -- do you guys think we could spread out the configuration files with 0.6? There are so many configuration options in main now that it's getting a little messy.

It would also designate a clean cut. ;-)

I'd suggest to reduce the config to one single file but also reading config/defaults.inc.php first. That way the local config file only needs entries that differ from the defaults. I can't remember what brought me to the idea of creating two config files actually...

comment:6 Changed 2 years ago by thomasb

Back to the initial topic: maybe this is a clear case for plugins. It's quite hard to express the interpretation of the name string in one single config option. A dedicated plugin hook would leave it open for everybody to implement their own algorithm. The attached patch could be the default implementation.

comment:7 Changed 2 years ago by alec

No. No guessing here, please. We should just display (simplified) input form to the user, before adding contact. Guessing could be used to fill initially the inputs.

comment:8 Changed 2 years ago by thomasb

Guessing is great and it satisfies the majority of users. Most of the mail clients I know don't show a dialog and their guessing is way less sophisticated than the proposed patch would be.

comment:9 Changed 2 years ago by thomasb

  • Resolution set to fixed
  • Status changed from reopened to closed

Added in [e848180a]. There's a plugin hook contact_displayname available for further refinement of the name building.

Note: See TracTickets for help on using tickets.