Skip to content

Commit

Permalink
don't remove quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
syobocat committed Aug 8, 2024
1 parent 0e1067a commit 8f4ff90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ pub fn filter(message: &Status, tl: &Timeline) -> Result<(), String> {
let timelines = &CONFIG.timelines;
let filter = &CONFIG.filter;

// Remove Repeats (a.k.a. Boosts)
if message.reblog.is_some() {
// Remove Repeats (a.k.a. Boosts), but pass Quotes
if message.reblog.is_some() && !message.quote {
return Err("The message is the repeat".to_owned());
}

Expand Down
4 changes: 2 additions & 2 deletions src/streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use crate::config::CONFIG;
use crate::filter;
use crate::logger;
use crate::utils::{die, die_with_error, success};
use log::error;
use log::info;
use log::{debug, error, info};
use megalodon::{default::NO_REDIRECT, generator, megalodon::AppInputOptions, streaming::Message};
use std::io;

Expand Down Expand Up @@ -44,6 +43,7 @@ pub async fn streaming(tl: Timeline) {
.listen(Box::new(move |message| {
if let Message::Update(mes) = message {
info!("Message received.");
debug!("{mes:?}");
let result = filter::filter(&mes, &tl);
if let Err(reason) = result {
info!("Message did not pass the filter. Reason: {reason}");
Expand Down

0 comments on commit 8f4ff90

Please sign in to comment.