]> git.mxchange.org Git - friendica.git/commitdiff
populate wall element
authorMike Macgirvin <mike@macgirvin.com>
Fri, 10 Sep 2010 02:14:42 +0000 (19:14 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Fri, 10 Sep 2010 02:14:42 +0000 (19:14 -0700)
include/items.php
mod/dfrn_notify.php
mod/item.php

index 45116a3bdb07131a87cd6ec742b533e04b024a11..acb9f6a065b7948596ac4e263e56fd0a0233152e 100644 (file)
@@ -306,6 +306,7 @@ function post_remote($a,$arr) {
 
        if(! x($arr,'type'))
                $arr['type'] = 'remote';
+       $arr['wall'] = ((intval($arr['wall'])) ? 1 : 0);
        $arr['uri'] = notags(trim($arr['uri']));
        $arr['author-name'] = notags(trim($arr['author-name']));
        $arr['author-link'] = notags(trim($arr['author-link']));
index 7bcf2af09c6d8ef13b89f4549750b4a40b72ce35..a1a6ab7168d25ef6d97a13ff6827f2c7045e5157 100644 (file)
@@ -182,6 +182,7 @@ function dfrn_notify_post(&$a) {
                                // remote reply to our post. Import and then notify everybody else.
                                $datarray = get_atom_elements($item);
                                $datarray['type'] = 'remote-comment';
+                               $datarray['wall'] = 1;
                                $datarray['parent-uri'] = $parent_uri;
                                $datarray['uid'] = $importer['importer_uid'];
                                $datarray['contact-id'] = $importer['id'];
index 20a2488c51b869e2586abf3841694a06f03e3256..5e4f54ce0a92ebc6103b28aa11914079f5afa2a3 100644 (file)
@@ -96,23 +96,30 @@ function item_post(&$a) {
 
        if($post_type == 'net-comment') {
                if($parent_item !== null) {
-                       if($parent_item['type'] == 'remote')
+                       if($parent_item['type'] == 'remote') {
                                $post_type = 'remote-comment';
-                       else            
+                       } 
+                       else {          
                                $post_type = 'wall-comment';
+                       }
                }
        }
 
+       $wall = 0;
+       if($post_type == 'wall' || $post_type == 'wall-comment')
+               $wall = 1;
        $notify_type = (($parent) ? 'comment-new' : 'wall-new' );
 
        $uri = item_new_uri($a->get_hostname(),$profile_uid);
 
-       $r = q("INSERT INTO `item` (`uid`,`type`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`, 
+       $r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`, 
                `author-name`, `author-link`, `author-avatar`, `created`,
                `edited`, `changed`, `uri`, `title`, `body`, `location`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
                VALUES( %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
                intval($profile_uid),
                dbesc($post_type),
+               intval($wall),
                intval($contact_id),
                dbesc($contact_record['name']),
                dbesc($contact_record['url']),