         callback new KodingError 'Account not found'
 
 
-  blockUser: secure (client, accountIdOrNickname, toDate, callback)->
+  blockUser: secure (client, accountIdOrNickname, durationMillis, callback)->
     {delegate} = client.connection
-    if delegate.can('flag', this) and accountIdOrNickname? and toDate?
+    if delegate.can('flag', this) and accountIdOrNickname? and durationMillis?
       @fetchUserByAccountIdOrNickname accountIdOrNickname, (err, {user, account})->
         return callback err if err
-        blockedDate = new Date(Date.now() + toDate)
+        blockedDate = new Date(Date.now() + durationMillis)
         account.sendNotification 'UserBlocked', { blockedDate }
         user.block blockedDate, callback
     else

  fetchGroupsWithPendingInvitations:(options, callback)->
    @fetchGroupsWithPending '', 'sent', options, callback

  fetchMyGroupInvitationStatus: secure (client, sourceId, callback)->
    return  unless @equals client.connection.delegate

    options = targetOptions: selector: status: 'pending'
    @fetchInvitationRequests {sourceId}, options, (err, requests)=>
      return callback err                if err
      return callback null, 'requested'  if requests?[0]

      options = targetOptions: selector: status: 'sent'
      @fetchInvitations {sourceId}, options, (err, invites)=>
        return callback err              if err
        return callback null, 'invited'  if invites?[0]
        return callback null, no

  cancelRequest: secure (client, group, callback)->
    options = targetOptions: selector: status: 'pending'
    @fetchInvitationRequests {sourceId: group._id}, options, (err, [request])->
      return callback err                                  if err
      return callback 'could not find invitation request'  unless request
      request.remove callback

  fetchInvitationByGroup:(group, callback)->
    options = targetOptions: selector: {status: 'sent', group: group.slug}
    @fetchInvitations {}, options, (err, [invite])->
      return callback err                          if err
      return callback 'could not find invitation'  unless invite

      JGroup = require './group'
      JGroup.one _id: group._id, (err, groupObj)->
        return callback err  if err
        callback null, invite, groupObj

  acceptInvitation: secure (client, group, callback)->
    @fetchInvitationByGroup group, (err, invite, groupObj)=>
      return callback err  if err
      groupObj.approveMember this, (err)->
        return callback err  if err
        invite.update $set:status:'accepted', callback

  ignoreInvitation: secure (client, group, callback)->
    @fetchInvitationByGroup group, (err, invite)->
      return callback err  if err
      invite.update $set:status:'ignored', callback


        as          : 'skill'
        targetType  : "JTag"

      content       :
        as          : 'creator'
        targetType  : [
