about summary refs log tree commit homepage
path: root/lib/PublicInbox/IMAP.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/IMAP.pm')
-rw-r--r--lib/PublicInbox/IMAP.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm
index ce0dce0f..805f1102 100644
--- a/lib/PublicInbox/IMAP.pm
+++ b/lib/PublicInbox/IMAP.pm
@@ -1212,8 +1212,6 @@ sub event_step {
         $self->requeue unless $pending;
 }
 
-sub compressed { undef }
-
 # RFC 4978
 sub cmd_compress ($$$) {
         my ($self, $tag, $alg) = @_;
@@ -1223,7 +1221,9 @@ sub cmd_compress ($$$) {
         # CRIME made TLS compression obsolete
         # return "$tag NO [COMPRESSIONACTIVE]\r\n" if $self->tls_compressed;
 
-        PublicInbox::IMAPdeflate->enable($self, $tag);
+        PublicInbox::IMAPdeflate->enable($self) or return
+                                \"$tag BAD failed to activate compression\r\n";
+        PublicInbox::DS::write($self, \"$tag OK DEFLATE active\r\n");
         $self->requeue;
         undef
 }
@@ -1269,4 +1269,8 @@ our @ISA = qw(PublicInbox::IMAP);
 
 sub logged_in { 0 }
 
+package PublicInbox::IMAPdeflate;
+use PublicInbox::DSdeflate;
+our @ISA = qw(PublicInbox::DSdeflate PublicInbox::IMAP);
+
 1;