diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-04-06 13:39:23 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-04-06 13:39:23 +0000 |
commit | 86ba7b6b4aceb3aa1c7b2868a0e9682407568466 (patch) | |
tree | 6d7d604ce08a48b5f0002baf5c5cf0c0cd382c1c | |
parent | f979b544590635d51be35eb33292e3410afd89b4 (diff) |
src/: wrap long lines
41 files changed, 650 insertions, 396 deletions
diff --git a/src/capabilities.c b/src/capabilities.c index 99b5fbb20..926b1c3ea 100644 --- a/src/capabilities.c +++ b/src/capabilities.c @@ -34,8 +34,10 @@ static const Feature self_advertised_features[] = { VERSION, NS_CHAT_STATES, PRESENCE_CAP_CHAT_STATES}, { BUNDLE_VOICE_V1, NS_GOOGLE_FEAT_VOICE, PRESENCE_CAP_GOOGLE_VOICE}, - { BUNDLE_JINGLE_AUDIO, NS_JINGLE_DESCRIPTION_AUDIO, PRESENCE_CAP_JINGLE_DESCRIPTION_AUDIO}, - { BUNDLE_JINGLE_VIDEO, NS_JINGLE_DESCRIPTION_VIDEO, PRESENCE_CAP_JINGLE_DESCRIPTION_VIDEO}, + { BUNDLE_JINGLE_AUDIO, NS_JINGLE_DESCRIPTION_AUDIO, + PRESENCE_CAP_JINGLE_DESCRIPTION_AUDIO}, + { BUNDLE_JINGLE_VIDEO, NS_JINGLE_DESCRIPTION_VIDEO, + PRESENCE_CAP_JINGLE_DESCRIPTION_VIDEO}, { NULL, NULL, 0} }; @@ -78,8 +80,11 @@ capabilities_get_initial_caps () for (feat = self_advertised_features; NULL != feat->ns; feat++) { if (g_str_equal (feat->bundle, VERSION)) - /* VERSION == bundle means a fixed feature, which we always advertise */ - ret |= feat->caps; + { + /* VERSION == bundle means a fixed feature, which we always + * advertise */ + ret |= feat->caps; + } } return ret; @@ -87,7 +92,9 @@ capabilities_get_initial_caps () const CapabilityConversionData capabilities_conversions[] = { - { TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, _gabble_media_channel_typeflags_to_caps, _gabble_media_channel_caps_to_typeflags }, + { TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, + _gabble_media_channel_typeflags_to_caps, + _gabble_media_channel_caps_to_typeflags }, { NULL, NULL, NULL} }; diff --git a/src/conn-aliasing.c b/src/conn-aliasing.c index 1d1590c3f..49138cc42 100644 --- a/src/conn-aliasing.c +++ b/src/conn-aliasing.c @@ -226,10 +226,12 @@ gabble_connection_request_aliases (TpSvcConnectionInterfaceAliasing *iface, g_free (alias); - if (gabble_vcard_manager_get_cached (self->vcard_manager, handle, NULL)) + if (gabble_vcard_manager_get_cached (self->vcard_manager, handle, + NULL)) { GabbleConnectionAliasSource source; - source = _gabble_connection_get_cached_alias (self, handle, &alias); + source = _gabble_connection_get_cached_alias (self, handle, + &alias); request->vcard_requests[i] = NULL; request->aliases[i] = alias; request->pending_vcard_requests++; diff --git a/src/conn-avatars.c b/src/conn-avatars.c index ff3db6c6d..885f661a0 100644 --- a/src/conn-avatars.c +++ b/src/conn-avatars.c @@ -544,7 +544,8 @@ _set_avatar_cb1 (GabbleVCardManager *manager, } ctx->new_vcard_msg = lm_message_new (NULL, LM_MESSAGE_TYPE_UNKNOWN); - new_vcard = lm_message_node_add_child (ctx->new_vcard_msg->node, "vCard", ""); + new_vcard = lm_message_node_add_child (ctx->new_vcard_msg->node, + "vCard", ""); lm_message_node_set_attribute (new_vcard, "xmlns", NS_VCARD_TEMP); lm_message_node_steal_children (new_vcard, vcard); @@ -653,7 +654,8 @@ conn_avatars_init (GabbleConnection *conn) void conn_avatars_iface_init (gpointer g_iface, gpointer iface_data) { - TpSvcConnectionInterfaceAvatarsClass *klass = (TpSvcConnectionInterfaceAvatarsClass *) g_iface; + TpSvcConnectionInterfaceAvatarsClass *klass = + (TpSvcConnectionInterfaceAvatarsClass *) g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_avatars_implement_##x (\ klass, gabble_connection_##x) diff --git a/src/conn-presence.c b/src/conn-presence.c index bddc368bf..cb3e9490f 100644 --- a/src/conn-presence.c +++ b/src/conn-presence.c @@ -584,9 +584,11 @@ setstatuses_foreach (gpointer key, gpointer value, gpointer user_data) prio = CLAMP (g_value_get_int (priority), G_MININT8, G_MAXINT8); } - gabble_presence_update (data->conn->self_presence, resource, i, status, prio); + gabble_presence_update (data->conn->self_presence, resource, i, status, + prio); emit_one_presence_update (data->conn, base->self_handle); - data->retval = _gabble_connection_signal_own_presence (data->conn, data->error); + data->retval = _gabble_connection_signal_own_presence (data->conn, + data->error); } else { diff --git a/src/debug.c b/src/debug.c index eda75419d..0c06a77e4 100644 --- a/src/debug.c +++ b/src/debug.c @@ -41,7 +41,8 @@ void gabble_debug_set_flags_from_env () if (flags_string) { tp_debug_set_flags_from_env ("GABBLE_DEBUG"); - gabble_debug_set_flags (g_parse_debug_string (flags_string, keys, nkeys)); + gabble_debug_set_flags (g_parse_debug_string (flags_string, keys, + nkeys)); } } diff --git a/src/disco.c b/src/disco.c index eb6d7e21b..6ba6f80bb 100644 --- a/src/disco.c +++ b/src/disco.c @@ -277,7 +277,8 @@ delete_request (GabbleDiscoRequest *request) if (NULL != request->bound_object) { - g_object_weak_unref (request->bound_object, notify_delete_request, request); + g_object_weak_unref (request->bound_object, notify_delete_request, + request); } if (0 != request->timer_id) @@ -419,7 +420,8 @@ gabble_disco_request (GabbleDisco *self, GabbleDiscoType type, * @type: type of request * @jid: Jabber ID to request on * @node: node to request on @jid, or NULL - * @timeout: the time until the request fails, in milliseconds (1/1000ths of a second) + * @timeout: the time until the request fails, in milliseconds (1/1000ths of + * a second) * @callback: #GabbleDiscoCb to call on request fullfilment * @object: GObject to bind request to. the callback will not be * called if this object has been unrefed. NULL if not needed @@ -707,7 +709,8 @@ disco_items_cb (GabbleDisco *disco, item_jid = lm_message_node_get_attribute (iter, "jid"); if (NULL != item_jid && - !g_hash_table_lookup_extended (pipeline->remaining_items, item_jid, &key, &value)) + !g_hash_table_lookup_extended (pipeline->remaining_items, item_jid, + &key, &value)) { gchar *tmp = g_strdup (item_jid); DEBUG ("discovered service item: %s", tmp); @@ -832,8 +835,10 @@ services_cb (gpointer pipeline, GabbleDiscoItem *item, gpointer user_data) my_item->type = g_strdup (item->type); my_item->category = g_strdup (item->category); - my_item->features = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); - g_hash_table_foreach (item->features, service_feature_copy_one, my_item->features); + my_item->features = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, + NULL); + g_hash_table_foreach (item->features, service_feature_copy_one, + my_item->features); priv->service_cache = g_slist_prepend (priv->service_cache, my_item); } diff --git a/src/disco.h b/src/disco.h index 334f8b85e..533e4a212 100644 --- a/src/disco.h +++ b/src/disco.h @@ -81,7 +81,9 @@ struct _GabbleDisco { gpointer priv; }; -typedef void (*GabbleDiscoCb)(GabbleDisco *self, GabbleDiscoRequest *request, const gchar *jid, const gchar *node, LmMessageNode *query_result, GError* error, gpointer user_data); +typedef void (*GabbleDiscoCb)(GabbleDisco *self, GabbleDiscoRequest *request, + const gchar *jid, const gchar *node, LmMessageNode *query_result, + GError* error, gpointer user_data); GabbleDisco *gabble_disco_new (GabbleConnection *); diff --git a/src/gabble-connection.c b/src/gabble-connection.c index 7cfb7dd2f..7300e821d 100644 --- a/src/gabble-connection.c +++ b/src/gabble-connection.c @@ -176,7 +176,9 @@ struct _GabbleConnectionPrivate ((GabbleConnectionPrivate *)obj->priv) static void connection_nickname_update_cb (GObject *, TpHandle, gpointer); -static void connection_capabilities_update_cb (GabblePresenceCache *, TpHandle, GabblePresenceCapabilities, GabblePresenceCapabilities, gpointer); +static void connection_capabilities_update_cb (GabblePresenceCache *, + TpHandle, GabblePresenceCapabilities, GabblePresenceCapabilities, + gpointer); static GPtrArray * _gabble_connection_create_channel_factories (TpBaseConnection *conn) @@ -492,7 +494,8 @@ gabble_connection_class_init (GabbleConnectionClass *gabble_connection_class) parent_class->start_connecting = _gabble_connection_connect; parent_class->interfaces_always_present = interfaces_always_present; - g_type_class_add_private (gabble_connection_class, sizeof (GabbleConnectionPrivate)); + g_type_class_add_private (gabble_connection_class, + sizeof (GabbleConnectionPrivate)); object_class->dispose = gabble_connection_dispose; object_class->finalize = gabble_connection_finalize; @@ -976,14 +979,19 @@ _gabble_connection_send_with_reply (GabbleConnection *conn, return ret; } -static LmHandlerResult connection_iq_disco_cb (LmMessageHandler*, LmConnection*, LmMessage*, gpointer); -static LmHandlerResult connection_iq_unknown_cb (LmMessageHandler*, LmConnection*, LmMessage*, gpointer); -static LmHandlerResult connection_stream_error_cb (LmMessageHandler*, LmConnection*, LmMessage*, gpointer); -static LmSSLResponse connection_ssl_cb (LmSSL*, LmSSLStatus, gpointer); -static void connection_open_cb (LmConnection*, gboolean, gpointer); -static void connection_auth_cb (LmConnection*, gboolean, gpointer); -static void connection_disco_cb (GabbleDisco *, GabbleDiscoRequest *, const gchar *, const gchar *, LmMessageNode *, GError *, gpointer); -static void connection_disconnected_cb (LmConnection *, LmDisconnectReason, gpointer); +static LmHandlerResult connection_iq_disco_cb (LmMessageHandler *, + LmConnection *, LmMessage *, gpointer); +static LmHandlerResult connection_iq_unknown_cb (LmMessageHandler *, + LmConnection *, LmMessage *, gpointer); +static LmHandlerResult connection_stream_error_cb (LmMessageHandler *, + LmConnection *, LmMessage *, gpointer); +static LmSSLResponse connection_ssl_cb (LmSSL *, LmSSLStatus, gpointer); +static void connection_open_cb (LmConnection *, gboolean, gpointer); +static void connection_auth_cb (LmConnection *, gboolean, gpointer); +static void connection_disco_cb (GabbleDisco *, GabbleDiscoRequest *, + const gchar *, const gchar *, LmMessageNode *, GError *, gpointer); +static void connection_disconnected_cb (LmConnection *, LmDisconnectReason, + gpointer); static gboolean @@ -1058,8 +1066,8 @@ disconnect_callbacks (TpBaseConnection *base) lm_message_handler_unref (priv->iq_unknown_cb); priv->iq_unknown_cb = NULL; - lm_connection_unregister_message_handler (conn->lmconn, priv->stream_error_cb, - LM_MESSAGE_TYPE_STREAM_ERROR); + lm_connection_unregister_message_handler (conn->lmconn, + priv->stream_error_cb, LM_MESSAGE_TYPE_STREAM_ERROR); lm_message_handler_unref (priv->stream_error_cb); priv->stream_error_cb = NULL; } @@ -1610,7 +1618,8 @@ connection_iq_disco_cb (LmMessageHandler *handler, if (node) lm_message_node_set_attribute (result_query, "node", node); - DEBUG ("got disco request for bundle %s, caps are %x", node, self->self_presence->caps); + DEBUG ("got disco request for bundle %s, caps are %x", node, + self->self_presence->caps); features = capabilities_get_features (self->self_presence->caps); g_debug ("%s: caps now %u", G_STRFUNC, self->self_presence->caps); @@ -1784,9 +1793,9 @@ do_auth (GabbleConnection *conn) DEBUG ("authenticating with username: %s, password: <hidden>, resource: %s", priv->username, priv->resource); - if (!lm_connection_authenticate (conn->lmconn, priv->username, priv->password, - priv->resource, connection_auth_cb, - conn, NULL, &error)) + if (!lm_connection_authenticate (conn->lmconn, priv->username, + priv->password, priv->resource, connection_auth_cb, conn, NULL, + &error)) { DEBUG ("failed: %s", error->message); g_error_free (error); @@ -2223,7 +2232,8 @@ gabble_connection_advertise_capabilities (TpSvcConnectionInterfaceCapabilities * if (caps ^ save_caps) { DEBUG ("before != after, changing"); - gabble_presence_set_capabilities (pres, priv->resource, caps, priv->caps_serial++); + gabble_presence_set_capabilities (pres, priv->resource, caps, + priv->caps_serial++); DEBUG ("set caps: %x", pres->caps); } @@ -2318,7 +2328,8 @@ gabble_connection_get_capabilities (TpSvcConnectionInterfaceCapabilities *iface, if (0 == handle) { - /* FIXME report the magical channel types available on the connection itself */ + /* FIXME report the magical channel types available on the + * connection itself */ continue; } @@ -2638,8 +2649,8 @@ room_jid_disco_cb (GabbleDisco *disco, { DEBUG ("no MUC support for service name in jid %s", rvctx->jid); - error = g_error_new (TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "specified server " - "doesn't support MUC"); + error = g_error_new (TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + "specified server doesn't support MUC"); room_verify_batch_raise_error (batch, error); @@ -2732,8 +2743,8 @@ gabble_connection_request_handles (TpSvcConnection *iface, batch = room_verify_batch_new (self, context, count, names); if (!batch) { - /* an error occurred while setting up the batch, and we returned error - to dbus */ + /* an error occurred while setting up the batch, and we returned + error to dbus */ return; } @@ -2778,7 +2789,8 @@ conn_service_iface_init (gpointer g_iface, gpointer iface_data) static void capabilities_service_iface_init (gpointer g_iface, gpointer iface_data) { - TpSvcConnectionInterfaceCapabilitiesClass *klass = (TpSvcConnectionInterfaceCapabilitiesClass *)g_iface; + TpSvcConnectionInterfaceCapabilitiesClass *klass = + (TpSvcConnectionInterfaceCapabilitiesClass *)g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_capabilities_implement_##x (\ klass, gabble_connection_##x) diff --git a/src/gabble-error.h b/src/gabble-error.h index 91a5e515d..970961a2c 100644 --- a/src/gabble-error.h +++ b/src/gabble-error.h @@ -77,7 +77,8 @@ GQuark gabble_xmpp_error_quark (void); GabbleXmppError gabble_xmpp_error_from_node (LmMessageNode *error_node); GError *gabble_xmpp_error_to_g_error (GabbleXmppError error); -LmMessageNode *gabble_xmpp_error_to_node (GabbleXmppError error, LmMessageNode *parent_node, const gchar *errmsg); +LmMessageNode *gabble_xmpp_error_to_node (GabbleXmppError error, + LmMessageNode *parent_node, const gchar *errmsg); const gchar *gabble_xmpp_error_string (GabbleXmppError error); const gchar *gabble_xmpp_error_description (GabbleXmppError error); diff --git a/src/gabble-im-channel.c b/src/gabble-im-channel.c index bc99f6713..2930a1388 100644 --- a/src/gabble-im-channel.c +++ b/src/gabble-im-channel.c @@ -50,7 +50,8 @@ G_DEFINE_TYPE_WITH_CODE (GabbleIMChannel, gabble_im_channel, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, text_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL); - G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_CHAT_STATE, chat_state_iface_init)); + G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_CHAT_STATE, + chat_state_iface_init)); /* properties */ @@ -208,7 +209,8 @@ gabble_im_channel_class_init (GabbleIMChannelClass *gabble_im_channel_class) GObjectClass *object_class = G_OBJECT_CLASS (gabble_im_channel_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_im_channel_class, sizeof (GabbleIMChannelPrivate)); + g_type_class_add_private (gabble_im_channel_class, + sizeof (GabbleIMChannelPrivate)); object_class->constructor = gabble_im_channel_constructor; @@ -218,9 +220,12 @@ gabble_im_channel_class_init (GabbleIMChannelClass *gabble_im_channel_class) object_class->dispose = gabble_im_channel_dispose; object_class->finalize = gabble_im_channel_finalize; - g_object_class_override_property (object_class, PROP_OBJECT_PATH, "object-path"); - g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, "channel-type"); - g_object_class_override_property (object_class, PROP_HANDLE_TYPE, "handle-type"); + g_object_class_override_property (object_class, PROP_OBJECT_PATH, + "object-path"); + g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, + "channel-type"); + g_object_class_override_property (object_class, PROP_HANDLE_TYPE, + "handle-type"); g_object_class_override_property (object_class, PROP_HANDLE, "handle"); param_spec = g_param_spec_object ("connection", "GabbleConnection object", @@ -278,8 +283,9 @@ gabble_im_channel_dispose (GObject *object) /* Set the chat state of the channel on gone * (Channel.Interface.ChatState) */ gabble_text_mixin_send (G_OBJECT (self), - TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, 0, TP_CHANNEL_CHAT_STATE_GONE, - priv->peer_jid, NULL, priv->conn, FALSE /* emit_signal */, NULL); + TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, 0, + TP_CHANNEL_CHAT_STATE_GONE, priv->peer_jid, NULL, priv->conn, + FALSE /* emit_signal */, NULL); } tp_svc_channel_emit_closed (self); @@ -592,7 +598,8 @@ text_iface_init (gpointer g_iface, gpointer iface_data) static void chat_state_iface_init (gpointer g_iface, gpointer iface_data) { - TpSvcChannelInterfaceChatStateClass *klass = (TpSvcChannelInterfaceChatStateClass *)g_iface; + TpSvcChannelInterfaceChatStateClass *klass = + (TpSvcChannelInterfaceChatStateClass *)g_iface; #define IMPLEMENT(x) tp_svc_channel_interface_chat_state_implement_##x (\ klass, gabble_im_channel_##x) IMPLEMENT(set_chat_state); diff --git a/src/gabble-im-channel.h b/src/gabble-im-channel.h index 8be680f4b..7c5e2244c 100644 --- a/src/gabble-im-channel.h +++ b/src/gabble-im-channel.h @@ -54,15 +54,19 @@ GType gabble_im_channel_get_type (void); #define GABBLE_IM_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_IM_CHANNEL, GabbleIMChannel)) #define GABBLE_IM_CHANNEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_IM_CHANNEL, GabbleIMChannelClass)) + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_IM_CHANNEL,\ + GabbleIMChannelClass)) #define GABBLE_IS_IM_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_IM_CHANNEL)) #define GABBLE_IS_IM_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_IM_CHANNEL)) #define GABBLE_IM_CHANNEL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_IM_CHANNEL, GabbleIMChannelClass)) + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_IM_CHANNEL, \ + GabbleIMChannelClass)) -void _gabble_im_channel_receive (GabbleIMChannel *chan, TpChannelTextMessageType type, TpHandle sender, const char *from, time_t timestamp, const char *text); +void _gabble_im_channel_receive (GabbleIMChannel *chan, + TpChannelTextMessageType type, TpHandle sender, const char *from, + time_t timestamp, const char *text); void _gabble_im_channel_state_receive (GabbleIMChannel *chan, guint state); G_END_DECLS diff --git a/src/gabble-media-channel.c b/src/gabble-media-channel.c index a99811a0b..0bc9a9b8b 100644 --- a/src/gabble-media-channel.c +++ b/src/gabble-media-channel.c @@ -192,9 +192,12 @@ gabble_media_channel_constructor (GType type, guint n_props, return obj; } -static void session_state_changed_cb (GabbleMediaSession *session, GParamSpec *arg1, GabbleMediaChannel *channel); -static void session_stream_added_cb (GabbleMediaSession *session, GabbleMediaStream *stream, GabbleMediaChannel *chan); -static void session_terminated_cb (GabbleMediaSession *session, guint terminator, guint reason, gpointer user_data); +static void session_state_changed_cb (GabbleMediaSession *session, + GParamSpec *arg1, GabbleMediaChannel *channel); +static void session_stream_added_cb (GabbleMediaSession *session, + GabbleMediaStream *stream, GabbleMediaChannel *chan); +static void session_terminated_cb (GabbleMediaSession *session, + guint terminator, guint reason, gpointer user_data); /** * create_session @@ -438,7 +441,8 @@ gabble_media_channel_class_init (GabbleMediaChannelClass *gabble_media_channel_c GObjectClass *object_class = G_OBJECT_CLASS (gabble_media_channel_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_media_channel_class, sizeof (GabbleMediaChannelPrivate)); + g_type_class_add_private (gabble_media_channel_class, + sizeof (GabbleMediaChannelPrivate)); object_class->constructor = gabble_media_channel_constructor; @@ -449,13 +453,15 @@ gabble_media_channel_class_init (GabbleMediaChannelClass *gabble_media_channel_c object_class->finalize = gabble_media_channel_finalize; tp_group_mixin_class_init (object_class, - G_STRUCT_OFFSET (GabbleMediaChannelClass, group_class), - _gabble_media_channel_add_member, - gabble_media_channel_remove_member); - - g_object_class_override_property (object_class, PROP_OBJECT_PATH, "object-path"); - g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, "channel-type"); - g_object_class_override_property (object_class, PROP_HANDLE_TYPE, "handle-type"); + G_STRUCT_OFFSET (GabbleMediaChannelClass, group_class), + _gabble_media_channel_add_member, gabble_media_channel_remove_member); + + g_object_class_override_property (object_class, PROP_OBJECT_PATH, + "object-path"); + g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, + "channel-type"); + g_object_class_override_property (object_class, PROP_HANDLE_TYPE, + "handle-type"); g_object_class_override_property (object_class, PROP_HANDLE, "handle"); param_spec = g_param_spec_object ("connection", "GabbleConnection object", @@ -495,7 +501,8 @@ gabble_media_channel_class_init (GabbleMediaChannelClass *gabble_media_channel_c G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB); - g_object_class_install_property (object_class, PROP_NAT_TRAVERSAL, param_spec); + g_object_class_install_property (object_class, PROP_NAT_TRAVERSAL, + param_spec); param_spec = g_param_spec_string ("stun-server", "STUN server", @@ -523,7 +530,8 @@ gabble_media_channel_class_init (GabbleMediaChannelClass *gabble_media_channel_c G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB); - g_object_class_install_property (object_class, PROP_GTALK_P2P_RELAY_TOKEN, param_spec); + g_object_class_install_property (object_class, PROP_GTALK_P2P_RELAY_TOKEN, + param_spec); tp_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (GabbleMediaChannelClass, properties_class), @@ -606,7 +614,8 @@ gabble_media_channel_close (GabbleMediaChannel *self) if (priv->session) { - _gabble_media_session_terminate (priv->session, INITIATOR_LOCAL, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); + _gabble_media_session_terminate (priv->session, INITIATOR_LOCAL, + TP_CHANNEL_GROUP_CHANGE_REASON_NONE); } tp_svc_channel_emit_closed (self); @@ -861,7 +870,8 @@ gabble_media_channel_remove_streams (TpSvcChannelTypeStreamedMedia *iface, goto OUT; } - /* make sure we don't allow the client to repeatedly remove the same stream */ + /* make sure we don't allow the client to repeatedly remove the same + stream */ for (j = 0; j < stream_objs->len; j++) { GabbleMediaStream *tmp = g_ptr_array_index (stream_objs, j); @@ -1154,7 +1164,8 @@ gabble_media_channel_remove_member (GObject *obj, return FALSE; } - _gabble_media_session_terminate (priv->session, INITIATOR_LOCAL, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); + _gabble_media_session_terminate (priv->session, INITIATOR_LOCAL, + TP_CHANNEL_GROUP_CHANGE_REASON_NONE); /* remove the member */ set = tp_intset_new (); @@ -1312,7 +1323,10 @@ stream_state_changed_cb (GabbleMediaStream *stream, guint id; TpMediaStreamState connection_state; - g_object_get (stream, "id", &id, "connection-state", &connection_state, NULL); + g_object_get (stream, + "id", &id, + "connection-state", &connection_state, + NULL); tp_svc_channel_type_streamed_media_emit_stream_state_changed (chan, id, connection_state); @@ -1430,7 +1444,8 @@ channel_iface_init (gpointer g_iface, gpointer iface_data) static void streamed_media_iface_init (gpointer g_iface, gpointer iface_data) { - TpSvcChannelTypeStreamedMediaClass *klass = (TpSvcChannelTypeStreamedMediaClass *)g_iface; + TpSvcChannelTypeStreamedMediaClass *klass = + (TpSvcChannelTypeStreamedMediaClass *)g_iface; #define IMPLEMENT(x) tp_svc_channel_type_streamed_media_implement_##x (\ klass, gabble_media_channel_##x) @@ -1444,7 +1459,8 @@ streamed_media_iface_init (gpointer g_iface, gpointer iface_data) static void media_signalling_iface_init (gpointer g_iface, gpointer iface_data) { - TpSvcChannelInterfaceMediaSignallingClass *klass = (TpSvcChannelInterfaceMediaSignallingClass *)g_iface; + TpSvcChannelInterfaceMediaSignallingClass *klass = + (TpSvcChannelInterfaceMediaSignallingClass *)g_iface; #define IMPLEMENT(x) tp_svc_channel_interface_media_signalling_implement_##x (\ klass, gabble_media_channel_##x) diff --git a/src/gabble-media-session.c b/src/gabble-media-session.c index 8b008f7bb..aedaabab7 100644 --- a/src/gabble-media-session.c +++ b/src/gabble-media-session.c @@ -125,12 +125,18 @@ typedef struct { static const SessionStateDescription session_states[] = { - { "JS_STATE_PENDING_CREATED", TP_ANSI_BOLD_ON TP_ANSI_FG_BLACK TP_ANSI_BG_WHITE }, - { "JS_STATE_PENDING_INITIATE_SENT", TP_ANSI_BOLD_ON TP_ANSI_BG_CYAN }, - { "JS_STATE_PENDING_INITIATED", TP_ANSI_BOLD_ON TP_ANSI_BG_MAGENTA }, - { "JS_STATE_PENDING_ACCEPT_SENT", TP_ANSI_BOLD_ON TP_ANSI_BG_CYAN }, - { "JS_STATE_ACTIVE", TP_ANSI_BOLD_ON TP_ANSI_BG_BLUE }, - { "JS_STATE_ENDED", TP_ANSI_BG_RED } + { "JS_STATE_PENDING_CREATED", + TP_ANSI_BOLD_ON TP_ANSI_FG_BLACK TP_ANSI_BG_WHITE }, + { "JS_STATE_PENDING_INITIATE_SENT", + TP_ANSI_BOLD_ON TP_ANSI_BG_CYAN }, + { "JS_STATE_PENDING_INITIATED", + TP_ANSI_BOLD_ON TP_ANSI_BG_MAGENTA }, + { "JS_STATE_PENDING_ACCEPT_SENT", + TP_ANSI_BOLD_ON TP_ANSI_BG_CYAN }, + { "JS_STATE_ACTIVE", + TP_ANSI_BOLD_ON TP_ANSI_BG_BLUE }, + { "JS_STATE_ENDED", + TP_ANSI_BG_RED } }; static void @@ -407,7 +413,8 @@ gabble_media_session_class_init (GabbleMediaSessionClass *gabble_media_session_c GObjectClass *object_class = G_OBJECT_CLASS (gabble_media_session_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_media_session_class, sizeof (GabbleMediaSessionPrivate)); + g_type_class_add_private (gabble_media_session_class, + sizeof (GabbleMediaSessionPrivate)); object_class->constructor = gabble_media_session_constructor; @@ -427,15 +434,14 @@ gabble_media_session_class_init (GabbleMediaSessionClass *gabble_media_session_c G_PARAM_STATIC_BLURB); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); - param_spec = g_param_spec_object ("media-channel", "GabbleMediaChannel object", - "Gabble media channel object that owns this " - "media session object.", - GABBLE_TYPE_MEDIA_CHANNEL, - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_READWRITE | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB); - g_object_class_install_property (object_class, PROP_MEDIA_CHANNEL, param_spec); + param_spec = g_param_spec_object ("media-channel", + "GabbleMediaChannel object", + "Gabble media channel object that owns this media session object.", + GABBLE_TYPE_MEDIA_CHANNEL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_NICK | + G_PARAM_STATIC_BLURB); + g_object_class_install_property (object_class, PROP_MEDIA_CHANNEL, + param_spec); param_spec = g_param_spec_string ("object-path", "D-Bus object path", "The D-Bus object path used for this " @@ -690,8 +696,8 @@ _handle_create (GabbleMediaSession *session, else { g_set_error (error, GABBLE_XMPP_ERROR, XMPP_ERROR_CONFLICT, - "session initiator is creating a stream named \"%s\" already", - stream_name); + "session initiator is creating a stream named \"%s\" " + "already", stream_name); return FALSE; } } @@ -1417,8 +1423,8 @@ _add_ready_new_streams (GabbleMediaSession *session) GabbleMediaStream *stream = g_ptr_array_index (priv->streams, i); GMS_DEBUG_DUMP (session, "pondering accept-time add for stream: %s, got " - "local codecs: %s, initiator: %s, signalling state: %d", stream->name, - stream->got_local_codecs ? "true" : "false", + "local codecs: %s, initiator: %s, signalling state: %d", + stream->name, stream->got_local_codecs ? "true" : "false", stream->initiator == INITIATOR_LOCAL ? "local" : "remote", stream->signalling_state); @@ -1463,8 +1469,9 @@ session_state_changed (GabbleMediaSession *session, g_source_remove (priv->timer_id); priv->timer_id = 0; - /* signal any streams to the remote end which were added locally & became - * ready before the session was accepted, so haven't been mentioned yet */ + /* signal any streams to the remote end which were added locally & + * became ready before the session was accepted, so haven't been + * mentioned yet */ _add_ready_new_streams (session); } } @@ -1482,7 +1489,8 @@ _mark_local_streams_sent (GabbleMediaSession *session) if (stream->initiator == INITIATOR_REMOTE) continue; - GMS_DEBUG_INFO (session, "marking local stream %s as signalled", stream->name); + GMS_DEBUG_INFO (session, "marking local stream %s as signalled", + stream->name); g_object_set (stream, "signalling-state", STREAM_SIG_STATE_SENT, NULL); } @@ -1504,7 +1512,8 @@ _mark_local_streams_acked (GabbleMediaSession *session) if (stream->signalling_state != STREAM_SIG_STATE_SENT) continue; - GMS_DEBUG_INFO (session, "marking local stream %s as acknowledged", stream->name); + GMS_DEBUG_INFO (session, "marking local stream %s as acknowledged", + stream->name); g_object_set (stream, "signalling-state", STREAM_SIG_STATE_ACKNOWLEDGED, @@ -1525,7 +1534,8 @@ _set_remote_streams_playing (GabbleMediaSession *session) if (stream->initiator == INITIATOR_LOCAL) continue; - GMS_DEBUG_INFO (session, "setting remote stream %s as playing", stream->name); + GMS_DEBUG_INFO (session, "setting remote stream %s as playing", + stream->name); g_object_set (stream, "playing", TRUE, NULL); } @@ -2200,7 +2210,8 @@ content_remove_msg_reply_cb (GabbleConnection *conn, GPtrArray *removing = (GPtrArray *) user_data; guint i; - MSG_REPLY_CB_END_SESSION_IF_NOT_SUCCESSFUL (session, "stream removal failed"); + MSG_REPLY_CB_END_SESSION_IF_NOT_SUCCESSFUL (session, + "stream removal failed"); for (i = 0; i < removing->len; i++) destroy_media_stream (session, @@ -2775,7 +2786,8 @@ direction_msg_reply_cb (GabbleConnection *conn, GabbleMediaSession *session = GABBLE_MEDIA_SESSION (user_data); GabbleMediaStream *stream = GABBLE_MEDIA_STREAM (object); - MSG_REPLY_CB_END_SESSION_IF_NOT_SUCCESSFUL (session, "direction change failed"); + MSG_REPLY_CB_END_SESSION_IF_NOT_SUCCESSFUL (session, + "direction change failed"); if (stream->playing) { @@ -2906,7 +2918,8 @@ _gabble_media_session_request_stream_direction (GabbleMediaSession *session, static void session_handler_iface_init (gpointer g_iface, gpointer iface_data) { - TpSvcMediaSessionHandlerClass *klass = (TpSvcMediaSessionHandlerClass *)g_iface; + TpSvcMediaSessionHandlerClass *klass = + (TpSvcMediaSessionHandlerClass *)g_iface; #define IMPLEMENT(x) tp_svc_media_session_handler_implement_##x (\ klass, gabble_media_session_##x) diff --git a/src/gabble-media-session.h b/src/gabble-media-session.h index 82303b464..ee80b0a96 100644 --- a/src/gabble-media-session.h +++ b/src/gabble-media-session.h @@ -114,8 +114,10 @@ LmMessage *_gabble_media_session_message_new (GabbleMediaSession *session, LmMessageNode **session_node); void _gabble_media_session_accept (GabbleMediaSession *session); -void _gabble_media_session_remove_streams (GabbleMediaSession *session, GabbleMediaStream **streams, guint len); -void _gabble_media_session_terminate (GabbleMediaSession *session, JingleInitiator who, TpChannelGroupChangeReason why); +void _gabble_media_session_remove_streams (GabbleMediaSession *session, + GabbleMediaStream **streams, guint len); +void _gabble_media_session_terminate (GabbleMediaSession *session, + JingleInitiator who, TpChannelGroupChangeReason why); gboolean _gabble_media_session_request_streams (GabbleMediaSession *session, const GArray *types, @@ -123,9 +125,7 @@ gboolean _gabble_media_session_request_streams (GabbleMediaSession *session, GError **error); gboolean _gabble_media_session_request_stream_direction (GabbleMediaSession *, - GabbleMediaStream *, - TpMediaStreamDirection, - GError **); + GabbleMediaStream *, TpMediaStreamDirection, GError **); #ifndef _GMS_DEBUG_LEVEL #define _GMS_DEBUG_LEVEL 2 @@ -134,15 +134,20 @@ gboolean _gabble_media_session_request_stream_direction (GabbleMediaSession *, #if _GMS_DEBUG_LEVEL #ifdef ENABLE_DEBUG -#define GMS_DEBUG_INFO(s, ...) _gabble_media_session_debug (s, DEBUG_MSG_INFO, __VA_ARGS__) +#define GMS_DEBUG_INFO(s, ...) \ + _gabble_media_session_debug (s, DEBUG_MSG_INFO, __VA_ARGS__) #if _GMS_DEBUG_LEVEL > 1 -#define GMS_DEBUG_DUMP(s, ...) _gabble_media_session_debug (s, DEBUG_MSG_DUMP, __VA_ARGS__) +#define GMS_DEBUG_DUMP(s, ...) \ + _gabble_media_session_debug (s, DEBUG_MSG_DUMP, __VA_ARGS__) #else #define GMS_DEBUG_DUMP(s, ...) #endif -#define GMS_DEBUG_WARNING(s, ...) _gabble_media_session_debug (s, DEBUG_MSG_WARNING, __VA_ARGS__) -#define GMS_DEBUG_ERROR(s, ...) _gabble_media_session_debug (s, DEBUG_MSG_ERROR, __VA_ARGS__) -#define GMS_DEBUG_EVENT(s, ...) _gabble_media_session_debug (s, DEBUG_MSG_EVENT, __VA_ARGS__) +#define GMS_DEBUG_WARNING(s, ...) \ + _gabble_media_session_debug (s, DEBUG_MSG_WARNING, __VA_ARGS__) +#define GMS_DEBUG_ERROR(s, ...) \ + _gabble_media_session_debug (s, DEBUG_MSG_ERROR, __VA_ARGS__) +#define GMS_DEBUG_EVENT(s, ...) \ + _gabble_media_session_debug (s, DEBUG_MSG_EVENT, __VA_ARGS__) void _gabble_media_session_debug (GabbleMediaSession *session, DebugMessageType type, diff --git a/src/gabble-media-stream.c b/src/gabble-media-stream.c index de931c687..c063b0463 100644 --- a/src/gabble-media-stream.c +++ b/src/gabble-media-stream.c @@ -326,7 +326,8 @@ gabble_media_stream_class_init (GabbleMediaStreamClass *gabble_media_stream_clas GObjectClass *object_class = G_OBJECT_CLASS (gabble_media_stream_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_media_stream_class, sizeof (GabbleMediaStreamPrivate)); + g_type_class_add_private (gabble_media_stream_class, + sizeof (GabbleMediaStreamPrivate)); object_class->constructor = gabble_media_stream_constructor; @@ -346,15 +347,14 @@ gabble_media_stream_class_init (GabbleMediaStreamClass *gabble_media_stream_clas G_PARAM_STATIC_BLURB); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); - param_spec = g_param_spec_object ("media-session", "GabbleMediaSession object", - "Gabble media session object that owns this " - "media stream object.", - GABBLE_TYPE_MEDIA_SESSION, - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_READWRITE | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB); - g_object_class_install_property (object_class, PROP_MEDIA_SESSION, param_spec); + param_spec = g_param_spec_object ("media-session", + "GabbleMediaSession object", + "Gabble media session object that owns this media stream object.", + GABBLE_TYPE_MEDIA_SESSION, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_NICK | + G_PARAM_STATIC_BLURB); + g_object_class_install_property (object_class, PROP_MEDIA_SESSION, + param_spec); param_spec = g_param_spec_string ("object-path", "D-Bus object path", "The D-Bus object path used for this " @@ -378,13 +378,9 @@ gabble_media_stream_class_init (GabbleMediaStreamClass *gabble_media_stream_clas g_object_class_install_property (object_class, PROP_MODE, param_spec); param_spec = g_param_spec_string ("name", "Stream name", - "An opaque name for the stream used in the " - "signalling.", - NULL, - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_BLURB); + "An opaque name for the stream used in the signalling.", NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB); g_object_class_install_property (object_class, PROP_NAME, param_spec); param_spec = g_param_spec_uint ("id", "Stream ID", @@ -421,17 +417,16 @@ gabble_media_stream_class_init (GabbleMediaStreamClass *gabble_media_stream_clas G_PARAM_STATIC_BLURB); g_object_class_install_property (object_class, PROP_MEDIA_TYPE, param_spec); - param_spec = g_param_spec_uint ("connection-state", "Stream connection state", - "An integer indicating the state of the" - "stream's connection.", - TP_MEDIA_STREAM_STATE_DISCONNECTED, - TP_MEDIA_STREAM_STATE_CONNECTED, - TP_MEDIA_STREAM_STATE_DISCONNECTED, - G_PARAM_CONSTRUCT | - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_BLURB); - g_object_class_install_property (object_class, PROP_CONNECTION_STATE, param_spec); + param_spec = g_param_spec_uint ("connection-state", + "Stream connection state", + "An integer indicating the state of the stream's connection.", + TP_MEDIA_STREAM_STATE_DISCONNECTED, + TP_MEDIA_STREAM_STATE_CONNECTED, + TP_MEDIA_STREAM_STATE_DISCONNECTED, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB); + g_object_class_install_property (object_class, PROP_CONNECTION_STATE, + param_spec); param_spec = g_param_spec_boolean ("ready", "Ready?", "A boolean signifying whether the user " @@ -445,14 +440,12 @@ gabble_media_stream_class_init (GabbleMediaStreamClass *gabble_media_stream_clas g_object_class_install_property (object_class, PROP_READY, param_spec); param_spec = g_param_spec_boolean ("got-local-codecs", "Got local codecs?", - "A boolean signifying whether we've got " - "the locally supported codecs from the user.", - FALSE, - G_PARAM_CONSTRUCT | - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_BLURB); - g_object_class_install_property (object_class, PROP_GOT_LOCAL_CODECS, param_spec); + "A boolean signifying whether we've got the locally supported codecs " + "from the user.", FALSE, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB); + g_object_class_install_property (object_class, PROP_GOT_LOCAL_CODECS, + param_spec); param_spec = g_param_spec_uint ("signalling-state", "Signalling state", "Whether the stream is newly created, " @@ -464,7 +457,8 @@ gabble_media_stream_class_init (GabbleMediaStreamClass *gabble_media_stream_clas G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB); - g_object_class_install_property (object_class, PROP_SIGNALLING_STATE, param_spec); + g_object_class_install_property (object_class, PROP_SIGNALLING_STATE, + param_spec); param_spec = g_param_spec_boolean ("playing", "Set playing", "A boolean signifying whether the stream " @@ -607,7 +601,9 @@ gabble_media_stream_error (GabbleMediaStream *self, priv = GABBLE_MEDIA_STREAM_GET_PRIVATE (self); - GMS_DEBUG_WARNING (priv->session, "Media.StreamHandler::Error called, error %u (%s) -- emitting signal", errno, message); + GMS_DEBUG_WARNING (priv->session, + "Media.StreamHandler::Error called, error %u (%s) -- emitting signal", + errno, message); g_signal_emit (self, signals[ERROR], 0, errno, message); @@ -750,15 +746,16 @@ gabble_media_stream_new_native_candidate (TpSvcMediaStreamHandler *iface, addr = g_value_get_string (g_value_array_get_nth (transport, 1)); if (!strcmp (addr, "127.0.0.1")) { - GMS_DEBUG_WARNING (priv->session, "%s: ignoring native localhost candidate", - G_STRFUNC); + GMS_DEBUG_WARNING (priv->session, + "%s: ignoring native localhost candidate", G_STRFUNC); tp_svc_media_stream_handler_return_from_new_native_candidate (context); return; } g_ptr_array_add (candidates, g_value_get_boxed (&candidate)); - GMS_DEBUG_INFO (priv->session, "put 1 native candidate from stream-engine into cache"); + GMS_DEBUG_INFO (priv->session, + "put 1 native candidate from stream-engine into cache"); push_native_candidates (self); @@ -895,7 +892,8 @@ candidates_msg_reply_cb (GabbleConnection *conn, priv = GABBLE_MEDIA_STREAM_GET_PRIVATE (stream); - MSG_REPLY_CB_END_SESSION_IF_NOT_SUCCESSFUL (priv->session, "candidates failed"); + MSG_REPLY_CB_END_SESSION_IF_NOT_SUCCESSFUL (priv->session, + "candidates failed"); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } @@ -976,9 +974,9 @@ _add_rtp_candidate_node (GabbleMediaSession *session, LmMessageNode *parent, GMS_DEBUG_DUMP (session, " from Telepathy D-Bus struct: [%s\"%s\", %s[%s1, \"%s\", %d, %s, " "\"%s\", \"%s\", %f, %s, \"%s\", \"%s\"%s]]", - TP_ANSI_BOLD_OFF, candidate_id, TP_ANSI_BOLD_ON, TP_ANSI_BOLD_OFF, addr, port, - tp_protocols[proto], "RTP", "AVP", pref, tp_transports[type], user, pass, - TP_ANSI_BOLD_ON); + TP_ANSI_BOLD_OFF, candidate_id, TP_ANSI_BOLD_ON, TP_ANSI_BOLD_OFF, + addr, port, tp_protocols[proto], "RTP", "AVP", pref, tp_transports[type], + user, pass, TP_ANSI_BOLD_ON); GMS_DEBUG_DUMP (session, " to Jingle XML: [%s%s%s]", TP_ANSI_BOLD_OFF, xml, TP_ANSI_BOLD_ON); g_free (xml); @@ -1384,12 +1382,17 @@ _gabble_media_stream_post_remote_candidates (GabbleMediaStream *stream, g_ptr_array_add (candidates, g_value_get_boxed (&candidate)); xml = lm_message_node_to_string (node); - GMS_DEBUG_INFO (priv->session, "put 1 remote candidate from peer into cache"); + GMS_DEBUG_INFO (priv->session, + "put 1 remote candidate from peer into cache"); GMS_DEBUG_DUMP (priv->session, " from Jingle XML: [%s%s%s]", TP_ANSI_BOLD_OFF, xml, TP_ANSI_BOLD_ON); - GMS_DEBUG_DUMP (priv->session, " to Telepathy D-Bus struct: [%s\"%s\", %s[%s1, \"%s\", %d, %s, \"%s\", \"%s\", %f, %s, \"%s\", \"%s\"%s]]", - TP_ANSI_BOLD_OFF, candidate_id, TP_ANSI_BOLD_ON, - TP_ANSI_BOLD_OFF, addr, port, tp_protocols[proto], "RTP", "AVP", pref, tp_transports[type], user, pass, TP_ANSI_BOLD_ON); + GMS_DEBUG_DUMP (priv->session, + " to Telepathy D-Bus struct: [%s\"%s\", %s[%s1, \"%s\", %d, %s, " + "\"%s\", \"%s\", %f, %s, \"%s\", \"%s\"%s]]", + TP_ANSI_BOLD_OFF, candidate_id, TP_ANSI_BOLD_ON, + TP_ANSI_BOLD_OFF, addr, port, tp_protocols[proto], + "RTP", "AVP", pref, tp_transports[type], + user, pass, TP_ANSI_BOLD_ON); g_free (xml); g_free (candidate_id); @@ -1699,7 +1702,8 @@ _gabble_media_stream_update_sending (GabbleMediaStream *stream, static void stream_handler_iface_init (gpointer g_iface, gpointer iface_data) { - TpSvcMediaStreamHandlerClass *klass = (TpSvcMediaStreamHandlerClass *)g_iface; + TpSvcMediaStreamHandlerClass *klass = + (TpSvcMediaStreamHandlerClass *)g_iface; #define IMPLEMENT(x,suffix) tp_svc_media_stream_handler_implement_##x (\ klass, gabble_media_stream_##x##suffix) diff --git a/src/gabble-muc-channel.c b/src/gabble-muc-channel.c index 7a4daf979..9109469a2 100644 --- a/src/gabble-muc-channel.c +++ b/src/gabble-muc-channel.c @@ -228,7 +228,9 @@ struct _GabbleMucChannelPrivate gboolean invite_self; }; -#define GABBLE_MUC_CHANNEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_MUC_CHANNEL, GabbleMucChannelPrivate)) +#define GABBLE_MUC_CHANNEL_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_MUC_CHANNEL, \ + GabbleMucChannelPrivate)) static void gabble_muc_channel_init (GabbleMucChannel *obj) @@ -236,7 +238,8 @@ gabble_muc_channel_init (GabbleMucChannel *obj) /* do nothing? */ } -static void contact_handle_to_room_identity (GabbleMucChannel *, TpHandle, TpHandle *, GString **); +static void contact_handle_to_room_identity (GabbleMucChannel *, TpHandle, + TpHandle *, GString **); static GObject * gabble_muc_channel_constructor (GType type, guint n_props, @@ -786,9 +789,12 @@ gabble_muc_channel_class_init (GabbleMucChannelClass *gabble_muc_channel_class) object_class->dispose = gabble_muc_channel_dispose; object_class->finalize = gabble_muc_channel_finalize; - g_object_class_override_property (object_class, PROP_OBJECT_PATH, "object-path"); - g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, "channel-type"); - g_object_class_override_property (object_class, PROP_HANDLE_TYPE, "handle-type"); + g_object_class_override_property (object_class, PROP_OBJECT_PATH, + "object-path"); + g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, + "channel-type"); + g_object_class_override_property (object_class, PROP_HANDLE_TYPE, + "handle-type"); g_object_class_override_property (object_class, PROP_HANDLE, "handle"); param_spec = g_param_spec_object ("connection", "GabbleConnection object", @@ -810,12 +816,9 @@ gabble_muc_channel_class_init (GabbleMucChannelClass *gabble_muc_channel_class) g_object_class_install_property (object_class, PROP_STATE, param_spec); param_spec = g_param_spec_boolean ("invite-self", "Invite self", - "Whether the user should be added to members list.", - FALSE, - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_WRITABLE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_BLURB); + "Whether the user should be added to members list.", FALSE, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB); g_object_class_install_property (object_class, PROP_INVITE_SELF, param_spec); signals[READY] = @@ -973,7 +976,8 @@ provide_password_return_if_pending (GabbleMucChannel *chan, gboolean success) } } -static void close_channel (GabbleMucChannel *chan, const gchar *reason, gboolean inform_muc, TpHandle actor, guint reason_code); +static void close_channel (GabbleMucChannel *chan, const gchar *reason, + gboolean inform_muc, TpHandle actor, guint reason_code); static gboolean timeout_join (gpointer data) @@ -1008,7 +1012,8 @@ channel_state_changed (GabbleMucChannel *chan, { GabbleMucChannelPrivate *priv = GABBLE_MUC_CHANNEL_GET_PRIVATE (chan); - DEBUG ("state changed from %s to %s", muc_states[prev_state], muc_states[new_state]); + DEBUG ("state changed from %s to %s", muc_states[prev_state], + muc_states[new_state]); if (new_state == MUC_STATE_INITIATED) { @@ -1141,8 +1146,8 @@ _gabble_muc_channel_presence_error (GabbleMucChannel *chan, if (priv->state >= MUC_STATE_JOINED) { - g_warning ("%s: presence error while already member of the channel -- NYI", - G_STRFUNC); + g_warning ("%s: presence error while already member of the channel " + "-- NYI", G_STRFUNC); return; } @@ -1627,8 +1632,8 @@ _gabble_muc_channel_member_presence_updated (GabbleMucChannel *chan, LmMessage *msg; GError *error = NULL; - msg = lm_message_new_with_sub_type (priv->jid, LM_MESSAGE_TYPE_IQ, - LM_MESSAGE_SUB_TYPE_SET); + msg = lm_message_new_with_sub_type (priv->jid, + LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_SET); node = lm_message_node_add_child (msg->node, "query", NULL); lm_message_node_set_attribute (node, "xmlns", NS_MUC_OWNER); @@ -1640,10 +1645,11 @@ _gabble_muc_channel_member_presence_updated (GabbleMucChannel *chan, NULL); if (!_gabble_connection_send_with_reply (priv->conn, msg, - room_created_submit_reply_cb, G_OBJECT (chan), NULL, &error)) + room_created_submit_reply_cb, G_OBJECT (chan), NULL, + &error)) { - g_warning ("%s: failed to send submit message: %s", G_STRFUNC, - error->message); + g_warning ("%s: failed to send submit message: %s", + G_STRFUNC, error->message); g_error_free (error); lm_message_unref (msg); @@ -1698,7 +1704,8 @@ _gabble_muc_channel_member_presence_updated (GabbleMucChannel *chan, * 301 banned * 307 kicked * 321 "because of an affiliation change" - no reason_code - * 322 room has become members-only and we're not a member - no reason_code + * 322 room has become members-only and we're not a member - no + * reason_code * 332 system (server) is being shut down - no reason code */ if (status_code) @@ -1875,7 +1882,8 @@ _gabble_muc_channel_receive (GabbleMucChannel *chan, } else if ((sender == chan->group.self_handle) && (timestamp == 0)) { - /* If we sent the message and it's not delayed, just emit the sent signal */ + /* If we sent the message and it's not delayed, just emit the sent + signal */ timestamp = time (NULL); tp_svc_channel_type_text_emit_sent (chan, timestamp, msg_type, text); @@ -1948,7 +1956,9 @@ _gabble_muc_channel_handle_invited (GabbleMucChannel *chan, * on org.freedesktop.Telepathy.Channel.Interface.ChatState */ void -_gabble_muc_channel_state_receive (GabbleMucChannel *chan, guint state, guint from_handle) +_gabble_muc_channel_state_receive (GabbleMucChannel *chan, + guint state, + guint from_handle) { GabbleMucChannelPrivate *priv; @@ -1956,7 +1966,7 @@ _gabble_muc_channel_state_receive (GabbleMucChannel *chan, guint state, guint fr g_assert (GABBLE_IS_MUC_CHANNEL (chan)); priv = GABBLE_MUC_CHANNEL_GET_PRIVATE (chan); - tp_svc_channel_interface_chat_state_emit_chat_state_changed ((TpSvcChannelInterfaceChatState*)chan, + tp_svc_channel_interface_chat_state_emit_chat_state_changed (chan, from_handle, state); } @@ -2203,8 +2213,7 @@ gabble_muc_channel_add_member (GObject *obj, tp_intset_add (set_pending, handle); tp_group_mixin_change_members (obj, "", set_empty, set_members, - set_empty, set_pending, 0, - TP_CHANNEL_GROUP_CHANGE_REASON_INVITED); + set_empty, set_pending, 0, TP_CHANNEL_GROUP_CHANGE_REASON_INVITED); tp_intset_destroy (set_empty); tp_intset_destroy (set_members); diff --git a/src/gabble-muc-channel.h b/src/gabble-muc-channel.h index 62da01932..67024539d 100644 --- a/src/gabble-muc-channel.h +++ b/src/gabble-muc-channel.h @@ -58,23 +58,32 @@ GType gabble_muc_channel_get_type (void); #define GABBLE_TYPE_MUC_CHANNEL \ (gabble_muc_channel_get_type ()) #define GABBLE_MUC_CHANNEL(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_MUC_CHANNEL, GabbleMucChannel)) + (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_MUC_CHANNEL, \ + GabbleMucChannel)) #define GABBLE_MUC_CHANNEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_MUC_CHANNEL, GabbleMucChannelClass)) + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_MUC_CHANNEL,\ + GabbleMucChannelClass)) #define GABBLE_IS_MUC_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_MUC_CHANNEL)) #define GABBLE_IS_MUC_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_MUC_CHANNEL)) #define GABBLE_MUC_CHANNEL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_MUC_CHANNEL, GabbleMucChannelClass)) + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_MUC_CHANNEL,\ + GabbleMucChannelClass)) gboolean _gabble_muc_channel_is_ready (GabbleMucChannel *chan); -void _gabble_muc_channel_presence_error (GabbleMucChannel *chan, const gchar *jid, LmMessageNode *pres_node); -void _gabble_muc_channel_member_presence_updated (GabbleMucChannel *chan, TpHandle handle, LmMessage *message, LmMessageNode *x_node); -void _gabble_muc_channel_receive (GabbleMucChannel *chan, TpChannelTextMessageType msg_type, TpHandleType handle_type, TpHandle sender, time_t timestamp, const gchar *text, LmMessage *msg); - -void _gabble_muc_channel_handle_invited (GabbleMucChannel *chan, TpHandle inviter, const gchar *message); -void _gabble_muc_channel_state_receive (GabbleMucChannel *chan, guint state, guint from_handle); +void _gabble_muc_channel_presence_error (GabbleMucChannel *chan, + const gchar *jid, LmMessageNode *pres_node); +void _gabble_muc_channel_member_presence_updated (GabbleMucChannel *chan, + TpHandle handle, LmMessage *message, LmMessageNode *x_node); +void _gabble_muc_channel_receive (GabbleMucChannel *chan, + TpChannelTextMessageType msg_type, TpHandleType handle_type, + TpHandle sender, time_t timestamp, const gchar *text, LmMessage *msg); + +void _gabble_muc_channel_handle_invited (GabbleMucChannel *chan, + TpHandle inviter, const gchar *message); +void _gabble_muc_channel_state_receive (GabbleMucChannel *chan, + guint state, guint from_handle); G_END_DECLS diff --git a/src/gabble-register.c b/src/gabble-register.c index b88148753..bba748cf2 100644 --- a/src/gabble-register.c +++ b/src/gabble-register.c @@ -68,7 +68,9 @@ struct _GabbleRegisterPrivate gboolean dispose_has_run; }; -#define GABBLE_REGISTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_REGISTER, GabbleRegisterPrivate)) +#define GABBLE_REGISTER_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_REGISTER,\ + GabbleRegisterPrivate)) static void gabble_register_init (GabbleRegister *obj) @@ -88,7 +90,8 @@ gabble_register_class_init (GabbleRegisterClass *gabble_register_class) GObjectClass *object_class = G_OBJECT_CLASS (gabble_register_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_register_class, sizeof (GabbleRegisterPrivate)); + g_type_class_add_private (gabble_register_class, + sizeof (GabbleRegisterPrivate)); object_class->get_property = gabble_register_get_property; object_class->set_property = gabble_register_set_property; diff --git a/src/gabble-register.h b/src/gabble-register.h index 031cf5870..c6fc41c5b 100644 --- a/src/gabble-register.h +++ b/src/gabble-register.h @@ -48,7 +48,8 @@ GType gabble_register_get_type (void); #define GABBLE_IS_REGISTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_REGISTER)) #define GABBLE_REGISTER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_REGISTER, GabbleRegisterClass)) + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_REGISTER,\ + GabbleRegisterClass)) struct _GabbleRegisterClass { GObjectClass parent_class; diff --git a/src/gabble-roomlist-channel.c b/src/gabble-roomlist-channel.c index cfaef489c..64c3bbd04 100644 --- a/src/gabble-roomlist-channel.c +++ b/src/gabble-roomlist-channel.c @@ -136,7 +136,8 @@ gabble_roomlist_channel_get_property (GObject *object, GParamSpec *pspec) { GabbleRoomlistChannel *chan = GABBLE_ROOMLIST_CHANNEL (object); - GabbleRoomlistChannelPrivate *priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan); + GabbleRoomlistChannelPrivate *priv = + GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan); switch (property_id) { case PROP_OBJECT_PATH: @@ -170,7 +171,8 @@ gabble_roomlist_channel_set_property (GObject *object, GParamSpec *pspec) { GabbleRoomlistChannel *chan = GABBLE_ROOMLIST_CHANNEL (object); - GabbleRoomlistChannelPrivate *priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan); + GabbleRoomlistChannelPrivate *priv = + GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan); TpBaseConnection *conn; TpHandleRepoIface *room_handles; TpHandleSet *new_signalled_rooms; @@ -192,7 +194,8 @@ gabble_roomlist_channel_set_property (GObject *object, priv->conn = g_value_get_object (value); conn = (TpBaseConnection *)priv->conn; - room_handles = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_ROOM); + room_handles = tp_base_connection_get_handles (conn, + TP_HANDLE_TYPE_ROOM); new_signalled_rooms = tp_handle_set_new (room_handles); if (priv->signalled_rooms != NULL) @@ -225,7 +228,8 @@ gabble_roomlist_channel_class_init (GabbleRoomlistChannelClass *gabble_roomlist_ GObjectClass *object_class = G_OBJECT_CLASS (gabble_roomlist_channel_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_roomlist_channel_class, sizeof (GabbleRoomlistChannelPrivate)); + g_type_class_add_private (gabble_roomlist_channel_class, + sizeof (GabbleRoomlistChannelPrivate)); object_class->constructor = gabble_roomlist_channel_constructor; @@ -235,10 +239,14 @@ gabble_roomlist_channel_class_init (GabbleRoomlistChannelClass *gabble_roomlist_ object_class->dispose = gabble_roomlist_channel_dispose; object_class->finalize = gabble_roomlist_channel_finalize; - g_object_class_override_property (object_class, PROP_OBJECT_PATH, "object-path"); - g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, "channel-type"); - g_object_class_override_property (object_class, PROP_HANDLE_TYPE, "handle-type"); - g_object_class_override_property (object_class, PROP_HANDLE, "handle"); + g_object_class_override_property (object_class, PROP_OBJECT_PATH, + "object-path"); + g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, + "channel-type"); + g_object_class_override_property (object_class, PROP_HANDLE_TYPE, + "handle-type"); + g_object_class_override_property (object_class, PROP_HANDLE, + "handle"); param_spec = g_param_spec_object ("connection", "GabbleConnection object", "Gabble connection object that owns this " @@ -269,7 +277,8 @@ void gabble_roomlist_channel_dispose (GObject *object) { GabbleRoomlistChannel *self = GABBLE_ROOMLIST_CHANNEL (object); - GabbleRoomlistChannelPrivate *priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self); + GabbleRoomlistChannelPrivate *priv = + GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self); if (priv->dispose_has_run) return; @@ -297,7 +306,8 @@ void gabble_roomlist_channel_finalize (GObject *object) { GabbleRoomlistChannel *self = GABBLE_ROOMLIST_CHANNEL (object); - GabbleRoomlistChannelPrivate *priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self); + GabbleRoomlistChannelPrivate *priv = + GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self); /* free any data held directly by the object here */ @@ -330,7 +340,8 @@ static gboolean emit_room_signal (gpointer data) { GabbleRoomlistChannel *chan = data; - GabbleRoomlistChannelPrivate *priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan); + GabbleRoomlistChannelPrivate *priv = + GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan); if (!priv->listing) return FALSE; @@ -386,7 +397,8 @@ room_info_cb (gpointer pipeline, GabbleDiscoItem *item, gpointer user_data) 0 != strcmp (type, "text")) return; - if (!g_hash_table_lookup_extended (item->features, "http://jabber.org/protocol/muc", &k, &v)) + if (!g_hash_table_lookup_extended (item->features, + "http://jabber.org/protocol/muc", &k, &v)) { /* not muc */ return; @@ -399,7 +411,8 @@ room_info_cb (gpointer pipeline, GabbleDiscoItem *item, gpointer user_data) return; } - DEBUG ("got room identity, name=%s, category=%s, type=%s", name, category, type); + DEBUG ("got room identity, name=%s, category=%s, type=%s", name, + category, type); keys = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); @@ -410,7 +423,8 @@ room_info_cb (gpointer pipeline, GabbleDiscoItem *item, gpointer user_data) INSERT_KEY (keys, "invite-only", G_TYPE_BOOLEAN, boolean, TRUE); if (g_hash_table_lookup_extended (item->features, "muc_open", &k, &v)) INSERT_KEY (keys, "invite-only", G_TYPE_BOOLEAN, boolean, FALSE); - if (g_hash_table_lookup_extended (item->features, "muc_passwordprotected", &k, &v)) + if (g_hash_table_lookup_extended (item->features, + "muc_passwordprotected", &k, &v)) INSERT_KEY (keys, "password", G_TYPE_BOOLEAN, boolean, TRUE); if (g_hash_table_lookup_extended (item->features, "muc_unsecure", &k, &v)) INSERT_KEY (keys, "password", G_TYPE_BOOLEAN, boolean, FALSE); @@ -428,11 +442,13 @@ room_info_cb (gpointer pipeline, GabbleDiscoItem *item, gpointer user_data) INSERT_KEY (keys, "moderated", G_TYPE_BOOLEAN, boolean, TRUE); if (g_hash_table_lookup_extended (item->features, "muc_unmoderated", &k, &v)) INSERT_KEY (keys, "moderated", G_TYPE_BOOLEAN, boolean, FALSE); - if (g_hash_table_lookup_extended (item->features, "muc_nonanonymous", &k, &v)) + if (g_hash_table_lookup_extended (item->features, + "muc_nonanonymous", &k, &v)) INSERT_KEY (keys, "anonymous", G_TYPE_BOOLEAN, boolean, FALSE); if (g_hash_table_lookup_extended (item->features, "muc_anonymous", &k, &v)) INSERT_KEY (keys, "anonymous", G_TYPE_BOOLEAN, boolean, TRUE); - if (g_hash_table_lookup_extended (item->features, "muc_semianonymous", &k, &v)) + if (g_hash_table_lookup_extended (item->features, + "muc_semianonymous", &k, &v)) INSERT_KEY (keys, "anonymous", G_TYPE_BOOLEAN, boolean, FALSE); if (g_hash_table_lookup_extended (item->features, "muc_persistent", &k, &v)) INSERT_KEY (keys, "persistent", G_TYPE_BOOLEAN, boolean, TRUE); @@ -475,7 +491,8 @@ static void rooms_end_cb (gpointer data, gpointer user_data) { GabbleRoomlistChannel *chan = user_data; - GabbleRoomlistChannelPrivate *priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan); + GabbleRoomlistChannelPrivate *priv = + GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan); emit_room_signal (chan); @@ -490,7 +507,8 @@ rooms_end_cb (gpointer data, gpointer user_data) static void stop_listing (GabbleRoomlistChannel *self) { - GabbleRoomlistChannelPrivate *priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self); + GabbleRoomlistChannelPrivate *priv = + GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self); if (priv->listing) { @@ -683,7 +701,8 @@ channel_iface_init (gpointer g_iface, gpointer iface_data) static void roomlist_iface_init (gpointer g_iface, gpointer iface_data) { - TpSvcChannelTypeRoomListClass *klass = (TpSvcChannelTypeRoomListClass *)g_iface; + TpSvcChannelTypeRoomListClass *klass = + (TpSvcChannelTypeRoomListClass *)g_iface; #define IMPLEMENT(x) tp_svc_channel_type_room_list_implement_##x (\ klass, gabble_roomlist_channel_##x) diff --git a/src/gabble-roomlist-channel.h b/src/gabble-roomlist-channel.h index 0c5e7dbcf..8fd5da2b8 100644 --- a/src/gabble-roomlist-channel.h +++ b/src/gabble-roomlist-channel.h @@ -46,18 +46,22 @@ GType gabble_roomlist_channel_get_type (void); #define GABBLE_TYPE_ROOMLIST_CHANNEL \ (gabble_roomlist_channel_get_type ()) #define GABBLE_ROOMLIST_CHANNEL(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_ROOMLIST_CHANNEL, GabbleRoomlistChannel)) + (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_ROOMLIST_CHANNEL,\ + GabbleRoomlistChannel)) #define GABBLE_ROOMLIST_CHANNEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_ROOMLIST_CHANNEL, GabbleRoomlistChannelClass)) + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_ROOMLIST_CHANNEL,\ + GabbleRoomlistChannelClass)) #define GABBLE_IS_ROOMLIST_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_ROOMLIST_CHANNEL)) #define GABBLE_IS_ROOMLIST_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_ROOMLIST_CHANNEL)) #define GABBLE_ROOMLIST_CHANNEL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_ROOMLIST_CHANNEL, GabbleRoomlistChannelClass)) + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_ROOMLIST_CHANNEL,\ + GabbleRoomlistChannelClass)) -GabbleRoomlistChannel *_gabble_roomlist_channel_new (GabbleConnection *conn, const gchar *object_path, const gchar *conference_server); +GabbleRoomlistChannel *_gabble_roomlist_channel_new (GabbleConnection *conn, + const gchar *object_path, const gchar *conference_server); G_END_DECLS diff --git a/src/gabble-roster-channel.c b/src/gabble-roster-channel.c index 1d3529a2e..c1479938a 100644 --- a/src/gabble-roster-channel.c +++ b/src/gabble-roster-channel.c @@ -253,7 +253,8 @@ gabble_roster_channel_class_init (GabbleRosterChannelClass *gabble_roster_channe GObjectClass *object_class = G_OBJECT_CLASS (gabble_roster_channel_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_roster_channel_class, sizeof (GabbleRosterChannelPrivate)); + g_type_class_add_private (gabble_roster_channel_class, + sizeof (GabbleRosterChannelPrivate)); object_class->constructor = gabble_roster_channel_constructor; @@ -273,15 +274,18 @@ gabble_roster_channel_class_init (GabbleRosterChannelClass *gabble_roster_channe G_PARAM_STATIC_BLURB); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); - g_object_class_override_property (object_class, PROP_OBJECT_PATH, "object-path"); - g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, "channel-type"); - g_object_class_override_property (object_class, PROP_HANDLE_TYPE, "handle-type"); + g_object_class_override_property (object_class, PROP_OBJECT_PATH, + "object-path"); + g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, + "channel-type"); + g_object_class_override_property (object_class, PROP_HANDLE_TYPE, + "handle-type"); g_object_class_override_property (object_class, PROP_HANDLE, "handle"); tp_group_mixin_class_init (object_class, - G_STRUCT_OFFSET (GabbleRosterChannelClass, group_class), - _gabble_roster_channel_add_member_cb, - _gabble_roster_channel_remove_member_cb); + G_STRUCT_OFFSET (GabbleRosterChannelClass, group_class), + _gabble_roster_channel_add_member_cb, + _gabble_roster_channel_remove_member_cb); } void @@ -513,8 +517,8 @@ _gabble_roster_channel_remove_member_cb (GObject *obj, else if (GABBLE_LIST_HANDLE_DENY == priv->handle) { /* unblock contact */ - ret = gabble_roster_handle_set_blocked (priv->conn->roster, handle, FALSE, - error); + ret = gabble_roster_handle_set_blocked (priv->conn->roster, handle, + FALSE, error); } else { @@ -627,7 +631,7 @@ gabble_roster_channel_get_interfaces (TpSvcChannel *self, static void -channel_iface_init(gpointer g_iface, gpointer iface_data) +channel_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcChannelClass *klass = (TpSvcChannelClass *)g_iface; diff --git a/src/gabble-roster-channel.h b/src/gabble-roster-channel.h index 78b2d9e45..29f8bd5e3 100644 --- a/src/gabble-roster-channel.h +++ b/src/gabble-roster-channel.h @@ -51,15 +51,18 @@ GType gabble_roster_channel_get_type (void); #define GABBLE_TYPE_ROSTER_CHANNEL \ (gabble_roster_channel_get_type ()) #define GABBLE_ROSTER_CHANNEL(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_ROSTER_CHANNEL, GabbleRosterChannel)) + (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_ROSTER_CHANNEL,\ + GabbleRosterChannel)) #define GABBLE_ROSTER_CHANNEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_ROSTER_CHANNEL, GabbleRosterChannelClass)) + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_ROSTER_CHANNEL,\ + GabbleRosterChannelClass)) #define GABBLE_IS_ROSTER_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_ROSTER_CHANNEL)) #define GABBLE_IS_ROSTER_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_ROSTER_CHANNEL)) #define GABBLE_ROSTER_CHANNEL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_ROSTER_CHANNEL, GabbleRosterChannelClass)) + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_ROSTER_CHANNEL,\ + GabbleRosterChannelClass)) G_END_DECLS diff --git a/src/handles.c b/src/handles.c index edd6349f6..009e8e1bb 100644 --- a/src/handles.c +++ b/src/handles.c @@ -40,7 +40,9 @@ * provided through error if set. */ gboolean -gabble_handle_jid_is_valid (TpHandleType type, const gchar *jid, GError **error) +gabble_handle_jid_is_valid (TpHandleType type, + const gchar *jid, + GError **error) { if (type == TP_HANDLE_TYPE_CONTACT || type == TP_HANDLE_TYPE_ROOM) { diff --git a/src/handles.h b/src/handles.h index 385c2b8f0..377e76a0b 100644 --- a/src/handles.h +++ b/src/handles.h @@ -30,7 +30,8 @@ G_BEGIN_DECLS -gboolean gabble_handle_jid_is_valid (TpHandleType type, const gchar *jid, GError **error); +gboolean gabble_handle_jid_is_valid (TpHandleType type, const gchar *jid, + GError **error); G_END_DECLS diff --git a/src/im-factory.c b/src/im-factory.c index 931c975fe..525ce2258 100644 --- a/src/im-factory.c +++ b/src/im-factory.c @@ -43,10 +43,12 @@ #include "text-mixin.h" #include <telepathy-glib/channel-factory-iface.h> -static void gabble_im_factory_iface_init (gpointer g_iface, gpointer iface_data); +static void gabble_im_factory_iface_init (gpointer g_iface, + gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (GabbleImFactory, gabble_im_factory, G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_FACTORY_IFACE, gabble_im_factory_iface_init)); + G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_FACTORY_IFACE, + gabble_im_factory_iface_init)); /* properties */ enum @@ -65,9 +67,12 @@ struct _GabbleImFactoryPrivate gboolean dispose_has_run; }; -#define GABBLE_IM_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_IM_FACTORY, GabbleImFactoryPrivate)) +#define GABBLE_IM_FACTORY_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_IM_FACTORY,\ + GabbleImFactoryPrivate)) -static GObject *gabble_im_factory_constructor (GType type, guint n_props, GObjectConstructParam *props); +static GObject *gabble_im_factory_constructor (GType type, guint n_props, + GObjectConstructParam *props); static void gabble_im_factory_init (GabbleImFactory *fac) @@ -161,7 +166,8 @@ gabble_im_factory_class_init (GabbleImFactoryClass *gabble_im_factory_class) GObjectClass *object_class = G_OBJECT_CLASS (gabble_im_factory_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_im_factory_class, sizeof (GabbleImFactoryPrivate)); + g_type_class_add_private (gabble_im_factory_class, + sizeof (GabbleImFactoryPrivate)); object_class->constructor = gabble_im_factory_constructor; object_class->dispose = gabble_im_factory_dispose; @@ -329,7 +335,8 @@ new_im_channel (GabbleImFactory *fac, TpHandle handle) g_hash_table_insert (priv->channels, GINT_TO_POINTER (handle), chan); - tp_channel_factory_iface_emit_new_channel (fac, (TpChannelIface *)chan, NULL); + tp_channel_factory_iface_emit_new_channel (fac, (TpChannelIface *)chan, + NULL); g_free (object_path); @@ -386,8 +393,8 @@ gabble_im_factory_iface_disconnected (TpChannelFactoryIface *iface) g_assert (priv->message_cb != NULL); - lm_connection_unregister_message_handler (priv->conn->lmconn, priv->message_cb, - LM_MESSAGE_TYPE_MESSAGE); + lm_connection_unregister_message_handler (priv->conn->lmconn, + priv->message_cb, LM_MESSAGE_TYPE_MESSAGE); lm_message_handler_unref (priv->message_cb); priv->message_cb = NULL; } @@ -408,7 +415,9 @@ _foreach_slave (gpointer key, gpointer value, gpointer user_data) } static void -gabble_im_factory_iface_foreach (TpChannelFactoryIface *iface, TpChannelFunc foreach, gpointer user_data) +gabble_im_factory_iface_foreach (TpChannelFactoryIface *iface, + TpChannelFunc foreach, + gpointer user_data) { GabbleImFactory *fac = GABBLE_IM_FACTORY (iface); GabbleImFactoryPrivate *priv = GABBLE_IM_FACTORY_GET_PRIVATE (fac); diff --git a/src/im-factory.h b/src/im-factory.h index 811ccb9ef..b895ed4aa 100644 --- a/src/im-factory.h +++ b/src/im-factory.h @@ -45,13 +45,15 @@ GType gabble_im_factory_get_type (void); #define GABBLE_IM_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_IM_FACTORY, GabbleImFactory)) #define GABBLE_IM_FACTORY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_IM_FACTORY, GabbleImFactoryClass)) + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_IM_FACTORY,\ + GabbleImFactoryClass)) #define GABBLE_IS_IM_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_IM_FACTORY)) #define GABBLE_IS_IM_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_IM_FACTORY)) #define GABBLE_IM_FACTORY_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_IM_FACTORY, GabbleImFactoryClass)) + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_IM_FACTORY,\ + GabbleImFactoryClass)) G_END_DECLS diff --git a/src/media-factory.c b/src/media-factory.c index e21c025e8..da5a8ee51 100644 --- a/src/media-factory.c +++ b/src/media-factory.c @@ -44,11 +44,15 @@ #include <telepathy-glib/channel-factory-iface.h> #include "util.h" -static void gabble_media_factory_iface_init (gpointer g_iface, gpointer iface_data); -static LmHandlerResult media_factory_jingle_cb (LmMessageHandler*, LmConnection*, LmMessage*, gpointer); +static void gabble_media_factory_iface_init (gpointer g_iface, + gpointer iface_data); +static LmHandlerResult media_factory_jingle_cb (LmMessageHandler *, + LmConnection *, LmMessage *, gpointer); -G_DEFINE_TYPE_WITH_CODE (GabbleMediaFactory, gabble_media_factory, G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_FACTORY_IFACE, gabble_media_factory_iface_init)); +G_DEFINE_TYPE_WITH_CODE (GabbleMediaFactory, gabble_media_factory, + G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_FACTORY_IFACE, + gabble_media_factory_iface_init)); /* properties */ enum @@ -77,9 +81,12 @@ struct _GabbleMediaFactoryPrivate gboolean dispose_has_run; }; -#define GABBLE_MEDIA_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_MEDIA_FACTORY, GabbleMediaFactoryPrivate)) +#define GABBLE_MEDIA_FACTORY_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_MEDIA_FACTORY, \ + GabbleMediaFactoryPrivate)) -static GObject *gabble_media_factory_constructor (GType type, guint n_props, GObjectConstructParam *props); +static GObject *gabble_media_factory_constructor (GType type, guint n_props, + GObjectConstructParam *props); static void gabble_media_factory_init (GabbleMediaFactory *fac) @@ -190,7 +197,8 @@ gabble_media_factory_class_init (GabbleMediaFactoryClass *gabble_media_factory_c GObjectClass *object_class = G_OBJECT_CLASS (gabble_media_factory_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_media_factory_class, sizeof (GabbleMediaFactoryPrivate)); + g_type_class_add_private (gabble_media_factory_class, + sizeof (GabbleMediaFactoryPrivate)); object_class->constructor = gabble_media_factory_constructor; object_class->dispose = gabble_media_factory_dispose; @@ -210,9 +218,12 @@ gabble_media_factory_class_init (GabbleMediaFactoryClass *gabble_media_factory_c } -static gboolean _gabble_media_factory_sid_in_use (GabbleMediaFactory *fac, const gchar *sid); -static GabbleMediaChannel *new_media_channel (GabbleMediaFactory *fac, TpHandle handle); -static void media_channel_closed_cb (GabbleMediaChannel *chan, gpointer user_data); +static gboolean _gabble_media_factory_sid_in_use (GabbleMediaFactory *fac, + const gchar *sid); +static GabbleMediaChannel *new_media_channel (GabbleMediaFactory *fac, + TpHandle handle); +static void media_channel_closed_cb (GabbleMediaChannel *chan, + gpointer user_data); /** * media_factory_jingle_cb @@ -399,7 +410,8 @@ _gabble_media_factory_sid_in_use (GabbleMediaFactory *fac, const gchar *sid) } const gchar * -_gabble_media_factory_allocate_sid (GabbleMediaFactory *fac, GabbleMediaChannel *chan) +_gabble_media_factory_allocate_sid (GabbleMediaFactory *fac, + GabbleMediaChannel *chan) { const gchar *sid = _gabble_media_factory_get_unique_sid (fac); @@ -465,7 +477,8 @@ media_channel_closed_cb (GabbleMediaChannel *chan, gpointer user_data) if (priv->session_chans) { - g_hash_table_foreach_remove (priv->session_chans, _remove_sid_mapping, chan); + g_hash_table_foreach_remove (priv->session_chans, _remove_sid_mapping, + chan); } } @@ -508,7 +521,8 @@ new_media_channel (GabbleMediaFactory *fac, TpHandle creator) if (priv->relay_token != NULL) { - g_object_set ((GObject *) chan, "gtalk-p2p-relay-token", priv->relay_token, NULL); + g_object_set ((GObject *) chan, "gtalk-p2p-relay-token", + priv->relay_token, NULL); } DEBUG ("object path %s", object_path); @@ -712,7 +726,8 @@ gabble_media_factory_iface_connecting (TpChannelFactoryIface *iface) g_assert (priv->jingle_cb == NULL); g_assert (priv->jingle_info_cb == NULL); - priv->jingle_cb = lm_message_handler_new (media_factory_jingle_cb, fac, NULL); + priv->jingle_cb = lm_message_handler_new (media_factory_jingle_cb, fac, + NULL); lm_connection_register_message_handler (priv->conn->lmconn, priv->jingle_cb, LM_MESSAGE_TYPE_IQ, LM_HANDLER_PRIORITY_NORMAL); @@ -766,20 +781,22 @@ gabble_media_factory_iface_disconnected (TpChannelFactoryIface *iface) g_assert (priv->jingle_cb != NULL); g_assert (priv->jingle_info_cb != NULL); - lm_connection_unregister_message_handler (priv->conn->lmconn, priv->jingle_cb, - LM_MESSAGE_TYPE_IQ); + lm_connection_unregister_message_handler (priv->conn->lmconn, + priv->jingle_cb, LM_MESSAGE_TYPE_IQ); lm_message_handler_unref (priv->jingle_cb); priv->jingle_cb = NULL; - lm_connection_unregister_message_handler (priv->conn->lmconn, priv->jingle_info_cb, - LM_MESSAGE_TYPE_IQ); + lm_connection_unregister_message_handler (priv->conn->lmconn, + priv->jingle_info_cb, LM_MESSAGE_TYPE_IQ); lm_message_handler_unref (priv->jingle_info_cb); priv->jingle_info_cb = NULL; } static void -gabble_media_factory_iface_foreach (TpChannelFactoryIface *iface, TpChannelFunc foreach, gpointer user_data) +gabble_media_factory_iface_foreach (TpChannelFactoryIface *iface, + TpChannelFunc foreach, + gpointer user_data) { GabbleMediaFactory *fac = GABBLE_MEDIA_FACTORY (iface); GabbleMediaFactoryPrivate *priv = GABBLE_MEDIA_FACTORY_GET_PRIVATE (fac); @@ -787,7 +804,8 @@ gabble_media_factory_iface_foreach (TpChannelFactoryIface *iface, TpChannelFunc for (i = 0; i < priv->channels->len; i++) { - foreach (TP_CHANNEL_IFACE (g_ptr_array_index (priv->channels, i)), user_data); + foreach (TP_CHANNEL_IFACE (g_ptr_array_index (priv->channels, i)), + user_data); } } diff --git a/src/media-factory.h b/src/media-factory.h index ac9611d54..90b19c7a3 100644 --- a/src/media-factory.h +++ b/src/media-factory.h @@ -43,19 +43,25 @@ GType gabble_media_factory_get_type (void); #define GABBLE_TYPE_MEDIA_FACTORY \ (gabble_media_factory_get_type ()) #define GABBLE_MEDIA_FACTORY(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_MEDIA_FACTORY, GabbleMediaFactory)) + (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_MEDIA_FACTORY,\ + GabbleMediaFactory)) #define GABBLE_MEDIA_FACTORY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_MEDIA_FACTORY, GabbleMediaFactoryClass)) + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_MEDIA_FACTORY,\ + GabbleMediaFactoryClass)) #define GABBLE_IS_MEDIA_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_MEDIA_FACTORY)) #define GABBLE_IS_MEDIA_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_MEDIA_FACTORY)) #define GABBLE_MEDIA_FACTORY_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_MEDIA_FACTORY, GabbleMediaFactoryClass)) + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_MEDIA_FACTORY,\ + GabbleMediaFactoryClass)) -const gchar * _gabble_media_factory_allocate_sid (GabbleMediaFactory *fac, GabbleMediaChannel *chan); -const gchar * _gabble_media_factory_register_sid (GabbleMediaFactory *fac, const gchar *sid, GabbleMediaChannel *chan); -void _gabble_media_factory_free_sid (GabbleMediaFactory *fac, const gchar *sid); +const gchar * _gabble_media_factory_allocate_sid (GabbleMediaFactory *fac, + GabbleMediaChannel *chan); +const gchar * _gabble_media_factory_register_sid (GabbleMediaFactory *fac, + const gchar *sid, GabbleMediaChannel *chan); +void _gabble_media_factory_free_sid (GabbleMediaFactory *fac, + const gchar *sid); G_END_DECLS diff --git a/src/muc-factory.c b/src/muc-factory.c index 9d1d0bbe1..eee926a91 100644 --- a/src/muc-factory.c +++ b/src/muc-factory.c @@ -47,10 +47,12 @@ #include <telepathy-glib/channel-factory-iface.h> #include "util.h" -static void gabble_muc_factory_iface_init (gpointer g_iface, gpointer iface_data); +static void gabble_muc_factory_iface_init (gpointer g_iface, + gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (GabbleMucFactory, gabble_muc_factory, G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_FACTORY_IFACE, gabble_muc_factory_iface_init)); + G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_FACTORY_IFACE, + gabble_muc_factory_iface_init)); /* properties */ enum @@ -75,9 +77,12 @@ struct _GabbleMucFactoryPrivate gboolean dispose_has_run; }; -#define GABBLE_MUC_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_MUC_FACTORY, GabbleMucFactoryPrivate)) +#define GABBLE_MUC_FACTORY_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_MUC_FACTORY, \ + GabbleMucFactoryPrivate)) -static GObject *gabble_muc_factory_constructor (GType type, guint n_props, GObjectConstructParam *props); +static GObject *gabble_muc_factory_constructor (GType type, guint n_props, + GObjectConstructParam *props); static void gabble_muc_factory_init (GabbleMucFactory *fac) @@ -134,7 +139,8 @@ gabble_muc_factory_dispose (GObject *object) tp_channel_factory_iface_close_all (TP_CHANNEL_FACTORY_IFACE (object)); - g_hash_table_foreach (priv->disco_requests, cancel_disco_request, priv->conn->disco); + g_hash_table_foreach (priv->disco_requests, cancel_disco_request, + priv->conn->disco); g_hash_table_destroy (priv->disco_requests); if (G_OBJECT_CLASS (gabble_muc_factory_parent_class)->dispose) @@ -185,7 +191,8 @@ gabble_muc_factory_class_init (GabbleMucFactoryClass *gabble_muc_factory_class) GObjectClass *object_class = G_OBJECT_CLASS (gabble_muc_factory_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_muc_factory_class, sizeof (GabbleMucFactoryPrivate)); + g_type_class_add_private (gabble_muc_factory_class, + sizeof (GabbleMucFactoryPrivate)); object_class->constructor = gabble_muc_factory_constructor; object_class->dispose = gabble_muc_factory_dispose; @@ -260,7 +267,8 @@ muc_ready_cb (GabbleMucChannel *chan, DEBUG ("chan=%p", chan); - tp_channel_factory_iface_emit_new_channel (fac, (TpChannelIface *)chan, NULL); + tp_channel_factory_iface_emit_new_channel (fac, (TpChannelIface *)chan, + NULL); } static void @@ -711,7 +719,8 @@ muc_factory_presence_cb (LmMessageHandler *handler, if (from == NULL) { - NODE_DEBUG (msg->node, "presence stanza without from attribute, ignoring"); + NODE_DEBUG (msg->node, + "presence stanza without from attribute, ignoring"); return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } @@ -728,7 +737,8 @@ muc_factory_presence_cb (LmMessageHandler *handler, return LM_HANDLER_RESULT_REMOVE_MESSAGE; } - x_node = lm_message_node_get_child_with_namespace (msg->node, "x", NS_MUC_USER); + x_node = lm_message_node_get_child_with_namespace (msg->node, "x", + NS_MUC_USER); /* is it a MUC member presence? */ if (x_node != NULL) @@ -741,7 +751,8 @@ muc_factory_presence_cb (LmMessageHandler *handler, GUINT_TO_POINTER (GABBLE_JID_ROOM_MEMBER), NULL); if (handle == 0) { - NODE_DEBUG (msg->node, "discarding MUC presence from malformed jid"); + NODE_DEBUG (msg->node, + "discarding MUC presence from malformed jid"); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } @@ -843,15 +854,16 @@ gabble_muc_factory_iface_connecting (TpChannelFactoryIface *iface) g_assert (priv->message_cb == NULL); g_assert (priv->presence_cb == NULL); - priv->message_cb = lm_message_handler_new (muc_factory_message_cb, fac, NULL); + priv->message_cb = lm_message_handler_new (muc_factory_message_cb, fac, + NULL); lm_connection_register_message_handler (priv->conn->lmconn, priv->message_cb, LM_MESSAGE_TYPE_MESSAGE, LM_HANDLER_PRIORITY_NORMAL); - priv->presence_cb = lm_message_handler_new (muc_factory_presence_cb, fac, NULL); - lm_connection_register_message_handler (priv->conn->lmconn, priv->presence_cb, - LM_MESSAGE_TYPE_PRESENCE, - LM_HANDLER_PRIORITY_NORMAL); + priv->presence_cb = lm_message_handler_new (muc_factory_presence_cb, + fac, NULL); + lm_connection_register_message_handler (priv->conn->lmconn, + priv->presence_cb, LM_MESSAGE_TYPE_PRESENCE, LM_HANDLER_PRIORITY_NORMAL); } @@ -872,13 +884,13 @@ gabble_muc_factory_iface_disconnected (TpChannelFactoryIface *iface) g_assert (priv->message_cb != NULL); g_assert (priv->presence_cb != NULL); - lm_connection_unregister_message_handler (priv->conn->lmconn, priv->message_cb, - LM_MESSAGE_TYPE_MESSAGE); + lm_connection_unregister_message_handler (priv->conn->lmconn, + priv->message_cb, LM_MESSAGE_TYPE_MESSAGE); lm_message_handler_unref (priv->message_cb); priv->message_cb = NULL; - lm_connection_unregister_message_handler (priv->conn->lmconn, priv->presence_cb, - LM_MESSAGE_TYPE_PRESENCE); + lm_connection_unregister_message_handler (priv->conn->lmconn, + priv->presence_cb, LM_MESSAGE_TYPE_PRESENCE); lm_message_handler_unref (priv->presence_cb); priv->presence_cb = NULL; } @@ -899,7 +911,9 @@ _foreach_slave (gpointer key, gpointer value, gpointer user_data) } static void -gabble_muc_factory_iface_foreach (TpChannelFactoryIface *iface, TpChannelFunc foreach, gpointer user_data) +gabble_muc_factory_iface_foreach (TpChannelFactoryIface *iface, + TpChannelFunc foreach, + gpointer user_data) { GabbleMucFactory *fac = GABBLE_MUC_FACTORY (iface); GabbleMucFactoryPrivate *priv = GABBLE_MUC_FACTORY_GET_PRIVATE (fac); diff --git a/src/muc-factory.h b/src/muc-factory.h index 7cc794d1d..09ec8dbc4 100644 --- a/src/muc-factory.h +++ b/src/muc-factory.h @@ -41,15 +41,18 @@ GType gabble_muc_factory_get_type (void); #define GABBLE_TYPE_MUC_FACTORY \ (gabble_muc_factory_get_type ()) #define GABBLE_MUC_FACTORY(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_MUC_FACTORY, GabbleMucFactory)) + (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_MUC_FACTORY, \ + GabbleMucFactory)) #define GABBLE_MUC_FACTORY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_MUC_FACTORY, GabbleMucFactoryClass)) + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_MUC_FACTORY, \ + GabbleMucFactoryClass)) #define GABBLE_IS_MUC_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_MUC_FACTORY)) #define GABBLE_IS_MUC_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_MUC_FACTORY)) #define GABBLE_MUC_FACTORY_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_MUC_FACTORY, GabbleMucFactoryClass)) + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_MUC_FACTORY, \ + GabbleMucFactoryClass)) G_END_DECLS diff --git a/src/namespaces.h b/src/namespaces.h index f69db1738..91bf40813 100644 --- a/src/namespaces.h +++ b/src/namespaces.h @@ -35,16 +35,20 @@ #define NS_GOOGLE_SESSION_PHONE "http://www.google.com/session/phone" #define NS_GOOGLE_TRANSPORT_P2P "http://www.google.com/transport/p2p" #define NS_JINGLE "http://jabber.org/protocol/jingle" -#define NS_JINGLE_DESCRIPTION_AUDIO "http://jabber.org/protocol/jingle/description/audio" -#define NS_JINGLE_DESCRIPTION_VIDEO "http://jabber.org/protocol/jingle/description/video" +#define NS_JINGLE_DESCRIPTION_AUDIO \ + "http://jabber.org/protocol/jingle/description/audio" +#define NS_JINGLE_DESCRIPTION_VIDEO \ + "http://jabber.org/protocol/jingle/description/video" #define NS_JINGLE_ERRORS "http://jabber.org/protocol/jingle#errors" -#define NS_JINGLE_TRANSPORT_ICE "http://jabber.org/protocol/jingle/transport/ice" +#define NS_JINGLE_TRANSPORT_ICE \ + "http://jabber.org/protocol/jingle/transport/ice" #define NS_MUC "http://jabber.org/protocol/muc" #define NS_MUC_USER "http://jabber.org/protocol/muc#user" #define NS_MUC_ADMIN "http://jabber.org/protocol/muc#admin" #define NS_MUC_OWNER "http://jabber.org/protocol/muc#owner" #define NS_NICK "http://jabber.org/protocol/nick" -#define NS_NOKIA_IV "http://videovoip.tableteer.nokia.com/xmpp/privilege" +#define NS_NOKIA_IV \ + "http://videovoip.tableteer.nokia.com/xmpp/privilege" #define NS_OLPC_BUDDY_PROPS "http://laptop.org/xmpp/buddy-properties" #define NS_OLPC_ACTIVITIES "http://laptop.org/xmpp/activities" #define NS_PUBSUB "http://jabber.org/protocol/pubsub" diff --git a/src/presence-cache.c b/src/presence-cache.c index 7f4f219ea..49506c78a 100644 --- a/src/presence-cache.c +++ b/src/presence-cache.c @@ -23,7 +23,8 @@ #include <stdlib.h> #include <string.h> -/* when five DIFFERENT guys report the same caps for a given bundle, it'll be enough */ +/* when five DIFFERENT guys report the same caps for a given bundle, it'll +be enough */ #define CAPABILITY_BUNDLE_ENOUGH_TRUST 5 #define DEBUG_FLAG GABBLE_DEBUG_PRESENCE @@ -57,7 +58,8 @@ enum static guint signals[LAST_SIGNAL] = { 0 }; -#define GABBLE_PRESENCE_CACHE_PRIV(account) ((GabblePresenceCachePrivate *)account->priv) +#define GABBLE_PRESENCE_CACHE_PRIV(account) \ + ((GabblePresenceCachePrivate *)account->priv) typedef struct _GabblePresenceCachePrivate GabblePresenceCachePrivate; @@ -93,7 +95,10 @@ struct _DiscoWaiter * disco_waiter_new () */ static DiscoWaiter * -disco_waiter_new (TpHandleRepoIface *repo, TpHandle handle, const gchar *resource, guint serial) +disco_waiter_new (TpHandleRepoIface *repo, + TpHandle handle, + const gchar *resource, + guint serial) { DiscoWaiter *waiter; @@ -106,7 +111,8 @@ disco_waiter_new (TpHandleRepoIface *repo, TpHandle handle, const gchar *resourc waiter->resource = g_strdup (resource); waiter->serial = serial; - DEBUG ("created waiter %p for handle %u with serial %u", waiter, handle, serial); + DEBUG ("created waiter %p for handle %u with serial %u", waiter, handle, + serial); return waiter; } @@ -116,7 +122,8 @@ disco_waiter_free (DiscoWaiter *waiter) { g_assert (NULL != waiter); - DEBUG ("freeing waiter %p for handle %u with serial %u", waiter, waiter->handle, waiter->serial); + DEBUG ("freeing waiter %p for handle %u with serial %u", waiter, + waiter->handle, waiter->serial); tp_handle_unref (waiter->repo, waiter->handle); @@ -276,7 +283,8 @@ gabble_presence_cache_class_init (GabblePresenceCacheClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - gabble_marshal_VOID__UINT_UINT_UINT, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); + gabble_marshal_VOID__UINT_UINT_UINT, G_TYPE_NONE, + 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); signals[AVATAR_UPDATE] = g_signal_new ( "avatar-update", G_TYPE_FROM_CLASS (klass), @@ -467,8 +475,8 @@ gabble_presence_cache_status_changed_cb (GabbleConnection *conn, case TP_CONNECTION_STATUS_CONNECTING: g_assert (priv->lm_message_cb == NULL); - priv->lm_message_cb = lm_message_handler_new (gabble_presence_cache_lm_message_cb, - cache, NULL); + priv->lm_message_cb = lm_message_handler_new ( + gabble_presence_cache_lm_message_cb, cache, NULL); lm_connection_register_message_handler (priv->conn->lmconn, priv->lm_message_cb, LM_MESSAGE_TYPE_PRESENCE, @@ -637,7 +645,8 @@ _grab_avatar_sha1 (GabblePresenceCache *cache, * For the moment I'm going to ignore that requirement and * trust that our other resource is getting its sha1 right! */ - /* TODO: I don't trust anyone to get XMPP right, so let's do this. :D */ + /* TODO: I don't trust anyone to get XMPP right, so let's do + * this. :D */ } #endif @@ -733,8 +742,8 @@ _caps_disco_cb (GabbleDisco *disco, jid = tp_handle_inspect (contact_repo, waiter->handle); full_jid = g_strdup_printf ("%s/%s", jid, waiter->resource); - gabble_disco_request (disco, GABBLE_DISCO_TYPE_INFO, full_jid, node, - _caps_disco_cb, cache, G_OBJECT(cache), NULL); + gabble_disco_request (disco, GABBLE_DISCO_TYPE_INFO, full_jid, + node, _caps_disco_cb, cache, G_OBJECT(cache), NULL); waiter->disco_requested = TRUE; break; } @@ -742,11 +751,13 @@ _caps_disco_cb (GabbleDisco *disco, if (NULL != i) { - DEBUG ("sent a retry disco request to %s for URI %s", full_jid, node); + DEBUG ("sent a retry disco request to %s for URI %s", full_jid, + node); } else { - DEBUG ("failed to find a suitable candidate to retry disco request for URI %s", node); + DEBUG ("failed to find a suitable candidate to retry disco " + "request for URI %s", node); /* FIXME do something very clever here? */ g_hash_table_remove (priv->disco_pending, node); } @@ -901,7 +912,8 @@ _process_caps_uri (GabblePresenceCache *cache, if (presence) { GabblePresenceCapabilities save_caps = presence->caps; - gabble_presence_set_capabilities (presence, resource, info->caps, serial); + gabble_presence_set_capabilities (presence, resource, info->caps, + serial); g_signal_emit (cache, signals[CAPABILITIES_UPDATE], 0, handle, save_caps, presence->caps); DEBUG ("caps for %d (%s) now %d", handle, from, presence->caps); @@ -947,11 +959,13 @@ _process_caps_uri (GabblePresenceCache *cache, possible_trust = disco_waiter_list_get_request_count (waiters); - if (!value || info->trust + possible_trust < CAPABILITY_BUNDLE_ENOUGH_TRUST) + if (!value + || info->trust + possible_trust < CAPABILITY_BUNDLE_ENOUGH_TRUST) { /* DISCO */ - DEBUG ("only %u trust out of %u possible thus far, sending disco for URI %s", - info->trust + possible_trust, CAPABILITY_BUNDLE_ENOUGH_TRUST, uri); + DEBUG ("only %u trust out of %u possible thus far, sending " + "disco for URI %s", info->trust + possible_trust, + CAPABILITY_BUNDLE_ENOUGH_TRUST, uri); gabble_disco_request (priv->conn->disco, GABBLE_DISCO_TYPE_INFO, from, uri, _caps_disco_cb, cache, G_OBJECT (cache), NULL); /* enough DISCO for you, buddy */ @@ -983,7 +997,8 @@ _process_caps (GabblePresenceCache *cache, for (i = uris; NULL != i; i = i->next) { - _process_caps_uri (cache, from, (gchar *) i->data, handle, resource, serial); + _process_caps_uri (cache, from, (gchar *) i->data, handle, resource, + serial); g_free (i->data); } diff --git a/src/presence.h b/src/presence.h index b641fcef9..5dedcb26c 100644 --- a/src/presence.h +++ b/src/presence.h @@ -82,20 +82,23 @@ GType gabble_presence_get_type (void); GabblePresence* gabble_presence_new (void); -gboolean gabble_presence_update (GabblePresence *presence, const gchar *resource, GabblePresenceId status, const gchar *status_message, gint8 priority); +gboolean gabble_presence_update (GabblePresence *presence, + const gchar *resource, GabblePresenceId status, + const gchar *status_message, gint8 priority); -void gabble_presence_set_capabilities (GabblePresence *presence, const gchar *resource, GabblePresenceCapabilities caps, guint serial); +void gabble_presence_set_capabilities (GabblePresence *presence, + const gchar *resource, GabblePresenceCapabilities caps, guint serial); -const gchar *gabble_presence_pick_resource_by_caps (GabblePresence *presence, GabblePresenceCapabilities caps); +const gchar *gabble_presence_pick_resource_by_caps (GabblePresence *presence, + GabblePresenceCapabilities caps); -gboolean -gabble_presence_resource_has_caps (GabblePresence *presence, +gboolean gabble_presence_resource_has_caps (GabblePresence *presence, const gchar *resource, GabblePresenceCapabilities caps); -LmMessage *gabble_presence_as_message (GabblePresence *presence, const gchar *resource); -gchar * -gabble_presence_dump (GabblePresence *presence); +LmMessage *gabble_presence_as_message (GabblePresence *presence, + const gchar *resource); +gchar *gabble_presence_dump (GabblePresence *presence); G_END_DECLS diff --git a/src/roster.c b/src/roster.c index 6073c18c4..c4cf237ed 100644 --- a/src/roster.c +++ b/src/roster.c @@ -113,7 +113,8 @@ struct _GabbleRosterItem static void gabble_roster_factory_iface_init (); static void gabble_roster_init (GabbleRoster *roster); -static GObject * gabble_roster_constructor (GType type, guint n_props, GObjectConstructParam *props); +static GObject * gabble_roster_constructor (GType type, guint n_props, + GObjectConstructParam *props); static void gabble_roster_dispose (GObject *object); static void gabble_roster_finalize (GObject *object); static void gabble_roster_set_property (GObject *object, guint property_id, @@ -125,7 +126,8 @@ static void _gabble_roster_item_free (GabbleRosterItem *item); static void item_edit_free (GabbleRosterItemEdit *edits); G_DEFINE_TYPE_WITH_CODE (GabbleRoster, gabble_roster, G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_FACTORY_IFACE, gabble_roster_factory_iface_init)); + G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_FACTORY_IFACE, + gabble_roster_factory_iface_init)); #define GABBLE_ROSTER_GET_PRIVATE(o) ((GabbleRosterPrivate*) ((o)->priv)); @@ -169,25 +171,19 @@ gabble_roster_class_init (GabbleRosterClass *gabble_roster_class) static void gabble_roster_init (GabbleRoster *obj) { - GabbleRosterPrivate *priv = - G_TYPE_INSTANCE_GET_PRIVATE (obj, GABBLE_TYPE_ROSTER, GabbleRosterPrivate); + GabbleRosterPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (obj, + GABBLE_TYPE_ROSTER, GabbleRosterPrivate); obj->priv = priv; - priv->list_channels = g_hash_table_new_full (g_direct_hash, - g_direct_equal, - NULL, - g_object_unref); + priv->list_channels = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, g_object_unref); - priv->group_channels = g_hash_table_new_full (g_direct_hash, - g_direct_equal, - NULL, - g_object_unref); + priv->group_channels = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, g_object_unref); - priv->items = g_hash_table_new_full (g_direct_hash, - g_direct_equal, - NULL, - (GDestroyNotify) _gabble_roster_item_free); + priv->items = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, (GDestroyNotify) _gabble_roster_item_free); } static GObject * @@ -623,7 +619,8 @@ _gabble_roster_item_update (GabbleRoster *roster, DEBUG ("name for contact#%u changed to %s", contact_handle, name); - g_signal_emit (G_OBJECT (roster), signals[NICKNAME_UPDATE], 0, contact_handle); + g_signal_emit (G_OBJECT (roster), signals[NICKNAME_UPDATE], 0, + contact_handle); } old_groups = tp_handle_set_peek (item->groups); /* borrowed */ @@ -635,9 +632,11 @@ _gabble_roster_item_update (GabbleRoster *roster, added_to = tp_handle_set_update (item->groups, new_groups); removed_from2 = tp_handle_set_difference_update (item->groups, removed_from); - DEBUG ("Checking which groups contact#%u was just added to:", contact_handle); + DEBUG ("Checking which groups contact#%u was just added to:", + contact_handle); tp_intset_foreach (added_to, _update_add_to_group, &ctx); - DEBUG ("Checking which groups contact#%u was just removed from:", contact_handle); + DEBUG ("Checking which groups contact#%u was just removed from:", + contact_handle); tp_intset_foreach (removed_from, _update_remove_from_group, &ctx); tp_intset_destroy (added_to); @@ -733,7 +732,8 @@ struct _ItemToMessageContext { static void _gabble_roster_item_put_group_in_message (guint handle, gpointer user_data) { - struct _ItemToMessageContext *ctx = (struct _ItemToMessageContext *)user_data; + struct _ItemToMessageContext *ctx = + (struct _ItemToMessageContext *)user_data; TpHandleRepoIface *group_repo = tp_base_connection_get_handles ( ctx->conn, TP_HANDLE_TYPE_GROUP); const char *name = tp_handle_inspect (group_repo, handle); @@ -871,8 +871,8 @@ _gabble_roster_create_channel (GabbleRoster *roster, } else { - DEBUG ("roster not yet received, not emitting signal for %s list channel", - name); + DEBUG ("roster not yet received, not emitting signal for %s list " + "channel", name); } g_free (object_path); @@ -964,9 +964,11 @@ _gabble_roster_received (GabbleRoster *roster) priv->roster_received = TRUE; - g_hash_table_foreach (priv->list_channels, _gabble_roster_emit_one, &data); + g_hash_table_foreach (priv->list_channels, _gabble_roster_emit_one, + &data); data.handle_type = TP_HANDLE_TYPE_GROUP; - g_hash_table_foreach (priv->group_channels, _gabble_roster_emit_one, &data); + g_hash_table_foreach (priv->group_channels, _gabble_roster_emit_one, + &data); } } @@ -992,7 +994,8 @@ _update_group (gpointer key, gpointer value, gpointer user_data) g_assert (group_handle == update->group_handle); #endif - DEBUG ("Updating group channel %u now message has been received", group_handle); + DEBUG ("Updating group channel %u now message has been received", + group_handle); tp_group_mixin_change_members ((GObject *)group_channel, "", update->contacts_added, update->contacts_removed, empty, empty, 0, 0); @@ -1409,7 +1412,8 @@ gabble_roster_presence_cb (LmMessageHandler *handler, if (from == NULL) { - NODE_DEBUG (pres_node, "presence stanza without from attribute, ignoring"); + NODE_DEBUG (pres_node, "presence stanza without from attribute, " + "ignoring"); return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } @@ -1425,7 +1429,8 @@ gabble_roster_presence_cb (LmMessageHandler *handler, if (handle == conn->self_handle) { - NODE_DEBUG (pres_node, "ignoring presence from ourselves on another resource"); + NODE_DEBUG (pres_node, "ignoring presence from ourselves on another " + "resource"); ret = LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; goto OUT; } @@ -1876,7 +1881,8 @@ roster_item_apply_edits (GabbleRoster *roster, } DEBUG ("Contact#%u did change, sending message", contact); - message = _gabble_roster_item_to_message (roster, contact, NULL, &edited_item); + message = _gabble_roster_item_to_message (roster, contact, NULL, + &edited_item); ret = _gabble_connection_send_with_reply (priv->conn, message, roster_edited_cb, G_OBJECT (roster), GUINT_TO_POINTER(contact), NULL); @@ -2317,7 +2323,8 @@ gabble_roster_handle_remove_from_group (GabbleRoster *roster, } else { - DEBUG ("immediate edit to contact#%u - remove from group#%u", handle, group); + DEBUG ("immediate edit to contact#%u - remove from group#%u", handle, + group); item->unsent_edits = item_edit_new (); } diff --git a/src/roster.h b/src/roster.h index 1dba0e90c..a5749adf1 100644 --- a/src/roster.h +++ b/src/roster.h @@ -68,10 +68,13 @@ typedef enum GabbleRoster *gabble_roster_new (GabbleConnection *); -GabbleRosterSubscription gabble_roster_handle_get_subscription (GabbleRoster *, TpHandle); -gboolean gabble_roster_handle_set_blocked (GabbleRoster *, TpHandle, gboolean, GError **); +GabbleRosterSubscription gabble_roster_handle_get_subscription (GabbleRoster *, + TpHandle); +gboolean gabble_roster_handle_set_blocked (GabbleRoster *, TpHandle, gboolean, + GError **); const gchar *gabble_roster_handle_get_name (GabbleRoster *, TpHandle); -gboolean gabble_roster_handle_set_name (GabbleRoster *, TpHandle, const gchar *, GError **); +gboolean gabble_roster_handle_set_name (GabbleRoster *, TpHandle, + const gchar *, GError **); gboolean gabble_roster_handle_remove (GabbleRoster *, TpHandle, GError **); gboolean gabble_roster_handle_add (GabbleRoster *, TpHandle, GError **); gboolean gabble_roster_handle_has_entry (GabbleRoster *, TpHandle); diff --git a/src/text-mixin.c b/src/text-mixin.c index 5ebf1834a..730628bb9 100644 --- a/src/text-mixin.c +++ b/src/text-mixin.c @@ -124,7 +124,8 @@ gabble_text_mixin_send (GObject *obj, } } - msg = lm_message_new_with_sub_type (recipient, LM_MESSAGE_TYPE_MESSAGE, subtype); + msg = lm_message_new_with_sub_type (recipient, LM_MESSAGE_TYPE_MESSAGE, + subtype); if (mixin->send_nick) { diff --git a/src/text-mixin.h b/src/text-mixin.h index 1811fc5d3..acc8a6425 100644 --- a/src/text-mixin.h +++ b/src/text-mixin.h @@ -40,8 +40,11 @@ struct _GabbleTextMixin gboolean send_nick; }; -#define GABBLE_TEXT_MIXIN_CLASS(o) ((GabbleTextMixinClass *) tp_mixin_offset_cast (o, TP_TEXT_MIXIN_CLASS_OFFSET (o))) -#define GABBLE_TEXT_MIXIN(o) ((GabbleTextMixin *) tp_mixin_offset_cast (o, TP_TEXT_MIXIN_OFFSET (o))) +#define GABBLE_TEXT_MIXIN_CLASS(o) \ + ((GabbleTextMixinClass *) tp_mixin_offset_cast (o,\ + TP_TEXT_MIXIN_CLASS_OFFSET (o))) +#define GABBLE_TEXT_MIXIN(o) \ + ((GabbleTextMixin *) tp_mixin_offset_cast (o, TP_TEXT_MIXIN_OFFSET (o))) #define TP_CHANNEL_SEND_NO_ERROR ((TpChannelTextSendError)-1) diff --git a/src/util.h b/src/util.h index 3f1b026bb..efd8fe958 100644 --- a/src/util.h +++ b/src/util.h @@ -30,12 +30,17 @@ #include "gabble-types.h" gchar *sha1_hex (const gchar *bytes, guint len); -void lm_message_node_add_own_nick (LmMessageNode *node, GabbleConnection *conn); +void lm_message_node_add_own_nick (LmMessageNode *node, + GabbleConnection *conn); void lm_message_node_unlink (LmMessageNode *orphan); -void lm_message_node_steal_children (LmMessageNode *snatcher, LmMessageNode *mum); -gboolean lm_message_node_has_namespace (LmMessageNode *node, const gchar *ns, const gchar *tag); -LmMessageNode *lm_message_node_get_child_with_namespace (LmMessageNode *node, const gchar *name, const gchar *ns); -G_GNUC_NULL_TERMINATED LmMessage *lm_message_build (const gchar *to, LmMessageType type, guint spec, ...); +void lm_message_node_steal_children (LmMessageNode *snatcher, + LmMessageNode *mum); +gboolean lm_message_node_has_namespace (LmMessageNode *node, const gchar *ns, + const gchar *tag); +LmMessageNode *lm_message_node_get_child_with_namespace (LmMessageNode *node, + const gchar *name, const gchar *ns); +G_GNUC_NULL_TERMINATED LmMessage *lm_message_build (const gchar *to, + LmMessageType type, guint spec, ...); /* format: a@b/c */ void gabble_decode_jid (const gchar *jid, gchar **a, gchar **b, gchar **c); diff --git a/src/vcard-manager.c b/src/vcard-manager.c index 0223c081b..c1df08781 100644 --- a/src/vcard-manager.c +++ b/src/vcard-manager.c @@ -129,7 +129,8 @@ gabble_vcard_manager_cache_quark (void) return quark; } -#define GABBLE_VCARD_MANAGER_GET_PRIVATE(o) ((GabbleVCardManagerPrivate*)((o)->priv)); +#define GABBLE_VCARD_MANAGER_GET_PRIVATE(o)\ + ((GabbleVCardManagerPrivate*)((o)->priv)); static void cache_entry_free (void *data); static gint cache_entry_compare (gconstpointer a, gconstpointer b); @@ -138,7 +139,8 @@ static void gabble_vcard_manager_init (GabbleVCardManager *obj) { GabbleVCardManagerPrivate *priv = - G_TYPE_INSTANCE_GET_PRIVATE (obj, GABBLE_TYPE_VCARD_MANAGER, GabbleVCardManagerPrivate); + G_TYPE_INSTANCE_GET_PRIVATE (obj, GABBLE_TYPE_VCARD_MANAGER, + GabbleVCardManagerPrivate); obj->priv = priv; priv->cache = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, @@ -147,10 +149,10 @@ gabble_vcard_manager_init (GabbleVCardManager *obj) priv->timed_cache = tp_heap_new (cache_entry_compare, NULL); } -static void gabble_vcard_manager_set_property (GObject *object, guint property_id, - const GValue *value, GParamSpec *pspec); -static void gabble_vcard_manager_get_property (GObject *object, guint property_id, - GValue *value, GParamSpec *pspec); +static void gabble_vcard_manager_set_property (GObject *object, + guint property_id, const GValue *value, GParamSpec *pspec); +static void gabble_vcard_manager_get_property (GObject *object, + guint property_id, GValue *value, GParamSpec *pspec); static void gabble_vcard_manager_dispose (GObject *object); static void gabble_vcard_manager_finalize (GObject *object); @@ -160,7 +162,8 @@ gabble_vcard_manager_class_init (GabbleVCardManagerClass *gabble_vcard_manager_c GObjectClass *object_class = G_OBJECT_CLASS (gabble_vcard_manager_class); GParamSpec *param_spec; - g_type_class_add_private (gabble_vcard_manager_class, sizeof (GabbleVCardManagerPrivate)); + g_type_class_add_private (gabble_vcard_manager_class, + sizeof (GabbleVCardManagerPrivate)); object_class->get_property = gabble_vcard_manager_get_property; object_class->set_property = gabble_vcard_manager_set_property; @@ -354,7 +357,8 @@ static void cache_entry_attempt_to_free (GabbleVCardManager *manager, TpHandle handle) { GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager); - GabbleVCardCacheEntry *entry = g_hash_table_lookup (priv->cache, GUINT_TO_POINTER (handle)); + GabbleVCardCacheEntry *entry = g_hash_table_lookup (priv->cache, + GUINT_TO_POINTER (handle)); if (!entry || entry->message || entry->pending_requests) return; @@ -365,10 +369,12 @@ cache_entry_attempt_to_free (GabbleVCardManager *manager, TpHandle handle) } void -gabble_vcard_manager_invalidate_cache (GabbleVCardManager *manager, TpHandle handle) +gabble_vcard_manager_invalidate_cache (GabbleVCardManager *manager, + TpHandle handle) { GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager); - GabbleVCardCacheEntry *entry = g_hash_table_lookup (priv->cache, GUINT_TO_POINTER (handle)); + GabbleVCardCacheEntry *entry = g_hash_table_lookup (priv->cache, + GUINT_TO_POINTER (handle)); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( (TpBaseConnection *)priv->connection, TP_HANDLE_TYPE_CONTACT); @@ -407,12 +413,15 @@ cache_entry_fill (GabbleVCardManager *manager, LmMessage *msg, TpHandle handle) { GabbleVCardCacheEntry *first = tp_heap_peek_first (priv->timed_cache); priv->cache_timer = g_timeout_add ((first->received + - VCARD_CACHE_ENTRY_TTL - time (NULL)) * 1000, cache_entry_timeout, manager); + VCARD_CACHE_ENTRY_TTL - time (NULL)) * 1000, cache_entry_timeout, + manager); } } static void -complete_pending_requests (GabbleVCardManager *manager, TpHandle handle, GError *err) +complete_pending_requests (GabbleVCardManager *manager, + TpHandle handle, + GError *err) { GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager); GabbleVCardCacheEntry *entry = @@ -448,7 +457,9 @@ complete_pending_requests (GabbleVCardManager *manager, TpHandle handle, GError } static void -complete_one_request (GabbleVCardManagerRequest *request, gpointer data, GError *err) +complete_one_request (GabbleVCardManagerRequest *request, + gpointer data, + GError *err) { GabbleVCardManager *manager = request->manager; TpHandle handle = request->handle; @@ -641,7 +652,8 @@ gabble_vcard_manager_new (GabbleConnection *conn) g_return_val_if_fail (GABBLE_IS_CONNECTION (conn), NULL); - self = GABBLE_VCARD_MANAGER (g_object_new (GABBLE_TYPE_VCARD_MANAGER, "connection", conn, NULL)); + self = GABBLE_VCARD_MANAGER (g_object_new (GABBLE_TYPE_VCARD_MANAGER, + "connection", conn, NULL)); g_signal_connect (conn, "status-changed", G_CALLBACK (status_changed_cb), self); return self; @@ -677,7 +689,8 @@ delete_request (GabbleVCardManagerRequest *request) GabbleVCardPipelineItem *item = l->data; if (item->request == request) { - priv->request_pipeline = g_slist_remove (priv->request_pipeline, item); + priv->request_pipeline = g_slist_remove (priv->request_pipeline, + item); lm_message_unref (item->msg); g_free (item); break; @@ -692,7 +705,8 @@ delete_request (GabbleVCardManagerRequest *request) if (NULL != request->bound_object) { - g_object_weak_unref (request->bound_object, notify_delete_request, request); + g_object_weak_unref (request->bound_object, notify_delete_request, + request); } if (0 != request->timer_id) @@ -702,7 +716,8 @@ delete_request (GabbleVCardManagerRequest *request) tp_handle_unref (contact_repo, request->handle); - entry = g_hash_table_lookup (priv->cache, GUINT_TO_POINTER (request->handle)); + entry = g_hash_table_lookup (priv->cache, + GUINT_TO_POINTER (request->handle)); if (entry) { if (request == entry->request) @@ -711,7 +726,8 @@ delete_request (GabbleVCardManagerRequest *request) } else { - entry->pending_requests = g_slist_remove (entry->pending_requests, request); + entry->pending_requests = g_slist_remove (entry->pending_requests, + request); } } @@ -897,7 +913,7 @@ replace_reply_cb (GabbleConnection *conn, LmMessage *sent_msg, return LM_HANDLER_RESULT_REMOVE_MESSAGE; } -static GabbleVCardManagerRequest *request_send (GabbleVCardManagerRequest *request, +static GabbleVCardManagerRequest *request_send (GabbleVCardManagerRequest *, LmMessageNode *replacement, const gchar *jid, GError **error); static LmHandlerResult @@ -1020,8 +1036,8 @@ request_reply_cb (GabbleConnection *conn, } else { - GabbleVCardCacheEntry *entry = - g_hash_table_lookup (priv->cache, GUINT_TO_POINTER (request->handle)); + GabbleVCardCacheEntry *entry = g_hash_table_lookup (priv->cache, + GUINT_TO_POINTER (request->handle)); if (entry) { @@ -1060,8 +1076,8 @@ vcard_pipeline_send_next_request (GabbleVCardManager *manager) if (!_gabble_connection_send_with_reply (priv->connection, item->msg, item->callback, G_OBJECT(manager), item->request, &error)) { - GabbleVCardCacheEntry *entry = - g_hash_table_lookup (priv->cache, GUINT_TO_POINTER (item->request->handle)); + GabbleVCardCacheEntry *entry = g_hash_table_lookup (priv->cache, + GUINT_TO_POINTER (item->request->handle)); if (entry && entry->request == item->request) { entry->request = NULL; @@ -1076,7 +1092,8 @@ vcard_pipeline_send_next_request (GabbleVCardManager *manager) } else { - priv->reqs_in_flight = g_slist_prepend (priv->reqs_in_flight, item->request); + priv->reqs_in_flight = g_slist_prepend (priv->reqs_in_flight, + item->request); } lm_message_unref (item->msg); @@ -1229,7 +1246,8 @@ gabble_vcard_manager_request (GabbleVCardManager *self, if (entry->request) { DEBUG ("adding pending request to existing cache entry %p", entry); - entry->pending_requests = g_slist_prepend (entry->pending_requests, request); + entry->pending_requests = g_slist_prepend (entry->pending_requests, + request); } else { @@ -1239,8 +1257,10 @@ gabble_vcard_manager_request (GabbleVCardManager *self, tp_handle_ref (contact_repo, handle); priv->requests = g_slist_prepend (priv->requests, entry->request); - entry->pending_requests = g_slist_prepend (entry->pending_requests, request); - DEBUG ("adding the request to new entry %p and sending the request", entry); + entry->pending_requests = g_slist_prepend (entry->pending_requests, + request); + DEBUG ("adding the request to new entry %p and sending the request", + entry); if (!request_send (entry->request, NULL, jid, error)) { diff --git a/src/vcard-manager.h b/src/vcard-manager.h index c81f9038f..8d3acb74b 100644 --- a/src/vcard-manager.h +++ b/src/vcard-manager.h @@ -54,15 +54,18 @@ GType gabble_vcard_manager_get_type (void); #define GABBLE_TYPE_VCARD_MANAGER \ (gabble_vcard_manager_get_type ()) #define GABBLE_VCARD_MANAGER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_VCARD_MANAGER, GabbleVCardManager)) + (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_VCARD_MANAGER, \ + GabbleVCardManager)) #define GABBLE_VCARD_MANAGER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_VCARD_MANAGER, GabbleVCardManagerClass)) + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_VCARD_MANAGER, \ + GabbleVCardManagerClass)) #define GABBLE_IS_VCARD_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_VCARD_MANAGER)) #define GABBLE_IS_VCARD_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_VCARD_MANAGER)) #define GABBLE_VCARD_MANAGER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_VCARD_MANAGER, GabbleVCardManagerClass)) + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_VCARD_MANAGER, \ + GabbleVCardManagerClass)) struct _GabbleVCardManagerClass { GObjectClass parent_class; |