nea_event.c 2 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7
/*
 * This file is part of the Sofia-SIP package
 *
 * Copyright (C) 2005 Nokia Corporation.
 *
 * Contact: Pekka Pessi <pekka.pessi@nokia.com>
 *
8
 * This library is free software; you can redistribute it and/or
Pekka Pessi's avatar
Pekka Pessi committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 */

Pekka Pessi's avatar
Pekka Pessi committed
25
/**@internal
Pekka Pessi's avatar
Pekka Pessi committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
 * @file nea_event.c
 * @brief Default MIME type for certain events.
 * 
 * @author Pekka Pessi <Pekka.Pessi@nokia.com>
 *
 * @date Created: Thu Dec 11 20:28:46 2003 ppessi
 */

#include "config.h"

#include <stddef.h>
#include <string.h>

char const *nea_default_content_type(char const *event)
{
  char const *template = strrchr(event, '.');

  if (strcmp(event, "presence") == 0)
    return "application/pidf+xml";
  else if (strcmp(event, "cpl") == 0)
    return "application/cpl+xml";
  else if (strcmp(event, "reg") == 0)
    return "application/reginfo+xml";
  else if (strcmp(event, "presencelist") == 0)
    return "application/cpim-plidf+xml";
  else if (strcmp(event, "message-summary") == 0)
    return "application/simple-message-summary";
  else if (template && strcmp(template, ".acl") == 0)
    return "application/vnd.nokia-acl+xml";
  else if (template && strcmp(template, ".winfo") == 0)
    return "application/watcherinfo+xml";
  else if (template && strcmp(template, ".list") == 0)
    return "application/rlmi+xml";
  else if (strcmp(event, "rlmi") == 0)
    return "application/rlmi+xml";
  else
    return NULL;
}