use Friendica\App;
use Friendica\Content\OEmbed;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
$root = self::addHeader($doc, $owner, $author, $alternatelink, true);
/// @TODO This hook can't work anymore
- // call_hooks('atom_feed', $atom);
+ // Addon::callHooks('atom_feed', $atom);
if (!DBM::is_result($items) || $onlyheader) {
$atom = trim($doc->saveXML());
- call_hooks('atom_feed_end', $atom);
+ Addon::callHooks('atom_feed_end', $atom);
return $atom;
}
$atom = trim($doc->saveXML());
- call_hooks('atom_feed_end', $atom);
+ Addon::callHooks('atom_feed_end', $atom);
return $atom;
}
/* get site pubkey. this could be a new installation with no site keys*/
$pubkey = Config::get('system', 'site_pubkey');
if (! $pubkey) {
- $res = Crypto::newKeypair(2048);
+ $res = Crypto::newKeypair(1024);
Config::set('system', 'site_prvkey', $res['prvkey']);
Config::set('system', 'site_pubkey', $res['pubkey']);
}
XML::addElement($doc, $entry, "dfrn:diaspora_signature", $sign);
}
- XML::addElement($doc, $entry, "activity:verb", construct_verb($item));
+ XML::addElement($doc, $entry, "activity:verb", self::constructVerb($item));
if ($item['object-type'] != "") {
XML::addElement($doc, $entry, "activity:object-type", $item['object-type']);
switch ($rino_remote_version) {
case 1:
- case 2:
- // Force downgrade in case the remote server is still using the deprecated version 2
- $rino = 1;
- $rino_remote_version = 1;
-
$key = openssl_random_pseudo_bytes(16);
$data = self::aesEncrypt($postvars['data'], $key);
break;
logger("updating birthday: ".$birthday." for contact ".$contact["id"]);
- $bdtext = sprintf(t("%s\'s birthday"), $contact["name"]);
- $bdtext2 = sprintf(t("Happy Birthday %s"), " [url=".$contact["url"]."]".$contact["name"]."[/url]");
+ $bdtext = L10n::t("%s\'s birthday", $contact["name"]);
+ $bdtext2 = L10n::t("Happy Birthday %s", " [url=".$contact["url"]."]".$contact["name"]."[/url]");
$r = q(
"INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`)
return;
}
+
+ /**
+ * @brief Returns the activity verb
+ *
+ * @param array $item Item array
+ *
+ * @return string activity verb
+ */
+ private static function constructVerb(array $item)
+ {
+ if ($item['verb']) {
+ return $item['verb'];
+ }
+ return ACTIVITY_POST;
+ }
}