Skip to content

Be case-sensitive about responding to “RFC” #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/Synergy/Reactor/RFC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sub listener_specs {
name => 'rfc-mention',
method => 'handle_rfc',
predicate => sub ($self, $e) {
return unless $e->text =~ /RFC\s*[0-9]+/i; },
return unless $e->text =~ /RFC\s*[0-9]+/; },
};
}

Expand Down Expand Up @@ -52,7 +52,7 @@ sub handle_rfc ($self, $event) {
my ($num, $link) = $self->extract_rfc($text);

unless (defined $num && defined $link) {
if ($event->was_targeted && $event->text =~ /\A\s* RFC \s* [0-9]+/ix) {
if ($event->was_targeted && $event->text =~ /\A\s* RFC \s* [0-9]+/x) {
$event->reply("Oddly, I could not figure out what RFC you meant");

$event->mark_handled;
Expand All @@ -62,7 +62,7 @@ sub handle_rfc ($self, $event) {
}

my $solo_cmd = $event->was_targeted
&& $event->text =~ /\A\s* RFC \s* [0-9]+ \s*/ix;
&& $event->text =~ /\A\s* RFC \s* [0-9]+ \s*/x;

$event->mark_handled if $solo_cmd;

Expand Down Expand Up @@ -118,7 +118,7 @@ sub handle_rfc ($self, $event) {
my $sec_dig = qr/[0-9]+(?:[.-])?(?:[0-9]+)?/;

sub extract_rfc ($self, $text) {
return unless $text =~ s/RFC\s*([0-9]+)//ig;
return unless $text =~ s/RFC\s*([0-9]+)//g;

my $num = $1;

Expand Down