diff options
Diffstat (limited to 'libempathy')
56 files changed, 107 insertions, 123 deletions
diff --git a/libempathy/.gitignore b/libempathy/.gitignore index 8617dcbd0..5cc6b3397 100644 --- a/libempathy/.gitignore +++ b/libempathy/.gitignore @@ -1,4 +1,5 @@ empathy-chandler-glue.h +empathy-dtd-resources.[ch] empathy-marshal.* empathy-filter-glue.h tp-stream-engine-gen.h diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am index 36de4d6c2..5f4059f20 100644 --- a/libempathy/Makefile.am +++ b/libempathy/Makefile.am @@ -2,8 +2,7 @@ include $(top_srcdir)/tools/flymake.mk AM_CPPFLAGS = \ $(ERROR_CFLAGS) \ - -I. \ - -I$(top_srcdir) \ + -I$(top_srcdir)/extensions \ -I$(top_builddir) \ -DDATADIR=\""$(datadir)"\" \ -DLOCALEDIR=\""$(datadir)/locale"\" \ @@ -21,6 +20,8 @@ AM_CPPFLAGS = \ $(DISABLE_DEPRECATED) BUILT_SOURCES = \ + empathy-dtd-resources.c \ + empathy-dtd-resources.h \ empathy-enum-types.h \ empathy-enum-types.c @@ -134,8 +135,7 @@ libempathy_la_LIBADD = \ $(UOA_LIBS) \ $(LIBM) -dtddir = $(datadir)/empathy -dtd_DATA = \ +dtd_resources_files = \ empathy-status-presets.dtd \ empathy-contact-groups.dtd \ empathy-chatroom-manager.dtd \ @@ -145,8 +145,17 @@ ircnetworksdir = $(datadir)/empathy ircnetworks_DATA = \ irc-networks.xml -EXTRA_DIST = \ - $(dtd_DATA) \ +dtd_resource_files: $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/empathy-dtd.gresource.xml) + +empathy-dtd-resources.c: empathy-dtd.gresource.xml $(dtd_resource_files) + $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $< + +empathy-dtd-resources.h: empathy-dtd.gresource.xml $(dtd_resource_files) + $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header $< + +EXTRA_DIST = \ + empathy-dtd.gresource.xml \ + $(dtd_resources_files) \ $(ircnetworks_DATA) CLEANFILES = \ @@ -189,7 +198,7 @@ stamp-empathy-enum-types.h: $(libempathy_headers) Makefile --fhead "G_BEGIN_DECLS\n\n" \ --ftail "G_END_DECLS\n\n" \ --ftail "#endif /* __LIBEMPATHY_ENUM_TYPES_H__ */\n" \ - --fprod "#include <libempathy/@filename@>\n" \ + --fprod '#include "@filename@"\n' \ --eprod "#define EMPATHY_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \ --eprod "GType @enum_name@_get_type (void);\n" \ $(libempathy_headers) ) > xgen-gth \ diff --git a/libempathy/cheese-camera-device-monitor.c b/libempathy/cheese-camera-device-monitor.c index 3b937ce9a..0e868f2b6 100644 --- a/libempathy/cheese-camera-device-monitor.c +++ b/libempathy/cheese-camera-device-monitor.c @@ -69,7 +69,7 @@ G_DEFINE_TYPE (EmpathyCameraDeviceMonitor, empathy_camera_device_monitor, G_TYPE #define EMPATHY_CAMERA_DEVICE_MONITOR_ERROR empathy_camera_device_monitor_error_quark () #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" enum EmpathyCameraDeviceMonitorError { diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c index 12b28b8ba..064d4d215 100644 --- a/libempathy/empathy-account-settings.c +++ b/libempathy/empathy-account-settings.c @@ -19,15 +19,15 @@ */ #include "config.h" - #include "empathy-account-settings.h" + #include "empathy-connection-managers.h" #include "empathy-keyring.h" -#include "empathy-utils.h" #include "empathy-presence-manager.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAccountSettings) diff --git a/libempathy/empathy-account-settings.h b/libempathy/empathy-account-settings.h index 162def48c..6e4713c4c 100644 --- a/libempathy/empathy-account-settings.h +++ b/libempathy/empathy-account-settings.h @@ -23,7 +23,6 @@ #include <glib-object.h> #include <gio/gio.h> - #include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS diff --git a/libempathy/empathy-auth-factory.c b/libempathy/empathy-auth-factory.c index b2f2b802f..cba4607a3 100644 --- a/libempathy/empathy-auth-factory.c +++ b/libempathy/empathy-auth-factory.c @@ -19,11 +19,8 @@ */ #include "config.h" - #include "empathy-auth-factory.h" -#define DEBUG_FLAG EMPATHY_DEBUG_TLS -#include "empathy-debug.h" #include "empathy-keyring.h" #include "empathy-sasl-mechanisms.h" #include "empathy-server-sasl-handler.h" @@ -38,7 +35,10 @@ #include "empathy-uoa-auth-handler.h" #endif /* HAVE_UOA */ -#include "extensions/extensions.h" +#include "extensions.h" + +#define DEBUG_FLAG EMPATHY_DEBUG_TLS +#include "empathy-debug.h" G_DEFINE_TYPE (EmpathyAuthFactory, empathy_auth_factory, TP_TYPE_BASE_CLIENT); diff --git a/libempathy/empathy-auth-factory.h b/libempathy/empathy-auth-factory.h index 16d6ad34f..73e905782 100644 --- a/libempathy/empathy-auth-factory.h +++ b/libempathy/empathy-auth-factory.h @@ -22,7 +22,6 @@ #define __EMPATHY_AUTH_FACTORY_H__ #include <glib-object.h> - #include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS diff --git a/libempathy/empathy-camera-monitor.c b/libempathy/empathy-camera-monitor.c index 1e603e989..6e6691120 100644 --- a/libempathy/empathy-camera-monitor.c +++ b/libempathy/empathy-camera-monitor.c @@ -19,8 +19,8 @@ */ #include "config.h" - #include "empathy-camera-monitor.h" + #include "cheese-camera-device-monitor.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER diff --git a/libempathy/empathy-chatroom-manager.c b/libempathy/empathy-chatroom-manager.c index ebdc50433..3f1828612 100644 --- a/libempathy/empathy-chatroom-manager.c +++ b/libempathy/empathy-chatroom-manager.c @@ -22,18 +22,18 @@ */ #include "config.h" +#include "empathy-chatroom-manager.h" #include <sys/stat.h> #include "empathy-client-factory.h" -#include "empathy-chatroom-manager.h" #include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER #include "empathy-debug.h" #define CHATROOMS_XML_FILENAME "chatrooms.xml" -#define CHATROOMS_DTD_FILENAME "empathy-chatroom-manager.dtd" +#define CHATROOMS_DTD_RESOURCENAME "/org/gnome/Empathy/empathy-chatroom-manager.dtd" #define SAVE_TIMER 4 static EmpathyChatroomManager *chatroom_manager_singleton = NULL; @@ -320,7 +320,7 @@ chatroom_manager_file_parse (EmpathyChatroomManager *manager, return FALSE; } - if (!empathy_xml_validate (doc, CHATROOMS_DTD_FILENAME)) + if (!empathy_xml_validate_from_resource (doc, CHATROOMS_DTD_RESOURCENAME)) { g_warning ("Failed to validate file:'%s'", filename); xmlFreeDoc (doc); diff --git a/libempathy/empathy-chatroom-manager.h b/libempathy/empathy-chatroom-manager.h index b8232dc64..498d225ad 100644 --- a/libempathy/empathy-chatroom-manager.h +++ b/libempathy/empathy-chatroom-manager.h @@ -25,7 +25,6 @@ #define __EMPATHY_CHATROOM_MANAGER_H__ #include <glib-object.h> - #include <telepathy-glib/telepathy-glib.h> #include "empathy-chatroom.h" diff --git a/libempathy/empathy-chatroom.c b/libempathy/empathy-chatroom.c index dcc72d5f7..32bb4ce30 100644 --- a/libempathy/empathy-chatroom.c +++ b/libempathy/empathy-chatroom.c @@ -20,8 +20,8 @@ */ #include "config.h" - #include "empathy-chatroom.h" + #include "empathy-utils.h" #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChatroom) diff --git a/libempathy/empathy-chatroom.h b/libempathy/empathy-chatroom.h index 57ca685cb..98ed04b96 100644 --- a/libempathy/empathy-chatroom.h +++ b/libempathy/empathy-chatroom.h @@ -23,10 +23,9 @@ #define __EMPATHY_CHATROOM_H__ #include <glib-object.h> - #include <telepathy-glib/telepathy-glib.h> -#include <libempathy/empathy-tp-chat.h> +#include "empathy-tp-chat.h" G_BEGIN_DECLS diff --git a/libempathy/empathy-client-factory.c b/libempathy/empathy-client-factory.c index 1c8fc58cf..39760998c 100644 --- a/libempathy/empathy-client-factory.c +++ b/libempathy/empathy-client-factory.c @@ -20,7 +20,6 @@ */ #include "config.h" - #include "empathy-client-factory.h" #include "empathy-tp-chat.h" diff --git a/libempathy/empathy-connection-aggregator.c b/libempathy/empathy-connection-aggregator.c index 83e15f15d..763715f9e 100644 --- a/libempathy/empathy-connection-aggregator.c +++ b/libempathy/empathy-connection-aggregator.c @@ -19,7 +19,6 @@ */ #include "config.h" - #include "empathy-connection-aggregator.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER diff --git a/libempathy/empathy-connection-aggregator.h b/libempathy/empathy-connection-aggregator.h index 71e6e4392..267b20937 100644 --- a/libempathy/empathy-connection-aggregator.h +++ b/libempathy/empathy-connection-aggregator.h @@ -22,7 +22,6 @@ #define __EMPATHY_CONNECTION_AGGREGATOR_H__ #include <glib-object.h> - #include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS diff --git a/libempathy/empathy-connection-managers.c b/libempathy/empathy-connection-managers.c index abf862bca..b94ac1253 100644 --- a/libempathy/empathy-connection-managers.c +++ b/libempathy/empathy-connection-managers.c @@ -19,12 +19,12 @@ */ #include "config.h" - #include "empathy-connection-managers.h" + #include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" static GObject *managers = NULL; diff --git a/libempathy/empathy-connection-managers.h b/libempathy/empathy-connection-managers.h index d8bcb390a..0ed20c934 100644 --- a/libempathy/empathy-connection-managers.h +++ b/libempathy/empathy-connection-managers.h @@ -23,7 +23,6 @@ #include <glib-object.h> #include <gio/gio.h> - #include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS diff --git a/libempathy/empathy-contact-groups.c b/libempathy/empathy-contact-groups.c index 8d49f0519..81a1b3133 100644 --- a/libempathy/empathy-contact-groups.c +++ b/libempathy/empathy-contact-groups.c @@ -21,17 +21,17 @@ */ #include "config.h" +#include "empathy-contact-groups.h" #include <sys/stat.h> #include "empathy-utils.h" -#include "empathy-contact-groups.h" #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT #include "empathy-debug.h" #define CONTACT_GROUPS_XML_FILENAME "contact-groups.xml" -#define CONTACT_GROUPS_DTD_FILENAME "empathy-contact-groups.dtd" +#define CONTACT_GROUPS_DTD_RESOURCENAME "/org/gnome/Empathy/empathy-contact-groups.dtd" typedef struct { gchar *name; @@ -91,7 +91,7 @@ contact_groups_file_parse (const gchar *filename) return; } - if (!empathy_xml_validate (doc, CONTACT_GROUPS_DTD_FILENAME)) { + if (!empathy_xml_validate_from_resource (doc, CONTACT_GROUPS_DTD_RESOURCENAME)) { g_warning ("Failed to validate file:'%s'", filename); xmlFreeDoc (doc); xmlFreeParserCtxt (ctxt); diff --git a/libempathy/empathy-contact-groups.h b/libempathy/empathy-contact-groups.h index 181b28753..0be1c81b3 100644 --- a/libempathy/empathy-contact-groups.h +++ b/libempathy/empathy-contact-groups.h @@ -23,10 +23,10 @@ #ifndef __EMPATHY_CONTACT_GROUPS_H__ #define __EMPATHY_CONTACT_GROUPS_H__ -G_BEGIN_DECLS - #include <glib.h> +G_BEGIN_DECLS + void empathy_contact_groups_get_all (void); gboolean empathy_contact_group_get_expanded (const gchar *group); diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index 3c91e6319..356104434 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -20,6 +20,7 @@ */ #include "config.h" +#include "empathy-contact.h" #ifdef HAVE_GEOCODE #include <geocode-glib/geocode-glib.h> diff --git a/libempathy/empathy-contact.h b/libempathy/empathy-contact.h index 14c3f6440..e7ce10e4b 100644 --- a/libempathy/empathy-contact.h +++ b/libempathy/empathy-contact.h @@ -23,7 +23,6 @@ #define __EMPATHY_CONTACT_H__ #include <glib-object.h> - #include <telepathy-glib/telepathy-glib.h> #include <telepathy-logger/telepathy-logger.h> #include <folks/folks.h> diff --git a/libempathy/empathy-debug.c b/libempathy/empathy-debug.c index 09573c39a..75900f4ad 100644 --- a/libempathy/empathy-debug.c +++ b/libempathy/empathy-debug.c @@ -19,7 +19,6 @@ */ #include "config.h" - #include "empathy-debug.h" #ifdef ENABLE_DEBUG diff --git a/libempathy/empathy-debug.h b/libempathy/empathy-debug.h index e6b93cc7a..5a600602b 100644 --- a/libempathy/empathy-debug.h +++ b/libempathy/empathy-debug.h @@ -21,9 +21,6 @@ #ifndef __EMPATHY_DEBUG_H__ #define __EMPATHY_DEBUG_H__ -#include "config.h" - - #include <glib.h> #include <telepathy-glib/telepathy-glib.h> diff --git a/libempathy/empathy-dtd.gresource.xml b/libempathy/empathy-dtd.gresource.xml new file mode 100644 index 000000000..76cc81702 --- /dev/null +++ b/libempathy/empathy-dtd.gresource.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gresources> + <gresource prefix="/org/gnome/Empathy"> + <file>empathy-status-presets.dtd</file> + <file>empathy-contact-groups.dtd</file> + <file>empathy-chatroom-manager.dtd</file> + <file>empathy-irc-networks.dtd</file> + </gresource> +</gresources> + diff --git a/libempathy/empathy-ft-factory.c b/libempathy/empathy-ft-factory.c index 9cf90014b..855ddb98f 100644 --- a/libempathy/empathy-ft-factory.c +++ b/libempathy/empathy-ft-factory.c @@ -21,7 +21,9 @@ /* empathy-ft-factory.c */ +#include "config.h" #include "empathy-ft-factory.h" + #include "empathy-request-util.h" #include "empathy-utils.h" diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c index 30711c7d1..96c8e47f5 100644 --- a/libempathy/empathy-ft-handler.c +++ b/libempathy/empathy-ft-handler.c @@ -22,10 +22,10 @@ /* empathy-ft-handler.c */ #include "config.h" +#include "empathy-ft-handler.h" #include <glib/gi18n-lib.h> -#include "empathy-ft-handler.h" #include "empathy-time.h" #include "empathy-utils.h" diff --git a/libempathy/empathy-ft-handler.h b/libempathy/empathy-ft-handler.h index a120f241b..2fc1b609f 100644 --- a/libempathy/empathy-ft-handler.h +++ b/libempathy/empathy-ft-handler.h @@ -26,7 +26,6 @@ #include <glib-object.h> #include <gio/gio.h> - #include <telepathy-glib/telepathy-glib.h> #include "empathy-contact.h" diff --git a/libempathy/empathy-goa-auth-handler.c b/libempathy/empathy-goa-auth-handler.c index 3659b3728..379730004 100644 --- a/libempathy/empathy-goa-auth-handler.c +++ b/libempathy/empathy-goa-auth-handler.c @@ -19,14 +19,15 @@ */ #include "config.h" +#include "empathy-goa-auth-handler.h" #define GOA_API_IS_SUBJECT_TO_CHANGE /* awesome! */ #include <goa/goa.h> +#include "empathy-sasl-mechanisms.h" + #define DEBUG_FLAG EMPATHY_DEBUG_SASL #include "empathy-debug.h" -#include "empathy-goa-auth-handler.h" -#include "empathy-sasl-mechanisms.h" struct _EmpathyGoaAuthHandlerPriv { diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c index f3c7565a1..71960b5d2 100644 --- a/libempathy/empathy-individual-manager.c +++ b/libempathy/empathy-individual-manager.c @@ -21,8 +21,8 @@ */ #include "config.h" - #include "empathy-individual-manager.h" + #include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT diff --git a/libempathy/empathy-irc-network-manager.c b/libempathy/empathy-irc-network-manager.c index 7f6ed9df8..3f53a49ad 100644 --- a/libempathy/empathy-irc-network-manager.c +++ b/libempathy/empathy-irc-network-manager.c @@ -19,16 +19,16 @@ */ #include "config.h" +#include "empathy-irc-network-manager.h" #include <sys/stat.h> #include "empathy-utils.h" -#include "empathy-irc-network-manager.h" #define DEBUG_FLAG EMPATHY_DEBUG_IRC #include "empathy-debug.h" -#define IRC_NETWORKS_DTD_FILENAME "empathy-irc-networks.dtd" +#define IRC_NETWORKS_DTD_RESOURCENAME "/org/gnome/Empathy/empathy-irc-networks.dtd" #define IRC_NETWORKS_FILENAME "irc-networks.xml" #define SAVE_TIMER 4 @@ -632,7 +632,7 @@ irc_network_manager_file_parse (EmpathyIrcNetworkManager *self, return FALSE; } - if (!empathy_xml_validate (doc, IRC_NETWORKS_DTD_FILENAME)) { + if (!empathy_xml_validate_from_resource (doc, IRC_NETWORKS_DTD_RESOURCENAME)) { g_warning ("Failed to validate file:'%s'", filename); xmlFreeDoc (doc); xmlFreeParserCtxt (ctxt); diff --git a/libempathy/empathy-irc-network.c b/libempathy/empathy-irc-network.c index e0bc84f7d..e01116e96 100644 --- a/libempathy/empathy-irc-network.c +++ b/libempathy/empathy-irc-network.c @@ -20,8 +20,8 @@ */ #include "config.h" - #include "empathy-irc-network.h" + #include "empathy-utils.h" #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIrcNetwork) diff --git a/libempathy/empathy-irc-server.c b/libempathy/empathy-irc-server.c index 5457f23a1..75eb016dd 100644 --- a/libempathy/empathy-irc-server.c +++ b/libempathy/empathy-irc-server.c @@ -19,8 +19,8 @@ */ #include "config.h" - #include "empathy-irc-server.h" + #include "empathy-utils.h" #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIrcServer) diff --git a/libempathy/empathy-keyring.c b/libempathy/empathy-keyring.c index 837b2d519..40667342f 100644 --- a/libempathy/empathy-keyring.c +++ b/libempathy/empathy-keyring.c @@ -17,11 +17,9 @@ */ #include "config.h" - -#include <glib/gi18n-lib.h> - #include "empathy-keyring.h" +#include <glib/gi18n-lib.h> #include <libsecret/secret.h> #ifdef HAVE_UOA @@ -51,12 +49,6 @@ static const SecretSchema room_keyring_schema = { "room-id", SECRET_SCHEMA_ATTRIBUTE_STRING }, { NULL } } }; -gboolean -empathy_keyring_is_available (void) -{ - return TRUE; -} - /* get */ static void diff --git a/libempathy/empathy-keyring.h b/libempathy/empathy-keyring.h index 7e945dc02..8a426a037 100644 --- a/libempathy/empathy-keyring.h +++ b/libempathy/empathy-keyring.h @@ -20,13 +20,10 @@ #define __EMPATHY_KEYRING_H__ #include <gio/gio.h> - #include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS -gboolean empathy_keyring_is_available (void); - void empathy_keyring_get_account_password_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data); diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c index e19f69b09..1115eddda 100644 --- a/libempathy/empathy-message.c +++ b/libempathy/empathy-message.c @@ -23,11 +23,11 @@ */ #include "config.h" +#include "empathy-message.h" #include <glib/gi18n-lib.h> #include "empathy-client-factory.h" -#include "empathy-message.h" #include "empathy-time.h" #include "empathy-utils.h" #include "empathy-enum-types.h" diff --git a/libempathy/empathy-pkg-kit.c b/libempathy/empathy-pkg-kit.c index 1d01b931d..21f703b68 100644 --- a/libempathy/empathy-pkg-kit.c +++ b/libempathy/empathy-pkg-kit.c @@ -19,8 +19,7 @@ */ #include "config.h" - -#include <libempathy/empathy-pkg-kit.h> +#include "empathy-pkg-kit.h" typedef struct { diff --git a/libempathy/empathy-presence-manager.c b/libempathy/empathy-presence-manager.c index cdc45fbe9..1c288fb98 100644 --- a/libempathy/empathy-presence-manager.c +++ b/libempathy/empathy-presence-manager.c @@ -19,7 +19,6 @@ */ #include "config.h" - #include "empathy-presence-manager.h" #include "empathy-utils.h" diff --git a/libempathy/empathy-presence-manager.h b/libempathy/empathy-presence-manager.h index 6357aeecd..f616647ad 100644 --- a/libempathy/empathy-presence-manager.h +++ b/libempathy/empathy-presence-manager.h @@ -22,7 +22,6 @@ #define __EMPATHY_PRESENCE_MANAGER_H__ #include <glib.h> - #include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS diff --git a/libempathy/empathy-request-util.c b/libempathy/empathy-request-util.c index 8532da57b..c5f693f04 100644 --- a/libempathy/empathy-request-util.c +++ b/libempathy/empathy-request-util.c @@ -20,11 +20,10 @@ */ #include "config.h" - #include "empathy-request-util.h" #define DEBUG_FLAG EMPATHY_DEBUG_DISPATCHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" void empathy_chat_with_contact (EmpathyContact *contact, diff --git a/libempathy/empathy-request-util.h b/libempathy/empathy-request-util.h index 497c65ee5..9c168d7a3 100644 --- a/libempathy/empathy-request-util.h +++ b/libempathy/empathy-request-util.h @@ -23,7 +23,6 @@ #include <glib.h> #include <gio/gio.h> - #include <telepathy-glib/telepathy-glib.h> #include "empathy-contact.h" diff --git a/libempathy/empathy-sasl-mechanisms.c b/libempathy/empathy-sasl-mechanisms.c index 303bf9e3e..a6829c450 100644 --- a/libempathy/empathy-sasl-mechanisms.c +++ b/libempathy/empathy-sasl-mechanisms.c @@ -19,13 +19,13 @@ */ #include "config.h" +#include "empathy-sasl-mechanisms.h" #include <libsoup/soup.h> #define DEBUG_FLAG EMPATHY_DEBUG_SASL #include "empathy-debug.h" #include "empathy-utils.h" -#include "empathy-sasl-mechanisms.h" #define MECH_FACEBOOK "X-FACEBOOK-PLATFORM" #define MECH_WLM "X-MESSENGER-OAUTH2" diff --git a/libempathy/empathy-server-sasl-handler.c b/libempathy/empathy-server-sasl-handler.c index bdca7b623..b18d1a735 100644 --- a/libempathy/empathy-server-sasl-handler.c +++ b/libempathy/empathy-server-sasl-handler.c @@ -18,15 +18,14 @@ */ #include "config.h" - #include "empathy-server-sasl-handler.h" -#include <extensions/extensions.h> +#include "empathy-keyring.h" +#include "empathy-sasl-mechanisms.h" +#include "extensions.h" #define DEBUG_FLAG EMPATHY_DEBUG_SASL #include "empathy-debug.h" -#include "empathy-keyring.h" -#include "empathy-sasl-mechanisms.h" enum { PROP_CHANNEL = 1, diff --git a/libempathy/empathy-server-sasl-handler.h b/libempathy/empathy-server-sasl-handler.h index d25d90ab7..8bf7e3b7f 100644 --- a/libempathy/empathy-server-sasl-handler.h +++ b/libempathy/empathy-server-sasl-handler.h @@ -22,7 +22,6 @@ #include <glib-object.h> #include <gio/gio.h> - #include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS diff --git a/libempathy/empathy-server-tls-handler.c b/libempathy/empathy-server-tls-handler.c index d58155f58..34c3147a3 100644 --- a/libempathy/empathy-server-tls-handler.c +++ b/libempathy/empathy-server-tls-handler.c @@ -19,14 +19,13 @@ */ #include "config.h" - #include "empathy-server-tls-handler.h" -#define DEBUG_FLAG EMPATHY_DEBUG_TLS -#include "empathy-debug.h" #include "empathy-utils.h" +#include "extensions.h" -#include "extensions/extensions.h" +#define DEBUG_FLAG EMPATHY_DEBUG_TLS +#include "empathy-debug.h" static void async_initable_iface_init (GAsyncInitableIface *iface); diff --git a/libempathy/empathy-server-tls-handler.h b/libempathy/empathy-server-tls-handler.h index f4caf3539..ed19c72ff 100644 --- a/libempathy/empathy-server-tls-handler.h +++ b/libempathy/empathy-server-tls-handler.h @@ -23,7 +23,6 @@ #include <glib-object.h> #include <gio/gio.h> - #include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS diff --git a/libempathy/empathy-status-presets.c b/libempathy/empathy-status-presets.c index d8faa4fe9..0e651f074 100644 --- a/libempathy/empathy-status-presets.c +++ b/libempathy/empathy-status-presets.c @@ -21,17 +21,17 @@ */ #include "config.h" +#include "empathy-status-presets.h" #include <sys/stat.h> #include "empathy-utils.h" -#include "empathy-status-presets.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER #include "empathy-debug.h" #define STATUS_PRESETS_XML_FILENAME "status-presets.xml" -#define STATUS_PRESETS_DTD_FILENAME "empathy-status-presets.dtd" +#define STATUS_PRESETS_DTD_RESOURCENAME "/org/gnome/Empathy/empathy-status-presets.dtd" #define STATUS_PRESETS_MAX_EACH 15 typedef struct { @@ -92,7 +92,7 @@ status_presets_file_parse (const gchar *filename) return; } - if (!empathy_xml_validate (doc, STATUS_PRESETS_DTD_FILENAME)) { + if (!empathy_xml_validate_from_resource (doc, STATUS_PRESETS_DTD_RESOURCENAME)) { g_warning ("Failed to validate file:'%s'", filename); xmlFreeDoc (doc); xmlFreeParserCtxt (ctxt); diff --git a/libempathy/empathy-time.c b/libempathy/empathy-time.c index cbb6b3bdb..d14f2c4cc 100644 --- a/libempathy/empathy-time.c +++ b/libempathy/empathy-time.c @@ -20,11 +20,10 @@ */ #include "config.h" +#include "empathy-time.h" #include <glib/gi18n-lib.h> -#include "empathy-time.h" - /* Note: EmpathyTime is always in UTC. */ gint64 diff --git a/libempathy/empathy-time.h b/libempathy/empathy-time.h index 59bd9269b..fc7af28e3 100644 --- a/libempathy/empathy-time.h +++ b/libempathy/empathy-time.h @@ -24,7 +24,6 @@ #define __USE_XOPEN #endif #include <time.h> - #include <glib.h> G_BEGIN_DECLS diff --git a/libempathy/empathy-tls-verifier.c b/libempathy/empathy-tls-verifier.c index 00447cc40..fcbc559b3 100644 --- a/libempathy/empathy-tls-verifier.c +++ b/libempathy/empathy-tls-verifier.c @@ -20,14 +20,14 @@ */ #include "config.h" - #include "empathy-tls-verifier.h" #include <gcr/gcr.h> +#include "empathy-utils.h" + #define DEBUG_FLAG EMPATHY_DEBUG_TLS #include "empathy-debug.h" -#include "empathy-utils.h" G_DEFINE_TYPE (EmpathyTLSVerifier, empathy_tls_verifier, G_TYPE_OBJECT) diff --git a/libempathy/empathy-tls-verifier.h b/libempathy/empathy-tls-verifier.h index 2f66acb9c..c25d9756c 100644 --- a/libempathy/empathy-tls-verifier.h +++ b/libempathy/empathy-tls-verifier.h @@ -23,7 +23,6 @@ #include <glib-object.h> #include <gio/gio.h> - #include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index e15a8c41b..4711affcb 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -19,8 +19,8 @@ */ #include "config.h" - #include "empathy-tp-chat.h" + #include "empathy-request-util.h" #include "empathy-utils.h" diff --git a/libempathy/empathy-tp-chat.h b/libempathy/empathy-tp-chat.h index d8d4ac31d..20fb4e1e0 100644 --- a/libempathy/empathy-tp-chat.h +++ b/libempathy/empathy-tp-chat.h @@ -22,7 +22,6 @@ #define __EMPATHY_TP_CHAT_H__ #include <glib.h> - #include <telepathy-glib/telepathy-glib.h> #include "empathy-message.h" diff --git a/libempathy/empathy-uoa-auth-handler.c b/libempathy/empathy-uoa-auth-handler.c index a57dd6335..7e17b7089 100644 --- a/libempathy/empathy-uoa-auth-handler.c +++ b/libempathy/empathy-uoa-auth-handler.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "empathy-uoa-auth-handler.h" #include <libaccounts-glib/ag-account.h> #include <libaccounts-glib/ag-account-service.h> @@ -29,14 +30,14 @@ #include <libsignon-glib/signon-identity.h> #include <libsignon-glib/signon-auth-session.h> -#define DEBUG_FLAG EMPATHY_DEBUG_SASL -#include "empathy-debug.h" #include "empathy-keyring.h" #include "empathy-utils.h" -#include "empathy-uoa-auth-handler.h" #include "empathy-uoa-utils.h" #include "empathy-sasl-mechanisms.h" +#define DEBUG_FLAG EMPATHY_DEBUG_SASL +#include "empathy-debug.h" + struct _EmpathyUoaAuthHandlerPriv { AgManager *manager; diff --git a/libempathy/empathy-uoa-utils.c b/libempathy/empathy-uoa-utils.c index f63a15193..6032d36bd 100644 --- a/libempathy/empathy-uoa-utils.c +++ b/libempathy/empathy-uoa-utils.c @@ -19,10 +19,10 @@ */ #include "config.h" +#include "empathy-uoa-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT #include "empathy-debug.h" -#include "empathy-uoa-utils.h" static AgManager *singleton = NULL; diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index b8f54baa4..0efe3a180 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -27,17 +27,15 @@ */ #include "config.h" +#include "empathy-utils.h" #include <glib/gi18n-lib.h> - -#include <libxml/uri.h> #include <dbus/dbus-protocol.h> +#include <math.h> #include "empathy-client-factory.h" -#include "empathy-utils.h" #include "empathy-presence-manager.h" - -#include <extensions/extensions.h> +#include "extensions.h" #include <math.h> @@ -111,36 +109,36 @@ empathy_init (void) } gboolean -empathy_xml_validate (xmlDoc *doc, - const gchar *dtd_filename) +empathy_xml_validate_from_resource (xmlDoc *doc, + const gchar *dtd_resourcename) { - gchar *path; - xmlChar *escaped; + GBytes *resourcecontents; + gconstpointer resourcedata; + gsize resourcesize; + xmlParserInputBufferPtr buffer; xmlValidCtxt cvp; xmlDtd *dtd; + GError *error = NULL; gboolean ret; - path = g_build_filename (g_getenv ("EMPATHY_SRCDIR"), "libempathy", - dtd_filename, NULL); - if (!g_file_test (path, G_FILE_TEST_EXISTS)) + DEBUG ("Loading dtd resource %s", dtd_resourcename); + + resourcecontents = g_resources_lookup_data (dtd_resourcename, G_RESOURCE_LOOKUP_FLAGS_NONE, &error); + if (error != NULL) { - g_free (path); - path = g_build_filename (DATADIR, "empathy", dtd_filename, NULL); + g_warning ("Unable to load dtd resource '%s': %s", dtd_resourcename, error->message); + g_error_free (error); + return FALSE; } - - DEBUG ("Loading dtd file %s", path); - - /* The list of valid chars is taken from libxml. */ - escaped = xmlURIEscapeStr ((const xmlChar *) path, - (const xmlChar *)":@&=+$,/?;"); - g_free (path); + resourcedata = g_bytes_get_data (resourcecontents, &resourcesize); + buffer = xmlParserInputBufferCreateStatic (resourcedata, resourcesize, XML_CHAR_ENCODING_UTF8); memset (&cvp, 0, sizeof (cvp)); - dtd = xmlParseDTD (NULL, escaped); + dtd = xmlIOParseDTD (NULL, buffer, XML_CHAR_ENCODING_UTF8); ret = xmlValidateDtd (&cvp, doc, dtd); - xmlFree (escaped); xmlFreeDtd (dtd); + g_bytes_unref (resourcecontents); return ret; } diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index 5fe79e9ee..440fe8350 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -27,7 +27,6 @@ #include <glib.h> #include <glib-object.h> - #include <gnutls/x509.h> #include <libxml/tree.h> #include <folks/folks.h> @@ -44,8 +43,8 @@ G_BEGIN_DECLS void empathy_init (void); /* XML */ -gboolean empathy_xml_validate (xmlDoc *doc, - const gchar *dtd_filename); +gboolean empathy_xml_validate_from_resource (xmlDoc *doc, + const gchar *dtd_resourcename); xmlNodePtr empathy_xml_node_get_child (xmlNodePtr node, const gchar *child_name); xmlChar * empathy_xml_node_get_child_content (xmlNodePtr node, |