aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hotline/access.go16
-rw-r--r--hotline/field.go1
-rw-r--r--hotline/server.go8
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) {