]> git.r.bdr.sh - rbdr/mobius/commitdiff
patch: Fix ACLs and brew install issues
authorJeff Halter <redacted>
Mon, 26 Jul 2021 23:41:01 +0000 (16:41 -0700)
committerJeff Halter <redacted>
Mon, 26 Jul 2021 23:41:01 +0000 (16:41 -0700)
server.go
server/mobius/config/Files/hello.txt [new file with mode: 0644]
server/mobius/config/ThreadedNews.yaml
transaction_handlers.go
version.go

index 002eb40d6c9c94acad9f015d067b07035674ee47..e51f673bf1c5c57446008fbb65be1a63fd83c500 100644 (file)
--- a/server.go
+++ b/server.go
@@ -504,13 +504,6 @@ func (s *Server) handleNewConnection(conn net.Conn) error {
                return fmt.Errorf("incorrect login")
        }
 
-       // Hotline 1.2.3 client does not send fieldVersion
-       // Nostalgia client sends ""
-       //if string(*c.Version) == "" {
-       //      *c.UserName = clientLogin.GetField(fieldUserName).Data
-       //      *c.Icon = clientLogin.GetField(fieldUserIconID).Data
-       //}
-       //
        if clientLogin.GetField(fieldUserName).Data != nil {
                *c.UserName = clientLogin.GetField(fieldUserName).Data
        }
