Commits

David Lazar committed 8798fac Merge

Merged in awhetter/reminderbot/PMs (pull request #2)

Added support for PMs

Comments (0)

Files changed (1)

src/org/jibble/reminderbot/ReminderBot.java

     }
 
     public synchronized void onMessage(String channel, String sender, String login, String hostname, String message) {
+        processMessage(channel, sender, login, hostname, message);
+    }
+
+    public synchronized void onPrivateMessage(String sender, String login, String hostname, String message) {
+        processMessage(sender, sender, login, hostname, message);
+    }
+
+    public synchronized void processMessage(String channel, String sender, String login, String hostname, String message) {
 
         Pattern messagePattern = Pattern.compile("^\\s*(?i:(" + getNick() + ")?\\s*[\\:,]?\\s*remind\\s+me\\s+in\\s+(((\\d+\\.?\\d*|\\.\\d+)\\s*(years?|y|weeks?|w|days?|d|hours?|hrs?|h|minutes?|mins?|m|seconds?|secs?|s)[\\s,]*(and)?\\s+)+)(.*)\\s*)$");
         Matcher m = messagePattern.matcher(message);