oxen-io / libsession-util

Session utilities library
GNU General Public License v3.0
15 stars 16 forks source link

Unified state #78

Open mpretty-cyro opened 8 months ago

mpretty-cyro commented 8 months ago

The goal of this PR is to consolidate the different config object types behind a single State class so clients only need to hold on to a single object instead of juggling multiple Config objects.

This PR also attempts to abstract as much of the config change/update loop as it currently can via generic hooks (on_send/on_store) and bulk processing methods (state.merge()).

In the future this class can be extended to include individual functions which result in changes across multiple configs in order to simplify the interface for the clients (eg. adding a member to a group).

mpretty-cyro commented 2 months ago

Converting this back to a draft as it'll require a number of changes to be usable again