mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add sigchat doco
This commit is contained in:
parent
572dcd6bd1
commit
e5bb114c71
1 changed files with 30 additions and 0 deletions
|
|
@ -47,6 +47,14 @@ impl<'a> SigChat<'a> {
|
||||||
|
|
||||||
/// Connect to the Signal servers
|
/// Connect to the Signal servers
|
||||||
///
|
///
|
||||||
|
/// The process first waits for an active WiFi connection, and then
|
||||||
|
/// initiates a Signal Account Manager with the Signal Account struct stored
|
||||||
|
/// in the pddb (or kicks off the Account setup process otherwise). The
|
||||||
|
/// Account Manager orchestrates the interaction with the Signal host server.
|
||||||
|
///
|
||||||
|
/// # Returns
|
||||||
|
/// true on a successful connection to a Signal Account/Server
|
||||||
|
///
|
||||||
pub fn connect(&mut self) -> Result<bool, Error> {
|
pub fn connect(&mut self) -> Result<bool, Error> {
|
||||||
log::info!("Attempting connect to Signal server");
|
log::info!("Attempting connect to Signal server");
|
||||||
if self.wifi() {
|
if self.wifi() {
|
||||||
|
|
@ -84,6 +92,16 @@ impl<'a> SigChat<'a> {
|
||||||
/// Setup a Signal Account via Registration or Linking,
|
/// Setup a Signal Account via Registration or Linking,
|
||||||
/// or abort setup and read existing chat Dialogues in pddb
|
/// or abort setup and read existing chat Dialogues in pddb
|
||||||
///
|
///
|
||||||
|
/// The user can choose to:
|
||||||
|
/// 1. Link to an existing Signal Account
|
||||||
|
/// 2. Register a new Signal Account
|
||||||
|
/// 3. Abort account setup to read existing Signal Dialogues stored in the pddb
|
||||||
|
/// The online options involve nominating the Signal host server,
|
||||||
|
/// and probing the host for trusted tlls Certificate Authorities.
|
||||||
|
///
|
||||||
|
/// # Returns
|
||||||
|
/// Account struct stored in pddb
|
||||||
|
///
|
||||||
fn account_setup(&mut self) -> Result<Account, Error> {
|
fn account_setup(&mut self) -> Result<Account, Error> {
|
||||||
log::info!("Attempting to setup a Signal Account");
|
log::info!("Attempting to setup a Signal Account");
|
||||||
self.modals
|
self.modals
|
||||||
|
|
@ -177,6 +195,15 @@ impl<'a> SigChat<'a> {
|
||||||
/// Signal allows to link additional devices to your primary device (e.g. Signal-Android).
|
/// Signal allows to link additional devices to your primary device (e.g. Signal-Android).
|
||||||
/// Note that currently Signal allows up to three linked devices per primary.
|
/// Note that currently Signal allows up to three linked devices per primary.
|
||||||
///
|
///
|
||||||
|
/// The user must provide a name for the current device before the Link process
|
||||||
|
/// commences - culminating by presenting a qr-code to be scanned by the primary device.
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
/// * `host` - the Signal server host name or ip-address
|
||||||
|
///
|
||||||
|
/// # Returns
|
||||||
|
/// Account struct stored in pddb
|
||||||
|
///
|
||||||
pub fn account_link(&mut self, host: &str) -> Result<Account, Error> {
|
pub fn account_link(&mut self, host: &str) -> Result<Account, Error> {
|
||||||
log::info!("Attempting to Link to an existing Signal Account");
|
log::info!("Attempting to Link to an existing Signal Account");
|
||||||
match Account::new(SIGCHAT_ACCOUNT) {
|
match Account::new(SIGCHAT_ACCOUNT) {
|
||||||
|
|
@ -306,6 +333,9 @@ impl<'a> SigChat<'a> {
|
||||||
/// If wifi is not connected then a modal offers to "Connect to wifi?"
|
/// If wifi is not connected then a modal offers to "Connect to wifi?"
|
||||||
/// and tries for 10 seconds before representing.
|
/// and tries for 10 seconds before representing.
|
||||||
///
|
///
|
||||||
|
/// # Returns
|
||||||
|
/// true when wifi is connected
|
||||||
|
///
|
||||||
pub fn wifi(&self) -> bool {
|
pub fn wifi(&self) -> bool {
|
||||||
if HOSTED_MODE {
|
if HOSTED_MODE {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue