diff --git a/CMakeLists.txt b/CMakeLists.txt
index f536e45a9..d980f5856 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16)
project(jami-core
- VERSION 13.11.0
+ VERSION 14.0.0
LANGUAGES C CXX)
set(PACKAGE_NAME "Jami Daemon")
set (CMAKE_CXX_STANDARD 17)
diff --git a/bin/dbus/cx.ring.Ring.ConfigurationManager.xml b/bin/dbus/cx.ring.Ring.ConfigurationManager.xml
index c1643d2d8..e7f7aa897 100644
--- a/bin/dbus/cx.ring.Ring.ConfigurationManager.xml
+++ b/bin/dbus/cx.ring.Ring.ConfigurationManager.xml
@@ -1848,9 +1848,21 @@
-
-
-
+
+
+
+ Load messages from a conversation
+
+
+
+
+
+
+
+
+
+
+
Load messages from a conversation
@@ -1873,6 +1885,15 @@
+
+
+
+ Clear interactions loaded from daemon. Used by dbus to reload interactions
+
+
+
+
+
@@ -1992,9 +2013,37 @@
-
-
-
+
+
+
+ Notify clients when a conversation is loaded
+
+
+
+ Id of the related loadConversationMessages's request
+
+
+
+
+ Account id related
+
+
+
+
+ Conversation id
+
+
+
+
+
+ Messages of the conversation
+
+
+
+
+
+
+
Notify clients when messages matching a regex are found
@@ -2043,9 +2092,111 @@
-
-
-
+
+
+
+ Notify clients when a conversation receives a new message
+
+
+
+ Account id related
+
+
+
+
+ Conversation id
+
+
+
+
+
+ The new message
+
+
+
+
+
+
+
+ Notify clients when a conversation receives a new message
+
+
+
+ Account id related
+
+
+
+
+ Conversation id
+
+
+
+
+
+ The new message
+
+
+
+
+
+
+
+ Notify clients when a conversation receives a new message
+
+
+
+ Account id related
+
+
+
+
+ Conversation id
+
+
+
+
+ Conversation id
+
+
+
+
+
+ The new message
+
+
+
+
+
+
+
+ Notify clients when a conversation receives a new message
+
+
+
+ Account id related
+
+
+
+
+ Conversation id
+
+
+
+
+ Message's id
+
+
+
+
+ Reaction's id
+
+
+
+
+
+
+
+
Notify clients when a conversation got its profile changed.
diff --git a/bin/dbus/dbusconfigurationmanager.hpp b/bin/dbus/dbusconfigurationmanager.hpp
index 8fddb461b..638d08fad 100644
--- a/bin/dbus/dbusconfigurationmanager.hpp
+++ b/bin/dbus/dbusconfigurationmanager.hpp
@@ -29,6 +29,7 @@
class DBusConfigurationManager : public sdbus::AdaptorInterfaces
{
public:
+ using DBusSwarmMessage = sdbus::Struct, std::vector>, std::vector>>;
DBusConfigurationManager(sdbus::IConnection& connection)
: AdaptorInterfaces(connection, "/cx/ring/Ring/ConfigurationManager")
{
@@ -931,6 +932,15 @@ public:
return libjami::loadConversationMessages(accountId, conversationId, fromMessage, n);
}
+ uint32_t
+ loadConversation(const std::string& accountId,
+ const std::string& conversationId,
+ const std::string& fromMessage,
+ const uint32_t& n)
+ {
+ return libjami::loadConversation(accountId, conversationId, fromMessage, n);
+ }
+
uint32_t
loadConversationUntil(const std::string& accountId,
const std::string& conversationId,
@@ -950,6 +960,13 @@ public:
return libjami::countInteractions(accountId, conversationId, toId, fromId, authorUri);
}
+ void
+ clearCache(const std::string& accountId,
+ const std::string& conversationId)
+ {
+ return libjami::clearCache(accountId, conversationId);
+ }
+
uint32_t
searchConversation(const std::string& accountId,
const std::string& conversationId,
@@ -1122,10 +1139,30 @@ private:
const std::map convEvHandlers = {
exportable_serialized_callback(
std::bind(&DBusConfigurationManager::emitConversationLoaded, this, _1, _2, _3, _4)),
+ exportable_serialized_callback([this](const uint32_t& id, const std::string& account_id, const std::string& conversation_id, const std::vector& messages) {
+ std::vector msgList;
+ for (const auto& message: messages) {
+ DBusSwarmMessage msg {message.id, message.type, message.linearizedParent, message.body, message.reactions, message.editions};
+ msgList.push_back(msg);
+ }
+ DBusConfigurationManager::emitSwarmLoaded(id, account_id, conversation_id, msgList);
+ }),
exportable_serialized_callback(
std::bind(&DBusConfigurationManager::emitMessagesFound, this, _1, _2, _3, _4)),
exportable_serialized_callback(
std::bind(&DBusConfigurationManager::emitMessageReceived, this, _1, _2, _3)),
+ exportable_serialized_callback([this](const std::string& account_id, const std::string& conversation_id, const libjami::SwarmMessage& message) {
+ DBusSwarmMessage msg {message.id, message.type, message.linearizedParent, message.body, message.reactions, message.editions};
+ DBusConfigurationManager::emitSwarmMessageReceived(account_id, conversation_id, msg);
+ }),
+ exportable_serialized_callback([this](const std::string& account_id, const std::string& conversation_id, const libjami::SwarmMessage& message) {
+ DBusSwarmMessage msg {message.id, message.type, message.linearizedParent, message.body, message.reactions, message.editions};
+ DBusConfigurationManager::emitSwarmMessageUpdated(account_id, conversation_id, msg);
+ }),
+ exportable_serialized_callback(
+ std::bind(&DBusConfigurationManager::emitReactionAdded, this, _1, _2, _3, _4)),
+ exportable_serialized_callback(
+ std::bind(&DBusConfigurationManager::emitReactionRemoved, this, _1, _2, _3, _4)),
exportable_serialized_callback(
std::bind(&DBusConfigurationManager::emitConversationProfileUpdated, this, _1, _2, _3)),
exportable_serialized_callback(
diff --git a/bin/jni/conversation.i b/bin/jni/conversation.i
index 30c10efde..fdecb07e2 100644
--- a/bin/jni/conversation.i
+++ b/bin/jni/conversation.i
@@ -26,8 +26,13 @@ class ConversationCallback {
public:
virtual ~ConversationCallback(){}
virtual void conversationLoaded(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector> /*messages*/){}
+ virtual void swarmLoaded(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector /*messages*/){}
virtual void messagesFound(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector> /*messages*/){}
virtual void messageReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*message*/){}
+ virtual void swarmMessageReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, const libjami::SwarmMessage& /*message*/){}
+ virtual void swarmMessageUpdated(const std::string& /*accountId*/, const std::string& /* conversationId */, const libjami::SwarmMessage& /*message*/){}
+ virtual void reactionAdded(const std::string& /*accountId*/, const std::string& /* conversationId */, const std::string& /* messageId */, std::map /*reaction*/){}
+ virtual void reactionRemoved(const std::string& /*accountId*/, const std::string& /* conversationId */, const std::string& /* messageId */, const std::string& /* reactionId */){}
virtual void conversationProfileUpdated(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*profile*/){}
virtual void conversationRequestReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*metadatas*/){}
virtual void conversationRequestDeclined(const std::string& /*accountId*/, const std::string& /* conversationId */){}
@@ -43,6 +48,16 @@ public:
namespace libjami {
+struct SwarmMessage
+{
+ std::string id;
+ std::string type;
+ std::string linearizedParent;
+ std::map body;
+ std::vector> reactions;
+ std::vector> editions;
+};
+
// Conversation management
std::string startConversation(const std::string& accountId);
void acceptConversationRequest(const std::string& accountId, const std::string& conversationId);
@@ -64,8 +79,10 @@ namespace libjami {
// Message send/load
void sendMessage(const std::string& accountId, const std::string& conversationId, const std::string& message, const std::string& replyTo, const int32_t& flag);
uint32_t loadConversationMessages(const std::string& accountId, const std::string& conversationId, const std::string& fromMessage, size_t n);
+ uint32_t loadConversation(const std::string& accountId, const std::string& conversationId, const std::string& fromMessage, size_t n);
uint32_t loadConversationUntil(const std::string& accountId, const std::string& conversationId, const std::string& fromMessage, const std::string& toMessage);
uint32_t countInteractions(const std::string& accountId, const std::string& conversationId, const std::string& toId, const std::string& fromId, const std::string& authorUri);
+ void clearCache(const std::string& accountId, const std::string& conversationId);
uint32_t searchConversation(const std::string& accountId,
const std::string& conversationId,
const std::string& author,
@@ -82,8 +99,13 @@ class ConversationCallback {
public:
virtual ~ConversationCallback(){}
virtual void conversationLoaded(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector> /*messages*/){}
+ virtual void swarmLoaded(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector /*messages*/){}
virtual void messagesFound(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector> /*messages*/){}
virtual void messageReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*message*/){}
+ virtual void swarmMessageReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, const libjami::SwarmMessage& /*message*/){}
+ virtual void swarmMessageUpdated(const std::string& /*accountId*/, const std::string& /* conversationId */, const libjami::SwarmMessage& /*message*/){}
+ virtual void reactionAdded(const std::string& /*accountId*/, const std::string& /* conversationId */, const std::string& /* messageId */, std::map /*messageId*/){}
+ virtual void reactionRemoved(const std::string& /*accountId*/, const std::string& /* conversationId */, const std::string& /* messageId */, const std::string& /* reactionId */){}
virtual void conversationProfileUpdated(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*profile*/){}
virtual void conversationRequestReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*metadatas*/){}
virtual void conversationRequestDeclined(const std::string& /*accountId*/, const std::string& /* conversationId */){}
diff --git a/bin/jni/jni_interface.i b/bin/jni/jni_interface.i
index 6b549324d..9e54cda75 100644
--- a/bin/jni/jni_interface.i
+++ b/bin/jni/jni_interface.i
@@ -325,8 +325,13 @@ void init(ConfigurationCallback* confM, Callback* callM, PresenceCallback* presM
const std::map conversationHandlers = {
exportable_callback(bind(&ConversationCallback::conversationLoaded, convM, _1, _2, _3, _4)),
+ exportable_callback(bind(&ConversationCallback::swarmLoaded, convM, _1, _2, _3, _4)),
exportable_callback(bind(&ConversationCallback::messagesFound, convM, _1, _2, _3, _4)),
exportable_callback(bind(&ConversationCallback::messageReceived, convM, _1, _2, _3)),
+ exportable_callback(bind(&ConversationCallback::swarmMessageReceived, convM, _1, _2, _3)),
+ exportable_callback(bind(&ConversationCallback::swarmMessageUpdated, convM, _1, _2, _3)),
+ exportable_callback(bind(&ConversationCallback::reactionAdded, convM, _1, _2, _3, _4)),
+ exportable_callback(bind(&ConversationCallback::reactionRemoved, convM, _1, _2, _3, _4)),
exportable_callback(bind(&ConversationCallback::conversationProfileUpdated, convM, _1, _2, _3)),
exportable_callback(bind(&ConversationCallback::conversationRequestReceived, convM, _1, _2, _3)),
exportable_callback(bind(&ConversationCallback::conversationRequestDeclined, convM, _1, _2)),
diff --git a/bin/nodejs/callback.h b/bin/nodejs/callback.h
index 7b2a4d69b..154d6d77d 100644
--- a/bin/nodejs/callback.h
+++ b/bin/nodejs/callback.h
@@ -31,8 +31,10 @@ Persistent incomingMessageCb;
Persistent incomingCallCb;
Persistent incomingCallWithMediaCb;
Persistent conversationLoadedCb;
+Persistent swarmLoadedCb;
Persistent messagesFoundCb;
Persistent messageReceivedCb;
+Persistent swarmMessageReceivedCb;
Persistent conversationProfileUpdatedCb;
Persistent conversationRequestReceivedCb;
Persistent conversationRequestDeclinedCb;
@@ -99,10 +101,14 @@ getPresistentCb(std::string_view signal)
return &incomingCallWithMediaCb;
else if (signal == "ConversationLoaded")
return &conversationLoadedCb;
+ else if (signal == "SwarmLoaded")
+ return &swarmLoadedCb;
else if (signal == "MessagesFound")
return &messagesFoundCb;
else if (signal == "MessageReceived")
return &messageReceivedCb;
+ else if (signal == "SwarmMessageReceived")
+ return &swarmMessageReceivedCb;
else if (signal == "ConversationProfileUpdated")
return &conversationProfileUpdatedCb;
else if (signal == "ConversationReady")
diff --git a/bin/nodejs/conversation.i b/bin/nodejs/conversation.i
index 803fcd3b2..6673a8c4e 100644
--- a/bin/nodejs/conversation.i
+++ b/bin/nodejs/conversation.i
@@ -26,8 +26,13 @@ class ConversationCallback {
public:
virtual ~ConversationCallback(){}
virtual void conversationLoaded(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector> /*messages*/){}
+ virtual void swarmLoaded(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector /*messages*/){}
virtual void messagesFound(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector> /*messages*/){}
virtual void messageReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*message*/){}
+ virtual void swarmMessageReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, const libjami::SwarmMessage& /*message*/){}
+ virtual void swarmMessageUpdated(const std::string& /*accountId*/, const std::string& /* conversationId */, const libjami::SwarmMessage& /*message*/){}
+ virtual void reactionAdded(const std::string& /*accountId*/, const std::string& /* conversationId */, const std::string& /* messageId */, std::map /*reaction*/){}
+ virtual void reactionRemoved(const std::string& /*accountId*/, const std::string& /* conversationId */, const std::string& /* messageId */, const std::string& /* reactionId */){}
virtual void conversationProfileUpdated(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*profile*/){}
virtual void conversationRequestReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*metadatas*/){}
virtual void conversationRequestDeclined(const std::string& /*accountId*/, const std::string& /* conversationId */){}
@@ -43,6 +48,16 @@ public:
namespace libjami {
+struct SwarmMessage
+{
+ std::string id;
+ std::string type;
+ std::string linearizedParent;
+ std::map body;
+ std::vector> reactions;
+ std::vector> editions;
+};
+
// Conversation management
std::string startConversation(const std::string& accountId);
void acceptConversationRequest(const std::string& accountId, const std::string& conversationId);
@@ -64,7 +79,9 @@ namespace libjami {
// Message send/load
void sendMessage(const std::string& accountId, const std::string& conversationId, const std::string& message, const std::string& replyTo, const int32_t& flag);
uint32_t loadConversationMessages(const std::string& accountId, const std::string& conversationId, const std::string& fromMessage, size_t n);
+ uint32_t loadConversation(const std::string& accountId, const std::string& conversationId, const std::string& fromMessage, size_t n);
uint32_t loadConversationUntil(const std::string& accountId, const std::string& conversationId, const std::string& fromMessage, const std::string& toMessage);
+ void clearCache(const std::string& accountId, const std::string& conversationId);
uint32_t countInteractions(const std::string& accountId, const std::string& conversationId, const std::string& toId, const std::string& fromId, const std::string& authorUri);
uint32_t searchConversation(const std::string& accountId,
const std::string& conversationId,
@@ -83,8 +100,13 @@ class ConversationCallback {
public:
virtual ~ConversationCallback(){}
virtual void conversationLoaded(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector> /*messages*/){}
+ virtual void swarmLoaded(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector /*messages*/){}
virtual void messagesFound(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector> /*messages*/){}
virtual void messageReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*message*/){}
+ virtual void swarmMessageReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, const libjami::SwarmMessage& /*message*/){}
+ virtual void swarmMessageUpdated(const std::string& /*accountId*/, const std::string& /* conversationId */, const libjami::SwarmMessage& /*message*/){}
+ virtual void reactionAdded(const std::string& /*accountId*/, const std::string& /* conversationId */, const std::string& /* messageId */, std::map /*reaction*/){}
+ virtual void reactionRemoved(const std::string& /*accountId*/, const std::string& /* conversationId */, const std::string& /* messageId */, const std::string& /* reactionId */){}
virtual void conversationProfileUpdated(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*profile*/){}
virtual void conversationRequestReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map /*metadatas*/){}
virtual void conversationRequestDeclined(const std::string& /*accountId*/, const std::string& /* conversationId */){}
diff --git a/bin/nodejs/nodejs_interface.i b/bin/nodejs/nodejs_interface.i
index 13a3d911c..42a73c39e 100644
--- a/bin/nodejs/nodejs_interface.i
+++ b/bin/nodejs/nodejs_interface.i
@@ -150,8 +150,13 @@ void init(const SWIGV8_VALUE& funcMap){
const std::map conversationHandlers = {
exportable_callback(bind(&conversationLoaded, _1, _2, _3, _4)),
+ exportable_callback(bind(&swarmLoaded, _1, _2, _3, _4)),
exportable_callback(bind(&messagesFound, _1, _2, _3, _4)),
exportable_callback(bind(&messageReceived, _1, _2, _3)),
+ exportable_callback(bind(&swarmMessageReceived, _1, _2, _3)),
+ exportable_callback(bind(&swarmMessageUpdated, _1, _2, _3)),
+ exportable_callback(bind(&reactionAdded, _1, _2, _3, _4)),
+ exportable_callback(bind(&reactionRemoved, _1, _2, _3, _4)),
exportable_callback(bind(&conversationProfileUpdated, _1, _2, _3)),
exportable_callback(bind(&conversationRequestReceived, _1, _2, _3)),
exportable_callback(bind(&conversationRequestDeclined, _1, _2)),
diff --git a/configure.ac b/configure.ac
index f94bf70f7..5c7467037 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ dnl Jami - configure.ac
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Jami Daemon],[13.11.0],[jami@gnu.org],[jami])
+AC_INIT([Jami Daemon],[14.0.0],[jami@gnu.org],[jami])
dnl Clear the implicit flags that default to '-g -O2', otherwise they
dnl take precedence over the values we set via the
diff --git a/meson.build b/meson.build
index 73c16b774..97ae791a1 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
project('jami-daemon', ['c', 'cpp'],
- version: '13.11.0',
+ version: '14.0.0',
license: 'GPL3+',
default_options: ['cpp_std=gnu++17', 'buildtype=debugoptimized'],
meson_version:'>= 0.56'
diff --git a/src/client/conversation_interface.cpp b/src/client/conversation_interface.cpp
index 661832b96..0fb86ab66 100644
--- a/src/client/conversation_interface.cpp
+++ b/src/client/conversation_interface.cpp
@@ -195,6 +195,18 @@ loadConversationMessages(const std::string& accountId,
return 0;
}
+uint32_t
+loadConversation(const std::string& accountId,
+ const std::string& conversationId,
+ const std::string& fromMessage,
+ size_t n)
+{
+ if (auto acc = jami::Manager::instance().getAccount(accountId))
+ if (auto convModule = acc->convModule())
+ return convModule->loadConversation(conversationId, fromMessage, n);
+ return 0;
+}
+
uint32_t
loadConversationUntil(const std::string& accountId,
const std::string& conversationId,
@@ -220,6 +232,14 @@ countInteractions(const std::string& accountId,
return 0;
}
+void
+clearCache(const std::string& accountId, const std::string& conversationId)
+{
+ if (auto acc = jami::Manager::instance().getAccount(accountId))
+ if (auto convModule = acc->convModule())
+ convModule->clearCache(conversationId);
+}
+
uint32_t
searchConversation(const std::string& accountId,
const std::string& conversationId,
diff --git a/src/client/ring_signal.cpp b/src/client/ring_signal.cpp
index 5576d32b3..9d86696ca 100644
--- a/src/client/ring_signal.cpp
+++ b/src/client/ring_signal.cpp
@@ -129,8 +129,13 @@ getSignalHandlers()
/* Conversation */
exported_callback(),
+ exported_callback(),
exported_callback(),
exported_callback(),
+ exported_callback(),
+ exported_callback(),
+ exported_callback(),
+ exported_callback(),
exported_callback(),
exported_callback(),
exported_callback(),
diff --git a/src/jami/conversation_interface.h b/src/jami/conversation_interface.h
index aed802231..26d932c77 100644
--- a/src/jami/conversation_interface.h
+++ b/src/jami/conversation_interface.h
@@ -26,11 +26,28 @@
#include
#include