Browse Source

XEP-0153: Clarify encoding of update hash

Jonas Wielicki 1 year ago
parent
commit
d3cc6bcf9d
1 changed files with 10 additions and 3 deletions
  1. 10
    3
      xep-0153.xml

+ 10
- 3
xep-0153.xml View File

@@ -26,6 +26,12 @@
26 26
     <url>http://www.xmpp.org/schemas/vcard-avatar.xsd</url>
27 27
   </schemaloc>
28 28
   &stpeter;
29
+  <revision>
30
+    <version>1.1</version>
31
+    <date>2018-02-26</date>
32
+    <initials>jwi</initials>
33
+    <remark>Clarify encoding of the photo hash in the presence update.</remark>
34
+  </revision>
29 35
   <revision>
30 36
     <version>1.0</version>
31 37
     <date>2006-08-16</date>
@@ -110,14 +116,15 @@
110 116
     <example caption="User&apos;s Server Acknowledges Publish"><![CDATA[
111 117
 <iq to='juliet@capulet.com' type='result' id='vc1'/>
112 118
 ]]></example>
113
-    <p>Next, the user's client computes the SHA1 hash of the avatar image data itself (not the base64-encoded version) in accordance with &rfc3174;. This hash is then included in the user's presence information as the XML character data of the &lt;photo/&gt; child of an &X; element qualified by the 'vcard-temp:x:update' namespace, as shown in the following example:</p>
119
+    <p>Next, the user's client computes the SHA1 hash of the avatar image data itself (not the base64-encoded version) in accordance with &rfc3174;. This hash is then included in the user's presence information. This is done by putting the hash encoded as hexadecimal digits as the XML character data of the &lt;photo/&gt; child of an &X; element qualified by the 'vcard-temp:x:update' namespace, as shown in the following example:</p>
114 120
     <example caption="User&apos;s Client Includes Avatar Hash in Presence Broadcast"><![CDATA[
115 121
 <presence from='juliet@capulet.com/balcony'>
116 122
   <x xmlns='vcard-temp:x:update'>
117
-    <photo>sha1-hash-of-image</photo>
123
+    <photo>01b87fcd030b72895ff8e88db57ec525450f000d</photo>
118 124
   </x>
119 125
 </presence>
120 126
 ]]></example>
127
+    <p>Note that while XML Schema defines the canonical representation of hexadecimal values to be upper-case, the historical use throughout the XMPP ecosystem has established lower-case use. Entities need to be able to process both and may prefer to emit lower-case for compatibility.</p>
121 128
     <p>The user's server then broadcasts that presence information to all contacts who are subscribed to the user's presence information.</p>
122 129
   </section2>
123 130
   <section2 topic='Contact Retrieves Avatar' anchor='retrieve'>
@@ -270,7 +277,7 @@
270 277
   <xs:element name='x'>
271 278
     <xs:complexType>
272 279
       <xs:sequence>
273
-        <xs:element name='photo' minOccurs='0' type='xs:base64Binary'/>
280
+        <xs:element name='photo' minOccurs='0' type='xs:hexBinary'/>
274 281
       </xs:sequence>
275 282
     </xs:complexType>
276 283
   </xs:element>

Loading…
Cancel
Save