diff -X exclude -Naru jabberzilla2-0.4-r938-WINNT_x86-msvc/chrome/content/jabberzilla/jabber/dispatcher.js jabberzilla2-0.4-r938-WINNT_x86-msvc-jauto/chrome/content/jabberzilla/jabber/dispatcher.js
--- jabberzilla2-0.4-r938-WINNT_x86-msvc/chrome/content/jabberzilla/jabber/dispatcher.js	2006-08-03 07:10:12.000000000 +0200
+++ jabberzilla2-0.4-r938-WINNT_x86-msvc-jauto/chrome/content/jabberzilla/jabber/dispatcher.js	2006-08-21 15:50:38.000000000 +0200
@@ -57,6 +57,7 @@
 ML.importMod("jabber/services/filetransfer.js");
 ML.importMod("jabber/services/socks5.js");
 ML.importMod("jabber/services/autoaway.js");
+ML.importMod("jabber/services/httpauth.js");
 
 ML.exportSym("Dispatcher StanzaListener");
 
@@ -644,6 +645,8 @@
         new SIFileTransferService());
 Dispatcher.addInputHandler(new IQStanzaCondition(IQSocks5Stanza),
         new Socks5Service());
+Dispatcher.addInputHandler(new StanzaCondition(null, null),
+		new HttpAuthService(), null, -200);
 
 CapsRegistry._init(Dispatcher);
 UIUpdater._init(Dispatcher);
