3 * StatusNet, the distributed open-source microblogging tool
5 * Plugin to add a StatusNet Facebook application
9 * LICENCE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * @author Craig Andrews <candrews@integralblue.com
25 * @copyright 2009 StatusNet, Inc.
26 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET')) {
36 * IMAP plugin to allow StatusNet to grab incoming emails and handle them as new user posts
40 * @author Craig Andrews <candrews@integralblue.com
41 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
42 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
43 * @link http://status.net/
45 class ImapPlugin extends Plugin
50 public $poll_frequency = 60;
52 function initialize(){
53 if(!isset($this->mailbox)){
54 throw new Exception(_m("A mailbox must be specified."));
56 if(!isset($this->user)){
57 throw new Exception(_m("A user must be specified."));
59 if(!isset($this->password)){
60 throw new Exception(_m("A password must be specified."));
62 if(!isset($this->poll_frequency)){
63 throw new Exception(_m("A poll_frequency must be specified."));
70 * Load related modules when needed
72 * @param string $cls Name of the class to be loaded
74 * @return boolean hook value; true means continue processing, false means stop.
76 function onAutoload($cls)
78 $dir = dirname(__FILE__);
83 case 'IMAPMailHandler':
84 include_once $dir . '/'.strtolower($cls).'.php';
91 function onStartQueueDaemonIoManagers(&$classes)
93 $classes[] = new ImapManager($this);
96 function onPluginVersion(&$versions)
98 $versions[] = array('name' => 'IMAP',
99 'version' => STATUSNET_VERSION,
100 'author' => 'Craig Andrews',
101 'homepage' => 'http://status.net/wiki/Plugin:IMAP',
103 _m('The IMAP plugin allows for StatusNet to check a POP or IMAP mailbox for incoming mail containing user posts.'));