Skip Menu |
 

This queue is for tickets about the Net-IMAP-Simple CPAN distribution.

Report information
The Basics
Id: 128564
Status: new
Priority: 0/
Queue: Net-IMAP-Simple

People
Owner: Nobody in particular
Requestors: tlhackque [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Yes, slfags should be exposed
Date: Wed, 20 Feb 2019 08:46:52 -0500
To: bug-Net-IMAP-Simple [...] rt.cpan.org
From: tlhackque <tlhackque [...] yahoo.com>
Download (untitled) / with headers
text/plain 1.9k
Simple.pm at line 405 says:     # NOTE: the sflags really aren't used anywhere, should they be? Yes, they should. They indicate which flags can be set permanently on the server, and in particular, the \* flag in this response indicates whether new keywords can be created. I suggest the following simple change to the 'flags' method: |sub| |flags {| |    ||my| |( ||$self||, ||$folder| |) = ||@_||;|   |    ||$self||->||select||(||$folder||);|   |    ||return| |@{ ||$self||->{BOXES}{ ||$self||->current_box }{flags} || [] };| |}|   becomes: (add $permflags and first "return") |sub| |flags {| |    ||my| |( ||$self||, ||$folder|, $permflags |) = ||@_||;|   |    ||$self||->||select||(||$folder||);|   |  ||return| |@{ ||$self||->{BOXES}{ ||$self||->current_box }{sflags}{PERMANENTFLAGS} || [ ' ' ] } if( $permflags );|   |  ||return| |@{ ||$self||->{BOXES}{ ||$self||->current_box }{flags} || [] };| |||| |}|   You can then remove the NOTE. And the POD becomes |=item flags|   |    ||print "Available server flags: " . join(", ", $imap->flags) . "\n";|   |This method accepts an optional folder name and optional boolean, "$permflags| |and returns the current available| |server flags as a list, for the selected folder. If no folder name is provided| |the last folder C<< $imap->select >>'ed will be used.| If the $permflags boolean is specified, the flags that the server allows to be set permanently are returned. The flag '\*' indicates that new keywords can be created. If the list ( ' ' ) is returned, the server did not provide an explicit list, and "all flags" should be assumed. To specify $permflags & default $folder, use 'undef' for $folder. |This method uses caching.|   I noted in passing that line 369 (in sub select) defaults $mbox to $self->current_box 'unless $mbox'. This won't work if you happen to have a folder named '0' - stranger things have happened. The clause should be 'unless defined $mbox'.

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #128564] Uncorrupted version
Date: Wed, 20 Feb 2019 09:03:41 -0500
To: bug-Net-IMAP-Simple [...] rt.cpan.org
From: tlhackque <tlhackque [...] yahoo.com>
Download (untitled) / with headers
text/plain 1.9k
For some reason the report was garbled.  Sorry about that.  Here is another attempt (same content, hopefully without the extraneous stuff). Simple.pm at line 405 says:     # NOTE: the sflags really aren't used anywhere, should they be? Yes, they should.  They indicate which flags can be set permanently on the server, and in particular, the \* flag in this response indicates whether new keywords can be created. I suggest the following simple change to the 'flags' method: sub flags {     my ( $self, $folder ) = @_;       $self->select($folder);       return @{ $self->{BOXES}{ $self->current_box }{flags} || [] }; }   becomes: (add $permflags and first "return") sub flags {     my ( $self, $folder, $permflags ) = @_;       $self->select($folder);     return @{ $self->{BOXES}{ $self->current_box }{sflags}{PERMANENTFLAGS} || [ ' ' ] } if( $permflags );     return @{ $self->{BOXES}{ $self->current_box }{flags} || [] }; }   You can then remove the NOTE. And the POD becomes =item flags       print "Available server flags: " . join(", ", $imap->flags) . "\n";   This method accepts an optional folder name and optional boolean, "$permflags and returns the current available server flags as a list, for the selected folder. If no folder name is provided the last folder C<< $imap->select >>'ed will be used. If the $permflags boolean is specified, the flags that the server allows to be set permanently are returned. The flag '\*' indicates that new keywords can be created. If the list ( ' ' ) is returned, the server did not provide an explicit list, and "all flags" should be assumed.  To specify $permflags & default $folder, use 'undef' for $folder. This method uses caching.   I noted in passing that line 369 (in sub select) defaults $mbox to $self->current_box 'unless $mbox'. This won't work if you happen to have a folder named '0' - stranger things have happened. The clause should be 'unless defined $mbox'.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.