libsignal_service/
lib.rs

1#![recursion_limit = "256"]
2#![deny(clippy::dbg_macro)]
3// TODO: we cannot use this until whisperfish builds with a newer Rust version
4#![allow(clippy::uninlined_format_args)]
5
6mod account_manager;
7pub mod attachment_cipher;
8pub mod cipher;
9pub mod profile_cipher;
10pub mod sticker_cipher;
11
12pub mod configuration;
13pub mod content;
14mod digeststream;
15pub mod envelope;
16pub mod groups_v2;
17pub mod master_key;
18pub mod messagepipe;
19pub mod models;
20pub mod pre_keys;
21pub mod profile_name;
22#[allow(clippy::derive_partial_eq_without_eq)]
23pub mod proto;
24pub mod provisioning;
25pub mod push_service;
26pub mod receiver;
27pub mod sender;
28pub mod service_address;
29pub mod session_store;
30mod timestamp;
31pub mod unidentified_access;
32pub mod utils;
33pub mod websocket;
34
35pub use crate::account_manager::{
36    decrypt_device_name, encrypt_device_name, AccountManager, Profile,
37    ProfileManagerError,
38};
39pub use crate::service_address::*;
40
41pub const USER_AGENT: &str =
42    concat!(env!("CARGO_PKG_NAME"), "-rs-", env!("CARGO_PKG_VERSION"));
43
44/// GROUP_UPDATE_FLAG signals that this message updates the group membership or
45/// name.
46pub const GROUP_UPDATE_FLAG: u32 = 1;
47
48/// GROUP_LEAVE_FLAG signals that this message is a group leave message.
49pub const GROUP_LEAVE_FLAG: u32 = 2;
50
51pub mod prelude {
52    pub use crate::{
53        cipher::ServiceCipher,
54        configuration::{ServiceConfiguration, ServiceCredentials},
55        content::Content,
56        envelope::Envelope,
57        groups_v2::{
58            AccessControl, Group, Member, PendingMember, RequestingMember,
59            Timer,
60        },
61        master_key::{MasterKey, MasterKeyStore, StorageServiceKey},
62        proto::{
63            attachment_pointer::AttachmentIdentifier, sync_message::Contacts,
64            AttachmentPointer,
65        },
66        push_service::{PushService, ServiceError},
67        receiver::MessageReceiver,
68        sender::{MessageSender, MessageSenderError},
69        session_store::SessionStoreExt,
70    };
71    #[cfg(feature = "phonenumber")]
72    pub use phonenumber;
73    pub use prost::Message as ProtobufMessage;
74    pub use uuid::{Error as UuidError, Uuid};
75    pub use zkgroup::{
76        groups::{GroupMasterKey, GroupSecretParams},
77        profiles::ProfileKey,
78    };
79}
80
81pub mod protocol {
82    pub use libsignal_core::{InvalidDeviceId, E164};
83    pub use libsignal_protocol::*;
84    pub use usernames::{Username, UsernameError};
85}
86
87pub use zkgroup;