static TnyMsg *
find_message_by_url (const char *uri, TnyAccount **ac_out)
{
-
ModestTnyAccountStore *astore;
TnyAccount *account;
TnyFolder *folder;
TnyMsg *msg;
-
+ GError *err = NULL;
account = NULL;
msg = NULL;
folder = NULL;
if (astore == NULL) {
return NULL;
}
-
- g_debug ("Got AccountStore, lets go");
account = tny_account_store_find_account (TNY_ACCOUNT_STORE (astore),
uri);
if (account == NULL) {
+ g_debug ("%s: tny_account_store_find_account() failed.\n", __FUNCTION__);
return NULL;
}
- g_debug ("Found account");
+ g_debug ("%s: Found account.\n", __FUNCTION__);
if ( ! TNY_IS_STORE_ACCOUNT (account)) {
goto out;
}
- g_debug ("Account is store account");
+ g_debug ("%s: Account is store account.\n", __FUNCTION__);
*ac_out = account;
folder = tny_store_account_find_folder (TNY_STORE_ACCOUNT (account),
uri,
- NULL);
+ &err);
if (folder == NULL) {
+ g_debug ("%s: tny_store_account_find_folder() failed.\n", __FUNCTION__);
goto out;
}
- g_debug ("Found folder");
+ g_debug ("%s: Found folder. (%s)\n", __FUNCTION__, uri);
- msg = tny_folder_find_msg (folder, uri, NULL);
+ msg = tny_folder_find_msg (folder, uri, &err);
+
+ if (!msg) {
+ g_debug ("%s: tny_folder_find_msg() failed (%s).\n",
+ __FUNCTION__, err->message);
+ }
out:
+ if (err)
+ g_error_free (err);
+
if (account && !msg) {
g_object_unref (account);
*ac_out = NULL;
uri = (char *) user_data;
- g_debug ("Trying to find msg by url: %s", uri);
+ g_debug ("%s: Trying to find msg by url: %s", __FUNCTION__, uri);
msg = find_message_by_url (uri, &account);
g_free (uri);
if (msg == NULL) {
+ g_debug (" %s: message not found.", __FUNCTION__);
return FALSE;
}
- g_debug ("Found message");
+ g_debug (" %s: Found message.", __FUNCTION__);
header = tny_msg_get_header (msg);
account_name = tny_account_get_name (account);
osso_rpc_t * retval)
{
- g_debug ("modest_dbus_req_handler()\n");
- g_debug ("debug: method received: %s\n", method);
+ g_debug ("debug: %s\n", __FUNCTION__);
+ g_debug ("debug: %s: method received: %s\n", __FUNCTION__, method);
if (g_ascii_strcasecmp(method, MODEST_DBUS_METHOD_SEND_MAIL) == 0) {
return on_send_mail (arguments, data, retval);
DBUS_STRUCT_END_CHAR_AS_STRING
static DBusMessage *
-search_result_to_messsage (DBusMessage *reply,
+search_result_to_message (DBusMessage *reply,
GList *hits)
{
DBusMessageIter iter;
is_unread = hit->is_unread;
ts = hit->timestamp;
- g_debug ("Adding hit: %s", msg_url);
+ g_debug ("DEBUG: %s: Adding hit: %s", __FUNCTION__, msg_url);
dbus_message_iter_open_container (&array_iter,
DBUS_TYPE_STRUCT,
reply = dbus_message_new_method_return (message);
- search_result_to_messsage (reply, hits);
+ search_result_to_message (reply, hits);
if (reply == NULL) {
g_warning ("Could not create reply");