|
Ring Daemon
|
#include <contact_list.h>

Classes | |
| struct | OnChangeCallback |
Public Types | |
| using | clock = std::chrono::system_clock |
| using | OnAcceptConversation = std::function< void(const std::string &, const std::string &)> |
| using | OnConfirmation = std::function< void(const std::string &, const std::string &)> |
| using | OnContactAdded = std::function< void(const std::string &, bool)> |
| using | OnContactRemoved = std::function< void(const std::string &, bool)> |
| using | OnDevicesChanged = std::function< void(const std::map< dht::PkId, KnownDevice > &)> |
| using | OnIncomingTrustRequest = std::function< void(const std::string &, const std::string &, const std::vector< uint8_t > &, time_t)> |
| using | time_point = clock::time_point |
| using | VerifyResult = dht::crypto::TrustList::VerifyResult |
Public Member Functions | |
| void | acceptConversation (const std::string &convId, const std::string &deviceId="") |
| bool | acceptTrustRequest (const dht::InfoHash &from) |
| const std::string & | accountId () const |
| bool | addContact (const dht::InfoHash &, bool confirmed=false, const std::string &conversationId="") |
| ContactList (const std::string &accountId, const std::shared_ptr< crypto::Certificate > &cert, const std::filesystem::path &path, OnChangeCallback cb) | |
| bool | discardTrustRequest (const dht::InfoHash &from) |
| void | foundAccountDevice (const dht::PkId &device, const std::string &name={}, const time_point &last_sync=time_point::min()) |
| bool | foundAccountDevice (const std::shared_ptr< dht::crypto::Certificate > &crt, const std::string &name={}, const time_point &last_sync=time_point::min(), bool notify=true) |
| std::string | getAccountDeviceName (const dht::PkId &device) const |
| std::vector< std::string > | getCertificatesByStatus (dhtnet::tls::TrustStore::PermissionStatus status) const |
| dhtnet::tls::TrustStore::PermissionStatus | getCertificateStatus (const std::string &cert_id) const |
| std::map< std::string, std::string > | getContactDetails (const dht::InfoHash &) const |
| std::optional< Contact > | getContactInfo (const dht::InfoHash &) const |
| const std::map< dht::InfoHash, Contact > & | getContacts () const |
| const std::map< dht::PkId, KnownDevice > & | getKnownDevices () const |
| DeviceSync | getSyncData () const |
| std::map< std::string, std::string > | getTrustRequest (const dht::InfoHash &from) const |
| std::vector< std::map< std::string, std::string > > | getTrustRequests () const |
| bool | isAllowed (const crypto::Certificate &crt, bool allowPublic) |
| VerifyResult | isValidAccountDevice (const crypto::Certificate &crt) const |
| void | load () |
| bool | onTrustRequest (const dht::InfoHash &peer_account, const std::shared_ptr< dht::crypto::PublicKey > &peer_device, time_t received, bool confirm, const std::string &conversationId, std::vector< uint8_t > &&payload) |
| Inform of a new contact request. | |
| const std::filesystem::path & | path () const |
| bool | removeAccountDevice (const dht::PkId &device) |
| bool | removeContact (const dht::InfoHash &, bool ban) |
| bool | removeContactConversation (const dht::InfoHash &) |
| void | save () |
| void | saveContacts () const |
| Should be called only after updateContact. | |
| void | setAccountDeviceName (const dht::PkId &device, const std::string &name) |
| bool | setCertificateStatus (const std::shared_ptr< crypto::Certificate > &cert, dhtnet::tls::TrustStore::PermissionStatus status, bool local=true) |
| bool | setCertificateStatus (const std::string &cert_id, const dhtnet::tls::TrustStore::PermissionStatus status) |
| void | setContacts (const std::map< dht::InfoHash, Contact > &) |
| bool | syncDevice (const dht::PkId &device, const time_point &syncDate) |
| void | updateContact (const dht::InfoHash &, const Contact &, bool emit=true) |
| bool | updateConversation (const dht::InfoHash &h, const std::string &conversationId, bool added=false) |
| ~ContactList () | |
Definition at line 31 of file contact_list.h.
| using jami::ContactList::clock = std::chrono::system_clock |
Definition at line 34 of file contact_list.h.
| using jami::ContactList::OnAcceptConversation = std::function<void(const std::string&, const std::string&)> |
Definition at line 42 of file contact_list.h.
| using jami::ContactList::OnConfirmation = std::function<void(const std::string&, const std::string&)> |
Definition at line 43 of file contact_list.h.
| using jami::ContactList::OnContactAdded = std::function<void(const std::string&, bool)> |
Definition at line 38 of file contact_list.h.
| using jami::ContactList::OnContactRemoved = std::function<void(const std::string&, bool)> |
Definition at line 39 of file contact_list.h.
| using jami::ContactList::OnDevicesChanged = std::function<void(const std::map<dht::PkId, KnownDevice>&)> |
Definition at line 44 of file contact_list.h.
| using jami::ContactList::OnIncomingTrustRequest = std::function<void(const std::string&, const std::string&, const std::vector<uint8_t>&, time_t)> |
Definition at line 40 of file contact_list.h.
| using jami::ContactList::time_point = clock::time_point |
Definition at line 35 of file contact_list.h.
| using jami::ContactList::VerifyResult = dht::crypto::TrustList::VerifyResult |
Definition at line 36 of file contact_list.h.
| jami::ContactList::ContactList | ( | const std::string & | accountId, |
| const std::shared_ptr< crypto::Certificate > & | cert, | ||
| const std::filesystem::path & | path, | ||
| OnChangeCallback | cb | ||
| ) |
Definition at line 34 of file contact_list.cpp.
References jami::emitSignal(), and jami::Manager::instance().

