]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
define Reply::pkeyGet()
[quix0rs-gnu-social.git] / lib / util.php
index 0b637dd1cc4efe6b9d211efe4a3bff4586a5fd36..d35833851900758a2354849063050cdfe745e865 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, StatusNet, Inc.
+ * Copyright (C) 2008-2011, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -1470,8 +1470,7 @@ function common_redirect($url, $code=307)
 
 function common_enqueue_notice($notice)
 {
-    static $localTransports = array('omb',
-                                    'ping');
+    static $localTransports = array('ping');
 
     $transports = array();
     if (common_config('sms', 'enabled')) {
@@ -1502,7 +1501,7 @@ function common_enqueue_notice($notice)
 }
 
 /**
- * Broadcast profile updates to OMB and other remote subscribers.
+ * Broadcast profile updates to remote subscribers.
  *
  * Since this may be slow with a lot of subscribers or bad remote sites,
  * this is run through the background queues if possible.
@@ -2009,20 +2008,20 @@ function common_user_property($property)
 
 function common_profile_uri($profile)
 {
-    if (!$profile) {
-        return null;
-    }
-    $user = User::staticGet($profile->id);
-    if ($user) {
-        return $user->uri;
-    }
+    $uri = null;
 
-    $remote = Remote_profile::staticGet($profile->id);
-    if ($remote) {
-        return $remote->uri;
+    if (!empty($profile)) {
+        if (Event::handle('StartCommonProfileURI', array($profile, &$uri))) {
+            $user = User::staticGet($profile->id);
+            if (!empty($user)) {
+                $uri = $user->uri;
+            }
+            Event::handle('EndCommonProfileURI', array($profile, &$uri));
+        }
     }
+
     // XXX: this is a very bad profile!
-    return null;
+    return $uri;
 }
 
 function common_canonical_sms($sms)