 
     $('#add-contact').click    => this.toggleForm '#add-contact-form'
     $('#remove-contact').click => this.toggleForm '#remove-contact-form'
-    $('#edit-contact').click   => this.toggleForm '#edit-contact-form'
+    $('#edit-contact').click   => this.toggleForm '#edit-contact-form', =>
+      if @currentContact
+        $('#edit-contact-jid').text @currentContact
+        $('#edit-contact-name').val @session.roster[@currentContact].name
 
     $('#add-contact-cancel').click    => this.toggleForm '#add-contact-form'
     $('#remove-contact-cancel').click => this.toggleForm '#remove-contact-form'


    $('#search-roster-text').keyup  => this.filterRoster()
    $('#search-roster-text').change => this.filterRoster()
    $('#search-roster').click =>
      this.toggleForm '#search-roster-form', => this.filterRoster()


  presence: (presence) ->
    from = presence.from.split('/')[0]
    return if from == @session.bareJid()
    if !presence.type || presence.offline
      status =
        if presence.status       then presence.status
        else if presence.offline then 'Offline'
        else if presence.away    then 'Away'
        else 'Available'
      this.eachContact from, (node) ->
        $('.status-msg', node).text status

    if presence.type == 'subscribe'
      node = $("""
