Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook request: message_saved #4503

Closed
rcubetrac opened this issue Apr 1, 2014 · 3 comments
Closed

Hook request: message_saved #4503

rcubetrac opened this issue Apr 1, 2014 · 3 comments

Comments

@rcubetrac
Copy link

Reported by rosali on 1 Apr 2014 07:32 UTC as Trac ticket #1489752

One of my plugins needs to know when a message is successfully appended to an IMAP folder. Please add the following hook to rcube_imap.php, method 'save_message' (lines 2329 ff.):

        if ($saved) {
            // let plugins know that a message has been appended
            rcube::get_instance()->plugins->exec_hook("message_saved", array('saved' => $saved, 'folder' => $folder, 'message' => $message));
            // increase messagecount of the target folder
            $this->set_messagecount($folder, 'ALL', 1);
        }

Migrated-From: http://trac.roundcube.net/ticket/1489752

@rcubetrac
Copy link
Author

Comment by rosali on 1 Apr 2014 07:59 UTC

Maybe it is better to pass all parameters to the hook:

        if ($saved) {
            // let plugins know that a message has been appended
            rcube::get_instance()->plugins->exec_hook("message_saved",
                array('saved' => $saved, 'folder' => $folder, 'message' => $message, 'headers' => $headers, 'flags' => $flags, 'date' => $date, 'is_file' => $is_file, 'binary' => $binary));
            // increase messagecount of the target folder
            $this->set_messagecount($folder, 'ALL', 1);
        }

@rcubetrac
Copy link
Author

Comment by @alecpl on 19 Apr 2014 14:55 UTC

Done in ed763b2.

@rcubetrac
Copy link
Author

Status changed by @alecpl on 19 Apr 2014 14:55 UTC

new => closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant