From mboxrd@z Thu Jan 1 00:00:00 1970 From: pierre@baillet.name (Pierre Baillet) Date: Sat, 24 Nov 2007 19:38:49 +0100 Subject: [sup-talk] Contact Manager and fullname aliasing In-Reply-To: <1195843961-sup-2106@south> References: <6205b42d0711220057l79ecc2ect6c4a29dc5efff4ef@mail.gmail.com> <1195843961-sup-2106@south> Message-ID: <6205b42d0711241038j3f1b75e6s3ad7a2d7f4d5b316@mail.gmail.com> Hi, This is my first implementation. Interestingly enough, most of the code modified is in person.rb because this class already seems to store the full name of contacts. Can the full name stored in it be overwritten by sup when it receives new emails ? If this is the case, maybe we should add another field there to indicate that the fullname has been modified by the user and that sup shouldn't change it. I wanted to avoid to duplicate the full names between person and contact but maybe i'm too lazy... At the same time, no data migration is needed to add an extra field in the person or contact.txt:) The Contact Manager now has an Array instead of a hash. One problem might happen : duplicate aliases. How can i warm the user that the alias he just typed already exists ? This should be done in #update_alias of #alias_contact. The method contact_for aalias has been modified and now includes a grep. I don't know when this method is called, but i always take the first elements returned. What if the aalias passed as parameter yields no match ? Last method implementation yielded nil. Can this happen ? I aliased everything to "a" like before, and made sup ask for the alias and the full name (my mutt has this bound on "a" too...). Let me know what you think of all this :) -- Pierre. On Nov 23, 2007 7:56 PM, William Morgan wrote: > Hi Pierre, > > Excerpts from Pierre Baillet's message of Thu Nov 22 00:57:08 -0800 2007: > > I'd like to alter the way the ContactManager work so that it could be > > able to save contact which don't have an alias but for which the #name > > has been modified: > > Sounds great. > > > The problem is that the contact manager is not able to handle > > alias-less contacts and hence any modification to a Person during the > > run of Sup is never saved for unaliased contacts (I actually patched > > my sup to allow fullname modification before understanding that sup > > will never save these changes :p). > > I think the best solution is to alter the contact manager such that it > can handle contacts without aliases. I think it currently stores > everything as a hash from alias to Person object, so you'll have to add > an array instead. > > On the UI side, we can mimic Mutt-style alias prompts. Press 'l' and it > asks you for the person name (pre-filled with the name from the email), > and then asks you for the alias, allowing you to hit enter for none. > Something like that. > > > Another idea would be to force all displays to use aliases instead of > > real names when displaying emails. This is probably simple to > > implement because there is no need to rework on the Contact Manager, > > but i still think that "full name" (this full name is used in TO: > > headers) and "alias" (this alias is only used internally) should be > > different > > I agree that it's better that the two fields are different. > > -- > William > _______________________________________________ > sup-talk mailing list > sup-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/sup-talk > -- Pierre Baillet -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/sup-talk/attachments/20071124/157e6dd2/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: contact_manager.patch Type: application/octet-stream Size: 4344 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071124/157e6dd2/attachment.obj