| jami::ContactList::~ContactList | ( | ) |
Definition at line 48 of file contact_list.cpp.
| void jami::ContactList::acceptConversation | ( | const std::string & | convId, |
| const std::string & | deviceId = "" |
||
| ) |
Definition at line 430 of file contact_list.cpp.
References jami::ContactList::OnChangeCallback::acceptConversation, and jami::emitSignal().

Definition at line 413 of file contact_list.cpp.
References addContact(), and jami::emitSignal().

|
inline |
Definition at line 62 of file contact_list.h.
| bool jami::ContactList::addContact | ( | const dht::InfoHash & | h, |
| bool | confirmed = false, |
||
| const std::string & | conversationId = "" |
||
| ) |
Definition at line 88 of file contact_list.cpp.
References jami::ContactList::OnChangeCallback::contactAdded, jami::emitSignal(), JAMI_WARNING, and saveContacts().
Referenced by acceptTrustRequest().

Definition at line 437 of file contact_list.cpp.
References jami::emitSignal().

| void jami::ContactList::foundAccountDevice | ( | const dht::PkId & | device, |
| const std::string & | name = {}, |
||
| const time_point & | last_sync = time_point::min() |
||
| ) |
Definition at line 490 of file contact_list.cpp.
References jami::ContactList::OnChangeCallback::devicesChanged, jami::emitSignal(), and JAMI_LOG.

| bool jami::ContactList::foundAccountDevice | ( | const std::shared_ptr< dht::crypto::Certificate > & | crt, |
| const std::string & | name = {}, |
||
| const time_point & | last_sync = time_point::min(), |
||
| bool | notify = true |
||
| ) |
Definition at line 510 of file contact_list.cpp.
References jami::Manager::certStore(), jami::ContactList::OnChangeCallback::devicesChanged, jami::emitSignal(), jami::Manager::instance(), JAMI_ERROR, JAMI_LOG, and JAMI_WARNING.

| std::string jami::ContactList::getAccountDeviceName | ( | const dht::PkId & | device | ) | const |
Definition at line 584 of file contact_list.cpp.
|
inline |
Definition at line 87 of file contact_list.h.
|
inline |
Definition at line 82 of file contact_list.h.
References jami::emitSignal().

| std::map< std::string, std::string > jami::ContactList::getContactDetails | ( | const dht::InfoHash & | h | ) | const |
Definition at line 169 of file contact_list.cpp.
References jami::emitSignal(), and JAMI_WARNING.

Definition at line 186 of file contact_list.cpp.
References JAMI_WARNING.
Definition at line 197 of file contact_list.cpp.
Referenced by getSyncData().
|
inline |
Definition at line 123 of file contact_list.h.
| DeviceSync jami::ContactList::getSyncData | ( | ) | const |
Definition at line 594 of file contact_list.cpp.
References jami::DeviceSync::date, jami::TrustRequest::device, jami::emitSignal(), and getContacts().

