Skip to content

Commit

Permalink
Fix conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
dcadenas committed Sep 27, 2024
1 parent 264de68 commit 87d05f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/domain/followee_notification_factory.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::{FollowChange, NotificationMessage, MAX_FOLLOWERS_PER_BATCH};
use crate::rate_limiter::RateLimiter;
use nostr_sdk::PublicKey;
use nostr_sdk::prelude::*;
use ordermap::OrderMap;
use std::fmt::Debug;
use std::num::NonZeroUsize;
Expand Down Expand Up @@ -131,8 +131,12 @@ impl FolloweeNotificationFactory {

if let Some(follow_change) = followers.first() {
info!(
"Followee {}. {}",
"Followee {}({}). {}",
follow_change.friendly_followee(),
follow_change
.followee()
.to_bech32()
.expect("Followee to_bech32"),
self.rate_limiter
);
}
Expand Down
3 changes: 1 addition & 2 deletions src/domain/follows_differ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ async fn should_send_notifications(
/// notifications in that case, but we still want to process the contact list.
fn probably_inactive_or_spam(event: &Event, account_info: &AccountInfo) -> bool {
let too_new =
!older_than_five_minutes(account_info.created_at.unwrap_or_default().timestamp() as u64)
&& older_than_five_minutes(event.created_at.as_u64());
!older_than_five_minutes(account_info.created_at.unwrap_or(Utc::now()).timestamp() as u64);

if too_new
&& event.public_keys().any(|pk| {
Expand Down

0 comments on commit 87d05f1

Please sign in to comment.