Mentions légales du service

Skip to content

Create map to link the networkId to the muteCoreId

HUBERT Baptiste requested to merge feat/map-mutecore-id into main

In the mute-core project :

We removed the id attribute in the ICollaborator interface. In the EmitUpdate function in the CollaboratorsService class, we removed the id as it is no longer used.
We modified the names of the variable senderId and recipientId as senderNetworkId and recipientNetworkId to clearly states that it is the networkId used in the network part of mute.
The networkId is now only stored as a key in the collaborators map in the CollaboratorsService class. (As opposed to before when it was basically both the id of the ICollaborator and the key to the collaborators map)

In the mute project :

  • network.service.ts
    Created an IdMap class, that stores two maps, networkIdToMuteCoreIdMap and muteCoreIdToNetworkIdMap. With function to set and unset value to both of the maps, and getters.
    The IdMap is initialized in the Network.service.ts class.
    There is also a tempNetworkId cariable in the network.service.ts class.
  • rich-collaborators.service.ts
    Replaced the id by a networkId. In the constructor, added a parameter to get the networkId.
    Replaced every instance of the id of a RichCollaborator by networkId.
    Replaced every instance of senderId and recipientId by senderNetworkId and recipientNetworkId (to be on-par with what's used in mute-core)
    Added a NetworkService class variable. This way, the IdMap is accessible. The network is set in the doc.service.ts class, before setting up the collaborator's subscriptions.

The RichCollaborator, the collaborator used in mute, has a networkId attribute, whereas the ICollaborator, the collaborator used in mute-core has a muteCoreId attribute)

Setting values in the IdMap is done by this process : In the doc.service class. a subscription is made on the network.onMemberJoin observable. Whenever this observable is updated, we update the network.tempNetworkId by the value updated (this observable is updated everytime a peer joins the webgroup).

In the rich-collaborators.service class, we can get the ICollaborator.muteCoreId. We get it in the subscribeTo functions as these function use muteCore observable.

Fixes #27 (closed)

Edited by HUBERT Baptiste

Merge request reports