summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-03-24 20:26:52 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-03-25 14:03:04 -0400
commitf1f8673bea54f69765c48aa71b217865562c0095 (patch)
tree750e7684ed57fa2565477d5f2aa9453bf68147ea
parentfef67aaec653f183c797597dd081bfc1e00cee6e (diff)
Make Call support conditional to --enable-call
-rw-r--r--configure.ac13
-rw-r--r--data/Logger.Call.client.in (renamed from data/Logger.client)13
-rw-r--r--data/Logger.Observer.client.in3
-rw-r--r--data/Logger.Recover.client.in2
-rw-r--r--data/Logger.Text.client.in8
-rw-r--r--data/Makefile.am22
-rw-r--r--src/telepathy-logger.c7
-rw-r--r--telepathy-logger/Makefile.am35
-rw-r--r--telepathy-logger/observer.c2
9 files changed, 80 insertions, 25 deletions
diff --git a/configure.ac b/configure.ac
index 36e616c..3d7ea48 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,18 @@ if test x$enable_debug = xyes; then
fi
AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = xyes])
+#------------------------------------------------------------
+# Enable Call logging
+#------------------------------------------------------------
+AC_ARG_ENABLE(call,
+ AS_HELP_STRING([--enable-call],[compile with experimental Call logging support]),
+ enable_call=$enableval, enable_call=no )
+
+if test x$enable_call = xyes; then
+ AC_DEFINE(ENABLE_CALL, [], [Enable Call logging])
+fi
+AM_CONDITIONAL([ENABLE_CALL], [test "x$enable_call" = xyes])
+
# -----------------------------------------------------------
# Coding style checks
# -----------------------------------------------------------
@@ -224,5 +236,6 @@ Configure summary:
Bugreporting URL............: ${PACKAGE_BUGREPORT}
Public extensions library...: ${enable_public_extensions}
Introspection support.......: ${found_introspection}
+ Call support................: ${enable_call}
"
diff --git a/data/Logger.client b/data/Logger.Call.client.in
index e76023d..c943eec 100644
--- a/data/Logger.client
+++ b/data/Logger.Call.client.in
@@ -1,14 +1,3 @@
-[org.freedesktop.Telepathy.Client]
-Interfaces=org.freedesktop.Telepathy.Client.Observer
-
-[org.freedesktop.Telepathy.Client.Observer.ObserverChannelFilter 0]
-org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text
-org.freedesktop.Telepathy.Channel.TargetHandleType u=1
-
-[org.freedesktop.Telepathy.Client.Observer.ObserverChannelFilter 1]
-org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text
-org.freedesktop.Telepathy.Channel.TargetHandleType u=2
-
[org.freedesktop.Telepathy.Client.Observer.ObserverChannelFilter 2]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamedMedia
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
@@ -21,5 +10,3 @@ org.freedesktop.Telepathy.Channel.TargetHandleType u=1
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call.DRAFT
org.freedesktop.Telepathy.Channel.TargetHandleType u=2
-[org.freedesktop.Telepathy.Client.Observer]
-Recover=true
diff --git a/data/Logger.Observer.client.in b/data/Logger.Observer.client.in
new file mode 100644
index 0000000..e3cff68
--- /dev/null
+++ b/data/Logger.Observer.client.in
@@ -0,0 +1,3 @@
+[org.freedesktop.Telepathy.Client]
+Interfaces=org.freedesktop.Telepathy.Client.Observer
+
diff --git a/data/Logger.Recover.client.in b/data/Logger.Recover.client.in
new file mode 100644
index 0000000..bd1766f
--- /dev/null
+++ b/data/Logger.Recover.client.in
@@ -0,0 +1,2 @@
+[org.freedesktop.Telepathy.Client.Observer]
+Recover=true
diff --git a/data/Logger.Text.client.in b/data/Logger.Text.client.in
new file mode 100644
index 0000000..562b040
--- /dev/null
+++ b/data/Logger.Text.client.in
@@ -0,0 +1,8 @@
+[org.freedesktop.Telepathy.Client.Observer.ObserverChannelFilter 0]
+org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text
+org.freedesktop.Telepathy.Channel.TargetHandleType u=1
+
+[org.freedesktop.Telepathy.Client.Observer.ObserverChannelFilter 1]
+org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text
+org.freedesktop.Telepathy.Channel.TargetHandleType u=2
+
diff --git a/data/Makefile.am b/data/Makefile.am
index 179e08f..69953bf 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -14,13 +14,31 @@ servicefile_DATA = $(servicefile_in_files:.service.in=.service)
$(AM_V_GEN)sed -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@
clientfiledir = $(datarootdir)/telepathy/clients
+
+clientfile_parts = $(top_srcdir)/data/Logger.Observer.client.in \
+ $(top_srcdir)/data/Logger.Text.client.in \
+ $(top_srcdir)/data/Logger.Call.client.in \
+ $(top_srcdir)/data/Logger.Recover.client.in
+
clientfile_DATA = Logger.client
EXTRA_DIST = \
$(gsettings_files) \
$(clientfile_DATA) \
- $(servicefile_in_files)
+ $(servicefile_in_files) \
+ $(client_file_parts)
CLEANFILES = \
$(gsettings_SCHEMAS) \
- $(servicefile_DATA)
+ $(servicefile_DATA) \
+ $(clientfile_DATA)
+
+# Generates Logger.client file
+Logger.client: $(clientfile_parts)
+ cp $(top_srcdir)/data/Logger.Observer.client.in $(clientfile_DATA)
+ cat $(top_srcdir)/data/Logger.Text.client.in >> $(clientfile_DATA)
+if ENABLE_CALL
+ cat $(top_srcdir)/data/Logger.Call.client.in >> $(clientfile_DATA)
+endif
+ cat $(top_srcdir)/data/Logger.Recover.client.in >> $(clientfile_DATA)
+
diff --git a/src/telepathy-logger.c b/src/telepathy-logger.c
index 57dbd46..a6513ff 100644
--- a/src/telepathy-logger.c
+++ b/src/telepathy-logger.c
@@ -25,12 +25,15 @@
#include <telepathy-glib/telepathy-glib.h>
#include <telepathy-glib/debug-sender.h>
-#include <telepathy-logger/call-channel-internal.h>
#include <telepathy-logger/channel-factory-internal.h>
#include <telepathy-logger/text-channel-internal.h>
#include <telepathy-logger/observer-internal.h>
#include <telepathy-logger/dbus-service-internal.h>
+
+#ifdef ENABLE_CALL
+#include <telepathy-logger/call-channel-internal.h>
#include <telepathy-logger/streamed-media-channel-internal.h>
+#endif /* ENABLE_CALL */
#define DEBUG_FLAG TPL_DEBUG_MAIN
#include <telepathy-logger/debug-internal.h>
@@ -175,6 +178,7 @@ main (int argc,
(TplChannelConstructor) _tpl_text_channel_new);
DEBUG ("- TplTextChannel registered.");
+#ifdef ENABLE_CALL
_tpl_channel_factory_add ("org.freedesktop.Telepathy.Channel.Type.StreamedMedia",
(TplChannelConstructor) _tpl_streamed_media_channel_new);
DEBUG ("- TplStreamedMediaChannel registered.");
@@ -182,6 +186,7 @@ main (int argc,
_tpl_channel_factory_add ("org.freedesktop.Telepathy.Channel.Type.Call.DRAFT",
(TplChannelConstructor) _tpl_call_channel_new);
DEBUG ("- TplCallChannel registered.");
+#endif /* ENABLE_CALL */
observer = _tpl_observer_new ();
DEBUG ("Registering channel factory into TplObserver");
diff --git a/telepathy-logger/Makefile.am b/telepathy-logger/Makefile.am
index ab35f93..959bcf4 100644
--- a/telepathy-logger/Makefile.am
+++ b/telepathy-logger/Makefile.am
@@ -21,14 +21,38 @@ pkgconfig_DATA = telepathy-logger-0.2.pc
lib_LTLIBRARIES = libtelepathy-logger.la
+EXTRA_DIST = \
+ tpl-marshal.list \
+ $(NULL)
+
+if ENABLE_CALL
+
+call_headers = call-event.h
+call_sources = \
+ call-channel.c \
+ call-channel-internal.h \
+ streamed-media-channel.c \
+ streamed-media-channel-internal.h
+
+else # ENABLE_CALL
+
+EXTRA_DIST += \
+ call-event.h \
+ call-channel.c \
+ call-channel-internal.h \
+ streamed-media-channel.c \
+ streamed-media-channel-internal.h
+
+endif # ENABLE_CALL
+
LIBTPLdir = $(includedir)/telepathy-logger-0.2/telepathy-logger
LIBTPL_HEADERS = \
- call-event.h \
entity.h \
event.h \
log-manager.h \
telepathy-logger.h \
text-event.h \
+ $(call_headers) \
$(NULL)
%-marshal.c: %-marshal.list Makefile.am
@@ -45,8 +69,6 @@ BUILT_SOURCES = \
libtelepathy_logger_la_SOURCES = \
action-chain.c \
action-chain-internal.h \
- call-channel.c \
- call-channel-internal.h \
call-event.c \
call-event-internal.h \
channel-internal.h \
@@ -77,23 +99,18 @@ libtelepathy_logger_la_SOURCES = \
log-store-factory-internal.h \
observer.c \
observer-internal.h \
- streamed-media-channel.c \
- streamed-media-channel-internal.h \
text-channel.c \
text-channel-internal.h \
text-event.c \
text-event-internal.h \
util-internal.h \
util.c \
+ $(call_sources) \
$(NULL)
nodist_libtelepathy_logger_la_SOURCES = \
$(BUILT_SOURCES)
-EXTRA_DIST = \
- tpl-marshal.list \
- $(NULL)
-
libtelepathy_logger_la_LIBADD = \
$(top_builddir)/extensions/libtpl-extensions-convenience.la
diff --git a/telepathy-logger/observer.c b/telepathy-logger/observer.c
index 5c676ca..d728fbc 100644
--- a/telepathy-logger/observer.c
+++ b/telepathy-logger/observer.c
@@ -380,6 +380,7 @@ _tpl_observer_init (TplObserver *self)
TP_HANDLE_TYPE_ROOM,
NULL));
+#ifdef ENABLE_CALL
/* Observe contact stream media channels */
tp_base_client_take_observer_filter (TP_BASE_CLIENT (self),
tp_asv_new (
@@ -406,6 +407,7 @@ _tpl_observer_init (TplObserver *self)
TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
TP_HANDLE_TYPE_ROOM,
NULL));
+#endif /* ENABLE_CALL */
tp_base_client_set_observer_recover (TP_BASE_CLIENT (self), TRUE);
}