Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::Conversation Class Reference

#include <conversation.h>

Inheritance diagram for jami::Conversation:
Inheritance graph
Collaboration diagram for jami::Conversation:
Collaboration graph

Classes

class  Impl
 

Public Member Functions

void addGitSocket (const DeviceId &deviceId, const std::shared_ptr< dhtnet::ChannelSocket > &socket)
 
void addMember (const std::string &contactUri, const OnDoneCb &cb={})
 Add conversation member.
 
void addSwarmChannel (std::shared_ptr< dhtnet::ChannelSocket > channel)
 Add swarm connection to the DRT.
 
void bootstrap (std::function< void()> onBootstraped, const std::vector< DeviceId > &knownDevices)
 Bootstrap swarm manager to other peers.
 
void clearCache ()
 Clear all cached messages.
 
void clearFetched ()
 Reset fetched information.
 
std::vector< std::string > commitsEndedCalls ()
 Refresh active calls.
 
void connectivityChanged ()
 If we change from one network to one another, we will need to update the state of the connections.
 
 Conversation (const std::shared_ptr< JamiAccount > &account, const std::string &conversationId="")
 
 Conversation (const std::shared_ptr< JamiAccount > &account, const std::string &remoteDevice, const std::string &conversationId)
 
 Conversation (const std::shared_ptr< JamiAccount > &account, ConversationMode mode, const std::string &otherMember="")
 
uint32_t countInteractions (const std::string &toId, const std::string &fromId="", const std::string &authorUri="") const
 Retrieve how many interactions there is from HEAD to interactionId.
 
std::vector< std::map< std::string, std::string > > currentCalls () const
 Return current detected calls.
 
std::shared_ptr< TransferManagerdataTransfer () const
 Access to transfer manager.
 
bool downloadFile (const std::string &interactionId, const std::string &fileId, const std::string &path, const std::string &member="", const std::string &deviceId="")
 Adds a file to the waiting list and ask members.
 
void erase ()
 Erase all related datas.
 
std::map< std::string, std::string > generateInvitation () const
 Generate an invitation to send to new contacts.
 
std::optional< std::map< std::string, std::string > > getCommit (const std::string &commitId) const
 Retrieve one commit.
 
std::vector< jami::DeviceIdgetDeviceIdList () const
 
std::vector< std::string > getInitialMembers () const
 One to one util, get initial members.
 
std::vector< std::map< std::string, std::string > > getMembers (bool includeInvited=false, bool includeLeft=false, bool includeBanned=false) const
 
std::shared_ptr< dhtnet::ChannelSocket > gitSocket (const DeviceId &deviceId) const
 Git operations will need a ChannelSocket for cloning/fetching commits Because libgit2 is a C library, we store the pointer in the corresponding conversation and the GitTransport will inject to libgit2 whenever needed.
 
void hasFetched (const std::string &deviceId, const std::string &commitId)
 Store information about who fetch or not.
 
bool hasSwarmChannel (const std::string &deviceId)
 Used to avoid multiple connections, we just check if we got a swarm channel with a specific device.
 
void hostConference (Json::Value &&message, OnDoneCb &&cb={})
 Host a conference in the conversation.
 
std::string id () const
 Get conversation's id.
 
std::map< std::string, std::string > infos () const
 Retrieve current infos (title, description, avatar, mode)
 
bool isBanned (const std::string &uri) const
 
bool isBootstraped () const
 Check if we're at least connected to one node.
 
bool isHosting (const std::string &confId) const
 Check if we're currently hosting this conference.
 
bool isInitialMember (const std::string &uri) const
 
bool isMember (const std::string &uri, bool includeInvited=false) const
 Test if an URI is a member.
 
bool isRemoving ()
 Check if we are removing the conversation.
 
std::string join ()
 Join a conversation.
 
std::string lastCommitId () const
 Get last commit id.
 
std::string leave ()
 Leave a conversation.
 
void loadMessages (OnLoadMessages cb, const LogOptions &options)
 Get a range of messages.
 
void loadMessages2 (const OnLoadMessages2 &cb, const LogOptions &options)
 Get a range of messages.
 
