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, AccountManager, Profile, ProfileManagerError,
37};
38pub use crate::service_address::*;
39
40pub const USER_AGENT: &str =
41    concat!(env!("CARGO_PKG_NAME"), "-rs-", env!("CARGO_PKG_VERSION"));
42
43/// GROUP_UPDATE_FLAG signals that this message updates the group membership or
44/// name.
45pub const GROUP_UPDATE_FLAG: u32 = 1;
46
47/// GROUP_LEAVE_FLAG signals that this message is a group leave message.
48pub const GROUP_LEAVE_FLAG: u32 = 2;
49
50pub mod prelude {
51    pub use crate::{
52        cipher::ServiceCipher,
53        configuration::{
54            ServiceConfiguration, ServiceCredentials, SignalingKey,
55        },
56        content::Content,
57        envelope::Envelope,
58        groups_v2::{
59            AccessControl, Group, Member, PendingMember, RequestingMember,
60            Timer,
61        },
62        master_key::{MasterKey, MasterKeyStore, StorageServiceKey},
63        proto::{
64            attachment_pointer::AttachmentIdentifier, sync_message::Contacts,
65            AttachmentPointer,
66        },
67        push_service::{PushService, ServiceError},
68        receiver::MessageReceiver,
69        sender::{MessageSender, MessageSenderError},
70        session_store::SessionStoreExt,
71    };
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    pub use libsignal_protocol::{DeviceId, IdentityKeyStore};
81}
82
83pub use libsignal_protocol as protocol;
84pub use zkgroup;