}
common_element('h2', NULL, _('Preferences'));
-
+
common_checkbox('emailnotifysub',
- _('Send me notices of new subscriptions through email.'),
- $user->emailnotifysub);
- common_checkbox('emailpost',
- _('I want to post notices by email.'),
- $user->emailpost);
-
+ _('Send me notices of new subscriptions through email.'),
+ $user->emailnotifysub);
+
common_submit('save', _('Save'));
common_element_end('form');
function save_preferences() {
$emailnotifysub = $this->boolean('emailnotifysub');
- $emailpost = $this->boolean('emailpost');
-
+
$user = common_current_user();
assert(!is_null($user)); # should already be checked
$original = clone($user);
$user->emailnotifysub = $emailnotifysub;
- $user->emailpost = $emailpost;
$result = $user->update($original);
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');
$jabbernotify = $this->boolean('jabbernotify');
$updatefrompresence = $this->boolean('updatefrompresence');
$jabberreplies = $this->boolean('jabberreplies');
+ $jabbermicroid = $this->boolean('jabbermicroid');
$user = common_current_user();
$user->jabbernotify = $jabbernotify;
$user->updatefrompresence = $updatefrompresence;
$user->jabberreplies = $jabberreplies;
+ $user->jabbermicroid = $jabbermicroid;
$result = $user->update($original);
# Looks like we're good; show the header
common_show_header(sprintf(_('%1$s\'s status on %2$s'), $profile->nickname, common_exact_date($notice->created)),
- NULL, $profile,
+ array($this, 'show_header'), $notice,
array($this, 'show_top'));
common_element_start('ul', array('id' => 'notices'));
common_show_footer();
}
- function show_top($user) {
+ function show_header($notice)
+ {
+ $profile = $notice->getProfile();
+ $user = User::staticGet($profile->id);
+ if (!$user) {
+ return;
+ }
+ if ($user->emailmicroid && $user->email && $notice->uri) {
+ common_element('meta', array('name' => 'microid',
+ 'content' => "mailto+http:sha1:" . sha1(sha1('mailto:' . $user->email) . sha1($notice->uri))));
+ }
+ if ($user->jabbermicroid && $user->jabber && $notice->uri) {
+ common_element('meta', array('name' => 'microid',
+ 'content' => "xmpp+http:sha1:" . sha1(sha1('xmpp:' . $user->jabber) . sha1($notice->uri))));
+ }
+ }
+
+ function show_top($notice) {
+ $user = $notice->getProfile();
$cur = common_current_user();
if ($cur && $cur->id == $user->id) {
common_element('meta', array('name' => 'description',
'content' => $profile->bio));
}
+
+ if ($user->emailmicroid && $user->email && $profile->profileurl) {
+ common_element('meta', array('name' => 'microid',
+ 'content' => "mailto+http:sha1:" . sha1(sha1('mailto:' . $user->email) . sha1($profile->profileurl))));
+ }
+ if ($user->jabbermicroid && $user->jabber && $profile->profileurl) {
+ common_element('meta', array('name' => 'microid',
+ 'content' => "xmpp+http:sha1:" . sha1(sha1('xmpp:' . $user->jabber) . sha1($profile->profileurl))));
+ }
+
}
function no_such_user() {
public $jabber; // varchar(255) unique_key
public $jabbernotify; // tinyint(1)
public $jabberreplies; // tinyint(1)
+ public $jabbermicroid; // tinyint(1) default_1
public $updatefrompresence; // tinyint(1)
public $sms; // varchar(64) unique_key
public $carrier; // int(4)
jabber varchar(255) unique key comment 'jabber ID for notices',
jabbernotify tinyint default 0 comment 'whether to send notices to jabber',
jabberreplies tinyint default 0 comment 'whether to send notices to jabber on replies',
+ jabbermicroid tinyint default 1 comment 'whether to publish xmpp microid',
updatefrompresence tinyint default 0 comment 'whether to record updates from Jabber presence notices',
sms varchar(64) unique key comment 'sms phone number',
carrier integer comment 'foreign key to sms_carrier' references sms_carrier (id),