* Badges now have an optional permissions field
* New struct changes integrating badge system
This commit is contained in:
parent
36dbc8dd1e
commit
fc24ad3430
@ -65,7 +65,8 @@ pub struct Channel {
|
|||||||
pub id: UBigInt,
|
pub id: UBigInt,
|
||||||
pub name: VarChar,
|
pub name: VarChar,
|
||||||
pub description: Option<VarChar>,
|
pub description: Option<VarChar>,
|
||||||
pub kind: Integer
|
pub kind: Integer,
|
||||||
|
pub badges: Vec<Badge>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Debug)]
|
#[derive(Serialize, Debug)]
|
||||||
@ -82,6 +83,7 @@ pub struct Member {
|
|||||||
pub name: VarChar,
|
pub name: VarChar,
|
||||||
pub status: Integer,
|
pub status: Integer,
|
||||||
pub permissions: UBigInt,
|
pub permissions: UBigInt,
|
||||||
|
pub badges: Vec<Badge>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
@ -90,6 +92,7 @@ pub struct PublicMember {
|
|||||||
pub name: VarChar,
|
pub name: VarChar,
|
||||||
pub status: Integer,
|
pub status: Integer,
|
||||||
pub permissions: UBigInt,
|
pub permissions: UBigInt,
|
||||||
|
pub badges: Vec<Badge>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
@ -100,3 +103,11 @@ pub struct Neighbor {
|
|||||||
pub url: String,
|
pub url: String,
|
||||||
pub wsurl: Option<String>,
|
pub wsurl: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
pub struct Badge {
|
||||||
|
pub name: String,
|
||||||
|
pub id: u32,
|
||||||
|
pub color: u32,
|
||||||
|
pub perms: Option<u32>, // abridged version of permissiosn
|
||||||
|
}
|
@ -2,5 +2,6 @@ CREATE TABLE IF NOT EXISTS `badges`(
|
|||||||
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`name` VARCHAR(256) NOT NULL,
|
`name` VARCHAR(256) NOT NULL,
|
||||||
`color` INTEGER UNSIGNED NOT NULL DEFAULT 0xFFFFFFFF,
|
`color` INTEGER UNSIGNED NOT NULL DEFAULT 0xFFFFFFFF,
|
||||||
|
`permissions` INTEGER UNSIGNED, -- nullable because this isn't logically applicable to every badge
|
||||||
PRIMARY KEY(`id`)
|
PRIMARY KEY(`id`)
|
||||||
);
|
);
|
Loading…
Reference in New Issue
Block a user