 
   bareJid: -> @xmpp.jid.split('/')[0]
 
+  uniqueId: -> @xmpp.getUniqueId()
+
   avatar: (jid) ->
     card = this.loadCard(jid)
     if card && card.photo

    iq = $iq(type: 'get', id: @xmpp.getUniqueId())
      .c('query', xmlns: 'jabber:iq:roster').up()

    @xmpp.sendIQ iq, handler, handler, 5000

  sendMessage: (jid, message) ->
    stanza = $msg(to: jid, from: @xmpp.jid, type: 'chat')

    iq = $iq(type: 'get', to: jid, id: @xmpp.getUniqueId())
      .c('vCard', xmlns: 'vcard-temp').up()

    this.sendIQ iq, handler

  parseRoster: (node) ->
    $('item', node).map(-> new Contact this ).get()
