|
|
|
@ -118,12 +118,18 @@
|
|
|
|
|
*/
|
|
|
|
|
function to_listing_data(): array {
|
|
|
|
|
$details = get_object_vars($this);
|
|
|
|
|
unset($details['server']);
|
|
|
|
|
$details['join_url'] = $this->get_join_url();
|
|
|
|
|
$details['tags'] = array_map(function(\CommunityTag $tag) {
|
|
|
|
|
return $tag->text;
|
|
|
|
|
}, $this->tags);
|
|
|
|
|
unset($details['message_sequence']);
|
|
|
|
|
return $details;
|
|
|
|
|
unset($details['tags']);
|
|
|
|
|
unset($details['language_flag']);
|
|
|
|
|
return array(
|
|
|
|
|
"api" => $details,
|
|
|
|
|
"extras" => array(
|
|
|
|
|
"join_url" => $this->get_join_url(),
|
|
|
|
|
"language_flag" => $this->language_flag,
|
|
|
|
|
"tags" => $this->get_raw_tags()
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -317,6 +323,15 @@
|
|
|
|
|
return count($this->get_staff()) < $minimal_staff_count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string[]
|
|
|
|
|
*/
|
|
|
|
|
function get_raw_tags(): array {
|
|
|
|
|
return array_map(function(\CommunityTag $tag) {
|
|
|
|
|
return $tag->text;
|
|
|
|
|
}, $this->tags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return the tags associated with this room.
|
|
|
|
|
* @return \CommunityTag[] Tags as string array.
|
|
|
|
|