From 14fb45c2d47095381da6df8d5b5e151319d404ef Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 19 Aug 2012 12:15:00 +0200 Subject: Support disabling XMPP support. --- resources/config.sexp.sample | 3 ++- src/mulk/benki/xmpp.clj | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/resources/config.sexp.sample b/resources/config.sexp.sample index 0e0d98a..5f3f696 100644 --- a/resources/config.sexp.sample +++ b/resources/config.sexp.sample @@ -11,7 +11,8 @@ :tag-base "example.com" :web-port 3001 :mode :production ;or :dev - :xmpp {:user "benki" + :xmpp {:enabled true ;will be assumed true if absent + :user "benki" :service-name "example.com" :server "jabber.example.com" :port 5222 diff --git a/src/mulk/benki/xmpp.clj b/src/mulk/benki/xmpp.clj index c23f613..77a37e4 100644 --- a/src/mulk/benki/xmpp.clj +++ b/src/mulk/benki/xmpp.clj @@ -90,7 +90,9 @@ (enqueue messages-in {:sender (.getParticipant chat) :body body})))))))))))) (defn init-xmpp! [] - (future - (reconnect!) - (handle-incoming-chats) - (startup-client))) + (when-let [xmpp-config (get @benki-config :xmpp)] + (when (get xmpp-config :enabled true) + (future + (reconnect!) + (handle-incoming-chats) + (startup-client))))) -- cgit v1.2.3