]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/OStatusPlugin.php
Copy-and-paste error in OStatus button output
[quix0rs-gnu-social.git] / plugins / OStatus / OStatusPlugin.php
index a74ce6201b9a95374567b8ba26f9da1d5e62f198..78408365dfa15a4f859ba7b01062fe128b7eed11 100644 (file)
@@ -125,11 +125,18 @@ class OStatusPlugin extends Plugin
      */
     function onStartEnqueueNotice($notice, &$transports)
     {
-        // FIXME: we don't do privacy-controlled OStatus updates yet.
-        // once that happens, finer grain of control here.
-        if ($notice->isLocal() && $notice->inScope(null)) {
-            // put our transport first, in case there's any conflict (like OMB)
-            array_unshift($transports, 'ostatus');
+        if ($notice->isLocal()) {
+                if ($notice->inScope(null)) {  
+               // put our transport first, in case there's any conflict (like OMB)
+               array_unshift($transports, 'ostatus');
+                       $this->log(LOG_INFO, "Notice {$notice->id} queued for OStatus processing");
+                } else {
+                       // FIXME: we don't do privacy-controlled OStatus updates yet.
+                       // once that happens, finer grain of control here.
+                       $this->log(LOG_NOTICE, "Not queueing notice {$notice->id} for OStatus because of privacy; scope = {$notice->scope}");
+                }
+        } else {
+               $this->log(LOG_NOTICE, "Not queueing notice {$notice->id} for OStatus because it's not local.");
         }
         return true;
     }
@@ -239,8 +246,8 @@ class OStatusPlugin extends Plugin
         $cur = common_current_user();
 
         if (empty($cur)) {
-            $output->elementStart('li', 'entity_subscribe');
-            $profile = $peopletag->getTagger();
+            $widget->out->elementStart('li', 'entity_subscribe');
+
             $url = common_local_url('ostatusinit',
                                     array('group' => $group->nickname));
             $widget->out->element('a', array('href' => $url,
@@ -248,7 +255,7 @@ class OStatusPlugin extends Plugin
                                 // TRANS: Link to subscribe to a remote entity.
                                 _m('Subscribe'));
 
-            $output->elementEnd('li');
+            $widget->out->elementEnd('li');
             return false;
         }
 
@@ -286,7 +293,7 @@ class OStatusPlugin extends Plugin
 
         $action->elementStart('fieldset');
         // TRANS: Fieldset legend.
-        $action->element('legend', null, _m('Tag remote profile'));
+        $action->element('legend', null, _m('List remote profile'));
         $action->hidden('token', common_session_token());
 
         $user = common_current_user();
@@ -327,7 +334,8 @@ class OStatusPlugin extends Plugin
                 return false;
 
             } catch (Exception $e) {
-                // TRANS: Error message in OStatus plugin.
+                // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com
+                // TRANS: and example.net, as these are official standard domain names for use in examples.
                 $err = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname.");
             }
 
@@ -342,8 +350,7 @@ class OStatusPlugin extends Plugin
      */
     function onStartProfileCompletionSearch($action, $profile, $search_engine) {
         if ($action->field == 'uri') {
-            $user = new User();
-            $profile->joinAdd($user);
+            $profile->joinAdd(array('id', 'user:id'));
             $profile->whereAdd('uri LIKE "%' . $profile->escape($q) . '%"');
             $profile->query();
 
@@ -360,7 +367,8 @@ class OStatusPlugin extends Plugin
                     return $this->filter(array($oprofile->localProfile()));
 
                 } catch (Exception $e) {
-                    // TRANS: Error message in OStatus plugin.
+                // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com
+                // TRANS: and example.net, as these are official standard domain names for use in examples.
                     $this->msg = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname.");
                     return array();
                 }
@@ -575,8 +583,7 @@ class OStatusPlugin extends Plugin
                 }
 
                 $url = $notice->url;
-                // TRANS: Title.
-                // TRANS: %s is a domain name.
+                // TRANS: Title. %s is a domain name.
                 $title = sprintf(_m('Sent from %s via OStatus'), $domain);
                 return false;
             }
@@ -774,7 +781,7 @@ class OStatusPlugin extends Plugin
             $act->object = $oprofile->asActivityObject();
 
             $act->time = time();
-            // TRANS: Title to join a remote group.
+            // TRANS: Title for joining a remote groep.
             $act->title = _m('TITLE','Join');
             // TRANS: Success message for subscribe to group attempt through OStatus.
             // TRANS: %1$s is the member name, %2$s is the subscribed group's name.
