From 2f90eb7409df91a80c60b189242ac0c1de313910 Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Wed, 23 Nov 2016 18:28:01 +0100
Subject: Fix building with Avahi support on Linux

This was broken in commit 43479ef.

Test-Information:

Build with Avahi support on Ubuntu 16.04.1. Unit tests
passed.

Change-Id: If7ee5f740510956d89f6c406e68b92ddeb61cf85

diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp
index 6510275..08de722 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp
@@ -6,18 +6,20 @@
 
 #include <Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h>
 
-#include <iostream>
-
 #include <boost/bind.hpp>
 
+#include <netinet/in.h>
+
+#include <Swiften/Base/Log.h>
+
 namespace Swift {
 
 AvahiResolveHostnameQuery::AvahiResolveHostnameQuery(const std::string& hostname, int, std::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), hostname(hostname) {
-    std::cout << "Resolving hostname " << hostname << std::endl;
+    SWIFT_LOG(debug) << "Resolving hostname " << hostname << std::endl;
 }
 
 void AvahiResolveHostnameQuery::run() {
-        eventLoop->postEvent(boost::bind(boost::ref(onHostnameResolved), boost::optional<HostAddress>(HostAddress(hostname))), shared_from_this());
+        eventLoop->postEvent(boost::bind(boost::ref(onHostnameResolved), HostAddress::fromString(hostname)), shared_from_this());
 }
 
 }
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h
index 5498285..33c425f 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h
@@ -8,8 +8,6 @@
 
 #include <string>
 
-#include <netinet/in.h>
-
 #include <Swiften/EventLoop/EventLoop.h>
 #include <Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h>
 #include <Swiften/LinkLocal/DNSSD/DNSSDResolveHostnameQuery.h>
-- 
cgit v0.10.2-6-g49f6