std::set< std::string > memberUris (std::string_view filter={}, const std::set< MemberRole > &filteredRoles={MemberRole::INVITED, MemberRole::LEFT, MemberRole::BANNED}) const
 
std::map< std::string, std::map< std::string, std::string > > messageStatus () const
 Retrieve last displayed and fetch status per member.
 
ConversationMode mode () const
 Get conversation's mode.
 
void monitor ()
 Print the state of the DRT linked to the conversation.
 
bool onFileChannelRequest (const std::string &member, const std::string &fileId, std::filesystem::path &path, std::string &sha3sum) const
 Choose if we can accept channel request.
 
void onMembersChanged (OnMembersChanged &&cb)
 
void onMessageStatusChanged (const std::function< void(const std::map< std::string, std::map< std::string, std::string > > &)> &cb)
 
void onNeedSocket (NeedSocketCb cb)
 Set the callback that will be called whenever a new socket will be needed.
 
std::vector< NodeIdpeersToSyncWith () const
 Get peers to sync with.
 
std::map< std::string, std::string > preferences (bool includeLastModified) const
 Retrieve current preferences (color, notification, etc)
 
bool pull (const std::string &deviceId, OnPullCb &&cb, std::string commitId="")
 Fetch and merge from peer.
 
void removeActiveConference (Json::Value &&message, OnDoneCb &&cb={})
 Announce the end of a call.
 
void removeGitSocket (const DeviceId &deviceId)
 
void removeMember (const std::string &contactUri, bool isDevice, const OnDoneCb &cb={})
 
void search (uint32_t req, const Filter &filter, const std::shared_ptr< std::atomic_int > &flag) const
 Search in the conversation via a filter.
 
void sendMessage (Json::Value &&message, const std::string &replyTo="", OnCommitCb &&onCommit={}, OnDoneCb &&cb={})
 
void sendMessage (std::string &&message, const std::string &type="text/plain", const std::string &replyTo="", OnCommitCb &&onCommit={}, OnDoneCb &&cb={})
 
void sendMessages (std::vector< Json::Value > &&messages, OnMultiDoneCb &&cb={})
 
bool setMessageDisplayed (const std::string &uri, const std::string &interactionId)
 Store last read commit (returned in getMembers)
 
void setRemovingFlag ()
 Set a conversation as removing (when loading convInfo and still not sync)
 
void shutdownConnections ()
 Stop SwarmManager, bootstrap and gitSockets.
 
void sync (const std::string &member, const std::string &deviceId, OnPullCb &&cb, std::string commitId="")
 Fetch new commits and re-ask for waiting files.
 
std::shared_ptr< Typerstypers () const
 Get Typers object.
 
void updateInfos (const std::map< std::string, std::string > &map, const OnDoneCb &cb={})
 Change repository's infos.
 
void updateMessageStatus (const std::map< std::string, std::map< std::string, std::string > > &messageStatus)
 Update fetch/read status.
 
void updatePreferences (const std::map< std::string, std::string > &map)
 Change user's preferences.
 
std::string uriFromDevice (const std::string &deviceId) const
 Retrieve the uri from a deviceId.
 
std::vector< uint8_tvCard () const
 
 ~Conversation ()
 

Detailed Description

Definition at line 148 of file conversation.h.

Constructor & Destructor Documentation

◆ Conversation() [1/3]

jami::Conversation::Conversation ( const std::shared_ptr< JamiAccount > &  account,
ConversationMode  mode,
const std::string &  otherMember = "" 
)

Definition at line 1288 of file conversation.cpp.

◆ Conversation() [2/3]

jami::Conversation::Conversation ( const std::shared_ptr< JamiAccount > &  account,
const std::string &  conversationId = "" 
)

Definition at line 1294 of file conversation.cpp.

◆ Conversation() [3/3]

jami::Conversation::Conversation ( const std::shared_ptr< JamiAccount > &  account,
const std::string &  remoteDevice,
const std::string &  conversationId 
)

Definition at line 1299 of file conversation.cpp.

◆ ~Conversation()

jami::Conversation::~Conversation ( )

Definition at line 1305 of file conversation.cpp.

Member Function Documentation

