Allow others to augment what we report support for

Stephen Paul Weber created

Also, remove advertisements of support for things we don't currently
support.

Change summary

sgx-catapult.rb | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)

Detailed changes

sgx-catapult.rb 🔗

@@ -67,6 +67,10 @@ module SGXcatapult
 	@jingle_fnames = {}
 	@partial_data = {}
 	@client = SGXClient.new
+	@gateway_features = [
+		"http://jabber.org/protocol/disco#info",
+		"jabber:iq:register"
+	]
 
 	def self.run
 		client.run
@@ -265,6 +269,11 @@ module SGXcatapult
 		]
 	end
 
+	def self.add_gateway_feature(feature)
+		@gateway_features << feature
+		@gateway_features.uniq!
+	end
+
 	presence :subscribe? do |p|
 		puts "PRESENCE1: #{p.inspect}"
 
@@ -500,10 +509,6 @@ module SGXcatapult
 		}
 	end
 
-	iq '/iq/ns:query', ns:	'http://jabber.org/protocol/disco#items' do |i|
-		write_to_stream i.reply
-	end
-
 	iq '/iq/ns:query', ns:	'http://jabber.org/protocol/disco#info' do |i|
 		# respond to capabilities request for an sgx-catapult number JID
 		if i.to.node
@@ -525,14 +530,7 @@ module SGXcatapult
 			name: 'Soprani.ca Gateway to XMPP - Catapult',
 			type: 'sms', category: 'gateway'
 		}]
-		msg.features = [
-			"jabber:iq:register",
-			"jabber:iq:gateway",
-			"jabber:iq:private",
-			"http://jabber.org/protocol/disco#info",
-			"http://jabber.org/protocol/commands",
-			"http://jabber.org/protocol/muc"
-		]
+		msg.features = @gateway_features
 		write_to_stream msg
 	end