forked from Keelrleek/SoulStream
community: declare what you like on soulseek, so the similar-users shelf finally has something to rank on
This commit is contained in:
1 parent
8093adc89e
commit
7b7f48ebc6
8 files changed
+5671
-5519
No files matched your search
@@ -31,7 +31,11 @@ pub mod code {
|
||||
pub const PING: u32 = 32;
|
||||
pub const SHARED_FOLDERS_AND_FILES: u32 = 35;
|
||||
pub const GET_USER_STATS: u32 = 36;
|
||||
pub const ADD_THING_I_LIKE: u32 = 51;
|
||||
pub const REMOVE_THING_I_LIKE: u32 = 52;
|
||||
pub const USER_INTERESTS: u32 = 57;
|
||||
pub const ADD_THING_I_HATE: u32 = 117;
|
||||
pub const REMOVE_THING_I_HATE: u32 = 118;
|
||||
pub const SIMILAR_USERS: u32 = 110;
|
||||
pub const ROOM_LIST: u32 = 64;
|
||||
pub const HAVE_NO_PARENTS: u32 = 71;
|
||||
@@ -138,6 +142,28 @@ pub fn get_user_stats(username: &str) -> Vec<u8> {
|
||||
.finish_u32(code::GET_USER_STATS)
|
||||
}
|
||||
|
||||
/// Declare a like (code 51). These are what the server matches on when it
|
||||
/// ranks similar users, so a client that never sends one is invisible to that
|
||||
/// ranking however much it reads.
|
||||
pub fn add_thing_i_like(thing: &str) -> Vec<u8> {
|
||||
Writer::new().string(thing).finish_u32(code::ADD_THING_I_LIKE)
|
||||
}
|
||||
|
||||
/// Take a like back (code 52).
|
||||
pub fn remove_thing_i_like(thing: &str) -> Vec<u8> {
|
||||
Writer::new().string(thing).finish_u32(code::REMOVE_THING_I_LIKE)
|
||||
}
|
||||
|
||||
/// Declare a dislike (code 117).
|
||||
pub fn add_thing_i_hate(thing: &str) -> Vec<u8> {
|
||||
Writer::new().string(thing).finish_u32(code::ADD_THING_I_HATE)
|
||||
}
|
||||
|
||||
/// Take a dislike back (code 118).
|
||||
pub fn remove_thing_i_hate(thing: &str) -> Vec<u8> {
|
||||
Writer::new().string(thing).finish_u32(code::REMOVE_THING_I_HATE)
|
||||
}
|
||||
|
||||
/// A user's declared likes and hates (code 57).
|
||||
pub fn user_interests(username: &str) -> Vec<u8> {
|
||||
Writer::new()
|
||||
|
||||
Reference in new issue
Block a user