+ /**
+ * Fetch the privacy of the post
+ *
+ * @param array $item Item record
+ * @return string Item privacy message
+ * @throws InvalidArgumentException If $item['private'] is unknown
+ */
+ private function fetchPrivacy(array $item): string
+ {
+ switch ($item['private']) {
+ case Item::PRIVATE:
+ $output = DI::l10n()->t('Private Message');
+ break;
+
+ case Item::PUBLIC:
+ $output = DI::l10n()->t('Public Message');
+ break;
+
+ case Item::UNLISTED:
+ $output = DI::l10n()->t('Unlisted Message');
+ break;
+
+ default:
+ throw new InvalidArgumentException('Item privacy ' . $item['privacy'] . ' is unsupported');
+ }
+
+ return $output;
+ }
+