aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/notifier.rb
diff options
context:
space:
mode:
authorJames Carter <james.carter@bytemark.co.uk>2017-08-01 15:56:35 +0100
committerJames Carter <james.carter@bytemark.co.uk>2017-08-01 15:56:35 +0100
commit4eff930c3f01414bb454d7bcb5501827cb60289b (patch)
treea398edd68c7fd30cf3987538e41e9b4df9f561b8 /lib/mauve/notifier.rb
parent0be1fa0ebadf9435a760582d17f47ff96dc0851c (diff)
parent814ed65fd415cc62b2f6f661a7f6d1629562544b (diff)
Merge branch '27-package-and-publish-in-gitlab-ci-retire-maker2-job' into 'develop'
Added CI Closes #27 See merge request !2
Diffstat (limited to 'lib/mauve/notifier.rb')
-rw-r--r--lib/mauve/notifier.rb46
1 files changed, 1 insertions, 45 deletions
diff --git a/lib/mauve/notifier.rb b/lib/mauve/notifier.rb
index 35ac019..4939b03 100644
--- a/lib/mauve/notifier.rb
+++ b/lib/mauve/notifier.rb
@@ -1,6 +1,5 @@
require 'mauve/mauve_thread'
require 'mauve/notifiers'
-require 'mauve/notifiers/xmpp'
module Mauve
@@ -15,8 +14,7 @@ module Mauve
include Singleton
# Stop the notifier thread. This just makes sure that all the
- # notifications in the buffer have been sent before closing the XMPP
- # connection.
+ # notifications in the buffer have been sent.
#
def stop
super
@@ -25,11 +23,6 @@ module Mauve
# Flush the queue.
#
main_loop
-
- if Configuration.current.notification_methods['xmpp']
- Configuration.current.notification_methods['xmpp'].close
- end
-
end
#
@@ -69,43 +62,6 @@ module Mauve
#
#
def main_loop
-
- #
- # Make sure we're connected to the XMPP server if needed on every iteration.
- #
- xmpp = Configuration.current.notification_methods['xmpp']
-
- if xmpp and !xmpp.ready?
- #
- # Connect to XMPP server
- #
- xmpp.connect
-
- #
- # Join all chats and shit. Unless the connection failed.
- #
- Configuration.current.people.each do |username, person|
- #
- # Ignore people without XMPP stanzas.
- #
- next unless person.respond_to?(:xmpp) and person.xmpp
-
- #
- # For each JID, either ensure they're on our roster, or that we're in
- # that chat room.
- #
- jid = if xmpp.is_muc?(person.xmpp)
- xmpp.join_muc(person.xmpp)
- else
- xmpp.ensure_roster_and_subscription!(person.xmpp)
- end
-
- Configuration.current.people[username].xmpp = jid unless jid.nil?
-
- end if xmpp.ready?
-
- end
-
#
# Cycle through the buffer.
#