aboutsummaryrefslogtreecommitdiff
path: root/src/message/handshake/features.rs
blob: e7557e987e9cc71b023434e09056d9c7eb6e9234 (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
61
62
63
64
65
66
67
use crate::primitive::StringList;

pub enum Feature {
    /// --
    SynchronizedMarkerLine = 0x00000001,
    /// --
    SaslAuthentication = 0x00000002,
    /// --
    SaslExternal = 0x00000004,
    /// --
    HideInactiveNetworks = 0x00000008,
    /// --
    PasswordChange = 0x00000010,
    /// IRCv3 capability negotiation, account tracking
    CapNegotiation = 0x00000020,
    /// IRC server SSL validation
    VerifyServerSSL = 0x00000040,
    /// IRC server custom message rate limits
    CustomRateLimits = 0x00000080,
    /// Currently not supported
    DccFileTransfer = 0x00000100,
    /// Timestamp formatting in away (e.g. %%hh:mm%%)
    AwayFormatTimestamp = 0x00000200,
    /// Support for exchangeable auth backends
    Authenticators = 0x00000400,
    /// Sync buffer activity status
    BufferActivitySync = 0x00000800,
    /// Core-Side highlight configuration and matching
    CoreSideHighlights = 0x00001000,
    /// Show prefixes for senders in backlog
    SenderPrefixes = 0x00002000,
    /// Supports RPC call disconnectFromCore to remotely disconnect a client
    RemoteDisconnect = 0x00004000,
    /// Transmit features as list of strings
    ExtendedFeatures = 0x00008000,
    /// Serialize message time as 64-bit
    LongTime,
    /// Real Name and Avatar URL in backlog
    RichMessages,
    /// Backlogmanager supports filtering backlog by messagetype
    BacklogFilterType,
    /// ECDSA keys for CertFP in identities
    EcdsaCertfpKeys,
    /// 64-bit IDs for messages
    LongMessageId,
    /// CoreInfo dynamically updated using signals
    SyncedCoreInfo,
}

impl Feature {
    pub fn get() -> StringList {
        let mut features = StringList::new();
        features.push("ExtendedFeatures".to_string());
        #[cfg(feature = "long-message-id")]
        features.push("LongMessageId".to_string());
        #[cfg(feature = "long-time")]
        features.push("LongTime".to_string());
        #[cfg(feature = "rich-messages")]
        features.push("RichMessages".to_string());
        #[cfg(feature = "sender-prefixes")]
        features.push("SenderPrefixes".to_string());
        #[cfg(feature = "authenticators")]
        features.push("Authenticators".to_string());

        return features;
    }
}