Skip to main content

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 storage_service;
31mod timestamp;
32pub mod unidentified_access;
33pub mod utils;
34pub mod websocket;
35
36pub use crate::account_manager::{
37    decrypt_device_name, encrypt_device_name, AccountManager, Profile,
38    ProfileManagerError,
39};
40pub use crate::service_address::*;
41pub use crate::storage_service::{StorageService, StorageServiceError};
42
43pub const USER_AGENT: &str =
44    concat!(env!("CARGO_PKG_NAME"), "-rs-", env!("CARGO_PKG_VERSION"));
45
46/// GROUP_UPDATE_FLAG signals that this message updates the group membership or
47/// name.
48pub const GROUP_UPDATE_FLAG: u32 = 1;
49
50/// GROUP_LEAVE_FLAG signals that this message is a group leave message.
51pub const GROUP_LEAVE_FLAG: u32 = 2;
52
53pub mod prelude {
54    pub use crate::{
55        cipher::ServiceCipher,
56        configuration::{ServiceConfiguration, ServiceCredentials},
57        content::Content,
58        envelope::Envelope,
59        groups_v2::{
60            AccessControl, Group, Member, PendingMember, RequestingMember,
61            Timer,
62        },
63        master_key::{MasterKey, MasterKeyStore, StorageServiceKey},
64        proto::{
65            attachment_pointer::AttachmentIdentifier, sync_message::Contacts,
66            AttachmentPointer,
67        },
68        push_service::{PushService, ServiceError},
69        receiver::MessageReceiver,
70        sender::{MessageSender, MessageSenderError},
71        session_store::SessionStoreExt,
72    };
73    #[cfg(feature = "phonenumber")]
74    pub use phonenumber;
75    pub use prost::Message as ProtobufMessage;
76    pub use uuid::{Error as UuidError, Uuid};
77    pub use zkgroup::{
78        groups::{GroupMasterKey, GroupSecretParams},
79        profiles::ProfileKey,
80    };
81}
82
83pub mod protocol {
84    pub use libsignal_core::{InvalidDeviceId, E164};
85    pub use libsignal_protocol::*;
86    pub use usernames::{Username, UsernameError};
87}
88
89pub use libsignal_account_keys;
90
91pub use zkgroup;