aboutsummaryrefslogtreecommitdiff
path: root/src/message/signalproxy/objects/coreinfo.rs
blob: a717366a16586f94afeb46e3ec3dfb16afd439e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use libquassel_derive::Network;

use crate::primitive::{DateTime, StringList};

#[derive(Debug, Clone, PartialEq, Network)]
#[network(repr = "map")]
pub struct CoreInfo {
    #[network(rename = "coreData", network, variant = "VariantMap")]
    core_data: CoreData,
}

// // S->C calls
// setCoreData(coreData: QVariantMap)
// /**
//  * Replaces all properties of the object with the content of the
//  * "properties" parameter. This parameter is in network representation.
//  */
// update(properties: QVariantMap)

#[derive(Debug, Clone, PartialEq, Network)]
#[network(repr = "map")]
pub struct CoreData {
    #[network(rename = "quasselVersion")]
    quassel_version: String,
    #[network(rename = "quasselBuildDate")]
    quassel_build_date: String,
    #[network(rename = "startTime")]
    start_time: DateTime,
    #[network(rename = "sessionConnectedClients")]
    session_connected_clients: i32,
    #[network(
        rename = "sessionConnectedClientData",
        variant = "VariantList",
        network
    )]
    session_connected_client_data: Vec<ConnectedClient>,
}

#[derive(Debug, Clone, PartialEq, Network)]
#[network(repr = "map")]
pub struct ConnectedClient {
    #[network(rename = "id")]
    id: i32,
    #[network(rename = "remoteAddress")]
    remote_address: String,
    #[network(rename = "location")]
    location: String,
    #[network(rename = "clientVersion")]
    client_version: String,
    #[network(rename = "clientVersionDate")]
    client_version_date: String,
    #[network(rename = "connectedSince")]
    connected_since: DateTime,
    #[network(rename = "secure")]
    secure: bool,
    #[network(rename = "features")]
    features: i32,
    #[network(rename = "featureList")]
    feature_list: StringList,
}
+39 Up to now it was represented as i32. If we introduce a newtype for it, we can handle it idiomatically as dedicated Variant::BufferId variant (instead of having it mashed into Variant::UserType). 2025-02-25Use MsgId in MessageTobias Deiminger-18/+6 2025-02-25Use MsgId in VariantTobias Deiminger-20/+37 2025-02-25Add MsgId as Rust typeTobias Deiminger-0/+56 Up to now it was handled implicitely in Variant::UserType. Making it an explicit type allows to centralize the i32/i64 cfg dependency and to use the type for arguments in signalproxy::objects functions. 2025-02-24added session manager comments and log messageMax Audron-1/+3 2025-02-23add identity syncable to SessionManagerMax Audron-1/+8 2025-02-23add syncables for IrcUserMax Audron-2/+53 2025-02-23move network config to it's own file and impl it's syncMax Audron-23/+84 2025-02-23add basic network syncablesMax Audron-39/+420 2025-02-23clean up unused_import and unused_variables a bitMax Audron-2/+8 2025-02-23fix server feature errorsMax Audron-28/+23 2025-02-23fix ircchannel and maplist network representationMax Audron-154/+137 2025-02-22replace deprecated failure crate with thiserrorMax Audron-278/+194 this changes the public API in that all our methods now return a proper ProtocolError crate. Needed change anyways to properly deal with all our errors in the long run. Will still need to do a pass through the crate to remove all existing unwraps where it makes sense. 2025-02-22update dependencies and fix errorsMax Audron-508/+332 2025-02-22update flakeMax Audron-94/+117 2024-05-22add todos to readmeMax Audron-16/+35