Switched from update_id to message_id.

This commit is contained in:
Stefan Härter 2023-07-07 19:12:57 +02:00
parent ed510c0635
commit a6816bd213

View File

@ -38,7 +38,7 @@ sub new {
};
# load remembered update ids
$Self->{UpdateIDs} = YAML::LoadFile('update_ids.yml');
$Self->{MessageIDs} = YAML::LoadFile('message_ids.yml');
return $Self;
}
@ -393,17 +393,17 @@ sub fetchMessages {
MESSAGE:
for my $Message (@Messages) {
$Self->{LogObject}->info('fetchMessages: Calling processMessage');
if ($Self->{UpdateIDs}{$Message->{update_id}}) {
$Self->{LogObject}->info('fetchMessages: Skipping known update_id');
if ($Self->{MessageIDs}{$Message->{message}{message_id}}) {
$Self->{LogObject}->info('fetchMessages: Skipping known message_id');
next MESSAGE;
}
else {
$Self->{UpdateIDs}{$Message->{update_id}} = 1;
$Self->{LogObject}->info('fetchMessages: Calling processMessage');
$Self->{MessageIDs}{$Message->{message}{message_id}} = 1;
$Self->processMessage( Message => $Message, );
}
}
YAML::DumpFile('update_ids.yml', $Self->{UpdateIDs});
YAML::DumpFile('message_ids.yml', $Self->{MessageIDs});
}
1;