X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/0a92e50b2704c1eb02233c9aa5778d21455d345b..2a42aad2a01e50d158a13439f851e49c799c5510:/hotline/transaction.go diff --git a/hotline/transaction.go b/hotline/transaction.go index e7bfa58..ece2924 100644 --- a/hotline/transaction.go +++ b/hotline/transaction.go @@ -6,7 +6,6 @@ import ( "fmt" "github.com/jhalter/mobius/concat" "math/rand" - "net" ) const ( @@ -32,6 +31,7 @@ const ( tranNotifyChatSubject = 119 tranSetChatSubject = 120 tranAgreed = 121 + tranServerBanner = 122 tranGetFileNameList = 200 tranDownloadFile = 202 tranUploadFile = 203 @@ -40,10 +40,10 @@ const ( tranGetFileInfo = 206 tranSetFileInfo = 207 tranMoveFile = 208 - tranMakeFileAlias = 209 // TODO: implement file alias command + tranMakeFileAlias = 209 tranDownloadFldr = 210 // tranDownloadInfo = 211 TODO: implement file transfer queue - // tranDownloadBanner = 212 TODO: figure out what this is used for + tranDownloadBanner = 212 tranUploadFldr = 213 tranGetUserNameList = 300 tranNotifyChangeUser = 301 @@ -131,29 +131,6 @@ func ReadTransaction(buf []byte) (*Transaction, int, error) { }, tranLen, nil } -func readN(conn net.Conn, n int) ([]Transaction, error) { - buf := make([]byte, 1400) - i := 0 - for { - readLen, err := conn.Read(buf) - if err != nil { - return nil, err - } - - transactions, _, err := readTransactions(buf[:readLen]) - // spew.Fdump(os.Stderr, transactions) - if err != nil { - return nil, err - } - - i += len(transactions) - - if n == i { - return transactions, nil - } - } -} - func readTransactions(buf []byte) ([]Transaction, int, error) { var transactions []Transaction