Skip to content

Distributing DistributionMessage #73

@Swepilot

Description

@Swepilot

Hi!

I've been studying this package, examples and reading other issues for a few days now. What I fail to get my head around is how to distribute the DistributionMessage to other members in a group chat. Examples run fine but then all members (Alice, Bob & Dean) all are in the same function with direct access to all variables.

Currently I have written a small test program that stores the chat messages (cipher text) in a Firestore database. It works fine to "chat" between two different devices, but only because I am storing the DistributionMessage along with the cipherText. This is obviously not how it should be done. Should the DistriubutionMessage be sent to all members using the normal 1-to-1 session or some other mechanism?

Furthermore, should I every time I send a message go through every member of the group and .process their DistributionMessage before encrypting the message to be sent? Is this how one achieve the behaviour that new members cannot see old messages, because their distribution message was not included when the message was encrypted?

for each member in chat {
   await bobGroupSessionBuilder.process(
      member[GroupSender], member[DistributionMessage]);
}

Thankful for any guidance!

/Nik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions