Changed which messages are forwardable
Challenges should be forwardable. Group creation should be done by users on the local server as otherwise groups will get squatted incredibly easily and quickly
This commit is contained in:
+11
-4
@@ -1,6 +1,6 @@
|
|||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
use crate::message::{MessageId,TaggedMessage,VerificationError,Relevance};
|
use crate::message::{MessageId,TaggedMessage,VerificationError,Relevance};
|
||||||
use crate::state::{self,StateType,StateValue,StatePath,StatePermission,StatePermissionKey};
|
use crate::state::{self,StateValue,StatePath,StatePermission,StatePermissionKey};
|
||||||
use crate::{RoomId,Group,Role,User,GroupPower,ServerAddr};
|
use crate::{RoomId,Group,Role,User,GroupPower,ServerAddr};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use time::OffsetDateTime;
|
use time::OffsetDateTime;
|
||||||
@@ -250,11 +250,17 @@ impl ClientMessage<> {
|
|||||||
username: _,
|
username: _,
|
||||||
password: _,
|
password: _,
|
||||||
}
|
}
|
||||||
|
// Groups can only be created locally. However, you can still
|
||||||
|
// grant admin permissions to users on other servers
|
||||||
|
| GroupCreate {
|
||||||
|
users: _,
|
||||||
|
group: _,
|
||||||
|
} => false,
|
||||||
// In the future challenges might be forwardable but right now they are
|
// In the future challenges might be forwardable but right now they are
|
||||||
// only used for signups and auth is local.
|
// only used for signups and auth is local.
|
||||||
| ChallengeAnswer {
|
//| ChallengeAnswer {
|
||||||
response: _
|
// response: _
|
||||||
} => false,
|
//} => false,
|
||||||
|
|
||||||
_ => true
|
_ => true
|
||||||
}
|
}
|
||||||
@@ -322,6 +328,7 @@ pub enum ServerError {
|
|||||||
RemoveLastOwner,
|
RemoveLastOwner,
|
||||||
MessageNotForwardable,
|
MessageNotForwardable,
|
||||||
UserAlreadyExists,
|
UserAlreadyExists,
|
||||||
|
MissingPermission,
|
||||||
Generic
|
Generic
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user