]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/client_conn.go
Improve compatability of threaded news post and delete
[rbdr/mobius] / hotline / client_conn.go
index 076919fbd99f73aa9ef4543cba236d473d12ce64..8c95aebbf2273882e57dadb1c0d09352a4bed0ed 100644 (file)
@@ -135,9 +135,7 @@ func (cc *ClientConn) uint16ID() uint16 {
 
 // Authorize checks if the user account has the specified permission
 func (cc *ClientConn) Authorize(access int) bool {
-       i := big.NewInt(int64(binary.BigEndian.Uint64(*cc.Account.Access)))
-
-       return i.Bit(63-access) == 1
+       return cc.Account.Access.IsSet(access)
 }
 
 // Disconnect notifies other clients that a client has disconnected
@@ -172,7 +170,7 @@ func (cc *ClientConn) NewReply(t *Transaction, fields ...Field) Transaction {
        reply := Transaction{
                Flags:     0x00,
                IsReply:   0x01,
-               Type:      t.Type,
+               Type:      []byte{0x00, 0x00},
                ID:        t.ID,
                clientID:  cc.ID,
                ErrorCode: []byte{0, 0, 0, 0},