diff --git a/cchat.go b/cchat.go index efc44ee..1b74fbf 100644 --- a/cchat.go +++ b/cchat.go @@ -577,6 +577,13 @@ type MessagesContainer interface { type Messenger interface { // JoinServer joins a server that's capable of receiving messages. The server // may not necessarily support sending messages. + // + // Frontends must never call JoinServer on the same server more than twice + // without calling the stop function first. This is the best of both worlds, as + // it greatly reduces complexity on both sides in most cases, therefore the + // backend can safely assume that there will only ever be one active JoinServer. + // If the frontend wishes to do this, it must keep its own shared message + // buffer. JoinServer(context.Context, MessagesContainer) (stop func(), err error) // Asserters. diff --git a/repository/gob/repository.gob b/repository/gob/repository.gob index b23a751..5fe1e10 100644 Binary files a/repository/gob/repository.gob and b/repository/gob/repository.gob differ diff --git a/repository/main.go b/repository/main.go index 80a7d86..12285be 100644 --- a/repository/main.go +++ b/repository/main.go @@ -1019,6 +1019,15 @@ var Main = Packages{ JoinServer joins a server that's capable of receiving messages. The server may not necessarily support sending messages. + + Frontends must never call JoinServer on the same + server more than twice without calling the stop + function first. This is the best of both worlds, as + it greatly reduces complexity on both sides in most + cases, therefore the backend can safely assume that + there will only ever be one active JoinServer. If + the frontend wishes to do this, it must keep its own + shared message buffer. `}, Name: "JoinServer", },