@@ 244,27 244,17 @@ disco_items node: "http://jabber.org/protocol/commands" do |iq|
reply.items = [
# TODO: don't show this item if no braintree methods available
# TODO: don't show this item if no plan for this customer
+ { node: "buy-credit", name: "Buy account credit" },
+ { node: "jabber:iq:register", name: "Register" },
+ { node: "usage", name: "Show Monthly Usage" },
+ { node: "reset sip account", name: "Create or Reset SIP Account" }
+ ].map do |item|
Blather::Stanza::DiscoItems::Item.new(
iq.to,
- "buy-credit",
- "Buy account credit"
- ),
- Blather::Stanza::DiscoItems::Item.new(
- iq.to,
- "jabber:iq:register",
- "Register"
- ),
- Blather::Stanza::DiscoItems::Item.new(
- iq.to,
- "usage",
- "Show Monthly Usage"
- ),
- Blather::Stanza::DiscoItems::Item.new(
- iq.to,
- "reset sip account",
- "Create or Reset SIP Account"
+ item[:node],
+ item[:name]
)
- ]
+ end
self << reply
end