remove prefix matching for ids and authors filter fields

- this also fixes https://github.com/hoytech/strfry/issues/109
This commit is contained in:
Doug Hoyte
2024-08-30 15:56:41 -04:00
parent 80249f2078
commit 21d4e07b87
9 changed files with 42 additions and 70 deletions

View File

@ -46,7 +46,7 @@ sub doesMatchSingle {
if ($filter->{ids}) {
my $found;
foreach my $id (@{ $filter->{ids} }) {
if (startsWith($ev->{id}, $id)) {
if ($ev->{id} eq $id) {
$found = 1;
last;
}
@ -57,7 +57,7 @@ sub doesMatchSingle {
if ($filter->{authors}) {
my $found;
foreach my $author (@{ $filter->{authors} }) {
if (startsWith($ev->{pubkey}, $author)) {
if ($ev->{pubkey} eq $author) {
$found = 1;
last;
}
@ -117,7 +117,3 @@ sub doesMatchSingle {
return 1;
}
sub startsWith {
return rindex($_[0], $_[1], 0) == 0;
}