From f161f8da8ed0a7fc364acd4bd6062d42e9d84bb3 Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Tue, 2 Sep 2014 22:52:47 -0400
Subject: [PATCH] configure: fix --without-instant_messaging

Refs #54375

Change-Id: Ic1fee5ba3f140f3ce1f8ece581a433963fc0747e
---
 daemon/configure.ac            | 1 -
 daemon/src/iax/iaxvoiplink.cpp | 2 ++
 daemon/src/iax/iaxvoiplink.h   | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/daemon/configure.ac b/daemon/configure.ac
index ffbd9a7a47..56746b3599 100644
--- a/daemon/configure.ac
+++ b/daemon/configure.ac
@@ -349,7 +349,6 @@ AC_ARG_WITH([instant_messaging],
            dnl Fallback to older version
            [with_instant_messaging=no])
     ]);
-AS_IF([test "$with_instant_messaging" != "yes"], [AC_MSG_ERROR([Missing libexpat development files])], [])
 
 AC_DEFINE_UNQUOTED([HAVE_INSTANT_MESSAGING], `if test "x$with_instant_messaging" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have instant messaging support])
 AM_CONDITIONAL(BUILD_INSTANT_MESSAGING, test "x$with_instant_messaging" = "xyes" )
diff --git a/daemon/src/iax/iaxvoiplink.cpp b/daemon/src/iax/iaxvoiplink.cpp
index ccd79ba8b1..1ca6d675dd 100644
--- a/daemon/src/iax/iaxvoiplink.cpp
+++ b/daemon/src/iax/iaxvoiplink.cpp
@@ -244,12 +244,14 @@ IAXVoIPLink::handleBusy(IAXCall& call)
     call.removeCall();
 }
 
+#if HAVE_INSTANT_MESSAGING
 void
 IAXVoIPLink::handleMessage(iax_event* event, IAXCall& call)
 {
     Manager::instance().incomingMessage(call.getCallId(), call.getPeerNumber(),
                                         std::string((const char*) event->data));
 }
+#endif
 
 void
 IAXVoIPLink::handleRinging(IAXCall& call)
diff --git a/daemon/src/iax/iaxvoiplink.h b/daemon/src/iax/iaxvoiplink.h
index 5f946ae2be..1e4a0aef16 100644
--- a/daemon/src/iax/iaxvoiplink.h
+++ b/daemon/src/iax/iaxvoiplink.h
@@ -94,7 +94,9 @@ class IAXVoIPLink {
         void handleRinging(IAXCall& call);
         void handleAnswerTransfer(iax_event* event, IAXCall& call);
         void handleBusy(IAXCall& call);
+#if HAVE_INSTANT_MESSAGING
         void handleMessage(iax_event* event, IAXCall& call);
+#endif
         void handleHangup(IAXCall& call);
 
         /*
-- 
GitLab