diff -X exclude -Naru jabberzilla2-0.4-r938-WINNT_x86-msvc/chrome/content/jabberzilla/jabber/services/httpauth.js jabberzilla2-0.4-r938-WINNT_x86-msvc-jauto/chrome/content/jabberzilla/jabber/services/httpauth.js
--- jabberzilla2-0.4-r938-WINNT_x86-msvc/chrome/content/jabberzilla/jabber/services/httpauth.js	1970-01-01 01:00:00.000000000 +0100
+++ jabberzilla2-0.4-r938-WINNT_x86-msvc-jauto/chrome/content/jabberzilla/jabber/services/httpauth.js	2006-08-21 16:45:20.750000000 +0200
@@ -0,0 +1,115 @@
+/*
+ * This file is part of jauto.
+ * Copyright (C) 2006  Maciej Niedzielski <machekku@uaznia.net>
+ * 
+ * jauto is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+*/
+
+ML.importMod("jabber/dispatcher.js");
+ML.importMod("jabber/xmlstream/extensions/httpauth.js");
+
+ML.exportSym("HttpAuthService");
+
+function HttpAuthService()
+{
+}
+
+HttpAuthService.prototype =
+{
+
+	confirm: function(stream, stanza, token) {
+
+		var mgr = Components.classes["@machekku.uaznia.net/http-xmpp-auth/manager;1"].getService(Components.interfaces.nsIHttpXmppAuthRequestManager);
+
+		var urlObject = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI(stanza.url, null, null)
+		var tidObject = {value: stanza.tid};
+
+		if (mgr.confirm(stanza.jid, tidObject, stanza.method, urlObject))
+			return tidObject;
+		else
+			return false;
+	},
+
+    onStanza: function(stream, stanza, token) {
+		if (stanza instanceof IQHttpAuthStanza && stanza.type == "get") {
+
+			var tidObject = this.confirm(stream, stanza, token);
+
+			if ( tidObject !== false ) {
+            	response = new IQHttpAuthStanza({
+                	id: stanza.id,
+	                to: stanza.from,
+    	            type: "result",
+        	        tid: tidObject.value,
+            	    method: stanza.method,
+                	url: stanza.url
+                });
+            }
+            else {
+	            response = new IQStanza({
+                	id: stanza.id,
+	                to: stanza.from,
+    	            type: "error",
+        	        errorType: "auth",
+            	    errorCode: "401",
+                	errorCondition: "not-authorized"
+                });
+            }
+
+            Dispatcher.send(response, null, null, stream);
+
+            return true;
+        }
+    },
+
+    onMessageStanza: function(stream, stanza, token) {
+		var ex = null;
+
+        if (stanza.type != "error" && (ex = stanza.locateExtension(HttpAuthExtension))) {
+
+			var tidObject = this.confirm(stream, ex, token);
+
+			if ( tidObject !== false ) {
+            	response = new MessageStanza({
+	                to: stanza.from,
+	                thread: stanza.thread,
+    	            type: stanza.type,
+                });
+
+   				response.addExtension(new HttpAuthExtension({
+        	        tid: tidObject.value,
+            	    method: ex.method,
+                	url: ex.url
+				}));
+            }
+            else {
+	            response = new MessageStanza({
+	                to: stanza.from,
+	                thread: stanza.thread,
+    	            type: "error",
+        	        errorType: "auth",
+            	    errorCode: "401",
+                	errorCondition: "not-authorized"
+                });
+            }
+
+            Dispatcher.send(response, null, null, stream);
+			return true;
+        }
+	}
+}
+
+DiscoServiceRegistry.registerFeature(null, "http://jabber.org/protocol/http-auth");
diff -X exclude -Naru jabberzilla2-0.4-r938-WINNT_x86-msvc/chrome/content/jabberzilla/jabber/xmlstream/extensions/httpauth.js jabberzilla2-0.4-r938-WINNT_x86-msvc-jauto/chrome/content/jabberzilla/jabber/xmlstream/extensions/httpauth.js
--- jabberzilla2-0.4-r938-WINNT_x86-msvc/chrome/content/jabberzilla/jabber/xmlstream/extensions/httpauth.js	1970-01-01 01:00:00.000000000 +0100
+++ jabberzilla2-0.4-r938-WINNT_x86-msvc-jauto/chrome/content/jabberzilla/jabber/xmlstream/extensions/httpauth.js	2006-08-21 15:50:38.000000000 +0200
@@ -0,0 +1,50 @@
+/*
+ * This file is part of jauto.
+ * Copyright (C) 2006  Maciej Niedzielski <machekku@uaznia.net>
+ * 
+ * jauto is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+*/
+
+ML.importMod("jabber/xmlstream/xmlstream.js");
+
+ML.exportSym("HttpAuthExtension");
+
+
+function HttpAuthExtension(node)
+{
+    TreeBasedExtension.call(this, this.__tree, node, null,
+            ['tid', 'method', 'url']);
+}
+
+HttpAuthExtension.prototype =
+{
+    __proto__: TreeBasedExtension.prototype,
+    tid: null,
+    method: null,
+    url: null,
+
+    __tree: {
+        NS:       "http://jabber.org/protocol/http-auth",
+        NODENAME: "confirm",
+        FLAGS:    ["generate-root-element"],
+        PROCESS:  "processAttributes",
+        ATTRS: {
+            "id":      "storeInObject['tid']",
+            "method":  "storeInObject['method']",
+            "url":     "storeInObject['url']",
+        },
+    }
+}
diff -X exclude -Naru jabberzilla2-0.4-r938-WINNT_x86-msvc/chrome/content/jabberzilla/jabber/xmlstream/iqstanzas/iqhttpauth.js jabberzilla2-0.4-r938-WINNT_x86-msvc-jauto/chrome/content/jabberzilla/jabber/xmlstream/iqstanzas/iqhttpauth.js
--- jabberzilla2-0.4-r938-WINNT_x86-msvc/chrome/content/jabberzilla/jabber/xmlstream/iqstanzas/iqhttpauth.js	1970-01-01 01:00:00.000000000 +0100
+++ jabberzilla2-0.4-r938-WINNT_x86-msvc-jauto/chrome/content/jabberzilla/jabber/xmlstream/iqstanzas/iqhttpauth.js	2006-08-21 15:50:38.000000000 +0200
@@ -0,0 +1,49 @@
+/*
+ * This file is part of jauto.
+ * Copyright (C) 2006  Maciej Niedzielski <machekku@uaznia.net>
+ * 
+ * jauto is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+*/
+
+ML.importMod("jabber/xmlstream/clientstanzas.js");
+
+ML.exportSym("IQHttpAuthStanza");
+
+function IQHttpAuthStanza(node)
+{
+    TreeBasedIQStanza.call(this, this.__tree, node, null,
+            ['tid', 'method', 'url']);
+}
+
+IQHttpAuthStanza.prototype =
+{
+    __proto__: TreeBasedIQStanza.prototype,
+    tid: null,
+    method: null,
+    url: null,
+
+    __tree: {
+        NS:       "http://jabber.org/protocol/http-auth",
+        NODENAME: "confirm",
+        FLAGS:    ["generate-root-element"],
+        PROCESS:  "processAttributes",
+        ATTRS: {
+            "id":          "storeInObject['tid']",
+            "method":   "storeInObject['method']",
+            "url":   "storeInObject['url']",
+        },
+    }
+}
diff -X exclude -Naru jabberzilla2-0.4-r938-WINNT_x86-msvc/chrome/content/jabberzilla/jabber/xmlstream/stanzaregistry.js jabberzilla2-0.4-r938-WINNT_x86-msvc-jauto/chrome/content/jabberzilla/jabber/xmlstream/stanzaregistry.js
--- jabberzilla2-0.4-r938-WINNT_x86-msvc/chrome/content/jabberzilla/jabber/xmlstream/stanzaregistry.js	2006-08-03 07:10:12.000000000 +0200
+++ jabberzilla2-0.4-r938-WINNT_x86-msvc-jauto/chrome/content/jabberzilla/jabber/xmlstream/stanzaregistry.js	2006-08-21 15:50:38.000000000 +0200
@@ -61,6 +61,7 @@
 ML.importMod('jabber/xmlstream/iqstanzas/iqoob.js');
 ML.importMod('jabber/xmlstream/iqstanzas/iqsi.js');
 ML.importMod('jabber/xmlstream/iqstanzas/iqsocks5.js');
+ML.importMod('jabber/xmlstream/iqstanzas/iqhttpauth.js');
 
 ML.importMod('jabber/xmlstream/extensions/xdata.js');
 ML.importMod('jabber/xmlstream/extensions/xevent.js');
@@ -73,6 +74,7 @@
 ML.importMod('jabber/xmlstream/extensions/vcard-update.js');
 ML.importMod('jabber/xmlstream/extensions/feature-neg.js');
 ML.importMod('jabber/xmlstream/extensions/chatstates.js');
+ML.importMod('jabber/xmlstream/extensions/httpauth.js');
 
 ML.exportSym('StanzaRegistry');
 
@@ -246,6 +248,9 @@
             SIFactory);
     store(['http://jabber.org/protocol/bytestreams', 'query'],
             new SF(IQSocks5Stanza));
+    store(['http://jabber.org/protocol/http-auth', 'confirm'],
+            new SF(IQHttpAuthStanza));
+           
 }
 
 with (StanzaRegistry.extensionRegistry) {
@@ -273,5 +278,7 @@
             new SF(FeatureNegExtension));
     store(['http://jabber.org/protocol/chatstates'],
             new SF(ChatStatesExtension));
+    store(['http://jabber.org/protocol/http-auth', 'confirm'],
+            new SF(HttpAuthExtension));
 }
 
