From: Evan Prodromou Date: Wed, 4 May 2011 21:59:39 +0000 (-0700) Subject: merge 0.9.x into 1.0.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c97048d01bea468e0cf8865b60c3c250b4515c39;p=quix0rs-gnu-social.git merge 0.9.x into 1.0.x --- c97048d01bea468e0cf8865b60c3c250b4515c39 diff --cc actions/newapplication.php index ca5d902a26,657c7bcb71..93ef417f63 --- a/actions/newapplication.php +++ b/actions/newapplication.php @@@ -295,9 -294,8 +295,8 @@@ class NewApplicationAction extends Owne $app->uploadLogo(); } catch (Exception $e) { $app->query('ROLLBACK'); - // TRANS: Form validation error on New application page when providing an invalid image upload. $this->showForm(_('Invalid image.')); - return; - return; ++ return; } $app->query('COMMIT'); diff --cc classes/Notice.php index ba66dd8054,d513695192..87363158dd --- a/classes/Notice.php +++ b/classes/Notice.php @@@ -570,11 -454,10 +570,11 @@@ class Notice extends Memcached_DataObje // XXX: Before we were blowing the casche only if the notice id // was not the root of the conversation. What to do now? - $this->blowStream('notice:conversation_ids:%d', $this->conversation); + self::blow('notice:conversation_ids:%d', $this->conversation); + self::blow('conversation::notice_count:%d', $this->conversation); if (!empty($this->repeat_of)) { - self::blow('notice:repeats:%d', $this->repeat_of); + $this->blowStream('notice:repeats:%d', $this->repeat_of); } $original = Notice::staticGet('id', $this->repeat_of); @@@ -610,20 -489,44 +611,56 @@@ if ($this->isPublic()) { self::blow('public;last'); } + + self::blow('fave:by_notice', $this->id); + + if ($this->conversation) { + // In case we're the first, will need to calc a new root. + self::blow('notice:conversation_root:%d', $this->conversation); + } + + $ptags = $this->getProfileTags(); + foreach ($ptags as $ptag) { + $ptag->blowNoticeStreamCache(true); + } } + function blowStream() + { + $c = self::memcache(); + + if (empty($c)) { + return false; + } + + $args = func_get_args(); + + $format = array_shift($args); + + $keyPart = vsprintf($format, $args); + + $cacheKey = Cache::key($keyPart); + + $c->delete($cacheKey); + + // delete the "last" stream, too, if this notice is + // older than the top of that stream + + $lastKey = $cacheKey.';last'; + + $lastStr = $c->get($lastKey); + + if ($lastStr !== false) { + $window = explode(',', $lastStr); + $lastID = $window[0]; + $lastNotice = Notice::staticGet('id', $lastID); + if (empty($lastNotice) // just weird + || strtotime($lastNotice->created) >= strtotime($this->created)) { + $c->delete($lastKey); + } + } + } + /** save all urls in the notice to the db * * follow redirects and save all available file information diff --cc lib/action.php index a16a027573,fef4259264..3492873c59 --- a/lib/action.php +++ b/lib/action.php @@@ -324,18 -295,12 +324,20 @@@ class Action extends HTMLOutputter // l } if (Event::handle('StartShowStatusNetScripts', array($this)) && Event::handle('StartShowLaconicaScripts', array($this))) { - $this->script('util.min.js'); + if (common_config('site', 'minify')) { + $this->script('util.min.js'); + } else { + $this->script('util.js'); + $this->script('xbImportNode.js'); + $this->script('geometa.js'); + } + $this->inlineScript('var _peopletagAC = "' . + common_local_url('peopletagautocomplete') . '";'); $this->showScriptMessages(); // Frame-busting code to avoid clickjacking attacks. - $this->inlineScript('if (window.top !== window.self) { window.top.location.href = window.self.location.href; }'); + if (common_config('javascript', 'bustframes')) { + $this->inlineScript('if (window.top !== window.self) { window.top.location.href = window.self.location.href; }'); + } Event::handle('EndShowStatusNetScripts', array($this)); Event::handle('EndShowLaconicaScripts', array($this)); }