/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+ public function getObjectType()
+ {
+ return ActivityObject::GROUP;
+ }
+
+
public static function schemaDef()
{
return array(
function setOriginal($filename)
{
- $imagefile = new ImageFile($this->id, Avatar::path($filename));
+ // This should be handled by the Profile->setOriginal function so user and group avatars are handled the same
+ $imagefile = new ImageFile(null, Avatar::path($filename));
+
+ $sizes = array('homepage_logo' => AVATAR_PROFILE_SIZE,
+ 'stream_logo' => AVATAR_STREAM_SIZE,
+ 'mini_logo' => AVATAR_MINI_SIZE);
$orig = clone($this);
$this->original_logo = Avatar::url($filename);
- $this->homepage_logo = Avatar::url($imagefile->resize(AVATAR_PROFILE_SIZE));
- $this->stream_logo = Avatar::url($imagefile->resize(AVATAR_STREAM_SIZE));
- $this->mini_logo = Avatar::url($imagefile->resize(AVATAR_MINI_SIZE));
+ foreach ($sizes as $name=>$size) {
+ $filename = Avatar::filename($this->profile_id, image_type_to_extension($imagefile->preferredType()),
+ $size, common_timestamp());
+ $imagefile->resizeTo(Avatar::path($filename), array('width'=>$size, 'height'=>$size));
+ $this->$name = Avatar::url($filename);
+ }
common_debug(common_log_objstring($this));
return $this->update($orig);
}
function isPrivate()
{
return ($this->join_policy == self::JOIN_POLICY_MODERATE &&
- $this->force_scope == 1);
+ intval($this->force_scope) === 1);
}
public function isLocal()