◆ addGitSocket()

void jami::Conversation::addGitSocket ( const DeviceId deviceId,
const std::shared_ptr< dhtnet::ChannelSocket > &  socket 
)

Definition at line 1378 of file conversation.cpp.

◆ addMember()

void jami::Conversation::addMember ( const std::string &  contactUri,
const OnDoneCb cb = {} 
)

Add conversation member.

Parameters
uriMember to add
cbOn done cb

Definition at line 1314 of file conversation.cpp.

References jami::emitSignal(), getInitialMembers(), isBanned(), isMember(), JAMI_WARN, mode(), and jami::ONE_TO_ONE.

Here is the call graph for this function:

◆ addSwarmChannel()

void jami::Conversation::addSwarmChannel ( std::shared_ptr< dhtnet::ChannelSocket >  channel)

Add swarm connection to the DRT.

Parameters
channelRelated channel

Definition at line 2531 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ bootstrap()

void jami::Conversation::bootstrap ( std::function< void()>  onBootstraped,
const std::vector< DeviceId > &  knownDevices 
)

Bootstrap swarm manager to other peers.

Parameters
onBootstrapedCallback called when connection is successfully established
knownDevicesList of account's known devices

Definition at line 2417 of file conversation.cpp.

References jami::emitSignal(), isBanned(), and JAMI_DEBUG.

Here is the call graph for this function:

◆ clearCache()

void jami::Conversation::clearCache ( )

Clear all cached messages.

Definition at line 1727 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ clearFetched()

void jami::Conversation::clearFetched ( )

Reset fetched information.

◆ commitsEndedCalls()

std::vector< std::string > jami::Conversation::commitsEndedCalls ( )

Refresh active calls.

Note
: If the host crash during a call, when initializing, we need to update and commit all the crashed calls
Returns
Commits added

Definition at line 2495 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ connectivityChanged()

void jami::Conversation::connectivityChanged ( )

If we change from one network to one another, we will need to update the state of the connections.

Definition at line 1402 of file conversation.cpp.

◆ countInteractions()

uint32_t jami::Conversation::countInteractions ( const std::string &  toId,
const std::string &  fromId = "",
const std::string &  authorUri = "" 
) const

Retrieve how many interactions there is from HEAD to interactionId.

Parameters
toId"" for getting the whole history
fromId"" => HEAD
authorURIauthor to stop counting
Returns
number of interactions since interactionId

Definition at line 2552 of file conversation.cpp.

References jami::emitSignal(), and jami::LogOptions::to.

Here is the call graph for this function:

◆ currentCalls()

std::vector< std::map< std::string, std::string > > jami::Conversation::currentCalls ( ) const

Return current detected calls.

Returns
a vector of map with the following keys: "id", "uri", "device"

Definition at line 2714 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ dataTransfer()

std::shared_ptr< TransferManager > jami::Conversation::dataTransfer ( ) const

Access to transfer manager.

Definition at line 2096 of file conversation.cpp.

Referenced by onFileChannelRequest().

◆ downloadFile()

bool jami::Conversation::downloadFile ( const std::string &  interactionId,
const std::string &  fileId,
const std::string &  path,
const std::string &  member = "",
const std::string &  deviceId = "" 
)

Adds a file to the waiting list and ask members.

Parameters
interactionIdRelated interaction id
fileIdRelated id
pathDestination
memberMember if we know from who to pull file
deviceIdDevice if we know from who to pull file
Returns
id of the file

Definition at line 2133 of file conversation.cpp.

References jami::emitSignal(), getCommit(), and JAMI_ERROR.

Here is the call graph for this function:

◆ erase()

void jami::Conversation::erase ( )

Erase all related datas.

Definition at line 1989 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ generateInvitation()

std::map< std::string, std::string > jami::Conversation::generateInvitation ( ) const

Generate an invitation to send to new contacts.

Returns
the invite to send

Definition at line 1952 of file conversation.cpp.

References jami::ConversationMapKeys::CONVERSATIONID, jami::emitSignal(), id(), infos(), JAMI_WARNING, jami::ConversationMapKeys::METADATAS, and jami::json::toString().

Here is the call graph for this function:

