const fieldTransferSize = 108
const fieldChatOptions = 109
const fieldUserAccess = 110
-const fieldUserAlias = 111
+
+// const fieldUserAlias = 111 TODO: implement
const fieldUserFlags = 112
const fieldOptions = 113
const fieldChatID = 114
const fieldChatSubject = 115
const fieldWaitingCount = 116
+const fieldBannerType = 152
+const fieldNoServerAgreement = 152
const fieldVersion = 160
const fieldCommunityBannerID = 161
const fieldServerName = 162
const fieldFileNameWithInfo = 200
const fieldFileName = 201
const fieldFilePath = 202
+const fieldFileResumeData = 203
+const fieldFileTransferOptions = 204
const fieldFileTypeString = 205
const fieldFileCreatorString = 206
const fieldFileSize = 207
const fieldFileNewName = 211
const fieldFileNewPath = 212
const fieldFileType = 213
-const fieldQuotingMsg = 214 // Defined but unused in the Hotline Protocol spec
+const fieldQuotingMsg = 214
const fieldAutomaticResponse = 215
const fieldFolderItemCount = 220
const fieldUsernameWithInfo = 300
const fieldNewsArtPrevArt = 331
const fieldNewsArtNextArt = 332
const fieldNewsArtData = 333
-const fieldNewsArtFlags = 334
+
+// const fieldNewsArtFlags = 334
const fieldNewsArtParentArt = 335
const fieldNewsArt1stChildArt = 336
-const fieldNewsArtRecurseDel = 337
+
+// const fieldNewsArtRecurseDel = 337
type Field struct {
ID []byte // Type of field
return concat.Slices(f.ID, f.FieldSize, f.Data)
}
-type FileNameWithInfo struct {
- Type string // file type code
- Creator []byte // File creator code
- FileSize uint32 // File Size in bytes
- NameScript []byte // TODO: What is this?
- NameSize []byte // Length of name field
- Name string // File name
-}
-
-func (f FileNameWithInfo) Payload() []byte {
- name := []byte(f.Name)
- nameSize := make([]byte, 2)
- binary.BigEndian.PutUint16(nameSize, uint16(len(name)))
-
- kb := f.FileSize
-
- fSize := make([]byte, 4)
- binary.BigEndian.PutUint32(fSize, kb)
-
- return concat.Slices(
- []byte(f.Type),
- f.Creator,
- fSize,
- []byte{0, 0, 0, 0},
- f.NameScript,
- nameSize,
- []byte(f.Name),
- )
-
+func getField(id int, fields *[]Field) *Field {
+ for _, field := range *fields {
+ if id == int(binary.BigEndian.Uint16(field.ID)) {
+ return &field
+ }
+ }
+ return nil
}