Fixes for snikket domaininfo

Stephen Paul Weber created

Change summary

lib/snikket.rb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Detailed changes

lib/snikket.rb 🔗

@@ -202,7 +202,7 @@ module Snikket
 		register nil, "domain-info", "xmpp:snikket.org/hosting/v1"
 
 		def self.new(type=nil, to=nil, id=nil, domain: nil)
-			stanza = super(type || :set, to, id)
+			stanza = super(type || :get, to, id)
 			node = Nokogiri::XML::Node.new("domain-info", stanza.document)
 			node.default_namespace = registered_ns
 			stanza << node
@@ -224,6 +224,10 @@ module Snikket
 				&.content
 		end
 
+		def available?
+			!!query.at_xpath("./ns:available", ns: self.class.registered_ns)
+		end
+
 		def custom?
 			!!query.at_xpath("./ns:custom", ns: self.class.registered_ns)
 		end