diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-25 21:10:55 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-25 21:10:55 -0700 |
| commit | 688c86d220b0d2eef1f2a3ef0a389261dc48be93 (patch) | |
| tree | ba99952597be980098ac49004920046cd2701d4a /hotline | |
| parent | 264b7c27c7a46e2d0eb699812c8e38cf771fcf00 (diff) | |
Implement Don't Show Agreement permission
Diffstat (limited to 'hotline')
| -rw-r--r-- | hotline/access.go | 16 | ||||
| -rw-r--r-- | hotline/field.go | 1 | ||||
| -rw-r--r-- | hotline/server.go | 8 |
3 files changed, 15 insertions, 10 deletions
diff --git a/hotline/access.go b/hotline/access.go index 1bee72c..bc3cb0d 100644 --- a/hotline/access.go +++ b/hotline/access.go @@ -27,14 +27,14 @@ const ( accessModifyUser = 17 // accessChangeOwnPass = 18 // Documented but unused? // accessSendPrivMsg = 19 // This doesn't do what it seems like it should do. TODO: Investigate - accessNewsReadArt = 20 - accessNewsPostArt = 21 - accessDisconUser = 22 // Toggles red user name in user list - accessCannotBeDiscon = 23 - accessGetClientInfo = 24 - accessUploadAnywhere = 25 - accessAnyName = 26 - // accessNoAgreement = 27 + accessNewsReadArt = 20 + accessNewsPostArt = 21 + accessDisconUser = 22 // Toggles red user name in user list + accessCannotBeDiscon = 23 + accessGetClientInfo = 24 + accessUploadAnywhere = 25 + accessAnyName = 26 + accessNoAgreement = 27 accessSetFileComment = 28 accessSetFolderComment = 29 accessViewDropBoxes = 30 diff --git a/hotline/field.go b/hotline/field.go index aef790d..c9db3d9 100644 --- a/hotline/field.go +++ b/hotline/field.go @@ -24,6 +24,7 @@ const fieldChatID = 114 const fieldChatSubject = 115 const fieldWaitingCount = 116 const fieldBannerType = 152 +const fieldNoServerAgreement = 152 const fieldVersion = 160 const fieldCommunityBannerID = 161 const fieldServerName = 162 diff --git a/hotline/server.go b/hotline/server.go index 41b9a97..f3574de 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -653,8 +653,12 @@ 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)) + // Users with accessNoAgreement do not receive the server agreement on login + if c.Authorize(accessNoAgreement) { + 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) { |