]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/transaction_handlers.go
Disconnect banned users earlier in the login flow
[rbdr/mobius] / hotline / transaction_handlers.go
index acc8fe4ac76d6bd2ad8cc43d46a85270f0d36aa9..d99da53519a393c559fd6ce005157f7f34e0f8db 100644 (file)
@@ -933,8 +933,6 @@ func HandleGetUserNameList(cc *ClientConn, t *Transaction) (res []Transaction, e
 }
 
 func HandleTranAgreed(cc *ClientConn, t *Transaction) (res []Transaction, err error) {
-       cc.Agreed = true
-
        if t.GetField(fieldUserName).Data != nil {
                if cc.Authorize(accessAnyName) {
                        cc.UserName = t.GetField(fieldUserName).Data
@@ -992,15 +990,6 @@ func HandleTranAgreed(cc *ClientConn, t *Transaction) (res []Transaction, err er
        return res, err
 }
 
-const defaultNewsDateFormat = "Jan02 15:04" // Jun23 20:49
-//  "Mon, 02 Jan 2006 15:04:05 MST"
-
-const defaultNewsTemplate = `From %s (%s):
-
-%s
-
-__________________________________________________________`
-
 // HandleTranOldPostNews updates the flat news
 // Fields used in this request:
 // 101 Data
@@ -1368,7 +1357,7 @@ func HandlePostNewsArt(cc *ClientConn, t *Transaction) (res []Transaction, err e
        }
        convertedArtID := uint32(artID)
        bs := make([]byte, 4)
-       binary.LittleEndian.PutUint32(bs, convertedArtID)
+       binary.BigEndian.PutUint32(bs, convertedArtID)
 
        newArt := NewsArtData{
                Title:         string(t.GetField(fieldNewsArtTitle).Data),
@@ -1921,7 +1910,7 @@ func HandleLeaveChat(cc *ClientConn, t *Transaction) (res []Transaction, err err
 // HandleSetChatSubject is sent from a v1.8+ Hotline client when the user sets a private chat subject
 // Fields used in the request:
 // * 114       Chat ID
-// * 115       Chat subject    Chat subject string
+// * 115       Chat subject
 // Reply is not expected.
 func HandleSetChatSubject(cc *ClientConn, t *Transaction) (res []Transaction, err error) {
        chatID := t.GetField(fieldChatID).Data
@@ -1944,7 +1933,7 @@ func HandleSetChatSubject(cc *ClientConn, t *Transaction) (res []Transaction, er
        return res, err
 }
 
-// HandleMakeAlias makes a filer alias using the specified path.
+// HandleMakeAlias makes a file alias using the specified path.
 // Fields used in the request:
 // 201 File name
 // 202 File path