Commits

Christian Kaula committed 7fc1b57

some code improvements

Comments (0)

Files changed (1)

 	}
 
 	protected function XMPPNotify($message) {
+		$host = C('Plugins.GlobalNotify.XMPP.Host');
+		$port = C('Plugins.GlobalNotify.XMPP.Port', 5222);
+		$user = C('Plugins.GlobalNotify.XMPP.User');
+		$pass = C('Plugins.GlobalNotify.XMPP.Pass');
+		$resource = C('Plugins.GlobalNotify.XMPP.Resource', 'xmppphp');
 		// make sure we got all needed options
-		if (
-			!C('Plugins.GlobalNotify.XMPP.Host')
-			|| !C('Plugins.GlobalNotify.XMPP.Port', 5222)
-			|| !C('Plugins.GlobalNotify.XMPP.User')
-			|| !C('Plugins.GlobalNotify.XMPP.Pass')
-			|| !C('Plugins.GlobalNotify.XMPP.Resource', 'xmppphp')
-		) {
+		if (!$host || !$port || !$user || !$pass || !$resource) {
 			return;
 		}
 		$jids = $this->GetJIDs();
 		
-		$conn = new XMPPHP_XMPP(
-			C('Plugins.GlobalNotify.XMPP.Host'),
-			C('Plugins.GlobalNotify.XMPP.Port', 5222),
-			C('Plugins.GlobalNotify.XMPP.User'),
-			C('Plugins.GlobalNotify.XMPP.Pass'),
-			C('Plugins.GlobalNotify.XMPP.Resource', 'xmppphp')
-		);
+		$conn = new XMPPHP_XMPP($host, $port, $user, $pass, $resource);
 		try {
 			$conn->connect();
 			$conn->processUntil('session_start');