From a4d23bc445e5220c043814b70ac33a90f9894e6a Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 1 Dec 2016 05:05:07 -0800 Subject: [PATCH] Er, use OR instead of AND... --- PBot/MessageHistory_SQLite.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PBot/MessageHistory_SQLite.pm b/PBot/MessageHistory_SQLite.pm index 630d5cbd..c7a316d2 100644 --- a/PBot/MessageHistory_SQLite.pm +++ b/PBot/MessageHistory_SQLite.pm @@ -801,15 +801,15 @@ sub get_recent_messages { my $ids; my %seen_id; - my $and = ''; + my $or = ''; foreach my $aka (keys %akas) { next if $akas{$aka}->{type} == $self->{alias_type}->{WEAK}; next if $akas{$aka}->{nickchange} == 1; next if exists $seen_id{$akas{$aka}->{id}}; $seen_id{$akas{$aka}->{id}} = 1; - $ids .= "${and}id = ?"; - $and = ' AND '; + $ids .= "${or}id = ?"; + $or = ' OR '; } $sql .= "$ids AND channel = ? $mode_query ORDER BY timestamp ASC LIMIT ? OFFSET (SELECT COUNT(*) FROM Messages WHERE $ids AND channel = ? $mode_query) - ?"; @@ -1040,15 +1040,15 @@ sub get_max_messages { my $ids; my %seen_id; - my $and = ''; + my $or = ''; foreach my $aka (keys %akas) { next if $akas{$aka}->{type} == $self->{alias_type}->{WEAK}; next if $akas{$aka}->{nickchange} == 1; next if exists $seen_id{$akas{$aka}->{id}}; $seen_id{$akas{$aka}->{id}} = 1; - $ids .= "${and}id = ?"; - $and = ' AND '; + $ids .= "${or}id = ?"; + $or = ' OR '; } $sql .= $ids;