summaryrefslogtreecommitdiff
path: root/obexd/client/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'obexd/client/map.c')
-rw-r--r--obexd/client/map.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/obexd/client/map.c b/obexd/client/map.c
index e1f95f1ed..3feac9060 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -923,21 +923,22 @@ static void parse_recipient_address(struct map_msg *msg, const char *value)
static void parse_type(struct map_msg *msg, const char *value)
{
- if (g_strcmp0(msg->type, value) == 0)
- return;
-
- g_free(msg->type);
+ const char *type = NULL;
if (strcasecmp(value, "SMS_GSM") == 0)
- msg->type = g_strdup("sms-gsm");
+ type = "sms-gsm";
else if (strcasecmp(value, "SMS_CDMA") == 0)
- msg->type = g_strdup("sms-cdma");
+ type = "sms-cdma";
else if (strcasecmp(value, "EMAIL") == 0)
- msg->type = g_strdup("email");
+ type = "email";
else if (strcasecmp(value, "MMS") == 0)
- msg->type = g_strdup("mms");
- else
- msg->type = NULL;
+ type = "mms";
+
+ if (g_strcmp0(msg->type, type) == 0)
+ return;
+
+ g_free(msg->type);
+ msg->type = g_strdup(type);
g_dbus_emit_property_changed(conn, msg->path,
MAP_MSG_INTERFACE, "Type");