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()));
common_hidden('jabber',$confirm->address);
common_element_end('p');
common_submit('cancel',_('Cancel'));
}else{
common_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()));
common_submit('add',_('Add'));
}
}
common_element('h2',NULL,_('Preferences'));
common_checkbox('jabbernotify',
_('Send me notices through Jabber/GTalk.'),
$user->jabbernotify);
common_checkbox('updatefrompresence',
_('Post a notice when my Jabber/GTalk status changes.'),
$user->updatefrompresence);
common_checkbox('jabberreplies',
_('Send me replies through Jabber/GTalk from people I\'m not subscribed to.'),
$user->jabberreplies);
common_checkbox('jabbermicroid',
_('Publish a MicroID for my Jabber/GTalk address.'),
$user->jabbermicroid);
common_submit('save',_('Save'));
common_element_end('form');
common_show_footer();
}
functionget_confirmation(){
$user=common_current_user();
$confirm=newConfirm_address();
$confirm->user_id=$user->id;
$confirm->address_type='jabber';
if($confirm->find(TRUE)){
return$confirm;
}else{
returnNULL;
}
}
functionhandle_post(){
# CSRF protection
$token=$this->trimmed('token');
if(!$token||$token!=common_session_token()){
$this->show_form(_('There was a problem with your session token. Try again, please.'));
return;
}
if($this->arg('save')){
$this->save_preferences();
}elseif($this->arg('add')){
$this->add_address();
}elseif($this->arg('cancel')){
$this->cancel_confirmation();
}elseif($this->arg('remove')){
$this->remove_address();
}else{
$this->show_form(_('Unexpected form submission.'));