* Copyright (C) 2010, StatusNet, Inc.
*
* Title of module
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
* @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;
function moveActivity($act, $sink, $user, $remote)
{
if (empty($user)) {
- throw new Exception("No such user {$act->actor->id}");
+ // TRANS: Exception thrown if no user is provided. %s is a user ID.
+ throw new Exception(sprintf(_('No such user "%s".'),$act->actor->id));
}
switch ($act->verb) {
$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:
/**
* 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
*
* @return void
*/
-
protected function log($level, $message)
{
common_log($level, "ActivityMover: " . $message);