~jonjfineman/cli-mail

71b7faa856725e96dcbe80d5dedc77b2fadcea1d — Jon Fineman 2 years ago 415d6cb
add flag/unflag action
1 files changed, 53 insertions(+), 0 deletions(-)

M cli-mail.pl
M cli-mail.pl => cli-mail.pl +53 -0
@@ 849,6 849,59 @@ while($input = <>)
    }

    #
    # mark flagged msg #
    #
    elsif ($action eq "flag")
    {
        if ( $#args >= 1 )
        {
            $msg_no = $args[1] ;
        }
        elsif ($msg_no == -1)
        {
            print "select msg no\n" ;
            print("> ") ;
            next ;
        }

        if ( $msg_no > $#threads )
        {
            print "msg out of range\n" ;
        }
        else
        {
            change_msg_status ( $threads[$msg_no], "+flagged" ) ;
        }
    }

    #
    # mark un-flagged msg #
    #
    elsif ($action eq "unflag")
    {
        # todo probably should be a toggle with flag
        if ( $#args >= 1 )
        {
            $msg_no = $args[1] ;
        }
        elsif ($msg_no == -1)
        {
            print "select msg no\n" ;
            print("> ") ;
            next ;
        }

        if ( $msg_no > $#threads )
        {
            print "msg out of range\n" ;
        }
        else
        {
            change_msg_status ( $threads[$msg_no], "-flagged" ) ;
        }
    }

    #
    # quit
    #
    elsif ($action eq "q")