     # included (in accordance with XEP-0030, the category and type MUST be
     # included.
 
-    # not implemented yet
+    propertySort( ids, "category" )
+    propertySort( ids, "type" )
+    propertySort( ids, "lang" )
 
     # 3. For each identity, append the 'category/type/lang/name' to S, followed by
     # the '<' character.
 
-    S += "client/pc//#{conn.disco._identities[0].name}<"
+    for key, id of ids
+      S += "#{id.category}/#{id.type}/#{id.lang}/#{id.name}<"
 
     # 4. Sort the supported service discovery features.
-    
-    features = conn.disco._features
+
     features.sort()
 
     # 5. For each feature, append the feature to S, followed by the '<' character.

    "#{b64_sha1 S}="

  # Public API
  
  init: init
  addNode: addNode
  sendPres: sendPres
  generateVerificationString: generateVerificationString


    # 7. For each extended service discovery information form:

    #  a) Append the XML character data of the FORM_TYPE field's <value/> element,
    #     followed by the '<' character.

    # not implemented yet

