]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/activitymover.php
Merge branch 'master' into testing
[quix0rs-gnu-social.git] / lib / activitymover.php
index 7032331104c41a3110cf2fce3dcb7494d8acd3a7..6d9d77b215e08be1a61d3c2ae2b0d2d026bbe7fd 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2010, StatusNet, Inc.
  *
  * Title of module
- * 
+ *
  * PHP version 5
  *
  * This program is free software: you can redistribute it and/or modify
@@ -44,14 +44,13 @@ if (!defined('STATUSNET')) {
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
  * @link      http://status.net/
  */
-
 class ActivityMover extends QueueHandler
 {
     function transport()
     {
         return 'actmove';
     }
-    
+
     function handle($data)
     {
         list ($act, $sink, $userURI, $remoteURI) = $data;
@@ -82,7 +81,8 @@ class ActivityMover extends QueueHandler
     function moveActivity($act, $sink, $user, $remote)
     {
         if (empty($user)) {
-            throw new Exception("No such user {$act->actor->id}");
+            // TRANS: Exception thrown if a non-existing user is provided. %s is a user ID.
+            throw new Exception(sprintf(_('No such user "%s".'),$act->actor->id));
         }
 
         switch ($act->verb) {
@@ -117,7 +117,7 @@ class ActivityMover extends QueueHandler
             $sink->postActivity($act);
             $group = User_group::staticGet('uri', $act->objects[0]->id);
             if (!empty($group)) {
-                Group_member::leave($group->id, $user->id);
+                $user->leaveGroup($group);
             }
             break;
         case ActivityVerb::FOLLOW:
@@ -152,7 +152,7 @@ class ActivityMover extends QueueHandler
 
     /**
      * Log some data
-     * 
+     *
      * Add a header for our class so we know who did it.
      *
      * @param int    $level   Log level, like LOG_ERR or LOG_INFO
@@ -160,7 +160,6 @@ class ActivityMover extends QueueHandler
      *
      * @return void
      */
-
     protected function log($level, $message)
     {
         common_log($level, "ActivityMover: " . $message);