@@ -494,11 +494,11 @@ def response_data
494
494
when "ESEARCH" then esearch_response # RFC4731, RFC9051, etc
495
495
when "VANISHED" then expunged_resp # RFC7162
496
496
when "UIDFETCH" then uidfetch_resp # (draft) UIDONLY
497
- when "SEARCH" then search_response # RFC3501 (obsolete)
497
+ when "SEARCH" then mailbox_data__search # RFC3501 (obsolete)
498
498
when "CAPABILITY" then capability_data__untagged # RFC3501, RFC9051
499
- when "FLAGS" then flags_response # RFC3501, RFC9051
500
- when "LIST" then list_response # RFC3501, RFC9051
501
- when "STATUS" then status_response # RFC3501, RFC9051
499
+ when "FLAGS" then mailbox_data__flags # RFC3501, RFC9051
500
+ when "LIST" then mailbox_data__list # RFC3501, RFC9051
501
+ when "STATUS" then mailbox_data__status # RFC3501, RFC9051
502
502
when "NAMESPACE" then namespace_response # RFC2342, RFC9051
503
503
when "ENABLED" then enable_data # RFC5161, RFC9051
504
504
when "BAD" then response_cond # RFC3501, RFC9051
@@ -507,25 +507,25 @@ def response_data
507
507
when "BYE" then response_cond # RFC3501, RFC9051
508
508
when "RECENT" then mailbox_data__recent # RFC3501 (obsolete)
509
509
when "SORT" then sort_data # RFC5256, RFC7162
510
- when "THREAD" then thread_response # RFC5256
511
- when "QUOTA" then getquota_response # RFC2087, RFC9208
512
- when "QUOTAROOT" then getquotaroot_response # RFC2087, RFC9208
510
+ when "THREAD" then thread_data # RFC5256
511
+ when "QUOTA" then quota_response # RFC2087, RFC9208
512
+ when "QUOTAROOT" then quotaroot_response # RFC2087, RFC9208
513
513
when "ID" then id_response # RFC2971
514
- when "ACL" then getacl_response # RFC4314
514
+ when "ACL" then acl_data # RFC4314
515
515
when "LISTRIGHTS" then listrights_data # RFC4314
516
516
when "MYRIGHTS" then myrights_data # RFC4314
517
517
when "METADATA" then metadata_resp # RFC5464
518
518
when "LANGUAGE" then language_data # RFC5255
519
519
when "COMPARATOR" then comparator_data # RFC5255
520
520
when "CONVERTED" then message_data__converted # RFC5259
521
- when "LSUB" then list_response # RFC3501 (obsolete)
522
- when "XLIST" then list_response # deprecated
523
- when "NOOP" then ignored_response
524
- else unparsed_response
521
+ when "LSUB" then mailbox_data__lsub # RFC3501 (obsolete)
522
+ when "XLIST" then mailbox_data__xlist # deprecated
523
+ when "NOOP" then response_data__noop
524
+ else response_data__unhandled
525
525
end
526
526
end
527
527
528
- def unparsed_response ( klass = UntaggedResponse )
528
+ def response_data__unhandled ( klass = UntaggedResponse )
529
529
num = number? ; SP?
530
530
type = tagged_ext_label ; SP?
531
531
text = remaining_unparsed
@@ -539,17 +539,18 @@ def remaining_unparsed
539
539
str &.empty? ? nil : str
540
540
end
541
541
542
- def ignored_response ; unparsed_response ( IgnoredResponse ) end
542
+ def response_data__ignored ; response_data__unhandled ( IgnoredResponse ) end
543
+ alias response_data__noop response_data__ignored
543
544
544
- alias esearch_response unparsed_response
545
- alias expunged_resp unparsed_response
546
- alias uidfetch_resp unparsed_response
547
- alias listrights_data unparsed_response
548
- alias myrights_data unparsed_response
549
- alias metadata_resp unparsed_response
550
- alias language_data unparsed_response
551
- alias comparator_data unparsed_response
552
- alias message_data__converted unparsed_response
545
+ alias esearch_response response_data__unhandled
546
+ alias expunged_resp response_data__unhandled
547
+ alias uidfetch_resp response_data__unhandled
548
+ alias listrights_data response_data__unhandled
549
+ alias myrights_data response_data__unhandled
550
+ alias metadata_resp response_data__unhandled
551
+ alias language_data response_data__unhandled
552
+ alias comparator_data response_data__unhandled
553
+ alias message_data__converted response_data__unhandled
553
554
554
555
# RFC3501 & RFC9051:
555
556
# response-tagged = tag SP resp-cond-state CRLF
@@ -1046,19 +1047,21 @@ def modseq_data
1046
1047
return name , modseq
1047
1048
end
1048
1049
1049
- def flags_response
1050
+ def mailbox_data__flags
1050
1051
token = match ( T_ATOM )
1051
1052
name = token . value . upcase
1052
1053
match ( T_SPACE )
1053
1054
return UntaggedResponse . new ( name , flag_list , @str )
1054
1055
end
1055
1056
1056
- def list_response
1057
+ def mailbox_data__list
1057
1058
token = match ( T_ATOM )
1058
1059
name = token . value . upcase
1059
1060
match ( T_SPACE )
1060
1061
return UntaggedResponse . new ( name , mailbox_list , @str )
1061
1062
end
1063
+ alias mailbox_data__lsub mailbox_data__list
1064
+ alias mailbox_data__xlist mailbox_data__list
1062
1065
1063
1066
def mailbox_list
1064
1067
attr = flag_list
@@ -1124,7 +1127,8 @@ def getquotaroot_response
1124
1127
return UntaggedResponse . new ( name , data , @str )
1125
1128
end
1126
1129
1127
- def getacl_response
1130
+ # acl-data = "ACL" SP mailbox *(SP identifier SP rights)
1131
+ def acl_data
1128
1132
token = match ( T_ATOM )
1129
1133
name = token . value . upcase
1130
1134
match ( T_SPACE )
@@ -1150,7 +1154,21 @@ def getacl_response
1150
1154
return UntaggedResponse . new ( name , data , @str )
1151
1155
end
1152
1156
1153
- def search_response
1157
+ # RFC3501:
1158
+ # mailbox-data = "SEARCH" *(SP nz-number) / ...
1159
+ # RFC5256: SORT
1160
+ # sort-data = "SORT" *(SP nz-number)
1161
+ # RFC7162: CONDSTORE, QRESYNC
1162
+ # mailbox-data =/ "SEARCH" [1*(SP nz-number) SP
1163
+ # search-sort-mod-seq]
1164
+ # sort-data = "SORT" [1*(SP nz-number) SP
1165
+ # search-sort-mod-seq]
1166
+ # ; Updates the SORT response from RFC 5256.
1167
+ # search-sort-mod-seq = "(" "MODSEQ" SP mod-sequence-value ")"
1168
+ # RFC9051:
1169
+ # mailbox-data = obsolete-search-response / ...
1170
+ # obsolete-search-response = "SEARCH" *(SP nz-number)
1171
+ def mailbox_data__search
1154
1172
token = match ( T_ATOM )
1155
1173
name = token . value . upcase
1156
1174
token = lookahead
@@ -1180,8 +1198,9 @@ def search_response
1180
1198
end
1181
1199
return UntaggedResponse . new ( name , data , @str )
1182
1200
end
1201
+ alias sort_data mailbox_data__search
1183
1202
1184
- def thread_response
1203
+ def thread_data
1185
1204
token = match ( T_ATOM )
1186
1205
name = token . value . upcase
1187
1206
token = lookahead
@@ -1243,7 +1262,7 @@ def thread_branch(token)
1243
1262
return rootmember
1244
1263
end
1245
1264
1246
- def status_response
1265
+ def mailbox_data__status
1247
1266
token = match ( T_ATOM )
1248
1267
name = token . value . upcase
1249
1268
match ( T_SPACE )
0 commit comments