Ring Daemon 16.0.0
|
#include <conversation_module.h>
Classes | |
class | Impl |
Public Member Functions | |
void | acceptConversationRequest (const std::string &conversationId, const std::string &deviceId="") |
Accept a conversation's request. | |
void | addCallHistoryMessage (const std::string &uri, uint64_t duration_ms, const std::string &reason) |
Add to the related conversation the call history message. | |
void | addConversationMember (const std::string &conversationId, const dht::InfoHash &contactUri, bool sendRequest=true) |
Adds a new member to a conversation (this will triggers a member event + new message on success) | |
void | addConvInfo (const ConvInfo &info) |
void | addGitSocket (std::string_view deviceId, std::string_view convId, const std::shared_ptr< dhtnet::ChannelSocket > &channel) |
void | addSwarmChannel (const std::string &conversationId, std::shared_ptr< dhtnet::ChannelSocket > socket) |
Add a swarm connection. | |
void | bootstrap (const std::string &convId="") |
Bootstrap swarm managers to other peers. | |
std::shared_ptr< SIPCall > | call (const std::string &url, const std::vector< libjami::MediaMap > &mediaList, std::function< void(const std::string &, const DeviceId &, const std::shared_ptr< SIPCall > &)> &&cb) |
Call the conversation. | |
void | clearCache (const std::string &conversationId) |
Clear loaded interactions. | |
void | clearPendingFetch () |
Clear not removed fetch. | |
void | cloneConversationFrom (const std::string &conversationId, const std::string &uri, const std::string &oldConvId="") |
Clone conversation from a member. | |
void | connectivityChanged () |
Triggers a bucket maintainance for DRTs. | |
std::map< std::string, std::string > | conversationInfos (const std::string &conversationId) const |
ConversationModule (std::shared_ptr< JamiAccount > account, std::shared_ptr< AccountManager > accountManager, NeedsSyncingCb &&needsSyncingCb, SengMsgCb &&sendMsgCb, NeedSocketCb &&onNeedSocket, NeedSocketCb &&onNeedSwarmSocket, OneToOneRecvCb &&oneToOneRecvCb, bool autoLoadConversations=true) | |
std::vector< uint8_t > | conversationVCard (const std::string &conversationId) const |
std::map< std::string, std::map< std::string, std::map< std::string, std::string > > > | convMessageStatus () const |
std::map< std::string, std::map< std::string, std::string > > | convPreferences () const |
Retrieve all conversation preferences to sync with other devices. | |
uint32_t | countInteractions (const std::string &convId, const std::string &toId, const std::string &fromId, const std::string &authorUri) const |
Retrieve the number of interactions from interactionId to HEAD. | |
std::shared_ptr< TransferManager > | dataTransfer (const std::string &id) const |
Returns related transfer manager. | |
void | declineConversationRequest (const std::string &conversationId) |
Decline a conversation's request. | |
bool | downloadFile (const std::string &conversationId, const std::string &interactionId, const std::string &fileId, const std::string &path) |
Ask conversation's members to send a file to this device. | |
void | editMessage (const std::string &conversationId, const std::string &newBody, const std::string &editedId) |
void | fetchNewCommits (const std::string &peer, const std::string &deviceId, const std::string &conversationId, const std::string &commitId) |
Launch fetch on new commit. | |
std::vector< std::map< std::string, std::string > > | getActiveCalls (const std::string &conversationId) const |
Return active calls. | |
std::shared_ptr< Conversation > | getConversation (const std::string &convId) |
Get a conversation. | |
std::vector< std::map< std::string, std::string > > | getConversationMembers (const std::string &conversationId, bool includeBanned=false) const |
Get members. | |
std::map< std::string, std::string > | getConversationPreferences (const std::string &conversationId, bool includeCreated=false) const |
std::vector< std::map< std::string, std::string > > | getConversationRequests () const |
Return conversation's requests. | |
std::vector< std::string > | getConversations () const |
Return all conversation's id (including syncing ones) | |
std::string | getOneToOneConversation (const std::string &uri) const noexcept |
Get related conversation with member. | |
std::shared_ptr< Typers > | getTypers (const std::string &convId) |
Get Typers object for a conversation. | |
std::shared_ptr< dhtnet::ChannelSocket > | gitSocket (std::string_view deviceId, std::string_view convId) const |
Return current git socket used for a conversation. | |
void | hostConference (const std::string &conversationId, const std::string &confId, const std::string &callId, const std::vector< libjami::MediaMap > &mediaList={}) |
void | initReplay (const std::string &oldConvId, const std::string &newConvId) |
bool | isBanned (const std::string &convId, const std::string &uri) const |
Return if a device or member is banned from a conversation. | |
bool | isHosting (const std::string &conversationId, const std::string &confId) const |
Check if we're hosting a specific conference. | |
uint32_t | loadConversation (const std::string &conversationId, const std::string &fromMessage="", size_t n=0) |
uint32_t | loadConversationMessages (const std::string &conversationId, const std::string &fromMessage="", size_t n=0) |
Load conversation's messages. | |
void | loadConversations () |
Refresh information about conversations. | |
uint32_t | loadConversationUntil (const std::string &conversationId, const std::string &fromMessage, const std::string &to) |
void | loadSingleConversation (const std::string &convId) |
uint32_t | loadSwarmUntil (const std::string &conversationId, const std::string &fromMessage, const std::string &toMessage) |
void | monitor () |
bool | needsSyncingWith (const std::string &memberUri, const std::string &deviceId) const |
Check if we need to share infos with a contact. | |
void | onConversationRequest (const std::string &from, const Json::Value &value) |
Called when receiving a new conversation's request. | |
bool | onFileChannelRequest (const std::string &conversationId, const std::string &member, const std::string &fileId, bool verifyShaSum=true) const |
Choose if we can accept channel request. | |
bool | onMessageDisplayed (const std::string &peer, const std::string &conversationId, const std::string &interactionId) |
void | onNeedConversationRequest (const std::string &from, const std::string &conversationId) |
Called when a peer needs an invite for a conversation (generally after that they received a commit notification for a conversation they don't have yet) | |
void | onSyncData (const SyncMsg &msg, const std::string &peerId, const std::string &deviceId) |
Detect new conversations and request from other devices. | |
void | onTrustRequest (const std::string &uri, const std::string &conversationId, const std::vector< uint8_t > &payload, time_t received) |
Called when detecting a new trust request with linked one to one. | |
std::string | peerFromConversationRequest (const std::string &convId) const |
Retrieve author of a conversation request. | |
void | reactToMessage (const std::string &conversationId, const std::string &newBody, const std::string &reactToId) |
void | reloadRequests () |
Reload requests from file. | |
void | removeContact (const std::string &uri, bool ban) |
Remove one to one conversations related to a contact. | |
bool | removeConversation (const std::string &conversationId) |
Remove a conversation, but not the contact. | |
void | removeConversationMember (const std::string &conversationId, const dht::InfoHash &contactUri, bool isDevice=false) |
Remove a member from a conversation (this will trigger a member event + new message on success) | |
void | removeGitSocket (std::string_view deviceId, std::string_view convId) |
void | search (uint32_t req, const std::string &convId, const Filter &filter) const |
Search in conversations via a filter. | |
void | sendMessage (const std::string &conversationId, Json::Value &&value, const std::string &replyTo="", bool announce=true, OnCommitCb &&onCommit={}, OnDoneCb &&cb={}) |
void | sendMessage (const std::string &conversationId, std::string message, const std::string &replyTo="", const std::string &type="text/plain", bool announce=true, OnCommitCb &&onCommit={}, OnDoneCb &&cb={}) |
void | setAccountManager (std::shared_ptr< AccountManager > accountManager) |
void | setConversationPreferences (const std::string &conversationId, const std::map< std::string, std::string > &prefs) |
Update user's preferences (like color, notifications, etc) to be synced across devices. | |
void | setFetched (const std::string &conversationId, const std::string &deviceId, const std::string &commit) |
Notify that a peer fetched a commit. | |
void | shutdownConnections () |
Clear all connection (swarm channels) | |
std::string | startConversation (ConversationMode mode=ConversationMode::INVITES_ONLY, const dht::InfoHash &otherMember={}) |
Starts a new conversation. | |
void | syncConversations (const std::string &peer, const std::string &deviceId) |
Sync conversations with detected peer. | |
void | updateConversationInfos (const std::string &conversationId, const std::map< std::string, std::string > &infos, bool sync=true) |
Update metadatas from conversations (like title, avatar, etc) | |
bool | updateConvForContact (const std::string &uri, const std::string &oldConv, const std::string &newConv) |
Replace linked conversation in contact's details. | |
~ConversationModule ()=default | |
Static Public Member Functions | |
static std::map< std::string, ConvInfo > | convInfos (const std::string &accountId) |
static std::map< std::string, ConvInfo > | convInfosFromPath (const std::filesystem::path &path) |
static std::map< std::string, ConversationRequest > | convRequests (const std::string &accountId) |
static std::map< std::string, ConversationRequest > | convRequestsFromPath (const std::filesystem::path &path) |
static void | saveConvInfos (const std::string &accountId, const std::map< std::string, ConvInfo > &conversations) |
static void | saveConvInfosToPath (const std::filesystem::path &path, const std::map< std::string, ConvInfo > &conversations) |
static void | saveConvRequests (const std::string &accountId, const std::map< std::string, ConversationRequest > &conversationsRequests) |
static void | saveConvRequestsToPath (const std::filesystem::path &path, const std::map< std::string, ConversationRequest > &conversationsRequests) |
Definition at line 68 of file conversation_module.h.
jami::ConversationModule::ConversationModule | ( | std::shared_ptr< JamiAccount > | account, |
std::shared_ptr< AccountManager > | accountManager, | ||
NeedsSyncingCb && | needsSyncingCb, | ||
SengMsgCb && | sendMsgCb, | ||
NeedSocketCb && | onNeedSocket, | ||
NeedSocketCb && | onNeedSwarmSocket, | ||
OneToOneRecvCb && | oneToOneRecvCb, | ||
bool | autoLoadConversations = true |
||
) |
Definition at line 1512 of file conversation_module.cpp.
References jami::emitSignal(), and loadConversations().
|
default |
void jami::ConversationModule::acceptConversationRequest | ( | const std::string & | conversationId, |
const std::string & | deviceId = "" |
||
) |
Accept a conversation's request.
convId | |
deviceId | If a trust request is accepted from a device (can help to sync) |
Definition at line 2021 of file conversation_module.cpp.
References cloneConversationFrom(), jami::emitSignal(), and JAMI_WARNING.
void jami::ConversationModule::addCallHistoryMessage | ( | const std::string & | uri, |
uint64_t | duration_ms, | ||
const std::string & | reason | ||
) |
Add to the related conversation the call history message.
uri | Peer number |
duration_ms | The call duration in ms |
reason |
Definition at line 2185 of file conversation_module.cpp.
References jami::emitSignal(), getOneToOneConversation(), and sendMessage().
void jami::ConversationModule::addConversationMember | ( | const std::string & | conversationId, |
const dht::InfoHash & | contactUri, | ||
bool | sendRequest = true |
||
) |
Adds a new member to a conversation (this will triggers a member event + new message on success)
conversationId | |
contactUri | |
sendRequest | If we need to inform the peer (used for tests) |
Definition at line 2625 of file conversation_module.cpp.
References jami::emitSignal(), JAMI_DEBUG, and JAMI_ERROR.
Definition at line 3265 of file conversation_module.cpp.
Referenced by jami::ConversationModule::Impl::cloneConversation(), jami::ConversationModule::Impl::cloneConversationFrom(), onSyncData(), jami::ConversationModule::Impl::removeConversationImpl(), jami::ConversationModule::Impl::removeRepositoryImpl(), and startConversation().
void jami::ConversationModule::addGitSocket | ( | std::string_view | deviceId, |
std::string_view | convId, | ||
const std::shared_ptr< dhtnet::ChannelSocket > & | channel | ||
) |
Definition at line 3305 of file conversation_module.cpp.
References JAMI_WARNING.
void jami::ConversationModule::addSwarmChannel | ( | const std::string & | conversationId, |
std::shared_ptr< dhtnet::ChannelSocket > | socket | ||
) |
Add a swarm connection.
conversationId | |
socket |
Definition at line 3334 of file conversation_module.cpp.
Bootstrap swarm managers to other peers.
Definition at line 1821 of file conversation_module.cpp.
References jami::emitSignal().
Referenced by jami::ConversationModule::Impl::bootstrap().
std::shared_ptr< SIPCall > jami::ConversationModule::call | ( | const std::string & | url, |
const std::vector< libjami::MediaMap > & | mediaList, | ||
std::function< void(const std::string &, const DeviceId &, const std::shared_ptr< SIPCall > &)> && | cb | ||
) |
Call the conversation.
url | Url to call (swarm:conversation or swarm:conv/account/device/conf to join) |
mediaList | The media list |
cb | Callback to pass which device to call (called in the same thread) |
Definition at line 2989 of file conversation_module.cpp.
References call(), jami::Manager::callFactory, jami::Call::DISCONNECTED, jami::emitSignal(), jami::CallFactory::getNewCallID(), hostConference(), jami::Manager::instance(), JAMI_DEBUG, JAMI_ERROR, jami::MediaAttribute::mediaAttributesToMediaMaps(), jami::Call::MERROR, jami::Call::OUTGOING, jami::split_string(), and jami::Call::TRYING.
Referenced by call().
Clear loaded interactions.
conversationId |
Definition at line 2258 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::clearPendingFetch | ( | ) |
Clear not removed fetch.
Definition at line 1834 of file conversation_module.cpp.
References jami::emitSignal(), and JAMI_ERR.
void jami::ConversationModule::cloneConversationFrom | ( | const std::string & | conversationId, |
const std::string & | uri, | ||
const std::string & | oldConvId = "" |
||
) |
Clone conversation from a member.
conversationId | |
uri | |
oldConvId |
Definition at line 2121 of file conversation_module.cpp.
References jami::emitSignal().
Referenced by acceptConversationRequest(), jami::ConversationModule::Impl::bootstrap(), jami::ConversationModule::Impl::fallbackClone(), and onSyncData().
void jami::ConversationModule::connectivityChanged | ( | ) |
Triggers a bucket maintainance for DRTs.
Definition at line 3342 of file conversation_module.cpp.
std::map< std::string, std::string > jami::ConversationModule::conversationInfos | ( | const std::string & | conversationId | ) | const |
Definition at line 2753 of file conversation_module.cpp.
References jami::emitSignal(), and JAMI_ERROR.
std::vector< uint8_t > jami::ConversationModule::conversationVCard | ( | const std::string & | conversationId | ) | const |
Definition at line 2828 of file conversation_module.cpp.
References jami::emitSignal(), and JAMI_ERROR.
|
static |
Definition at line 3216 of file conversation_module.cpp.
Referenced by loadConversations(), loadSingleConversation(), and jami::SyncModule::Impl::syncInfos().
|
static |
Definition at line 3222 of file conversation_module.cpp.
References JAMI_WARN.
std::map< std::string, std::map< std::string, std::map< std::string, std::string > > > jami::ConversationModule::convMessageStatus | ( | ) | const |
Definition at line 2219 of file conversation_module.cpp.
References jami::emitSignal().
std::map< std::string, std::map< std::string, std::string > > jami::ConversationModule::convPreferences | ( | ) | const |
Retrieve all conversation preferences to sync with other devices.
Definition at line 2816 of file conversation_module.cpp.
References jami::emitSignal().
|
static |
Definition at line 3240 of file conversation_module.cpp.
Referenced by jami::ConversationModule::Impl::Impl(), reloadRequests(), and jami::SyncModule::Impl::syncInfos().
|
static |
Definition at line 3247 of file conversation_module.cpp.
References JAMI_WARN.
uint32_t jami::ConversationModule::countInteractions | ( | const std::string & | convId, |
const std::string & | toId, | ||
const std::string & | fromId, | ||
const std::string & | authorUri | ||
) | const |
Retrieve the number of interactions from interactionId to HEAD.
convId | |
interactionId | "" for getting the whole history |
authorUri | Stop when detect author |
Definition at line 2695 of file conversation_module.cpp.
References jami::emitSignal().
std::shared_ptr< TransferManager > jami::ConversationModule::dataTransfer | ( | const std::string & | id | ) | const |
Returns related transfer manager.
id | Conversation's id |
Definition at line 2352 of file conversation_module.cpp.
Decline a conversation's request.
convId |
Definition at line 2048 of file conversation_module.cpp.
References jami::emitSignal().
bool jami::ConversationModule::downloadFile | ( | const std::string & | conversationId, |
const std::string & | interactionId, | ||
const std::string & | fileId, | ||
const std::string & | path | ||
) |
Ask conversation's members to send a file to this device.
conversationId | Related conversation |
interactionId | Related interaction |
fileId | Related fileId |
path | where to download the file |
Definition at line 2399 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::editMessage | ( | const std::string & | conversationId, |
const std::string & | newBody, | ||
const std::string & | editedId | ||
) |
Definition at line 2164 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::fetchNewCommits | ( | const std::string & | peer, |
const std::string & | deviceId, | ||
const std::string & | conversationId, | ||
const std::string & | commitId | ||
) |
Launch fetch on new commit.
peer | Who sent the notification |
deviceId | Who sent the notification |
conversationId | Related conversation |
commitId | Commit to retrieve |
Definition at line 2616 of file conversation_module.cpp.
References jami::emitSignal().
std::vector< std::map< std::string, std::string > > jami::ConversationModule::getActiveCalls | ( | const std::string & | conversationId | ) | const |
Return active calls.
convId | Which conversation to choose |
Definition at line 2981 of file conversation_module.cpp.
std::shared_ptr< Conversation > jami::ConversationModule::getConversation | ( | const std::string & | convId | ) |
Get a conversation.
convId |
Definition at line 3282 of file conversation_module.cpp.
Referenced by jami::ConversationModule::Impl::bootstrap(), jami::ConversationModule::Impl::editMessage(), jami::ConversationModule::Impl::fallbackClone(), jami::ConversationModule::Impl::fetchNewCommits(), jami::ConversationModule::Impl::handlePendingConversation(), jami::ConversationModule::Impl::removeRepository(), jami::ConversationModule::Impl::sendMessage(), and jami::ConversationModule::Impl::sendMessageNotification().
std::vector< std::map< std::string, std::string > > jami::ConversationModule::getConversationMembers | ( | const std::string & | conversationId, |
bool | includeBanned = false |
||
) | const |
Get members.
conversationId | |
includeBanned |
Definition at line 2688 of file conversation_module.cpp.
References jami::emitSignal().
Referenced by jami::ConversationModule::Impl::bootstrap(), jami::ConversationModule::Impl::fallbackClone(), and onSyncData().
std::map< std::string, std::string > jami::ConversationModule::getConversationPreferences | ( | const std::string & | conversationId, |
bool | includeCreated = false |
||
) | const |
Definition at line 2804 of file conversation_module.cpp.
References jami::emitSignal().
std::vector< std::map< std::string, std::string > > jami::ConversationModule::getConversationRequests | ( | ) | const |
Return conversation's requests.
Definition at line 1887 of file conversation_module.cpp.
References jami::emitSignal().
std::vector< std::string > jami::ConversationModule::getConversations | ( | ) | const |
Return all conversation's id (including syncing ones)
Definition at line 1859 of file conversation_module.cpp.
References jami::emitSignal().
|
noexcept |
Get related conversation with member.
uri | The member to search for |
Definition at line 1873 of file conversation_module.cpp.
Referenced by addCallHistoryMessage(), onTrustRequest(), removeContact(), jami::ConversationModule::Impl::removeRepositoryImpl(), and jami::ConversationModule::Impl::updateConvForContact().
Get Typers object for a conversation.
convId |
Definition at line 3349 of file conversation_module.cpp.
std::shared_ptr< dhtnet::ChannelSocket > jami::ConversationModule::gitSocket | ( | std::string_view | deviceId, |
std::string_view | convId | ||
) | const |
Return current git socket used for a conversation.
deviceId | Related device |
conversationId | Related conversation |
Definition at line 3292 of file conversation_module.cpp.
void jami::ConversationModule::hostConference | ( | const std::string & | conversationId, |
const std::string & | confId, | ||
const std::string & | callId, | ||
const std::vector< libjami::MediaMap > & | mediaList = {} |
||
) |
Definition at line 3110 of file conversation_module.cpp.
References JAMI_ERROR, and JAMI_WARNING.
Referenced by call().
void jami::ConversationModule::initReplay | ( | const std::string & | oldConvId, |
const std::string & | newConvId | ||
) |
Definition at line 2938 of file conversation_module.cpp.
References jami::emitSignal().
bool jami::ConversationModule::isBanned | ( | const std::string & | convId, |
const std::string & | uri | ||
) | const |
Return if a device or member is banned from a conversation.
convId | |
uri |
Definition at line 2840 of file conversation_module.cpp.
References jami::emitSignal(), and jami::ONE_TO_ONE.
bool jami::ConversationModule::isHosting | ( | const std::string & | conversationId, |
const std::string & | confId | ||
) | const |
Check if we're hosting a specific conference.
conversationId | (empty to search all conv) |
confId |
Definition at line 2961 of file conversation_module.cpp.
References jami::emitSignal().
uint32_t jami::ConversationModule::loadConversation | ( | const std::string & | conversationId, |
const std::string & | fromMessage = "" , |
||
size_t | n = 0 |
||
) |
Definition at line 2269 of file conversation_module.cpp.
References jami::emitSignal(), and jami::LogOptions::from.
uint32_t jami::ConversationModule::loadConversationMessages | ( | const std::string & | conversationId, |
const std::string & | fromMessage = "" , |
||
size_t | n = 0 |
||
) |
Load conversation's messages.
conversationId | Conversation to load |
fromMessage | |
n | Max interactions to load |
Definition at line 2231 of file conversation_module.cpp.
References jami::emitSignal(), and jami::LogOptions::from.
void jami::ConversationModule::loadConversations | ( | ) |
Refresh information about conversations.
Definition at line 1552 of file conversation_module.cpp.
References convInfos(), jami::emitSignal(), jami::fileutils::get_data_dir(), JAMI_ERROR, JAMI_LOG, JAMI_WARNING, jami::ConversationMapKeys::LAST_DISPLAYED, and jami::ONE_TO_ONE.
Referenced by ConversationModule().
uint32_t jami::ConversationModule::loadConversationUntil | ( | const std::string & | conversationId, |
const std::string & | fromMessage, | ||
const std::string & | to | ||
) |
Definition at line 2296 of file conversation_module.cpp.
References jami::emitSignal(), and jami::LogOptions::from.
Definition at line 1762 of file conversation_module.cpp.
References convInfos(), jami::emitSignal(), jami::fileutils::get_data_dir(), JAMI_LOG, and JAMI_WARNING.
uint32_t jami::ConversationModule::loadSwarmUntil | ( | const std::string & | conversationId, |
const std::string & | fromMessage, | ||
const std::string & | toMessage | ||
) |
Definition at line 2324 of file conversation_module.cpp.
References jami::emitSignal(), and jami::LogOptions::from.
void jami::ConversationModule::monitor | ( | ) |
Definition at line 1827 of file conversation_module.cpp.
References jami::emitSignal().
bool jami::ConversationModule::needsSyncingWith | ( | const std::string & | memberUri, |
const std::string & | deviceId | ||
) | const |
Check if we need to share infos with a contact.
memberUri | |
deviceId |
Definition at line 2580 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::onConversationRequest | ( | const std::string & | from, |
const Json::Value & | value | ||
) |
Called when receiving a new conversation's request.
from | Sender |
value | Conversation's request |
Definition at line 1942 of file conversation_module.cpp.
References jami::ConversationRequest::conversationId, jami::emitSignal(), jami::ConversationRequest::from, jami::ConversationRequest::isOneToOne(), JAMI_DEBUG, JAMI_WARNING, jami::ConversationRequest::received, and jami::ConversationRequest::toMap().
bool jami::ConversationModule::onFileChannelRequest | ( | const std::string & | conversationId, |
const std::string & | member, | ||
const std::string & | fileId, | ||
bool | verifyShaSum = true |
||
) | const |
Choose if we can accept channel request.
member | Member to check |
fileId | File transfer to check (needs to be waiting) |
verifyShaSum | For debug only |
Definition at line 2359 of file conversation_module.cpp.
References jami::emitSignal(), JAMI_WARNING, and jami::fileutils::sha3File().
bool jami::ConversationModule::onMessageDisplayed | ( | const std::string & | peer, |
const std::string & | conversationId, | ||
const std::string & | interactionId | ||
) |
Definition at line 2204 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::onNeedConversationRequest | ( | const std::string & | from, |
const std::string & | conversationId | ||
) |
Called when a peer needs an invite for a conversation (generally after that they received a commit notification for a conversation they don't have yet)
from | |
conversationId |
Definition at line 2007 of file conversation_module.cpp.
References JAMI_LOG.
void jami::ConversationModule::onSyncData | ( | const SyncMsg & | msg, |
const std::string & | peerId, | ||
const std::string & | deviceId | ||
) |
Detect new conversations and request from other devices.
msg | Received data |
peerId | Sender |
deviceId |
Definition at line 2440 of file conversation_module.cpp.
References addConvInfo(), cloneConversationFrom(), jami::emitSignal(), getConversationMembers(), JAMI_DEBUG, JAMI_LOG, and JAMI_WARNING.
void jami::ConversationModule::onTrustRequest | ( | const std::string & | uri, |
const std::string & | conversationId, | ||
const std::vector< uint8_t > & | payload, | ||
time_t | received | ||
) |
Called when detecting a new trust request with linked one to one.
uri | Sender's URI |
conversationId | Related conversation's id |
payload | VCard |
received | Received time |
Definition at line 1901 of file conversation_module.cpp.
References jami::ConversationRequest::conversationId, jami::emitSignal(), jami::ConversationRequest::from, getOneToOneConversation(), jami::ConversationRepository::infosFromVCard(), JAMI_DEBUG, JAMI_WARNING, jami::ConversationRequest::metadatas, jami::ConversationRequest::received, jami::ConversationRequest::toMap(), and vCard::utils::toMap().
std::string jami::ConversationModule::peerFromConversationRequest | ( | const std::string & | convId | ) | const |
Retrieve author of a conversation request.
convId | Conversation's id |
Definition at line 1996 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::reactToMessage | ( | const std::string & | conversationId, |
const std::string & | newBody, | ||
const std::string & | reactToId | ||
) |
Definition at line 2172 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::reloadRequests | ( | ) |
Reload requests from file.
Definition at line 1853 of file conversation_module.cpp.
References convRequests().
Remove one to one conversations related to a contact.
uri | Of the contact |
ban | If banned |
Definition at line 2856 of file conversation_module.cpp.
References jami::emitSignal(), getOneToOneConversation(), JAMI_DEBUG, JAMI_WARN, and jami::ONE_TO_ONE.
Remove a conversation, but not the contact.
conversationId |
Definition at line 2932 of file conversation_module.cpp.
Referenced by jami::ConversationModule::Impl::fixStructures(), and jami::ConversationModule::Impl::handlePendingConversation().
void jami::ConversationModule::removeConversationMember | ( | const std::string & | conversationId, |
const dht::InfoHash & | contactUri, | ||
bool | isDevice = false |
||
) |
Remove a member from a conversation (this will trigger a member event + new message on success)
conversationId | |
contactUri | |
isDevice |
Definition at line 2666 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::removeGitSocket | ( | std::string_view | deviceId, |
std::string_view | convId | ||
) |
Definition at line 3317 of file conversation_module.cpp.
|
static |
Definition at line 1496 of file conversation_module.cpp.
References jami::fileutils::get_data_dir(), and saveConvInfosToPath().
Referenced by jami::ConversationModule::Impl::saveConvInfos().
|
static |
Definition at line 1503 of file conversation_module.cpp.
References jami::emitSignal().
Referenced by saveConvInfos().
|
static |
Definition at line 1476 of file conversation_module.cpp.
References jami::fileutils::get_data_dir(), and saveConvRequestsToPath().
Referenced by jami::ConversationModule::Impl::fixStructures(), and jami::ConversationModule::Impl::saveConvRequests().
|
static |
Definition at line 1485 of file conversation_module.cpp.
References jami::emitSignal().
Referenced by saveConvRequests().
void jami::ConversationModule::search | ( | uint32_t | req, |
const std::string & | convId, | ||
const Filter & | filter | ||
) | const |
Search in conversations via a filter.
req | Id of the request |
convId | Leave empty to search in all conversation, else add the conversation's id |
filter | Parameters for the search |
Definition at line 2709 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::sendMessage | ( | const std::string & | conversationId, |
Json::Value && | value, | ||
const std::string & | replyTo = "" , |
||
bool | announce = true , |
||
OnCommitCb && | onCommit = {} , |
||
OnDoneCb && | cb = {} |
||
) |
Definition at line 2148 of file conversation_module.cpp.
References jami::emitSignal().
Referenced by addCallHistoryMessage(), jami::ConversationModule::Impl::editMessage(), and jami::ConversationModule::Impl::sendMessage().
void jami::ConversationModule::sendMessage | ( | const std::string & | conversationId, |
std::string | message, | ||
const std::string & | replyTo = "" , |
||
const std::string & | type = "text/plain" , |
||
bool | announce = true , |
||
OnCommitCb && | onCommit = {} , |
||
OnDoneCb && | cb = {} |
||
) |
Definition at line 2130 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::setAccountManager | ( | std::shared_ptr< AccountManager > | accountManager | ) |
Definition at line 1534 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::setConversationPreferences | ( | const std::string & | conversationId, |
const std::map< std::string, std::string > & | prefs | ||
) |
Update user's preferences (like color, notifications, etc) to be synced across devices.
conversationId | |
preferences |
Definition at line 2785 of file conversation_module.cpp.
References jami::emitSignal(), and JAMI_ERROR.
void jami::ConversationModule::setFetched | ( | const std::string & | conversationId, |
const std::string & | deviceId, | ||
const std::string & | commit | ||
) |
Notify that a peer fetched a commit.
conversationId | Related conv |
deviceId | Device who synced |
commit | HEAD synced |
Definition at line 2600 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::shutdownConnections | ( | ) |
Clear all connection (swarm channels)
Definition at line 3323 of file conversation_module.cpp.
std::string jami::ConversationModule::startConversation | ( | ConversationMode | mode = ConversationMode::INVITES_ONLY , |
const dht::InfoHash & | otherMember = {} |
||
) |
Starts a new conversation.
mode | Wanted mode |
otherMember | If needed (one to one) |
Definition at line 2064 of file conversation_module.cpp.
References _, addConvInfo(), jami::ConversationModule::Impl::bootstrapCb(), jami::emitSignal(), JAMI_ERROR, and jami::kd.
Referenced by jami::ConversationModule::Impl::cloneConversation(), and jami::ConversationModule::Impl::cloneConversationFrom().
void jami::ConversationModule::syncConversations | ( | const std::string & | peer, |
const std::string & | deviceId | ||
) |
Sync conversations with detected peer.
Definition at line 2413 of file conversation_module.cpp.
References jami::emitSignal().
void jami::ConversationModule::updateConversationInfos | ( | const std::string & | conversationId, |
const std::map< std::string, std::string > & | infos, | ||
bool | sync = true |
||
) |
Update metadatas from conversations (like title, avatar, etc)
conversationId | |
infos | |
sync | If we need to sync with others (used for tests) |
Definition at line 2733 of file conversation_module.cpp.
References jami::emitSignal(), JAMI_ERROR, and JAMI_WARNING.
bool jami::ConversationModule::updateConvForContact | ( | const std::string & | uri, |
const std::string & | oldConv, | ||
const std::string & | newConv | ||
) |
Replace linked conversation in contact's details.
uri | Of the contact |
oldConv | Current conversation |
newConv |
Definition at line 1879 of file conversation_module.cpp.
References jami::emitSignal().
Referenced by jami::ConversationModule::Impl::fixStructures(), and jami::ConversationModule::Impl::removeConversationImpl().