Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show own e-mail-address instead of "Me" (configuarable) #866

Conversation

pianoslum
Copy link
Contributor

This should fix issue #859 .

Maybe some locale-strings are obsolete by now. Should I remove them and make a commit?

@rnc
Copy link

rnc commented Sep 26, 2014

Can this be configurable - I quite like 'Me' :-)

@orschiro
Copy link
Contributor

@pianoslum

Thanks a lot for the quick fix! :)

@rnc

I agree. Maybe something in line with Friendly dates, e.g. Friendly name?

@protz
Copy link
Collaborator

protz commented Sep 27, 2014

I think there's two distinct issues here.

  • Dropping the "me" short name (possibly guarded by an option).
  • Making sure that, when hitting "show details", the email address of
    the sender is always shown, even if I am the one who sent the message
    (currently, it just shows "me").

Are you trying to solve both at the same time?

~ jonathan

On 09/27/2014 10:20 AM, Robert Orzanna wrote:

@rnc https://github.com/rnc

I agree. Maybe something in line with |Friendly dates|, e.g. |Friendly
name|?


Reply to this email directly or view it on GitHub
#866 (comment).

@orschiro
Copy link
Contributor

@protz

Is this related to what this add-on tries to solve?

https://addons.mozilla.org/en-US/thunderbird/addon/disable-you/?src=search

@protz
Copy link
Collaborator

protz commented Sep 27, 2014

Yes, the addon you mention tries to solve the first issue, although it
won't work with Conversations.

~ jonathan

On 09/27/2014 01:14 PM, Robert Orzanna wrote:

@protz https://github.com/protz

Is this related to what this add-on tries to solve?

https://addons.mozilla.org/en-US/thunderbird/addon/disable-you/?src=search


Reply to this email directly or view it on GitHub
#866 (comment).

@pianoslum
Copy link
Contributor Author

So the second issue you mentioned only occurs when sending E-Mails to oneself? I never looked into that so I will do this maybe on Monday.

Would you prefer that I add an option to switch whether "Me" or the full address is showing? Then new language-strings would be needed, I guess.

@protz
Copy link
Collaborator

protz commented Sep 27, 2014

The second issue occurs only when hitting "show details" for an email
you sent (email address of the sender not shown if sender = me). I think
we agree that issue #2 should be fixed. Here's a picture :

selection_089

The first issue can be controlled via a pref, I guess I'm ok with adding
new strings.

~ jonathan

@pianoslum pianoslum changed the title Show own e-mail-address instead of "Me" Show own e-mail-address instead of "Me" (configuarable) Sep 29, 2014
@pianoslum
Copy link
Contributor Author

The updated patch adds an option to show the full e-mail-address instead of "me". The only occation where "me" is still shown is in the tooltip, when hovering over the own address. However, the own e-mail-address is shown there under "me" so this shouldn't be a problem.

I'll have a look at the second issue soon and submit an extra patch for that.

@protz
Copy link
Collaborator

protz commented Nov 5, 2014

I've merged your pull request. Let me know if you need any pointers for
solving the second bit!

Cheers,

~ jonathan

On 09/29/2014 04:35 AM, pianoslum wrote:

The updated patch adds an option to show the full e-mail-address
instead of "me". The only occation where "me" is still shown is in the
tooltip, when hovering over the own address. However, the own
e-mail-address is shown there under "me" so this shouldn't be a problem.

I'll have a look at the second issue soon and submit an extra patch
for that.


Reply to this email directly or view it on GitHub
#866 (comment).

@protz
Copy link
Collaborator

protz commented Nov 5, 2014

Ok I just realized that this was the second bit.

The behavior for "not-me" email addresses is as follows:

  • if there is a name, display the name (e.g. "John Doe")
  • if there is no name, only an email address, display the email address "john.doe@example.com")

The behavior for "me" email addresses is as follows (without your option):

  • display "me" (with correct grammar depending on the locale)

