conversation: addToHistory is not const

remove artificial const signature for announce and addToHistory

Change-Id: I2edbffeaaaff4bbfa68122fa96ed23aa8859dc0b
This commit is contained in:
Adrien Beraud
2025-02-05 13:34:40 -05:00
parent e048f1b999
commit ad72c928c6

View File

@ -262,7 +262,7 @@ public:
bool isAdmin() const; bool isAdmin() const;
std::filesystem::path repoPath() const; std::filesystem::path repoPath() const;
void announce(const std::string& commitId, bool commitFromSelf = false) const void announce(const std::string& commitId, bool commitFromSelf = false)
{ {
std::vector<std::string> vec; std::vector<std::string> vec;
if (!commitId.empty()) if (!commitId.empty())
@ -270,7 +270,7 @@ public:
announce(vec, commitFromSelf); announce(vec, commitFromSelf);
} }
void announce(const std::vector<std::string>& commits, bool commitFromSelf = false) const void announce(const std::vector<std::string>& commits, bool commitFromSelf = false)
{ {
std::vector<ConversationCommit> convcommits; std::vector<ConversationCommit> convcommits;
convcommits.reserve(commits.size()); convcommits.reserve(commits.size());
@ -451,7 +451,7 @@ public:
} }
} }
void announce(const std::vector<std::map<std::string, std::string>>& commits, bool commitFromSelf = false) const void announce(const std::vector<std::map<std::string, std::string>>& commits, bool commitFromSelf = false)
{ {
if (!repository_) if (!repository_)
return; return;
@ -676,12 +676,12 @@ public:
/** /**
* Loaded history represents the linearized history to show for clients * Loaded history represents the linearized history to show for clients
*/ */
mutable History loadedHistory_ {}; History loadedHistory_ {};
std::vector<std::shared_ptr<libjami::SwarmMessage>> addToHistory( std::vector<std::shared_ptr<libjami::SwarmMessage>> addToHistory(
const std::vector<std::map<std::string, std::string>>& commits, const std::vector<std::map<std::string, std::string>>& commits,
bool messageReceived = false, bool messageReceived = false,
bool commitFromSelf = false, bool commitFromSelf = false,
History* history = nullptr) const; History* history = nullptr);
void handleReaction(History& history, void handleReaction(History& history,
const std::shared_ptr<libjami::SwarmMessage>& sharedCommit) const; const std::shared_ptr<libjami::SwarmMessage>& sharedCommit) const;
@ -1168,7 +1168,7 @@ std::vector<std::shared_ptr<libjami::SwarmMessage>>
Conversation::Impl::addToHistory(const std::vector<std::map<std::string, std::string>>& commits, Conversation::Impl::addToHistory(const std::vector<std::map<std::string, std::string>>& commits,
bool messageReceived, bool messageReceived,
bool commitFromSelf, bool commitFromSelf,
History* optHistory) const History* optHistory)
{ {
auto acc = account_.lock(); auto acc = account_.lock();
if (!acc) if (!acc)