◆ getCommit()

std::optional< std::map< std::string, std::string > > jami::Conversation::getCommit ( const std::string &  commitId) const

Retrieve one commit.

Parameters
commitId
Returns
The commit if found

Definition at line 1693 of file conversation.cpp.

References jami::emitSignal().

Referenced by downloadFile(), and onFileChannelRequest().

Here is the call graph for this function:

◆ getDeviceIdList()

std::vector< jami::DeviceId > jami::Conversation::getDeviceIdList ( ) const
Returns
getAllNodes() Nodes that are linked to the conversation

Definition at line 1409 of file conversation.cpp.

◆ getInitialMembers()

std::vector< std::string > jami::Conversation::getInitialMembers ( ) const

One to one util, get initial members.

Returns
initial members

Definition at line 2006 of file conversation.cpp.

Referenced by addMember(), isInitialMember(), and isMember().

◆ getMembers()

std::vector< std::map< std::string, std::string > > jami::Conversation::getMembers ( bool  includeInvited = false,
bool  includeLeft = false,
bool  includeBanned = false 
) const
Parameters
includeInvitedIf we want invited members
includeLeftIf we want left members
includeBannedIf we want banned members
Returns
a vector of member details: { "uri":"xxx", "role":"member/admin/invited", "lastDisplayed":"id" ... }

Definition at line 1537 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ gitSocket()

std::shared_ptr< dhtnet::ChannelSocket > jami::Conversation::gitSocket ( const DeviceId deviceId) const

Git operations will need a ChannelSocket for cloning/fetching commits Because libgit2 is a C library, we store the pointer in the corresponding conversation and the GitTransport will inject to libgit2 whenever needed.

Definition at line 1372 of file conversation.cpp.

◆ hasFetched()

void jami::Conversation::hasFetched ( const std::string &  deviceId,
const std::string &  commitId 
)

Store information about who fetch or not.

This simplify sync (sync when a device without the last fetch is detected)

Parameters
deviceId
commitId

Definition at line 2198 of file conversation.cpp.

References jami::emitSignal(), and libjami::Account::SENT.

Here is the call graph for this function:

◆ hasSwarmChannel()

bool jami::Conversation::hasSwarmChannel ( const std::string &  deviceId)

Used to avoid multiple connections, we just check if we got a swarm channel with a specific device.

Parameters
deviceId

Definition at line 1421 of file conversation.cpp.

◆ hostConference()

void jami::Conversation::hostConference ( Json::Value &&  message,
OnDoneCb &&  cb = {} 
)

Host a conference in the conversation.

Note
the message must have "confId"
Update hostedCalls_ and commit in the conversation
Parameters
messagemessage to commit
cbcallback triggered when committed

Definition at line 2665 of file conversation.cpp.

References jami::emitSignal(), JAMI_ERROR, and sendMessage().

Here is the call graph for this function:

◆ id()

std::string jami::Conversation::id ( ) const

Get conversation's id.

Returns
conversation Id

Definition at line 1308 of file conversation.cpp.

Referenced by generateInvitation(), search(), and jami::ConversationModule::Impl::sendMessageNotification().

◆ infos()

std::map< std::string, std::string > jami::Conversation::infos ( ) const

Retrieve current infos (title, description, avatar, mode)

Returns
infos

Definition at line 2037 of file conversation.cpp.

Referenced by generateInvitation(), and isHosting().

◆ isBanned()

bool jami::Conversation::isBanned ( const std::string &  uri) const

Definition at line 1625 of file conversation.cpp.

Referenced by addMember(), and bootstrap().

◆ isBootstraped()

bool jami::Conversation::isBootstraped ( ) const

Check if we're at least connected to one node.

Returns
if the DRT is connected

Definition at line 1565 of file conversation.cpp.

References jami::emitSignal().

Referenced by jami::ConversationModule::Impl::sendMessageNotification().

Here is the call graph for this function:

◆ isHosting()

bool jami::Conversation::isHosting ( const std::string &  confId) const

Check if we're currently hosting this conference.

Parameters
confId
Returns
true if hosting

Definition at line 2684 of file conversation.cpp.

