You are here

function _support_get_filemime in Support Ticketing System 6

Same name and namespace in other branches
  1. 7 support.module \_support_get_filemime()

Retrieve MIME type of the message structure.

3 calls to _support_get_filemime()
support_client_fetch in ./support.module
Fetch mail for a specific client.
_support_get_attachments in ./support.module
Find all attachments in the current message.
_support_get_message_body_part in ./support.module

File

./support.module, line 1508
support.module

Code

function _support_get_filemime(&$structure) {
  static $primary_mime_type = array(
    'TEXT',
    'MULTIPART',
    'MESSAGE',
    'APPLICATION',
    'AUDIO',
    'IMAGE',
    'VIDEO',
    'OTHER',
  );
  $type_id = (int) $structure->type;
  if (isset($primary_mime_type[$type_id]) && !empty($structure->subtype)) {
    return $primary_mime_type[$type_id] . '/' . $structure->subtype;
  }
  return 'application/octet-stream';
}