Permalink
Browse files

Let disconnect shutdown xmpp connection immediately

Clean pubsub nodes can be optional, we want to make sure that INT signal
will shutdown EM loop.
  • Loading branch information...
1 parent 2d3391e commit c3a5fcc207cb9ce0a12b691e1e4304a733d1311e Jack C Hong committed May 17, 2012
Showing with 2 additions and 14 deletions.
  1. +2 −14 omf_common/lib/omf_common/dsl/xmpp_blather.rb
@@ -26,23 +26,11 @@ def connect(username, password, server)
client.run
end
- # Shut down XMPP connection, clean up pubsub nodes if necessary
+ # Shut down XMPP connection
#
# @param [String] host Host represents the pubsub address, e.g. pubsub.norbit.npc.nicta.com.au
def disconnect(host)
- pubsub.affiliations(host) do |affs|
- # We don't care if server has user tune support
- affs[:owner].delete_if { |item| item == "http://jabber.org/protocol/tune" } if affs[:owner]
- shutdown if affs[:owner].nil? || affs[:owner].empty?
- affs[:owner] && affs[:owner].each do |item|
- delete_node(item, host) do |m|
- pubsub.affiliations(host) do |affs|
- affs[:owner].delete_if { |item| item == "http://jabber.org/protocol/tune" } if affs[:owner]
- shutdown if affs[:owner].nil? || affs[:owner].empty?
- end
- end
- end
- end
+ shutdown
end
# Create a new pubsub node with additional configuration

0 comments on commit c3a5fcc

Please sign in to comment.