|
|
@ -119,28 +119,16 @@ impl Service {
|
|
|
|
true
|
|
|
|
true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Some(HistoryVisibility::Invited) => {
|
|
|
|
Some(HistoryVisibility::Invited) => {
|
|
|
|
let mut visible = false;
|
|
|
|
// Allow if any member on requesting server was AT LEAST invited, else deny
|
|
|
|
// Allow if any member on requesting server was invited or joined, else deny
|
|
|
|
current_server_members
|
|
|
|
for member in current_server_members {
|
|
|
|
.into_iter()
|
|
|
|
if self.user_was_invited(shortstatehash, &member)?
|
|
|
|
.any(|member| self.user_was_invited(shortstatehash, &member))
|
|
|
|
|| self.user_was_joined(shortstatehash, &member)?
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
visible = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
visible
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_ => {
|
|
|
|
_ => {
|
|
|
|
// Allow if any member on requested server was joined, else deny
|
|
|
|
// Allow if any member on requested server was joined, else deny
|
|
|
|
let mut visible = false;
|
|
|
|
current_server_members
|
|
|
|
for member in current_server_members {
|
|
|
|
.into_iter()
|
|
|
|
if self.user_was_joined(shortstatehash, &member)? {
|
|
|
|
.any(|member| self.user_was_joined(shortstatehash, &member))
|
|
|
|
visible = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
visible
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|