/**
  * An entity tag for this stream
  *
  * Returns an Etag based on the action name, language, user ID, and
  * timestamps of the first and last notice in the timeline
  *
  * @return string etag
  */
 function etag()
 {
     if (!empty($this->notices) && count($this->notices) > 0) {
         $last = count($this->notices) - 1;
         return '"' . implode(':', array($this->arg('action'), common_user_cache_hash($this->auth_user), common_language(), $this->target->id, strtotime($this->notices[0]->created), strtotime($this->notices[$last]->created))) . '"';
     }
     return null;
 }
Example #2
0
 /**
  * An entity tag for this page
  *
  * Shows the ETag for the page, based on the notice ID and timestamps
  * for the notice, profile, and avatar. It's weak, since we change
  * the date text "one hour ago", etc.
  *
  * @return string etag
  */
 function etag()
 {
     return '"' . implode(':', array($this->arg('action'), common_user_cache_hash(), crc32($this->arg('term')), $this->arg('limit'), $this->lastModified())) . '"';
 }
Example #3
0
 /**
  * An entity tag for this notice
  *
  * Returns an Etag based on the action name, language, and
  * timestamps of the notice
  *
  * @return string etag
  */
 function etag()
 {
     if (!empty($this->notice)) {
         return '"' . implode(':', array($this->arg('action'), common_user_cache_hash($this->auth_user), common_language(), $this->notice->id, strtotime($this->notice->created))) . '"';
     }
     return null;
 }
Example #4
0
 /**
  * An entity tag for this page
  *
  * Shows the ETag for the page, based on the notice ID and timestamps
  * for the notice, profile, and avatar. It's weak, since we change
  * the date text "one hour ago", etc.
  *
  * @return string etag
  */
 function etag()
 {
     $avtime = $this->avatar ? strtotime($this->avatar->modified) : 0;
     return 'W/"' . implode(':', array($this->arg('action'), common_user_cache_hash(), common_language(), $this->notice->id, strtotime($this->notice->created), strtotime($this->profile->modified), $avtime)) . '"';
 }
Example #5
0
 /**
  * Return etag, if applicable.
  *
  * MAY override
  *
  * @return string etag http header
  */
 function etag()
 {
     return 'W/"' . implode(':', array($this->arg('action'), common_user_cache_hash(), common_language(), $this->file->id)) . '"';
 }
 /**
  * Return etag, if applicable.
  *
  * MAY override
  *
  * @return string etag http header
  */
 function etag()
 {
     try {
         $avatar = $this->sender->getAvatar(AVATAR_STREAM_SIZE);
         $avtime = strtotime($avatar->modified);
     } catch (Exception $e) {
         $avtime = 0;
     }
     return 'W/"' . implode(':', array($this->arg('action'), common_user_cache_hash(), common_language(), $this->gm->id, strtotime($this->sender->modified), strtotime($this->group->modified), $avtime)) . '"';
 }
Example #7
0
 /**
  * An entity tag for this action
  *
  * Returns an Etag based on the action name, language, user ID, and
  * timestamps of the first and last profiles in the subscriptions list
  * There's also an indicator to show whether this action is being called
  * as /api/statuses/(friends|followers) or /api/(friends|followers)/ids
  *
  * @return string etag
  */
 function etag()
 {
     if (!empty($this->profiles) && count($this->profiles) > 0) {
         $last = count($this->profiles) - 1;
         return '"' . implode(':', array($this->arg('action'), common_user_cache_hash($this->auth_user), common_language(), $this->user->id, isset($this->ids_only) ? 'IDs' : 'Profiles', strtotime($this->profiles[0]->created), strtotime($this->profiles[$last]->created))) . '"';
     }
     return null;
 }
Example #8
0
 /**
  * Return etag, if applicable.
  *
  * MAY override
  *
  * @return string etag http header
  */
 function etag()
 {
     return 'W/"' . implode(':', array($this->getActionName(), common_user_cache_hash(), common_language(), $this->file->getID())) . '"';
 }