@@ -854,8 +861,8 @@ class OStatusPlugin extends Plugin
         $oprofile = Ostatus_profile::staticGet('peopletag_id', $peopletag->id);
         if ($oprofile) {
             if (!$oprofile->subscribe()) {
-                // TRANS: Exception thrown when setup of remote people tag subscription fails.
-                throw new Exception(_m('Could not set up remote people tag subscription.'));
+                // TRANS: Exception thrown when setup of remote list subscription fails.
+                throw new Exception(_m('Could not set up remote list subscription.'));
             }
 
             $sub = $user->getProfile();
@@ -872,11 +879,11 @@ class OStatusPlugin extends Plugin
             $act->object = $oprofile->asActivityObject();
 
             $act->time = time();
-            // TRANS: Title for remote follow list.
+            // TRANS: Title for following a remote list.
             $act->title = _m('TITLE','Follow list');
             // TRANS: Success message for remote list follow through OStatus.
-            // TRANS: %1$s is the subscriber name, %2$s the prople tag, %3$s is the tagger's name.
-            $act->content = sprintf(_m("%1$s is now following people tagged %2$s by %3$s."),
+            // TRANS: %1$s is the subscriber name, %2$s is the list, %3$s is the lister's name.
+            $act->content = sprintf(_m('%1$s is now following people listed in %2$s by %3$s.'),
                                     $sub->getBestName(),
                                     $oprofile->getBestName(),
                                     $tagger->getBestName());
@@ -885,8 +892,8 @@ class OStatusPlugin extends Plugin
                 return true;
             } else {
                 $oprofile->garbageCollect();
-                // TRANS: Exception thrown when subscription of remote people tag fails.
-                throw new Exception(_m('Failed subscribing to remote people tag.'));
+                // TRANS: Exception thrown when subscription to remote list fails.
+                throw new Exception(_m('Failed subscribing to remote list.'));
             }
         }
     }
@@ -922,7 +929,10 @@ class OStatusPlugin extends Plugin
             $act->object = $oprofile->asActivityObject();
 
             $act->time = time();
-            $act->title = _m('Unfollow people tag');
+            // TRANS: Title for unfollowing a remote list.
+            $act->title = _m('Unfollow list');
+            // TRANS: Success message for remote list unfollow through OStatus.
+            // TRANS: %1$s is the subscriber name, %2$s is the list, %3$s is the lister's name.
             $act->content = sprintf(_m('%1$s stopped following the list %2$s by %3$s.'),
                                     $sub->getBestName(),
                                     $oprofile->getBestName(),
@@ -999,8 +1009,11 @@ class OStatusPlugin extends Plugin
                                   $plist->tagger, $plist->id,
                                   common_date_iso8601(time()));
         $act->time = time();
-        $act->title = _m('TITLE','Tag');
-        $act->content = sprintf(_m('%1$s tagged %2$s in the list %3$s.'),
+        // TRANS: Title for listing a remote profile.
+        $act->title = _m('TITLE','List');
+        // TRANS: Success message for remote list addition through OStatus.
+        // TRANS: %1$s is the list creator's name, %2$s is the added list member, %3$s is the list name.
+        $act->content = sprintf(_m('%1$s listed %2$s in the list %3$s.'),
                                 $tagger->getBestName(),
                                 $tagged->getBestName(),
                                 $plist->getBestName());
@@ -1013,8 +1026,9 @@ class OStatusPlugin extends Plugin
 
         // initiate a PuSH subscription for the person being tagged
         if (!$oprofile->subscribe()) {
+            // TRANS: Exception thrown when subscribing to a remote list fails.
             throw new Exception(sprintf(_m('Could not complete subscription to remote '.
-                                          'profile\'s feed. Tag %s could not be saved.'), $ptag->tag));
+                                          'profile\'s feed. List %s could not be saved.'), $ptag->tag));
             return false;
         }
         return true;
@@ -1052,8 +1066,11 @@ class OStatusPlugin extends Plugin
                                   $plist->tagger, $plist->id,
                                   common_date_iso8601(time()));
         $act->time = time();
-        $act->title = _m('TITLE','Untag');
-        $act->content = sprintf(_('%1$s untagged %2$s from the list %3$s.'),
+        // TRANS: Title for unlisting a remote profile.
+        $act->title = _m('TITLE','Unlist');
+        // TRANS: Success message for remote list removal through OStatus.
+        // TRANS: %1$s is the list creator's name, %2$s is the removed list member, %3$s is the list name.
+        $act->content = sprintf(_m('%1$s removed %2$s from the list %3$s.'),
                                 $tagger->getBestName(),
                                 $tagged->getBestName(),
                                 $plist->getBestName());
@@ -1100,10 +1117,11 @@ class OStatusPlugin extends Plugin
                                   $notice->id,
                                   common_date_iso8601(time()));
         $act->time    = time();
-        $act->title   = _m('Disfavor');
+        // TRANS: Title for unliking a remote notice.
+        $act->title   = _m('Unlike');
         // TRANS: Success message for remove a favorite notice through OStatus.
         // TRANS: %1$s is the unfavoring user's name, %2$s is URI to the no longer favored notice.
-        $act->content = sprintf(_m('%1$s marked notice %2$s as no longer a favorite.'),
+        $act->content = sprintf(_m('%1$s no longer likes %2$s.'),
                                $profile->getBestName(),
                                $notice->uri);
 
@@ -1219,7 +1237,7 @@ class OStatusPlugin extends Plugin
                                   common_date_iso8601(time()));
         $act->time    = time();
         // TRANS: Title for activity.
-        $act->title   = _m("Profile update");
+        $act->title   = _m('Profile update');
         // TRANS: Ping text for remote profile update through OStatus.
         // TRANS: %s is user that updated their profile.
         $act->content = sprintf(_m('%s has updated their profile page.'),
@@ -1265,7 +1283,8 @@ class OStatusPlugin extends Plugin
                                         array('nickname' => $profileUser->nickname));
                 $output->element('a', array('href' => $url,
                                             'class' => 'entity_remote_tag'),
-                                 _m('Tag'));
+                                  // TRANS: Link text for a user to list an OStatus user.
+                                 _m('List'));
                 $output->elementEnd('li');
             }
         }