Skip to content
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

fix: skip galileo messages in history #58

Merged
merged 1 commit into from
Aug 3, 2023
Merged
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
18 changes: 12 additions & 6 deletions src/opt/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,19 @@ pub fn gather(

for message in messages {
if let Some((response, request)) = Request::try_new(&message) {
yield Ok((message.timestamp, message.author, message.id, response, request));
// Skip self: since galileo posts replies containing addresses, its own messages
// will found in the history scan. Technically we should check the userid,
// as that's not spoofable, but we still want to ignore messages from spoofed
// accounts too.
if message.author.name != "galileo [penumbra]" {
yield Ok((message.timestamp, message.author, message.id, response, request));
}

// Terminate after we see the after-message
if let Some(ref after_message) = after_message {
if message.id == after_message.id {
return;
}
}
// Terminate after we see the after-message
if let Some(ref after_message) = after_message {
if message.id == after_message.id {
return;
}
}
before = Some(message.id);
Expand Down