]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
finish up ability to switch languages without function collision
[friendica.git] / include / items.php
index 6ded6f87c4cf8f0b01e0797e50e9e445d3a8a827..b433381a74c50faa895b87238765463e1b5a6172 100644 (file)
@@ -378,6 +378,10 @@ function get_atom_elements($feed,$item) {
        if($dguid)
                $res['guid'] = unxmlify($dguid[0]['data']);
 
+       $bm = $item->get_item_tags(NAMESPACE_DFRN,'bookmark');
+       if($bm)
+               $res['bookmark'] = ((unxmlify($bm[0]['data']) === 'true') ? 1 : 0);
+
 
        /**
         * If there's a copy of the body content which is guaranteed to have survived mangling in transit, use it.
@@ -713,6 +717,7 @@ function item_store($arr,$force_parent = false) {
        $arr['owner-avatar']  = ((x($arr,'owner-avatar'))  ? notags(trim($arr['owner-avatar']))  : '');
        $arr['created']       = ((x($arr,'created') !== false) ? datetime_convert('UTC','UTC',$arr['created']) : datetime_convert());
        $arr['edited']        = ((x($arr,'edited')  !== false) ? datetime_convert('UTC','UTC',$arr['edited'])  : datetime_convert());
+       $arr['commented']     = datetime_convert();
        $arr['received']      = datetime_convert();
        $arr['changed']       = datetime_convert();
        $arr['title']         = ((x($arr,'title'))         ? notags(trim($arr['title']))         : '');
@@ -733,6 +738,7 @@ function item_store($arr,$force_parent = false) {
        $arr['deny_cid']      = ((x($arr,'deny_cid'))      ? trim($arr['deny_cid'])              : '');
        $arr['deny_gid']      = ((x($arr,'deny_gid'))      ? trim($arr['deny_gid'])              : '');
        $arr['private']       = ((x($arr,'private'))       ? intval($arr['private'])             : 0 );
+       $arr['bookmark']      = ((x($arr,'bookmark'))      ? intval($arr['bookmark'])            : 0 );
        $arr['body']          = ((x($arr,'body'))          ? trim($arr['body'])                  : '');
        $arr['tag']           = ((x($arr,'tag'))           ? notags(trim($arr['tag']))           : '');
        $arr['attach']        = ((x($arr,'attach'))        ? notags(trim($arr['attach']))        : '');
@@ -860,6 +866,14 @@ function item_store($arr,$force_parent = false) {
                intval($current_post)
        );
 
+       // update the commented timestamp on the parent
+
+       q("UPDATE `item` set `commented` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1",
+               dbesc(datetime_convert()),
+               dbesc(datetime_convert()),
+               intval($parent_id)
+       );
+
        if($dsprsig) {
                q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
                        intval($current_post),
@@ -1706,6 +1720,8 @@ function atom_entry($item,$type,$author,$owner,$comment = false) {
 
        if($item['extid'])
                $o .= '<dfrn:extid>' . xmlify($item['extid']) . '</dfrn:extid>' . "\r\n";
+       if($item['bookmark'])
+               $o .= '<dfrn:bookmark>true</dfrn:bookmark>' . "\r\n";
 
        if($item['app'])
                $o .= '<statusnet:notice_info local_id="' . $item['id'] . '" source="' . xmlify($item['app']) . '" ></statusnet:notice_info>' . "\r\n";