aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorMichael Vogel <icarus@dabo.de>2012-05-19 14:04:24 +0200
committerMichael Vogel <icarus@dabo.de>2012-05-19 14:04:24 +0200
commit9a940786c18c1c2bd772aec93f1828f67dc45667 (patch)
tree54114a005e74c8a6d8bad8a490e1d1e41bc4178f /include/items.php
parentf2c0c40f6e488f1a8e62bda9449b28115f343cac (diff)
parent513ef2410d9b892c8ebcb7ceac96b97023c3b5a5 (diff)
downloadvolse-hubzilla-9a940786c18c1c2bd772aec93f1828f67dc45667.tar.gz
volse-hubzilla-9a940786c18c1c2bd772aec93f1828f67dc45667.tar.bz2
volse-hubzilla-9a940786c18c1c2bd772aec93f1828f67dc45667.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/items.php')
-rw-r--r--include/items.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/include/items.php b/include/items.php
index 129499967..91c9056fe 100644
--- a/include/items.php
+++ b/include/items.php
@@ -959,6 +959,8 @@ function tag_deliver($uid,$item_id) {
return;
$community_page = (($u[0]['page-flags'] == PAGE_COMMUNITY) ? true : false);
+ $prvgroup = (($u[0]['page-flags'] == PAGE_PRVGROUP) ? true : false);
+
$i = q("select * from item where id = %d and uid = %d limit 1",
intval($item_id),
@@ -1008,9 +1010,10 @@ function tag_deliver($uid,$item_id) {
'otype' => 'item'
));
- if(! $community_page)
+ if((! $community_page) && (! prvgroup))
return;
+
// tgroup delivery - setup a second delivery chain
// prevent delivery looping - only proceed
// if the message originated elsewhere and is a top-level post
@@ -1031,8 +1034,11 @@ function tag_deliver($uid,$item_id) {
$private = ($u[0]['allow_cid'] || $u[0]['allow_gid'] || $u[0]['deny_cid'] || $u[0]['deny_gid']) ? 1 : 0;
- q("update item set wall = 1, origin = 1, forum_mode = 1, `owner-name` = '%s', `owner-link` = '%s', `owner-avatar` = '%s',
+ $forum_mode = (($prvgroup) ? 2 : 1);
+
+ q("update item set wall = 1, origin = 1, forum_mode = %d, `owner-name` = '%s', `owner-link` = '%s', `owner-avatar` = '%s',
`private` = %d, `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' where id = %d limit 1",
+ intval($forum_mode),
dbesc($c[0]['name']),
dbesc($c[0]['url']),
dbesc($c[0]['thumb']),
@@ -2194,7 +2200,7 @@ function local_delivery($importer,$data) {
if($is_reply) {
$community = false;
- if($importer['page-flags'] == PAGE_COMMUNITY) {
+ if($importer['page-flags'] == PAGE_COMMUNITY || $importer['page-flags'] == PAGE_PRVGROUP ) {
$sql_extra = '';
$community = true;
logger('local_delivery: possible community reply');
@@ -2221,8 +2227,8 @@ function local_delivery($importer,$data) {
if($r && count($r))
$is_a_remote_comment = true;
- // Does this have the characteristics of a community comment?
- // If it's a reply to a wall post on a community page it's a
+ // Does this have the characteristics of a community or private group comment?
+ // If it's a reply to a wall post on a community/prvgroup page it's a
// valid community comment. Also forum_mode makes it valid for sure.
// If neither, it's not.
@@ -2711,6 +2717,12 @@ function new_follower($importer,$contact,$datarray,$item,$sharing = false) {
);
$a = get_app();
if(count($r)) {
+
+ if(intval($r[0]['def_gid'])) {
+ require_once('include/group.php');
+ group_add_member($r[0]['uid'],'',$contact_record['id'],$r[0]['def_gid']);
+ }
+
if(($r[0]['notify-flags'] & NOTIFY_INTRO) && ($r[0]['page-flags'] == PAGE_NORMAL)) {
$email_tpl = get_intltext_template('follow_notify_eml.tpl');
$email = replace_macros($email_tpl, array(