The behavior for "me" email addresses is as follows (with your option):

  • display just the email address

I'm inclined to merge this, as people have been requesting this pretty often. I'm just wondering if we could do better by displaying, for instance, with your option:

Me (jonathan.protzenko@gmail.com)

So that the user can still easily see that the email is addressed to them... or maybe it's overkill? Thoughts?

@pianoslum
Copy link
Contributor Author

I am actually quite indifferent about this... Your solution could be the best of both worlds (even without an extra option), but I'd like to hear the opinion of the people who asked for this fix!

@protz
Copy link
Collaborator

protz commented Nov 5, 2014

You're right, that solution would work and would save the need for an
extra option. We could say that :

  • if there's only one email identity, then always show "Me"
  • otherwise, if number of identities > 1, show "Me (me@example.com)".

~ jonathan

On 11/05/2014 01:00 PM, pianoslum wrote:

I am actually quite indifferent about this... Your solution could be
the best of both worlds (even without an extra option), but I'd like
to hear the opinion of the people who asked for this fix!


Reply to this email directly or view it on GitHub
#866 (comment).

@orschiro
Copy link
Contributor

orschiro commented Nov 7, 2014

  • if there's only one email identity, then always show "Me" - otherwise, if number of identities > 1, show "Me (me@example.com)".

Very smart solution. I support it. Thanks for the efforts.

@pianoslum
Copy link
Contributor Author

How can I get the number of registered identities?
I tried gIdentities.length and Object.keys(gIdentities).length but this returned undefined.

Edit:
Sorry, Object.keys(gIdentities).length returns a value. But in my case it is 2 although I only have one address. Is this because ["default"] is counted as well? Can one assume that Object.keys(gIdentities).length - 1 returns the number of own addresses?

@protz
Copy link
Collaborator

protz commented Nov 8, 2014

Good point.

gIdentities is in modules/stdlib/misc.js; I'm not sure the API is
very-well designed. In particular, there's a "default" key, as well as
one key for each email address that maps to an identity. There are also
identities without email addresses (yes, this exists).

A call to fillIdentities has to be made on startup, which means that if
a user adds an identity in the meanwhile, Conversations won't pick it up.

I suggest you create a new function in stdlib called allIdentities()
that returns the list of all known identities, that is, a list of
Ci.nsIMsgIdentity, or possibly a pair of a possibly-null email address
and a Ci.nsIMsgIdentity. The function would take some options (e.g.
useNntpIdentities, which would default to false). allIdentities().length
would be what you want here.

gIdentities would then be marked as deprecated.

Let me know if that's asking too much and I'll take care of it. The
function is very similar to fillIdentities.

~ jonathan

On 11/07/2014 08:29 PM, pianoslum wrote:

How can I get the number of registered identities?
I tried gIdentities.length and Object.keys(gIdentities).length but
this returned /undefined/.


Reply to this email directly or view it on GitHub
#866 (comment).

@pianoslum
Copy link
Contributor Author

Well I can try... I'll just ask when I'm stuck ;)
How do you think should we mark the default identity (should we at all)?
What is Nntp anyway?

@protz
Copy link
Collaborator

protz commented Nov 8, 2014

Maybe you could return a list of objects :

{ isDefault: bool, identity: nsIMsgIdentity }

(the email property would then be accessible as x.identity.email)

You can also export a second function :

function getDefaultIdentity() {
return allIdentities().find(function (x) x.isDefault);
}

(Using the new experimental function-syntax and Array.prototype.find)

Nntp is newsgroups. We usually don't want these identities in the
context of Conversations as they are used for replying to newsgroups,
not emails.

~ jonathan

On 11/08/2014 07:47 AM, pianoslum wrote:

Well I can try... I'll just ask when I'm stuck ;)
How do you think should we mark the default identity (should we at all)?
What is Nntp anyway?


Reply to this email directly or view it on GitHub
#866 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants