swarm: add method to save user's preferences

This store user's preferences per conversation into
conversation_data/<convId>/preferences
In this way, the daemon is able to sync this file across devices
and remove preferences at the same time we remove the conversation.

For now, only support "color" and "ignoreNotifications"

The preferences are synced via partial SyncMsg sent across devices.

Change-Id: I8fe74cc06733ad61d45d721e0264b1941d4cf122
This commit is contained in:
Sébastien Blin
2022-03-17 17:37:47 -04:00
parent baf2510ffd
commit a4ff4abe70
26 changed files with 527 additions and 100 deletions

View File

@ -540,5 +540,10 @@ install_signal_primitives(void*)
int,
const std::string&>(handlers, "conversation-error");
add_handler<DRing::ConversationSignal::ConversationPreferencesUpdated,
const std::string&,
const std::string&,
std::map<std::string, std::string>>(handlers, "conversation-preferences-updated");
DRing::registerSignalHandlers(handlers);
}