aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mauve/notifier.rb18
-rw-r--r--lib/mauve/notifiers/xmpp.rb11
-rw-r--r--lib/mauve/pop3_server.rb2
-rw-r--r--lib/mauve/version.rb2
4 files changed, 15 insertions, 18 deletions
diff --git a/lib/mauve/notifier.rb b/lib/mauve/notifier.rb
index 14e188c..bf36162 100644
--- a/lib/mauve/notifier.rb
+++ b/lib/mauve/notifier.rb
@@ -42,13 +42,17 @@ module Mauve
#
# Make sure we're connected to the XMPP server if needed on every iteration.
#
- if Configuration.current.notification_methods['xmpp'] and !Configuration.current.notification_methods['xmpp'].ready?
+ xmpp = Configuration.current.notification_methods['xmpp']
+
+ if xmpp and !xmpp.ready?
#
# Connect to XMPP server
#
- xmpp = Configuration.current.notification_methods['xmpp']
- xmpp.connect
+ xmpp.connect
+ #
+ # Join all chats and shit. Unless the connection failed.
+ #
Configuration.current.people.each do |username, person|
#
# Ignore people without XMPP stanzas.
@@ -56,11 +60,6 @@ module Mauve
next unless person.xmpp
#
- # Can't do this unless we're ready.
- #
- next unless xmpp.ready?
-
- #
# For each JID, either ensure they're on our roster, or that we're in
# that chat room.
#
@@ -71,7 +70,8 @@ module Mauve
end
Configuration.current.people[username].xmpp = jid unless jid.nil?
- end
+
+ end if xmpp.ready?
end
diff --git a/lib/mauve/notifiers/xmpp.rb b/lib/mauve/notifiers/xmpp.rb
index fa1751c..8254494 100644
--- a/lib/mauve/notifiers/xmpp.rb
+++ b/lib/mauve/notifiers/xmpp.rb
@@ -150,12 +150,7 @@ module Mauve
unless ex.nil? or @closing
logger.warn(["Caught",ex.class,ex.to_s,"during XMPP",where].join(" "))
logger.debug ex.backtrace.join("\n")
- @closing = true
- connect
- @mucs.each do |jid, muc|
- @mucs.delete(jid)
- join_muc(muc[:jid], muc[:password])
- end
+ self.close
end
end
rescue StandardError => ex
@@ -566,11 +561,11 @@ EOF
def do_parse_ack(msg)
return "Sorry -- I don't understand your acknowledge command." unless
- msg.body =~ /ack(?:nowledge)?\s+([\d,]+)\s+for\s+(\d+(?:\.\d+)?)\s+(work(?:ing)?|day(?:time)?|wall(?:-?clock)?)?\s*(day|hour|min(?:ute)?|sec(?:ond))s?(?:\s+because\s+(.*))?/i
+ msg.body =~ /ack(?:nowledge)?\s+([\d\D]+)\s+for\s+(\d+(?:\.\d+)?)\s+(work(?:ing)?|day(?:time)?|wall(?:-?clock)?)?\s*(day|hour|min(?:ute)?|sec(?:ond))s?(?:\s+because\s+(.*))?/i
alerts, n_hours, type_hours, dhms, note = [$1,$2, $3, $4, $5]
- alerts = alerts.split(",")
+ alerts = alerts.split(/\D/)
n_hours = case dhms
when /^day/
diff --git a/lib/mauve/pop3_server.rb b/lib/mauve/pop3_server.rb
index 52f31d0..e7132f4 100644
--- a/lib/mauve/pop3_server.rb
+++ b/lib/mauve/pop3_server.rb
@@ -410,6 +410,8 @@ module Mauve
end
+ protected
+
#
# These are the messages in the mailbox. It looks for the first 100 alert_changed, and formats them into emails, and returns an array of
#
diff --git a/lib/mauve/version.rb b/lib/mauve/version.rb
index 9a9355e..926d01f 100644
--- a/lib/mauve/version.rb
+++ b/lib/mauve/version.rb
@@ -5,6 +5,6 @@ module Mauve
#
# Current version
- VERSION="3.5.9"
+ VERSION="3.5.10"
end