/**
* @file include/Smilies.php
* @brief This file contains the Smilies class which contains functions to handle smiles
+ *
+ * @todo Use the shortcodes from here:
+ * https://github.com/iamcal/emoji-data/blob/master/emoji_pretty.json?raw=true
*/
use Friendica\App;
$public = true;
$author_link = str_replace('acct:','',$children->header->author_id);
} else {
+ // This happens with posts from a relais
+ if (!$importer) {
+ logger("This is no private post in the old format", LOGGER_DEBUG);
+ return false;
+ }
$encrypted_header = json_decode(base64_decode($children->encrypted_header));
http_status_exit(500);
}
- $public = false;
-
if (($a->argc == 2) && ($a->argv[1] === 'public')) {
$public = true;
+ $importer = false;
} else {
+ $public = false;
if ($a->argc != 3 || $a->argv[1] !== 'users') {
http_status_exit(500);
logger('mod-diaspora: message is in the new format', LOGGER_DEBUG);
$msg = Diaspora::decode_raw($importer, $postdata);
} else {
- logger('mod-diaspora: message is in the old format', LOGGER_DEBUG);
+ logger('mod-diaspora: decode message in the old format', LOGGER_DEBUG);
$msg = Diaspora::decode($importer, $xml);
+
+ if ($public && !$msg) {
+ logger('mod-diaspora: decode message in the new format', LOGGER_DEBUG);
+ $msg = Diaspora::decode_raw($importer, $xml);
+ }
}
logger('mod-diaspora: decoded', LOGGER_DEBUG);