summaryrefslogtreecommitdiffstats
path: root/network/sendxmpp/patches/03.patch
blob: aefabbf41db5b8de3dcf6151bbca3e90d7368b1f (plain)
From 92af6b9bf4a583f6cec00a38d2fd3948654a64bc Mon Sep 17 00:00:00 2001
From: Lubomir Host <lubomir.host@gmail.com>
Date: Fri, 23 Jan 2015 00:22:02 +0100
Subject: [PATCH] Enable SRV record lookup by default

---
 sendxmpp | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/sendxmpp b/sendxmpp
index 74d95c0..0d7c4ff 100755
--- a/sendxmpp
+++ b/sendxmpp
@@ -344,26 +344,27 @@ sub xmpp_login ($$$$$$$$$$$$) { # {{{
 		ssl_ca_path		=> $tls_ca_path,
 		ssl             => $ssl,
 		connectiontype	=> 'tcpip',
-		componentname	=> $comp
+		componentname	=> $comp,
+		srv				=> 1, # enable SRV lookups
 	};
 
     if ($sso) {
-	$user = join('@', scalar getpwuid($<), Net::Domain::hostdomain());
-	debug_print "using SSO user $user";
+		$user = join('@', scalar getpwuid($<), Net::Domain::hostdomain());
+		debug_print "using SSO user $user";
     }
 
     # use the xmpp domain as the host and enable SRV lookups
-    if (!$host) {
-	if ($user =~ /@(.*)/) {
-	    $arghash->{hostname} = $host = $1;
-	    $arghash->{srv} = 1;
-	    debug_print "enabling SRV lookups";
-	    
-	} else {
-	    error_exit "unable to determine a host to connect to (no cmdline, no config, no SRV possible)";
-	}	    
+	if (!$host) {
+		if ($user =~ /@(.*)/) {
+			$arghash->{hostname} = $host = $1;
+			$arghash->{srv} = 1;
+			debug_print "enabling SRV lookups";
 
-    }
+		} else {
+			error_exit "unable to determine a host to connect to (no cmdline, no config, no SRV possible)";
+		}	    
+
+	}
 
 	delete $arghash->{port} unless $port; 
 	if ($arghash->{port}) {