add: use RemoteAddr for ip blocks as well
This commit is contained in:
parent
14936b8b90
commit
f5faed7762
12 changed files with 127 additions and 28 deletions
|
@ -1,6 +1,7 @@
|
|||
use std::collections::HashMap;
|
||||
use oiseau::cache::Cache;
|
||||
use tetratto_shared::unix_epoch_timestamp;
|
||||
use crate::model::addr::RemoteAddr;
|
||||
use crate::model::communities_permissions::CommunityPermission;
|
||||
use crate::model::uploads::{MediaType, MediaUpload};
|
||||
use crate::model::{
|
||||
|
@ -368,7 +369,10 @@ impl DataManager {
|
|||
|
||||
// check for ip block
|
||||
if self
|
||||
.get_ipblock_by_initiator_receiver(receiver.id, &data.ip)
|
||||
.get_ipblock_by_initiator_receiver(
|
||||
receiver.id,
|
||||
&RemoteAddr::from(data.ip.as_str()),
|
||||
)
|
||||
.await
|
||||
.is_ok()
|
||||
{
|
||||
|
@ -393,7 +397,7 @@ impl DataManager {
|
|||
|
||||
// check for ip block
|
||||
if self
|
||||
.get_ipblock_by_initiator_receiver(receiver.id, &data.ip)
|
||||
.get_ipblock_by_initiator_receiver(receiver.id, &RemoteAddr::from(data.ip.as_str()))
|
||||
.await
|
||||
.is_ok()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue