+ /**
+ * Get default text for the comment box
+ *
+ * @return string
+ */
+ private function getDefaultText()
+ {
+ if (!local_user()) {
+ return;
+ }
+
+ $a = self::getApp();
+
+ $item = Item::selectFirst(['author-addr'], ['id' => $this->getId()]);
+ if (!DBA::isResult($item) || empty($item['author-addr'])) {
+ // Should not happen
+ return '';
+ }
+
+ if ($item['author-addr'] != $a->profile['addr']) {
+ $text = '@' . $item['author-addr'] . ' ';
+ } else {
+ $text = '';
+ }
+
+ $terms = Term::tagArrayFromItemId($this->getId(), TERM_MENTION);
+
+ foreach ($terms as $term) {
+ $profile = Contact::getDetailsByURL($term['url']);
+ if (!empty($profile['addr']) && ($profile['contact-type'] != Contact::TYPE_COMMUNITY) &&
+ ($profile['addr'] != $a->profile['addr']) && !strstr($text, $profile['addr'])) {
+ $text .= '@' . $profile['addr'] . ' ';
+ }
+ }
+
+ return $text;
+ }
+