| std::map< std::string, std::string > jami::ContactList::getTrustRequest | ( | const dht::InfoHash & | from | ) | const |
Definition at line 398 of file contact_list.cpp.
References libjami::Account::TrustRequest::CONVERSATIONID, jami::emitSignal(), libjami::Account::TrustRequest::FROM, libjami::Account::TrustRequest::PAYLOAD, and libjami::Account::TrustRequest::RECEIVED.

| std::vector< std::map< std::string, std::string > > jami::ContactList::getTrustRequests | ( | ) | const |
Definition at line 381 of file contact_list.cpp.
References libjami::Account::TrustRequest::CONVERSATIONID, jami::emitSignal(), libjami::Account::TrustRequest::FROM, libjami::Account::TrustRequest::PAYLOAD, and libjami::Account::TrustRequest::RECEIVED.

Definition at line 92 of file contact_list.h.
References jami::emitSignal().

|
inline |
Definition at line 94 of file contact_list.h.
References jami::emitSignal().

| void jami::ContactList::load | ( | ) |
Definition at line 51 of file contact_list.cpp.
| bool jami::ContactList::onTrustRequest | ( | const dht::InfoHash & | peer_account, |
| const std::shared_ptr< dht::crypto::PublicKey > & | peer_device, | ||
| time_t | received, | ||
| bool | confirm, | ||
| const std::string & | conversationId, | ||
| std::vector< uint8_t > && | payload | ||
| ) |
Inform of a new contact request.
Returns true if the request should be immediatly accepted (already a contact)
Definition at line 319 of file contact_list.cpp.
References jami::ContactList::OnChangeCallback::contactAdded, jami::emitSignal(), JAMI_LOG, jami::ContactList::OnChangeCallback::onConfirmation, saveContacts(), and jami::ContactList::OnChangeCallback::trustRequest.

|
inline |
Definition at line 103 of file contact_list.h.
Definition at line 561 of file contact_list.cpp.
Definition at line 129 of file contact_list.cpp.
References jami::ContactList::OnChangeCallback::contactRemoved, jami::emitSignal(), jami::Manager::instance(), JAMI_WARNING, and saveContacts().

Definition at line 157 of file contact_list.cpp.
References jami::emitSignal(), and saveContacts().

| void jami::ContactList::save | ( | ) |
Definition at line 59 of file contact_list.cpp.
References saveContacts().

| void jami::ContactList::saveContacts | ( | ) | const |
Should be called only after updateContact.
Definition at line 275 of file contact_list.cpp.
References jami::emitSignal(), and JAMI_LOG.
Referenced by addContact(), onTrustRequest(), removeContact(), removeContactConversation(), save(), setContacts(), and updateConversation().

Definition at line 571 of file contact_list.cpp.
References jami::ContactList::OnChangeCallback::devicesChanged.
| bool jami::ContactList::setCertificateStatus | ( | const std::shared_ptr< crypto::Certificate > & | cert, |
| dhtnet::tls::TrustStore::PermissionStatus | status, | ||
| bool | local = true |
||
| ) |
Definition at line 80 of file contact_list.cpp.
References jami::emitSignal().

| bool jami::ContactList::setCertificateStatus | ( | const std::string & | cert_id, |
| const dhtnet::tls::TrustStore::PermissionStatus | status | ||
| ) |
Definition at line 67 of file contact_list.cpp.
References jami::emitSignal(), and JAMI_LOG.

Definition at line 203 of file contact_list.cpp.
References jami::ContactList::OnChangeCallback::contactAdded, JAMI_LOG, and saveContacts().

| bool jami::ContactList::syncDevice | ( | const dht::PkId & | device, |
| const time_point & | syncDate | ||
| ) |
Definition at line 632 of file contact_list.cpp.
References JAMI_LOG, and JAMI_WARNING.
| void jami::ContactList::updateContact | ( | const dht::InfoHash & | id, |
| const Contact & | contact, | ||
| bool | emit = true |
||
| ) |
Definition at line 218 of file contact_list.cpp.
References jami::ContactList::OnChangeCallback::contactAdded, jami::ContactList::OnChangeCallback::contactRemoved, jami::emitSignal(), JAMI_ERROR, and jami::toString().

| bool jami::ContactList::updateConversation | ( | const dht::InfoHash & | h, |
| const std::string & | conversationId, | ||
| bool | added = false |
||
| ) |
Definition at line 113 of file contact_list.cpp.
References jami::emitSignal(), and saveContacts().
