]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/field.go
Disconnect banned users earlier in the login flow
[rbdr/mobius] / hotline / field.go
index b057be3134e8a8ec0208a471d10317b9987ba716..3378552a8f0da2408691919cc16d53e85d61a9f2 100644 (file)
@@ -16,18 +16,23 @@ const fieldRefNum = 107
 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
@@ -37,7 +42,7 @@ const fieldFileComment = 210
 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
@@ -53,10 +58,12 @@ const fieldNewsArtDate = 330
 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
@@ -87,3 +94,12 @@ func NewField(id uint16, data []byte) Field {
 func (f Field) Payload() []byte {
        return concat.Slices(f.ID, f.FieldSize, f.Data)
 }
+
+func getField(id int, fields *[]Field) *Field {
+       for _, field := range *fields {
+               if id == int(binary.BigEndian.Uint16(field.ID)) {
+                       return &field
+               }
+       }
+       return nil
+}