diff --git a/.gitignore b/.gitignore index 0647576..3daa7d0 100644 --- a/.gitignore +++ b/.gitignore @@ -50,8 +50,8 @@ data/org.freedesktop.Telepathy.ConnectionManager.matrix.service extensions/_gen extensions/extensions.html -src/telepathy-matrix -src/telepathy-matrix.8 +src/telepathy-cauchy +src/telepathy-cauchy.8 core cscope.out diff --git a/README.md b/README.md index 5c4e9af..19ab94c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Telepathy connection manager for Matrix.org -Telepathy Matrix implements the +Telepathy Cauchy implements the [Telepathy](http://telepathy.freedesktop.org/wiki/) [D-Bus](http://www.freedesktop.org/wiki/Software/dbus/) specification for the [Matrix.org](http://matrix.org/) SDK, allowing Telepathy diff --git a/configure.ac b/configure.ac index 10f4f99..e76e865 100644 --- a/configure.ac +++ b/configure.ac @@ -3,23 +3,23 @@ ### Version numbers # Release Versions -m4_define([tp_matrix_major_version], [0]) -m4_define([tp_matrix_minor_version], [0]) -m4_define([tp_matrix_micro_version], [0]) -m4_define([tp_matrix_nano_version], [1]) +m4_define([cauchy_major_version], [0]) +m4_define([cauchy_minor_version], [0]) +m4_define([cauchy_micro_version], [0]) +m4_define([cauchy_nano_version], [1]) -m4_define([tp_matrix_base_version], - [tp_matrix_major_version.tp_matrix_minor_version.tp_matrix_micro_version]) -m4_define([tp_matrix_version], - [m4_if(tp_matrix_nano_version, 0, - [tp_matrix_base_version], - [tp_matrix_base_version].[tp_matrix_nano_version])]) +m4_define([cauchy_base_version], + [cauchy_major_version.cauchy_minor_version.cauchy_micro_version]) +m4_define([cauchy_version], + [m4_if(cauchy_nano_version, 0, + [cauchy_base_version], + [cauchy_base_version].[cauchy_nano_version])]) ### Setup # Initialise autoconf with project details, version -AC_INIT([telepathy-matrix], matrix_version, - [gergely@polonkai.eu], [telepathy-matrix]) +AC_INIT([telepathy-cauchy], cauchy_version, + [gergely@polonkai.eu], [telepathy-cauchy]) # Enable silent build rules by default, requires at least # Automake-1.11. Disable by either passing --disable-silent-rules to diff --git a/data/Makefile.am b/data/Makefile.am index 3547bba..8f48eae 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,12 +1,12 @@ # Telepathy manager file managerdir = $(datadir)/telepathy/managers -manager_DATA = matrix.manager +manager_DATA = cauchy.manager # Dbus service file BUILT_FILES = $(service_in_files:.service.in=.service) servicedir = $(DBUS_SERVICES_DIR) -service_in_files = org.freedesktop.Telepathy.ConnectionManager.matrix.service.in +service_in_files = org.freedesktop.Telepathy.ConnectionManager.cauchy.service.in service_DATA = $(BUILT_FILES) CLEANFILES = $(BUILT_FILES) diff --git a/data/cauchy.manager b/data/cauchy.manager new file mode 100644 index 0000000..8becc02 --- /dev/null +++ b/data/cauchy.manager @@ -0,0 +1,9 @@ +[ConnectionManager] +Name = cauchy +BusName = org.freedesktop.Telepathy.ConnectionManager.cauchy +ObjectPath = /org/freedesktop/Telepathy/ConnectionManager/cauchy + +[Protocol matrix] +param-matrix-id = s required +param-homeserver = s required +param-password = s secret diff --git a/data/matrix.manager b/data/matrix.manager deleted file mode 100644 index d361dee..0000000 --- a/data/matrix.manager +++ /dev/null @@ -1,9 +0,0 @@ -[ConnectionManager] -Name = matrix -BusName = org.freedesktop.Telepathy.ConnectionManager.matrix -ObjectPath = /org/freedesktop/Telepathy/ConnectionManager/matrix - -[Protocol matrix] -param-matrix-id = s required -param-homeserver = s required -param-password = s secret diff --git a/data/org.freedesktop.Telepathy.ConnectionManager.cauchy.service.in b/data/org.freedesktop.Telepathy.ConnectionManager.cauchy.service.in new file mode 100644 index 0000000..b59ce11 --- /dev/null +++ b/data/org.freedesktop.Telepathy.ConnectionManager.cauchy.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.freedesktop.Telepathy.ConnectionManager.cauchy +Exec=@libexecdir@/telepathy-cauchy diff --git a/data/org.freedesktop.Telepathy.ConnectionManager.matrix.service.in b/data/org.freedesktop.Telepathy.ConnectionManager.matrix.service.in deleted file mode 100644 index cb4b55c..0000000 --- a/data/org.freedesktop.Telepathy.ConnectionManager.matrix.service.in +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=org.freedesktop.Telepathy.ConnectionManager.matrix -Exec=@libexecdir@/telepathy-matrix diff --git a/src/Makefile.am b/src/Makefile.am index 2138252..a33edce 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,24 +1,24 @@ # correctly clean the generated source files CLEANFILES = $(BUILT_SOURCES) $(man_MANS) -libexec_PROGRAMS = telepathy-matrix +libexec_PROGRAMS = telepathy-cauchy AM_VALAFLAGS = -C --pkg=telepathy-glib -libtp_matrix_convenience_la_VALA_SOURCES = \ +libtp_cauchy_convenience_la_VALA_SOURCES = \ $(NULL) -vala-stamp: $(libtp_matrix_convenience_la_VALA_SOURCES) +vala-stamp: $(libtp_cauchy_convenience_la_VALA_SOURCES) @rm -f vala-temp @touch vala-temp $(AM_V_GEN) $(VALAC) $(AM_VALAFLAGS) $^ @mv -f vala-temp $@ CLEANFILES += \ - $(libtp_matrix_convenience_la_VALA_SOURCES:.vala=.c) \ + $(libtp_cauchy_convenience_la_VALA_SOURCES:.vala=.c) \ $(NULL) -$(libtp_matrix_convenience_la_VALA_SOURCES:.vala=.c): vala-stamp +$(libtp_cauchy_convenience_la_VALA_SOURCES:.vala=.c): vala-stamp @if test -f $@; then :; else \ trap 'rm -rf vala-lock vala-stamp' 1 2 13 15; \ if mkdir vala-lock 2> /dev/null; then \ @@ -31,37 +31,37 @@ $(libtp_matrix_convenience_la_VALA_SOURCES:.vala=.c): vala-stamp fi \ fi -libmatrix_convenience_la_SOURCES = \ - $(libtp_matrix_convenience_la_VALA_SOURCES:.vala=.c) \ - matrix-connection-manager.c \ - matrix-connection-manager.h \ - matrix-protocol.c \ - matrix-protocol.h \ - matrix-debug.c \ - matrix-debug.h \ - matrix-handles.c \ - matrix-handles.h \ - matrix-connection.c \ - matrix-connection.h \ - matrix-im-manager.c \ - matrix-im-manager.h \ - matrix-muc-manager.c \ - matrix-muc-manager.h \ - matrix-contact-info.c \ - matrix-contact-info.h \ +libcauchy_convenience_la_SOURCES = \ + $(libtp_cauchy_convenience_la_VALA_SOURCES:.vala=.c) \ + cauchy-connection-manager.c \ + cauchy-connection-manager.h \ + cauchy-connection.c \ + cauchy-connection.h \ + cauchy-protocol.c \ + cauchy-protocol.h \ + cauchy-debug.c \ + cauchy-debug.h \ + cauchy-handles.c \ + cauchy-handles.h \ + cauchy-im-manager.c \ + cauchy-im-manager.h \ + cauchy-muc-manager.c \ + cauchy-muc-manager.h \ + cauchy-contact-info.c \ + cauchy-contact-info.h \ $(NULL) -nodist_libmatrix_convenience_la_SOURCES = \ +nodist_libcauchy_convenience_la_SOURCES = \ $(BUILT_SOURCES) -telepathy_matrix_SOURCES = \ - matrix.c +telepathy_cauchy_SOURCES = \ + cauchy.c -telepathy_matrix_LDADD = \ - libmatrix-convenience.la \ +telepathy_cauchy_LDADD = \ + libcauchy-convenience.la \ $(ALL_LIBS) -noinst_LTLIBRARIES = libmatrix-convenience.la +noinst_LTLIBRARIES = libcauchy-convenience.la AM_CFLAGS = \ -I$(top_srcdir) \ @@ -81,9 +81,9 @@ ALL_LIBS = \ @GLIB_LIBS@ \ @TELEPATHY_LIBS@ -man_MANS = telepathy-matrix.8 +man_MANS = telepathy-cauchy.8 -EXTRA_DIST = telepathy-matrix.8.in +EXTRA_DIST = telepathy-cauchy.8.in %.8: %.8.in Makefile $(AM_V_GEN)sed -e 's,[@]libexecdir[@],@libexecdir@,' < $< > $@ diff --git a/src/matrix-connection-manager.c b/src/cauchy-connection-manager.c similarity index 53% rename from src/matrix-connection-manager.c rename to src/cauchy-connection-manager.c index bc2ff38..de9033b 100644 --- a/src/matrix-connection-manager.c +++ b/src/cauchy-connection-manager.c @@ -1,64 +1,64 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * - * telepathy-matrix is distributed in the hope that it will be useful, + * telepathy-cauchy is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see + * License along with telepathy-cauchy. If not, see * . */ -#include "matrix-connection-manager.h" -#include "matrix-protocol.h" -#include "matrix-debug.h" +#include "cauchy-connection-manager.h" +#include "cauchy-protocol.h" +#include "cauchy-debug.h" -G_DEFINE_TYPE(MatrixConnectionManager, matrix_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER); +G_DEFINE_TYPE(CauchyConnectionManager, cauchy_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER); static void -matrix_connection_manager_finalize(GObject *gobject) +cauchy_connection_manager_finalize(GObject *gobject) { - matrix_debug_free(); + cauchy_debug_free(); - G_OBJECT_CLASS(matrix_connection_manager_parent_class)->finalize(gobject); + G_OBJECT_CLASS(cauchy_connection_manager_parent_class)->finalize(gobject); } static void -matrix_connection_manager_constructed(GObject *gobject) +cauchy_connection_manager_constructed(GObject *gobject) { TpBaseConnectionManager *base = (TpBaseConnectionManager *)gobject; TpBaseProtocol *p; - void (*constructed)(GObject *) = ((GObjectClass *)matrix_connection_manager_parent_class)->constructed; + void (*constructed)(GObject *) = ((GObjectClass *)cauchy_connection_manager_parent_class)->constructed; if (constructed != NULL) { constructed(gobject); } - p = matrix_protocol_new(); + p = cauchy_protocol_new(); tp_base_connection_manager_add_protocol(base, p); g_object_unref(p); } static void -matrix_connection_manager_class_init(MatrixConnectionManagerClass *klass) +cauchy_connection_manager_class_init(CauchyConnectionManagerClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); TpBaseConnectionManagerClass *parent_class = TP_BASE_CONNECTION_MANAGER_CLASS(klass); - parent_class->cm_dbus_name = "matrix"; + parent_class->cm_dbus_name = "cauchy"; - gobject_class->finalize = matrix_connection_manager_finalize; - gobject_class->constructed = matrix_connection_manager_constructed; + gobject_class->finalize = cauchy_connection_manager_finalize; + gobject_class->constructed = cauchy_connection_manager_constructed; } static void -matrix_connection_manager_init(MatrixConnectionManager *connection_manager) +cauchy_connection_manager_init(CauchyConnectionManager *connection_manager) { } diff --git a/src/cauchy-connection-manager.h b/src/cauchy-connection-manager.h new file mode 100644 index 0000000..3f70b16 --- /dev/null +++ b/src/cauchy-connection-manager.h @@ -0,0 +1,54 @@ +/* + * This file is part of telepathy-cauchy + * + * telepathy-cauchy is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * telepathy-cauchy is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with telepathy-cauchy. If not, see + * . + */ + +#ifndef __CAUCHY_CONNECTION_MANAGER_H__ +#define __CAUCHY_CONNECTION_MANAGER_H__ + +#include +#include + +G_BEGIN_DECLS + +/* TYPE MACROS */ + +#define CAUCHY_TYPE_CONNECTION_MANAGER (cauchy_connection_manager_get_type()) +#define CAUCHY_CONNECTION_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), CAUCHY_TYPE_CONNECTION_MANAGER, CauchyConnectionManager)) +#define CAUCHY_CONNECTION_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CAUCHY_TYPE_CONNECTION_MANAGER, CauchyConnectionManagerClass)) +#define CAUCHY_IS_CONNECTION_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CAUCHY_TYPE_CONNECTION_MANAGER)) +#define CAUCHY_IS_CONNECTION_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), CAUCHY_TYPE_CONNECTION_MANAGER)) +#define CAUCHY_CONNECTION_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), CAUCHY_TYPE_CONNECTION_MANAGER, CauchyConnectionManagerClass)) + +typedef struct _CauchyConnectionManager CauchyConnectionManager; +typedef struct _CauchyConnectionManagerClass CauchyConnectionManagerClass; + +struct _CauchyConnectionManagerClass { + TpBaseConnectionManagerClass parent_class; +}; + +struct _CauchyConnectionManager { + /* Parent instance structure */ + TpBaseConnection parent; + + /* Instance members */ +}; + +GType cauchy_connection_manager_get_type(void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __CAUCHY_CONNECTION_MANAGER_H__ */ diff --git a/src/matrix-connection.c b/src/cauchy-connection.c similarity index 73% rename from src/matrix-connection.c rename to src/cauchy-connection.c index d66c053..d26b08e 100644 --- a/src/matrix-connection.c +++ b/src/cauchy-connection.c @@ -1,30 +1,30 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the * License, or (at your option) any later * version. * - * telepathy-matrix is distributed in the hope that it will be + * telepathy-cauchy is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see + * License along with telepathy-cauchy. If not, see * . */ -#include "matrix-connection.h" +#include "cauchy-connection.h" -#include "matrix-contact-info.h" +#include "cauchy-contact-info.h" static void _aliasing_iface_init(gpointer, gpointer); -struct _MatrixConnectionPrivate { - gchar *matrix_id; +struct _CauchyConnectionPrivate { + gchar *cauchy_id; gchar *homeserver; gchar *password; GHashTable *aliases; @@ -34,7 +34,7 @@ struct _MatrixConnectionPrivate { enum { PROP_0, - PROP_MATRIX_ID, + PROP_CAUCHY_ID, PROP_HOMESERVER, PROP_PASSWORD, PROP_COUNT @@ -44,7 +44,7 @@ static const gchar *interfaces_always_present[] = { TP_IFACE_CONNECTION_INTERFACE_ALIASING, TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO, /* TODO: - MATRIX_IFACE_CONNECTION_INTERFACE_RENAMING, + CAUCHY_IFACE_CONNECTION_INTERFACE_RENAMING, */ TP_IFACE_CONNECTION_INTERFACE_REQUESTS, TP_IFACE_CONNECTION_INTERFACE_CONTACTS, @@ -52,16 +52,16 @@ static const gchar *interfaces_always_present[] = { }; G_DEFINE_TYPE_WITH_CODE( - MatrixConnection, matrix_connection, TP_TYPE_BASE_CONNECTION, + CauchyConnection, cauchy_connection, TP_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE( TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING, _aliasing_iface_init); G_IMPLEMENT_INTERFACE( TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_INFO, - matrix_contact_info_iface_init); + cauchy_contact_info_iface_init); /* TODO: G_IMPLEMENT_INTERFACE( - MATRIX_TYPE_SVC_CONNECTION_INTERFACE_RENAMING, + CAUCHY_TYPE_SVC_CONNECTION_INTERFACE_RENAMING, _renaming_interface_init); */ G_IMPLEMENT_INTERFACE( @@ -70,18 +70,18 @@ G_DEFINE_TYPE_WITH_CODE( ); static void -matrix_connection_set_property(GObject *obj, +cauchy_connection_set_property(GObject *obj, guint prop_id, const GValue *value, GParamSpec *pspec) { - MatrixConnection *connection = MATRIX_CONNECTION(obj); - MatrixConnectionPrivate *priv = connection->priv; + CauchyConnection *connection = CAUCHY_CONNECTION(obj); + CauchyConnectionPrivate *priv = connection->priv; switch (prop_id) { - case PROP_MATRIX_ID: - g_free(priv->matrix_id); - priv->matrix_id = g_value_dup_string(value); + case PROP_CAUCHY_ID: + g_free(priv->cauchy_id); + priv->cauchy_id = g_value_dup_string(value); break; @@ -105,17 +105,17 @@ matrix_connection_set_property(GObject *obj, } static void -matrix_connection_get_property(GObject *obj, +cauchy_connection_get_property(GObject *obj, guint prop_id, GValue *value, GParamSpec *pspec) { - MatrixConnection *connection = MATRIX_CONNECTION(obj); - MatrixConnectionPrivate *priv = connection->priv; + CauchyConnection *connection = CAUCHY_CONNECTION(obj); + CauchyConnectionPrivate *priv = connection->priv; switch (prop_id) { - case PROP_MATRIX_ID: - g_value_set_string(value, priv->matrix_id); + case PROP_CAUCHY_ID: + g_value_set_string(value, priv->cauchy_id); break; @@ -137,14 +137,14 @@ matrix_connection_get_property(GObject *obj, } static void -matrix_connection_get_alias_flags(TpSvcConnectionInterfaceAliasing *iface, +cauchy_connection_get_alias_flags(TpSvcConnectionInterfaceAliasing *iface, DBusGMethodInvocation *context) { tp_svc_connection_interface_aliasing_return_from_get_alias_flags(context, 0); } static const gchar * -gimme_an_alias(MatrixConnection *connection, +gimme_an_alias(CauchyConnection *connection, TpHandleRepoIface *repo, TpHandle handle) { @@ -159,11 +159,11 @@ gimme_an_alias(MatrixConnection *connection, } static void -matrix_connection_get_aliases(TpSvcConnectionInterfaceAliasing *iface, +cauchy_connection_get_aliases(TpSvcConnectionInterfaceAliasing *iface, const GArray *handles, DBusGMethodInvocation *context) { - MatrixConnection *self = MATRIX_CONNECTION(iface); + CauchyConnection *self = CAUCHY_CONNECTION(iface); TpHandleRepoIface *repo = tp_base_connection_get_handles( TP_BASE_CONNECTION(iface), TP_HANDLE_TYPE_CONTACT); @@ -192,11 +192,11 @@ matrix_connection_get_aliases(TpSvcConnectionInterfaceAliasing *iface, } static void -matrix_connection_request_aliases(TpSvcConnectionInterfaceAliasing *iface, +cauchy_connection_request_aliases(TpSvcConnectionInterfaceAliasing *iface, const GArray *handles, DBusGMethodInvocation *context) { - MatrixConnection *connection = MATRIX_CONNECTION(iface); + CauchyConnection *connection = CAUCHY_CONNECTION(iface); TpHandleRepoIface *repo = tp_base_connection_get_handles( TP_BASE_CONNECTION(iface), TP_HANDLE_TYPE_CONTACT); GError *err = NULL; @@ -226,7 +226,7 @@ _aliasing_iface_init(gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceAliasingClass *klass = (TpSvcConnectionInterfaceAliasingClass *)g_iface; -#define IMPLEMENT(x) tp_svc_connection_interface_aliasing_implement_##x(klass, matrix_connection_##x) +#define IMPLEMENT(x) tp_svc_connection_interface_aliasing_implement_##x(klass, cauchy_connection_##x) IMPLEMENT(get_alias_flags); IMPLEMENT(get_aliases); IMPLEMENT(request_aliases); @@ -234,10 +234,10 @@ _aliasing_iface_init(gpointer g_iface, gpointer iface_data) } static void -matrix_connection_finalize(GObject *gobject) +cauchy_connection_finalize(GObject *gobject) { g_signal_handlers_destroy(gobject); - G_OBJECT_CLASS(matrix_connection_parent_class)->finalize(gobject); + G_OBJECT_CLASS(cauchy_connection_parent_class)->finalize(gobject); } static void @@ -245,7 +245,7 @@ _aliasing_fill_contact_attributes(GObject *obj, const GArray *contacts, GHashTable *attributes_hash) { - MatrixConnection *connection = MATRIX_CONNECTION(obj); + CauchyConnection *connection = CAUCHY_CONNECTION(obj); TpHandleRepoIface *repo = tp_base_connection_get_handles( TP_BASE_CONNECTION(connection), TP_HANDLE_TYPE_CONTACT); @@ -265,11 +265,11 @@ _aliasing_fill_contact_attributes(GObject *obj, } static void -matrix_connection_constructed(GObject *obj) +cauchy_connection_constructed(GObject *obj) { - MatrixConnection *connection = MATRIX_CONNECTION(obj); + CauchyConnection *connection = CAUCHY_CONNECTION(obj); - matrix_contact_info_init(connection); + cauchy_contact_info_init(connection); tp_contacts_mixin_add_contact_attributes_iface( obj, TP_IFACE_CONNECTION_INTERFACE_ALIASING, @@ -277,10 +277,10 @@ matrix_connection_constructed(GObject *obj) } static void -matrix_connection_dispose(GObject *obj) +cauchy_connection_dispose(GObject *obj) { - MatrixConnection *connection = MATRIX_CONNECTION(obj); - MatrixConnectionPrivate *priv = connection->priv; + CauchyConnection *connection = CAUCHY_CONNECTION(obj); + CauchyConnectionPrivate *priv = connection->priv; if (priv->dispose_has_run) { return; @@ -290,8 +290,8 @@ matrix_connection_dispose(GObject *obj) tp_clear_pointer(&priv->aliases, g_hash_table_unref); - if (G_OBJECT_CLASS(matrix_connection_parent_class)->dispose) { - G_OBJECT_CLASS(matrix_connection_parent_class)->dispose(obj); + if (G_OBJECT_CLASS(cauchy_connection_parent_class)->dispose) { + G_OBJECT_CLASS(cauchy_connection_parent_class)->dispose(obj); } } @@ -303,35 +303,35 @@ _iface_create_handle_repos(TpBaseConnection *connection, repos[i] = NULL; } -// TODO matrix_handle_repos_init(repos); +// TODO cauchy_handle_repos_init(repos); } static gchar * _iface_get_unique_connection_name(TpBaseConnection *base) { - MatrixConnection *connection = MATRIX_CONNECTION(base); - MatrixConnectionPrivate *priv = connection->priv; + CauchyConnection *connection = CAUCHY_CONNECTION(base); + CauchyConnectionPrivate *priv = connection->priv; return g_strdup_printf( "@%s:%s%p", - priv->matrix_id, priv->homeserver, connection); + priv->cauchy_id, priv->homeserver, connection); } static GPtrArray * _iface_create_channel_managers(TpBaseConnection *base) { - MatrixConnection *connection = MATRIX_CONNECTION(base); - MatrixConnectionPrivate *priv = connection->priv; + CauchyConnection *connection = CAUCHY_CONNECTION(base); + CauchyConnectionPrivate *priv = connection->priv; GPtrArray *managers = g_ptr_array_sized_new(1); //GObject *manager; /* TODO: - manager = g_object_new(MATRIX_TYPE_IM_MANAGER, + manager = g_object_new(CAUCHY_TYPE_IM_MANAGER, "connection", connection, NULL); g_ptr_array_add(managers, manager); - manager = g_object_new(MATRIX_TYPE_IM_MUC_MANAGER, + manager = g_object_new(CAUCHY_TYPE_IM_MUC_MANAGER, "connection", connection, NULL); */ @@ -340,7 +340,7 @@ _iface_create_channel_managers(TpBaseConnection *base) g_ptr_array_add(managers, priv->password_manager); /* TODO: - manager = g_object_new(MATRIX_TYPE_ROOMLIST_MANAGER, + manager = g_object_new(CAUCHY_TYPE_ROOMLIST_MANAGER, "connection", connection, NULL); g_ptr_array_add(managers, manager); @@ -359,19 +359,19 @@ _iface_disconnected(TpBaseConnection *base) {} static void -matrix_connection_class_init(MatrixConnectionClass *klass) +cauchy_connection_class_init(CauchyConnectionClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); TpBaseConnectionClass *parent_class = TP_BASE_CONNECTION_CLASS(klass); GParamSpec *param_spec; - g_type_class_add_private(klass, sizeof(MatrixConnectionPrivate)); + g_type_class_add_private(klass, sizeof(CauchyConnectionPrivate)); - gobject_class->constructed = matrix_connection_constructed; - gobject_class->set_property = matrix_connection_set_property; - gobject_class->get_property = matrix_connection_get_property; - gobject_class->dispose = matrix_connection_dispose; - gobject_class->finalize = matrix_connection_finalize; + gobject_class->constructed = cauchy_connection_constructed; + gobject_class->set_property = cauchy_connection_set_property; + gobject_class->get_property = cauchy_connection_get_property; + gobject_class->dispose = cauchy_connection_dispose; + gobject_class->finalize = cauchy_connection_finalize; parent_class->create_handle_repos = _iface_create_handle_repos; parent_class->get_unique_connection_name = _iface_get_unique_connection_name; @@ -387,12 +387,12 @@ matrix_connection_class_init(MatrixConnectionClass *klass) */ param_spec = g_param_spec_string( - "matrix-id", - "Matrix ID", - "Your registered Matrix ID", + "cauchy-id", + "Cauchy ID", + "Your registered Cauchy ID", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - g_object_class_install_property(gobject_class, PROP_MATRIX_ID, param_spec); + g_object_class_install_property(gobject_class, PROP_CAUCHY_ID, param_spec); param_spec = g_param_spec_string( "homeserver", @@ -410,29 +410,29 @@ matrix_connection_class_init(MatrixConnectionClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property(gobject_class, PROP_PASSWORD, param_spec); - tp_contacts_mixin_class_init(gobject_class, G_STRUCT_OFFSET(MatrixConnectionClass, contacts)); - matrix_contact_info_class_init(klass); + tp_contacts_mixin_class_init(gobject_class, G_STRUCT_OFFSET(CauchyConnectionClass, contacts)); + cauchy_contact_info_class_init(klass); } static void -matrix_connection_init(MatrixConnection *connection) +cauchy_connection_init(CauchyConnection *connection) { - MatrixConnectionPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE( + CauchyConnectionPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE( connection, - MATRIX_TYPE_CONNECTION, MatrixConnectionPrivate); + CAUCHY_TYPE_CONNECTION, CauchyConnectionPrivate); connection->priv = priv; priv->aliases = g_hash_table_new_full(NULL, NULL, NULL, g_free); tp_contacts_mixin_init( G_OBJECT(connection), - G_STRUCT_OFFSET(MatrixConnection, contacts)); + G_STRUCT_OFFSET(CauchyConnection, contacts)); tp_base_connection_register_with_contacts_mixin( (TpBaseConnection *)connection); } const gchar * const * -matrix_connection_get_implemented_interfaces(void) +cauchy_connection_get_implemented_interfaces(void) { /* We don’t have any conditionally implemented interfaces */ diff --git a/src/cauchy-connection.h b/src/cauchy-connection.h new file mode 100644 index 0000000..20c4da3 --- /dev/null +++ b/src/cauchy-connection.h @@ -0,0 +1,59 @@ +/* + * This file is part of telepathy-cauchy + * + * telepathy-cauchy is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of * the License, or (at your option) any later version. + * + * telepathy-cauchy is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with telepathy-cauchy. If not, see + * . + */ + +#ifndef __CAUCHY_CONNECTION_H__ +#define __CAUCHY_CONNECTION_H__ + +#include +#include + +G_BEGIN_DECLS + +#define CAUCHY_TYPE_CONNECTION (cauchy_connection_get_type()) +#define CAUCHY_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_CAST((o), CAUCHY_TYPE_CONNECTION, CauchyConnection)) +#define CAUCHY_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CAUCHY_TYPE_CONNECTION, CauchyConnectionClass)) +#define CAUCHY_IS_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CAUCHY_TYPE_CONNECTION)) +#define CAUCHY_IS_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), CAUCHY_TYPE_CONNECTION)) +#define CAUCHY_CONNECTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), CAUCHY_TYPE_CONNECTION, CauchyConnectionClass)) + +typedef struct _CauchyConnection CauchyConnection; +typedef struct _CauchyConnectionClass CauchyConnectionClass; +typedef struct _CauchyConnectionPrivate CauchyConnectionPrivate; + +struct _CauchyConnection { + /* Parent instance structure */ + TpBaseConnection parent_instance; + TpContactsMixin contacts; + GQueue *contact_info_requests; + + /* Instance members */ + CauchyConnectionPrivate *priv; +}; + +struct _CauchyConnectionClass { + TpBaseConnectionClass parent_class; + TpContactsMixinClass contacts; +}; + +GType cauchy_connection_get_type(void) G_GNUC_CONST; + +const gchar * const *cauchy_connection_get_implemented_interfaces(void); + +G_END_DECLS + +#endif /* __CAUCHY_CONNECTION_H__ */ diff --git a/src/matrix-contact-info.c b/src/cauchy-contact-info.c similarity index 79% rename from src/matrix-contact-info.c rename to src/cauchy-contact-info.c index db97956..e686b07 100644 --- a/src/matrix-contact-info.c +++ b/src/cauchy-contact-info.c @@ -1,25 +1,25 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * - * telepathy-matrix is distributed in the hope that it will be + * telepathy-cauchy is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see + * License along with telepathy-cauchy. If not, see * . */ -#include "matrix-contact-info.h" +#include "cauchy-contact-info.h" -#define MATRIX_DEBUG_FLAG MATRIX_DEBUG_CONNECTION -#include "matrix-debug.h" +#define CAUCHY_DEBUG_FLAG CAUCHY_DEBUG_CONNECTION +#include "cauchy-debug.h" typedef enum _ContactPresence { CONTACT_PRESENCE_UNKNOWN, @@ -38,7 +38,7 @@ typedef struct _ContactInfoRequest { } ContactInfoRequest; static void -matrix_contact_info_properties_getter(GObject *gobject, +cauchy_contact_info_properties_getter(GObject *gobject, GQuark interface, GQuark name, GValue *value, @@ -58,7 +58,7 @@ matrix_contact_info_properties_getter(GObject *gobject, } void -matrix_contact_info_class_init(MatrixConnectionClass *klass) +cauchy_contact_info_class_init(CauchyConnectionClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); @@ -71,13 +71,13 @@ matrix_contact_info_class_init(MatrixConnectionClass *klass) tp_dbus_properties_mixin_implement_interface( gobject_class, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO, - matrix_contact_info_properties_getter, + cauchy_contact_info_properties_getter, NULL, props); } static void -matrix_contact_info_fill_contact_attributes(GObject *gobject, +cauchy_contact_info_fill_contact_attributes(GObject *gobject, const GArray *contacts, GHashTable *attributes_hash) { @@ -85,7 +85,7 @@ matrix_contact_info_fill_contact_attributes(GObject *gobject, } void -matrix_contact_info_init(MatrixConnection *connection) +cauchy_contact_info_init(CauchyConnection *connection) { connection->contact_info_requests = g_queue_new(); @@ -94,18 +94,18 @@ matrix_contact_info_init(MatrixConnection *connection) tp_contacts_mixin_add_contact_attributes_iface( G_OBJECT(connection), TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO, - matrix_contact_info_fill_contact_attributes); + cauchy_contact_info_fill_contact_attributes); } static void -_send_request_contact_info(MatrixConnection *connection, +_send_request_contact_info(CauchyConnection *connection, ContactInfoRequest *request) { // TODO: implement actual contact info querying } static void -_queue_request_contact_info(MatrixConnection *connection, +_queue_request_contact_info(CauchyConnection *connection, guint handle, const gchar *id, DBusGMethodInvocation *context) @@ -127,12 +127,12 @@ _queue_request_contact_info(MatrixConnection *connection, } static void -matrix_connection_request_contact_info( +cauchy_connection_request_contact_info( TpSvcConnectionInterfaceContactInfo *iface, guint contact, DBusGMethodInvocation *context) { - MatrixConnection *connection = MATRIX_CONNECTION(iface); + CauchyConnection *connection = CAUCHY_CONNECTION(iface); TpBaseConnection *base = TP_BASE_CONNECTION(connection); TpHandleRepoIface *contact_handles = tp_base_connection_get_handles( base, @@ -151,18 +151,18 @@ matrix_connection_request_contact_info( id = tp_handle_inspect(contact_handles, contact); - MATRIX_DEBUG("Queued contact info request for handle: %u (%s)", + CAUCHY_DEBUG("Queued contact info request for handle: %u (%s)", contact, id); _queue_request_contact_info(connection, contact, id, context); } void -matrix_contact_info_iface_init(gpointer g_iface, gpointer iface_data) +cauchy_contact_info_iface_init(gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceContactInfoClass *klass = (TpSvcConnectionInterfaceContactInfoClass *)g_iface; -#define IMPLEMENT(x) tp_svc_connection_interface_contact_info_implement_##x (klass, matrix_connection_##x) +#define IMPLEMENT(x) tp_svc_connection_interface_contact_info_implement_##x (klass, cauchy_connection_##x) IMPLEMENT(request_contact_info); #undef IMPLEMENT } diff --git a/src/matrix-contact-info.h b/src/cauchy-contact-info.h similarity index 54% rename from src/matrix-contact-info.h rename to src/cauchy-contact-info.h index b108195..ec5f593 100644 --- a/src/matrix-contact-info.h +++ b/src/cauchy-contact-info.h @@ -1,36 +1,36 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * - * telepathy-matrix is distributed in the hope that it will be + * telepathy-cauchy is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see + * License along with telepathy-cauchy. If not, see * . */ -#ifndef __MATRIX_CONTACT_INFO_H__ -#define __MATRIX_CONTACT_INFO_H__ +#ifndef __CAUCHY_CONTACT_INFO_H__ +#define __CAUCHY_CONTACT_INFO_H__ #include #include #include -#include "matrix-connection.h" +#include "cauchy-connection.h" G_BEGIN_DECLS -void matrix_contact_info_class_init(MatrixConnectionClass *klass); -void matrix_contact_info_iface_init(gpointer g_iface, gpointer iface_data); -void matrix_contact_info_init(MatrixConnection *connection); +void cauchy_contact_info_class_init(CauchyConnectionClass *klass); +void cauchy_contact_info_iface_init(gpointer g_iface, gpointer iface_data); +void cauchy_contact_info_init(CauchyConnection *connection); G_END_DECLS -#endif /* __MATRIX_CONTACT_INFO_H__ */ +#endif /* __CAUCHY_CONTACT_INFO_H__ */ diff --git a/src/matrix-debug.c b/src/cauchy-debug.c similarity index 70% rename from src/matrix-debug.c rename to src/cauchy-debug.c index aa234c2..2163ded 100644 --- a/src/matrix-debug.c +++ b/src/cauchy-debug.c @@ -1,44 +1,44 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * - * telepathy-matrix is distributed in the hope that it will be useful, + * telepathy-cauchy is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see + * License along with telepathy-cauchy. If not, see * . */ #include "config.h" -#include "matrix-debug.h" +#include "cauchy-debug.h" #include #include -static MatrixDebugFlags _flags = 0; +static CauchyDebugFlags _flags = 0; static GDebugKey _keys[] = { - {"connection", MATRIX_DEBUG_CONNECTION}, - {"dns", MATRIX_DEBUG_DNS}, - {"im", MATRIX_DEBUG_IM}, - {"muc", MATRIX_DEBUG_MUC}, - {"network", MATRIX_DEBUG_NETWORK}, - {"parser", MATRIX_DEBUG_PARSER}, - {"text", MATRIX_DEBUG_TEXT}, - {"tls", MATRIX_DEBUG_TLS}, + {"connection", CAUCHY_DEBUG_CONNECTION}, + {"dns", CAUCHY_DEBUG_DNS}, + {"im", CAUCHY_DEBUG_IM}, + {"muc", CAUCHY_DEBUG_MUC}, + {"network", CAUCHY_DEBUG_NETWORK}, + {"parser", CAUCHY_DEBUG_PARSER}, + {"text", CAUCHY_DEBUG_TEXT}, + {"tls", CAUCHY_DEBUG_TLS}, {NULL, 0} }; void -matrix_debug_init (void) { - const gchar *flags_string = g_getenv("MATRIX_DEBUG"); +cauchy_debug_init (void) { + const gchar *flags_string = g_getenv("CAUCHY_DEBUG"); guint nkeys; for (nkeys = 0; _keys[nkeys].value; nkeys++) { @@ -50,14 +50,14 @@ matrix_debug_init (void) { _flags |= g_parse_debug_string(flags_string, _keys, nkeys); } - if (g_getenv("MATRIX_PERSIST") != NULL) + if (g_getenv("CAUCHY_PERSIST") != NULL) tp_debug_set_persistent(TRUE); } GHashTable *flag_to_domains = NULL; static const gchar * -debug_flag_to_domain (MatrixDebugFlags flag) +debug_flag_to_domain (CauchyDebugFlags flag) { if (G_UNLIKELY (flag_to_domains == NULL)) { guint i; @@ -68,7 +68,7 @@ debug_flag_to_domain (MatrixDebugFlags flag) GDebugKey key = _keys[i]; gchar *val; - val = g_strdup_printf ("%s/%s", "matrix", key.key); + val = g_strdup_printf ("%s/%s", "cauchy", key.key); g_hash_table_insert (flag_to_domains, GUINT_TO_POINTER (key.value), val); } @@ -78,7 +78,7 @@ debug_flag_to_domain (MatrixDebugFlags flag) } void -matrix_debug_free (void) +cauchy_debug_free (void) { if (flag_to_domains == NULL) return; @@ -88,7 +88,7 @@ matrix_debug_free (void) } static void -log_to_debug_sender (MatrixDebugFlags flag, +log_to_debug_sender (CauchyDebugFlags flag, const gchar *message) { TpDebugSender *dbg; @@ -104,7 +104,7 @@ log_to_debug_sender (MatrixDebugFlags flag, g_object_unref (dbg); } -void matrix_debug(MatrixDebugFlags flag, const gchar *format, ...) { +void cauchy_debug(CauchyDebugFlags flag, const gchar *format, ...) { gchar *message; va_list args; diff --git a/src/cauchy-debug.h b/src/cauchy-debug.h new file mode 100644 index 0000000..4f540a3 --- /dev/null +++ b/src/cauchy-debug.h @@ -0,0 +1,47 @@ +/* + * This file is part of telepathy-cauchy + * + * telepathy-cauchy is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * telepathy-cauchy is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with telepathy-cauchy. If not, see + * . + */ + +#ifndef __CAUCHY_DEBUG_H__ +#define __CAUCHY_DEBUG_H__ + +#include + +typedef enum { + CAUCHY_DEBUG_CONNECTION = (1 << 0), + CAUCHY_DEBUG_DNS = (1 << 1), + CAUCHY_DEBUG_IM = (1 << 2), + CAUCHY_DEBUG_MUC = (1 << 3), + CAUCHY_DEBUG_NETWORK = (1 << 4), + CAUCHY_DEBUG_PARSER = (1 << 5), + CAUCHY_DEBUG_TEXT = (1 << 6), + CAUCHY_DEBUG_ROOMLIST = (1 << 7), + CAUCHY_DEBUG_TLS = (1 << 8), +} CauchyDebugFlags; + +void cauchy_debug_init (void); +void cauchy_debug(CauchyDebugFlags flag, const gchar *format, ...) G_GNUC_PRINTF(2, 3); + +void cauchy_debug_free (void); + +#endif /* __CAUCHY_DEBUG_H__ */ + +#ifdef CAUCHY_DEBUG_FLAG +# undef CAUCHY_DEBUG +# define CAUCHY_DEBUG(format, ...) \ + cauchy_debug(CAUCHY_DEBUG_FLAG, "%s: " format, G_STRFUNC, ##__VA_ARGS__) +#endif /* CAUCHY_DEBUG_FLAG */ diff --git a/src/matrix-handles.c b/src/cauchy-handles.c similarity index 53% rename from src/matrix-handles.c rename to src/cauchy-handles.c index e703e6c..245c03f 100644 --- a/src/matrix-handles.c +++ b/src/cauchy-handles.c @@ -1,40 +1,40 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * - * telepathy-matrix is distributed in the hope that it will be useful, + * telepathy-cauchy is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see + * License along with telepathy-cauchy. If not, see * . */ -#include "matrix-handles.h" +#include "cauchy-handles.h" #include -#define MATRIX_DEBUG_FLAG MATRIX_DEBUG_PARSER -#include "matrix-debug.h" +#define CAUCHY_DEBUG_FLAG CAUCHY_DEBUG_PARSER +#include "cauchy-debug.h" gboolean -matrix_id_is_valid(const gchar *matrix_id, gboolean strict_mode) +cauchy_id_is_valid(const gchar *cauchy_id, gboolean strict_mode) { - MATRIX_DEBUG( - "Validating Matrix ID '%s' with strict mode %d", - matrix_id, strict_mode); + CAUCHY_DEBUG( + "Validating Cauchy ID '%s' with strict mode %d", + cauchy_id, strict_mode); - if (!matrix_id || *matrix_id == '\0') { + if (!cauchy_id || *cauchy_id == '\0') { return FALSE; } - if (!g_utf8_validate(matrix_id, -1, NULL)) { + if (!g_utf8_validate(cauchy_id, -1, NULL)) { return FALSE; } @@ -44,18 +44,18 @@ matrix_id_is_valid(const gchar *matrix_id, gboolean strict_mode) } gchar * -matrix_normalize_id(const gchar *id, GError **err) +cauchy_normalize_id(const gchar *id, GError **err) { - if (!matrix_id_is_valid(id, FALSE)) { + if (!cauchy_id_is_valid(id, FALSE)) { g_set_error(err, TP_ERROR, TP_ERROR_INVALID_HANDLE, - "Invalid Matrix ID"); + "Invalid Cauchy ID"); return NULL; } /* telepathy-idle sets the nickname to lowercase here. I’m not - * sure it can be done with Matrix IDs. TODO: check if it can. + * sure it can be done with Cauchy IDs. TODO: check if it can. */ return g_strdup(id); } diff --git a/src/matrix-handles.h b/src/cauchy-handles.h similarity index 55% rename from src/matrix-handles.h rename to src/cauchy-handles.h index aa9bf3a..4603e8d 100644 --- a/src/matrix-handles.h +++ b/src/cauchy-handles.h @@ -1,27 +1,27 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * - * telepathy-matrix is distributed in the hope that it will be useful, + * telepathy-cauchy is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License * along with telepathy-matrix. If not, see + * License * along with telepathy-cauchy. If not, see * . */ -#ifndef __MATRIX_HANDLES_H__ -#define __MATRIX_HANDLES_H__ +#ifndef __CAUCHY_HANDLES_H__ +#define __CAUCHY_HANDLES_H__ #include -gboolean matrix_id_is_valid(const gchar *matrix_id, gboolean strict_mode); -gchar *matrix_normalize_id(const gchar *id, GError **err); +gboolean cauchy_id_is_valid(const gchar *cauchy_id, gboolean strict_mode); +gchar *cauchy_normalize_id(const gchar *id, GError **err); -#endif /* __MATRIX_HANDLES_H__ */ +#endif /* __CAUCHY_HANDLES_H__ */ diff --git a/src/matrix-im-manager.c b/src/cauchy-im-manager.c similarity index 53% rename from src/matrix-im-manager.c rename to src/cauchy-im-manager.c index f73c5b9..e35ddc8 100644 --- a/src/matrix-im-manager.c +++ b/src/cauchy-im-manager.c @@ -1,45 +1,45 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * - * telepathy-matrix is distributed in the hope that it will be + * telepathy-cauchy is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see + * License along with telepathy-cauchy. If not, see * . */ -#include "matrix-im-manager.h" +#include "cauchy-im-manager.h" -typedef struct _MatrixIMManagerPrivate { +typedef struct _CauchyIMManagerPrivate { /* TODO: You must add something here, or GLib will produce warnings! */ -} MatrixIMManagerPrivate; +} CauchyIMManagerPrivate; -G_DEFINE_TYPE_WITH_PRIVATE(MatrixIMManager, matrix_im_manager, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE(CauchyIMManager, cauchy_im_manager, G_TYPE_OBJECT); static void -matrix_im_manager_finalize(GObject *gobject) +cauchy_im_manager_finalize(GObject *gobject) { g_signal_handlers_destroy(gobject); - G_OBJECT_CLASS(matrix_im_manager_parent_class)->finalize(gobject); + G_OBJECT_CLASS(cauchy_im_manager_parent_class)->finalize(gobject); } static void -matrix_im_manager_class_init(MatrixIMManagerClass *klass) +cauchy_im_manager_class_init(CauchyIMManagerClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); - gobject_class->finalize = matrix_im_manager_finalize; + gobject_class->finalize = cauchy_im_manager_finalize; } static void -matrix_im_manager_init(MatrixIMManager *im_manager) +cauchy_im_manager_init(CauchyIMManager *im_manager) { } diff --git a/src/cauchy-im-manager.h b/src/cauchy-im-manager.h new file mode 100644 index 0000000..2a38c4a --- /dev/null +++ b/src/cauchy-im-manager.h @@ -0,0 +1,51 @@ +/* + * This file is part of telepathy-cauchy + * + * telepathy-cauchy is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * telepathy-cauchy is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with telepathy-cauchy. If not, see + * . + */ + +#ifndef __CAUCHY_IM_MANAGER_H__ +#define __CAUCHY_IM_MANAGER_H__ + +#include + +G_BEGIN_DECLS + +#define CAUCHY_TYPE_IM_MANAGER (cauchy_im_manager_get_type()) +#define CAUCHY_IM_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), CAUCHY_TYPE_IM_MANAGER, CauchyIMManager)) +#define CAUCHY_IM_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CAUCHY_TYPE_IM_MANAGER, CauchyIMManagerClass)) +#define CAUCHY_IS_IM_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CAUCHY_TYPE_IM_MANAGER)) +#define CAUCHY_IS_IM_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), CAUCHY_TYPE_IM_MANAGER)) +#define CAUCHY_IM_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), CAUCHY_TYPE_IM_MANAGER, CauchyIMManagerClass)) + +typedef struct _CauchyIMManager CauchyIMManager; +typedef struct _CauchyIMManagerClass CauchyIMManagerClass; + +struct _CauchyIMManager { + /* Parent instance structure */ + GObject parent_instance; + + /* Instance members */ +}; + +struct _CauchyIMManagerClass { + GObjectClass parent_class; +}; + +GType cauchy_im_manager_get_type(void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __CAUCHY_IM_MANAGER_H__ */ diff --git a/src/matrix-muc-manager.c b/src/cauchy-muc-manager.c similarity index 53% rename from src/matrix-muc-manager.c rename to src/cauchy-muc-manager.c index 8eb38f7..cac29c3 100644 --- a/src/matrix-muc-manager.c +++ b/src/cauchy-muc-manager.c @@ -1,45 +1,45 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * - * telepathy-matrix is distributed in the hope that it will be + * telepathy-cauchy is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see + * License along with telepathy-cauchy. If not, see * . */ -#include "matrix-muc-manager.h" +#include "cauchy-muc-manager.h" -typedef struct _MatrixMUCManagerPrivate { +typedef struct _CauchyMUCManagerPrivate { /* TODO: You must add something here, or GLib will produce warnings! */ -} MatrixMUCManagerPrivate; +} CauchyMUCManagerPrivate; -G_DEFINE_TYPE_WITH_PRIVATE(MatrixMUCManager, matrix_muc_manager, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE(CauchyMUCManager, cauchy_muc_manager, G_TYPE_OBJECT); static void -matrix_muc_manager_finalize(GObject *gobject) +cauchy_muc_manager_finalize(GObject *gobject) { g_signal_handlers_destroy(gobject); - G_OBJECT_CLASS(matrix_muc_manager_parent_class)->finalize(gobject); + G_OBJECT_CLASS(cauchy_muc_manager_parent_class)->finalize(gobject); } static void -matrix_muc_manager_class_init(MatrixMUCManagerClass *klass) +cauchy_muc_manager_class_init(CauchyMUCManagerClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); - gobject_class->finalize = matrix_muc_manager_finalize; + gobject_class->finalize = cauchy_muc_manager_finalize; } static void -matrix_muc_manager_init(MatrixMUCManager *muc_manager) +cauchy_muc_manager_init(CauchyMUCManager *muc_manager) { } diff --git a/src/cauchy-muc-manager.h b/src/cauchy-muc-manager.h new file mode 100644 index 0000000..57038dd --- /dev/null +++ b/src/cauchy-muc-manager.h @@ -0,0 +1,51 @@ +/* + * This file is part of telepathy-cauchy + * + * telepathy-cauchy is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * telepathy-cauchy is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with telepathy-cauchy. If not, see + * . + */ + +#ifndef __CAUCHY_MUC_MANAGER_H__ +#define __CAUCHY_MUC_MANAGER_H__ + +#include + +G_BEGIN_DECLS + +#define CAUCHY_TYPE_MUC_MANAGER (cauchy_muc_manager_get_type()) +#define CAUCHY_MUC_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), CAUCHY_TYPE_MUC_MANAGER, CauchyMUCManager)) +#define CAUCHY_MUC_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CAUCHY_TYPE_MUC_MANAGER, CauchyMUCManagerClass)) +#define CAUCHY_IS_MUC_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CAUCHY_TYPE_MUC_MANAGER)) +#define CAUCHY_IS_MUC_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), CAUCHY_TYPE_MUC_MANAGER)) +#define CAUCHY_MUC_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), CAUCHY_TYPE_MUC_MANAGER, CauchyMUCManagerClass)) + +typedef struct _CauchyMUCManager CauchyMUCManager; +typedef struct _CauchyMUCManagerClass CauchyMUCManagerClass; + +struct _CauchyMUCManager { + /* Parent instance structure */ + GObject parent_instance; + + /* Instance members */ +}; + +struct _CauchyMUCManagerClass { + GObjectClass parent_class; +}; + +GType cauchy_muc_manager_get_type(void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __CAUCHY_MUC_MANAGER_H__ */ diff --git a/src/matrix-protocol.c b/src/cauchy-protocol.c similarity index 77% rename from src/matrix-protocol.c rename to src/cauchy-protocol.c index 51ad0b3..62949af 100644 --- a/src/matrix-protocol.c +++ b/src/cauchy-protocol.c @@ -1,26 +1,26 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * - * telepathy-matrix is distributed in the hope that it will be + * telepathy-cauchy is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see + * License along with telepathy-cauchy. If not, see * . */ -#include "matrix-protocol.h" -#include "matrix-handles.h" -#include "matrix-connection.h" -#include "matrix-im-manager.h" -#include "matrix-muc-manager.h" +#include "cauchy-protocol.h" +#include "cauchy-handles.h" +#include "cauchy-connection.h" +#include "cauchy-im-manager.h" +#include "cauchy-muc-manager.h" #include @@ -31,7 +31,7 @@ static gboolean filter_account(const TpCMParamSpec *, GValue *, GError **); -static const TpCMParamSpec matrix_params[] = { +static const TpCMParamSpec cauchy_params[] = { { "account", DBUS_TYPE_STRING_AS_STRING, G_TYPE_STRING, @@ -51,20 +51,20 @@ static const TpCMParamSpec matrix_params[] = { {NULL, NULL, 0, 0, NULL, 0} }; -G_DEFINE_TYPE(MatrixProtocol, matrix_protocol, TP_TYPE_BASE_PROTOCOL); +G_DEFINE_TYPE(CauchyProtocol, cauchy_protocol, TP_TYPE_BASE_PROTOCOL); static gboolean filter_account(const TpCMParamSpec *paramspec, GValue *value, GError **err) { - const gchar *matrixid = g_value_get_string(value); + const gchar *matrix_id = g_value_get_string(value); - g_assert(matrixid); + g_assert(matrix_id); g_assert(G_VALUE_HOLDS_STRING(value)); - if (!matrix_id_is_valid(matrixid, TRUE)) { + if (!cauchy_id_is_valid(matrix_id, TRUE)) { g_set_error(err, TP_ERROR, TP_ERROR_INVALID_HANDLE, - "Invalid account name '%s'", matrixid); + "Invalid account name '%s'", matrix_id); return FALSE; } @@ -75,7 +75,7 @@ filter_account(const TpCMParamSpec *paramspec, GValue *value, GError **err) static const TpCMParamSpec * get_parameters(TpBaseProtocol *self G_GNUC_UNUSED) { - return matrix_params; + return cauchy_params; } static TpBaseConnection * @@ -83,7 +83,7 @@ new_connection(TpBaseProtocol *protocol G_GNUC_UNUSED, GHashTable *params, GError **err G_GNUC_UNUSED) { - return g_object_new(MATRIX_TYPE_CONNECTION, + return g_object_new(CAUCHY_TYPE_CONNECTION, "homeserver", tp_asv_get_string(params, "homeserver"), "matrix_id", tp_asv_get_string(params, "account"), "password", tp_asv_get_string(params, "password"), @@ -95,7 +95,7 @@ normalize_contact(TpBaseProtocol *protocol G_GNUC_UNUSED, const gchar *contact, GError **err) { - return matrix_normalize_id(contact, err); + return cauchy_normalize_id(contact, err); } static gchar * @@ -103,7 +103,7 @@ identify_account(TpBaseProtocol *protocol G_GNUC_UNUSED, GHashTable *asv, GError **err) { - gchar *id = matrix_normalize_id(tp_asv_get_string(asv, "account"), err); + gchar *id = cauchy_normalize_id(tp_asv_get_string(asv, "account"), err); gchar *server; gchar *id_at_server; @@ -125,7 +125,7 @@ get_interfaces_array(TpBaseProtocol *protocol) { GPtrArray *interfaces; - interfaces = TP_BASE_PROTOCOL_CLASS(matrix_protocol_parent_class)->get_interfaces_array(protocol); + interfaces = TP_BASE_PROTOCOL_CLASS(cauchy_protocol_parent_class)->get_interfaces_array(protocol); return interfaces; } @@ -140,13 +140,13 @@ get_connection_details(TpBaseProtocol *protocol, { if (connection_interfaces != NULL) { *connection_interfaces = g_strdupv( - (GStrv)matrix_connection_get_implemented_interfaces()); + (GStrv)cauchy_connection_get_implemented_interfaces()); } if (channel_managers != NULL) { GType types[] = { - MATRIX_TYPE_IM_MANAGER, - MATRIX_TYPE_MUC_MANAGER, + CAUCHY_TYPE_IM_MANAGER, + CAUCHY_TYPE_MUC_MANAGER, G_TYPE_INVALID }; @@ -177,7 +177,7 @@ dup_authentication_types(TpBaseProtocol *base) } static void -matrix_protocol_class_init(MatrixProtocolClass *klass) +cauchy_protocol_class_init(CauchyProtocolClass *klass) { TpBaseProtocolClass *base_class = (TpBaseProtocolClass *)klass; @@ -191,14 +191,14 @@ matrix_protocol_class_init(MatrixProtocolClass *klass) } static void -matrix_protocol_init(MatrixProtocol *protocol) +cauchy_protocol_init(CauchyProtocol *protocol) { } TpBaseProtocol * -matrix_protocol_new(void) +cauchy_protocol_new(void) { - return g_object_new(MATRIX_TYPE_PROTOCOL, + return g_object_new(CAUCHY_TYPE_PROTOCOL, "name", PROTOCOL_NAME, NULL); } diff --git a/src/cauchy-protocol.h b/src/cauchy-protocol.h new file mode 100644 index 0000000..c7657ed --- /dev/null +++ b/src/cauchy-protocol.h @@ -0,0 +1,53 @@ +/* + * This file is part of telepathy-cauchy + * + * telepathy-cauchy is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * telepathy-cauchy is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with telepathy-cauchy. If not, see + * . + */ + +#ifndef __CAUCHY_PROTOCOL_H__ +#define __CAUCHY_PROTOCOL_H__ + +#include + +G_BEGIN_DECLS + +#define CAUCHY_TYPE_PROTOCOL (cauchy_protocol_get_type()) +#define CAUCHY_PROTOCOL(o) (G_TYPE_CHECK_INSTANCE_CAST((o), CAUCHY_TYPE_PROTOCOL, CauchyProtocol)) +#define CAUCHY_PROTOCOL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CAUCHY_TYPE_PROTOCOL, CauchyProtocolClass)) +#define CAUCHY_IS_PROTOCOL(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CAUCHY_TYPE_PROTOCOL)) +#define CAUCHY_IS_PROTOCOL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), CAUCHY_TYPE_PROTOCOL)) +#define CAUCHY_PROTOCOL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), CAUCHY_TYPE_PROTOCOL, CauchyProtocolClass)) + +typedef struct _CauchyProtocol CauchyProtocol; +typedef struct _CauchyProtocolClass CauchyProtocolClass; + +struct _CauchyProtocol { + /* Parent instance structure */ + TpBaseProtocol parent_instance; + + /* Instance members */ +}; + +struct _CauchyProtocolClass { + TpBaseProtocolClass parent_class; +}; + +GType cauchy_protocol_get_type(void) G_GNUC_CONST; + +TpBaseProtocol *cauchy_protocol_new(void); + +G_END_DECLS + +#endif /* __CAUCHY_PROTOCOL_H__ */ diff --git a/src/matrix.c b/src/cauchy.c similarity index 68% rename from src/matrix.c rename to src/cauchy.c index a86cded..10482e5 100644 --- a/src/matrix.c +++ b/src/cauchy.c @@ -1,18 +1,18 @@ /* - * This file is part of telepathy-matrix + * This file is part of telepathy-cauchy * - * telepathy-matrix is free software: you can redistribute it and/or + * telepathy-cauchy is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * - * telepathy-matrix is distributed in the hope that it will be useful, + * telepathy-cauchy is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see + * License along with telepathy-cauchy. If not, see * . */ @@ -20,14 +20,14 @@ #include -#include "matrix-connection-manager.h" -#include "matrix-debug.h" +#include "cauchy-connection-manager.h" +#include "cauchy-debug.h" static TpBaseConnectionManager * _construct_cm(void) { TpBaseConnectionManager *base_cm = TP_BASE_CONNECTION_MANAGER( - g_object_new(MATRIX_TYPE_CONNECTION_MANAGER, NULL)); + g_object_new(CAUCHY_TYPE_CONNECTION_MANAGER, NULL)); return base_cm; } @@ -39,14 +39,14 @@ main(int argc, char **argv) int result; g_type_init(); - tp_debug_divert_messages(g_getenv("MATRIX_LOGFILE")); + tp_debug_divert_messages(g_getenv("CAUCHY_LOGFILE")); - matrix_debug_init(); + cauchy_debug_init(); debug_sender = tp_debug_sender_dup(); result = tp_run_connection_manager( - "telepathy-matrix", VERSION, + "telepathy-cauchy", VERSION, _construct_cm, argc, argv); diff --git a/src/matrix-connection-manager.h b/src/matrix-connection-manager.h deleted file mode 100644 index a8c4349..0000000 --- a/src/matrix-connection-manager.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * This file is part of telepathy-matrix - * - * telepathy-matrix is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * telepathy-matrix is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see - * . - */ - -#ifndef __MATRIX_CONNECTION_MANAGER_H__ -#define __MATRIX_CONNECTION_MANAGER_H__ - -#include -#include - -G_BEGIN_DECLS - -/* TYPE MACROS */ - -#define MATRIX_TYPE_CONNECTION_MANAGER (matrix_connection_manager_get_type()) -#define MATRIX_CONNECTION_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), MATRIX_TYPE_CONNECTION_MANAGER, MatrixConnectionManager)) -#define MATRIX_CONNECTION_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MATRIX_TYPE_CONNECTION_MANAGER, MatrixConnectionManagerClass)) -#define MATRIX_IS_CONNECTION_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), MATRIX_TYPE_CONNECTION_MANAGER)) -#define MATRIX_IS_CONNECTION_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), MATRIX_TYPE_CONNECTION_MANAGER)) -#define MATRIX_CONNECTION_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MATRIX_TYPE_CONNECTION_MANAGER, MatrixConnectionManagerClass)) - -typedef struct _MatrixConnectionManager MatrixConnectionManager; -typedef struct _MatrixConnectionManagerClass MatrixConnectionManagerClass; - -struct _MatrixConnectionManagerClass { - TpBaseConnectionManagerClass parent_class; -}; - -struct _MatrixConnectionManager { - /* Parent instance structure */ - TpBaseConnection parent; - - /* Instance members */ -}; - -GType matrix_connection_manager_get_type(void) G_GNUC_CONST; - -G_END_DECLS - -#endif /* __MATRIX_CONNECTION_MANAGER_H__ */ diff --git a/src/matrix-connection.h b/src/matrix-connection.h deleted file mode 100644 index 74e343b..0000000 --- a/src/matrix-connection.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of telepathy-matrix - * - * telepathy-matrix is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of * the License, or (at your option) any later version. - * - * telepathy-matrix is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see - * . - */ - -#ifndef __MATRIX_CONNECTION_H__ -#define __MATRIX_CONNECTION_H__ - -#include -#include - -G_BEGIN_DECLS - -#define MATRIX_TYPE_CONNECTION (matrix_connection_get_type()) -#define MATRIX_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_CAST((o), MATRIX_TYPE_CONNECTION, MatrixConnection)) -#define MATRIX_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MATRIX_TYPE_CONNECTION, MatrixConnectionClass)) -#define MATRIX_IS_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), MATRIX_TYPE_CONNECTION)) -#define MATRIX_IS_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), MATRIX_TYPE_CONNECTION)) -#define MATRIX_CONNECTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MATRIX_TYPE_CONNECTION, MatrixConnectionClass)) - -typedef struct _MatrixConnection MatrixConnection; -typedef struct _MatrixConnectionClass MatrixConnectionClass; -typedef struct _MatrixConnectionPrivate MatrixConnectionPrivate; - -struct _MatrixConnection { - /* Parent instance structure */ - TpBaseConnection parent_instance; - TpContactsMixin contacts; - GQueue *contact_info_requests; - - /* Instance members */ - MatrixConnectionPrivate *priv; -}; - -struct _MatrixConnectionClass { - TpBaseConnectionClass parent_class; - TpContactsMixinClass contacts; -}; - -GType matrix_connection_get_type(void) G_GNUC_CONST; - -const gchar * const *matrix_connection_get_implemented_interfaces(void); - -G_END_DECLS - -#endif /* __MATRIX_CONNECTION_H__ */ diff --git a/src/matrix-debug.h b/src/matrix-debug.h deleted file mode 100644 index f82b8c0..0000000 --- a/src/matrix-debug.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of telepathy-matrix - * - * telepathy-matrix is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * telepathy-matrix is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see - * . - */ - -#ifndef __MATRIX_DEBUG_H__ -#define __MATRIX_DEBUG_H__ - -#include - -typedef enum { - MATRIX_DEBUG_CONNECTION = (1 << 0), - MATRIX_DEBUG_DNS = (1 << 1), - MATRIX_DEBUG_IM = (1 << 2), - MATRIX_DEBUG_MUC = (1 << 3), - MATRIX_DEBUG_NETWORK = (1 << 4), - MATRIX_DEBUG_PARSER = (1 << 5), - MATRIX_DEBUG_TEXT = (1 << 6), - MATRIX_DEBUG_ROOMLIST = (1 << 7), - MATRIX_DEBUG_TLS = (1 << 8), -} MatrixDebugFlags; - -void matrix_debug_init (void); -void matrix_debug(MatrixDebugFlags flag, const gchar *format, ...) G_GNUC_PRINTF(2, 3); - -void matrix_debug_free (void); - -#endif /* __MATRIX_DEBUG_H__ */ - -#ifdef MATRIX_DEBUG_FLAG -# undef MATRIX_DEBUG -# define MATRIX_DEBUG(format, ...) \ - matrix_debug(MATRIX_DEBUG_FLAG, "%s: " format, G_STRFUNC, ##__VA_ARGS__) -#endif /* MATRIX_DEBUG_FLAG */ diff --git a/src/matrix-im-manager.h b/src/matrix-im-manager.h deleted file mode 100644 index 05ee9ee..0000000 --- a/src/matrix-im-manager.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of telepathy-matrix - * - * telepathy-matrix is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * telepathy-matrix is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see - * . - */ - -#ifndef __MATRIX_IM_MANAGER_H__ -#define __MATRIX_IM_MANAGER_H__ - -#include - -G_BEGIN_DECLS - -#define MATRIX_TYPE_IM_MANAGER (matrix_im_manager_get_type()) -#define MATRIX_IM_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), MATRIX_TYPE_IM_MANAGER, MatrixIMManager)) -#define MATRIX_IM_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MATRIX_TYPE_IM_MANAGER, MatrixIMManagerClass)) -#define MATRIX_IS_IM_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), MATRIX_TYPE_IM_MANAGER)) -#define MATRIX_IS_IM_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), MATRIX_TYPE_IM_MANAGER)) -#define MATRIX_IM_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MATRIX_TYPE_IM_MANAGER, MatrixIMManagerClass)) - -typedef struct _MatrixIMManager MatrixIMManager; -typedef struct _MatrixIMManagerClass MatrixIMManagerClass; - -struct _MatrixIMManager { - /* Parent instance structure */ - GObject parent_instance; - - /* Instance members */ -}; - -struct _MatrixIMManagerClass { - GObjectClass parent_class; -}; - -GType matrix_im_manager_get_type(void) G_GNUC_CONST; - -G_END_DECLS - -#endif /* __MATRIX_IM_MANAGER_H__ */ diff --git a/src/matrix-muc-manager.h b/src/matrix-muc-manager.h deleted file mode 100644 index 37a228c..0000000 --- a/src/matrix-muc-manager.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of telepathy-matrix - * - * telepathy-matrix is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * telepathy-matrix is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see - * . - */ - -#ifndef __MATRIX_MUC_MANAGER_H__ -#define __MATRIX_MUC_MANAGER_H__ - -#include - -G_BEGIN_DECLS - -#define MATRIX_TYPE_MUC_MANAGER (matrix_muc_manager_get_type()) -#define MATRIX_MUC_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), MATRIX_TYPE_MUC_MANAGER, MatrixMUCManager)) -#define MATRIX_MUC_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MATRIX_TYPE_MUC_MANAGER, MatrixMUCManagerClass)) -#define MATRIX_IS_MUC_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), MATRIX_TYPE_MUC_MANAGER)) -#define MATRIX_IS_MUC_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), MATRIX_TYPE_MUC_MANAGER)) -#define MATRIX_MUC_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MATRIX_TYPE_MUC_MANAGER, MatrixMUCManagerClass)) - -typedef struct _MatrixMUCManager MatrixMUCManager; -typedef struct _MatrixMUCManagerClass MatrixMUCManagerClass; - -struct _MatrixMUCManager { - /* Parent instance structure */ - GObject parent_instance; - - /* Instance members */ -}; - -struct _MatrixMUCManagerClass { - GObjectClass parent_class; -}; - -GType matrix_muc_manager_get_type(void) G_GNUC_CONST; - -G_END_DECLS - -#endif /* __MATRIX_MUC_MANAGER_H__ */ diff --git a/src/matrix-protocol.h b/src/matrix-protocol.h deleted file mode 100644 index c6ea416..0000000 --- a/src/matrix-protocol.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file is part of telepathy-matrix - * - * telepathy-matrix is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * telepathy-matrix is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with telepathy-matrix. If not, see - * . - */ - -#ifndef __MATRIX_PROTOCOL_H__ -#define __MATRIX_PROTOCOL_H__ - -#include - -G_BEGIN_DECLS - -#define MATRIX_TYPE_PROTOCOL (matrix_protocol_get_type()) -#define MATRIX_PROTOCOL(o) (G_TYPE_CHECK_INSTANCE_CAST((o), MATRIX_TYPE_PROTOCOL, MatrixProtocol)) -#define MATRIX_PROTOCOL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MATRIX_TYPE_PROTOCOL, MatrixProtocolClass)) -#define MATRIX_IS_PROTOCOL(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), MATRIX_TYPE_PROTOCOL)) -#define MATRIX_IS_PROTOCOL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), MATRIX_TYPE_PROTOCOL)) -#define MATRIX_PROTOCOL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MATRIX_TYPE_PROTOCOL, MatrixProtocolClass)) - -typedef struct _MatrixProtocol MatrixProtocol; -typedef struct _MatrixProtocolClass MatrixProtocolClass; - -struct _MatrixProtocol { - /* Parent instance structure */ - TpBaseProtocol parent_instance; - - /* Instance members */ -}; - -struct _MatrixProtocolClass { - TpBaseProtocolClass parent_class; -}; - -GType matrix_protocol_get_type(void) G_GNUC_CONST; - -TpBaseProtocol *matrix_protocol_new(void); - -G_END_DECLS - -#endif /* __MATRIX_PROTOCOL_H__ */ diff --git a/src/telepathy-matrix.8.in b/src/telepathy-cauchy.8.in similarity index 65% rename from src/telepathy-matrix.8.in rename to src/telepathy-cauchy.8.in index ab4dafc..b65353e 100644 --- a/src/telepathy-matrix.8.in +++ b/src/telepathy-cauchy.8.in @@ -1,14 +1,14 @@ -.TH TELEPATHY-MATRIX "8" "December 2015" "Telepathy" "D-Bus services" +.TH TELEPATHY-CAUCHY "8" "December 2015" "Telepathy" "D-Bus services" \" This man page was written by Gergely Polonkai for the Telepathy -\" Matrix Project, but may be used by others. +\" Cauchy Project, but may be used by others. \" Copyright © 2015 Gergely Polonkai -\" It may be distributed under the same terms as telepathy-matrix itself. +\" It may be distributed under the same terms as telepathy-cauchy itself. .SH NAME -telepathy-matrix \- Telepathy connection manager for Matrix.org +telepathy-cauchy \- Telepathy connection manager for Matrix.org .SH SYNOPSIS -\fB@libexecdir@/telepathy\-matrix\fR +\fB@libexecdir@/telepathy\-cauchy\fR .SH DESCRIPTION -Telepathy Matrix implements the Telepathy D-Bus specification for +Telepathy Cauchy implements the Telepathy D-Bus specification for Matrix.org, allowing Telepathy clients like .BR empathy (1) to connect to Matrix.org home servers. @@ -20,14 +20,14 @@ start it manually for debugging. There are no command-line options. .SH ENVIRONMENT .TP -\fBMATRIX_LOGFILE\fR=\fIfilename\fR +\fBCAUCHY_LOGFILE\fR=\fIfilename\fR If set, debug output will go to the given file rather than to stderr. If \fB+\fR is prepended to the \fIfilename\fR (e.g. -\fBMATRIX_LOGFILE=+matrix.log\fR), debug output will be appended +\fBCAUCHY_LOGFILE=+cauchy.log\fR), debug output will be appended to the file; otherwise, any existing file will be replaced. .TP .TP -\fBMATRIX_DEBUG\fR=\fItype\fR +\fBCAUCHY_DEBUG\fR=\fItype\fR May be set to "all" for full debug output, or various undocumented options (which may change from release to release) to filter the output. .SH SEE ALSO