@@ -539,13 +532,6 @@ func (s *Server) handleNewConnection(conn net.Conn) error {
        // Show agreement to client
        c.Server.outbox <- *NewTransaction(tranShowAgreement, c.ID, NewField(fieldData, s.Agreement))
 
-       // The Hotline ClientConn v1.2.3 has a different login sequence than 1.9.2
-       if string(*c.Version) == "" {
-               if _, err := c.notifyNewUserHasJoined(); err != nil {
-                       return err
-               }
-       }
-
        if _, err := c.notifyNewUserHasJoined(); err != nil {
                return err
        }
diff --git a/server/mobius/config/Files/hello.txt b/server/mobius/config/Files/hello.txt
new file mode 100644 (file)
index 0000000..271a837
--- /dev/null
@@ -0,0 +1 @@
+I'm a test file
\ No newline at end of file
index dc2e8b5fe86a6284da6f3f126da73a502e1a89ba..59e0a68cf62cf69114d4d7f03cb47fe57332e12f 100644 (file)
@@ -1 +1 @@
-Categories:
+Categories: {}
index 7920eaa8acfb044c89eb4a9ba5ff2009e9e8712a..b06297dc6926169d2dceebcb69e96ad699b1e746 100644 (file)
@@ -41,6 +41,9 @@ var TransactionHandlers = map[uint16]TransactionType{
        tranUserAccess: {
                Name: "tranUserAccess",
        },
+       tranNotifyDeleteUser: {
+               Name: "tranNotifyDeleteUser",
+       },
        tranAgreed: {
                Access:  accessAlwaysAllow,
                Name:    "tranAgreed",
@@ -117,18 +120,26 @@ var TransactionHandlers = map[uint16]TransactionType{
                Handler: HandleGetFileNameList,
        },
        tranGetMsgs: {
+               Access:  accessNewsReadArt,
+               DenyMsg: "You are not allowed to read news.",
                Name:    "tranGetMsgs",
                Handler: HandleGetMsgs,
        },
        tranGetNewsArtData: {
+               Access:  accessNewsReadArt,
+               DenyMsg: "You are not allowed to read news.",
                Name:    "tranGetNewsArtData",
                Handler: HandleGetNewsArtData,
        },
        tranGetNewsArtNameList: {
+               Access:  accessNewsReadArt,
+               DenyMsg: "You are not allowed to read news.",
                Name:    "tranGetNewsArtNameList",
                Handler: HandleGetNewsArtNameList,
        },
        tranGetNewsCatNameList: {
+               Access:  accessNewsReadArt,
+               DenyMsg: "You are not allowed to read news.",
                Name:    "tranGetNewsCatNameList",
                Handler: HandleGetNewsCatNameList,
        },
@@ -150,24 +161,27 @@ var TransactionHandlers = map[uint16]TransactionType{
                Handler: HandleInviteNewChat,
        },
        tranInviteToChat: {
+               Access:  accessOpenChat,
+               DenyMsg: "You are not allowed to request private chat.",
                Name:    "tranInviteToChat",
                Handler: HandleInviteToChat,
        },
        tranJoinChat: {
+               Access:  accessAlwaysAllow,
                Name:    "tranJoinChat",
                Handler: HandleJoinChat,
        },
        tranKeepAlive: {
+               Access:  accessAlwaysAllow,
                Name:    "tranKeepAlive",
                Handler: HandleKeepAlive,
        },
        tranLeaveChat: {
+               Access:  accessAlwaysAllow,
                Name:    "tranJoinChat",
                Handler: HandleLeaveChat,
        },
-       tranNotifyDeleteUser: {
-               Name: "tranNotifyDeleteUser",
-       },
+
        tranListUsers: {
                Access:  accessOpenUser,
                DenyMsg: "You are not allowed to view accounts.",
@@ -181,14 +195,20 @@ var TransactionHandlers = map[uint16]TransactionType{
                Handler: HandleMoveFile,
        },
        tranNewFolder: {
+               Access:  accessCreateFolder,
+               DenyMsg: "You are not allow to create folders.",
                Name:    "tranNewFolder",
                Handler: HandleNewFolder,
        },
        tranNewNewsCat: {
+               Access:  accessNewsCreateCat,
+               DenyMsg: "You are not allowed to create news categories.",
                Name:    "tranNewNewsCat",
                Handler: HandleNewNewsCat,
        },
        tranNewNewsFldr: {
+               Access:  accessNewsCreateFldr,
+               DenyMsg: "You are not allowed to create news folders.",
                Name:    "tranNewNewsFldr",
                Handler: HandleNewNewsFldr,
        },
@@ -199,6 +219,8 @@ var TransactionHandlers = map[uint16]TransactionType{
                Handler: HandleNewUser,
        },
        tranOldPostNews: {
+               Access:  accessNewsPostArt,
+               DenyMsg: "You are not allowed to post news.",
                Name:    "tranOldPostNews",
                Handler: HandleTranOldPostNews,
        },
@@ -209,10 +231,12 @@ var TransactionHandlers = map[uint16]TransactionType{
                Handler: HandlePostNewsArt,
        },
        tranRejectChatInvite: {
+               Access:  accessAlwaysAllow,
                Name:    "tranRejectChatInvite",
                Handler: HandleRejectChatInvite,
        },
        tranSendInstantMsg: {
+               Access: accessAlwaysAllow,
                //Access: accessSendPrivMsg,
                //DenyMsg: "You are not allowed to send private messages",
                Name:    "tranSendInstantMsg",
@@ -228,6 +252,7 @@ var TransactionHandlers = map[uint16]TransactionType{
                },
        },
        tranSetChatSubject: {
+               Access:  accessAlwaysAllow,
                Name:    "tranSetChatSubject",
                Handler: HandleSetChatSubject,
        },
@@ -237,6 +262,7 @@ var TransactionHandlers = map[uint16]TransactionType{
                Handler: HandleSetClientUserInfo,
        },
        tranSetFileInfo: {
+               Access:  accessAlwaysAllow, // granular access is in the handler
                Name:    "tranSetFileInfo",
                Handler: HandleSetFileInfo,
        },
@@ -253,6 +279,7 @@ var TransactionHandlers = map[uint16]TransactionType{
                Handler: HandleUploadFile,
        },
        tranUploadFldr: {
+               Access:  accessAlwaysAllow, // TODO: what should this be?
                Name:    "tranUploadFldr",
                Handler: HandleUploadFolder,
        },
index 1025a59dbe884130a2088e61b7eab49b46d43980..d24a4bc6c9e3a8852d261efb22cf3b4220d7a26a 100644 (file)
@@ -1,3 +1,3 @@
 package hotline
 
-const VERSION = "0.0.5"
+const VERSION = "0.0.6"