Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Contact Manager and fullname aliasing
@ 2007-11-22  8:57 Pierre Baillet
  2007-11-23 18:56 ` William Morgan
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Baillet @ 2007-11-22  8:57 UTC (permalink / raw)


Hi,

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: For some of my contacts,  I'd like to be able to change the #name
without adding an alias (such as rename dad at home.com to "Dad Home" and
dad at work.com to "Dad Work") in order to make the Inbox List much easier to
read.

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).

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 might want to have an alias
name "annoyingcolleague" and still have "John Doe" displayed when sending
him an email... Maybe a mix of these two ideas : allow fullname aliasing and
present all "internal" emails list in the following priority order: alias,
aliased fullname, fullname from the real email.

What do you think ?

Cheers,
-- 
Pierre Baillet <pierre at baillet.name>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/sup-talk/attachments/20071122/5bcffae0/attachment.html 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sup-talk] Contact Manager and fullname aliasing
  2007-11-22  8:57 [sup-talk] Contact Manager and fullname aliasing Pierre Baillet
@ 2007-11-23 18:56 ` William Morgan
  2007-11-24 18:38   ` Pierre Baillet
  0 siblings, 1 reply; 4+ messages in thread
From: William Morgan @ 2007-11-23 18:56 UTC (permalink / raw)


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 <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sup-talk] Contact Manager and fullname aliasing
  2007-11-23 18:56 ` William Morgan
@ 2007-11-24 18:38   ` Pierre Baillet
  2007-12-21 18:23     ` William Morgan
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Baillet @ 2007-11-24 18:38 UTC (permalink / raw)


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 <wmorgan-sup at masanjin.net> 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 <wmorgan-sup at masanjin.net>
> _______________________________________________
> sup-talk mailing list
> sup-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk
>



-- 
Pierre Baillet <pierre at baillet.name>
-------------- 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 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sup-talk] Contact Manager and fullname aliasing
  2007-11-24 18:38   ` Pierre Baillet
@ 2007-12-21 18:23     ` William Morgan
  0 siblings, 0 replies; 4+ messages in thread
From: William Morgan @ 2007-12-21 18:23 UTC (permalink / raw)


Hi Pierre,

Excerpts from Pierre Baillet's message of Sat Nov 24 10:38:49 -0800 2007:
> 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. 

Sorry for sitting on this for so long. After reviewing the patch I think
I lead you down the wrong path by suggesting an array. I've just pushed
a changeset based on your patch which accomplishes the same thing (empty
contact aliases are allowed, and contact names can be edited) while
still maintaining the mapping in two hashtables.

In contact-list-mode editing a contact is bound to both 'a' and 'i', but
in thread-view-mode it's bound to 'i' only because people fought long
and hard for 'a' to act as archive-and-kill-buffer.

Contacts whose name is edited but don't have an alias are still stored
in contacts.txt, and anything there overrides what's found in the name
cache. So there's currently no way to remove someone from there except
by editing the file by hand, but there's not much of a reason to remove
someone anyways.

Check it out and let me know what you think.

-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-21 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-22  8:57 [sup-talk] Contact Manager and fullname aliasing Pierre Baillet
2007-11-23 18:56 ` William Morgan
2007-11-24 18:38   ` Pierre Baillet
2007-12-21 18:23     ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox