[Telepathy-commits] [telepathy-glib/master] fd.o #20096: TpContact: update for spec 0.17.18 compliance

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Feb 13 07:15:34 PST 2009


Previously, connection managers inconsistently raised NotAvailable,
InvalidHandle or InvalidArgument for bad identifiers. We've now
standardized on InvalidHandle, which TpContact wrongly treated as
fatal for the whole batch.
---
 telepathy-glib/contact.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index 7ddfc2e..dd1f346 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -894,7 +894,7 @@ contacts_context_fail (ContactsContext *c,
  * valid (it may be empty), and @failed_id_errors will map the IDs
  * that were not valid to a corresponding #GError (if the connection manager
  * complies with the Telepathy spec, it will have domain %TP_ERRORS and code
- * %TP_ERROR_NOT_AVAILABLE).
+ * %TP_ERROR_INVALID_HANDLE).
  *
  * If an unrecoverable error occurs (for instance, if @connection
  * becomes disconnected) the whole operation fails, and no contacts
@@ -2050,7 +2050,8 @@ contacts_requested_one_handle (TpConnection *connection,
       c->next_index++;
     }
   else if (error->domain == TP_ERRORS &&
-      (error->code == TP_ERROR_NOT_AVAILABLE ||
+      (error->code == TP_ERROR_INVALID_HANDLE ||
+       error->code == TP_ERROR_NOT_AVAILABLE ||
        error->code == TP_ERROR_INVALID_ARGUMENT))
     {
       g_hash_table_insert (c->request_errors,
@@ -2113,7 +2114,8 @@ contacts_requested_handles (TpConnection *connection,
         }
     }
   else if (error->domain == TP_ERRORS &&
-      (error->code == TP_ERROR_NOT_AVAILABLE ||
+      (error->code == TP_ERROR_INVALID_HANDLE ||
+       error->code == TP_ERROR_NOT_AVAILABLE ||
        error->code == TP_ERROR_INVALID_ARGUMENT))
     {
       /* One of the strings is bad. We don't know which, so split them. */
-- 
1.5.6.5




More information about the telepathy-commits mailing list