identifiers.md (2611B)
1 Jami identifiers 2 ---------------- 3 4 There are many identifiers in Jami. We need to unify the naming of these 5 identifiers between all implementations. This page reference various kind of 6 identifiers used in Jami with relevant examples. 7 8 - **Jami Infohash** or **Jami public key fingerprint** : a public key 9 fingerprint such as `3d1112ab2bb089370c0744a44bbbb0786418d40b` 10 - **Registered name** : a username associated to a Jami Infohash on 11 the blockchain such as `jeandupont` 12 - **URI** : a Jami or SIP URI such as 13 `ring:3d1112ab2bb089370c0744a44bbbb0786418d40b` or `ring:jeandupont` 14 or `<sip:nnnnn@host:5060>`. Must be compliant with [rfc3986](https://tools.ietf.org/html/rfc3986). If it's a SIP URI, it must be compliant with [rfc3261#19.1](https://tools.ietf.org/html/rfc3261#section-19.1). 15 - **Canonical URI** : `ring:3d1112ab2bb089370c0744a44bbbb0786418d40b` or `sip:nnnnn@host:5060`. The most simplified form of the URI. Registered name must be resolved, doesn't include <> brackets or display name. Prefixed with the scheme (`ring:` or `sip:` or `sips:`). 16 - **User ID**: registered name (preferred) or public key fingerprint. User-facing identifier for an account public key. 17 - **Display name** or **Profile name** : an editable user-defined 18 profile name such as `Jean Dupont`. 19 20 When displaying a contact: 21 22 ``` 23 _____ 24 |photo| Display name or User ID 25 |_____| User ID 26 ``` 27 28 - If Display name is empty, User ID is shown instead 29 - If both lines have the same content, only the first line is 30 displayed 31 - If no photo is available and a registered name (ring) or display name (sip) is available, the first letter of this name can be used to generate a placeholder. Otherwise a generic placeholder is used. 32 - If no photo is available, a placeholder with an Canonical URI-specific background color can be used: 33 34 ```java 35 final int[] contactColors = { 36 color.red_500, color.pink_500, 37 color.purple_500, color.deep_purple_500, 38 color.indigo_500, color.blue_500, 39 color.cyan_500, color.teal_500, 40 color.green_500, color.light_green_500, 41 color.grey_500, color.lime_500, 42 color.amber_500, color.deep_orange_500, 43 color.brown_500, color.blue_grey_500 44 }; 45 46 int generateAvatarColor(String canonicalUri) { 47 if (isEmpty(canonicalUri)) 48 return R.color.grey_500; 49 String h = md5(canonicalUri); 50 if (h == null) 51 return R.color.grey_500; 52 int colorIndex = Integer.parseInt(h.charAt(0) + "", 16); 53 return contactColors[colorIndex % contactColors.length]; 54 } 55 ``` 56 57 Color values are from the material palette: https://material.io/tools/color 58 59 60 ![références_couleurs_jami](color_reference.png)