aboutsummaryrefslogtreecommitdiffstats
path: root/include/ConversationObject.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/ConversationObject.php')
-rw-r--r--include/ConversationObject.php29
1 files changed, 9 insertions, 20 deletions
diff --git a/include/ConversationObject.php b/include/ConversationObject.php
index 7e0d67c10..82f381b0c 100644
--- a/include/ConversationObject.php
+++ b/include/ConversationObject.php
@@ -15,6 +15,7 @@ require_once('include/items.php');
*/
class Conversation extends BaseObject {
+
private $threads = array();
private $mode = null;
private $observer = null;
@@ -47,33 +48,26 @@ class Conversation extends BaseObject {
$a = $this->get_app();
- $this->observer = $a->get_observer();
+ $this->observer = App::get_observer();
$ob_hash = (($this->observer) ? $this->observer['xchan_hash'] : '');
switch($mode) {
case 'network':
-// if(array_key_exists('firehose',$a->data) && intval($a->data['firehose'])) {
-// $this->profile_owner = intval($a->data['firehose']);
-// $this->writable = false;
-// }
-// else {
- $this->profile_owner = local_channel();
- $this->writable = true;
-// }
+ $this->profile_owner = local_channel();
+ $this->writable = true;
break;
case 'channel':
- $this->profile_owner = $a->profile['profile_uid'];
+ $this->profile_owner = App::$profile['profile_uid'];
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
break;
case 'display':
// in this mode we set profile_owner after initialisation (from conversation()) and then
// pull some trickery which allows us to re-invoke this function afterward
// it's an ugly hack so FIXME
-// $this->profile_owner = $a->profile['uid'];
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
break;
case 'page':
- $this->profile_owner = $a->profile['uid'];
+ $this->profile_owner = App::$profile['uid'];
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
break;
default:
@@ -142,11 +136,11 @@ class Conversation extends BaseObject {
public function add_thread($item) {
$item_id = $item->get_id();
if(!$item_id) {
- logger('[ERROR] Conversation::add_thread : Item has no ID!!', LOGGER_DEBUG);
+ logger('Item has no ID!!', LOGGER_DEBUG, LOG_ERR);
return false;
}
if($this->get_thread($item->get_id())) {
- logger('[WARN] Conversation::add_thread : Thread already exists ('. $item->get_id() .').', LOGGER_DEBUG);
+ logger('Thread already exists ('. $item->get_id() .').', LOGGER_DEBUG, LOG_WARNING);
return false;
}
@@ -177,11 +171,6 @@ class Conversation extends BaseObject {
}
}
require_once('include/identity.php');
-// $sys = get_sys_channel();
-
-// if($sys && $item->get_data_value('uid') == $sys['channel_id']) {
-// $item->set_commentable(false);
-// }
$item->set_conversation($this);
$this->threads[] = $item;
@@ -209,7 +198,7 @@ class Conversation extends BaseObject {
$item_data = $item->get_template_data($conv_responses);
}
if(!$item_data) {
- logger('[ERROR] Conversation::get_template_data : Failed to get item template data ('. $item->get_id() .').', LOGGER_DEBUG);
+ logger('Failed to get item template data ('. $item->get_id() .').', LOGGER_DEBUG, LOG_ERR);
return false;
}
$result[] = $item_data;