<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Settings for Jabber/XMPP integration
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Settings
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008-2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2008-2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
-require_once INSTALLDIR.'/lib/settingsaction.php';
+require_once INSTALLDIR.'/lib/connectsettingsaction.php';
require_once INSTALLDIR.'/lib/jabber.php';
/**
* Settings for Jabber/XMPP integration
*
* @category Settings
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
* @see SettingsAction
*/
-class ImsettingsAction extends SettingsAction
+class ImsettingsAction extends ConnectSettingsAction
{
/**
* Title of the page
function title()
{
- return _('IM Settings');
+ return _('IM settings');
}
/**
function showContent()
{
+ if (!common_config('xmpp', 'enabled')) {
+ $this->element('div', array('class' => 'error'),
+ _('IM is not available.'));
+ return;
+ }
+
$user = common_current_user();
$this->elementStart('form', array('method' => 'post',
- 'id' => 'imsettings',
+ 'id' => 'form_settings_im',
+ 'class' => 'form_settings',
'action' =>
common_local_url('imsettings')));
+ $this->elementStart('fieldset', array('id' => 'settings_im_address'));
+ $this->element('legend', null, _('Address'));
$this->hidden('token', common_session_token());
- $this->element('h2', null, _('Address'));
-
if ($user->jabber) {
- $this->elementStart('p');
- $this->element('span', 'address confirmed', $user->jabber);
- $this->element('span', 'input_instructions',
+ $this->element('p', 'form_confirmed', $user->jabber);
+ $this->element('p', 'form_note',
_('Current confirmed Jabber/GTalk address.'));
$this->hidden('jabber', $user->jabber);
- $this->elementEnd('p');
$this->submit('remove', _('Remove'));
} else {
$confirm = $this->getConfirmation();
if ($confirm) {
- $this->elementStart('p');
- $this->element('span', 'address unconfirmed', $confirm->address);
- $this->element('span', 'input_instructions',
+ $this->element('p', 'form_unconfirmed', $confirm->address);
+ $this->element('p', 'form_note',
sprintf(_('Awaiting confirmation on this address. '.
'Check your Jabber/GTalk account for a '.
'message with further instructions. '.
'(Did you add %s to your buddy list?)'),
jabber_daemon_address()));
$this->hidden('jabber', $confirm->address);
- $this->elementEnd('p');
$this->submit('cancel', _('Cancel'));
} else {
- $this->input('jabber', _('IM Address'),
+ $this->elementStart('ul', 'form_data');
+ $this->elementStart('li');
+ $this->input('jabber', _('IM address'),
($this->arg('jabber')) ? $this->arg('jabber') : null,
sprintf(_('Jabber or GTalk address, '.
'like "UserName@example.org". '.
'First, make sure to add %s to your '.
'buddy list in your IM client or on GTalk.'),
jabber_daemon_address()));
+ $this->elementEnd('li');
+ $this->elementEnd('ul');
$this->submit('add', _('Add'));
}
}
-
- $this->element('h2', null, _('Preferences'));
-
+ $this->elementEnd('fieldset');
+
+ $this->elementStart('fieldset', array('id' => 'settings_im_preferences'));
+ $this->element('legend', null, _('Preferences'));
+ $this->elementStart('ul', 'form_data');
+ $this->elementStart('li');
$this->checkbox('jabbernotify',
_('Send me notices through Jabber/GTalk.'),
$user->jabbernotify);
+ $this->elementEnd('li');
+ $this->elementStart('li');
$this->checkbox('updatefrompresence',
_('Post a notice when my Jabber/GTalk status changes.'),
$user->updatefrompresence);
+ $this->elementEnd('li');
+ $this->elementStart('li');
$this->checkbox('jabberreplies',
_('Send me replies through Jabber/GTalk '.
'from people I\'m not subscribed to.'),
$user->jabberreplies);
+ $this->elementEnd('li');
+ $this->elementStart('li');
$this->checkbox('jabbermicroid',
_('Publish a MicroID for my Jabber/GTalk address.'),
$user->jabbermicroid);
+ $this->elementEnd('li');
+ $this->elementEnd('ul');
$this->submit('save', _('Save'));
-
+ $this->elementEnd('fieldset');
$this->elementEnd('form');
}
$confirm->address_type = 'jabber';
$confirm->user_id = $user->id;
$confirm->code = common_confirmation_code(64);
+ $confirm->sent = common_sql_now();
+ $confirm->claimed = common_sql_now();
$result = $confirm->insert();
return;
}
- if (!common_config('queue', 'enabled')) {
- jabber_confirm_address($confirm->code,
- $user->nickname,
- $jabber);
- }
+ jabber_confirm_address($confirm->code,
+ $user->nickname,
+ $jabber);
$msg = sprintf(_('A confirmation code was sent '.
'to the IM address you added. '.