Rename project to telepathy-cauchy
This is to comply with the recommendation not to use the protocol name as the connection manager name.
This commit is contained in:
parent
a368f0f4a5
commit
5fc195d972
4
.gitignore
vendored
4
.gitignore
vendored
@ -50,8 +50,8 @@ data/org.freedesktop.Telepathy.ConnectionManager.matrix.service
|
|||||||
extensions/_gen
|
extensions/_gen
|
||||||
extensions/extensions.html
|
extensions/extensions.html
|
||||||
|
|
||||||
src/telepathy-matrix
|
src/telepathy-cauchy
|
||||||
src/telepathy-matrix.8
|
src/telepathy-cauchy.8
|
||||||
|
|
||||||
core
|
core
|
||||||
cscope.out
|
cscope.out
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Telepathy connection manager for Matrix.org
|
# Telepathy connection manager for Matrix.org
|
||||||
|
|
||||||
Telepathy Matrix implements the
|
Telepathy Cauchy implements the
|
||||||
[Telepathy](http://telepathy.freedesktop.org/wiki/)
|
[Telepathy](http://telepathy.freedesktop.org/wiki/)
|
||||||
[D-Bus](http://www.freedesktop.org/wiki/Software/dbus/) specification
|
[D-Bus](http://www.freedesktop.org/wiki/Software/dbus/) specification
|
||||||
for the [Matrix.org](http://matrix.org/) SDK, allowing Telepathy
|
for the [Matrix.org](http://matrix.org/) SDK, allowing Telepathy
|
||||||
|
24
configure.ac
24
configure.ac
@ -3,23 +3,23 @@
|
|||||||
### Version numbers
|
### Version numbers
|
||||||
|
|
||||||
# Release Versions
|
# Release Versions
|
||||||
m4_define([tp_matrix_major_version], [0])
|
m4_define([cauchy_major_version], [0])
|
||||||
m4_define([tp_matrix_minor_version], [0])
|
m4_define([cauchy_minor_version], [0])
|
||||||
m4_define([tp_matrix_micro_version], [0])
|
m4_define([cauchy_micro_version], [0])
|
||||||
m4_define([tp_matrix_nano_version], [1])
|
m4_define([cauchy_nano_version], [1])
|
||||||
|
|
||||||
m4_define([tp_matrix_base_version],
|
m4_define([cauchy_base_version],
|
||||||
[tp_matrix_major_version.tp_matrix_minor_version.tp_matrix_micro_version])
|
[cauchy_major_version.cauchy_minor_version.cauchy_micro_version])
|
||||||
m4_define([tp_matrix_version],
|
m4_define([cauchy_version],
|
||||||
[m4_if(tp_matrix_nano_version, 0,
|
[m4_if(cauchy_nano_version, 0,
|
||||||
[tp_matrix_base_version],
|
[cauchy_base_version],
|
||||||
[tp_matrix_base_version].[tp_matrix_nano_version])])
|
[cauchy_base_version].[cauchy_nano_version])])
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
# Initialise autoconf with project details, version
|
# Initialise autoconf with project details, version
|
||||||
AC_INIT([telepathy-matrix], matrix_version,
|
AC_INIT([telepathy-cauchy], cauchy_version,
|
||||||
[gergely@polonkai.eu], [telepathy-matrix])
|
[gergely@polonkai.eu], [telepathy-cauchy])
|
||||||
|
|
||||||
# Enable silent build rules by default, requires at least
|
# Enable silent build rules by default, requires at least
|
||||||
# Automake-1.11. Disable by either passing --disable-silent-rules to
|
# Automake-1.11. Disable by either passing --disable-silent-rules to
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
# Telepathy manager file
|
# Telepathy manager file
|
||||||
managerdir = $(datadir)/telepathy/managers
|
managerdir = $(datadir)/telepathy/managers
|
||||||
manager_DATA = matrix.manager
|
manager_DATA = cauchy.manager
|
||||||
|
|
||||||
# Dbus service file
|
# Dbus service file
|
||||||
BUILT_FILES = $(service_in_files:.service.in=.service)
|
BUILT_FILES = $(service_in_files:.service.in=.service)
|
||||||
|
|
||||||
servicedir = $(DBUS_SERVICES_DIR)
|
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)
|
service_DATA = $(BUILT_FILES)
|
||||||
CLEANFILES = $(BUILT_FILES)
|
CLEANFILES = $(BUILT_FILES)
|
||||||
|
|
||||||
|
9
data/cauchy.manager
Normal file
9
data/cauchy.manager
Normal file
@ -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
|
@ -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
|
|
@ -0,0 +1,3 @@
|
|||||||
|
[D-BUS Service]
|
||||||
|
Name=org.freedesktop.Telepathy.ConnectionManager.cauchy
|
||||||
|
Exec=@libexecdir@/telepathy-cauchy
|
@ -1,3 +0,0 @@
|
|||||||
[D-BUS Service]
|
|
||||||
Name=org.freedesktop.Telepathy.ConnectionManager.matrix
|
|
||||||
Exec=@libexecdir@/telepathy-matrix
|
|
@ -1,24 +1,24 @@
|
|||||||
# correctly clean the generated source files
|
# correctly clean the generated source files
|
||||||
CLEANFILES = $(BUILT_SOURCES) $(man_MANS)
|
CLEANFILES = $(BUILT_SOURCES) $(man_MANS)
|
||||||
|
|
||||||
libexec_PROGRAMS = telepathy-matrix
|
libexec_PROGRAMS = telepathy-cauchy
|
||||||
|
|
||||||
AM_VALAFLAGS = -C --pkg=telepathy-glib
|
AM_VALAFLAGS = -C --pkg=telepathy-glib
|
||||||
|
|
||||||
libtp_matrix_convenience_la_VALA_SOURCES = \
|
libtp_cauchy_convenience_la_VALA_SOURCES = \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
vala-stamp: $(libtp_matrix_convenience_la_VALA_SOURCES)
|
vala-stamp: $(libtp_cauchy_convenience_la_VALA_SOURCES)
|
||||||
@rm -f vala-temp
|
@rm -f vala-temp
|
||||||
@touch vala-temp
|
@touch vala-temp
|
||||||
$(AM_V_GEN) $(VALAC) $(AM_VALAFLAGS) $^
|
$(AM_V_GEN) $(VALAC) $(AM_VALAFLAGS) $^
|
||||||
@mv -f vala-temp $@
|
@mv -f vala-temp $@
|
||||||
|
|
||||||
CLEANFILES += \
|
CLEANFILES += \
|
||||||
$(libtp_matrix_convenience_la_VALA_SOURCES:.vala=.c) \
|
$(libtp_cauchy_convenience_la_VALA_SOURCES:.vala=.c) \
|
||||||
$(NULL)
|
$(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 \
|
@if test -f $@; then :; else \
|
||||||
trap 'rm -rf vala-lock vala-stamp' 1 2 13 15; \
|
trap 'rm -rf vala-lock vala-stamp' 1 2 13 15; \
|
||||||
if mkdir vala-lock 2> /dev/null; then \
|
if mkdir vala-lock 2> /dev/null; then \
|
||||||
@ -31,37 +31,37 @@ $(libtp_matrix_convenience_la_VALA_SOURCES:.vala=.c): vala-stamp
|
|||||||
fi \
|
fi \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
libmatrix_convenience_la_SOURCES = \
|
libcauchy_convenience_la_SOURCES = \
|
||||||
$(libtp_matrix_convenience_la_VALA_SOURCES:.vala=.c) \
|
$(libtp_cauchy_convenience_la_VALA_SOURCES:.vala=.c) \
|
||||||
matrix-connection-manager.c \
|
cauchy-connection-manager.c \
|
||||||
matrix-connection-manager.h \
|
cauchy-connection-manager.h \
|
||||||
matrix-protocol.c \
|
cauchy-connection.c \
|
||||||
matrix-protocol.h \
|
cauchy-connection.h \
|
||||||
matrix-debug.c \
|
cauchy-protocol.c \
|
||||||
matrix-debug.h \
|
cauchy-protocol.h \
|
||||||
matrix-handles.c \
|
cauchy-debug.c \
|
||||||
matrix-handles.h \
|
cauchy-debug.h \
|
||||||
matrix-connection.c \
|
cauchy-handles.c \
|
||||||
matrix-connection.h \
|
cauchy-handles.h \
|
||||||
matrix-im-manager.c \
|
cauchy-im-manager.c \
|
||||||
matrix-im-manager.h \
|
cauchy-im-manager.h \
|
||||||
matrix-muc-manager.c \
|
cauchy-muc-manager.c \
|
||||||
matrix-muc-manager.h \
|
cauchy-muc-manager.h \
|
||||||
matrix-contact-info.c \
|
cauchy-contact-info.c \
|
||||||
matrix-contact-info.h \
|
cauchy-contact-info.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
nodist_libmatrix_convenience_la_SOURCES = \
|
nodist_libcauchy_convenience_la_SOURCES = \
|
||||||
$(BUILT_SOURCES)
|
$(BUILT_SOURCES)
|
||||||
|
|
||||||
telepathy_matrix_SOURCES = \
|
telepathy_cauchy_SOURCES = \
|
||||||
matrix.c
|
cauchy.c
|
||||||
|
|
||||||
telepathy_matrix_LDADD = \
|
telepathy_cauchy_LDADD = \
|
||||||
libmatrix-convenience.la \
|
libcauchy-convenience.la \
|
||||||
$(ALL_LIBS)
|
$(ALL_LIBS)
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libmatrix-convenience.la
|
noinst_LTLIBRARIES = libcauchy-convenience.la
|
||||||
|
|
||||||
AM_CFLAGS = \
|
AM_CFLAGS = \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
@ -81,9 +81,9 @@ ALL_LIBS = \
|
|||||||
@GLIB_LIBS@ \
|
@GLIB_LIBS@ \
|
||||||
@TELEPATHY_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
|
%.8: %.8.in Makefile
|
||||||
$(AM_V_GEN)sed -e 's,[@]libexecdir[@],@libexecdir@,' < $< > $@
|
$(AM_V_GEN)sed -e 's,[@]libexecdir[@],@libexecdir@,' < $< > $@
|
||||||
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the License, or (at your option) any later version.
|
* 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
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "matrix-connection-manager.h"
|
#include "cauchy-connection-manager.h"
|
||||||
#include "matrix-protocol.h"
|
#include "cauchy-protocol.h"
|
||||||
#include "matrix-debug.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
|
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
|
static void
|
||||||
matrix_connection_manager_constructed(GObject *gobject)
|
cauchy_connection_manager_constructed(GObject *gobject)
|
||||||
{
|
{
|
||||||
TpBaseConnectionManager *base = (TpBaseConnectionManager *)gobject;
|
TpBaseConnectionManager *base = (TpBaseConnectionManager *)gobject;
|
||||||
TpBaseProtocol *p;
|
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) {
|
if (constructed != NULL) {
|
||||||
constructed(gobject);
|
constructed(gobject);
|
||||||
}
|
}
|
||||||
|
|
||||||
p = matrix_protocol_new();
|
p = cauchy_protocol_new();
|
||||||
tp_base_connection_manager_add_protocol(base, p);
|
tp_base_connection_manager_add_protocol(base, p);
|
||||||
g_object_unref(p);
|
g_object_unref(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_manager_class_init(MatrixConnectionManagerClass *klass)
|
cauchy_connection_manager_class_init(CauchyConnectionManagerClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
|
||||||
TpBaseConnectionManagerClass *parent_class = TP_BASE_CONNECTION_MANAGER_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->finalize = cauchy_connection_manager_finalize;
|
||||||
gobject_class->constructed = matrix_connection_manager_constructed;
|
gobject_class->constructed = cauchy_connection_manager_constructed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_manager_init(MatrixConnectionManager *connection_manager)
|
cauchy_connection_manager_init(CauchyConnectionManager *connection_manager)
|
||||||
{
|
{
|
||||||
}
|
}
|
54
src/cauchy-connection-manager.h
Normal file
54
src/cauchy-connection-manager.h
Normal file
@ -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
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __CAUCHY_CONNECTION_MANAGER_H__
|
||||||
|
#define __CAUCHY_CONNECTION_MANAGER_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <telepathy-glib/telepathy-glib.h>
|
||||||
|
|
||||||
|
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__ */
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the * License, or (at your option) any later
|
* version 3 of the * License, or (at your option) any later
|
||||||
* version.
|
* 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
|
* useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
* See the GNU Lesser General Public License for more details.
|
* See the GNU Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#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);
|
static void _aliasing_iface_init(gpointer, gpointer);
|
||||||
|
|
||||||
struct _MatrixConnectionPrivate {
|
struct _CauchyConnectionPrivate {
|
||||||
gchar *matrix_id;
|
gchar *cauchy_id;
|
||||||
gchar *homeserver;
|
gchar *homeserver;
|
||||||
gchar *password;
|
gchar *password;
|
||||||
GHashTable *aliases;
|
GHashTable *aliases;
|
||||||
@ -34,7 +34,7 @@ struct _MatrixConnectionPrivate {
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_MATRIX_ID,
|
PROP_CAUCHY_ID,
|
||||||
PROP_HOMESERVER,
|
PROP_HOMESERVER,
|
||||||
PROP_PASSWORD,
|
PROP_PASSWORD,
|
||||||
PROP_COUNT
|
PROP_COUNT
|
||||||
@ -44,7 +44,7 @@ static const gchar *interfaces_always_present[] = {
|
|||||||
TP_IFACE_CONNECTION_INTERFACE_ALIASING,
|
TP_IFACE_CONNECTION_INTERFACE_ALIASING,
|
||||||
TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO,
|
TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO,
|
||||||
/* TODO:
|
/* TODO:
|
||||||
MATRIX_IFACE_CONNECTION_INTERFACE_RENAMING,
|
CAUCHY_IFACE_CONNECTION_INTERFACE_RENAMING,
|
||||||
*/
|
*/
|
||||||
TP_IFACE_CONNECTION_INTERFACE_REQUESTS,
|
TP_IFACE_CONNECTION_INTERFACE_REQUESTS,
|
||||||
TP_IFACE_CONNECTION_INTERFACE_CONTACTS,
|
TP_IFACE_CONNECTION_INTERFACE_CONTACTS,
|
||||||
@ -52,16 +52,16 @@ static const gchar *interfaces_always_present[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE(
|
G_DEFINE_TYPE_WITH_CODE(
|
||||||
MatrixConnection, matrix_connection, TP_TYPE_BASE_CONNECTION,
|
CauchyConnection, cauchy_connection, TP_TYPE_BASE_CONNECTION,
|
||||||
G_IMPLEMENT_INTERFACE(
|
G_IMPLEMENT_INTERFACE(
|
||||||
TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING,
|
TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING,
|
||||||
_aliasing_iface_init);
|
_aliasing_iface_init);
|
||||||
G_IMPLEMENT_INTERFACE(
|
G_IMPLEMENT_INTERFACE(
|
||||||
TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_INFO,
|
TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_INFO,
|
||||||
matrix_contact_info_iface_init);
|
cauchy_contact_info_iface_init);
|
||||||
/* TODO:
|
/* TODO:
|
||||||
G_IMPLEMENT_INTERFACE(
|
G_IMPLEMENT_INTERFACE(
|
||||||
MATRIX_TYPE_SVC_CONNECTION_INTERFACE_RENAMING,
|
CAUCHY_TYPE_SVC_CONNECTION_INTERFACE_RENAMING,
|
||||||
_renaming_interface_init);
|
_renaming_interface_init);
|
||||||
*/
|
*/
|
||||||
G_IMPLEMENT_INTERFACE(
|
G_IMPLEMENT_INTERFACE(
|
||||||
@ -70,18 +70,18 @@ G_DEFINE_TYPE_WITH_CODE(
|
|||||||
);
|
);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_set_property(GObject *obj,
|
cauchy_connection_set_property(GObject *obj,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
MatrixConnection *connection = MATRIX_CONNECTION(obj);
|
CauchyConnection *connection = CAUCHY_CONNECTION(obj);
|
||||||
MatrixConnectionPrivate *priv = connection->priv;
|
CauchyConnectionPrivate *priv = connection->priv;
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_MATRIX_ID:
|
case PROP_CAUCHY_ID:
|
||||||
g_free(priv->matrix_id);
|
g_free(priv->cauchy_id);
|
||||||
priv->matrix_id = g_value_dup_string(value);
|
priv->cauchy_id = g_value_dup_string(value);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -105,17 +105,17 @@ matrix_connection_set_property(GObject *obj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_get_property(GObject *obj,
|
cauchy_connection_get_property(GObject *obj,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
MatrixConnection *connection = MATRIX_CONNECTION(obj);
|
CauchyConnection *connection = CAUCHY_CONNECTION(obj);
|
||||||
MatrixConnectionPrivate *priv = connection->priv;
|
CauchyConnectionPrivate *priv = connection->priv;
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_MATRIX_ID:
|
case PROP_CAUCHY_ID:
|
||||||
g_value_set_string(value, priv->matrix_id);
|
g_value_set_string(value, priv->cauchy_id);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -137,14 +137,14 @@ matrix_connection_get_property(GObject *obj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_get_alias_flags(TpSvcConnectionInterfaceAliasing *iface,
|
cauchy_connection_get_alias_flags(TpSvcConnectionInterfaceAliasing *iface,
|
||||||
DBusGMethodInvocation *context)
|
DBusGMethodInvocation *context)
|
||||||
{
|
{
|
||||||
tp_svc_connection_interface_aliasing_return_from_get_alias_flags(context, 0);
|
tp_svc_connection_interface_aliasing_return_from_get_alias_flags(context, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const gchar *
|
static const gchar *
|
||||||
gimme_an_alias(MatrixConnection *connection,
|
gimme_an_alias(CauchyConnection *connection,
|
||||||
TpHandleRepoIface *repo,
|
TpHandleRepoIface *repo,
|
||||||
TpHandle handle)
|
TpHandle handle)
|
||||||
{
|
{
|
||||||
@ -159,11 +159,11 @@ gimme_an_alias(MatrixConnection *connection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_get_aliases(TpSvcConnectionInterfaceAliasing *iface,
|
cauchy_connection_get_aliases(TpSvcConnectionInterfaceAliasing *iface,
|
||||||
const GArray *handles,
|
const GArray *handles,
|
||||||
DBusGMethodInvocation *context)
|
DBusGMethodInvocation *context)
|
||||||
{
|
{
|
||||||
MatrixConnection *self = MATRIX_CONNECTION(iface);
|
CauchyConnection *self = CAUCHY_CONNECTION(iface);
|
||||||
TpHandleRepoIface *repo = tp_base_connection_get_handles(
|
TpHandleRepoIface *repo = tp_base_connection_get_handles(
|
||||||
TP_BASE_CONNECTION(iface),
|
TP_BASE_CONNECTION(iface),
|
||||||
TP_HANDLE_TYPE_CONTACT);
|
TP_HANDLE_TYPE_CONTACT);
|
||||||
@ -192,11 +192,11 @@ matrix_connection_get_aliases(TpSvcConnectionInterfaceAliasing *iface,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_request_aliases(TpSvcConnectionInterfaceAliasing *iface,
|
cauchy_connection_request_aliases(TpSvcConnectionInterfaceAliasing *iface,
|
||||||
const GArray *handles,
|
const GArray *handles,
|
||||||
DBusGMethodInvocation *context)
|
DBusGMethodInvocation *context)
|
||||||
{
|
{
|
||||||
MatrixConnection *connection = MATRIX_CONNECTION(iface);
|
CauchyConnection *connection = CAUCHY_CONNECTION(iface);
|
||||||
TpHandleRepoIface *repo = tp_base_connection_get_handles(
|
TpHandleRepoIface *repo = tp_base_connection_get_handles(
|
||||||
TP_BASE_CONNECTION(iface), TP_HANDLE_TYPE_CONTACT);
|
TP_BASE_CONNECTION(iface), TP_HANDLE_TYPE_CONTACT);
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
@ -226,7 +226,7 @@ _aliasing_iface_init(gpointer g_iface, gpointer iface_data)
|
|||||||
{
|
{
|
||||||
TpSvcConnectionInterfaceAliasingClass *klass = (TpSvcConnectionInterfaceAliasingClass *)g_iface;
|
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_alias_flags);
|
||||||
IMPLEMENT(get_aliases);
|
IMPLEMENT(get_aliases);
|
||||||
IMPLEMENT(request_aliases);
|
IMPLEMENT(request_aliases);
|
||||||
@ -234,10 +234,10 @@ _aliasing_iface_init(gpointer g_iface, gpointer iface_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_finalize(GObject *gobject)
|
cauchy_connection_finalize(GObject *gobject)
|
||||||
{
|
{
|
||||||
g_signal_handlers_destroy(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
|
static void
|
||||||
@ -245,7 +245,7 @@ _aliasing_fill_contact_attributes(GObject *obj,
|
|||||||
const GArray *contacts,
|
const GArray *contacts,
|
||||||
GHashTable *attributes_hash)
|
GHashTable *attributes_hash)
|
||||||
{
|
{
|
||||||
MatrixConnection *connection = MATRIX_CONNECTION(obj);
|
CauchyConnection *connection = CAUCHY_CONNECTION(obj);
|
||||||
TpHandleRepoIface *repo = tp_base_connection_get_handles(
|
TpHandleRepoIface *repo = tp_base_connection_get_handles(
|
||||||
TP_BASE_CONNECTION(connection),
|
TP_BASE_CONNECTION(connection),
|
||||||
TP_HANDLE_TYPE_CONTACT);
|
TP_HANDLE_TYPE_CONTACT);
|
||||||
@ -265,11 +265,11 @@ _aliasing_fill_contact_attributes(GObject *obj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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(
|
tp_contacts_mixin_add_contact_attributes_iface(
|
||||||
obj,
|
obj,
|
||||||
TP_IFACE_CONNECTION_INTERFACE_ALIASING,
|
TP_IFACE_CONNECTION_INTERFACE_ALIASING,
|
||||||
@ -277,10 +277,10 @@ matrix_connection_constructed(GObject *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_dispose(GObject *obj)
|
cauchy_connection_dispose(GObject *obj)
|
||||||
{
|
{
|
||||||
MatrixConnection *connection = MATRIX_CONNECTION(obj);
|
CauchyConnection *connection = CAUCHY_CONNECTION(obj);
|
||||||
MatrixConnectionPrivate *priv = connection->priv;
|
CauchyConnectionPrivate *priv = connection->priv;
|
||||||
|
|
||||||
if (priv->dispose_has_run) {
|
if (priv->dispose_has_run) {
|
||||||
return;
|
return;
|
||||||
@ -290,8 +290,8 @@ matrix_connection_dispose(GObject *obj)
|
|||||||
|
|
||||||
tp_clear_pointer(&priv->aliases, g_hash_table_unref);
|
tp_clear_pointer(&priv->aliases, g_hash_table_unref);
|
||||||
|
|
||||||
if (G_OBJECT_CLASS(matrix_connection_parent_class)->dispose) {
|
if (G_OBJECT_CLASS(cauchy_connection_parent_class)->dispose) {
|
||||||
G_OBJECT_CLASS(matrix_connection_parent_class)->dispose(obj);
|
G_OBJECT_CLASS(cauchy_connection_parent_class)->dispose(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,35 +303,35 @@ _iface_create_handle_repos(TpBaseConnection *connection,
|
|||||||
repos[i] = NULL;
|
repos[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO matrix_handle_repos_init(repos);
|
// TODO cauchy_handle_repos_init(repos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
_iface_get_unique_connection_name(TpBaseConnection *base)
|
_iface_get_unique_connection_name(TpBaseConnection *base)
|
||||||
{
|
{
|
||||||
MatrixConnection *connection = MATRIX_CONNECTION(base);
|
CauchyConnection *connection = CAUCHY_CONNECTION(base);
|
||||||
MatrixConnectionPrivate *priv = connection->priv;
|
CauchyConnectionPrivate *priv = connection->priv;
|
||||||
|
|
||||||
return g_strdup_printf(
|
return g_strdup_printf(
|
||||||
"@%s:%s%p",
|
"@%s:%s%p",
|
||||||
priv->matrix_id, priv->homeserver, connection);
|
priv->cauchy_id, priv->homeserver, connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GPtrArray *
|
static GPtrArray *
|
||||||
_iface_create_channel_managers(TpBaseConnection *base)
|
_iface_create_channel_managers(TpBaseConnection *base)
|
||||||
{
|
{
|
||||||
MatrixConnection *connection = MATRIX_CONNECTION(base);
|
CauchyConnection *connection = CAUCHY_CONNECTION(base);
|
||||||
MatrixConnectionPrivate *priv = connection->priv;
|
CauchyConnectionPrivate *priv = connection->priv;
|
||||||
GPtrArray *managers = g_ptr_array_sized_new(1);
|
GPtrArray *managers = g_ptr_array_sized_new(1);
|
||||||
//GObject *manager;
|
//GObject *manager;
|
||||||
|
|
||||||
/* TODO:
|
/* TODO:
|
||||||
manager = g_object_new(MATRIX_TYPE_IM_MANAGER,
|
manager = g_object_new(CAUCHY_TYPE_IM_MANAGER,
|
||||||
"connection", connection,
|
"connection", connection,
|
||||||
NULL);
|
NULL);
|
||||||
g_ptr_array_add(managers, manager);
|
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,
|
"connection", connection,
|
||||||
NULL);
|
NULL);
|
||||||
*/
|
*/
|
||||||
@ -340,7 +340,7 @@ _iface_create_channel_managers(TpBaseConnection *base)
|
|||||||
g_ptr_array_add(managers, priv->password_manager);
|
g_ptr_array_add(managers, priv->password_manager);
|
||||||
|
|
||||||
/* TODO:
|
/* TODO:
|
||||||
manager = g_object_new(MATRIX_TYPE_ROOMLIST_MANAGER,
|
manager = g_object_new(CAUCHY_TYPE_ROOMLIST_MANAGER,
|
||||||
"connection", connection,
|
"connection", connection,
|
||||||
NULL);
|
NULL);
|
||||||
g_ptr_array_add(managers, manager);
|
g_ptr_array_add(managers, manager);
|
||||||
@ -359,19 +359,19 @@ _iface_disconnected(TpBaseConnection *base)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_class_init(MatrixConnectionClass *klass)
|
cauchy_connection_class_init(CauchyConnectionClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
|
||||||
TpBaseConnectionClass *parent_class = TP_BASE_CONNECTION_CLASS(klass);
|
TpBaseConnectionClass *parent_class = TP_BASE_CONNECTION_CLASS(klass);
|
||||||
GParamSpec *param_spec;
|
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->constructed = cauchy_connection_constructed;
|
||||||
gobject_class->set_property = matrix_connection_set_property;
|
gobject_class->set_property = cauchy_connection_set_property;
|
||||||
gobject_class->get_property = matrix_connection_get_property;
|
gobject_class->get_property = cauchy_connection_get_property;
|
||||||
gobject_class->dispose = matrix_connection_dispose;
|
gobject_class->dispose = cauchy_connection_dispose;
|
||||||
gobject_class->finalize = matrix_connection_finalize;
|
gobject_class->finalize = cauchy_connection_finalize;
|
||||||
|
|
||||||
parent_class->create_handle_repos = _iface_create_handle_repos;
|
parent_class->create_handle_repos = _iface_create_handle_repos;
|
||||||
parent_class->get_unique_connection_name = _iface_get_unique_connection_name;
|
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(
|
param_spec = g_param_spec_string(
|
||||||
"matrix-id",
|
"cauchy-id",
|
||||||
"Matrix ID",
|
"Cauchy ID",
|
||||||
"Your registered Matrix ID",
|
"Your registered Cauchy ID",
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
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(
|
param_spec = g_param_spec_string(
|
||||||
"homeserver",
|
"homeserver",
|
||||||
@ -410,29 +410,29 @@ matrix_connection_class_init(MatrixConnectionClass *klass)
|
|||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||||
g_object_class_install_property(gobject_class, PROP_PASSWORD, param_spec);
|
g_object_class_install_property(gobject_class, PROP_PASSWORD, param_spec);
|
||||||
|
|
||||||
tp_contacts_mixin_class_init(gobject_class, G_STRUCT_OFFSET(MatrixConnectionClass, contacts));
|
tp_contacts_mixin_class_init(gobject_class, G_STRUCT_OFFSET(CauchyConnectionClass, contacts));
|
||||||
matrix_contact_info_class_init(klass);
|
cauchy_contact_info_class_init(klass);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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,
|
connection,
|
||||||
MATRIX_TYPE_CONNECTION, MatrixConnectionPrivate);
|
CAUCHY_TYPE_CONNECTION, CauchyConnectionPrivate);
|
||||||
|
|
||||||
connection->priv = priv;
|
connection->priv = priv;
|
||||||
priv->aliases = g_hash_table_new_full(NULL, NULL, NULL, g_free);
|
priv->aliases = g_hash_table_new_full(NULL, NULL, NULL, g_free);
|
||||||
|
|
||||||
tp_contacts_mixin_init(
|
tp_contacts_mixin_init(
|
||||||
G_OBJECT(connection),
|
G_OBJECT(connection),
|
||||||
G_STRUCT_OFFSET(MatrixConnection, contacts));
|
G_STRUCT_OFFSET(CauchyConnection, contacts));
|
||||||
tp_base_connection_register_with_contacts_mixin(
|
tp_base_connection_register_with_contacts_mixin(
|
||||||
(TpBaseConnection *)connection);
|
(TpBaseConnection *)connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
const gchar * const *
|
const gchar * const *
|
||||||
matrix_connection_get_implemented_interfaces(void)
|
cauchy_connection_get_implemented_interfaces(void)
|
||||||
{
|
{
|
||||||
/* We don’t have any conditionally implemented interfaces */
|
/* We don’t have any conditionally implemented interfaces */
|
||||||
|
|
59
src/cauchy-connection.h
Normal file
59
src/cauchy-connection.h
Normal file
@ -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
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __CAUCHY_CONNECTION_H__
|
||||||
|
#define __CAUCHY_CONNECTION_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <telepathy-glib/telepathy-glib.h>
|
||||||
|
|
||||||
|
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__ */
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the License, or (at your option) any later version.
|
* 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
|
* useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
* See the GNU Lesser General Public License for more details.
|
* See the GNU Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "matrix-contact-info.h"
|
#include "cauchy-contact-info.h"
|
||||||
|
|
||||||
#define MATRIX_DEBUG_FLAG MATRIX_DEBUG_CONNECTION
|
#define CAUCHY_DEBUG_FLAG CAUCHY_DEBUG_CONNECTION
|
||||||
#include "matrix-debug.h"
|
#include "cauchy-debug.h"
|
||||||
|
|
||||||
typedef enum _ContactPresence {
|
typedef enum _ContactPresence {
|
||||||
CONTACT_PRESENCE_UNKNOWN,
|
CONTACT_PRESENCE_UNKNOWN,
|
||||||
@ -38,7 +38,7 @@ typedef struct _ContactInfoRequest {
|
|||||||
} ContactInfoRequest;
|
} ContactInfoRequest;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_contact_info_properties_getter(GObject *gobject,
|
cauchy_contact_info_properties_getter(GObject *gobject,
|
||||||
GQuark interface,
|
GQuark interface,
|
||||||
GQuark name,
|
GQuark name,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
@ -58,7 +58,7 @@ matrix_contact_info_properties_getter(GObject *gobject,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
matrix_contact_info_class_init(MatrixConnectionClass *klass)
|
cauchy_contact_info_class_init(CauchyConnectionClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS(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(
|
tp_dbus_properties_mixin_implement_interface(
|
||||||
gobject_class,
|
gobject_class,
|
||||||
TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO,
|
TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO,
|
||||||
matrix_contact_info_properties_getter,
|
cauchy_contact_info_properties_getter,
|
||||||
NULL,
|
NULL,
|
||||||
props);
|
props);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_contact_info_fill_contact_attributes(GObject *gobject,
|
cauchy_contact_info_fill_contact_attributes(GObject *gobject,
|
||||||
const GArray *contacts,
|
const GArray *contacts,
|
||||||
GHashTable *attributes_hash)
|
GHashTable *attributes_hash)
|
||||||
{
|
{
|
||||||
@ -85,7 +85,7 @@ matrix_contact_info_fill_contact_attributes(GObject *gobject,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
matrix_contact_info_init(MatrixConnection *connection)
|
cauchy_contact_info_init(CauchyConnection *connection)
|
||||||
{
|
{
|
||||||
connection->contact_info_requests = g_queue_new();
|
connection->contact_info_requests = g_queue_new();
|
||||||
|
|
||||||
@ -94,18 +94,18 @@ matrix_contact_info_init(MatrixConnection *connection)
|
|||||||
tp_contacts_mixin_add_contact_attributes_iface(
|
tp_contacts_mixin_add_contact_attributes_iface(
|
||||||
G_OBJECT(connection),
|
G_OBJECT(connection),
|
||||||
TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO,
|
TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO,
|
||||||
matrix_contact_info_fill_contact_attributes);
|
cauchy_contact_info_fill_contact_attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_send_request_contact_info(MatrixConnection *connection,
|
_send_request_contact_info(CauchyConnection *connection,
|
||||||
ContactInfoRequest *request)
|
ContactInfoRequest *request)
|
||||||
{
|
{
|
||||||
// TODO: implement actual contact info querying
|
// TODO: implement actual contact info querying
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_queue_request_contact_info(MatrixConnection *connection,
|
_queue_request_contact_info(CauchyConnection *connection,
|
||||||
guint handle,
|
guint handle,
|
||||||
const gchar *id,
|
const gchar *id,
|
||||||
DBusGMethodInvocation *context)
|
DBusGMethodInvocation *context)
|
||||||
@ -127,12 +127,12 @@ _queue_request_contact_info(MatrixConnection *connection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_connection_request_contact_info(
|
cauchy_connection_request_contact_info(
|
||||||
TpSvcConnectionInterfaceContactInfo *iface,
|
TpSvcConnectionInterfaceContactInfo *iface,
|
||||||
guint contact,
|
guint contact,
|
||||||
DBusGMethodInvocation *context)
|
DBusGMethodInvocation *context)
|
||||||
{
|
{
|
||||||
MatrixConnection *connection = MATRIX_CONNECTION(iface);
|
CauchyConnection *connection = CAUCHY_CONNECTION(iface);
|
||||||
TpBaseConnection *base = TP_BASE_CONNECTION(connection);
|
TpBaseConnection *base = TP_BASE_CONNECTION(connection);
|
||||||
TpHandleRepoIface *contact_handles = tp_base_connection_get_handles(
|
TpHandleRepoIface *contact_handles = tp_base_connection_get_handles(
|
||||||
base,
|
base,
|
||||||
@ -151,18 +151,18 @@ matrix_connection_request_contact_info(
|
|||||||
|
|
||||||
id = tp_handle_inspect(contact_handles, contact);
|
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);
|
contact, id);
|
||||||
|
|
||||||
_queue_request_contact_info(connection, contact, id, context);
|
_queue_request_contact_info(connection, contact, id, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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;
|
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);
|
IMPLEMENT(request_contact_info);
|
||||||
#undef IMPLEMENT
|
#undef IMPLEMENT
|
||||||
}
|
}
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the License, or (at your option) any later version.
|
* 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
|
* useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
* See the GNU Lesser General Public License for more details.
|
* See the GNU Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __MATRIX_CONTACT_INFO_H__
|
#ifndef __CAUCHY_CONTACT_INFO_H__
|
||||||
#define __MATRIX_CONTACT_INFO_H__
|
#define __CAUCHY_CONTACT_INFO_H__
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include <telepathy-glib/telepathy-glib.h>
|
#include <telepathy-glib/telepathy-glib.h>
|
||||||
|
|
||||||
#include "matrix-connection.h"
|
#include "cauchy-connection.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
void matrix_contact_info_class_init(MatrixConnectionClass *klass);
|
void cauchy_contact_info_class_init(CauchyConnectionClass *klass);
|
||||||
void matrix_contact_info_iface_init(gpointer g_iface, gpointer iface_data);
|
void cauchy_contact_info_iface_init(gpointer g_iface, gpointer iface_data);
|
||||||
void matrix_contact_info_init(MatrixConnection *connection);
|
void cauchy_contact_info_init(CauchyConnection *connection);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __MATRIX_CONTACT_INFO_H__ */
|
#endif /* __CAUCHY_CONTACT_INFO_H__ */
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the License, or (at your option) any later version.
|
* 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
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "matrix-debug.h"
|
#include "cauchy-debug.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <telepathy-glib/telepathy-glib.h>
|
#include <telepathy-glib/telepathy-glib.h>
|
||||||
|
|
||||||
static MatrixDebugFlags _flags = 0;
|
static CauchyDebugFlags _flags = 0;
|
||||||
|
|
||||||
static GDebugKey _keys[] = {
|
static GDebugKey _keys[] = {
|
||||||
{"connection", MATRIX_DEBUG_CONNECTION},
|
{"connection", CAUCHY_DEBUG_CONNECTION},
|
||||||
{"dns", MATRIX_DEBUG_DNS},
|
{"dns", CAUCHY_DEBUG_DNS},
|
||||||
{"im", MATRIX_DEBUG_IM},
|
{"im", CAUCHY_DEBUG_IM},
|
||||||
{"muc", MATRIX_DEBUG_MUC},
|
{"muc", CAUCHY_DEBUG_MUC},
|
||||||
{"network", MATRIX_DEBUG_NETWORK},
|
{"network", CAUCHY_DEBUG_NETWORK},
|
||||||
{"parser", MATRIX_DEBUG_PARSER},
|
{"parser", CAUCHY_DEBUG_PARSER},
|
||||||
{"text", MATRIX_DEBUG_TEXT},
|
{"text", CAUCHY_DEBUG_TEXT},
|
||||||
{"tls", MATRIX_DEBUG_TLS},
|
{"tls", CAUCHY_DEBUG_TLS},
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
matrix_debug_init (void) {
|
cauchy_debug_init (void) {
|
||||||
const gchar *flags_string = g_getenv("MATRIX_DEBUG");
|
const gchar *flags_string = g_getenv("CAUCHY_DEBUG");
|
||||||
guint nkeys;
|
guint nkeys;
|
||||||
|
|
||||||
for (nkeys = 0; _keys[nkeys].value; 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);
|
_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);
|
tp_debug_set_persistent(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
GHashTable *flag_to_domains = NULL;
|
GHashTable *flag_to_domains = NULL;
|
||||||
|
|
||||||
static const gchar *
|
static const gchar *
|
||||||
debug_flag_to_domain (MatrixDebugFlags flag)
|
debug_flag_to_domain (CauchyDebugFlags flag)
|
||||||
{
|
{
|
||||||
if (G_UNLIKELY (flag_to_domains == NULL)) {
|
if (G_UNLIKELY (flag_to_domains == NULL)) {
|
||||||
guint i;
|
guint i;
|
||||||
@ -68,7 +68,7 @@ debug_flag_to_domain (MatrixDebugFlags flag)
|
|||||||
GDebugKey key = _keys[i];
|
GDebugKey key = _keys[i];
|
||||||
gchar *val;
|
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,
|
g_hash_table_insert (flag_to_domains,
|
||||||
GUINT_TO_POINTER (key.value), val);
|
GUINT_TO_POINTER (key.value), val);
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ debug_flag_to_domain (MatrixDebugFlags flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
matrix_debug_free (void)
|
cauchy_debug_free (void)
|
||||||
{
|
{
|
||||||
if (flag_to_domains == NULL)
|
if (flag_to_domains == NULL)
|
||||||
return;
|
return;
|
||||||
@ -88,7 +88,7 @@ matrix_debug_free (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
log_to_debug_sender (MatrixDebugFlags flag,
|
log_to_debug_sender (CauchyDebugFlags flag,
|
||||||
const gchar *message)
|
const gchar *message)
|
||||||
{
|
{
|
||||||
TpDebugSender *dbg;
|
TpDebugSender *dbg;
|
||||||
@ -104,7 +104,7 @@ log_to_debug_sender (MatrixDebugFlags flag,
|
|||||||
g_object_unref (dbg);
|
g_object_unref (dbg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void matrix_debug(MatrixDebugFlags flag, const gchar *format, ...) {
|
void cauchy_debug(CauchyDebugFlags flag, const gchar *format, ...) {
|
||||||
gchar *message;
|
gchar *message;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
47
src/cauchy-debug.h
Normal file
47
src/cauchy-debug.h
Normal file
@ -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
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __CAUCHY_DEBUG_H__
|
||||||
|
#define __CAUCHY_DEBUG_H__
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
|
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 */
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the License, or (at your option) any later version.
|
* 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
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "matrix-handles.h"
|
#include "cauchy-handles.h"
|
||||||
|
|
||||||
#include <telepathy-glib/telepathy-glib.h>
|
#include <telepathy-glib/telepathy-glib.h>
|
||||||
|
|
||||||
#define MATRIX_DEBUG_FLAG MATRIX_DEBUG_PARSER
|
#define CAUCHY_DEBUG_FLAG CAUCHY_DEBUG_PARSER
|
||||||
#include "matrix-debug.h"
|
#include "cauchy-debug.h"
|
||||||
|
|
||||||
gboolean
|
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(
|
CAUCHY_DEBUG(
|
||||||
"Validating Matrix ID '%s' with strict mode %d",
|
"Validating Cauchy ID '%s' with strict mode %d",
|
||||||
matrix_id, strict_mode);
|
cauchy_id, strict_mode);
|
||||||
|
|
||||||
if (!matrix_id || *matrix_id == '\0') {
|
if (!cauchy_id || *cauchy_id == '\0') {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_utf8_validate(matrix_id, -1, NULL)) {
|
if (!g_utf8_validate(cauchy_id, -1, NULL)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,18 +44,18 @@ matrix_id_is_valid(const gchar *matrix_id, gboolean strict_mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
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,
|
g_set_error(err,
|
||||||
TP_ERROR, TP_ERROR_INVALID_HANDLE,
|
TP_ERROR, TP_ERROR_INVALID_HANDLE,
|
||||||
"Invalid Matrix ID");
|
"Invalid Cauchy ID");
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* telepathy-idle sets the nickname to lowercase here. I’m not
|
/* 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);
|
return g_strdup(id);
|
||||||
}
|
}
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the License, or (at your option) any later version.
|
* 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
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __MATRIX_HANDLES_H__
|
#ifndef __CAUCHY_HANDLES_H__
|
||||||
#define __MATRIX_HANDLES_H__
|
#define __CAUCHY_HANDLES_H__
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
gboolean matrix_id_is_valid(const gchar *matrix_id, gboolean strict_mode);
|
gboolean cauchy_id_is_valid(const gchar *cauchy_id, gboolean strict_mode);
|
||||||
gchar *matrix_normalize_id(const gchar *id, GError **err);
|
gchar *cauchy_normalize_id(const gchar *id, GError **err);
|
||||||
|
|
||||||
#endif /* __MATRIX_HANDLES_H__ */
|
#endif /* __CAUCHY_HANDLES_H__ */
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the License, or (at your option) any later version.
|
* 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
|
* useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
* See the GNU Lesser General Public License for more details.
|
* See the GNU Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#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! */
|
/* 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
|
static void
|
||||||
matrix_im_manager_finalize(GObject *gobject)
|
cauchy_im_manager_finalize(GObject *gobject)
|
||||||
{
|
{
|
||||||
g_signal_handlers_destroy(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
|
static void
|
||||||
matrix_im_manager_class_init(MatrixIMManagerClass *klass)
|
cauchy_im_manager_class_init(CauchyIMManagerClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
|
||||||
|
|
||||||
gobject_class->finalize = matrix_im_manager_finalize;
|
gobject_class->finalize = cauchy_im_manager_finalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_im_manager_init(MatrixIMManager *im_manager)
|
cauchy_im_manager_init(CauchyIMManager *im_manager)
|
||||||
{
|
{
|
||||||
}
|
}
|
51
src/cauchy-im-manager.h
Normal file
51
src/cauchy-im-manager.h
Normal file
@ -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
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __CAUCHY_IM_MANAGER_H__
|
||||||
|
#define __CAUCHY_IM_MANAGER_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
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__ */
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the License, or (at your option) any later version.
|
* 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
|
* useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
* See the GNU Lesser General Public License for more details.
|
* See the GNU Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#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! */
|
/* 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
|
static void
|
||||||
matrix_muc_manager_finalize(GObject *gobject)
|
cauchy_muc_manager_finalize(GObject *gobject)
|
||||||
{
|
{
|
||||||
g_signal_handlers_destroy(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
|
static void
|
||||||
matrix_muc_manager_class_init(MatrixMUCManagerClass *klass)
|
cauchy_muc_manager_class_init(CauchyMUCManagerClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
|
||||||
|
|
||||||
gobject_class->finalize = matrix_muc_manager_finalize;
|
gobject_class->finalize = cauchy_muc_manager_finalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_muc_manager_init(MatrixMUCManager *muc_manager)
|
cauchy_muc_manager_init(CauchyMUCManager *muc_manager)
|
||||||
{
|
{
|
||||||
}
|
}
|
51
src/cauchy-muc-manager.h
Normal file
51
src/cauchy-muc-manager.h
Normal file
@ -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
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __CAUCHY_MUC_MANAGER_H__
|
||||||
|
#define __CAUCHY_MUC_MANAGER_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
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__ */
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the License, or (at your option) any later version.
|
* 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
|
* useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
* See the GNU Lesser General Public License for more details.
|
* See the GNU Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "matrix-protocol.h"
|
#include "cauchy-protocol.h"
|
||||||
#include "matrix-handles.h"
|
#include "cauchy-handles.h"
|
||||||
#include "matrix-connection.h"
|
#include "cauchy-connection.h"
|
||||||
#include "matrix-im-manager.h"
|
#include "cauchy-im-manager.h"
|
||||||
#include "matrix-muc-manager.h"
|
#include "cauchy-muc-manager.h"
|
||||||
|
|
||||||
#include <dbus/dbus-protocol.h>
|
#include <dbus/dbus-protocol.h>
|
||||||
|
|
||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
static gboolean filter_account(const TpCMParamSpec *, GValue *, GError **);
|
static gboolean filter_account(const TpCMParamSpec *, GValue *, GError **);
|
||||||
|
|
||||||
static const TpCMParamSpec matrix_params[] = {
|
static const TpCMParamSpec cauchy_params[] = {
|
||||||
{
|
{
|
||||||
"account",
|
"account",
|
||||||
DBUS_TYPE_STRING_AS_STRING, G_TYPE_STRING,
|
DBUS_TYPE_STRING_AS_STRING, G_TYPE_STRING,
|
||||||
@ -51,20 +51,20 @@ static const TpCMParamSpec matrix_params[] = {
|
|||||||
{NULL, NULL, 0, 0, NULL, 0}
|
{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
|
static gboolean
|
||||||
filter_account(const TpCMParamSpec *paramspec, GValue *value, GError **err)
|
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));
|
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,
|
g_set_error(err,
|
||||||
TP_ERROR, TP_ERROR_INVALID_HANDLE,
|
TP_ERROR, TP_ERROR_INVALID_HANDLE,
|
||||||
"Invalid account name '%s'", matrixid);
|
"Invalid account name '%s'", matrix_id);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ filter_account(const TpCMParamSpec *paramspec, GValue *value, GError **err)
|
|||||||
static const TpCMParamSpec *
|
static const TpCMParamSpec *
|
||||||
get_parameters(TpBaseProtocol *self G_GNUC_UNUSED)
|
get_parameters(TpBaseProtocol *self G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
return matrix_params;
|
return cauchy_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TpBaseConnection *
|
static TpBaseConnection *
|
||||||
@ -83,7 +83,7 @@ new_connection(TpBaseProtocol *protocol G_GNUC_UNUSED,
|
|||||||
GHashTable *params,
|
GHashTable *params,
|
||||||
GError **err G_GNUC_UNUSED)
|
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"),
|
"homeserver", tp_asv_get_string(params, "homeserver"),
|
||||||
"matrix_id", tp_asv_get_string(params, "account"),
|
"matrix_id", tp_asv_get_string(params, "account"),
|
||||||
"password", tp_asv_get_string(params, "password"),
|
"password", tp_asv_get_string(params, "password"),
|
||||||
@ -95,7 +95,7 @@ normalize_contact(TpBaseProtocol *protocol G_GNUC_UNUSED,
|
|||||||
const gchar *contact,
|
const gchar *contact,
|
||||||
GError **err)
|
GError **err)
|
||||||
{
|
{
|
||||||
return matrix_normalize_id(contact, err);
|
return cauchy_normalize_id(contact, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
@ -103,7 +103,7 @@ identify_account(TpBaseProtocol *protocol G_GNUC_UNUSED,
|
|||||||
GHashTable *asv,
|
GHashTable *asv,
|
||||||
GError **err)
|
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 *server;
|
||||||
gchar *id_at_server;
|
gchar *id_at_server;
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ get_interfaces_array(TpBaseProtocol *protocol)
|
|||||||
{
|
{
|
||||||
GPtrArray *interfaces;
|
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;
|
return interfaces;
|
||||||
}
|
}
|
||||||
@ -140,13 +140,13 @@ get_connection_details(TpBaseProtocol *protocol,
|
|||||||
{
|
{
|
||||||
if (connection_interfaces != NULL) {
|
if (connection_interfaces != NULL) {
|
||||||
*connection_interfaces = g_strdupv(
|
*connection_interfaces = g_strdupv(
|
||||||
(GStrv)matrix_connection_get_implemented_interfaces());
|
(GStrv)cauchy_connection_get_implemented_interfaces());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channel_managers != NULL) {
|
if (channel_managers != NULL) {
|
||||||
GType types[] = {
|
GType types[] = {
|
||||||
MATRIX_TYPE_IM_MANAGER,
|
CAUCHY_TYPE_IM_MANAGER,
|
||||||
MATRIX_TYPE_MUC_MANAGER,
|
CAUCHY_TYPE_MUC_MANAGER,
|
||||||
G_TYPE_INVALID
|
G_TYPE_INVALID
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ dup_authentication_types(TpBaseProtocol *base)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_protocol_class_init(MatrixProtocolClass *klass)
|
cauchy_protocol_class_init(CauchyProtocolClass *klass)
|
||||||
{
|
{
|
||||||
TpBaseProtocolClass *base_class = (TpBaseProtocolClass *)klass;
|
TpBaseProtocolClass *base_class = (TpBaseProtocolClass *)klass;
|
||||||
|
|
||||||
@ -191,14 +191,14 @@ matrix_protocol_class_init(MatrixProtocolClass *klass)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
matrix_protocol_init(MatrixProtocol *protocol)
|
cauchy_protocol_init(CauchyProtocol *protocol)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
TpBaseProtocol *
|
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,
|
"name", PROTOCOL_NAME,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
53
src/cauchy-protocol.h
Normal file
53
src/cauchy-protocol.h
Normal file
@ -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
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __CAUCHY_PROTOCOL_H__
|
||||||
|
#define __CAUCHY_PROTOCOL_H__
|
||||||
|
|
||||||
|
#include <telepathy-glib/telepathy-glib.h>
|
||||||
|
|
||||||
|
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__ */
|
@ -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
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation, either
|
* License as published by the Free Software Foundation, either
|
||||||
* version 3 of the License, or (at your option) any later version.
|
* 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
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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
|
||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -20,14 +20,14 @@
|
|||||||
|
|
||||||
#include <telepathy-glib/telepathy-glib.h>
|
#include <telepathy-glib/telepathy-glib.h>
|
||||||
|
|
||||||
#include "matrix-connection-manager.h"
|
#include "cauchy-connection-manager.h"
|
||||||
#include "matrix-debug.h"
|
#include "cauchy-debug.h"
|
||||||
|
|
||||||
static TpBaseConnectionManager *
|
static TpBaseConnectionManager *
|
||||||
_construct_cm(void)
|
_construct_cm(void)
|
||||||
{
|
{
|
||||||
TpBaseConnectionManager *base_cm = TP_BASE_CONNECTION_MANAGER(
|
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;
|
return base_cm;
|
||||||
}
|
}
|
||||||
@ -39,14 +39,14 @@ main(int argc, char **argv)
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
g_type_init();
|
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();
|
debug_sender = tp_debug_sender_dup();
|
||||||
|
|
||||||
result = tp_run_connection_manager(
|
result = tp_run_connection_manager(
|
||||||
"telepathy-matrix", VERSION,
|
"telepathy-cauchy", VERSION,
|
||||||
_construct_cm,
|
_construct_cm,
|
||||||
argc, argv);
|
argc, argv);
|
||||||
|
|
@ -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
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __MATRIX_CONNECTION_MANAGER_H__
|
|
||||||
#define __MATRIX_CONNECTION_MANAGER_H__
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
|
||||||
#include <telepathy-glib/telepathy-glib.h>
|
|
||||||
|
|
||||||
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__ */
|
|
@ -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
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __MATRIX_CONNECTION_H__
|
|
||||||
#define __MATRIX_CONNECTION_H__
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
|
||||||
#include <telepathy-glib/telepathy-glib.h>
|
|
||||||
|
|
||||||
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__ */
|
|
@ -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
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __MATRIX_DEBUG_H__
|
|
||||||
#define __MATRIX_DEBUG_H__
|
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
|
|
||||||
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 */
|
|
@ -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
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __MATRIX_IM_MANAGER_H__
|
|
||||||
#define __MATRIX_IM_MANAGER_H__
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
|
||||||
|
|
||||||
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__ */
|
|
@ -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
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __MATRIX_MUC_MANAGER_H__
|
|
||||||
#define __MATRIX_MUC_MANAGER_H__
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
|
||||||
|
|
||||||
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__ */
|
|
@ -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
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __MATRIX_PROTOCOL_H__
|
|
||||||
#define __MATRIX_PROTOCOL_H__
|
|
||||||
|
|
||||||
#include <telepathy-glib/telepathy-glib.h>
|
|
||||||
|
|
||||||
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__ */
|
|
@ -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
|
\" 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 <gergely@polonkai.eu>
|
\" Copyright © 2015 Gergely Polonkai <gergely@polonkai.eu>
|
||||||
\" 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
|
.SH NAME
|
||||||
telepathy-matrix \- Telepathy connection manager for Matrix.org
|
telepathy-cauchy \- Telepathy connection manager for Matrix.org
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fB@libexecdir@/telepathy\-matrix\fR
|
\fB@libexecdir@/telepathy\-cauchy\fR
|
||||||
.SH DESCRIPTION
|
.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
|
Matrix.org, allowing Telepathy clients like
|
||||||
.BR empathy (1)
|
.BR empathy (1)
|
||||||
to connect to Matrix.org home servers.
|
to connect to Matrix.org home servers.
|
||||||
@ -20,14 +20,14 @@ start it manually for debugging.
|
|||||||
There are no command-line options.
|
There are no command-line options.
|
||||||
.SH ENVIRONMENT
|
.SH ENVIRONMENT
|
||||||
.TP
|
.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 set, debug output will go to the given file rather than to stderr.
|
||||||
If \fB+\fR is prepended to the \fIfilename\fR (e.g.
|
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.
|
to the file; otherwise, any existing file will be replaced.
|
||||||
.TP
|
.TP
|
||||||
.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
|
May be set to "all" for full debug output, or various undocumented options
|
||||||
(which may change from release to release) to filter the output.
|
(which may change from release to release) to filter the output.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
Loading…
Reference in New Issue
Block a user