References jami::emitSignal(), and infos().

Here is the call graph for this function:

◆ isInitialMember()

bool jami::Conversation::isInitialMember ( const std::string &  uri) const

Definition at line 2012 of file conversation.cpp.

References getInitialMembers().

Here is the call graph for this function:

◆ isMember()

bool jami::Conversation::isMember ( const std::string &  uri,
bool  includeInvited = false 
) const

Test if an URI is a member.

Parameters
uriURI to test
Returns
true if uri is a member

Definition at line 1590 of file conversation.cpp.

References jami::emitSignal(), getInitialMembers(), JAMI_WARNING, mode(), and jami::ONE_TO_ONE.

Referenced by addMember(), and onFileChannelRequest().

Here is the call graph for this function:

◆ isRemoving()

bool jami::Conversation::isRemoving ( )

Check if we are removing the conversation.

Returns
true if left the room

Definition at line 1983 of file conversation.cpp.

◆ join()

std::string jami::Conversation::join ( )

Join a conversation.

Returns
commit id to send

Definition at line 1584 of file conversation.cpp.

◆ lastCommitId()

std::string jami::Conversation::lastCommitId ( ) const

Get last commit id.

Returns
last commit id

Definition at line 1741 of file conversation.cpp.

References jami::emitSignal(), and jami::LogOptions::nbOfCommits.

Referenced by jami::ConversationModule::Impl::sendMessageNotification().

Here is the call graph for this function:

◆ leave()

std::string jami::Conversation::leave ( )

Leave a conversation.

Returns
commit id to send

Definition at line 1969 of file conversation.cpp.

References jami::emitSignal(), and setRemovingFlag().

Here is the call graph for this function:

◆ loadMessages()

void jami::Conversation::loadMessages ( OnLoadMessages  cb,
const LogOptions options 
)

Get a range of messages.

Parameters
cbThe callback when loaded
optionsThe log options

Definition at line 1702 of file conversation.cpp.

References jami::emitSignal().

Referenced by jami::Conversation::Impl::pull().

Here is the call graph for this function:

◆ loadMessages2()

void jami::Conversation::loadMessages2 ( const OnLoadMessages2 cb,
const LogOptions options 
)

Get a range of messages.

Parameters
cbThe callback when loaded
optionsThe log options

Definition at line 1714 of file conversation.cpp.

References jami::emitSignal().

Referenced by jami::Conversation::Impl::updateStatus().

Here is the call graph for this function:

◆ memberUris()

std::set< std::string > jami::Conversation::memberUris ( std::string_view  filter = {},
const std::set< MemberRole > &  filteredRoles = {MemberRole::INVITEDMemberRole::LEFTMemberRole::BANNED} 
) const
Parameters
filterIf we want to remove one member
filteredRolesIf we want to ignore some roles
Returns
members' uris

Definition at line 1543 of file conversation.cpp.

References jami::emitSignal().

Referenced by onMembersChanged(), and jami::ConversationModule::Impl::sendMessageNotification().

Here is the call graph for this function:

◆ messageStatus()

std::map< std::string, std::map< std::string, std::string > > jami::Conversation::messageStatus ( ) const

Retrieve last displayed and fetch status per member.

Returns
A map with the following structure: {uri, { {"fetch", "commitId"}, {"fetched_ts", "timestamp"}, {"read", "commitId"}, {"read_ts", "timestamp"} } }

Definition at line 2289 of file conversation.cpp.

References jami::emitSignal().

Referenced by updateMessageStatus().

Here is the call graph for this function:

◆ mode()

ConversationMode jami::Conversation::mode ( ) const

Get conversation's mode.

Returns
the mode

Definition at line 2000 of file conversation.cpp.

Referenced by addMember(), and isMember().

◆ monitor()

void jami::Conversation::monitor ( )

Print the state of the DRT linked to the conversation.

Definition at line 1578 of file conversation.cpp.

◆ onFileChannelRequest()

bool jami::Conversation::onFileChannelRequest ( const std::string &  member,
const std::string &  fileId,
std::filesystem::path &  path,
std::string &  sha3sum 
) const

Choose if we can accept channel request.

