The directory was tracked as a mode-160000 gitlink (bare submodule reference) without a .gitmodules entry, causing 'has no commit checked out' errors on commit. Re-added as ordinary tracked files so the vendored copy is fully part of this repo. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
35 lines
787 B
Dart
35 lines
787 B
Dart
import '../../imap/id.dart';
|
|
import '../../imap/response.dart';
|
|
import 'imap_response.dart';
|
|
import 'response_parser.dart';
|
|
|
|
/// Parses IMAP ID responses
|
|
class IdParser extends ResponseParser<Id?> {
|
|
Id? _id;
|
|
|
|
@override
|
|
Id? parse(ImapResponse imapResponse, Response response) {
|
|
if (response.isOkStatus) {
|
|
return _id;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
@override
|
|
bool parseUntagged(ImapResponse imapResponse, Response<Id?>? response) {
|
|
final text = imapResponse.parseText;
|
|
if (text.startsWith('ID ')) {
|
|
_id = Id.fromText(text.substring('ID '.length));
|
|
|
|
return true;
|
|
} else if (text.startsWith('* ID ')) {
|
|
_id = Id.fromText(text.substring('* ID '.length));
|
|
|
|
return true;
|
|
}
|
|
|
|
return super.parseUntagged(imapResponse, response);
|
|
}
|
|
}
|