+ public function __construct($mode, $preview) {
+ $this->set_mode($mode);
+ $this->preview = $preview;
+ }
+
+ /**
+ * Set the mode we'll be displayed on
+ */
+ private function set_mode($mode) {
+ if($this->get_mode() == $mode)
+ return;
+
+ $a = $this->get_app();
+
+ switch($mode) {
+ case 'network':
+ case 'notes':
+ $this->profile_owner = local_user();
+ $this->writable = true;
+ break;
+ case 'profile':
+ $this->profile_owner = $a->profile['profile_uid'];
+ $this->writable = can_write_wall($a,$this->profile_owner);
+ break;
+ case 'display':
+ $this->profile_owner = $a->profile['uid'];
+ $this->writable = can_write_wall($a,$this->profile_owner);
+ break;
+ default:
+ logger('[ERROR] Conversation::set_mode : Unhandled mode ('. $mode .').', LOGGER_DEBUG);
+ return false;
+ break;
+ }