X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/a7216f677e7b02831328293224730f6f06f2d38a..a322be023434b4fbdfdc607b73212089ce7d077c:/hotline/server.go?ds=inline diff --git a/hotline/server.go b/hotline/server.go index 41b9a97..0d66e08 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -653,8 +653,17 @@ func (s *Server) handleNewConnection(ctx context.Context, rwc io.ReadWriteCloser // Send user access privs so client UI knows how to behave c.Server.outbox <- *NewTransaction(tranUserAccess, c.ID, NewField(fieldUserAccess, *c.Account.Access)) - // Show agreement to client - c.Server.outbox <- *NewTransaction(tranShowAgreement, c.ID, NewField(fieldData, s.Agreement)) + // Accounts with accessNoAgreement do not receive the server agreement on login. The behavior is different between + // client versions. For 1.2.3 client, we do not send tranShowAgreement. For other client versions, we send + // tranShowAgreement but with the NoServerAgreement field set to 1. + if c.Authorize(accessNoAgreement) { + // If client version is nil, then the client uses the 1.2.3 login behavior + if c.Version != nil { + c.Server.outbox <- *NewTransaction(tranShowAgreement, c.ID, NewField(fieldNoServerAgreement, []byte{1})) + } + } else { + c.Server.outbox <- *NewTransaction(tranShowAgreement, c.ID, NewField(fieldData, s.Agreement)) + } // Used simplified hotline v1.2.3 login flow for clients that do not send login info in tranAgreed if c.Version == nil || bytes.Equal(c.Version, nostalgiaVersion) {