aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-09 23:50:34 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-10 16:30:05 +0800
commitd49a19564bc1404c8536da85f97e22ae80e614e7 (patch)
tree8ded92bf205bb089bffd120d8832185ccd6aa875
parentc5353cf8c819b549de202faa3326406f3638a899 (diff)
downloadgsoc2013-empathy-d49a19564bc1404c8536da85f97e22ae80e614e7.tar
gsoc2013-empathy-d49a19564bc1404c8536da85f97e22ae80e614e7.tar.gz
gsoc2013-empathy-d49a19564bc1404c8536da85f97e22ae80e614e7.tar.bz2
gsoc2013-empathy-d49a19564bc1404c8536da85f97e22ae80e614e7.tar.lz
gsoc2013-empathy-d49a19564bc1404c8536da85f97e22ae80e614e7.tar.xz
gsoc2013-empathy-d49a19564bc1404c8536da85f97e22ae80e614e7.tar.zst
gsoc2013-empathy-d49a19564bc1404c8536da85f97e22ae80e614e7.zip
Don't require telepathy-logger with --enable-call
Having it is required for displaying call events in the history window though.
-rw-r--r--configure.ac38
-rw-r--r--libempathy-gtk/empathy-log-window.c23
-rw-r--r--libempathy/empathy-message.c12
3 files changed, 57 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 434cadb7e..b192e5f6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -214,16 +214,33 @@ AM_CONDITIONAL(HAVE_CALL, test "x$have_farstream" = "xyes")
# -----------------------------------------------------------
# Call support in tp-logger
# -----------------------------------------------------------
-SAVE_CFLAGS=$CFLAGS
-SAVE_CPPFLAGS=$CPPFLAGS
-CFLAGS="$CFLAGS $EMPATHY_CFLAGS"
-CPPFLAGS="$CPPFLAGS $EMPATHY_CFLAGS"
-
-AC_CHECK_HEADER(telepathy-logger/call-event.h,,
- AC_MSG_ERROR([tp-logger must be compiled with --enable-call]))
+AC_ARG_WITH(call-logs,
+ AC_HELP_STRING([--enable-call-logs=@<:@no/yes/auto@:>@],
+ [build with call logs support]),,
+ [with_call_logs=auto])
+if test "x$with_call_logs" != "xno" ; then
+ SAVE_CFLAGS=$CFLAGS
+ SAVE_CPPFLAGS=$CPPFLAGS
+ CFLAGS="$CFLAGS $EMPATHY_CFLAGS"
+ CPPFLAGS="$CPPFLAGS $EMPATHY_CFLAGS"
+
+ AC_CHECK_HEADER(telepathy-logger/call-event.h,
+ have_call_logs="yes", have_call_logs="no")
+
+ CFLAGS=$SAVE_CFLAGS
+ CPPFLAGS=$SAVE_CPPFLAGS
+
+ if test "x$have_call_logs" = "xyes"; then
+ AC_DEFINE(HAVE_CALL_LOGS, 1, [Define if you have call log support])
+ fi
+else
+ have_call_logs=no
+fi
-CFLAGS=$SAVE_CFLAGS
-CPPFLAGS=$SAVE_CPPFLAGS
+if test "x$with_call_logs" = "xyes" -a "x$have_call_logs" != "xyes"; then
+ AC_MSG_ERROR([Call logs support requested but telepathy-logger wasn't
+ built with --enable-call])
+fi
# -----------------------------------------------------------
# evolution-data-server (about-me)
@@ -607,7 +624,7 @@ Configure summary:
Spell checking (enchant)....: ${have_enchant}
Display maps (libchamplain).: ${have_libchamplain}
Location awareness (Geoclue): ${have_geoclue}
- Geocode support (Geoclue): ${have_geocode}
+ Geocode support (Geoclue)...: ${have_geocode}
Adium themes (Webkit).......: ${have_webkit}
Meego widgets...............: ${have_meego}
Control center embedding....: ${have_control_center_embedding}
@@ -621,4 +638,5 @@ Configure summary:
Nautilus-sendto plugin......: ${have_nst}
Salut E-D-S support.........: ${with_eds}
Exp. Call channel handler...: ${have_farstream}
+ Exp. Call log support.......: ${have_call_logs}
"
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 11cb4ab97..435c99760 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -34,7 +34,9 @@
#include <telepathy-glib/proxy-subclass.h>
#include <telepathy-logger/telepathy-logger.h>
-#include <telepathy-logger/call-event.h>
+#ifdef HAVE_CALL_LOGS
+# include <telepathy-logger/call-event.h>
+#endif
#include <extensions/extensions.h>
@@ -766,6 +768,7 @@ get_icon_for_event (TplEvent *event)
{
const gchar *icon = NULL;
+#ifdef HAVE_CALL_LOGS
if (TPL_IS_CALL_EVENT (event))
{
TplCallEvent *call = TPL_CALL_EVENT (event);
@@ -780,6 +783,7 @@ get_icon_for_event (TplEvent *event)
else if (tpl_entity_get_entity_type (receiver) == TPL_ENTITY_SELF)
icon = EMPATHY_IMAGE_CALL_INCOMING;
}
+#endif
return icon;
}
@@ -833,6 +837,7 @@ log_window_append_chat_message (TplEvent *event,
g_date_time_unref (date);
}
+#ifdef HAVE_CALL_LOGS
static void
log_window_append_call (TplEvent *event,
EmpathyMessage *message)
@@ -897,6 +902,7 @@ log_window_append_call (TplEvent *event,
g_free (pretty_date);
g_date_time_unref (started_date);
}
+#endif
static void
log_window_append_message (TplEvent *event,
@@ -904,8 +910,10 @@ log_window_append_message (TplEvent *event,
{
if (TPL_IS_TEXT_EVENT (event))
log_window_append_chat_message (event, message);
+#ifdef HAVE_CALL_LOGS
else if (TPL_IS_CALL_EVENT (event))
log_window_append_call (event, message);
+#endif
else
DEBUG ("Message type not handled");
}
@@ -2253,7 +2261,7 @@ log_window_what_setup (EmpathyLogWindow *window)
GtkTreeModel *model;
GtkTreeSelection *selection;
GtkTreeViewColumn *column;
- GtkTreeIter iter, parent;
+ GtkTreeIter iter;
GtkTreeStore *store;
GtkCellRenderer *cell;
guint i;
@@ -2261,13 +2269,18 @@ log_window_what_setup (EmpathyLogWindow *window)
{ TPL_EVENT_MASK_ANY, 0, NULL, _("Anything") },
{ WHAT_TYPE_SEPARATOR, 0, NULL, "separator" },
{ TPL_EVENT_MASK_TEXT, 0, "stock_text_justify", _("Text chats") },
- { TPL_EVENT_MASK_CALL, EVENT_CALL_ALL, "call-start", _("Calls") }
+#ifdef HAVE_CALL_LOGS
+ { TPL_EVENT_MASK_CALL, EVENT_CALL_ALL, "call-start", _("Calls") },
+#endif
};
+#ifdef HAVE_CALL_LOGS
struct event call_events [] = {
{ TPL_EVENT_MASK_CALL, EVENT_CALL_INCOMING, "call-start", _("Incoming calls") },
{ TPL_EVENT_MASK_CALL, EVENT_CALL_OUTGOING, "call-start", _("Outgoing calls") },
{ TPL_EVENT_MASK_CALL, EVENT_CALL_MISSED, "call-stop", _("Missed calls") }
};
+ GtkTreeIter parent;
+#endif
view = GTK_TREE_VIEW (window->treeview_what);
selection = gtk_tree_view_get_selection (view);
@@ -2321,6 +2334,7 @@ log_window_what_setup (EmpathyLogWindow *window)
-1);
}
+#ifdef HAVE_CALL_LOGS
gtk_tree_model_iter_nth_child (model, &parent, NULL, 3);
for (i = 0; i < G_N_ELEMENTS (call_events); i++)
{
@@ -2332,6 +2346,7 @@ log_window_what_setup (EmpathyLogWindow *window)
COL_WHAT_ICON, call_events[i].icon,
-1);
}
+#endif
gtk_tree_view_expand_all (view);
@@ -2423,6 +2438,7 @@ log_window_got_messages_for_date_cb (GObject *manager,
TplEvent *event = l->data;
gboolean append = TRUE;
+#ifdef HAVE_CALL_LOGS
if (TPL_IS_CALL_EVENT (l->data)
&& ctx->event_mask & TPL_EVENT_MASK_CALL
&& ctx->event_mask != TPL_EVENT_MASK_ANY)
@@ -2458,6 +2474,7 @@ log_window_got_messages_for_date_cb (GObject *manager,
}
}
}
+#endif
if (append)
{
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index d97539ffd..d30ce3645 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -35,7 +35,9 @@
#include <telepathy-logger/entity.h>
#include <telepathy-logger/event.h>
#include <telepathy-logger/text-event.h>
-#include <telepathy-logger/call-event.h>
+#ifdef HAVE_CALL_LOGS
+# include <telepathy-logger/call-event.h>
+#endif
#include "empathy-message.h"
#include "empathy-utils.h"
@@ -332,7 +334,9 @@ empathy_message_from_tpl_log_event (TplEvent *logevent)
TPL_TEXT_EVENT (logevent)));
type = tpl_text_event_get_message_type (TPL_TEXT_EVENT (logevent));
- } else if (TPL_IS_CALL_EVENT (logevent)) {
+ }
+#ifdef HAVE_CALL_LOGS
+ else if (TPL_IS_CALL_EVENT (logevent)) {
TplCallEvent *call = TPL_CALL_EVENT (logevent);
if (tpl_call_event_get_end_reason (call) == TPL_CALL_END_REASON_NO_ANSWER)
body = g_strdup_printf (_("Missed call from %s"),
@@ -343,7 +347,9 @@ empathy_message_from_tpl_log_event (TplEvent *logevent)
else
body = g_strdup_printf (_("Call from %s"),
tpl_entity_get_alias (tpl_event_get_sender (logevent)));
- } else {
+ }
+#endif
+ else {
/* Unknown event type */
return NULL;
}