summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2013-05-27 14:49:31 +0200
committerXavier Claessens <xavier.claessens@collabora.co.uk>2013-05-27 14:49:31 +0200
commit83723921f8d9d59164f8046e30da10f2706b3417 (patch)
treed3b0111fd80594a10979f2740798d9bd642f7824
parente91b3531384e1e75abdd039bc61a89c186f2b373 (diff)
parentae048ead88ae7e65372093d92af0cbedbf7d5c17 (diff)
downloadtelepathy-haze-83723921f8d9d59164f8046e30da10f2706b3417.tar.gz
Merge branch 'telepathy-haze-0.6'
Conflicts: src/im-channel.c
-rw-r--r--configure.ac3
-rw-r--r--src/connection-aliasing.c5
-rw-r--r--src/connection-avatars.c7
-rw-r--r--src/connection-mail.c4
-rw-r--r--src/connection-presence.c3
-rw-r--r--src/connection.c4
-rw-r--r--src/contact-list.c18
-rw-r--r--src/im-channel-factory.c11
-rw-r--r--src/im-channel.c34
-rw-r--r--src/media-backend.c2
-rw-r--r--src/media-channel.c44
-rw-r--r--src/media-manager.c2
-rw-r--r--src/media-stream.c2
-rw-r--r--src/protocol.c6
14 files changed, 107 insertions, 38 deletions
diff --git a/configure.ac b/configure.ac
index c0e50a7..07e3c8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,8 @@ TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test x$release = xno],
format-security \
init-self],
[missing-field-initializers \
- unused-parameter])
+ unused-parameter \
+ deprecated-declarations])
AC_SUBST(ERROR_CFLAGS)
AC_CHECK_HEADERS_ONCE([libintl.h])
diff --git a/src/connection-aliasing.c b/src/connection-aliasing.c
index 8400e59..5a5a276 100644
--- a/src/connection-aliasing.c
+++ b/src/connection-aliasing.c
@@ -247,7 +247,7 @@ set_aliases_foreach (gpointer key,
{
DEBUG ("can't set alias for %s to \"%s\": not on contact list",
bname, new_alias);
- g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED,
+ g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"can't set alias for %s to \"%s\": not on contact list",
bname, new_alias);
}
@@ -288,7 +288,7 @@ haze_connection_set_aliases (TpSvcConnectionInterfaceAliasing *self,
if (!can_alias (conn))
{
- g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"You can't set aliases on this protocol");
dbus_g_method_return_error (context, error);
g_error_free (error);
@@ -355,6 +355,7 @@ blist_node_aliased_cb (PurpleBlistNode *node,
aliases);
g_ptr_array_free (aliases, TRUE);
+ tp_handle_unref (contact_handles, handle);
}
void
diff --git a/src/connection-avatars.c b/src/connection-avatars.c
index 1042938..d1b2289 100644
--- a/src/connection-avatars.c
+++ b/src/connection-avatars.c
@@ -378,7 +378,7 @@ haze_connection_request_avatar (TpSvcConnectionInterfaceAvatars *self,
else
{
DEBUG ("handle %u has no avatar", contact);
- g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"handle %u has no avatar", contact);
@@ -455,7 +455,7 @@ haze_connection_set_avatar (TpSvcConnectionInterfaceAvatars *self,
if (max_filesize > 0 && icon_len > max_filesize)
{
- g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"avatar is %" G_GSIZE_FORMAT "B, "
"but the limit is %" G_GSIZE_FORMAT "B",
icon_len, max_filesize);
@@ -484,7 +484,7 @@ haze_connection_set_avatar (TpSvcConnectionInterfaceAvatars *self,
if (!acceptable_mime_type)
{
- g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"'%s' is not a supported MIME type", mime_type);
dbus_g_method_return_error (context, error);
@@ -547,6 +547,7 @@ buddy_icon_changed_cb (PurpleBuddy *buddy,
tp_svc_connection_interface_avatars_emit_avatar_updated (conn, contact,
token);
+ tp_handle_unref (contact_repo, contact);
g_free (token);
}
diff --git a/src/connection-mail.c b/src/connection-mail.c
index 9b71c9d..475e652 100644
--- a/src/connection-mail.c
+++ b/src/connection-mail.c
@@ -70,7 +70,7 @@ haze_connection_mail_request_inbox_url (
HazeSvcConnectionInterfaceMailNotification *iface,
DBusGMethodInvocation *context)
{
- GError e = {TP_ERROR, TP_ERROR_NOT_IMPLEMENTED,
+ GError e = {TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"LibPurple does not provide Inbox URL"};
dbus_g_method_return_error (context, &e);
}
@@ -87,7 +87,7 @@ haze_connection_mail_request_mail_url (
if (!G_VALUE_HOLDS_STRING (in_url_data))
{
- GError e = {TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ GError e = {TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"Wrong type for url-data"};
dbus_g_method_return_error (context, &e);
return;
diff --git a/src/connection-presence.c b/src/connection-presence.c
index 74ba730..3c635e5 100644
--- a/src/connection-presence.c
+++ b/src/connection-presence.c
@@ -184,7 +184,7 @@ _get_contact_statuses (GObject *obj,
{
DEBUG ("[%s] %s isn't on the blist, ergo no status!",
conn->account->username, bname);
- g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"Presence for %u unknown; subscribe to them first", handle);
g_hash_table_destroy (status_table);
status_table = NULL;
@@ -242,6 +242,7 @@ update_status (PurpleBuddy *buddy,
tp_presence_mixin_emit_one_presence_update (G_OBJECT (conn), handle,
tp_status);
+ tp_handle_unref (handle_repo, handle);
}
static void
diff --git a/src/connection.c b/src/connection.c
index 5518214..ae15e3a 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -394,7 +394,7 @@ set_option (
* constructors can't fail.
*
* Returns: %TRUE if the account was successfully created and hooked up;
- * %FALSE with @error set in the TP_ERROR domain if the account
+ * %FALSE with @error set in the TP_ERRORS domain if the account
* already existed or another error occurred.
*/
gboolean
@@ -410,7 +410,7 @@ haze_connection_create_account (HazeConnection *self,
if (purple_accounts_find (priv->username, priv->prpl_id) != NULL)
{
- g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"a connection already exists to %s on %s", priv->username,
priv->prpl_id);
return FALSE;
diff --git a/src/contact-list.c b/src/contact-list.c
index 13bf348..c9f069b 100644
--- a/src/contact-list.c
+++ b/src/contact-list.c
@@ -193,7 +193,10 @@ haze_contact_list_dup_contacts (TpBaseContactList *cl)
purple_buddy_get_name (sl_iter->data), NULL, NULL);
if (G_LIKELY (handle != 0))
- tp_handle_set_add (handles, handle);
+ {
+ tp_handle_set_add (handles, handle);
+ tp_handle_unref (contact_repo, handle);
+ }
}
g_slist_free (buddies);
@@ -308,6 +311,8 @@ buddy_added_cb (PurpleBuddy *buddy, gpointer unused)
group_name = purple_group_get_name (purple_buddy_get_group (buddy));
tp_base_contact_list_one_contact_groups_changed (
(TpBaseContactList *) contact_list, handle, &group_name, 1, NULL, 0);
+
+ tp_handle_unref (contact_repo, handle);
}
static void
@@ -357,6 +362,8 @@ buddy_removed_cb (PurpleBuddy *buddy, gpointer unused)
tp_base_contact_list_one_contact_removed (
(TpBaseContactList *) contact_list, handle);
}
+
+ tp_handle_unref (contact_repo, handle);
}
@@ -378,11 +385,18 @@ static void
remove_pending_publish_request (HazeContactList *self,
TpHandle handle)
{
+ HazeConnection *conn = self->priv->conn;
+ TpBaseConnection *base_conn = TP_BASE_CONNECTION (conn);
+ TpHandleRepoIface *handle_repo =
+ tp_base_connection_get_handles (base_conn, TP_HANDLE_TYPE_CONTACT);
+
gpointer h = GUINT_TO_POINTER (handle);
gboolean removed;
removed = g_hash_table_remove (self->priv->pending_publish_requests, h);
g_assert (removed);
+
+ tp_handle_unref (handle_repo, handle);
}
void
@@ -725,7 +739,7 @@ haze_contact_list_prep_remove_from_group (HazeContactList *self,
if (default_group == group)
{
- g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"Contacts can't be removed from '%s' unless they are in "
"another group", group->name);
return FALSE;
diff --git a/src/im-channel-factory.c b/src/im-channel-factory.c
index 3fb9824..44df761 100644
--- a/src/im-channel-factory.c
+++ b/src/im-channel-factory.c
@@ -457,6 +457,14 @@ haze_create_conversation (PurpleConversation *conv)
static void
haze_destroy_conversation (PurpleConversation *conv)
{
+ PurpleAccount *account = purple_conversation_get_account (conv);
+
+ HazeImChannelFactory *im_factory =
+ ACCOUNT_GET_HAZE_CONNECTION (account)->im_factory;
+ TpBaseConnection *base_conn = TP_BASE_CONNECTION (im_factory->priv->conn);
+ TpHandleRepoIface *contact_repo =
+ tp_base_connection_get_handles (base_conn, TP_HANDLE_TYPE_CONTACT);
+
HazeConversationUiData *ui_data;
DEBUG ("(PurpleConversation *)%p destroyed", conv);
@@ -468,6 +476,7 @@ haze_destroy_conversation (PurpleConversation *conv)
ui_data = PURPLE_CONV_GET_HAZE_UI_DATA (conv);
+ tp_handle_unref (contact_repo, ui_data->contact_handle);
if (ui_data->resend_typing_timeout_id)
g_source_remove (ui_data->resend_typing_timeout_id);
@@ -587,7 +596,7 @@ haze_im_channel_factory_request (HazeImChannelFactory *self,
if (require_new)
{
tp_channel_manager_emit_request_failed (self, request_token,
- TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Channel already exists");
+ TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "Channel already exists");
}
else
{
diff --git a/src/im-channel.c b/src/im-channel.c
index d374491..3a5a55c 100644
--- a/src/im-channel.c
+++ b/src/im-channel.c
@@ -98,10 +98,15 @@ haze_im_channel_close (TpSvcChannel *iface,
{
if (priv->initiator != priv->handle)
{
+ TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
+ (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+
g_assert (priv->initiator != 0);
g_assert (priv->handle != 0);
+ tp_handle_unref (contact_repo, priv->initiator);
priv->initiator = priv->handle;
+ tp_handle_ref (contact_repo, priv->initiator);
}
tp_message_mixin_set_rescued ((GObject *) self);
@@ -278,7 +283,7 @@ haze_im_channel_set_chat_state (TpSvcChannelInterfaceChatState *self,
{
case TP_CHANNEL_CHAT_STATE_GONE:
DEBUG ("The Gone state may not be explicitly set");
- g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"The Gone state may not be explicitly set");
break;
case TP_CHANNEL_CHAT_STATE_INACTIVE:
@@ -293,7 +298,7 @@ haze_im_channel_set_chat_state (TpSvcChannelInterfaceChatState *self,
break;
default:
DEBUG ("Invalid chat state: %u", state);
- g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"Invalid chat state: %u", state);
}
@@ -351,7 +356,7 @@ haze_im_channel_send (GObject *obj,
if (tp_message_count_parts (message) != 2)
{
- error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ error = g_error_new (TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"messages must have a single plain-text part");
goto err;
}
@@ -365,14 +370,14 @@ haze_im_channel_send (GObject *obj,
if (tp_strdiff (content_type, "text/plain"))
{
- error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ error = g_error_new (TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"messages must have a single plain-text part");
goto err;
}
if (text == NULL)
{
- error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ error = g_error_new (TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"message body must be a UTF-8 string");
goto err;
}
@@ -396,7 +401,7 @@ haze_im_channel_send (GObject *obj,
* support TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE.
*/
default:
- error = g_error_new (TP_ERROR, TP_ERROR_NOT_IMPLEMENTED,
+ error = g_error_new (TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"unsupported message type: %u", type);
goto err;
}
@@ -564,6 +569,7 @@ haze_im_channel_constructor (GType type, guint n_props,
GObject *obj;
HazeIMChannel *chan;
HazeIMChannelPrivate *priv;
+ TpHandleRepoIface *contact_handles;
TpBaseConnection *conn;
TpDBusDaemon *bus;
@@ -573,7 +579,11 @@ haze_im_channel_constructor (GType type, guint n_props,
priv = chan->priv;
conn = (TpBaseConnection *) (priv->conn);
+ contact_handles = tp_base_connection_get_handles (conn,
+ TP_HANDLE_TYPE_CONTACT);
+ tp_handle_ref (contact_handles, priv->handle);
g_assert (priv->initiator != 0);
+ tp_handle_ref (contact_handles, priv->initiator);
tp_message_mixin_init (obj, G_STRUCT_OFFSET (HazeIMChannel, messages),
conn);
@@ -594,11 +604,20 @@ haze_im_channel_dispose (GObject *obj)
{
HazeIMChannel *chan = HAZE_IM_CHANNEL (obj);
HazeIMChannelPrivate *priv = chan->priv;
+ TpBaseConnection *conn = (TpBaseConnection *) priv->conn;
+ TpHandleRepoIface *contact_handles = tp_base_connection_get_handles (conn,
+ TP_HANDLE_TYPE_CONTACT);
if (priv->dispose_has_run)
return;
priv->dispose_has_run = TRUE;
+ if (priv->handle != 0)
+ tp_handle_unref (contact_handles, priv->handle);
+
+ if (priv->initiator != 0)
+ tp_handle_unref (contact_handles, priv->initiator);
+
if (!priv->closed)
{
purple_conversation_destroy (priv->conv);
@@ -748,7 +767,8 @@ _make_message (HazeIMChannel *self,
else if (purple_message_meify (text_plain, -1))
type = TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION;
- tp_cm_message_set_sender (message, self->priv->handle);
+ tp_message_set_handle (message, 0, "message-sender", TP_HANDLE_TYPE_CONTACT,
+ self->priv->handle);
tp_message_set_uint32 (message, 0, "message-type", type);
/* FIXME: the second half of this test shouldn't be necessary but prpl-jabber
diff --git a/src/media-backend.c b/src/media-backend.c
index ec40af9..1d231e7 100644
--- a/src/media-backend.c
+++ b/src/media-backend.c
@@ -553,7 +553,7 @@ haze_media_backend_error (TpSvcMediaSessionHandler *iface,
* error message describes the only legitimate situation in which this
* could arise.
*/
- GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "call has already ended" };
+ GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "call has already ended" };
DEBUG ("no session, returning an error.");
dbus_g_method_return_error (context, &e);
diff --git a/src/media-channel.c b/src/media-channel.c
index 54c2a41..934eeb8 100644
--- a/src/media-channel.c
+++ b/src/media-channel.c
@@ -265,7 +265,7 @@ pending_stream_request_free (gpointer data)
if (p->context != NULL)
{
- GError e = { TP_ERROR, TP_ERROR_CANCELLED,
+ GError e = { TP_ERRORS, TP_ERROR_CANCELLED,
"The session terminated before the requested streams could be added"
};
@@ -609,6 +609,7 @@ haze_media_channel_constructor (GType type, guint n_props,
/* automatically add creator to channel, but also ref them again (because
* priv->creator is the InitiatorHandle) */
g_assert (priv->creator != 0);
+ tp_handle_ref (contact_handles, priv->creator);
set = tp_intset_new_containing (priv->creator);
tp_group_mixin_change_members (obj, "", set, NULL, NULL, NULL, 0,
@@ -786,6 +787,15 @@ haze_media_channel_set_property (GObject *object,
break;
case PROP_INITIAL_PEER:
priv->initial_peer = g_value_get_uint (value);
+
+ if (priv->initial_peer != 0)
+ {
+ TpBaseConnection *base_conn = (TpBaseConnection *) priv->conn;
+ TpHandleRepoIface *repo = tp_base_connection_get_handles (base_conn,
+ TP_HANDLE_TYPE_CONTACT);
+ tp_handle_ref (repo, priv->initial_peer);
+ }
+
break;
case PROP_MEDIA:
g_assert (priv->media == NULL);
@@ -957,6 +967,9 @@ haze_media_channel_dispose (GObject *object)
{
HazeMediaChannel *self = HAZE_MEDIA_CHANNEL (object);
HazeMediaChannelPrivate *priv = self->priv;
+ TpBaseConnection *conn = (TpBaseConnection *) priv->conn;
+ TpHandleRepoIface *contact_handles = tp_base_connection_get_handles (
+ conn, TP_HANDLE_TYPE_CONTACT);
if (priv->dispose_has_run)
return;
@@ -970,6 +983,15 @@ haze_media_channel_dispose (GObject *object)
g_assert (priv->closed);
+ tp_handle_unref (contact_handles, priv->creator);
+ priv->creator = 0;
+
+ if (priv->initial_peer != 0)
+ {
+ tp_handle_unref (contact_handles, priv->initial_peer);
+ priv->initial_peer = 0;
+ }
+
if (priv->media != NULL)
g_object_unref (priv->media);
priv->media = NULL;
@@ -1157,7 +1179,7 @@ haze_media_channel_remove_streams (TpSvcChannelTypeStreamedMedia *iface,
GError *e;
g_object_get (base_conn, "protocol", &name, NULL);
- g_set_error (&e, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED,
+ g_set_error (&e, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"Streams can't be removed in Haze's \"%s\" protocol's calls", name);
g_free (name);
@@ -1194,7 +1216,7 @@ haze_media_channel_remove_streams (TpSvcChannelTypeStreamedMedia *iface,
if (j >= backend_streams->len)
{
- GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"Requested stream wasn't found" };
DEBUG ("%s", e.message);
dbus_g_method_return_error (context, &e);
@@ -1239,7 +1261,7 @@ haze_media_channel_request_stream_direction (TpSvcChannelTypeStreamedMedia *ifac
DBusGMethodInvocation *context)
{
/* Libpurple doesn't have API for this yet */
- GError e = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED,
+ GError e = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"Stream direction can't be set Haze calls" };
DEBUG ("%s", e.message);
dbus_g_method_return_error (context, &e);
@@ -1305,7 +1327,7 @@ _haze_media_channel_request_contents (HazeMediaChannel *chan,
}
else
{
- g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED,
+ g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"given media type %u is invalid", media_type);
return FALSE;
}
@@ -1326,7 +1348,7 @@ _haze_media_channel_request_contents (HazeMediaChannel *chan,
gchar *name;
g_object_get (base_conn, "protocol", &name, NULL);
- g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"Streams can't be added in Haze's \"%s\" protocol's calls",
name);
@@ -1338,7 +1360,7 @@ _haze_media_channel_request_contents (HazeMediaChannel *chan,
if ((want_audio == FALSE || caps & PURPLE_MEDIA_CAPS_AUDIO) &&
(want_video == FALSE || caps & PURPLE_MEDIA_CAPS_VIDEO))
{
- g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"Member does not have the desired audio/video capabilities");
return FALSE;
}
@@ -1420,7 +1442,7 @@ media_channel_request_streams (HazeMediaChannel *self,
if (peer != contact_handle)
{
- g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"cannot add streams for %u: this channel's peer is %u",
contact_handle, peer);
goto error;
@@ -1559,7 +1581,7 @@ haze_media_channel_add_member (GObject *obj,
if (peer != handle)
{
- g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"handle %u cannot be added: this channel's peer is %u",
handle, peer);
return FALSE;
@@ -1589,7 +1611,7 @@ haze_media_channel_add_member (GObject *obj,
/* is the call on hold? */
if (priv->hold_state != TP_LOCAL_HOLD_STATE_UNHELD)
{
- g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"Can't answer a call while it's on hold");
return FALSE;
}
@@ -1608,7 +1630,7 @@ haze_media_channel_add_member (GObject *obj,
}
}
- g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"handle %u cannot be added in the current state", handle);
return FALSE;
}
diff --git a/src/media-manager.c b/src/media-manager.c
index 3df771c..fddd63a 100644
--- a/src/media-manager.c
+++ b/src/media-manager.c
@@ -478,7 +478,7 @@ haze_media_manager_requestotron (TpChannelManager *manager,
/* already checked by TpBaseConnection */
g_assert (handle == 0);
- g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED,
+ g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"A valid Contact handle must be provided when requesting a media "
"channel");
diff --git a/src/media-stream.c b/src/media-stream.c
index 7b4f29f..50dde5b 100644
--- a/src/media-stream.c
+++ b/src/media-stream.c
@@ -1345,7 +1345,7 @@ haze_media_stream_codecs_updated (TpSvcMediaStreamHandler *iface,
if (self->priv->codecs == NULL)
{
- GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"CodecsUpdated may only be called once an initial set of codecs "
"has been set" };
diff --git a/src/protocol.c b/src/protocol.c
index 639e25e..e9f848a 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -287,7 +287,7 @@ _param_filter_no_blanks (const TpCMParamSpec *paramspec,
if (*str == '\0')
{
- g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"Account parameter '%s' must not be empty",
paramspec->name);
return FALSE;
@@ -295,7 +295,7 @@ _param_filter_no_blanks (const TpCMParamSpec *paramspec,
if (strstr (str, " ") != NULL)
{
- g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"Account parameter '%s' may not contain spaces",
paramspec->name);
return FALSE;
@@ -320,7 +320,7 @@ _param_filter_string_list (const TpCMParamSpec *paramspec,
!= NULL)
return TRUE;
- g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"'%s' is not a valid value for parameter '%s'", str, paramspec->name);
return FALSE;
}