5 "github.com/jhalter/mobius/concat"
10 const fieldUserName = 102
11 const fieldUserID = 103
12 const fieldUserIconID = 104
13 const fieldUserLogin = 105
14 const fieldUserPassword = 106
15 const fieldRefNum = 107
16 const fieldTransferSize = 108
17 const fieldChatOptions = 109
18 const fieldUserAccess = 110
20 // const fieldUserAlias = 111 TODO: implement
21 const fieldUserFlags = 112
22 const fieldOptions = 113
23 const fieldChatID = 114
24 const fieldChatSubject = 115
25 const fieldWaitingCount = 116
26 const fieldVersion = 160
27 const fieldCommunityBannerID = 161
28 const fieldServerName = 162
29 const fieldFileNameWithInfo = 200
30 const fieldFileName = 201
31 const fieldFilePath = 202
32 const fieldFileTypeString = 205
33 const fieldFileCreatorString = 206
34 const fieldFileSize = 207
35 const fieldFileCreateDate = 208
36 const fieldFileModifyDate = 209
37 const fieldFileComment = 210
38 const fieldFileNewName = 211
39 const fieldFileNewPath = 212
40 const fieldFileType = 213
41 const fieldQuotingMsg = 214
42 const fieldAutomaticResponse = 215
43 const fieldFolderItemCount = 220
44 const fieldUsernameWithInfo = 300
45 const fieldNewsArtListData = 321
46 const fieldNewsCatName = 322
47 const fieldNewsCatListData15 = 323
48 const fieldNewsPath = 325
49 const fieldNewsArtID = 326
50 const fieldNewsArtDataFlav = 327
51 const fieldNewsArtTitle = 328
52 const fieldNewsArtPoster = 329
53 const fieldNewsArtDate = 330
54 const fieldNewsArtPrevArt = 331
55 const fieldNewsArtNextArt = 332
56 const fieldNewsArtData = 333
57 const fieldNewsArtFlags = 334
58 const fieldNewsArtParentArt = 335
59 const fieldNewsArt1stChildArt = 336
60 const fieldNewsArtRecurseDel = 337
63 ID []byte // Type of field
64 FieldSize []byte // Size of the data part
65 Data []byte // Actual field content
68 type requiredField struct {
74 func NewField(id uint16, data []byte) Field {
75 idBytes := make([]byte, 2)
76 binary.BigEndian.PutUint16(idBytes, id)
79 binary.BigEndian.PutUint16(bs, uint16(len(data)))
88 func (f Field) Payload() []byte {
89 return concat.Slices(f.ID, f.FieldSize, f.Data)