+
+ /**
+ * This will perform shortenLinks with the connected User object.
+ *
+ * Won't work on remote profiles or groups, so expect a
+ * NoSuchUserException if you don't know it's a local User.
+ *
+ * @param string $text String to shorten
+ * @param boolean $always Disrespect minimum length etc.
+ *
+ * @return string link-shortened $text
+ */
+ public function shortenLinks($text, $always=false)
+ {
+ return $this->getUser()->shortenLinks($text, $always);
+ }
+
+ public function isPrivateStream()
+ {
+ // We only know of public remote users as of yet...
+ if (!$this->isLocal()) {
+ return false;
+ }
+ return $this->getUser()->private_stream ? true : false;
+ }
+
+ public function delPref($namespace, $topic) {
+ return Profile_prefs::setData($this, $namespace, $topic, null);
+ }
+
+ public function getPref($namespace, $topic, $default=null) {
+ // If you want an exception to be thrown, call Profile_prefs::getData directly
+ try {
+ return Profile_prefs::getData($this, $namespace, $topic, $default);
+ } catch (NoResultException $e) {
+ return null;
+ }
+ }
+
+ // The same as getPref but will fall back to common_config value for the same namespace/topic
+ public function getConfigPref($namespace, $topic)
+ {
+ return Profile_prefs::getConfigData($this, $namespace, $topic);
+ }
+
+ public function setPref($namespace, $topic, $data) {
+ return Profile_prefs::setData($this, $namespace, $topic, $data);
+ }