summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWonYoung Choi <wy80.choi@samsung.com>2012-08-31 11:18:25 +0900
committerWonYoung Choi <wy80.choi@samsung.com>2012-08-31 11:18:25 +0900
commit8951750c5a96e24dd7a117a645a3d69214159f4c (patch)
treeaf3d11cc3f0949c498af55198c901454a5fd4383
parenta98d1b4ce380ae9ceca278403a681c0b253e3932 (diff)
downloadmessages-8951750c5a96e24dd7a117a645a3d69214159f4c.tar.gz
messages-8951750c5a96e24dd7a117a645a3d69214159f4c.tar.bz2
messages-8951750c5a96e24dd7a117a645a3d69214159f4c.zip
Fix bug for getting reqId after sending a message.
-rw-r--r--packaging/capi-messaging-messages.spec2
-rw-r--r--src/messages.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/packaging/capi-messaging-messages.spec b/packaging/capi-messaging-messages.spec
index 79c4b14..3e84fdc 100644
--- a/packaging/capi-messaging-messages.spec
+++ b/packaging/capi-messaging-messages.spec
@@ -1,7 +1,7 @@
Name: capi-messaging-messages
Summary: A SMS/MMS library in Tizen Native API
Version: 0.1.0
-Release: 13
+Release: 14
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: cmake
diff --git a/src/messages.c b/src/messages.c
index cd89d6f..09ad33f 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -451,6 +451,7 @@ int messages_send_message(messages_service_h svc, messages_message_h msg, bool s
ret = msg_sms_send_message(_svc->service_h, req);
+ msg_get_int_value(req, MSG_REQUEST_REQUESTID_INT, &reqId);
msg_release_struct(&req);
}
else if (MESSAGES_TYPE_MMS == msgType)
@@ -475,6 +476,7 @@ int messages_send_message(messages_service_h svc, messages_message_h msg, bool s
ret = msg_mms_send_message(_svc->service_h, req);
+ msg_get_int_value(req, MSG_REQUEST_REQUESTID_INT, &reqId);
msg_release_struct(&req);
}
}
@@ -492,11 +494,9 @@ int messages_send_message(messages_service_h svc, messages_message_h msg, bool s
// Add callback to mapping table
_cb = (messages_sent_callback_s *)malloc(sizeof(messages_sent_callback_s));
if (NULL != _cb) {
- msg_get_int_value(req, MSG_REQUEST_REQUESTID_INT, &reqId);
_cb->req_id = reqId;
_cb->callback = (void *)callback;
_cb->user_data = user_data;
-
_svc->sent_cb_list = g_slist_append(_svc->sent_cb_list, _cb);
}
}
@@ -750,7 +750,6 @@ void _messages_sent_mediator_cb(msg_handle_t handle, msg_struct_t pStatus, void
for (i=0; i < g_slist_length(_svc->sent_cb_list); i++)
{
_cb = (messages_sent_callback_s *)g_slist_nth_data(_svc->sent_cb_list, i);
-
if (NULL != _cb && _cb->req_id == reqId)
{
ret = (status == MSG_NETWORK_SEND_SUCCESS) ?