Parameters
membermember to check
fileIdfile transfer to check (needs to be waiting)
verifyShaSumfor debug only
Returns
if we accept the channel request

Definition at line 2102 of file conversation.cpp.

References dataTransfer(), jami::emitSignal(), getCommit(), isMember(), and JAMI_WARNING.

Here is the call graph for this function:

◆ onMembersChanged()

void jami::Conversation::onMembersChanged ( OnMembersChanged &&  cb)

Definition at line 2511 of file conversation.cpp.

References jami::emitSignal(), and memberUris().

Here is the call graph for this function:

◆ onMessageStatusChanged()

void jami::Conversation::onMessageStatusChanged ( const std::function< void(const std::map< std::string, std::map< std::string, std::string > > &)> &  cb)

Definition at line 2321 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ onNeedSocket()

void jami::Conversation::onNeedSocket ( NeedSocketCb  cb)

Set the callback that will be called whenever a new socket will be needed.

Parameters
cb

Definition at line 2521 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ peersToSyncWith()

std::vector< NodeId > jami::Conversation::peersToSyncWith ( ) const

Get peers to sync with.

This is mostly managed by the DRT

Returns
some mobile nodes and all connected nodes

Definition at line 1549 of file conversation.cpp.

References _, and jami::emitSignal().

Referenced by jami::ConversationModule::Impl::sendMessageNotification().

Here is the call graph for this function:

◆ preferences()

std::map< std::string, std::string > jami::Conversation::preferences ( bool  includeLastModified) const

Retrieve current preferences (color, notification, etc)

Parameters
includeLastModifiedIf we want to know when the preferences were modified
Returns
preferences

Definition at line 2069 of file conversation.cpp.

References jami::emitSignal(), jami::LAST_MODIFIED, jami::fileutils::lastWriteTimeInSeconds(), jami::fileutils::loadFile(), and preferences().

Referenced by preferences().

Here is the call graph for this function:

◆ pull()

bool jami::Conversation::pull ( const std::string &  deviceId,
OnPullCb &&  cb,
std::string  commitId = "" 
)

Fetch and merge from peer.

Parameters
deviceIdPeer device
cbOn pulled callback
commitIdCommit id that triggered this fetch
Returns
true if callback will be called later

Definition at line 1810 of file conversation.cpp.

References jami::emitSignal(), and JAMI_DEBUG.

Referenced by sync().

Here is the call graph for this function:

◆ removeActiveConference()

void jami::Conversation::removeActiveConference ( Json::Value &&  message,
OnDoneCb &&  cb = {} 
)

Announce the end of a call.

Note
the message must have "confId"
called when conference is finished
Parameters
messagemessage to commit
cbcallback triggered when committed

Definition at line 2694 of file conversation.cpp.

References jami::emitSignal(), JAMI_ERROR, and sendMessage().

Here is the call graph for this function:

◆ removeGitSocket()

void jami::Conversation::removeGitSocket ( const DeviceId deviceId)

Definition at line 1385 of file conversation.cpp.

◆ removeMember()

void jami::Conversation::removeMember ( const std::string &  contactUri,
bool  isDevice,
const OnDoneCb cb = {} 
)

Definition at line 1467 of file conversation.cpp.

References jami::ADMIN, jami::emitSignal(), jami::INVITED, JAMI_WARN, and jami::MEMBER.

Here is the call graph for this function:

◆ search()

void jami::Conversation::search ( uint32_t  req,
const Filter filter,
const std::shared_ptr< std::atomic_int > &  flag 
) const

Search in the conversation via a filter.

Parameters
reqId of the request
filterParameters for the search
flagTo check when search is finished
Note
triggers messagesFound

Definition at line 2569 of file conversation.cpp.

References jami::Break, jami::emitSignal(), id(), jami::Ok, std::regex_search(), and jami::Skip.

Here is the call graph for this function:

◆ sendMessage() [1/2]

void jami::Conversation::sendMessage ( Json::Value &&  message,
const std::string &  replyTo = "",
OnCommitCb &&  onCommit = {},
OnDoneCb &&  cb = {} 
)

Definition at line 1644 of file conversation.cpp.

