 
     dash queue, callback
 
-  getName = (delegate)->
+  getName = (delegate) ->
     { nickname, firstName, lastName } = delegate.profile.nickname
 
     name = nickname

    operation = $set : { status: 'accepted' }
    @update operation, callback

  @create = secure (client, options, callback)->
    { groupName, delegate } = client.connection

    groupName  or= 'koding'

    { emails }  = options

    name = getName delegate

    queue = emails.map (email)=>=>
      code = @generateInvitationCode email, groupName


      invite = new JInvitation {
        code
        email
        groupName
      }

      invite.save (err)->
        return callback err   if err

        options =

        default     : -> new Date

  remove$: permit 'send invitations',
    success: (client, callback) ->
      @remove callback

  accept$: secure (client, callback) ->
    { delegate } = client.connection
    @accept delegate, callback

