summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-12-01 23:50:21 -0500
committerEvan Prodromou <evan@controlyourself.ca>2008-12-01 23:50:21 -0500
commitc3f2d195f934c4deff91d30640ec703cb576e55d (patch)
tree05392002bbefbcdb7225032669227cebd5e075b8 /actions
parentdf5ce60edc63217d42b026b0fb9b76269196568d (diff)
generate an etag for shownotice
darcs-hash:20081202045021-5ed1f-ca0f14051507602bab8898e1e99d9cdb69f2eadc.gz
Diffstat (limited to 'actions')
-rw-r--r--actions/shownotice.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/actions/shownotice.php b/actions/shownotice.php
index cedf09678..d32846aad 100644
--- a/actions/shownotice.php
+++ b/actions/shownotice.php
@@ -42,14 +42,24 @@ class ShownoticeAction extends StreamAction {
return false;
}
+ $this->avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);
+
return true;
}
function last_modified() {
- $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);
return max(strtotime($this->notice->modified),
strtotime($this->profile->modified),
- ($avatar) ? strtotime($this->avatar->modified) : 0);
+ ($this->avatar) ? strtotime($this->avatar->modified) : 0);
+ }
+
+ function etag() {
+ return 'W/"' . implode(':', array($this->arg('action'),
+ common_language(),
+ $this->notice->id,
+ strtotime($this->notice->modified),
+ strtotime($this->profile->modified),
+ ($this->avatar) ? strtotime($this->avatar->modified) : 0));
}
function handle($args) {