References jami::emitSignal(), and JAMI_ERR.

Here is the call graph for this function:

◆ sendMessage() [2/2]

void jami::Conversation::sendMessage ( std::string &&  message,
const std::string &  type = "text/plain",
const std::string &  replyTo = "",
OnCommitCb &&  onCommit = {},
OnDoneCb &&  cb = {} 
)

Definition at line 1631 of file conversation.cpp.

References jami::emitSignal(), and sendMessage().

Referenced by hostConference(), removeActiveConference(), and sendMessage().

Here is the call graph for this function:

◆ sendMessages()

void jami::Conversation::sendMessages ( std::vector< Json::Value > &&  messages,
OnMultiDoneCb &&  cb = {} 
)

Definition at line 1673 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ setMessageDisplayed()

bool jami::Conversation::setMessageDisplayed ( const std::string &  uri,
const std::string &  interactionId 
)

Store last read commit (returned in getMembers)

Parameters
uriOf the member
interactionIdLast interaction displayed
Returns
if updated

Definition at line 2274 of file conversation.cpp.

References libjami::Account::DISPLAYED, and jami::emitSignal().

Here is the call graph for this function:

◆ setRemovingFlag()

void jami::Conversation::setRemovingFlag ( )

Set a conversation as removing (when loading convInfo and still not sync)

Todo:
: not a big fan to see this here. can be set in the constructor cause it's used by jamiaccount when loading conversations

Definition at line 1977 of file conversation.cpp.

Referenced by leave().

◆ shutdownConnections()

void jami::Conversation::shutdownConnections ( )

Stop SwarmManager, bootstrap and gitSockets.

Definition at line 1391 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ sync()

void jami::Conversation::sync ( const std::string &  member,
const std::string &  deviceId,
OnPullCb &&  cb,
std::string  commitId = "" 
)

Fetch new commits and re-ask for waiting files.

Parameters
member
deviceId
cbcf pull()
commitIdcf pull()

Definition at line 1936 of file conversation.cpp.

References jami::emitSignal(), and pull().

Here is the call graph for this function:

◆ typers()

std::shared_ptr< Typers > jami::Conversation::typers ( ) const

Get Typers object.

Returns
Typers object

Definition at line 1415 of file conversation.cpp.

◆ updateInfos()

void jami::Conversation::updateInfos ( const std::map< std::string, std::string > &  map,
const OnDoneCb cb = {} 
)

Change repository's infos.

Parameters
mapNew infos (supported keys: title, description, avatar)
cbOn commited

Definition at line 2019 of file conversation.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ updateMessageStatus()

void jami::Conversation::updateMessageStatus ( const std::map< std::string, std::map< std::string, std::string > > &  messageStatus)

Update fetch/read status.

Parameters
messageStatusA map with the following structure: {uri, { {"fetch", "commitId"}, {"fetched_ts", "timestamp"}, {"read", "commitId"}, {"read_ts", "timestamp"} } }

Definition at line 2296 of file conversation.cpp.

References libjami::Account::DISPLAYED, jami::emitSignal(), messageStatus(), and libjami::Account::SENT.

Here is the call graph for this function:

◆ updatePreferences()

void jami::Conversation::updatePreferences ( const std::map< std::string, std::string > &  map)

Change user's preferences.

Parameters
mapNew preferences

Definition at line 2043 of file conversation.cpp.

References jami::emitSignal(), jami::LAST_MODIFIED, and jami::fileutils::lastWriteTimeInSeconds().

Here is the call graph for this function:

◆ uriFromDevice()

std::string jami::Conversation::uriFromDevice ( const std::string &  deviceId) const

Retrieve the uri from a deviceId.

Note
used by swarm manager (peersToSyncWith)
Parameters
deviceId
Returns
corresponding issuer

Definition at line 1572 of file conversation.cpp.

Referenced by jami::ConversationModule::Impl::sendMessageNotification().

◆ vCard()

std::vector< uint8_t > jami::Conversation::vCard ( ) const

Definition at line 2086 of file conversation.cpp.

References jami::fileutils::loadFile().

Here is the call graph for this function:

The documentation for this class was generated from the following files: