]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/ActivityModeration/classes/Deleted_notice.php
Some obvious bug fixes for i18n
[quix0rs-gnu-social.git] / plugins / ActivityModeration / classes / Deleted_notice.php
index 76674d9bec63d31dc60dd1f77c9ba10477eae9f0..7a0c6a7f050b40a74a9003ee4ffec9da5a66a731 100644 (file)
@@ -78,7 +78,12 @@ class Deleted_notice extends Managed_DataObject
         $act->actor = $actor->asActivityObject();
         $act->target = new ActivityObject();    // We don't save the notice object, as it's supposed to be removed!
         $act->target->id = $notice->getUri();
-        $act->target->type = $notice->getObjectType();
+        try {
+            $act->target->type = $notice->getObjectType();
+        } catch (NoObjectTypeException $e) {
+            // This could be for example an RSVP which is a verb and carries no object-type
+            $act->target->type = null;
+        }
         $act->objects = array(clone($act->target));
 
         $url = $notice->getUrl();
@@ -146,9 +151,11 @@ class Deleted_notice extends Managed_DataObject
         $actobj->title = ActivityUtils::verbToTitle($actobj->verb);
 
         $actor = $this->getActor();
+        // TRANS: Notice HTML content of a deleted notice. %1$s is the
+        // TRANS: actor's URL, %2$s its "fancy name" and %3$s the notice URI.
         $actobj->content = sprintf(_m('<a href="%1$s">%2$s</a> deleted notice {{%3$s}}.'),
                             htmlspecialchars($actor->getUrl()),
-                            htmlspecialchars($actor->getBestName()),
+                            htmlspecialchars($actor->getFancyName()),
                             htmlspecialchars($this->getUri())
                            );
 
@@ -188,6 +195,7 @@ class Deleted_notice extends Managed_DataObject
             echo "\nFound old $table table, upgrading it to add 'act_created' field...";
 
             $schemadef['fields']['act_created'] = array('type' => 'datetime', 'not null' => true, 'description' => 'datetime the notice record was created');
+            $schemadef['fields']['uri']['length'] = 191;    // we likely don't have to discover too long keys here
             $schema->ensureTable($table, $schemadef);
 
             $deleted = new Deleted_notice();