You are here

function slack_delete_file in Slack 7

Deletes file from slack.

Parameters

array $file: Array with file info, that was get from slack_get_files_list().

1 string reference to 'slack_delete_file'
slack_cron_queue_info in ./slack.module
Implements hook_cron_queue_info().

File

./slack.module, line 133
Main module file, only hooks are allowed here.

Code

function slack_delete_file(array $file) {
  $delete = slack_send_request('files.delete', array(
    'file' => $file['id'],
  ));
  if ($delete['ok'] == TRUE) {
    watchdog('Slack', '@fid (@filename) was deleted via cron.', array(
      '@fid' => $file['id'],
      '@filename' => $file['name'],
    ));
  }
  else {
    watchdog('Slack', '@fid (@filename) not deleted', array(
      '@fid' => $file['id'],
      '@filename' => $file['name'],
    ), WATCHDOG_NOTICE, $file['permalink']);
  }
}