Closed Bug 1477438 Opened 2 years ago Closed 2 years ago

add telephone to the tooltip in IM contacts list


(Chat Core :: XMPP, enhancement)

Not set


(Not tracked)

Instantbird 67


(Reporter: matevz.jekovec, Assigned: clokep)



(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180704192850

Steps to reproduce:

In our company, we store internal phone numbers of the users to Active Directory. For chat, we set up an XMPP server with AD authentication and we are using thunderbird chat. It would be really useful, if the telephone number is also shown among other information in the tooltip when you move the mouse over the contact.

Actual results:

The current tooltip includes userName, fullName, nickname, title, organization, email, birthday, locality, and country.

Expected results:

The tooltip should also include the telephone number.
I don't think this would be that hard to do, and it makes sense to include. It looks like all we would need to do is add the proper field to the list of displayed fields (kTooltipFields) [1].

Unfortunately, I don't know what that field is called! You can likely pull it out of the debug log if you don't know off hand. (Debug log is found via right clicking on the account in the account manager and clicking "Copy debug log" Note that this can have sensitive things in it, although passwords should be blanked out.)

Hi Patrick.

Pasting the relevant snippet of the XMPP response. Notice the <TEL><NUMBER>+xxxxxxxxx</NUMBER></TEL> inside the <vCard>. Thanks for your effort!

<iq xmlns="jabber:client" xml:lang="en" to="" from="" type="result" id="ffcac345-2e96-4b7e-a241-2d96b07df1b8">
 <vCard xmlns="vcard-temp">
  <N xmlns="vcard-temp">
   <GIVEN xmlns="vcard-temp">
   <FAMILY xmlns="vcard-temp">
   <MIDDLE xmlns="vcard-temp"/>
  <FN xmlns="vcard-temp">
   Fele-Žorž, Gašper
  <TEL xmlns="vcard-temp">
   <NUMBER xmlns="vcard-temp">
    +386 1 479 8200
  <EMAIL xmlns="vcard-temp">
   <USERID xmlns="vcard-temp">
  <URL xmlns="vcard-temp"/>
  <ORG xmlns="vcard-temp">
   <ORGNAME xmlns="vcard-temp">
    Fakulteta za računalništvo in informatiko
   <ORGUNIT xmlns="vcard-temp">
    Laboratorij za vseprisotne sisteme
  <NICKNAME xmlns="vcard-temp">
  <TITLE xmlns="vcard-temp">
  <DESC xmlns="vcard-temp"/>
  <ADR xmlns="vcard-temp">
   <REGION xmlns="vcard-temp"/>
   <LOCALITY xmlns="vcard-temp">
   <CTRY xmlns="vcard-temp">
   <PCODE xmlns="vcard-temp">
   <STREET xmlns="vcard-temp">
    Večna pot 113
Component: Instant Messaging → XMPP
Ever confirmed: true
Product: Thunderbird → Chat Core
Version: 52 Branch → 52
Attached patch Patch v1 (obsolete) — Splinter Review

This adds telephone numbers to the tooltip and adds some basic tests for parsing vCards. Unfortunately I don't seem to have any contacts that provide a telephone number.

Assignee: nobody → clokep
Attachment #9046705 - Flags: review?(florian)
Comment on attachment 9046705 [details] [diff] [review]
Patch v1

Review of attachment 9046705 [details] [diff] [review]:

The code change looks good, the low readability of the test is frustrating; I'll rs it if you can convince me writing this test in a readable way is more effort than it's worth.

::: chat/protocols/xmpp/test/test_parseVCard.js
@@ +12,5 @@
> +  if (aText)
> +    node.addText(aText);
> +  aParent.addChild(node);
> +
> +  return aParent

eslint should catch the missing semi colon here.

@@ +18,5 @@
> +
> +/*
> + * Example vCard from XEP-0054 section 3.1, example 2.
> + */
> +function get_example() {

This function is unfortunately hard to read :-/. How much effort would it take to write the XML markup in a string, and parse it the using the same parser we use for incoming stanzas?
Attachment #9046705 - Flags: review?(florian) → feedback+
Attached patch Patch v2Splinter Review

Not doing the parsing of the strings was an attempt to separate tests into better units, but you're right that starting with the raw strings is much clearer. This patch does that. I also remembered to run eslint this time. :)

The examples from XEP-0054 ( were slightly modified by adding xmlns='jabber:client'. Our XMPP parser doesn't like it if you don't include a namespace.

One weird thing about this is that it takes the last telephone number. I feel like it should be an array (or object) with additional metadata. (Note that this issue seems to also exist for email addresses, and perhaps other elements in the vCard.)

Attachment #9046705 - Attachment is obsolete: true
Attachment #9046720 - Flags: review?(florian)
Attachment #9046720 - Flags: review?(florian) → review+

Pushed by
Add telephone number to the XMPP tooltip. r=florian

Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Instantbird 67
You need to log in before you can comment on or make changes to this bug.