     # 3. For each identity, append the 'category/type/lang/name' to S, followed by
     # the '<' character.
 
-    S += "client/pc//#{conn.disco.identity.name}<"
+    S += "client/pc//#{conn.disco._identities[0].name}<"
 
     # 4. Sort the supported service discovery features.
     
-    features = []
-
-    for ns of conn.disco.features
-      features.push ns
+    features = conn.disco._features
     features.sort()
 
     # 5. For each feature, append the feature to S, followed by the '<' character.

  init = ( c ) ->
    conn = c
    Strophe.addNamespace 'CAPS', "http://jabber.org/protocol/caps"
    conn.disco.addNode Strophe.NS.CAPS

  addNode = (node, opts) -> conn.disco.addNode node, opts

  sendPres = -> conn.send $pres().c "c",
    xmlns: Strophe.NS.CAPS
    hash: "sha-1"
    node: conn.disco.identity.name
    ver: generateVerificationString()

  generateVerificationString = ->


# NOTE: This plugin has following dependencies:
#
# - strophe.disco.js (by François de Metz)
# - sha1.js

Strophe.addConnectionPlugin 'caps', (->
