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

Some typeahead fixes mostly related to distribution lists #134

Merged
merged 3 commits into from
Mar 18, 2015

Conversation

dannybaumann
Copy link

No description provided.

At least in our Exchange setup, the email addresses present in the
contact element for distribution lists aren't meaningful; the only valid
one is contained in the mailbox element. As the handling in
exchangeAbDistListDirectory.js already treats PublicDL and PrivateDL in
the same way, handle it like that in exchangeAbFolderDirectory as well.
Exception looked like this:

[Exception... "
[JavaScript Error: "this.matchCount is not a function"
{file: "file:///<...>/interfaces/exchangeAutoCompleteResult/mivExchangeAutoCompleteResult.js" line: 160}]'
[JavaScript Error: "this.matchCount is not a function"
{file: "file:///<...>/interfaces/exchangeAutoCompleteResult/mivExchangeAutoCompleteResult.js" line: 160}]' when calling method:
[mivExchangeAutoCompleteResult::typeAheadResult]"  [...]

As the called function is trivial anyway, inline it into
typeAheadResult().
@bavincen
Copy link

hello @dannybaumann Thanks a lot for you patch,
may i know the target issue
i guess address completion #118 ?

@dannybaumann
Copy link
Author

No, address completion in itself is working fine for me. The issue just is that when attempting to autocomplete distribution list names, they're shown in a weird way (the name isn't displayed, but instead a list of all recipients is shown).

The root cause for that is the that the distribution list results in our setup have the following format:

<t:Resolution xmlns:s="...">
  <t:Mailbox>
    <t:Name>[displayname]</t:Name>
    <t:EmailAddress>[name]@[domain]</t:EmailAddress>
    <t:RoutingType>SMTP</t:RoutingType>
    <t:MailboxType>PublicDL</t:MailboxType>
  </t:Mailbox>
  <t:Contact>
    <t:DisplayName>[displayname]</t:DisplayName>
    <t:EmailAddresses>
      <t:Entry Key="EmailAddress1">CCMAIL:[name] at [location]</t:Entry>
      <t:Entry Key="EmailAddress2">faxmaker:[name]@[location].[domain]</t:Entry>
      <t:Entry Key="EmailAddress3">MS:[domain]/[location]/[name]</t:Entry>
    </t:EmailAddresses>
    <t:ContactSource>ActiveDirectory</t:ContactSource>
    <t:Alias>[name]</t:Alias>
    <t:DirectoryId>[uuid]</t:DirectoryId>
  </t:Contact>
</t:Resolution>

As the mailbox record wasn't used, but the contact one instead, the primary email address was filled with the (invalid) EmailAddress1 entry, leading to the getValueAt() function in mivExchangeAutoCompleteResult.js expanding the recipient list because the address doesn't contain an @ character. That was unnecessary, as there was actual valid information in the mailbox record.
At first I wasn't sure whether that's intentional or a bug, but seeing how the _contactsFoundOk function in exchangeAbDistListDirectory.js also passes the mailbox to convertExchangeDistListToCard() I concluded it's a bug.
Another (arguably better?) alternative would be passing in the resolution record and create a common parser method in mivExchangeAbCard.js (shared between convertExchangeDistListToCard and convertExchangeContactToCard) as convertExchangeContactToCard already can deal with mailboxes, resolutions and contacts being passed in. I just didn't feel comfortable doing that change, as my domain knowledge isn't good enough (yet) to understand the subtle differences between e.g. the this.localId generations in those methods.

The other two commits were just stuff I stumbled upon during debugging the first item.

Speaking of autocompletion, I think it would be useful if the completion result showed the number of recipients if it's a distribution list, like My distribution list <[email protected]> [5 recipients]. Do you agree? If yes, I can open a separate PR for that.

@muthusuba
Copy link

@dannybaumann Thank you! We would like to test this on our setup, to make sure it doesn't break some functionality for us - we'll take a few days, please? Thanks again for the nice patch!

bavincen added a commit that referenced this pull request Mar 18, 2015
Some typeahead fixes mostly related to distribution lists
@bavincen bavincen merged commit ce15abd into Ericsson:master Mar 18, 2015
@bavincen
Copy link

Thanks!

Trim added a commit to Trim/exchangecalendar that referenced this pull request Dec 25, 2017
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.

3 participants