SSilence / php-imap-client

a easy solution for simple IMAP email access in php
MIT License
268 stars 136 forks source link

setFlag methods #193

Closed reimax closed 6 years ago

reimax commented 6 years ago

in ImapClient.php add:

     /**
     * Set flag message
     *
     * @param int $ids or string like 1,2,3,4,5 or string like 1:5
     * @return bool
     */
    public function setFlagMessage($ids, $flags)
    {
        // We need better docs for this
        return imap_setflag_full($this->imap, $ids, $flags, ST_UID);
    }

    /**
     * Unset flag message
     *
     * @param int $ids or string like 1,2,3,4,5 or string like 1:5
     * @return bool
     */
    public function unsetFlagMessage($ids, $flags)
    {
        // We need better docs for this
        return imap_clearflag_full($this->imap, $ids, $flags, ST_UID);
    }

and use:

$imap->setFlagMessage(message_uid, message_flag);

$imap->unsetFlagMessage(message_uid, message_flag);

default setUnseenMessage() not work since there is no additional option ST_UID. http://php.net/manual/ru/function.imap-clearflag-full.php

mattparksjr commented 6 years ago

Hey! We have some issues, please fix the conflicts before I merge!

reimax commented 6 years ago

I only added two methods, conflicts with existing code I not have.

mattparksjr commented 6 years ago

When attempting to merge I can granted with conflicts. In order to fix this please remake a new clone, commit the code again and then I will merge this

reimax commented 6 years ago

I gave a working solution for a problem. The merge issue nothing to do with my decision. How to resolve these dependencies I do not see. My request is why it got to one that already existed. Mistakes in prev pull are not my mistakes, I didn't make edits on the code in the main library.

i chahge 1 file, error in 16...

mattparksjr commented 6 years ago

Okay, I will handle and fix this later

mattparksjr commented 6 years ago

Fixed the issue. Merged.

reimax commented 6 years ago

setFlagMessage(), unsetFlagMessage() not add.