diff --git a/actions/apitimelinementions.php b/actions/apitimelinementions.php index ecd2a1a0e6..2b5053a84f 100644 --- a/actions/apitimelinementions.php +++ b/actions/apitimelinementions.php @@ -193,10 +193,18 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction { $notices = array(); - $notice = $this->user->getReplies( - ($this->page - 1) * $this->count, $this->count, - $this->since_id, $this->max_id - ); + if (empty($this->auth_user)) { + $profile = null; + } else { + $profile = $this->auth_user->getProfile(); + } + + $stream = new ReplyNoticeStream($this->user->id, $profile); + + $notice = $stream->getNotices(($this->page - 1) * $this->count, + $this->count, + $this->since_id, + $this->max_id); while ($notice->fetch()) { $notices[] = clone($notice); diff --git a/actions/invite.php b/actions/invite.php index 0e3a878f2e..1bfc9f76d3 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -60,7 +60,6 @@ class InviteAction extends CurrentUserDesignAction function sendInvitations() { if (Event::handle('StartSendInvitations', array(&$this))) { - // CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -162,7 +161,6 @@ class InviteAction extends CurrentUserDesignAction function showInvitationSuccess() { if (Event::handle('StartShowInvitationSuccess', array($this))) { - if ($this->already) { // TRANS: Message displayed inviting users to use a StatusNet site while the inviting user // TRANS: is already subscribed to one or more users with the given e-mail address(es). diff --git a/actions/replies.php b/actions/replies.php index 7ae2d0eb76..385ca4c6cc 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -85,8 +85,11 @@ class RepliesAction extends OwnerDesignAction common_set_returnto($this->selfUrl()); - $this->notice = $this->user->getReplies(($this->page-1) * NOTICES_PER_PAGE, - NOTICES_PER_PAGE + 1); + $stream = new ReplyNoticeStream($this->user->id, + Profile::current()); + + $this->notice = $stream->getNotices(($this->page-1) * NOTICES_PER_PAGE, + NOTICES_PER_PAGE + 1); if($this->page > 1 && $this->notice->N == 0){ // TRANS: Server error when page not found (404) diff --git a/classes/Invitation.php b/classes/Invitation.php index 0e87c1629c..27ff400883 100644 --- a/classes/Invitation.php +++ b/classes/Invitation.php @@ -14,6 +14,7 @@ class Invitation extends Memcached_DataObject public $user_id; // int(4) not_null public $address; // varchar(255) multiple_key not_null public $address_type; // varchar(8) multiple_key not_null + public $registered_user_id; // int(4) not_null public $created; // datetime() not_null /* Static get */ @@ -22,4 +23,11 @@ class Invitation extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE + + function convert($user) + { + $orig = clone($this); + $this->registered_user_id = $user->id; + return $this->update($orig); + } } diff --git a/classes/User.php b/classes/User.php index 8642c78c27..9f79549327 100644 --- a/classes/User.php +++ b/classes/User.php @@ -263,6 +263,8 @@ class User extends Memcached_DataObject $user->nickname = $nickname; + $invite = null; + // Users who respond to invite email have proven their ownership of that address if (!empty($code)) { @@ -353,6 +355,12 @@ class User extends Memcached_DataObject return false; } + // Mark that this invite was converted + + if (!empty($invite)) { + $invite->convert($user); + } + if (!empty($email) && !$user->email) { $confirm = new Confirm_address(); diff --git a/classes/statusnet.ini b/classes/statusnet.ini index bdf96c1ddc..c5c126a133 100644 --- a/classes/statusnet.ini +++ b/classes/statusnet.ini @@ -258,6 +258,7 @@ user_id = 129 address = 130 address_type = 130 created = 142 +registered_user_id = 1 [invitation__keys] code = K diff --git a/db/core.php b/db/core.php index 10d8e51b9b..626672bf5f 100644 --- a/db/core.php +++ b/db/core.php @@ -542,14 +542,17 @@ $schema['invitation'] = array( 'address' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'invitation sent to'), 'address_type' => array('type' => 'varchar', 'length' => 8, 'not null' => true, 'description' => 'address type ("email", "xmpp", "sms")'), 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'), + 'registered_user_id' => array('type' => 'int', 'not null' => false, 'description' => 'if the invitation is converted, who the new user is'), ), 'primary key' => array('code'), 'foreign keys' => array( 'invitation_user_id_fkey' => array('user', array('user_id' => 'id')), + 'invitation_registered_user_id_fkey' => array('user', array('registered_user_id' => 'id')), ), 'indexes' => array( 'invitation_address_idx' => array('address', 'address_type'), 'invitation_user_id_idx' => array('user_id'), + 'invitation_registered_user_id_idx' => array('registered_user_id'), ), ); diff --git a/lib/activityimporter.php b/lib/activityimporter.php index da6fc5e321..096eb9ba43 100644 --- a/lib/activityimporter.php +++ b/lib/activityimporter.php @@ -63,9 +63,9 @@ class ActivityImporter extends QueueHandler $done = null; - if (Event::handle('StartImportActivity', - array($user, $author, $activity, $trusted, &$done))) { - try { + try { + if (Event::handle('StartImportActivity', + array($user, $author, $activity, $trusted, &$done))) { switch ($activity->verb) { case ActivityVerb::FOLLOW: $this->subscribeProfile($user, $author, $activity); @@ -83,10 +83,10 @@ class ActivityImporter extends QueueHandler Event::handle('EndImportActivity', array($user, $author, $activity, $trusted)); $done = true; - } catch (Exception $e) { - common_log(LOG_ERR, $e->getMessage()); - $done = true; } + } catch (Exception $e) { + common_log(LOG_ERR, $e->getMessage()); + $done = true; } return $done; } diff --git a/lib/activityutils.php b/lib/activityutils.php index 3aa09deb4e..59f7cdcf3a 100644 --- a/lib/activityutils.php +++ b/lib/activityutils.php @@ -104,8 +104,9 @@ class ActivityUtils { $els = $element->childNodes; $out = array(); - - foreach ($els as $link) { + + for ($i = 0; $i < $els->length; $i++) { + $link = $els->item($i); if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) { $linkRel = $link->getAttribute(self::REL); $linkType = $link->getAttribute(self::TYPE); diff --git a/lib/inviteform.php b/lib/inviteform.php index da23d31264..364ca75b9b 100644 --- a/lib/inviteform.php +++ b/lib/inviteform.php @@ -41,7 +41,6 @@ require_once INSTALLDIR . '/lib/form.php'; * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ - * */ class InviteForm extends Form { @@ -95,21 +94,21 @@ class InviteForm extends Form { $this->out->elementStart('ul', 'form_data'); $this->out->elementStart('li'); - // TRANS: Field label for a list of e-mail addresses. $this->out->textarea( 'addresses', + // TRANS: Field label for a list of e-mail addresses. _('Email addresses'), $this->out->trimmed('addresses'), - // TRANS: Tooltip for field label for a list of e-mail addresses. + // TRANS: Field title for a list of e-mail addresses. _('Addresses of friends to invite (one per line).') ); $this->out->elementEnd('li'); $this->out->elementStart('li'); - // TRANS: Field label for a personal message to send to invitees. $this->out->textarea( + // TRANS: Field label for a personal message to send to invitees. 'personal', _('Personal message'), $this->out->trimmed('personal'), - // TRANS: Tooltip for field label for a personal message to send to invitees. + // TRANS: Field title for a personal message to send to invitees. _('Optionally add a personal message to the invitation.') ); $this->out->elementEnd('li'); @@ -123,13 +122,13 @@ class InviteForm extends Form */ function formActions() { - // TRANS: Send button for inviting friends $this->out->submit( 'send', + // TRANS: Send button for inviting friends _m('BUTTON','Send'), 'submit form_action-primary', - // TRANS: Submit button title. 'send', - _('Send') + // TRANS: Submit button title. + _('Send invitations.') ); } } diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php index 2d41e53017..b56cd28092 100644 --- a/lib/noticelistitem.php +++ b/lib/noticelistitem.php @@ -229,31 +229,44 @@ class NoticeListItem extends Widget function showAddressees() { - $this->out->elementStart('span', 'addressees'); + $ga = $this->getGroupAddressees(); + $pa = $this->getProfileAddressees(); - $cnt = $this->showGroupAddressees(true); - $cnt = $this->showProfileAddressees($cnt == 0); + $a = array_merge($ga, $pa); - $this->out->elementEnd('span', 'addressees'); + if (!empty($a)) { + $this->out->elementStart('span', 'addressees'); + $first = true; + foreach ($a as $addr) { + if (!$first) { + // TRANS: Separator in profile addressees list. + $this->out->text(_m('SEPARATOR',', ')); + } else { + // TRANS: Start of profile addressees list. + $first = false; + } + $text = $addr['text']; + unset($addr['text']); + $this->out->element('a', $addr, $text); + } + $this->out->elementEnd('span', 'addressees'); + } } - function showGroupAddressees($first) + function getGroupAddressees() { + $ga = array(); + $groups = $this->getGroups(); foreach ($groups as $group) { - if (!$first) { - $this->out->text( _m('SEPARATOR',', ')); - } else { - $first = false; - } - $this->out->element('a', array('href' => $group->homeUrl(), - 'title' => $group->nickname, - 'class' => 'addressee group'), - $group->getBestName()); + $ga[] = array('href' => $group->homeUrl(), + 'title' => $group->nickname, + 'class' => 'addressee group', + 'text' => $group->getBestName()); } - return count($groups); + return $ga; } function getGroups() @@ -261,25 +274,20 @@ class NoticeListItem extends Widget return $this->notice->getGroups(); } - function showProfileAddressees($first) + function getProfileAddressees() { + $pa = array(); + $replies = $this->getReplyProfiles(); foreach ($replies as $reply) { - if (!$first) { - // TRANS: Separator in profile addressees list. - $this->out->text(_m('SEPARATOR',', ')); - } else { - // TRANS: Start of profile addressees list. - $first = false; - } - $this->out->element('a', array('href' => $reply->profileurl, - 'title' => $reply->nickname, - 'class' => 'addressee account'), - $reply->getBestName()); + $pa[] = array('href' => $reply->profileurl, + 'title' => $reply->nickname, + 'class' => 'addressee account', + 'text' => $reply->getBestName()); } - return count($replies); + return $pa; } function getReplyProfiles() diff --git a/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php b/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php index e79a445f20..9390a6e083 100644 --- a/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php +++ b/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php @@ -77,6 +77,7 @@ class DomainStatusNetworkPlugin extends Plugin $sn = Status_network::staticGet('nickname', $nickname); } catch (Exception $e) { $this->log(LOG_ERR, $e->getMessage()); + return; } $tags = $sn->getTags(); diff --git a/plugins/DomainWhitelist/DomainWhitelistPlugin.php b/plugins/DomainWhitelist/DomainWhitelistPlugin.php index cf0d94884d..da49338fe7 100644 --- a/plugins/DomainWhitelist/DomainWhitelistPlugin.php +++ b/plugins/DomainWhitelist/DomainWhitelistPlugin.php @@ -118,7 +118,7 @@ class DomainWhitelistPlugin extends Plugin } else { // TRANS: Client exception thrown when a given e-mailaddress is not in the domain whitelist. // TRANS: %s are whitelisted e-mail domains separated by comma's (localisable). - $message = sprintf(_('Email address must be in one of these domains: %s.'), + $message = sprintf(_m('Email address must be in one of these domains: %s.'), // TRANS: Separator for whitelisted domains. implode(_m('SEPARATOR',', '), $whitelist)); } @@ -132,7 +132,7 @@ class DomainWhitelistPlugin extends Plugin { if (!$this->matchesWhitelist($email)) { // TRANS: Exception thrown when an e-mail address does not match the site's domain whitelist. - throw new Exception(_('That email address is not allowed on this site.')); + throw new Exception(_m('That email address is not allowed on this site.')); } return true; diff --git a/plugins/DomainWhitelist/lib/whitelistinviteform.php b/plugins/DomainWhitelist/lib/whitelistinviteform.php index 7ff730e6a8..77a48f92fa 100644 --- a/plugins/DomainWhitelist/lib/whitelistinviteform.php +++ b/plugins/DomainWhitelist/lib/whitelistinviteform.php @@ -46,7 +46,7 @@ require_once INSTALLDIR . '/lib/form.php'; class WhitelistInviteForm extends Form { private $whitelist = null; - + /** * Constructor * @@ -86,7 +86,7 @@ class WhitelistInviteForm extends Form function formLegend() { // TRANS: Form legend. - $this->out->element('legend', null, _('Invite collegues')); + $this->out->element('legend', null, _m('Invite collegues')); } /** @@ -101,17 +101,17 @@ class WhitelistInviteForm extends Form $this->showEmailLI(); } $this->out->elementStart('li'); - // TRANS: Field label for a personal message to send to invitees. $this->out->textarea( - 'personal', _('Personal message'), + // TRANS: Field label for a personal message to send to invitees. + 'personal', _m('Personal message'), $this->out->trimmed('personal'), - // TRANS: Tooltip for field label for a personal message to send to invitees. - _('Optionally add a personal message to the invitation.') + // TRANS: Field title for a personal message to send to invitees. + _m('Optionally add a personal message to the invitation.') ); $this->out->elementEnd('li'); $this->out->elementEnd('ul'); } - + function showEmailLI() { $this->out->elementStart('li'); @@ -119,8 +119,8 @@ class WhitelistInviteForm extends Form $this->out->text('@'); if (count($this->whitelist) == 1) { $this->out->element( - 'span', - array('class' => 'email_invite'), + 'span', + array('class' => 'email_invite'), $this->whitelist[0] ); $this->out->hidden('domain[]', $this->whitelist[0]); @@ -154,10 +154,11 @@ class WhitelistInviteForm extends Form 'href' => 'javascript://', 'style' => 'display: none;' ), + // TRANS: Link description to action to add another item to a list. _m('Add another item') ); } - + /** * Action elements * @@ -165,13 +166,13 @@ class WhitelistInviteForm extends Form */ function formActions() { - // TRANS: Send button for inviting friends $this->out->submit( 'send', + // TRANS: Send button for inviting friends. _m('BUTTON','Send'), 'submit form_action-primary', - // TRANS: Submit button title. 'send', - _('Send') + // TRANS: Submit button title. + _m('Send invitations.') ); } } diff --git a/plugins/EmailRegistration/emailregister.php b/plugins/EmailRegistration/emailregister.php index a7c8e8a2da..1b0902587f 100644 --- a/plugins/EmailRegistration/emailregister.php +++ b/plugins/EmailRegistration/emailregister.php @@ -107,7 +107,11 @@ class EmailregisterAction extends Action $this->invitation = Invitation::staticGet('code', $this->code); - if (empty($this->invitation)) { + if (!empty($this->invitation)) { + if (!empty($this->invitation->registered_user_id)) { + throw new ClientException(_m('Invitation already used.'), 403); + } + } else { $this->confirmation = Confirm_address::staticGet('code', $this->code); @@ -133,6 +137,9 @@ class EmailregisterAction extends Action } else { $this->invitation = Invitation::staticGet('code', $this->code); if (!empty($this->invitation)) { + if (!empty($this->invitation->registered_user_id)) { + throw new ClientException(_m('Invitation already used.'), 403); + } $this->state = self::CONFIRMINVITE; } else { $this->state = self::CONFIRMREGISTER; @@ -283,10 +290,15 @@ class EmailregisterAction extends Action $nickname = $this->nicknameFromEmail($email); try { - $this->user = User::register(array('nickname' => $nickname, - 'email' => $email, - 'password' => $this->password1, - 'email_confirmed' => true)); + $fields = array('nickname' => $nickname, + 'email' => $email, + 'password' => $this->password1, + 'email_confirmed' => true); + + if (!empty($this->invitation)) { + $fields['code'] = $this->invitation->code; + } + $this->user = User::register($fields); } catch (ClientException $e) { $this->error = $e->getMessage(); $nickname = $this->nicknameFromEmail($email); @@ -306,18 +318,8 @@ class EmailregisterAction extends Action // Re-init language env in case it changed (not yet, but soon) common_init_language(); - if (!empty($this->invitation)) { - $inviter = User::staticGet('id', $this->invitation->user_id); - if (!empty($inviter)) { - Subscription::start($inviter->getProfile(), - $this->user->getProfile()); - } - - $this->invitation->delete(); - } else if (!empty($this->confirmation)) { + if (!empty($this->confirmation)) { $this->confirmation->delete(); - } else { - throw new Exception('No confirmation thing.'); } Event::handle('EndRegistrationTry', array($this)); diff --git a/plugins/EmailRegistration/scripts/cancelemailregistration.php b/plugins/EmailRegistration/scripts/cancelemailregistration.php index e6430e850f..d834aade60 100644 --- a/plugins/EmailRegistration/scripts/cancelemailregistration.php +++ b/plugins/EmailRegistration/scripts/cancelemailregistration.php @@ -27,7 +27,7 @@ $helptext = << Options: --d --dryrun Don't actually delete the email registration and confirmation code +-d --dryrun Do not actually delete the email registration and confirmation code Cancel an email registration code diff --git a/plugins/ExtendedProfile/lib/extendedprofilewidget.php b/plugins/ExtendedProfile/lib/extendedprofilewidget.php index 03be420bea..f04dccd0ae 100644 --- a/plugins/ExtendedProfile/lib/extendedprofilewidget.php +++ b/plugins/ExtendedProfile/lib/extendedprofilewidget.php @@ -328,7 +328,7 @@ class ExtendedProfileWidget extends Form if (!empty($field['company'])) { $this->out->element('div', 'field', $field['company']); - // TRANS: Field label in experience area of extended profile (when did one start a position). + // TRANS: Field label in extended profile (when did one start a position or education). $this->out->element('div', 'label', _m('Start')); $this->out->element( 'div', @@ -336,7 +336,7 @@ class ExtendedProfileWidget extends Form date('j M Y', strtotime($field['start']) ) ); - // TRANS: Field label in experience area of extended profile (when did one end a position). + // TRANS: Field label in extended profile (when did one end a position or education). $this->out->element('div', 'label', _m('End')); $this->out->element( 'div', @@ -376,7 +376,7 @@ class ExtendedProfileWidget extends Form isset($field['company']) ? $field['company'] : null ); - // TRANS: Field label in experience edit area of extended profile (when did one start at a company). + // TRANS: Field label in extended profile (when did one start a position or education). $this->out->element('div', 'label', _m('Start')); $this->out->input( $id . '-start', @@ -384,7 +384,7 @@ class ExtendedProfileWidget extends Form isset($field['start']) ? date('j M Y', strtotime($field['start'])) : null ); - // TRANS: Field label in experience edit area of extended profile (when did one terminate at a company). + // TRANS: Field label in extended profile (when did one end a position or education). $this->out->element('div', 'label', _m('End')); $this->out->input( @@ -416,13 +416,13 @@ class ExtendedProfileWidget extends Form $this->out->element('div', 'label', _m('Institution')); if (!empty($field['school'])) { $this->out->element('div', 'field', $field['school']); - // TRANS: Field label in education area of extended profile. + // TRANS: Field label in extended profile for specifying an academic degree. $this->out->element('div', 'label', _m('Degree')); $this->out->element('div', 'field', $field['degree']); // TRANS: Field label in education area of extended profile. $this->out->element('div', 'label', _m('Description')); $this->out->element('div', 'field', $field['description']); - // TRANS: Field label in education area of extended profile (when did one start an education). + // TRANS: Field label in extended profile (when did one start a position or education). $this->out->element('div', 'label', _m('Start')); $this->out->element( 'div', @@ -430,7 +430,7 @@ class ExtendedProfileWidget extends Form date('j M Y', strtotime($field['start']) ) ); - // TRANS: Field label in education area of extended profile (when did one end a education). + // TRANS: Field label in extended profile (when did one end a position or education). $this->out->element('div', 'label', _m('End')); $this->out->element( 'div', @@ -460,7 +460,7 @@ class ExtendedProfileWidget extends Form isset($field['school']) ? $field['school'] : null ); - // TRANS: Field label in education edit area of extended profile. + // TRANS: Field label in extended profile for specifying an academic degree. $this->out->element('div', 'label', _m('Degree')); $this->out->input( $id . '-degree', @@ -477,7 +477,7 @@ class ExtendedProfileWidget extends Form isset($field['description']) ? $field['description'] : null ); - // TRANS: Field label in education edit area of extended profile (when did one start an education). + // TRANS: Field label in extended profile (when did one start a position or education). $this->out->element('div', 'label', _m('Start')); $this->out->input( $id . '-start', @@ -486,7 +486,7 @@ class ExtendedProfileWidget extends Form isset($field['start']) ? date('j M Y', strtotime($field['start'])) : null ); - // TRANS: Field label in education edit area of extended profile (when did one end an education). + // TRANS: Field label in extended profile (when did one end a position or education). $this->out->element('div', 'label', _m('End')); $this->out->input( $id . '-end', diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index 4c87f694bb..e149573e88 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -49,6 +49,7 @@ class MobileProfilePlugin extends WAP20Plugin { public $DTD = null; public $serveMobile = false; + public $reallyMobile = false; public $mobileFeatures = array(); function __construct($DTD='http://www.wapforum.org/DTD/xhtml-mobile10.dtd') @@ -160,6 +161,7 @@ class MobileProfilePlugin extends WAP20Plugin $this->setMobileFeatures($httpuseragent); $this->serveMobile = true; + $this->reallyMobile = true; break; } } @@ -201,21 +203,28 @@ class MobileProfilePlugin extends WAP20Plugin header('Content-Type: '.$type); - $action->extraHeaders(); - if (preg_match("/.*\/.*xml/", $type)) { - // Required for XML documents - $action->xw->startDocument('1.0', 'UTF-8'); - } - $action->xw->writeDTD('html', - '-//WAPFORUM//DTD XHTML Mobile 1.0//EN', - $this->DTD); + if ($this->reallyMobile) { - $language = $action->getLanguage(); + $action->extraHeaders(); + if (preg_match("/.*\/.*xml/", $type)) { + // Required for XML documents + $action->xw->startDocument('1.0', 'UTF-8'); + } + $action->xw->writeDTD('html', + '-//WAPFORUM//DTD XHTML Mobile 1.0//EN', + $this->DTD); - $action->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml', + $language = $action->getLanguage(); + + $action->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml', 'xml:lang' => $language)); - return false; + return false; + + } else { + return true; + } + } function setMobileFeatures($useragent) @@ -312,13 +321,15 @@ class MobileProfilePlugin extends WAP20Plugin function onStartShowLocalNavBlock($action) { if ($this->serveMobile) { - $action->element('a', array('href' => '#', 'id' => 'navtoggle'), 'Show Navigation'); + // @todo FIXME: "Show Navigation" / "Hide Navigation" needs i18n + $action->element('a', array('href' => '#', 'id' => 'navtoggle'), 'Show Navigation'); return true; } } function onEndShowScripts($action) { + // @todo FIXME: "Show Navigation" / "Hide Navigation" needs i18n $action->inlineScript(' $(function() { $("#mobile-toggle-disable").click(function() { @@ -337,6 +348,7 @@ class MobileProfilePlugin extends WAP20Plugin $("#navtoggle").text( text == "Show Navigation" ? "Hide Navigation" : "Show Navigation"); }); + $(".checkbox-wrapper").unbind("click"); });' ); } diff --git a/plugins/Msn/extlib/phpmsnclass/msn.class.php b/plugins/Msn/extlib/phpmsnclass/msn.class.php index 3d10c25b2c..5675eb5c2f 100644 --- a/plugins/Msn/extlib/phpmsnclass/msn.class.php +++ b/plugins/Msn/extlib/phpmsnclass/msn.class.php @@ -2973,7 +2973,7 @@ X-OIM-Sequence-Num: 1 // t=tick&p= // binary secret // RST2: messenger.msn.com - // t=tick + // t=tick // RST3: contacts.msn.com // t=tick&p= // RST4: messengersecure.live.com @@ -2985,7 +2985,7 @@ X-OIM-Sequence-Num: 1 preg_match("#". "(.*)(.*)". "(.*)(.*)". - "(.*)(.*)". + "(.*)(.*)". "(.*)(.*)". "(.*)(.*)". "(.*)(.*)". diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index af343362fb..1a02cdc8d3 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -327,7 +327,8 @@ class OStatusPlugin extends Plugin return false; } catch (Exception $e) { - // TRANS: Error message in OStatus plugin. + // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com + // TRANS: and example.net, as these are official standard domain names for use in examples. $err = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname."); } @@ -360,7 +361,8 @@ class OStatusPlugin extends Plugin return $this->filter(array($oprofile->localProfile())); } catch (Exception $e) { - // TRANS: Error message in OStatus plugin. + // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com + // TRANS: and example.net, as these are official standard domain names for use in examples. $this->msg = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname."); return array(); } diff --git a/plugins/OStatus/actions/ostatusgroup.php b/plugins/OStatus/actions/ostatusgroup.php index f2170c0346..e2c4121c3f 100644 --- a/plugins/OStatus/actions/ostatusgroup.php +++ b/plugins/OStatus/actions/ostatusgroup.php @@ -77,7 +77,8 @@ class OStatusGroupAction extends OStatusSubAction // TRANS: Field label. _m('Join group'), $this->profile_uri, - // TRANS: Tooltip for field label "Join group". + // TRANS: Tooltip for field label "Join group". Do not translate the "example.net" + // TRANS: domain name in the URL, as it is an official standard domain name for examples. _m("OStatus group's address, like http://example.net/group/nickname.")); $this->elementEnd('li'); $this->elementEnd('ul'); diff --git a/plugins/OStatus/actions/ostatussub.php b/plugins/OStatus/actions/ostatussub.php index c592e8b380..00f9c81faa 100644 --- a/plugins/OStatus/actions/ostatussub.php +++ b/plugins/OStatus/actions/ostatussub.php @@ -228,14 +228,16 @@ class OStatusSubAction extends Action } else if (Validate::uri($this->profile_uri)) { $this->oprofile = Ostatus_profile::ensureProfileURL($this->profile_uri); } else { - // TRANS: Error text. + // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com + // TRANS: and example.net, as these are official standard domain names for use in examples. $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname."); common_debug('Invalid address format.', __FILE__); return false; } return true; } catch (FeedSubBadURLException $e) { - // TRANS: Error text. + // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com + // TRANS: and example.net, as these are official standard domain names for use in examples. $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname."); common_debug('Invalid URL or could not reach server.', __FILE__); } catch (FeedSubBadResponseException $e) { @@ -260,7 +262,8 @@ class OStatusSubAction extends Action common_debug('Not a recognized feed type.', __FILE__); } catch (Exception $e) { // Any new ones we forgot about - // TRANS: Error text. + // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com + // TRANS: and example.net, as these are official standard domain names for use in examples. $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname."); common_debug(sprintf('Bad feed URL: %s %s', get_class($e), $e->getMessage()), __FILE__); } diff --git a/plugins/OStatus/actions/ostatustag.php b/plugins/OStatus/actions/ostatustag.php index 95f56bbfc4..1df74d9079 100644 --- a/plugins/OStatus/actions/ostatustag.php +++ b/plugins/OStatus/actions/ostatustag.php @@ -74,7 +74,7 @@ class OStatusTagAction extends OStatusInitAction // TRANS: Field label. $this->input('profile', _m('Profile Account'), $this->profile, // TRANS: Field title. - _m('Your account id (i.e. user@identi.ca).')); + _m('Your account id (for example user@identi.ca).')); $this->elementEnd('li'); $this->elementEnd('ul'); $this->submit('submit', $submit); diff --git a/plugins/QnA/classes/QnA_Answer.php b/plugins/QnA/classes/QnA_Answer.php index d200c7b45a..1a415f4af4 100644 --- a/plugins/QnA/classes/QnA_Answer.php +++ b/plugins/QnA/classes/QnA_Answer.php @@ -219,7 +219,7 @@ class QnA_Answer extends Managed_DataObject $out->elementStart('p', array('class' => implode(' ', $cls))); $out->elementStart('span', 'answer-content'); - $out->raw(QnAPlugin::shorten($answer->content, $notice)); + $out->raw(common_render_text($answer->content)); $out->elementEnd('span'); if (!empty($answer->revisions)) { diff --git a/plugins/QnA/classes/QnA_Question.php b/plugins/QnA/classes/QnA_Question.php index 77d5a57fb1..e2430087c0 100644 --- a/plugins/QnA/classes/QnA_Question.php +++ b/plugins/QnA/classes/QnA_Question.php @@ -227,7 +227,7 @@ class QnA_Question extends Managed_DataObject if (!empty($question->description)) { $out->elementStart('span', 'question-description'); - $out->raw(QnAPlugin::shorten($question->description, $notice)); + $out->raw(common_render_text($question->description)); $out->elementEnd('span'); } diff --git a/tests/ActivityParseTests.php b/tests/ActivityParseTests.php index c2817a4602..6423eaaf03 100644 --- a/tests/ActivityParseTests.php +++ b/tests/ActivityParseTests.php @@ -405,6 +405,28 @@ class ActivityParseTests extends PHPUnit_Framework_TestCase $act = new Activity($entry, $feed); $this->assertEquals($act->actor->id, $expected); } + + public function testBookmarkRelated() + { + global $_example11; + $dom = new DOMDocument(); + $dom->loadXML($_example11); + + $feed = $dom->documentElement; + $entry = $dom->getElementsByTagName('entry')->item(0); + + $expected = 'http://blog.teambox.com/open-source-companies'; + + $links = ActivityUtils::getLinks($entry, 'related'); + + $this->assertFalse(empty($links)); + $this->assertTrue(is_array($links)); + $this->assertEquals(count($links), 1); + + $url = $links[0]->getAttribute('href'); + + $this->assertEquals($url, $expected); + } } $_example1 = << EXAMPLE10; + +$_example11 = << + + StatusNet + http://freelish.us/api/statuses/user_timeline/1.atom + demon timeline + Updates from demon on freelish.us! + http://avatar.status.net/f/freelishus/1-96-20110331163048.jpeg + 2011-05-30T09:36:03-04:00 + + http://activitystrea.ms/schema/1.0/person + http://freelishus.status.net/user/1 + demon + + + + + + 45.50884 -73.58781 + demon + Evan Prodromou + Montreal hacker and entrepreneur. + + Montreal, Quebec + + + + homepage + http://evan.status.net/ + true + + + + + + http://activitystrea.ms/schema/1.0/person + http://freelishus.status.net/user/1 + Evan Prodromou + + + + + + 45.50884 -73.58781 + demon + Evan Prodromou + Montreal hacker and entrepreneur. + + Montreal, Quebec + + + + homepage + http://evan.status.net/ + true + + + + + + + + + + + + + + http://activitystrea.ms/schema/1.0/bookmark + http://freelish.us/bookmark/9e930c3e-7ed9-47de-aba5-df6c60cec542 + Why you should build an open-source startup | Teambox Blog + + + http://activitystrea.ms/schema/1.0/post + 2011-05-26T20:36:25+00:00 + 2011-05-26T20:36:25+00:00 + + + + + + + + + +EXAMPLE11; diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 6ae14d2c7d..40656b7cf9 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -418,10 +418,6 @@ address .poweredby { content: '\25B8'; } -.notice .addressees:empty:before { - content: none; -} - .fn { overflow: hidden; } diff --git a/theme/base/css/ie.css b/theme/base/css/ie.css index 9dfb176698..c6ddbac654 100644 --- a/theme/base/css/ie.css +++ b/theme/base/css/ie.css @@ -1,13 +1,19 @@ -/* Temporary copy of base styles for overriding */ +/* IE specific styles */ input.checkbox, input.radio { top:0; } + .form_notice textarea { - width: 485px; + width: 473px; } -.form_notice .count + label { + +.threaded-replies .form_notice textarea { + width: 385px; +} + +.form_notice .form_note + label { position:absolute; top:25px; left:83%; @@ -15,25 +21,47 @@ text-indent:-9999px; height:16px; width:16px; display:block; - top: 30px; + left: 390px; + top: 27px; } -.form_notice .submit { +.form_notice #notice_action-submit { width: 106px; max-width: 106px; } -.form_notice .attach-status, -.form_notice #notice_data-geo_selected { -width:78.75%; + +.form_notice .count { + right: 52px; } -.form_notice .attach-status button, -.form_notice #notice_data-geo_selected button { -padding:0 4px; + +#form_notice-direct.form_notice .count { + right: 18px; } + +#form_notice-direct label { + float: left; +} + +#form_notice-direct select { + margin-top: 0px; + float: left; +} + +.form_notice .error, +.form_notice .success, +.form_notice .notice-status { + width: 468px; +} + +.threaded-replies .form_notice textarea { + width: 395px; +} + .notice-options input.submit { font-size:0; text-align:right; text-indent:0; } + .notice div.entry-content .timestamp a { margin-right:4px; } @@ -54,8 +82,14 @@ z-index:9999; line-height:auto; } +#site_nav_global_primary ul { + margin-right: 0px; +} -/* IE specific styles */ +#site_nav_local_views ul { + list-style-type: none; + list-style-position: outside; +} .notice-options input.submit { color:#FFFFFF; @@ -65,16 +99,31 @@ line-height:auto; filter: alpha(opacity=0); } -.form_notice .count + label { - background:transparent url(../images/icons/icons-01.gif) no-repeat 0 -328px; +.notice .addressees:before { + content: '\003E'; } -.form_notice .notice_data-geo_wrap label { - background:transparent url(../images/icons/icons-01.gif) no-repeat 0 -1780px; +/* IE7 */ + +*+html .input_forms { + margin-bottom: -20px; } -.form_notice .notice_data-geo_wrap label.checked { - background:transparent url(../images/icons/icons-01.gif) no-repeat 0 -1846px; +*+html .notice .addressees { + background: url(../images/icons/arrow_right.png) no-repeat top left; + padding-left: 16px; } +/* IE6 */ +#content { + _width: 520px; +} + +#aside_primary { + _width: 190px; +} + +#content h1 { + _clear: left; +} diff --git a/theme/base/images/icons/arrow_right.png b/theme/base/images/icons/arrow_right.png new file mode 100644 index 0000000000..cefa7c2c7a Binary files /dev/null and b/theme/base/images/icons/arrow_right.png differ diff --git a/theme/neo/css/display.css b/theme/neo/css/display.css index 2ab4b9158d..a0df1e9cb4 100644 --- a/theme/neo/css/display.css +++ b/theme/neo/css/display.css @@ -383,7 +383,7 @@ address { } #form_notice-direct.form_notice .count { - top: 80px; + top: 78px; right: 7px; } @@ -450,6 +450,7 @@ address { text-align: left; color: #888; cursor: text; + background: #fff; } .input_form .form_settings li input { @@ -786,6 +787,10 @@ div.entry-content a.response:after { font-size: 1em; } +.threaded-replies:empty { + display: none; +} + .user_in .threaded-replies { margin-top: 0px; } diff --git a/theme/neo/css/ie.css b/theme/neo/css/ie.css deleted file mode 100644 index 9af3955301..0000000000 --- a/theme/neo/css/ie.css +++ /dev/null @@ -1,100 +0,0 @@ -/* Temporary copy of base styles for overriding */ - -input.checkbox, -input.radio { -top:0; -} -.form_notice textarea { - width: 473px; -} -.threaded-replies .form_notice textarea { - width: 385px; -} - -.form_notice .form_note + label { -position:absolute; -top:25px; -left:83%; -text-indent:-9999px; -height:16px; -width:16px; -display:block; - left: 390px; - top: 27px; -} -.form_notice #notice_action-submit { - width: 106px; - max-width: 106px; -} -.form_notice input.notice_data-attach_selected, -.form_notice #notice_data-geo_selected { -width:78.75%; -} -.form_notice input.notice_data-attach_selected button, -.form_notice #notice_data-geo_selected button { -padding:0 4px; -} -.notice-options input.submit { -font-size:0; -text-align:right; -text-indent:0; -} -.notice div.entry-content .timestamp a { -margin-right:4px; -} -.entity_profile { -width:64%; -} -.notice { -z-index:1; -} -.notice:hover { -z-index:9999; -} -.notice .thumbnail img { -z-index:9999; -} - -.form_settings fieldset fieldset legend { -line-height:auto; -} - -/* IE specific styles */ - -#site_nav_global_primary ul { - margin-right: 0px; -} - -#site_nav_local_views ul { - list-style-type: none; - list-style-position: outside; -} - -.notice-options input.submit { - color:#FFFFFF; -} - -.form_notice input.notice_data-attach { - filter: alpha(opacity=0); -} - -.form_notice .form_note + label { - background:transparent url(../../rebase/images/icons/icons-01.gif) no-repeat 0 -328px; -} - -.form_notice #notice_data-geo_wrap label { - background:transparent url(../../rebase/images/icons/icons-01.gif) no-repeat 0 -1780px; -} -.form_notice #notice_data-geo_wrap label.checked { - background:transparent url(../../rebase/images/icons/icons-01.gif) no-repeat 0 -1846px; -} - -/* IE6 sucks */ - -#content { - _width: 520px; -} - -#aside_primary { - _width: 190px; -} diff --git a/theme/neo/css/mp-screen.css b/theme/neo/css/mp-screen.css index 559e71ce00..578736810e 100644 --- a/theme/neo/css/mp-screen.css +++ b/theme/neo/css/mp-screen.css @@ -120,6 +120,10 @@ address img + .fn { color: #333; font-size: 1em; margin-bottom: 0px; + background: none; + text-transform: none; + letter-spacing: 0; + padding-bottom: 0; } #site_nav_local_views li { @@ -240,6 +244,12 @@ address img + .fn { left: 270px; } +.form_notice .error, +.form_notice .success, +.form_notice .notice-status { + width: 285px; +} + /*input type=file no good in iPhone/iPod Touch, Android, Opera Mini Simulator @@ -254,6 +264,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator clear: left; float: left; width: 200px; + z-index: 2; } .form_notice .checkbox-wrapper { @@ -262,7 +273,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator } .checkbox-wrapper label.checkbox { - display: none; + display: none !important; } .checkbox-wrapper #notice_private { @@ -283,6 +294,10 @@ iPhone/iPod Touch, Android, Opera Mini Simulator width: 300px; } +.input_form .form_settings label { + display: inline; +} + .input_form .form_settings li input { width: 292px; } @@ -295,6 +310,11 @@ iPhone/iPod Touch, Android, Opera Mini Simulator display: none; } +#event-startdate, #event-starttime, #event-enddate, #event-endtime { + width: 120px; + margin-right: 12px; +} + .input_form .form_settings .submit { font-size: 1em; margin: 10px 0; @@ -305,7 +325,8 @@ iPhone/iPod Touch, Android, Opera Mini Simulator .form_notice #notice_action-submit { text-align: center; left: 0px; - top: 192px; + top: 100%; + margin-top: -45px; width: 80px; font-size: 1em; } @@ -406,10 +427,6 @@ margin-left:0 !important; content: '\003E'; } -.notice .addressees:empty:before { - content: none; -} - .user_in .notice div.entry-content { max-width: 150px; } @@ -426,6 +443,10 @@ ul.qna-dummy { width: 220px; } +.threaded-replies #answer-form fieldset { + width: 220px; +} + .threaded-replies #qna-answer-submit { float: left; clear: left;