Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
make regex check further down
Browse files Browse the repository at this point in the history
  • Loading branch information
charleseff committed Aug 24, 2013
1 parent 062d80d commit 96d3195
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/lita/handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ def build_response(message, route)

# Determines whether or not an incoming messages should trigger a route.
def route_applies?(route, message, robot)
# Message must match the pattern
return unless route.pattern === message.body

# Message must be a command if the route requires a command
return if route.command? && !message.command?

# Messages from self should be ignored to prevent infinite loops
return if message.user.name == robot.name

# Message must match the pattern
return unless route.pattern === message.body

# User must be in auth group if route is restricted
return unless authorized?(message.user, route.required_groups)

Expand Down

0 comments on commit 96d3195

Please sign in to comment.