+ foreach ($prefill as $fieldName) {
+ if (array_key_exists($fieldName, $options)) {
+ $this->$fieldName = $options[$fieldName];
+ }
+ }
+
+ // Prefill the profile if we're replying
+
+ if (empty($this->to_profile) &&
+ !empty($this->inreplyto)) {
+ $notice = Notice::getKV('id', $this->inreplyto);
+ if (!empty($notice)) {
+ $this->to_profile = $notice->getProfile();
+ }
+ }
+
+ if (array_key_exists('user', $options)) {
+ $this->user = $options['user'];